diff --git a/COPYING b/COPYING index 76c46d4ed180e..dcc0fd2f41f4b 100644 --- a/COPYING +++ b/COPYING @@ -11,7 +11,7 @@ distributions. MAME -Copyright (c) 1997-2023 MAMEdev and contributors +Copyright (c) 1997-2024 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 version 2, as provided diff --git a/README.md b/README.md index 11e1a799e2ade..c8d61bbe84daa 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ is required to use the "MAME" name, logo, or wordmark. - Copyright (C) 1997-2021 MAMEDev and contributors + Copyright (c) 1997-2024 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 version 2, as provided in diff --git a/android-project/LICENSE b/android-project/LICENSE index e5929c3bc95ad..1c4f0fe4393c4 100644 --- a/android-project/LICENSE +++ b/android-project/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 1997-2023, MAMEdev and contributors +Copyright (c) 1997-2024, MAMEdev and contributors 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 395d388956360..ab0dbdce70ed3 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/docs/source/conf.py b/docs/source/conf.py index e7f52cf5e9eba..e932d633316ce 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,16 +56,16 @@ # General information about the project. project = u'MAME Documentation' -copyright = u'1997-2023, MAMEdev and contributors' +copyright = u'1997-2024, MAMEdev and contributors' # 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.262' +version = '0.263' # The full version, including alpha/beta/rc tags. -release = '0.262' +release = '0.263' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst index 51c8d408fd844..f458f34af0860 100644 --- a/docs/source/initialsetup/compilingmame.rst +++ b/docs/source/initialsetup/compilingmame.rst @@ -559,6 +559,9 @@ Optional features TOOLS Set to **1** to build additional tools along with the emulator, including **unidasm**, **chdman**, **romcmp**, and **srcclean**. +EMULATOR + Set to **0** along with **TOOLS=1** to build *only* the tools and not the + main MAME emulator itself. NO_OPENGL Set to **1** to disable building the OpenGL video output module. NO_USE_PORTAUDIO diff --git a/docs/source/license.rst b/docs/source/license.rst index e58d21b6dea23..aaffd97a1694d 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -12,7 +12,7 @@ would encourage new contributors to distribute files under this license. 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-2023 MAMEDev and contributors + Copyright (c) 1997-2024 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/whatis.rst b/docs/source/whatis.rst index b7b9e11c4a942..e6e93382ea300 100644 --- a/docs/source/whatis.rst +++ b/docs/source/whatis.rst @@ -19,7 +19,7 @@ that were its initial focus. | | **MAME®** -| **Copyright © 1997-2023 MAMEdev and contributors** +| **Copyright © 1997-2024 MAMEdev and contributors** | **MAME is a registered trademark of Gregory Ember** | diff --git a/hash/apple2_flop_misc.xml b/hash/apple2_flop_misc.xml index 6346a20753157..00dc839179b49 100644 --- a/hash/apple2_flop_misc.xml +++ b/hash/apple2_flop_misc.xml @@ -789,7 +789,8 @@ Generated by SLIST 0.2.1 2019 4AM - + + @@ -938,7 +944,8 @@ Generated by SLIST 0.2.1 Anti-M (version 1.6) 2019 4AM - + + @@ -967,11 +975,12 @@ Generated by SLIST 0.2.1 - + Anti-M (version 1.8) 2020 4AM - + + + + + + + + + + + + Anti-M (version 2.0) + 2023 + 4AM + + + + + + + + + + + + + Anti-M (version 2.1) + 2024 + 4AM + + + + + + + + + + + + + Anti-M (version 2.2) + 2024 + 4AM + + + + + + + + + + Ankh diff --git a/hash/bbc_rom.xml b/hash/bbc_rom.xml index 03b315f9566dd..3f8af86232d8b 100644 --- a/hash/bbc_rom.xml +++ b/hash/bbc_rom.xml @@ -497,7 +497,7 @@ license:CC0-1.0 - Advanced Disc Toolkit 1.77 [cracked] + Advanced Disc Toolkit 1.77 (cracked) 1986 Advanced Computer Products @@ -2057,7 +2057,7 @@ license:CC0-1.0 - BeebFont [alt] + BeebFont (alt) 1984 Watford Electronics @@ -3903,7 +3903,7 @@ license:CC0-1.0 - Digitiser 1.00 [alt] + Digitiser 1.00 (alt) 1985 Watford Electronics @@ -6169,7 +6169,7 @@ license:CC0-1.0 - Inter-Word 1.02 [hack] + Inter-Word 1.02 (hack) 1986 Computer Concepts @@ -6185,7 +6185,7 @@ license:CC0-1.0 - Inter-Word 1.O2 [alt1] + Inter-Word 1.O2 (alt 1) 1986 Computer Concepts @@ -6197,7 +6197,7 @@ license:CC0-1.0 - Inter-Word 1.O2 [alt2] + Inter-Word 1.O2 (alt 2) 1986 Computer Concepts @@ -7057,7 +7057,7 @@ license:CC0-1.0 - Meta Assembler 2.13R [alt] + Meta Assembler 2.13R (alt) 1985 Crash Barrier @@ -7681,7 +7681,7 @@ license:CC0-1.0 - Multi-FORTH 83 [alt] + Multi-FORTH 83 (alt) 1984 Skywave @@ -8967,7 +8967,7 @@ license:CC0-1.0 - Ramrod MS4.00c [alt] + Ramrod MS4.00c (alt) 1987 Clares @@ -10561,7 +10561,7 @@ license:CC0-1.0 - Solidisk DFS 2.2k Issue 2 [hack] + Solidisk DFS 2.2k Issue 2 (hack) 1986 Solidisk diff --git a/hash/coco_cart.xml b/hash/coco_cart.xml index ae5bbeb075653..230c0e818dc84 100644 --- a/hash/coco_cart.xml +++ b/hash/coco_cart.xml @@ -1119,7 +1119,7 @@ Laggy keyboard presses (verify) - + diff --git a/hash/fmtowns_cd.xml b/hash/fmtowns_cd.xml index b91ff7dfc18a6..e7d7dea93dada 100644 --- a/hash/fmtowns_cd.xml +++ b/hash/fmtowns_cd.xml @@ -1479,7 +1479,7 @@ User/save disks that can be created from the game itself are not included. - + - The 4th Unit 5 - D-Again (Demo) + The 4th Unit 5 - D-Again (demo) 1990 データウエスト (Data West) @@ -1566,7 +1566,7 @@ User/save disks that can be created from the game itself are not included. - + - + - Taito Chase H.Q. (Demo) + Taito Chase H.Q. (demo) 1991 ビング (Ving) @@ -7448,7 +7448,7 @@ User/save disks that can be created from the game itself are not included. --> - Emit Vol. 1 - Toki no Maigo (Demo) + Emit Vol. 1 - Toki no Maigo (demo) 1994 光栄 (Koei) @@ -13244,7 +13244,7 @@ User/save disks that can be created from the game itself are not included. - + - Indiana Jones and the Last Crusade (Pre-Release Version) + Indiana Jones and the Last Crusade (pre-release version) 1990 富士通 (Fujitsu) @@ -17409,7 +17409,7 @@ User/save disks that can be created from the game itself are not included. - + - Megamorph (Demo) + Megamorph (demo) 1994 富士通 (Fujitsu) @@ -22807,7 +22807,7 @@ User/save disks that can be created from the game itself are not included. - + - Psychic Detective Series Vol. 2 - Memories (Demo) + Psychic Detective Series Vol. 2 - Memories (demo) 1989 データウエスト (Data West) @@ -22909,7 +22909,7 @@ User/save disks that can be created from the game itself are not included. - + - + - Psychic Detective Series Vol. 4 - Orgel (Demo) + Psychic Detective Series Vol. 4 - Orgel (demo) 1991 データウエスト (Data West) @@ -23055,7 +23055,7 @@ User/save disks that can be created from the game itself are not included. - + - + - Psychic Detective Series Final - Solitude Gekan (Demo) + Psychic Detective Series Final - Solitude Gekan (demo) 1993 データウエスト (Data West) @@ -25035,13 +25035,13 @@ User/save disks that can be created from the game itself are not included. - + - Sherlock Holmes - Consulting Detective (Demo) + Sherlock Holmes - Consulting Detective (demo) 1990 富士通 (Fujitsu) @@ -25506,7 +25506,7 @@ User/save disks that can be created from the game itself are not included. - + - Super Street Fighter II - The New Challengers (Sample Disc) + Super Street Fighter II - The New Challengers (sample disc) 1994 カプコン (Capcom) diff --git a/hash/gcslottv.xml b/hash/gcslottv.xml index ef028f02552ef..1576f94bd102e 100644 --- a/hash/gcslottv.xml +++ b/hash/gcslottv.xml @@ -21,7 +21,7 @@ license:CC0-1.0 - + Ginginmaru TV 2002 Sammy @@ -45,6 +45,19 @@ license:CC0-1.0 + + + Jū-ō Junior + 2002 + Sammy + + + + + + + + Mōjū-ō TV 2002 diff --git a/hash/ibm5170_cdrom.xml b/hash/ibm5170_cdrom.xml index efb9dd624b4c1..6d7885069e760 100644 --- a/hash/ibm5170_cdrom.xml +++ b/hash/ibm5170_cdrom.xml @@ -7092,7 +7092,7 @@ Contains software drivers for a ScanExpress 6000SP Flatbed Scanner, SCSI i/f S3 Apple Legacy Recovery 1998 Apple - - + + @@ -87,8 +88,8 @@ PPC750 - PowerPC 750 (G3) CPU Mac OS 7.6 (US English) 1997 Apple - - + + @@ -99,8 +100,8 @@ PPC750 - PowerPC 750 (G3) CPU Mac OS 7.6 (German) 1997 Apple - - + + @@ -111,8 +112,8 @@ PPC750 - PowerPC 750 (G3) CPU Mac OS 7.6.1 (US English) 1997 Apple - - + + diff --git a/hash/pc1512_hdd.xml b/hash/pc1512_hdd.xml index f23c5ac154bbb..176666301966c 100644 --- a/hash/pc1512_hdd.xml +++ b/hash/pc1512_hdd.xml @@ -10,7 +10,7 @@ license:CC0-1.0 1986 Amstrad - + diff --git a/hash/scv.xml b/hash/scv.xml index 7011d9ecca27f..c69cbfe68e829 100644 --- a/hash/scv.xml +++ b/hash/scv.xml @@ -89,10 +89,12 @@ Information found at http://www.rhod.fr/yeno_epoch.html 1985 Epoch - + + + diff --git a/language/Afrikaans/strings.po b/language/Afrikaans/strings.po index 672f42b653413..a0e9f66b27196 100644 --- a/language/Afrikaans/strings.po +++ b/language/Afrikaans/strings.po @@ -1,5 +1,5 @@ # Afrikaans translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Albanian/strings.po b/language/Albanian/strings.po index 5e0cf2e87cef1..7835e571533da 100644 --- a/language/Albanian/strings.po +++ b/language/Albanian/strings.po @@ -1,5 +1,5 @@ # Albanian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Arabic/strings.po b/language/Arabic/strings.po index 007cf18aeb32e..e457ebcd3801e 100644 --- a/language/Arabic/strings.po +++ b/language/Arabic/strings.po @@ -1,5 +1,5 @@ # Arabic translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Basque/strings.po b/language/Basque/strings.po index e9a3cb374d67c..44750cd65ff34 100644 --- a/language/Basque/strings.po +++ b/language/Basque/strings.po @@ -1,6 +1,6 @@ # Basque translations for MAME package # MAME paketearen Ingelesezko itzulpena. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Belarusian/strings.po b/language/Belarusian/strings.po index 8dc4504d9e7ce..152229ad9cb43 100644 --- a/language/Belarusian/strings.po +++ b/language/Belarusian/strings.po @@ -1,6 +1,6 @@ # Belarusian translations for MAME package # Беларускі пераклад для MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Bosnian/strings.po b/language/Bosnian/strings.po index 0201a3c9bb58c..f185ef3d29cf8 100644 --- a/language/Bosnian/strings.po +++ b/language/Bosnian/strings.po @@ -1,5 +1,5 @@ # Bosnian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Bulgarian/strings.po b/language/Bulgarian/strings.po index 94c1824fbe501..ace6d27006b0a 100644 --- a/language/Bulgarian/strings.po +++ b/language/Bulgarian/strings.po @@ -1,6 +1,6 @@ # Bulgarian translations for MAME package # Български превод за пакет MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Burmese/strings.po b/language/Burmese/strings.po index d4568f94f6882..822ef9dbec242 100644 --- a/language/Burmese/strings.po +++ b/language/Burmese/strings.po @@ -1,5 +1,5 @@ # Burmese translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Catalan/strings.po b/language/Catalan/strings.po index 998bd9edb186f..6b461187c209a 100644 --- a/language/Catalan/strings.po +++ b/language/Catalan/strings.po @@ -1,5 +1,5 @@ # Catalan translations for MAME package -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Jordi Mallach , 2016 # diff --git a/language/Chinese_Simplified/strings.po b/language/Chinese_Simplified/strings.po index 26b427761a62e..df088f0eb093f 100644 --- a/language/Chinese_Simplified/strings.po +++ b/language/Chinese_Simplified/strings.po @@ -1,6 +1,6 @@ # Chinese Simplified translations for MAME package # MAME 套件的简体中文翻译 -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Chinese_Traditional/strings.po b/language/Chinese_Traditional/strings.po index 97cc17cde13eb..fd00555eb84a4 100644 --- a/language/Chinese_Traditional/strings.po +++ b/language/Chinese_Traditional/strings.po @@ -1,6 +1,6 @@ # Chinese Traditional translations for MAME package # MAME 套件的正體中文翻譯 -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Croatian/strings.po b/language/Croatian/strings.po index 99652d822e205..beb5ca6a4686e 100644 --- a/language/Croatian/strings.po +++ b/language/Croatian/strings.po @@ -1,5 +1,5 @@ # Croatian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Czech/strings.po b/language/Czech/strings.po index 0013bf53046ef..4712d4d2dd1f8 100644 --- a/language/Czech/strings.po +++ b/language/Czech/strings.po @@ -1,6 +1,6 @@ # Czech translations for MAME package. # České preklady pre balík MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Danish/strings.po b/language/Danish/strings.po index bb2e2399c2c82..0e2687a59d83b 100644 --- a/language/Danish/strings.po +++ b/language/Danish/strings.po @@ -1,6 +1,6 @@ # Danish translations for MAME package # Danske oversættelser for pakke MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Dutch/strings.po b/language/Dutch/strings.po index a35a1a1e680ad..37cdb5af17370 100644 --- a/language/Dutch/strings.po +++ b/language/Dutch/strings.po @@ -1,6 +1,6 @@ # Dutch translations for MAME package # Nederlandse vertalingen voor het pakket MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/English/strings.po b/language/English/strings.po index bd9382398c15d..397e5caa9e997 100644 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -1,5 +1,5 @@ # English translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Estonian/strings.po b/language/Estonian/strings.po index 9367c5f08b93a..aa72d7caa4a3d 100644 --- a/language/Estonian/strings.po +++ b/language/Estonian/strings.po @@ -1,5 +1,5 @@ # Estonian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Finnish/strings.po b/language/Finnish/strings.po index 2c5023df25a40..945ff6c0f7110 100644 --- a/language/Finnish/strings.po +++ b/language/Finnish/strings.po @@ -1,6 +1,6 @@ # Finnish translations for MAME package # Suomenkielinen käännös MAME-paketille. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/French/strings.po b/language/French/strings.po index 5bf9cb542f51d..09bf6802364bd 100644 --- a/language/French/strings.po +++ b/language/French/strings.po @@ -1,5 +1,5 @@ # Traductions françaises du paquet MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/French_Belgium/strings.po b/language/French_Belgium/strings.po index b518608f2180e..0370553390c82 100644 --- a/language/French_Belgium/strings.po +++ b/language/French_Belgium/strings.po @@ -1,5 +1,5 @@ # Traductions françaises du paquet MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/French_Canada/strings.po b/language/French_Canada/strings.po index 7e2a725e8446c..d7628254e4bb9 100644 --- a/language/French_Canada/strings.po +++ b/language/French_Canada/strings.po @@ -1,6 +1,6 @@ # French translations for MAME package # Traductions françaises du paquet MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Georgian/strings.po b/language/Georgian/strings.po index a000af04f3949..d15a66f7c17a9 100644 --- a/language/Georgian/strings.po +++ b/language/Georgian/strings.po @@ -1,5 +1,5 @@ # Georgian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/German/strings.po b/language/German/strings.po index 3d45321b11806..5acd563396371 100644 --- a/language/German/strings.po +++ b/language/German/strings.po @@ -1,6 +1,6 @@ # German translations for MAME package # German translation for MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Greek/strings.po b/language/Greek/strings.po index 8c7a70a640ef8..824367ff84b1a 100644 --- a/language/Greek/strings.po +++ b/language/Greek/strings.po @@ -1,5 +1,5 @@ # Greek translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. msgid "" diff --git a/language/Hebrew/strings.po b/language/Hebrew/strings.po index 5e84de0633e2e..83afca11730cf 100644 --- a/language/Hebrew/strings.po +++ b/language/Hebrew/strings.po @@ -1,5 +1,5 @@ # Hebrew translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Hindi/strings.po b/language/Hindi/strings.po index 89a9f0d78d8a0..1a82de729e0f5 100644 --- a/language/Hindi/strings.po +++ b/language/Hindi/strings.po @@ -1,5 +1,5 @@ # Hindi translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Indonesian/strings.po b/language/Indonesian/strings.po index c408b0fb3b176..e741d430fb5ca 100644 --- a/language/Indonesian/strings.po +++ b/language/Indonesian/strings.po @@ -1,6 +1,6 @@ # Indonesian translations for MAME package # Terjemahan bahasa inggris untuk paket MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Italian/strings.po b/language/Italian/strings.po index 3a17975c6b92e..80366bce03d74 100644 --- a/language/Italian/strings.po +++ b/language/Italian/strings.po @@ -1,4 +1,4 @@ -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Japanese/strings.po b/language/Japanese/strings.po index a349f286f8e26..14352192da25f 100644 --- a/language/Japanese/strings.po +++ b/language/Japanese/strings.po @@ -1,5 +1,5 @@ # MAME パッケージに対する英訳. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Korean/strings.po b/language/Korean/strings.po index f7bc6b3f7a4b7..93490f003f7a8 100644 --- a/language/Korean/strings.po +++ b/language/Korean/strings.po @@ -1,6 +1,6 @@ # Korean translations for MAME package # MAME 패키지에 대한 한국어 번역문. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Latvian/strings.po b/language/Latvian/strings.po index 4fc7d0521b0b6..f473faa0c6602 100644 --- a/language/Latvian/strings.po +++ b/language/Latvian/strings.po @@ -1,5 +1,5 @@ # Latvian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Lithuanian/strings.po b/language/Lithuanian/strings.po index 506f2dd8119d6..621da97bf3fd1 100644 --- a/language/Lithuanian/strings.po +++ b/language/Lithuanian/strings.po @@ -1,5 +1,5 @@ # Lithuanian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Macedonian/strings.po b/language/Macedonian/strings.po index 0668e7ac2fa35..e81bf6808cbc6 100644 --- a/language/Macedonian/strings.po +++ b/language/Macedonian/strings.po @@ -1,5 +1,5 @@ # Macedonian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Norwegian/strings.po b/language/Norwegian/strings.po index 705d48be15f1b..a819f123e8320 100644 --- a/language/Norwegian/strings.po +++ b/language/Norwegian/strings.po @@ -1,5 +1,5 @@ # Norwegian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Persian/strings.po b/language/Persian/strings.po index f55be5cabbccb..0e072148f741d 100644 --- a/language/Persian/strings.po +++ b/language/Persian/strings.po @@ -1,5 +1,5 @@ # Persian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Polish/strings.po b/language/Polish/strings.po index 77187dc88c362..e7fba3a22beec 100644 --- a/language/Polish/strings.po +++ b/language/Polish/strings.po @@ -1,6 +1,6 @@ # Polish translations for MAME package # Polskie tłumaczenia dla pakietu MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Portuguese/strings.po b/language/Portuguese/strings.po index c64b6d6d46de3..8f03f3261b5a2 100644 --- a/language/Portuguese/strings.po +++ b/language/Portuguese/strings.po @@ -1,5 +1,5 @@ # Portuguese translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Portuguese_Brazil/strings.po b/language/Portuguese_Brazil/strings.po index 9efe627c42a40..1cb4054fcff03 100644 --- a/language/Portuguese_Brazil/strings.po +++ b/language/Portuguese_Brazil/strings.po @@ -1,6 +1,6 @@ # Brazilian Portuguese translation for the MAME Project. # Tradução pro Português Brasileiro para o Projeto MAME. -# Copyright (C) 1997-2023 MAMEDev and contributors +# Copyright (C) 1997-2024 MAMEDev and contributors # This file is distributed under the same license as the MAME Project. # Automatically generated, 2023. # diff --git a/language/Romanian/strings.po b/language/Romanian/strings.po index f068f5a6065af..ced43f14cc4b0 100644 --- a/language/Romanian/strings.po +++ b/language/Romanian/strings.po @@ -1,6 +1,6 @@ # Romanian translations for MAME package # Traducerea în limba românã pentru pachetul MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Russian/strings.po b/language/Russian/strings.po index 1fa66968aa5f5..c2c20236de864 100644 --- a/language/Russian/strings.po +++ b/language/Russian/strings.po @@ -1,6 +1,6 @@ # Russian translations for MAME package # Русский перевод для пакета MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Serbian/strings.po b/language/Serbian/strings.po index 55e09de93773b..f8b5c7fb8cda8 100644 --- a/language/Serbian/strings.po +++ b/language/Serbian/strings.po @@ -1,5 +1,5 @@ # Serbian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Serbian_Cyrillic/strings.po b/language/Serbian_Cyrillic/strings.po index 4608059945d07..a531adeaafaa0 100644 --- a/language/Serbian_Cyrillic/strings.po +++ b/language/Serbian_Cyrillic/strings.po @@ -1,5 +1,5 @@ # Serbian translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Slovak/strings.po b/language/Slovak/strings.po index f65cac147632c..9e4b07e6ad04f 100644 --- a/language/Slovak/strings.po +++ b/language/Slovak/strings.po @@ -1,6 +1,6 @@ # Slovak translations for MAME package # Slovenské preklady pre balík MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Slovenian/strings.po b/language/Slovenian/strings.po index cffda959f21c2..939fc6d92fb34 100644 --- a/language/Slovenian/strings.po +++ b/language/Slovenian/strings.po @@ -1,6 +1,6 @@ # Slovenian translations for MAME package # Slovenski prevodi paketa MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Spanish/strings.po b/language/Spanish/strings.po index f6da1167e97b9..a291692f571c2 100644 --- a/language/Spanish/strings.po +++ b/language/Spanish/strings.po @@ -1,6 +1,6 @@ # Spanish translations for MAME package # Traducciones al español para el paquete MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # A. Viloria, 2016-2018. diff --git a/language/Spanish_Mexico/strings.po b/language/Spanish_Mexico/strings.po index eb49aab269c44..6d4594b2c5450 100644 --- a/language/Spanish_Mexico/strings.po +++ b/language/Spanish_Mexico/strings.po @@ -1,6 +1,6 @@ # Spanish translations for MAME package # Traducciones al español para el paquete MAME. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Swedish/strings.po b/language/Swedish/strings.po index 71a42eec0cfaa..09763a226216a 100644 --- a/language/Swedish/strings.po +++ b/language/Swedish/strings.po @@ -1,5 +1,5 @@ # Swedish translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Thai/strings.po b/language/Thai/strings.po index 8539846206df6..ad309fe38cb4e 100644 --- a/language/Thai/strings.po +++ b/language/Thai/strings.po @@ -1,5 +1,5 @@ # Thai translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Turkish/strings.po b/language/Turkish/strings.po index 61c40d44d2c72..f16450a33d324 100644 --- a/language/Turkish/strings.po +++ b/language/Turkish/strings.po @@ -1,6 +1,6 @@ # Turkish translations for MAME package # MAME paketi için Türkçe çeviriler. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Ukrainian/strings.po b/language/Ukrainian/strings.po index 96a30ebc2ca74..d41319d812b0d 100644 --- a/language/Ukrainian/strings.po +++ b/language/Ukrainian/strings.po @@ -1,6 +1,6 @@ # Ukrainian translations for MAME package. # Український переклад MAME-пакета -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/language/Vietnamese/strings.po b/language/Vietnamese/strings.po index 2ba9ed917e9db..ae82551a21cf4 100644 --- a/language/Vietnamese/strings.po +++ b/language/Vietnamese/strings.po @@ -1,5 +1,5 @@ # Vietnamese translations for MAME package. -# Copyright (C) 1997-2023 MAMEdev and contributors +# Copyright (C) 1997-2024 MAMEdev and contributors # This file is distributed under the same license as the MAME package. # Automatically generated, 2023. # diff --git a/makefile b/makefile index 00d27444465f9..3567ccd3f7d23 100644 --- a/makefile +++ b/makefile @@ -1578,7 +1578,7 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.262"' > $@ + @echo '#define BARE_BUILD_VERSION "0.263"' > $@ @echo '#define BARE_VCS_REVISION "$(NEW_GIT_VERSION)"' >> $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char bare_vcs_revision[];' >> $@ @@ -1588,7 +1588,7 @@ $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) @echo 'const char build_version[] = BARE_BUILD_VERSION " (" BARE_VCS_REVISION ")";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.262" > $@ + @echo #define BARE_BUILD_VERSION "0.263" > $@ @echo #define BARE_VCS_REVISION "$(NEW_GIT_VERSION)" >> $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char bare_vcs_revision[]; >> $@ diff --git a/scripts/build/verinfo.py b/scripts/build/verinfo.py index 4b05d86040643..6cbc66813eaac 100644 --- a/scripts/build/verinfo.py +++ b/scripts/build/verinfo.py @@ -23,7 +23,7 @@ def parse_args(): def extract_version(verinfo): - pattern = re.compile('\s+BARE_BUILD_VERSION\s+"(([^."]+)\.([^."]+))"') + pattern = re.compile(r'\s+BARE_BUILD_VERSION\s+"(([^."]+)\.([^."]+))"') for line in verinfo: match = pattern.search(line) if match: @@ -122,7 +122,7 @@ def extract_version(verinfo): original=options.executable, product=('MAME' if options.target == 'mame' else options.target), rdns=('org.mamedev.' + internal), - copyright='\u00a9 1997-2023 MAMEdev and contributors', + copyright='\u00a9 1997-2024 MAMEdev and contributors', winfileflags=('0x0L' if verbuild == '0' else 'VS_FF_PRERELEASE'), resources=(options.resources or 'mame.rc')) diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 23aed10441e4a..e7b5a6150ea07 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2075,6 +2075,8 @@ if (BUSES["MC10"]~=null) then MAME_DIR .. "src/devices/bus/mc10/mc10_cart.h", MAME_DIR .. "src/devices/bus/mc10/mcx128.cpp", MAME_DIR .. "src/devices/bus/mc10/mcx128.h", + MAME_DIR .. "src/devices/bus/mc10/multiports_ext.cpp", + MAME_DIR .. "src/devices/bus/mc10/multiports_ext.h", MAME_DIR .. "src/devices/bus/mc10/pak.cpp", MAME_DIR .. "src/devices/bus/mc10/pak.h", MAME_DIR .. "src/devices/bus/mc10/ram.cpp", @@ -2572,6 +2574,8 @@ if (BUSES["VCS_CTRL"]~=null) then files { MAME_DIR .. "src/devices/bus/vcs_ctrl/ctrl.cpp", MAME_DIR .. "src/devices/bus/vcs_ctrl/ctrl.h", + MAME_DIR .. "src/devices/bus/vcs_ctrl/cx85.cpp", + MAME_DIR .. "src/devices/bus/vcs_ctrl/cx85.h", MAME_DIR .. "src/devices/bus/vcs_ctrl/joystick.cpp", MAME_DIR .. "src/devices/bus/vcs_ctrl/joystick.h", MAME_DIR .. "src/devices/bus/vcs_ctrl/joybooster.cpp", @@ -5490,6 +5494,8 @@ if (BUSES["PCI"]~=null) then MAME_DIR .. "src/devices/bus/pci/aha2940au.h", MAME_DIR .. "src/devices/bus/pci/audiowerk2.cpp", MAME_DIR .. "src/devices/bus/pci/audiowerk2.h", + MAME_DIR .. "src/devices/bus/pci/clgd546x_laguna.cpp", + MAME_DIR .. "src/devices/bus/pci/clgd546x_laguna.h", MAME_DIR .. "src/devices/bus/pci/ds2416.cpp", MAME_DIR .. "src/devices/bus/pci/ds2416.h", MAME_DIR .. "src/devices/bus/pci/ess_maestro.cpp", @@ -5502,6 +5508,8 @@ if (BUSES["PCI"]~=null) then MAME_DIR .. "src/devices/bus/pci/oti_spitfire.h", MAME_DIR .. "src/devices/bus/pci/opti82c861.cpp", MAME_DIR .. "src/devices/bus/pci/opti82c861.h", + MAME_DIR .. "src/devices/bus/pci/pdc20262.cpp", + MAME_DIR .. "src/devices/bus/pci/pdc20262.h", MAME_DIR .. "src/devices/bus/pci/promotion.cpp", MAME_DIR .. "src/devices/bus/pci/promotion.h", MAME_DIR .. "src/devices/bus/pci/riva128.cpp", @@ -5518,6 +5526,8 @@ if (BUSES["PCI"]~=null) then MAME_DIR .. "src/devices/bus/pci/sw1000xg.h", MAME_DIR .. "src/devices/bus/pci/virge_pci.cpp", MAME_DIR .. "src/devices/bus/pci/virge_pci.h", + MAME_DIR .. "src/devices/bus/pci/vision.cpp", + MAME_DIR .. "src/devices/bus/pci/vision.h", MAME_DIR .. "src/devices/bus/pci/vt6306.cpp", MAME_DIR .. "src/devices/bus/pci/vt6306.h", MAME_DIR .. "src/devices/bus/pci/wd9710_pci.cpp", @@ -5532,14 +5542,16 @@ end --------------------------------------------------- -- ---@src/devices/bus/plg100/plg100.h,BUSES["PLG100"] = true +--@src/devices/bus/plg1x0/plg1x0.h,BUSES["PLG1X0"] = true --------------------------------------------------- -if (BUSES["PLG100"]~=null) then +if (BUSES["PLG1X0"]~=null) then files { - MAME_DIR .. "src/devices/bus/plg100/plg100.cpp", - MAME_DIR .. "src/devices/bus/plg100/plg100.h", - MAME_DIR .. "src/devices/bus/plg100/vl.cpp", - MAME_DIR .. "src/devices/bus/plg100/vl.h", + MAME_DIR .. "src/devices/bus/plg1x0/plg1x0.cpp", + MAME_DIR .. "src/devices/bus/plg1x0/plg1x0.h", + MAME_DIR .. "src/devices/bus/plg1x0/plg100-vl.cpp", + MAME_DIR .. "src/devices/bus/plg1x0/plg100-vl.h", + MAME_DIR .. "src/devices/bus/plg1x0/plg150-ap.cpp", + MAME_DIR .. "src/devices/bus/plg1x0/plg150-ap.h", } end diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 881e4ca7338c9..c621575295433 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -701,8 +701,6 @@ if CPUS["H8"] then MAME_DIR .. "src/devices/cpu/h8/h8s2600.h", MAME_DIR .. "src/devices/cpu/h8/h8325.cpp", MAME_DIR .. "src/devices/cpu/h8/h8325.h", - MAME_DIR .. "src/devices/cpu/h8/h83337.cpp", - MAME_DIR .. "src/devices/cpu/h8/h83337.h", MAME_DIR .. "src/devices/cpu/h8/h83002.cpp", MAME_DIR .. "src/devices/cpu/h8/h83002.h", MAME_DIR .. "src/devices/cpu/h8/h83003.cpp", @@ -717,10 +715,16 @@ if CPUS["H8"] then MAME_DIR .. "src/devices/cpu/h8/h83042.h", MAME_DIR .. "src/devices/cpu/h8/h83048.cpp", MAME_DIR .. "src/devices/cpu/h8/h83048.h", + MAME_DIR .. "src/devices/cpu/h8/h83217.cpp", + MAME_DIR .. "src/devices/cpu/h8/h83217.h", + MAME_DIR .. "src/devices/cpu/h8/h83337.cpp", + MAME_DIR .. "src/devices/cpu/h8/h83337.h", MAME_DIR .. "src/devices/cpu/h8/h8s2245.cpp", MAME_DIR .. "src/devices/cpu/h8/h8s2245.h", - MAME_DIR .. "src/devices/cpu/h8/h8s2320.cpp", - MAME_DIR .. "src/devices/cpu/h8/h8s2320.h", + MAME_DIR .. "src/devices/cpu/h8/h8s2319.cpp", + MAME_DIR .. "src/devices/cpu/h8/h8s2319.h", + MAME_DIR .. "src/devices/cpu/h8/h8s2329.cpp", + MAME_DIR .. "src/devices/cpu/h8/h8s2329.h", MAME_DIR .. "src/devices/cpu/h8/h8s2357.cpp", MAME_DIR .. "src/devices/cpu/h8/h8s2357.h", MAME_DIR .. "src/devices/cpu/h8/h8s2655.cpp", @@ -897,6 +901,14 @@ if CPUS["SH"] then MAME_DIR .. "src/devices/cpu/sh/sh7032.h", MAME_DIR .. "src/devices/cpu/sh/sh7042.cpp", MAME_DIR .. "src/devices/cpu/sh/sh7042.h", + MAME_DIR .. "src/devices/cpu/sh/sh_adc.cpp", + MAME_DIR .. "src/devices/cpu/sh/sh_adc.h", + MAME_DIR .. "src/devices/cpu/sh/sh_cmt.cpp", + MAME_DIR .. "src/devices/cpu/sh/sh_cmt.h", + MAME_DIR .. "src/devices/cpu/sh/sh_intc.cpp", + MAME_DIR .. "src/devices/cpu/sh/sh_intc.h", + MAME_DIR .. "src/devices/cpu/sh/sh_port.cpp", + MAME_DIR .. "src/devices/cpu/sh/sh_port.h", MAME_DIR .. "src/devices/cpu/sh/sh7604_bus.cpp", MAME_DIR .. "src/devices/cpu/sh/sh7604_bus.h", MAME_DIR .. "src/devices/cpu/sh/sh7604_sci.cpp", diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index f1869389ae268..30425b67a80bb 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -1938,6 +1938,18 @@ if (MACHINES["K056230"]~=null) then } end +--------------------------------------------------- +-- +--@src/devices/machine/1801vp128.h,MACHINES["K1801VP128"] = true +--------------------------------------------------- + +if (MACHINES["K1801VP128"]~=null) then + files { + MAME_DIR .. "src/devices/machine/1801vp128.cpp", + MAME_DIR .. "src/devices/machine/1801vp128.h", + } +end + --------------------------------------------------- -- --@src/devices/machine/kb3600.h,MACHINES["KB3600"] = true @@ -4475,6 +4487,18 @@ if (MACHINES["PC87306"]~=null) then } end +--------------------------------------------------- +-- +--@src/devices/machine/w83787f.h,MACHINES["W83787F"] = true +--------------------------------------------------- + +if (MACHINES["W83787F"]~=null) then + files { + MAME_DIR .. "src/devices/machine/w83787f.cpp", + MAME_DIR .. "src/devices/machine/w83787f.h", + } +end + --------------------------------------------------- -- --@src/devices/machine/w83977tf.h,MACHINES["W83977TF"] = true diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index a92578153aad2..43cb768704d5a 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -60,6 +60,7 @@ function osdmodulesbuild() MAME_DIR .. "src/osd/interface/inputman.h", MAME_DIR .. "src/osd/interface/inputseq.cpp", MAME_DIR .. "src/osd/interface/inputseq.h", + MAME_DIR .. "src/osd/interface/midiport.h", MAME_DIR .. "src/osd/interface/nethandler.cpp", MAME_DIR .. "src/osd/interface/nethandler.h", MAME_DIR .. "src/osd/modules/debugger/debug_module.h", diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index fe1b86137cdff..522aff460425e 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -692,11 +692,12 @@ end --@src/devices/sound/msm5232.h,SOUNDS["MSM5232"] = true --@src/devices/sound/okim6376.h,SOUNDS["OKIM6376"] = true --@src/devices/sound/okim6295.h,SOUNDS["OKIM6295"] = true +--@src/devices/sound/okim6588.h,SOUNDS["OKIM6588"] = true --@src/devices/sound/okim9810.h,SOUNDS["OKIM9810"] = true --@src/devices/sound/okiadpcm.h,SOUNDS["OKIADPCM"] = true --------------------------------------------------- -if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null or SOUNDS["OKIADPCM"]~=null) then +if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM6588"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null or SOUNDS["OKIADPCM"]~=null) then files { MAME_DIR .. "src/devices/sound/okiadpcm.cpp", MAME_DIR .. "src/devices/sound/okiadpcm.h", @@ -738,6 +739,13 @@ if (SOUNDS["OKIM6258"]~=null) then } end +if (SOUNDS["OKIM6588"]~=null) then + files { + MAME_DIR .. "src/devices/sound/okim6588.cpp", + MAME_DIR .. "src/devices/sound/okim6588.h", + } +end + if (SOUNDS["OKIM9810"]~=null) then files { MAME_DIR .. "src/devices/sound/okim9810.cpp", diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index 3914a8f4191eb..e2340724e0c4e 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -469,7 +469,7 @@ includedirs { } defines { - "NL_DISABLE_DYNAMIC_LOAD=1", + "NL_DISABLE_DYNAMIC_LOAD=1", } files { @@ -747,7 +747,7 @@ if _OPTIONS["targetos"] == "macosx" then } dependency { - { "aueffectutil", MAME_DIR .. "src/tools/aueffectutil-Info.plist", true }, + { "aueffectutil", MAME_DIR .. "src/tools/aueffectutil-Info.plist", true }, } links { diff --git a/scripts/src/video.lua b/scripts/src/video.lua index 33b5c11066229..2b95f647fc659 100644 --- a/scripts/src/video.lua +++ b/scripts/src/video.lua @@ -247,28 +247,6 @@ if (VIDEOS["EF9365"]~=null) then } end --------------------------------------------------- ---@src/devices/video/epic12.h,VIDEOS["EPIC12"] = true --------------------------------------------------- - -if (VIDEOS["EPIC12"]~=null) then - files { - MAME_DIR .. "src/devices/video/epic12.cpp", - MAME_DIR .. "src/devices/video/epic12.h", - MAME_DIR .. "src/devices/video/epic12_blit0.cpp", - MAME_DIR .. "src/devices/video/epic12_blit1.cpp", - MAME_DIR .. "src/devices/video/epic12_blit2.cpp", - MAME_DIR .. "src/devices/video/epic12_blit3.cpp", - MAME_DIR .. "src/devices/video/epic12_blit4.cpp", - MAME_DIR .. "src/devices/video/epic12_blit5.cpp", - MAME_DIR .. "src/devices/video/epic12_blit6.cpp", - MAME_DIR .. "src/devices/video/epic12_blit7.cpp", - MAME_DIR .. "src/devices/video/epic12_blit8.cpp", - MAME_DIR .. "src/devices/video/epic12in.hxx", - MAME_DIR .. "src/devices/video/epic12pixel.hxx", - } -end - -------------------------------------------------- -- --@src/devices/video/fixfreq.h,VIDEOS["FIXFREQ"] = true @@ -1038,19 +1016,6 @@ if (VIDEOS["PC_XGA"]~=null) then end --------------------------------------------------- --- ---@src/devices/video/clgd546x_laguna.h,VIDEOS["CLGD546X_LAGUNA"] = true --------------------------------------------------- - -if (VIDEOS["CLGD546X_LAGUNA"]~=null) then - files { - MAME_DIR .. "src/devices/video/clgd546x_laguna.cpp", - MAME_DIR .. "src/devices/video/clgd546x_laguna.h", - } -end - - -------------------------------------------------- -- --@src/devices/video/pcd8544.h,VIDEOS["PCD8544"] = true diff --git a/src/devices/bus/ata/xm3301.cpp b/src/devices/bus/ata/xm3301.cpp index fad92778dfd08..a03579a6407b0 100644 --- a/src/devices/bus/ata/xm3301.cpp +++ b/src/devices/bus/ata/xm3301.cpp @@ -1,8 +1,8 @@ // license:BSD-3-Clause -// copyright-holders: Angelo Salese +// copyright-holders: Angelo Salese, Grull Osgo /************************************************************************************************** -Toshiba TAISATAP.SYS support +Toshiba TAISATAP.SYS support / CD_BALLY.SYS (gammagic) TODO: - XM-3301 on its own is a SCSI-2 drive, the ATAPI variants must be higher number(s)? @@ -25,9 +25,17 @@ void toshiba_xm3301_device::device_start() memset(m_identify_buffer, 0, sizeof(m_identify_buffer)); - // "E:XM" and "1.0" is where Master Model and Revision are printed - t10mmc::set_model("TOSHIBA CD-ROM DRVE:XM 1.0"); - + // From a XM-5401 SCSI dump string $7f08 + // [5401] will be printed as Master Model + // [3605] as Rev number + // Both TAISATAP.SYS and CD_BALLY.SYS tests against one of these strings: + // "TOSHIBA CD-ROM" + // "TOSHIBA CD-ROM XM-3301" + // "TOSHIBA CD-ROM DRIVE:XM" + // "TOSHIBA DVD" (CD_BALLY.SYS only) + t10mmc::set_model("TOSHIBA CD-ROM XM-5401TA3605"); + + // xx20 is the only confirmed part (wants IRQ for command $a0) m_identify_buffer[0] = 0x8520; // TODO: everything below here is unconfirmed diff --git a/src/devices/bus/ata/xm3301.h b/src/devices/bus/ata/xm3301.h index 2c497e6586055..b730502b24161 100644 --- a/src/devices/bus/ata/xm3301.h +++ b/src/devices/bus/ata/xm3301.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese +// copyright-holders:Angelo Salese, Grull Osgo #ifndef MAME_BUS_ATA_XM3301_H #define MAME_BUS_ATA_XM3301_H diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index a8f06fab8091c..c073dd6fe07a6 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -1821,3 +1821,21 @@ void sb_device::xmit_char(uint8_t data) m_tx_waiting++; } } + +void isa16_sblaster16_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_IO) + { + ymf262_device &ymf262 = *subdevice("ymf262"); + m_isa->install_device(0x0200, 0x0207, read8smo_delegate(*subdevice("pc_joy"), FUNC(pc_joy_device::joy_port_r)), write8smo_delegate(*subdevice("pc_joy"), FUNC(pc_joy_device::joy_port_w))); + m_isa->install_device(0x0226, 0x0227, read8sm_delegate(*this, FUNC(sb_device::dsp_reset_r)), write8sm_delegate(*this, FUNC(sb_device::dsp_reset_w))); + m_isa->install_device(0x022a, 0x022b, read8sm_delegate(*this, FUNC(sb_device::dsp_data_r)), write8sm_delegate(*this, FUNC(sb_device::dsp_data_w))); + m_isa->install_device(0x022c, 0x022d, read8sm_delegate(*this, FUNC(sb_device::dsp_wbuf_status_r)), write8sm_delegate(*this, FUNC(sb_device::dsp_cmd_w))); + m_isa->install_device(0x022e, 0x022f, read8sm_delegate(*this, FUNC(sb_device::dsp_rbuf_status_r)), write8sm_delegate(*this, FUNC(sb_device::dsp_rbuf_status_w))); + m_isa->install_device(0x0224, 0x0225, read8sm_delegate(*this, FUNC(sb16_device::mixer_r)), write8sm_delegate(*this, FUNC(sb16_device::mixer_w))); + m_isa->install_device(0x0330, 0x0331, read8sm_delegate(*this, FUNC(sb16_device::mpu401_r)), write8sm_delegate(*this, FUNC(sb16_device::mpu401_w))); + m_isa->install_device(0x0388, 0x038b, read8sm_delegate(ymf262, FUNC(ymf262_device::read)), write8sm_delegate(ymf262, FUNC(ymf262_device::write))); + m_isa->install_device(0x0220, 0x0223, read8sm_delegate(ymf262, FUNC(ymf262_device::read)), write8sm_delegate(ymf262, FUNC(ymf262_device::write))); + m_isa->install_device(0x0228, 0x0229, read8sm_delegate(ymf262, FUNC(ymf262_device::read)), write8sm_delegate(ymf262, FUNC(ymf262_device::write))); + } +} diff --git a/src/devices/bus/isa/sblaster.h b/src/devices/bus/isa/sblaster.h index 723998f919648..1443f2fa09c35 100644 --- a/src/devices/bus/isa/sblaster.h +++ b/src/devices/bus/isa/sblaster.h @@ -244,6 +244,7 @@ class isa16_sblaster16_device : public sb16_device // optional information overrides virtual void device_add_mconfig(machine_config &config) override; + virtual void remap(int space_id, offs_t start, offs_t end) override; }; // device type definition diff --git a/src/devices/bus/isa/svga_cirrus.cpp b/src/devices/bus/isa/svga_cirrus.cpp index 42b5f37eb3d04..2111b8c6e6bc7 100644 --- a/src/devices/bus/isa/svga_cirrus.cpp +++ b/src/devices/bus/isa/svga_cirrus.cpp @@ -353,7 +353,17 @@ void isa16_svga_cirrus_gd542x_device::device_start() m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_r)), write8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_w))); m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_cirrus_gd542x_device::io_isa_map); +} +void isa16_svga_cirrus_gd542x_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_PROGRAM) + { + m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_r)), write8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_w))); + m_isa->install_rom(this, 0xc0000, 0xc7fff, "clgd542x"); + } + else if (space_id == AS_IO) + m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_cirrus_gd542x_device::io_isa_map); } //------------------------------------------------- diff --git a/src/devices/bus/isa/svga_cirrus.h b/src/devices/bus/isa/svga_cirrus.h index 0286d3d8510aa..dafb11c84d575 100644 --- a/src/devices/bus/isa/svga_cirrus.h +++ b/src/devices/bus/isa/svga_cirrus.h @@ -47,6 +47,7 @@ class isa16_svga_cirrus_gd542x_device : uint8_t input_port_0_r(); + virtual void remap(int space_id, offs_t start, offs_t end) override; protected: // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/isa/svga_paradise.cpp b/src/devices/bus/isa/svga_paradise.cpp index 7a318ca124af2..955096ea3aa5c 100644 --- a/src/devices/bus/isa/svga_paradise.cpp +++ b/src/devices/bus/isa/svga_paradise.cpp @@ -106,6 +106,17 @@ void isa16_pvga1a_device::device_start() m_isa->install_device(0x03b0, 0x03df, *this, &isa16_pvga1a_device::io_isa_map); } +void isa16_pvga1a_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_PROGRAM) + { + m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(pvga1a_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(pvga1a_vga_device::mem_w))); + m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga_rom"); + } + else if (space_id == AS_IO) + m_isa->install_device(0x03b0, 0x03df, *this, &isa16_pvga1a_device::io_isa_map); +} + /****************** * * PVGA1A-JK @@ -460,6 +471,20 @@ void isa16_wd90c31_lr_device::device_start() m_isa->install_device(0x23c0, 0x23c7, *m_vga, &wd90c31_vga_device::ext_io_map); } +void isa16_wd90c31_lr_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_PROGRAM) + { + m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga_rom"); + + m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(wd90c31_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(wd90c31_vga_device::mem_w))); + } + else if (space_id == AS_IO) + { + m_isa->install_device(0x03b0, 0x03df, *this, &isa16_wd90c31_lr_device::io_isa_map); + m_isa->install_device(0x23c0, 0x23c7, *m_vga, &wd90c31_vga_device::ext_io_map); + } +} /****************** * diff --git a/src/devices/bus/isa/svga_paradise.h b/src/devices/bus/isa/svga_paradise.h index 35ab345b5d9f8..8b9eeea63679e 100644 --- a/src/devices/bus/isa/svga_paradise.h +++ b/src/devices/bus/isa/svga_paradise.h @@ -21,6 +21,8 @@ class isa16_pvga1a_device : // construction/destruction isa16_pvga1a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void remap(int space_id, offs_t start, offs_t end) override; + protected: // device-level overrides virtual void device_start() override; @@ -153,6 +155,8 @@ class isa16_wd90c31_lr_device : // construction/destruction isa16_wd90c31_lr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void remap(int space_id, offs_t start, offs_t end) override; + protected: // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/isa/svga_s3.cpp b/src/devices/bus/isa/svga_s3.cpp index 527fa762ad769..c935e3e0152a1 100644 --- a/src/devices/bus/isa/svga_s3.cpp +++ b/src/devices/bus/isa/svga_s3.cpp @@ -75,9 +75,9 @@ void isa16_svga_s3_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480); - screen.set_screen_update(m_vga, FUNC(s3_vga_device::screen_update)); + screen.set_screen_update(m_vga, FUNC(s3trio64_vga_device::screen_update)); - S3_VGA(config, m_vga, 0); + S3_TRIO64_VGA(config, m_vga, 0); m_vga->set_screen("screen"); m_vga->set_vram_size(0x100000); } @@ -108,7 +108,7 @@ isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const void isa16_svga_s3_device::io_isa_map(address_map &map) { - map(0x00, 0x2f).m(m_vga, FUNC(s3_vga_device::io_map)); + map(0x00, 0x2f).m(m_vga, FUNC(s3trio64_vga_device::io_map)); } //------------------------------------------------- @@ -141,7 +141,7 @@ void isa16_svga_s3_device::device_start() m_isa->install16_device(0xbee8, 0xbeeb, read16smo_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_multifunc_r)), write16smo_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_multifunc_w))); m_isa->install16_device(0xe2e8, 0xe2eb, read16sm_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_pixel_xfer_r)), write16sm_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_pixel_xfer_w))); - m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(s3_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(s3_vga_device::mem_w))); + m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(s3trio64_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(s3trio64_vga_device::mem_w))); } //------------------------------------------------- diff --git a/src/devices/bus/isa/svga_s3.h b/src/devices/bus/isa/svga_s3.h index c391443abe071..921eff6f440fd 100644 --- a/src/devices/bus/isa/svga_s3.h +++ b/src/devices/bus/isa/svga_s3.h @@ -37,7 +37,7 @@ class isa16_svga_s3_device : void io_isa_map(address_map &map); private: - required_device m_vga; + required_device m_vga; required_device m_8514; }; diff --git a/src/devices/bus/mc10/mc10_cart.cpp b/src/devices/bus/mc10/mc10_cart.cpp index 77d2ae58332b3..0100a8ae5ba61 100644 --- a/src/devices/bus/mc10/mc10_cart.cpp +++ b/src/devices/bus/mc10/mc10_cart.cpp @@ -27,6 +27,10 @@ 16 A3 33 GND 17 A5 34 GND + Alice 32 and Alice 90 have 2 more pins: + 35 IRQ (optional) + 36 SOUND + SEL is an input to the MC-10 that allows the cartridge to remove the internal chips from the bus. @@ -36,6 +40,7 @@ #include "mc10_cart.h" #include "mcx128.h" +#include "multiports_ext.h" #include "pak.h" #include "ram.h" @@ -198,6 +203,7 @@ void mc10_cart_add_basic_devices(device_slot_interface &device) device.option_add("mcx128", MC10_PAK_MCX128); device.option_add("pak", MC10_PAK); device.option_add("ram", MC10_PAK_RAM); + device.option_add("multi", ALICE_MULTIPORTS_EXT); } //------------------------------------------------- @@ -210,6 +216,7 @@ void alice_cart_add_basic_devices(device_slot_interface &device) device.option_add("alice128", ALICE_PAK_MCX128); device.option_add("pak", MC10_PAK); device.option_add("ram", MC10_PAK_RAM); + device.option_add("multi", ALICE_MULTIPORTS_EXT); } //------------------------------------------------- @@ -221,4 +228,5 @@ void alice32_cart_add_basic_devices(device_slot_interface &device) // basic devices device.option_add("pak", MC10_PAK); device.option_add("ram", MC10_PAK_RAM); + device.option_add("multi", ALICE_MULTIPORTS_EXT); } diff --git a/src/devices/bus/mc10/multiports_ext.cpp b/src/devices/bus/mc10/multiports_ext.cpp new file mode 100644 index 0000000000000..90f3716ccee03 --- /dev/null +++ b/src/devices/bus/mc10/multiports_ext.cpp @@ -0,0 +1,122 @@ +/*************************************************************************** + + multiports_ext.cpp + + Emulation of the Alice Multiports Extension + + Features: + The extension provides an extension doubler and two joystick ports. + + The extension also provides (for the whole Alice family and MC-10): + - 16K of RAM expansion ($5000-$8FFF) + - 64K of ROM expansion in two possible configurations: + - 8K of ROM between $1000 and $2FFF, as 8 banks (Cartridge mode). + - 16K of ROM between $C000 and $FFFF, as 4 banks (ROM mode). + + Only the RAM/ROM expansion is emulated here. + + Banks are selected by writing to: + - $1000 to $1FFF in Cartridge mode (number of bank between 0 and 7) + - $C000 to $CFFF in ROM mode (number of bank between 0 and 3) + +***************************************************************************/ + +#include "emu.h" +#include "multiports_ext.h" + + +namespace { + +//************************************************************************** +// TYPE DECLARATIONS +//************************************************************************** + +class mc10_multiports_ext_device : public device_t, public device_mc10cart_interface +{ +public: + mc10_multiports_ext_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual int max_rom_length() const override; + virtual std::pair load() override; + +protected: + mc10_multiports_ext_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + void control_register_write(offs_t offset, u8 data); + + void multiports_mem(address_map &map); + void update_bank(); + +private: + memory_bank_creator m_bank; + uint8_t rom_bank_index; + memory_share_creator m_extention_ram; +}; + +//------------------------------------------------- +// IMPLEMENTATION +//------------------------------------------------- + +mc10_multiports_ext_device::mc10_multiports_ext_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : mc10_multiports_ext_device(mconfig, ALICE_MULTIPORTS_EXT, tag, owner, clock) +{ +} + +mc10_multiports_ext_device::mc10_multiports_ext_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_mc10cart_interface(mconfig, *this) + , m_bank(*this, "cart_bank") + , rom_bank_index(0) + , m_extention_ram(*this, "ext_ram", 1024 * 16, ENDIANNESS_BIG) +{ +} + +int mc10_multiports_ext_device::max_rom_length() const +{ + return 1024 * 64; +} + +void mc10_multiports_ext_device::multiports_mem(address_map &map) +{ + map(0x0000, 0x1fff).bankr("cart_bank").w(FUNC(mc10_multiports_ext_device::control_register_write)); +} + +//------------------------------------------------- + +void mc10_multiports_ext_device::device_start() +{ + owning_slot().memspace().install_device(0x1000, 0x2fff, *this, &mc10_multiports_ext_device::multiports_mem); + owning_slot().memspace().install_ram(0x5000, 0x8fff, &m_extention_ram[0]); +} + +//------------------------------------------------- + +void mc10_multiports_ext_device::device_reset() +{ + m_bank->set_entry(0); +} + +void mc10_multiports_ext_device::control_register_write(offs_t offset, u8 data) +{ + if (offset < 0x1000) + m_bank->set_entry(data & 0x07); +} + +std::pair mc10_multiports_ext_device::load() +{ + memory_region *const romregion(memregion("^rom")); + if (romregion->bytes() < (0x2000 * 8)) + return std::make_pair(image_error::INVALIDLENGTH, "Cartridge ROM must be at least 64KB"); + + m_bank->configure_entries(0, 8, romregion->base(), 0x2000); + + return std::make_pair(std::error_condition(), std::string()); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(ALICE_MULTIPORTS_EXT, device_mc10cart_interface, mc10_multiports_ext_device, "mc10_multiports_ext", "Fred_72 and 6502man's Multiports Extension") diff --git a/src/devices/bus/mc10/multiports_ext.h b/src/devices/bus/mc10/multiports_ext.h new file mode 100644 index 0000000000000..2c31b9020a401 --- /dev/null +++ b/src/devices/bus/mc10/multiports_ext.h @@ -0,0 +1,12 @@ +#ifndef MAME_BUS_MC10_MULTIPORTS_EXT_H +#define MAME_BUS_MC10_MULTIPORTS_EXT_H + +#pragma once + +#include "mc10_cart.h" + +// device type definition +DECLARE_DEVICE_TYPE(ALICE_MULTIPORTS_EXT, device_mc10cart_interface) + +#endif // MAME_BUS_MC10_MC10_MULTIPORTS_EXT_H + diff --git a/src/devices/video/clgd546x_laguna.cpp b/src/devices/bus/pci/clgd546x_laguna.cpp similarity index 100% rename from src/devices/video/clgd546x_laguna.cpp rename to src/devices/bus/pci/clgd546x_laguna.cpp diff --git a/src/devices/video/clgd546x_laguna.h b/src/devices/bus/pci/clgd546x_laguna.h similarity index 92% rename from src/devices/video/clgd546x_laguna.h rename to src/devices/bus/pci/clgd546x_laguna.h index 67b8af14c2031..3eea0fcba27f8 100644 --- a/src/devices/video/clgd546x_laguna.h +++ b/src/devices/bus/pci/clgd546x_laguna.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_VIDEO_CLGD546X_LAGUNA_H -#define MAME_VIDEO_CLGD546X_LAGUNA_H +#ifndef MAME_BUS_PCI_CLGD546X_LAGUNA_H +#define MAME_BUS_PCI_CLGD546X_LAGUNA_H #pragma once @@ -45,4 +45,4 @@ class cirrus_gd5465_laguna3d_device : public pci_device DECLARE_DEVICE_TYPE(CIRRUS_GD5465_LAGUNA3D, cirrus_gd5465_laguna3d_device) -#endif // MAME_VIDEO_CLGD546X_LAGUNA_H +#endif // MAME_BUS_PCI_CLGD546X_LAGUNA_H diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 43b84f5540582..c03140091fd93 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -8,12 +8,14 @@ #include "aha2940au.h" #include "audiowerk2.h" +#include "clgd546x_laguna.h" #include "ds2416.h" #include "ess_maestro.h" #include "geforce.h" #include "mga2064w.h" #include "opti82c861.h" #include "oti_spitfire.h" +#include "pdc20262.h" #include "promotion.h" #include "riva128.h" #include "rivatnt.h" @@ -22,6 +24,7 @@ #include "sonicvibes.h" #include "sw1000xg.h" #include "virge_pci.h" +#include "vision.h" #include "vt6306.h" #include "wd9710_pci.h" #include "zr36057.h" @@ -103,26 +106,23 @@ void pci_card_device::irq_pin_w(offs_t line, int state) void pci_cards(device_slot_interface &device) { + // 0x00 - backward compatible pre-class code +// device.option_add("voodoo1", VOODOO_1_PCI); + device.option_add("vision864", VISION864_PCI); + device.option_add("vision964", VISION964_PCI); + // 0x01 - mass storage controllers device.option_add("aha2940au", AHA2940AU); + device.option_add("pdc20262", PDC20262); // 0x02 - network controllers device.option_add("rtl8029as", RTL8029AS_PCI); device.option_add("rtl8139", RTL8139_PCI); // 0x03 - display controllers + device.option_add("vision968", VISION968_PCI); device.option_add("virge", VIRGE_PCI); device.option_add("virgedx", VIRGEDX_PCI); - device.option_add("riva128", RIVA128); - device.option_add("riva128zx", RIVA128ZX); - device.option_add("rivatnt", RIVATNT); - device.option_add("rivatnt2", RIVATNT2); - device.option_add("rivatnt2_ultra", RIVATNT2_ULTRA); - device.option_add("vanta", VANTA); - device.option_add("rivatnt2_m64", RIVATNT2_M64); - device.option_add("geforce256", GEFORCE256); - device.option_add("geforce256_ddr", GEFORCE256_DDR); - device.option_add("quadro", QUADRO); device.option_add("mga2064w", MGA2064W); device.option_add("promotion3210", PROMOTION3210); device.option_add("oti64111", OTI64111_PCI); @@ -155,3 +155,19 @@ void pci_cards(device_slot_interface &device) // 0x12 - Processing accelerators // 0x13 - Debug } + +// assume all natively with class code 03 +void agp_cards(device_slot_interface &device) +{ + device.option_add("riva128", RIVA128); + device.option_add("riva128zx", RIVA128ZX); + device.option_add("rivatnt", RIVATNT); + device.option_add("rivatnt2", RIVATNT2); + device.option_add("rivatnt2_ultra", RIVATNT2_ULTRA); + device.option_add("vanta", VANTA); + device.option_add("rivatnt2_m64", RIVATNT2_M64); + device.option_add("geforce256", GEFORCE256); + device.option_add("geforce256_ddr", GEFORCE256_DDR); + device.option_add("quadro", QUADRO); + device.option_add("laguna3d", CIRRUS_GD5465_LAGUNA3D); +} diff --git a/src/devices/bus/pci/pci_slot.h b/src/devices/bus/pci/pci_slot.h index e37cea79bd88a..7c8c17ff32087 100644 --- a/src/devices/bus/pci/pci_slot.h +++ b/src/devices/bus/pci/pci_slot.h @@ -87,5 +87,6 @@ class pci_card_device : public pci_device, public pci_card_interface DECLARE_DEVICE_TYPE(PCI_SLOT, pci_slot_device) void pci_cards(device_slot_interface &device); +void agp_cards(device_slot_interface &device); #endif diff --git a/src/devices/bus/pci/pdc20262.cpp b/src/devices/bus/pci/pdc20262.cpp new file mode 100644 index 0000000000000..022f1f2fc9c8f --- /dev/null +++ b/src/devices/bus/pci/pdc20262.cpp @@ -0,0 +1,263 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +Promise PDC20262 FastTrak66/UDMA66 IDE controller + +No documentation, ATA4 complaint + +TODO: +- how it sets compatible/native modes? Subvendor ID list suggests it can switch at will; +- Install win9x driver causes huge loading hiccups, eventually freezes by accessing drive with + explorer.exe (enable UDMA?). For common use is **suggested** to not install them. +- Reportedly has issues with very big HDDs, pinpoint limit and assuming there isn't an issue here. +\- Tested with Seagate Barracuda ST380021A -chs=158816,16,63 (expected: 80GB, actual: 13655MB) +- Marketed as RAID card, verify; +\- Gets classified as SCSI controller in win9x device manager; +- ID and hookup Flash ROM type; +- PME 1.0 support (no low power states D1/D2, no PME#) + +**************************************************************************************************/ + +#include "emu.h" +#include "pdc20262.h" + +#define LOG_WARN (1U << 1) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) + + +DEFINE_DEVICE_TYPE(PDC20262, pdc20262_device, "pdc20262", "Promise PDC20262 FastTrak66 EIDE controller") + + + +pdc20262_device::pdc20262_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : pci_card_device(mconfig, type, tag, owner, clock) + , m_ide1(*this, "ide1") + , m_ide2(*this, "ide2") + , m_irqs(*this, "irqs") + // HACK: how to get to get_pci_busmaster_space()? + , m_bus_master_space(*this, ":maincpu", 0) + , m_bios_rom(*this, "bios_rom") +{ + // Subsystems: + // 105a 4d30 Ultra Device on SuperTrak + // 105a 4d33 Ultra66 + // 105a 4d39 FastTrak66 + // class code is trusted, bp 0xca09c + // assume revision depending on BIOS + set_ids(0x105a4d38, 0x02, 0x018000, 0x105a4d33); +} + +pdc20262_device::pdc20262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : pdc20262_device(mconfig, PDC20262, tag, owner, clock) +{ +} + +ROM_START( pdc20262 ) + ROM_REGION32_LE( 0x8000, "bios_rom", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("v200") + + ROM_SYSTEM_BIOS( 0, "v200", "Promise Ultra66 BIOS v2.00 (Build 18)" ) + ROMX_LOAD( "ul200b18.bin", 0x0000, 0x4000, CRC(71e48d73) SHA1(84d8c72118a3e26181573412e2cbb859691672de), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v114", "Promise Ultra66 BIOS v1.14 (Build 0728)" ) + ROMX_LOAD( "ul114b0728.bin", 0x0000, 0x4000, CRC(a71f0c3d) SHA1(ace4872c6060e9dd8458540c0f3193d1a9b4321a), ROM_BIOS(1) ) + + // v1.12 known to exist +ROM_END + +const tiny_rom_entry *pdc20262_device::device_rom_region() const +{ + return ROM_NAME(pdc20262); +} + + +void pdc20262_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set([this] (int state) { + irq_pin_w(0, state); + }); + + BUS_MASTER_IDE_CONTROLLER(config, m_ide1).options(ata_devices, "hdd", nullptr, false); + m_ide1->irq_handler().set([this] (int state) { + m_irq_state &= ~0x4; + m_irq_state |= (state << 2); + m_irqs->in_w<0>(state); + }); + m_ide1->set_bus_master_space(m_bus_master_space); + + BUS_MASTER_IDE_CONTROLLER(config, m_ide2).options(ata_devices, nullptr, nullptr, false); + m_ide2->irq_handler().set([this] (int state) { + m_irq_state &= ~0x40; + m_irq_state |= (state << 6); + m_irqs->in_w<1>(state); + }); + m_ide2->set_bus_master_space(m_bus_master_space); +} + +// $1f0 +void pdc20262_device::ide1_command_map(address_map &map) +{ + map(0, 7).rw(FUNC(pdc20262_device::ide1_read32_cs0_r), FUNC(pdc20262_device::ide1_write32_cs0_w)); +} + +// $3f4 +void pdc20262_device::ide1_control_map(address_map &map) +{ + map(2, 2).rw(FUNC(pdc20262_device::ide1_read_cs1_r), FUNC(pdc20262_device::ide1_write_cs1_w)); +} + +// $170 +void pdc20262_device::ide2_command_map(address_map &map) +{ + map(0, 7).rw(FUNC(pdc20262_device::ide2_read32_cs0_r), FUNC(pdc20262_device::ide2_write32_cs0_w)); +} + +// $374 +void pdc20262_device::ide2_control_map(address_map &map) +{ + map(2, 2).rw(FUNC(pdc20262_device::ide2_read_cs1_r), FUNC(pdc20262_device::ide2_write_cs1_w)); +} + +void pdc20262_device::bus_master_ide_control_map(address_map &map) +{ + map(0x00, 0x07).rw(m_ide1, FUNC(bus_master_ide_controller_device::bmdma_r), FUNC(bus_master_ide_controller_device::bmdma_w)); + map(0x08, 0x0f).rw(m_ide2, FUNC(bus_master_ide_controller_device::bmdma_r), FUNC(bus_master_ide_controller_device::bmdma_w)); + + map(0x11, 0x11).lrw8( + NAME([this] () { + return m_clock; + }), + NAME([this] (u8 data) { + LOG("extra $11: Clock set %02x\n", data); + m_clock = data; + }) + ); + +// map(0x1a, 0x1a) Primary Mode +// map(0x1b, 0x1b) Secondary Mode +/* + * upper nibble secondary, lower primary + * + * x--- error + * -x-- irq + * --x- FIFO full + * ---x FIFO empty + */ + map(0x1d, 0x1d).lr8( + NAME([this] () { + // FIXME: definitely requires a FIFO i/f + return m_irq_state | 1; + }) + ); +// map(0x1f, 0x1f) Ultra DMA speed flag +} + +void pdc20262_device::extra_map(address_map &map) +{ + // TODO: should be memory mapped versions of above, *nix driver seems to use this +// map(0x00, 0x07).m(*this, FUNC(pdc20262_device::ide1_command_map))); +// ... +} + +void pdc20262_device::device_start() +{ + pci_card_device::device_start(); + + add_map(8, M_IO, FUNC(pdc20262_device::ide1_command_map)); + add_map(4, M_IO, FUNC(pdc20262_device::ide1_control_map)); + add_map(8, M_IO, FUNC(pdc20262_device::ide2_command_map)); + add_map(4, M_IO, FUNC(pdc20262_device::ide2_control_map)); + add_map(32, M_IO, FUNC(pdc20262_device::bus_master_ide_control_map)); + // TODO: unknown size (a lot larger?), to be verified later thru PnP + add_map(64, M_MEM, FUNC(pdc20262_device::extra_map)); + + add_rom((u8 *)m_bios_rom->base(), 0x4000); + expansion_rom_base = 0xc8000; + + // INTA# + intr_pin = 1; +} + +void pdc20262_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + command_mask = 7; + status = 0x0210; + + remap_cb(); +} + +void pdc20262_device::config_map(address_map &map) +{ + pci_card_device::config_map(map); + // latency timer + map(0x0d, 0x0d).lr8(NAME([] () { return 0x01; })); + // TODO: everything, starting from capptr_r override +} + +/* + * Start of legacy handling, to be moved out + */ + +uint32_t pdc20262_device::ide1_read32_cs0_r(offs_t offset, uint32_t mem_mask) +{ + if (!(command & 1)) + return 0xffffffff; + return m_ide1->read_cs0(offset, mem_mask); +} + +void pdc20262_device::ide1_write32_cs0_w(offs_t offset, uint32_t data, uint32_t mem_mask) +{ + if (!(command & 1)) + return; + m_ide1->write_cs0(offset, data, mem_mask); +} + +uint32_t pdc20262_device::ide2_read32_cs0_r(offs_t offset, uint32_t mem_mask) +{ + if (!(command & 1)) + return 0xffffffff; + return m_ide2->read_cs0(offset, mem_mask); +} + +void pdc20262_device::ide2_write32_cs0_w(offs_t offset, uint32_t data, uint32_t mem_mask) +{ + if (!(command & 1)) + return; + m_ide2->write_cs0(offset, data, mem_mask); +} + +uint8_t pdc20262_device::ide1_read_cs1_r() +{ + if (!(command & 1)) + return 0xff; + return m_ide1->read_cs1(1, 0xff0000) >> 16; +} + +void pdc20262_device::ide1_write_cs1_w(uint8_t data) +{ + if (!(command & 1)) + return; + m_ide1->write_cs1(1, data << 16, 0xff0000); +} + +uint8_t pdc20262_device::ide2_read_cs1_r() +{ + if (!(command & 1)) + return 0xff; + return m_ide2->read_cs1(1, 0xff0000) >> 16; +} + +void pdc20262_device::ide2_write_cs1_w(uint8_t data) +{ + if (!(command & 1)) + return; + m_ide2->write_cs1(1, data << 16, 0xff0000); +} diff --git a/src/devices/bus/pci/pdc20262.h b/src/devices/bus/pci/pdc20262.h new file mode 100644 index 0000000000000..f448894eb033f --- /dev/null +++ b/src/devices/bus/pci/pdc20262.h @@ -0,0 +1,65 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese + +#ifndef MAME_BUS_PCI_PDC20262_H +#define MAME_BUS_PCI_PDC20262_H + +#pragma once + +#include "pci_slot.h" +#include "machine/idectrl.h" +#include "machine/input_merger.h" + +class pdc20262_device : public pci_card_device +{ +public: + pdc20262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type imperfect_features() { return feature::DISK; } + +protected: + pdc20262_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + virtual const tiny_rom_entry *device_rom_region() const override; + +// virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, +// uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override; + + virtual void config_map(address_map &map) override; + +private: + void ide1_command_map(address_map &map); + void ide1_control_map(address_map &map); + void ide2_command_map(address_map &map); + void ide2_control_map(address_map &map); + void bus_master_ide_control_map(address_map &map); + void extra_map(address_map &map); + +// virtual void device_config_complete() override; + + required_device m_ide1; + required_device m_ide2; + required_device m_irqs; + required_address_space m_bus_master_space; + required_memory_region m_bios_rom; + + u8 m_clock = 0; + u8 m_irq_state = 0; + + uint32_t ide1_read32_cs0_r(offs_t offset, uint32_t mem_mask = ~0); + void ide1_write32_cs0_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + uint32_t ide2_read32_cs0_r(offs_t offset, uint32_t mem_mask = ~0); + void ide2_write32_cs0_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + uint8_t ide1_read_cs1_r(); + void ide1_write_cs1_w(uint8_t data); + uint8_t ide2_read_cs1_r(); + void ide2_write_cs1_w(uint8_t data); +}; + +DECLARE_DEVICE_TYPE(PDC20262, pdc20262_device) + +#endif // MAME_BUS_PCI_PDC20262_H diff --git a/src/devices/bus/pci/virge_pci.cpp b/src/devices/bus/pci/virge_pci.cpp index 847796bba12ad..9ff07e24b5177 100644 --- a/src/devices/bus/pci/virge_pci.cpp +++ b/src/devices/bus/pci/virge_pci.cpp @@ -138,12 +138,12 @@ void virge_pci_device::linear_config_changed_w(int state) uint8_t virge_pci_device::vram_r(offs_t offset) { - return downcast(m_vga.target())->mem_r(offset); + return downcast(m_vga.target())->mem_r(offset); } void virge_pci_device::vram_w(offs_t offset, uint8_t data) { - downcast(m_vga.target())->mem_w(offset, data); + downcast(m_vga.target())->mem_w(offset, data); } void virge_pci_device::postload() diff --git a/src/devices/bus/pci/vision.cpp b/src/devices/bus/pci/vision.cpp new file mode 100644 index 0000000000000..ed6ab003613e9 --- /dev/null +++ b/src/devices/bus/pci/vision.cpp @@ -0,0 +1,286 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +S3 Vision 864 / 868 / 964 / 968 + +TODO: +- Add Vision868 +- Add Trio32/Trio64, pillage roms from isa/svga_s3 +- Make ViRGE to derive from here rather than reinventing the wheel + +Notes: +- Some of these BIOSes are buggy in SDD VBETEST.EXE, doesn't return any video mode, + Reportedly mirocrys (vision964) and no9fx771 (vision968) has this inconvenient. + +**************************************************************************************************/ + +#include "emu.h" +#include "vision.h" + +#define LOG_WARN (1U << 1) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) + + +DEFINE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device, "vision864", "S3 86C864 Vision864") +// Vision868 +DEFINE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device, "vision964", "S3 86C964 Vision964") +DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device, "vision968", "S3 86C968 Vision968") + + + +vision864_pci_device::vision864_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : pci_card_device(mconfig, type, tag, owner, clock) + , m_vga(*this, "vga") + , m_bios(*this, "bios") +{ +} + +vision864_pci_device::vision864_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision864_pci_device(mconfig, VISION864_PCI, tag, owner, clock) +{ + // device IDs: + // 88c0 = 86c864 DRAM v0 + // 88c1 = 86c864 DRAM v1 + // 88c2 = 86c864-P DRAM v2 + // 88c3 = 86c864-P DRAM v3 + // NOTE: class code = 0 (backward compatible VGA device) + set_ids(0x533388c1, 0x00, 0x000100, 0x00000000); +} + +ROM_START( vision864 ) + ROM_REGION32_LE( 0x8000, "bios", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS( 0, "vision864", "Phoenix S3 Vision864 1.04-01" ) + ROMX_LOAD( "bios.bin", 0x0000, 0x8000, CRC(791c9e0d) SHA1(340a64402958d2ee734d929dfce147d9afcf23f4), ROM_BIOS(0) ) + ROM_IGNORE( 0x8000 ) +ROM_END + +const tiny_rom_entry *vision864_pci_device::device_rom_region() const +{ + return ROM_NAME(vision864); +} + +void vision864_pci_device::device_add_mconfig(machine_config &config) +{ + 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(s3vision864_vga_device::screen_update)); + + S3_VISION864_VGA(config, m_vga, 0); + m_vga->set_screen("screen"); + // 1MB, option for 2MB + m_vga->set_vram_size(2*1024*1024); +} + +void vision864_pci_device::device_start() +{ + pci_card_device::device_start(); + +// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_pci_device::lfb_map)); +// set_map_address(0, 0x70000000); + + add_rom((u8 *)m_bios->base(), 0x8000); + expansion_rom_base = 0xc0000; + + // TODO: can't read the intr pin reg but still has an INTA# +} + +void vision864_pci_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0020; + command_mask = 0x23; + // Medium DEVSEL + status = 0x0200; + + remap_cb(); +} + +void vision864_pci_device::legacy_io_map(address_map &map) +{ + map(0, 0x02f).m(m_vga, FUNC(s3vision864_vga_device::io_map)); +} + +uint8_t vision864_pci_device::vram_r(offs_t offset) +{ + return downcast(m_vga.target())->mem_r(offset); +} + +void vision864_pci_device::vram_w(offs_t offset, uint8_t data) +{ + downcast(m_vga.target())->mem_w(offset, data); +} + +void vision864_pci_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) +{ + if (BIT(command, 1)) + { + memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(vision864_pci_device::vram_r)), write8sm_delegate(*this, FUNC(vision864_pci_device::vram_w))); + } + + if (BIT(command, 0)) + { + io_space->install_device(0x03b0, 0x03df, *this, &vision864_pci_device::legacy_io_map); + } +} + +/****************** + * + * Vision964 + * + *****************/ + +vision964_pci_device::vision964_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : vision864_pci_device(mconfig, type, tag, owner, clock) +{ +} + +vision964_pci_device::vision964_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision964_pci_device(mconfig, VISION964_PCI, tag, owner, clock) +{ + // device IDs: + // 88d0-88d1 = 86c964 VRAM v0-1 + // 88d2-88d3 = 86c964-P VRAM v2-3 + // NOTE: class code = 0 (backward compatible VGA device) + set_ids(0x533388d0, 0x00, 0x000100, 0x00000000); +} + +ROM_START( vision964 ) + ROM_REGION32_LE( 0x8000, "bios", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("mirocrys") + + ROM_SYSTEM_BIOS( 0, "mirocrys", "miroCRYSTAL Rev.2.13" ) + ROMX_LOAD( "mirocrystal.vbi", 0x0000, 0x8000, CRC(d0b0aa1c) SHA1(004e2432c4783f1539a7989e7d9ee422df09e695), ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *vision964_pci_device::device_rom_region() const +{ + return ROM_NAME(vision964); +} + +void vision964_pci_device::device_add_mconfig(machine_config &config) +{ + 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(s3vision964_vga_device::screen_update)); + + S3_VISION964_VGA(config, m_vga, 0); + m_vga->set_screen("screen"); + // 2MB/4MB/8MB + m_vga->set_vram_size(4*1024*1024); +} + + +/****************** + * + * Vision968 + * + *****************/ + +vision968_pci_device::vision968_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision964_pci_device(mconfig, VISION968_PCI, tag, owner, clock) +{ + // device IDs: + // 88f0-88f3 = 86c968 RAM v0-3 + // first device to actually have a real class code + set_ids(0x533388f0, 0x00, 0x030000, 0x00000000); +} + +ROM_START( vision968 ) + ROM_REGION32_LE( 0x8000, "bios", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("elsaw2k") + + ROM_SYSTEM_BIOS( 0, "no9fx771", "Number Nine 9FX MotionFX 771 v2.45.11" ) + ROMX_LOAD( "no9motionfx771.bin", 0x0000, 0x8000, CRC(7732e382) SHA1(9ec2fe056712cef39bd8380d406be3c874ea5ec9), ROM_BIOS(0) ) + ROM_IGNORE( 0x8000 ) + + ROM_SYSTEM_BIOS( 1, "elsaw2k", "Elsa Winner 2000Pro/X-8 v1.21.01-B" ) + ROMX_LOAD( "elsaw20008m.bin", 0x0000, 0x8000, CRC(47563211) SHA1(f51a40956c3e6e7c86851d81f81ba5f77509d361), ROM_BIOS(1) ) + ROM_IGNORE( 0x8000 ) + + ROM_SYSTEM_BIOS( 2, "speamp64", "SPEA/Videoseven V7-Mercury P-64 v1.01-08" ) + ROMX_LOAD( "spea.bin", 0x0000, 0x8000, CRC(2caeadaf) SHA1(236829f1e6065a2f0ebee91f71891d8402f0ab5a), ROM_BIOS(2) ) + ROM_IGNORE( 0x8000 ) +ROM_END + +const tiny_rom_entry *vision968_pci_device::device_rom_region() const +{ + return ROM_NAME(vision968); +} + +void vision968_pci_device::device_add_mconfig(machine_config &config) +{ + 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(s3vision968_vga_device::screen_update)); + + S3_VISION968_VGA(config, m_vga, 0); + m_vga->set_screen("screen"); + // 2MB/4MB/8MB + m_vga->set_vram_size(4*1024*1024); +// m_vga->linear_config_changed().set(FUNC(s3vision864_vga_device::linear_config_changed_w)); +} + +void vision968_pci_device::device_start() +{ + pci_card_device::device_start(); + +// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision968_pci_device::lfb_map)); + add_map(64 * 1024 * 1024, M_MEM, FUNC(vision968_pci_device::lfb_map)); + set_map_address(0, 0x70000000); + + add_rom((u8 *)m_bios->base(), 0x8000); + expansion_rom_base = 0xc0000; + + // INTA# + intr_pin = 1; +} + +void vision968_pci_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0020; + command_mask = 0x23; + // Adds fast back-to-back + status = 0x0280; + + remap_cb(); +} + +// TODO: 0x0200'0000 "mirror" (really an endian relocation?) +void vision968_pci_device::lfb_map(address_map &map) +{ + map(0x0000'0000, 0x00ff'ffff).rw(m_vga, FUNC(s3vision864_vga_device::mem_linear_r), FUNC(s3vision864_vga_device::mem_linear_w)); +// map(0x0100'0000, 0x0100'7fff) image transfer data + map(0x0100'8000, 0x0100'803f).m(FUNC(vision968_pci_device::config_map)); +// map(0x0100'8100, 0x0100'816f) packed copro regs +// map(0x0100'82e8, 0x0100'82e8) current ypos +// map(0x0100'82ea, 0x0100'82ea) current ypos-2 + map(0x0100'83b0, 0x0100'83df).m(m_vga, FUNC(s3vision968_vga_device::io_map)); +// map(0x0100'8502, 0x0100'8502) (VGA $0102 alias) +// map(0x0100'8504, 0x0100'8504) (VGA $42e8 alias) +// map(0x0100'8508, 0x0100'8508) (VGA $46e8 alias) +// map(0x0100'850c, 0x0100'850c) (VGA $4ae8 alias) +// map(0x0100'86e8, 0x0100'8eea) PnP copro region +// map(0x0101'0000, 0x0101'3fff) Pixel formatter data transfer +// map(0x0101'4000, 0x0101'7fff) Pixel formatter Mask data +// map(0x0101'8080, 0x0101'809f) Pixel formatter regs +} + +void vision968_pci_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) +{ + vision964_pci_device::map_extra( + memory_window_start, memory_window_end, memory_offset, memory_space, + io_window_start, io_window_end, io_offset, io_space + ); + // TODO: new MMIO goes here +} diff --git a/src/devices/bus/pci/vision.h b/src/devices/bus/pci/vision.h new file mode 100644 index 0000000000000..f1e9439ddb6f9 --- /dev/null +++ b/src/devices/bus/pci/vision.h @@ -0,0 +1,76 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese + +#ifndef MAME_BUS_PCI_S3VISION_PCI_H +#define MAME_BUS_PCI_S3VISION_PCI_H + +#pragma once + +#include "pci_slot.h" + +#include "video/pc_vga_s3.h" + +class vision864_pci_device : public pci_card_device +{ +public: + vision864_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } + + void legacy_io_map(address_map &map); + +protected: + vision864_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + virtual const tiny_rom_entry *device_rom_region() const override; + + virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override; + + required_device m_vga; + required_memory_region m_bios; +private: + u8 vram_r(offs_t offset); + void vram_w(offs_t offset, uint8_t data); +}; + +class vision964_pci_device : public vision864_pci_device +{ +public: + vision964_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + vision964_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_add_mconfig(machine_config &config) override; + + virtual const tiny_rom_entry *device_rom_region() const override; +}; + +class vision968_pci_device : public vision964_pci_device +{ +public: + vision968_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override; + + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_start() override; + virtual void device_reset() override; + + virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override; + + void lfb_map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device) +DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device) +DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device) + +#endif // MAME_BUS_PCI_S3VISION_PCI_H diff --git a/src/devices/bus/plg100/plg100.cpp b/src/devices/bus/plg100/plg100.cpp deleted file mode 100644 index 80da3152c7cbd..0000000000000 --- a/src/devices/bus/plg100/plg100.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert - -#include "emu.h" -#include "plg100.h" - -#include "vl.h" - -DEFINE_DEVICE_TYPE(PLG100_CONNECTOR, plg100_connector, "plg100_connector", "PLG100 extension connector") - -plg100_connector::plg100_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, PLG100_CONNECTOR, tag, owner, clock), - device_single_card_slot_interface(mconfig, *this), - device_mixer_interface(mconfig, *this, 2), - m_midi_tx(*this) -{ -} - -void plg100_connector::device_start() -{ - save_item(NAME(m_state_system_is_annoying)); -} - -void plg100_connector::midi_rx(int state) -{ - auto card = get_card_device(); - if(card) - card->midi_rx(state); -} - -void plg100_intf(device_slot_interface &device) -{ - device.option_add("vl", PLG100_VL); -} - -device_plg100_interface::device_plg100_interface(const machine_config &mconfig, device_t &device) : - device_interface(device, "plg100"), - m_connector(nullptr) -{ -} - -device_plg100_interface::~device_plg100_interface() -{ -} - -void device_plg100_interface::interface_pre_start() -{ - m_connector = downcast(device().owner()); -} diff --git a/src/devices/bus/plg100/vl.h b/src/devices/bus/plg100/vl.h deleted file mode 100644 index 57e1b520a3803..0000000000000 --- a/src/devices/bus/plg100/vl.h +++ /dev/null @@ -1,15 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert - -#ifndef MAME_BUS_PLG100_VL_H -#define MAME_BUS_PLG100_VL_H - -// Yamaha PLG100-VL - -#pragma once - -#include "plg100.h" - -DECLARE_DEVICE_TYPE(PLG100_VL, device_plg100_interface) - -#endif // MAME_BUS_PLG100_VL_H diff --git a/src/devices/bus/plg100/vl.cpp b/src/devices/bus/plg1x0/plg100-vl.cpp similarity index 91% rename from src/devices/bus/plg100/vl.cpp rename to src/devices/bus/plg1x0/plg100-vl.cpp index ec89fbeab0abc..177813052df6f 100644 --- a/src/devices/bus/plg100/vl.cpp +++ b/src/devices/bus/plg1x0/plg100-vl.cpp @@ -8,14 +8,14 @@ // Build around a h8 for the control and a dsp-v for the synthesis #include "emu.h" -#include "vl.h" +#include "plg100-vl.h" #include "cpu/h8/h83002.h" #include "sound/dspv.h" namespace { -class plg100_vl_device : public device_t, public device_plg100_interface +class plg100_vl_device : public device_t, public device_plg1x0_interface { public: plg100_vl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); @@ -38,7 +38,7 @@ class plg100_vl_device : public device_t, public device_plg100_interface plg100_vl_device::plg100_vl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLG100_VL, tag, owner, clock), - device_plg100_interface(mconfig, *this), + device_plg1x0_interface(mconfig, *this), m_cpu(*this, "cpu"), m_dspv(*this, "dspv") { @@ -50,7 +50,7 @@ plg100_vl_device::~plg100_vl_device() void plg100_vl_device::midi_rx(int state) { - m_cpu->sci_rx_w<0>(state); + m_cpu->sci_rx_w<1>(state); } void plg100_vl_device::map(address_map &map) @@ -93,4 +93,4 @@ const tiny_rom_entry *plg100_vl_device::device_rom_region() const } // anonymous namespace -DEFINE_DEVICE_TYPE_PRIVATE(PLG100_VL, device_plg100_interface, plg100_vl_device, "plg100_vl", "Yamaha PLG100-VL") +DEFINE_DEVICE_TYPE_PRIVATE(PLG100_VL, device_plg1x0_interface, plg100_vl_device, "plg100_vl", "Yamaha PLG100-VL") diff --git a/src/devices/bus/plg1x0/plg100-vl.h b/src/devices/bus/plg1x0/plg100-vl.h new file mode 100644 index 0000000000000..6ff3cd48a8f93 --- /dev/null +++ b/src/devices/bus/plg1x0/plg100-vl.h @@ -0,0 +1,15 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert + +#ifndef MAME_BUS_PLG1X0_PLG100VL_H +#define MAME_BUS_PLG1X0_PLG100VL_H + +// Yamaha PLG100-VL + +#pragma once + +#include "plg1x0.h" + +DECLARE_DEVICE_TYPE(PLG100_VL, device_plg1x0_interface) + +#endif // MAME_BUS_PLG1X0_PLG100_VL_H diff --git a/src/devices/bus/plg1x0/plg150-ap.cpp b/src/devices/bus/plg1x0/plg150-ap.cpp new file mode 100644 index 0000000000000..103e7a2c8c7a6 --- /dev/null +++ b/src/devices/bus/plg1x0/plg150-ap.cpp @@ -0,0 +1,89 @@ +// license:BSD-3-Clause +// copyright-holders: Olivier Galibert + +// Yamaha PLG150-AP + +// Acoustic Piano, a plugin dedicated to a high-quality piano sound + +// Dual SWX00 + +#include "emu.h" +#include "plg150-ap.h" + +#include "cpu/h8/swx00.h" + +namespace { + +class plg150_ap_device : public device_t, public device_plg1x0_interface +{ +public: + plg150_ap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + virtual ~plg150_ap_device(); + + virtual void midi_rx(int state) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + +private: + required_device m_cpu; + + void map(address_map &map); +}; + +plg150_ap_device::plg150_ap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, PLG150_AP, tag, owner, clock), + device_plg1x0_interface(mconfig, *this), + m_cpu(*this, "cpu") +{ +} + +plg150_ap_device::~plg150_ap_device() +{ +} + +void plg150_ap_device::midi_rx(int state) +{ + m_cpu->sci_rx_w<1>(state); +} + +void plg150_ap_device::map(address_map &map) +{ + map(0x000000, 0x07ffff).rom().region("cpu", 0); +} + +void plg150_ap_device::device_add_mconfig(machine_config &config) +{ + SWX00(config, m_cpu, 8.4672_MHz_XTAL, 1); + m_cpu->set_addrmap(AS_PROGRAM, &plg150_ap_device::map); + m_cpu->write_sci_tx<1>().set([this] (int state) { m_connector->do_midi_tx(state); }); +} + +ROM_START( plg150_ap ) + ROM_REGION( 0x80000, "cpu", 0 ) + ROM_LOAD16_WORD_SWAP( "x5757b0.ic03", 0x00000, 0x80000, CRC(5383b363) SHA1(b8e8e0673439c80dc9aecd6638f1c20454c82080) ) + + ROM_REGION( 0x1000000, "swx00", 0 ) + ROM_LOAD( "x575810.ic09", 0x000000, 0x800000, CRC(273b4574) SHA1(b33d67f7fe3a020c19133cc52bd6a228227941c5) ) + ROM_LOAD( "x575910.ic11", 0x800000, 0x800000, CRC(32a37ef3) SHA1(c0b5dfb1fbb5a3ddd33e6303039fbc197478abd2) ) +ROM_END + +void plg150_ap_device::device_start() +{ +} + +void plg150_ap_device::device_reset() +{ +} + +const tiny_rom_entry *plg150_ap_device::device_rom_region() const +{ + return ROM_NAME(plg150_ap); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(PLG150_AP, device_plg1x0_interface, plg150_ap_device, "plg150_ap", "Yamaha PLG150-AP") diff --git a/src/devices/bus/plg1x0/plg150-ap.h b/src/devices/bus/plg1x0/plg150-ap.h new file mode 100644 index 0000000000000..8e56ed6061c87 --- /dev/null +++ b/src/devices/bus/plg1x0/plg150-ap.h @@ -0,0 +1,15 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert + +#ifndef MAME_BUS_PLG1X0_PLG150AP_H +#define MAME_BUS_PLG1X0_PLG150AP_H + +// Yamaha PLG150-AP + +#pragma once + +#include "plg1x0.h" + +DECLARE_DEVICE_TYPE(PLG150_AP, device_plg1x0_interface) + +#endif // MAME_BUS_PLG1X0_PLG150_AP_H diff --git a/src/devices/bus/plg1x0/plg1x0.cpp b/src/devices/bus/plg1x0/plg1x0.cpp new file mode 100644 index 0000000000000..6abd510020985 --- /dev/null +++ b/src/devices/bus/plg1x0/plg1x0.cpp @@ -0,0 +1,51 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert + +#include "emu.h" +#include "plg1x0.h" + +#include "plg100-vl.h" +#include "plg150-ap.h" + +DEFINE_DEVICE_TYPE(PLG1X0_CONNECTOR, plg1x0_connector, "plg1x0_connector", "PLG1x0 extension connector") + +plg1x0_connector::plg1x0_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, PLG1X0_CONNECTOR, tag, owner, clock), + device_single_card_slot_interface(mconfig, *this), + device_mixer_interface(mconfig, *this, 2), + m_midi_tx(*this) +{ +} + +void plg1x0_connector::device_start() +{ + save_item(NAME(m_state_system_is_annoying)); +} + +void plg1x0_connector::midi_rx(int state) +{ + auto card = get_card_device(); + if(card) + card->midi_rx(state); +} + +void plg1x0_intf(device_slot_interface &device) +{ + device.option_add("plg100vl", PLG100_VL); + device.option_add("plg150ap", PLG150_AP); +} + +device_plg1x0_interface::device_plg1x0_interface(const machine_config &mconfig, device_t &device) : + device_interface(device, "plg1x0"), + m_connector(nullptr) +{ +} + +device_plg1x0_interface::~device_plg1x0_interface() +{ +} + +void device_plg1x0_interface::interface_pre_start() +{ + m_connector = downcast(device().owner()); +} diff --git a/src/devices/bus/plg100/plg100.h b/src/devices/bus/plg1x0/plg1x0.h similarity index 53% rename from src/devices/bus/plg100/plg100.h rename to src/devices/bus/plg1x0/plg1x0.h index 18864f7e2dff9..8c049c215d58c 100644 --- a/src/devices/bus/plg100/plg100.h +++ b/src/devices/bus/plg1x0/plg1x0.h @@ -5,6 +5,9 @@ // MU series of expanders. It mostly provides two midi-rate (and midi // protocol) serial lines (in and out) and two stereo serial sample // streams (in and out too). +// +// The PLG150 series, the successor, seems essentially compatible. +// The main difference is (in some cases) nvram to save settings. // Known existing cards: // PLG100-DX: DX7 as a plugin @@ -12,20 +15,29 @@ // PLG100-VH: Voice Harmonizer, harmony effects on the A/D inputs // PLG100-VL: Virtual Acoustic Synthesis, physical-modelling synthesis, a VL70-m on a plugin card // PLG100-XG: MU50 as a plugin +// +// PLG150-AN: Analog Physical Modeling +// PLG150-AP: Acoustic Piano +// PLG150-DR: Drums +// PLG150-DX: DX7 as a plugin +// PLG150-PC: Latin drums +// PLG150-PF: Piano +// PLG150-VL: Virtual Acoustic Synthesis -#ifndef MAME_BUS_PLG100_PLG100_H -#define MAME_BUS_PLG100_PLG100_H + +#ifndef MAME_BUS_PLG1X0_PLG1X0_H +#define MAME_BUS_PLG1X0_PLG1X0_H #pragma once -class device_plg100_interface; +class device_plg1x0_interface; -class plg100_connector: public device_t, public device_single_card_slot_interface, public device_mixer_interface +class plg1x0_connector: public device_t, public device_single_card_slot_interface, public device_mixer_interface { public: template - plg100_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt) - : plg100_connector(mconfig, tag, owner, (uint32_t)0) + plg1x0_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt) + : plg1x0_connector(mconfig, tag, owner, (uint32_t)0) { option_reset(); opts(*this); @@ -33,7 +45,7 @@ class plg100_connector: public device_t, public device_single_card_slot_interfac set_fixed(false); } - plg100_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + plg1x0_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void midi_rx(int state); auto midi_tx() { return m_midi_tx.bind(); } @@ -47,24 +59,24 @@ class plg100_connector: public device_t, public device_single_card_slot_interfac virtual void device_start() override; }; -class device_plg100_interface: public device_interface +class device_plg1x0_interface: public device_interface { public: - virtual ~device_plg100_interface(); + virtual ~device_plg1x0_interface(); virtual void midi_rx(int state) = 0; protected: - plg100_connector *m_connector; + plg1x0_connector *m_connector; - device_plg100_interface(const machine_config &mconfig, device_t &device); + device_plg1x0_interface(const machine_config &mconfig, device_t &device); virtual void interface_pre_start() override; }; -DECLARE_DEVICE_TYPE(PLG100_CONNECTOR, plg100_connector) +DECLARE_DEVICE_TYPE(PLG1X0_CONNECTOR, plg1x0_connector) -void plg100_intf(device_slot_interface &device); +void plg1x0_intf(device_slot_interface &device); -#endif // MAME_BUS_PLG100_PLG100_H +#endif // MAME_BUS_PLG1X0_PLG1X0_H diff --git a/src/devices/bus/vcs_ctrl/ctrl.cpp b/src/devices/bus/vcs_ctrl/ctrl.cpp index 2ff11e88040c4..0ddccd7f2ed58 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.cpp +++ b/src/devices/bus/vcs_ctrl/ctrl.cpp @@ -65,6 +65,7 @@ void vcs_control_port_device::device_start() // SLOT_INTERFACE( vcs_control_port_devices ) //------------------------------------------------- +#include "cx85.h" #include "joybooster.h" #include "joystick.h" #include "keypad.h" @@ -88,4 +89,6 @@ void a800_control_port_devices(device_slot_interface &device) { vcs_control_port_devices(device); device.set_option_machine_config("pad", &vcs_paddles_device::reverse_players); + + device.option_add("cx85", ATARI_CX85); } diff --git a/src/devices/bus/vcs_ctrl/cx85.cpp b/src/devices/bus/vcs_ctrl/cx85.cpp new file mode 100644 index 0000000000000..6f987a99250b0 --- /dev/null +++ b/src/devices/bus/vcs_ctrl/cx85.cpp @@ -0,0 +1,123 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + Atari CX85 Numeric Keypad + +**********************************************************************/ + +#include "emu.h" +#include "cx85.h" + +#include "machine/rescap.h" + + +//************************************************************************** +// DEVICE TYPE DEFINITION +//************************************************************************** + +DEFINE_DEVICE_TYPE(ATARI_CX85, atari_cx85_device, "atari_cx85", "Atari CX85 Numeric Keypad") + + +//************************************************************************** +// INPUT PORTS +//************************************************************************** + +static INPUT_PORTS_START(atari_cx85) + PORT_START("X1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad -") PORT_CODE(KEYCODE_PLUS_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("X2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad + Enter") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("X3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("X4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad F4 (Yes)") PORT_CODE(KEYCODE_MINUS_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad F2 (No)") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad F3 (Delete)") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad F1 (Escape)") PORT_CODE(KEYCODE_NUMLOCK) +INPUT_PORTS_END + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// atari_cx85_device - constructor +//------------------------------------------------- + +atari_cx85_device::atari_cx85_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ATARI_CX85, tag, owner, clock) + , device_vcs_control_port_interface(mconfig, *this) + , m_encoder(*this, "encoder") +{ +} + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void atari_cx85_device::device_add_mconfig(machine_config &config) +{ + MM74C923(config, m_encoder, 0); // MCM74C923N + m_encoder->set_cap_osc(CAP_U(.1)); + m_encoder->set_cap_debounce(CAP_U(.47)); + m_encoder->data_tri_callback().set_constant(0); + m_encoder->x1_rd_callback().set_ioport("X1"); + m_encoder->x2_rd_callback().set_ioport("X2"); + m_encoder->x3_rd_callback().set_ioport("X3"); + m_encoder->x4_rd_callback().set_ioport("X4"); + m_encoder->da_wr_callback().set(FUNC(atari_cx85_device::trigger_w)).invert(); +} + +//------------------------------------------------- +// device_input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor atari_cx85_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(atari_cx85); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void atari_cx85_device::device_start() +{ +} + +//------------------------------------------------- +// vcs_joy_r - read digital inputs +//------------------------------------------------- + +u8 atari_cx85_device::vcs_joy_r() +{ + // 74C923 outputs are buffered through 4049B + return (~m_encoder->read() & 0x0f) | (m_encoder->da_r() ? 0 : 0x20); +} + +//------------------------------------------------- +// vcs_pot_x_r - sample B pot +//------------------------------------------------- + +u8 atari_cx85_device::vcs_pot_x_r() +{ + return BIT(m_encoder->read(), 4) ? 0 : 0xff; +} diff --git a/src/devices/bus/vcs_ctrl/cx85.h b/src/devices/bus/vcs_ctrl/cx85.h new file mode 100644 index 0000000000000..32fca503a9f27 --- /dev/null +++ b/src/devices/bus/vcs_ctrl/cx85.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + Atari CX85 Numeric Keypad + +**********************************************************************/ + +#ifndef MAME_BUS_VCS_CTRL_CX85_H +#define MAME_BUS_VCS_CTRL_CX85_H + +#pragma once + +#include "ctrl.h" +#include "machine/mm74c922.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> atari_cx85_device + +class atari_cx85_device : public device_t, + public device_vcs_control_port_interface +{ +public: + // construction/destruction + atari_cx85_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; + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + + // device_vcs_control_port_interface overrides + virtual u8 vcs_joy_r() override; + virtual u8 vcs_pot_x_r() override; + + virtual bool has_pot_x() override { return true; } + virtual bool has_pot_y() override { return false; } // pin 9 not used + +private: + required_device m_encoder; +}; + + +// device type declaration +DECLARE_DEVICE_TYPE(ATARI_CX85, atari_cx85_device) + +#endif // MAME_BUS_VCS_CTRL_CX85_H diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp index b44c99c561e82..b3c195f295e2a 100644 --- a/src/devices/cpu/g65816/g65816.cpp +++ b/src/devices/cpu/g65816/g65816.cpp @@ -258,10 +258,10 @@ unsigned g65816_device::g65816i_read_8_opcode(unsigned address) unsigned g65816_device::g65816i_read_8_direct(unsigned address) { - if (FLAG_E) + if (FLAG_E && !MAKE_UINT_8(REGISTER_D)) { /* force address into zero page */ - address = REGISTER_D + MAKE_UINT_8(address - REGISTER_D); + address = REGISTER_D | MAKE_UINT_8(address); CLOCKS -= (bus_5A22_cycle_burst(address)); } else @@ -290,10 +290,10 @@ void g65816_device::g65816i_write_8_normal(unsigned address, unsigned value) void g65816_device::g65816i_write_8_direct(unsigned address, unsigned value) { - if (FLAG_E) + if (FLAG_E && !MAKE_UINT_8(REGISTER_D)) { /* force address into zero page */ - address = REGISTER_D + MAKE_UINT_8(address - REGISTER_D); + address = REGISTER_D | MAKE_UINT_8(address); CLOCKS -= (bus_5A22_cycle_burst(address)); } else @@ -322,6 +322,23 @@ unsigned g65816_device::g65816i_read_16_direct(unsigned address) (g65816i_read_8_direct(address+1)<<8); } +unsigned g65816_device::g65816i_read_16_direct_x(unsigned address) +{ + if (FLAG_E && MAKE_UINT_8(REGISTER_D)) + { + // The (direct,X) addressing mode has a bug in which the high byte is + // wrapped within the page if E = 1 and D&0xFF != 0. + uint8_t lo = g65816i_read_8_direct(address); + uint8_t hi = g65816i_read_8_direct((address & 0xFFFF00) | + MAKE_UINT_8(address+1)); + return lo | (hi<<8); + } + else + { + return g65816i_read_16_direct(address); + } +} + unsigned g65816_device::g65816i_read_16_vector(unsigned address) { return g65816i_read_8_vector(address) | @@ -354,13 +371,6 @@ unsigned g65816_device::g65816i_read_24_immediate(unsigned address) (g65816i_read_8_immediate(address+2)<<16); } -unsigned g65816_device::g65816i_read_24_direct(unsigned address) -{ - return g65816i_read_8_direct(address) | - (g65816i_read_8_direct(address+1)<<8) | - (g65816i_read_8_direct(address+2)<<16); -} - /* ======================================================================== */ /* ================================= STACK ================================ */ @@ -418,6 +428,51 @@ unsigned g65816_device::g65816i_pull_24() return ((res + 1) & 0xffff) | (g65816i_pull_8() << 16); } +void g65816_device::g65816i_push_8_native(unsigned value) +{ + g65816i_write_8_normal(REGISTER_S, value); + REGISTER_S = MAKE_UINT_16(REGISTER_S-1); +} + +unsigned g65816_device::g65816i_pull_8_native() +{ + REGISTER_S = MAKE_UINT_16(REGISTER_S+1); + return g65816i_read_8_normal(REGISTER_S); +} + +void g65816_device::g65816i_push_16_native(unsigned value) +{ + g65816i_push_8_native(value>>8); + g65816i_push_8_native(value&0xff); +} + +unsigned g65816_device::g65816i_pull_16_native() +{ + unsigned res = g65816i_pull_8_native(); + return res | (g65816i_pull_8_native() << 8); +} + +void g65816_device::g65816i_push_24_native(unsigned value) +{ + g65816i_push_8_native(value>>16); + g65816i_push_8_native((value>>8)&0xff); + g65816i_push_8_native(value&0xff); +} + +unsigned g65816_device::g65816i_pull_24_native() +{ + unsigned res = g65816i_pull_8_native(); + res |= g65816i_pull_8_native() << 8; + return ((res + 1) & 0xffff) | (g65816i_pull_8_native() << 16); +} + +void g65816_device::g65816i_update_reg_s() +{ + if (FLAG_E) + { + REGISTER_S = MAKE_UINT_8(REGISTER_S) | 0x100; + } +} /* ======================================================================== */ /* ============================ PROGRAM COUNTER =========================== */ @@ -686,15 +741,15 @@ unsigned g65816_device::EA_AX() {unsigned tmp = EA_A(); if((tmp^(tmp+REGISTER unsigned g65816_device::EA_ALX() {return EA_AL() + REGISTER_X;} unsigned g65816_device::EA_AY() {unsigned tmp = EA_A(); if((tmp^(tmp+REGISTER_Y))&0xff00) CLK(1); return tmp + REGISTER_Y;} unsigned g65816_device::EA_DI() {return REGISTER_DB | g65816i_read_16_direct(EA_D());} -unsigned g65816_device::EA_DLI() {return g65816i_read_24_direct(EA_D());} +unsigned g65816_device::EA_DLI() {return g65816i_read_24_normal(EA_D());} unsigned g65816_device::EA_AI() {return g65816i_read_16_normal(g65816i_read_16_immediate(EA_IMM16()));} unsigned g65816_device::EA_ALI() {return g65816i_read_24_normal(EA_A());} -unsigned g65816_device::EA_DXI() {return REGISTER_DB | g65816i_read_16_direct(EA_DX());} +unsigned g65816_device::EA_DXI() {return REGISTER_DB | g65816i_read_16_direct_x(EA_DX());} unsigned g65816_device::EA_DIY() {unsigned tmp = REGISTER_DB | g65816i_read_16_direct(EA_D()); if((tmp^(tmp+REGISTER_Y))&0xff00) CLK(1); return tmp + REGISTER_Y;} -unsigned g65816_device::EA_DLIY() {return g65816i_read_24_direct(EA_D()) + REGISTER_Y;} +unsigned g65816_device::EA_DLIY() {return g65816i_read_24_normal(EA_D()) + REGISTER_Y;} unsigned g65816_device::EA_AXI() {return g65816i_read_16_normal(MAKE_UINT_16(g65816i_read_16_immediate(EA_IMM16()) + REGISTER_X));} unsigned g65816_device::EA_S() {return MAKE_UINT_16(REGISTER_S + g65816i_read_8_immediate(EA_IMM8()));} -unsigned g65816_device::EA_SIY() {return MAKE_UINT_16(g65816i_read_16_normal(REGISTER_S + g65816i_read_8_immediate(EA_IMM8())) + REGISTER_Y) | REGISTER_DB;} +unsigned g65816_device::EA_SIY() {return (g65816i_read_16_normal(REGISTER_S + g65816i_read_8_immediate(EA_IMM8())) | REGISTER_DB) + REGISTER_Y;} diff --git a/src/devices/cpu/g65816/g65816.h b/src/devices/cpu/g65816/g65816.h index d918eba4f2922..59794cc66a09f 100644 --- a/src/devices/cpu/g65816/g65816.h +++ b/src/devices/cpu/g65816/g65816.h @@ -157,18 +157,25 @@ class g65816_device : public cpu_device, public g65816_disassembler::config unsigned g65816i_read_16_normal(unsigned address); unsigned g65816i_read_16_immediate(unsigned address); unsigned g65816i_read_16_direct(unsigned address); + unsigned g65816i_read_16_direct_x(unsigned address); unsigned g65816i_read_16_vector(unsigned address); void g65816i_write_16_normal(unsigned address, unsigned value); void g65816i_write_16_direct(unsigned address, unsigned value); unsigned g65816i_read_24_normal(unsigned address); unsigned g65816i_read_24_immediate(unsigned address); - unsigned g65816i_read_24_direct(unsigned address); void g65816i_push_8(unsigned value); unsigned g65816i_pull_8(); void g65816i_push_16(unsigned value); unsigned g65816i_pull_16(); void g65816i_push_24(unsigned value); unsigned g65816i_pull_24(); + void g65816i_push_8_native(unsigned value); + unsigned g65816i_pull_8_native(); + void g65816i_push_16_native(unsigned value); + unsigned g65816i_pull_16_native(); + void g65816i_push_24_native(unsigned value); + unsigned g65816i_pull_24_native(); + void g65816i_update_reg_s(); void g65816i_jump_16(unsigned address); void g65816i_jump_24(unsigned address); void g65816i_branch_8(unsigned offset); diff --git a/src/devices/cpu/g65816/g65816op.h b/src/devices/cpu/g65816/g65816op.h index 79de3ae49502a..663781b5e1446 100644 --- a/src/devices/cpu/g65816/g65816op.h +++ b/src/devices/cpu/g65816/g65816op.h @@ -101,11 +101,11 @@ #define read_24_NORM(A) g65816i_read_24_normal(A) #define read_24_IMM(A) g65816i_read_24_immediate(A) -#define read_24_D(A) g65816i_read_24_direct(A) +#define read_24_D(A) g65816i_read_24_normal(A) #define read_24_A(A) g65816i_read_24_normal(A) #define read_24_AL(A) g65816i_read_24_normal(A) -#define read_24_DX(A) g65816i_read_24_direct(A) -#define read_24_DY(A) g65816i_read_24_direct(A) +#define read_24_DX(A) g65816i_read_24_normal(A) +#define read_24_DY(A) g65816i_read_24_normal(A) #define read_24_AX(A) g65816i_read_24_normal(A) #define read_24_ALX(A) g65816i_read_24_normal(A) #define read_24_AY(A) g65816i_read_24_normal(A) @@ -588,8 +588,9 @@ #define OP_JSL(MODE) \ CLK(CLK_OP + CLK_W24 + CLK_##MODE + 1); \ DST = EA_##MODE(); \ - g65816i_push_8(REGISTER_PB>>16); \ - g65816i_push_16(REGISTER_PC-1); \ + g65816i_push_8_native(REGISTER_PB>>16); \ + g65816i_push_16_native(REGISTER_PC-1); \ + g65816i_update_reg_s(); \ g65816i_jump_24(DST) /* M6502 Jump to Subroutine */ @@ -601,13 +602,14 @@ g65816i_push_16(REGISTER_PC-1); \ g65816i_jump_16(DST) -/* M6502 Jump to Subroutine */ +/* G65816 Jump to Subroutine */ /* Unusual behavior: stacks PC-1 */ #undef OP_JSRAXI #define OP_JSRAXI() \ CLK(8); \ DST = read_16_AXI(REGISTER_PB | (MAKE_UINT_16(OPER_16_IMM() + REGISTER_X))); \ - g65816i_push_16(REGISTER_PC-1); \ + g65816i_push_16_native(REGISTER_PC-1); \ + g65816i_update_reg_s(); \ g65816i_jump_16(DST) /* M6502 Load accumulator with operand */ @@ -868,20 +870,23 @@ #undef OP_PEA #define OP_PEA() \ CLK(CLK_OP + CLK_R16 + CLK_W16); \ - g65816i_push_16(OPER_16_IMM()) + g65816i_push_16_native(OPER_16_IMM()); \ + g65816i_update_reg_s() /* G65816 Push Effective Indirect Address */ #undef OP_PEI #define OP_PEI() \ CLK(CLK_OP + CLK_R16 + CLK_W16 + CLK_D); \ - g65816i_push_16(EA_DI()) + g65816i_push_16_native(REGISTER_DB | g65816i_read_16_normal(EA_D())); \ + g65816i_update_reg_s() /* G65816 Push Effective PC-Relative Address */ #undef OP_PER #define OP_PER() \ CLK(CLK_OP + CLK_R16 + CLK_W16 + 1); \ SRC = OPER_16_IMM(); \ - g65816i_push_16(REGISTER_PC + SRC) + g65816i_push_16_native(REGISTER_PC + SRC); \ + g65816i_update_reg_s() /* M6502 Push accumulator to the stack */ #undef OP_PHA @@ -917,7 +922,8 @@ #undef OP_PHD #define OP_PHD() \ CLK(CLK_OP + CLK_W16 + 1); \ - g65816i_push_16(REGISTER_D) + g65816i_push_16_native(REGISTER_D); \ + g65816i_update_reg_s() /* G65816 Push program bank register */ #undef OP_PHK @@ -961,14 +967,16 @@ #undef OP_PLB #define OP_PLB() \ CLK(CLK_OP + CLK_R8 + 2); \ - FLAG_N = FLAG_Z = g65816i_pull_8(); \ + FLAG_N = FLAG_Z = g65816i_pull_8_native(); \ + g65816i_update_reg_s(); \ REGISTER_DB = FLAG_Z << 16 /* G65816 Pull direct register */ #undef OP_PLD #define OP_PLD() \ CLK(CLK_OP + CLK_R16 + 2); \ - FLAG_Z = REGISTER_D = g65816i_pull_16(); \ + FLAG_Z = REGISTER_D = g65816i_pull_16_native(); \ + g65816i_update_reg_s(); \ FLAG_N = NFLAG_16(FLAG_Z) /* M6502 Pull the Processor Status Register from the stack */ @@ -1077,7 +1085,8 @@ #undef OP_RTL #define OP_RTL() \ CLK(6); \ - g65816i_jump_24(g65816i_pull_24()) + g65816i_jump_24(g65816i_pull_24_native()); \ + g65816i_update_reg_s() /* M6502 Return from Subroutine */ /* Unusual behavior: Gets PC and increments */ diff --git a/src/devices/cpu/h8/gt913.cpp b/src/devices/cpu/h8/gt913.cpp index 8b2de950f5eb8..e32ad3f679ef5 100644 --- a/src/devices/cpu/h8/gt913.cpp +++ b/src/devices/cpu/h8/gt913.cpp @@ -253,6 +253,12 @@ void gt913_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void gt913_device::notify_standby(int state) +{ + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); +} + void gt913_device::execute_set_input(int inputnum, int state) { m_intc->set_input(inputnum, state); diff --git a/src/devices/cpu/h8/gt913.h b/src/devices/cpu/h8/gt913.h index 5686915bafc90..878dbc48ebe40 100644 --- a/src/devices/cpu/h8/gt913.h +++ b/src/devices/cpu/h8/gt913.h @@ -56,6 +56,7 @@ class gt913_device : public h8_device, public device_mixer_interface { virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void irq_setup() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index 131f9aabf4c0a..2816dd25e2ddb 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -39,7 +39,7 @@ h8_device::h8_device(const machine_config &mconfig, device_type type, const char m_PPC(0), m_NPC(0), m_PC(0), m_PIR(0), m_EXR(0), m_CCR(0), m_MAC(0), m_MACF(0), m_TMP1(0), m_TMP2(0), m_TMPR(0), m_inst_state(0), m_inst_substate(0), m_icount(0), m_bcount(0), m_irq_vector(0), m_taken_irq_vector(0), m_irq_level(0), m_taken_irq_level(0), m_irq_required(false), m_irq_nmi(false), - m_standby_pending(false), m_nvram_defval(0), m_nvram_battery(true) + m_standby_pending(false), m_standby_time(0), m_nvram_defval(0), m_nvram_battery(true) { m_supports_advanced = false; m_mode_advanced = false; @@ -145,6 +145,7 @@ void h8_device::device_start() state_add(H8_R7, "ER7", m_TMPR).callimport().callexport().formatstr("%9s"); } + save_item(NAME(m_cycles_base)); save_item(NAME(m_PPC)); save_item(NAME(m_NPC)); save_item(NAME(m_PC)); @@ -164,6 +165,7 @@ void h8_device::device_start() save_item(NAME(m_irq_nmi)); save_item(NAME(m_current_dma)); save_item(NAME(m_standby_pending)); + save_item(NAME(m_standby_time)); save_item(NAME(m_nvram_battery)); set_icountptr(m_icount); @@ -189,6 +191,7 @@ void h8_device::device_start() void h8_device::device_reset() { + m_cycles_base = machine().time().as_ticks(clock()); m_inst_state = STATE_RESET; m_inst_substate = 0; m_count_before_instruction_step = 0; @@ -577,6 +580,7 @@ void h8_device::set_irq(int irq_vector, int irq_level, bool irq_nmi) // wake up from software standby with an external interrupt if(standby() && m_irq_vector) { + notify_standby(0); resume(SUSPEND_REASON_CLOCK); m_standby_cb(0); take_interrupt(); @@ -610,13 +614,14 @@ int h8_device::trapa_setup() u8 h8_device::do_addx8(u8 v1, u8 v2) { - u16 res = v1 + v2 + (m_CCR & F_C ? 1 : 0); + u8 c = m_CCR & F_C ? 1 : 0; + u16 res = v1 + v2 + c; m_CCR &= ~(F_N|F_V|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; - if(((v1 & 0xf) + (v2 & 0xf) + (m_CCR & F_C ? 1 : 0)) & 0x10) + if(m_has_hc) { + if(((v1 & 0xf) + (v2 & 0xf) + c) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(u8(res)) m_CCR &= ~F_Z; @@ -631,13 +636,14 @@ u8 h8_device::do_addx8(u8 v1, u8 v2) u8 h8_device::do_subx8(u8 v1, u8 v2) { - u16 res = v1 - v2 - (m_CCR & F_C ? 1 : 0); + u8 c = m_CCR & F_C ? 1 : 0; + u16 res = v1 - v2 - c; m_CCR &= ~(F_N|F_V|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; - if(((v1 & 0xf) - (v2 & 0xf) - (m_CCR & F_C ? 1 : 0)) & 0x10) + if(m_has_hc) { + if(((v1 & 0xf) - (v2 & 0xf) - c) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(u8(res)) m_CCR &= ~F_Z; @@ -693,11 +699,11 @@ u8 h8_device::do_add8(u8 v1, u8 v2) { u16 res = v1 + v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xf) + (v2 & 0xf)) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u8(res)) m_CCR |= F_Z; @@ -714,11 +720,11 @@ u16 h8_device::do_add16(u16 v1, u16 v2) { u32 res = v1 + v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfff) + (v2 & 0xfff)) & 0x1000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u16(res)) m_CCR |= F_Z; @@ -735,11 +741,11 @@ u32 h8_device::do_add32(u32 v1, u32 v2) { u64 res = u64(v1) + u64(v2); m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfffffff) + (v2 & 0xfffffff)) & 0x10000000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u32(res)) m_CCR |= F_Z; @@ -795,11 +801,11 @@ u8 h8_device::do_sub8(u8 v1, u8 v2) { u16 res = v1 - v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xf) - (v2 & 0xf)) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u8(res)) m_CCR |= F_Z; @@ -816,11 +822,11 @@ u16 h8_device::do_sub16(u16 v1, u16 v2) { u32 res = v1 - v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfff) - (v2 & 0xfff)) & 0x1000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u16(res)) m_CCR |= F_Z; @@ -837,11 +843,11 @@ u32 h8_device::do_sub32(u32 v1, u32 v2) { u64 res = u64(v1) - u64(v2); m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfffffff) - (v2 & 0xfffffff)) & 0x10000000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u32(res)) m_CCR |= F_Z; diff --git a/src/devices/cpu/h8/h8.h b/src/devices/cpu/h8/h8.h index 9cce7631d9dc6..bf6b9540b7345 100644 --- a/src/devices/cpu/h8/h8.h +++ b/src/devices/cpu/h8/h8.h @@ -49,6 +49,7 @@ class h8_device : public cpu_device, public device_nvram_interface { void nvram_set_default_value(u16 val) { m_nvram_defval = val; } // default is 0 auto standby_cb() { return m_standby_cb.bind(); } // notifier (not an output pin) int standby() { return suspended(SUSPEND_REASON_CLOCK) ? 1 : 0; } + u64 standby_time() { return m_standby_time; } void internal_update(); void set_irq(int irq_vector, int irq_level, bool irq_nmi); @@ -65,6 +66,8 @@ class h8_device : public cpu_device, public device_nvram_interface { void do_sci_tx(int sci, int state) { m_sci_tx[sci](state); } void do_sci_clk(int sci, int state) { m_sci_clk[sci](state); } + u64 now_as_cycles() const { return machine().time().as_ticks(clock()) - m_cycles_base; } + protected: enum { // digital I/O ports @@ -153,19 +156,20 @@ class h8_device : public cpu_device, public device_nvram_interface { h8_dma_state *m_dma_channel[8]; int m_current_dma; h8_dtc_state *m_current_dtc; - - u32 m_PPC; // previous program counter - u32 m_NPC; // next start-of-instruction program counter - u32 m_PC; // program counter - u16 m_PIR; // Prefetched word - u16 m_IR[5]; // Fetched instruction - u16 m_R[16]; // Rn (0-7), En (8-15, h8-300h+) - u8 m_EXR; // Interrupt/trace register (h8s/2000+) - u8 m_CCR; // Condition-code register - s64 m_MAC; // Multiply accumulator (h8s/2600+) - u8 m_MACF; // MAC flags (h8s/2600+) - u32 m_TMP1, m_TMP2; - u32 m_TMPR; // For debugger ER register import + u64 m_cycles_base; + + u32 m_PPC; // previous program counter + u32 m_NPC; // next start-of-instruction program counter + u32 m_PC; // program counter + u16 m_PIR; // Prefetched word + u16 m_IR[5]; // Fetched instruction + u16 m_R[16]; // Rn (0-7), En (8-15, h8-300h+) + u8 m_EXR; // Interrupt/trace register (h8s/2000+) + u8 m_CCR; // Condition-code register + s64 m_MAC; // Multiply accumulator (h8s/2600+) + u8 m_MACF; // MAC flags (h8s/2600+) + u32 m_TMP1, m_TMP2; + u32 m_TMPR; // For debugger ER register import bool m_has_exr, m_has_mac, m_has_trace, m_supports_advanced, m_mode_advanced, m_mode_a20, m_mac_saturating; bool m_has_hc; // GT913's CCR bit 5 is I, not H @@ -176,6 +180,7 @@ class h8_device : public cpu_device, public device_nvram_interface { int m_irq_level, m_taken_irq_level; bool m_irq_required, m_irq_nmi; bool m_standby_pending; + u64 m_standby_time; u16 m_nvram_defval; bool m_nvram_battery; @@ -186,6 +191,7 @@ class h8_device : public cpu_device, public device_nvram_interface { virtual void update_irq_filter() = 0; virtual void interrupt_taken() = 0; virtual void internal_update(u64 current_time) = 0; + virtual void notify_standby(int state) = 0; void recompute_bcount(u64 event_time); virtual int trace_setup(); virtual int trapa_setup(); diff --git a/src/devices/cpu/h8/h8.lst b/src/devices/cpu/h8/h8.lst index 92a9e03cacab4..d1ddf51cdf8ac 100644 --- a/src/devices/cpu/h8/h8.lst +++ b/src/devices/cpu/h8/h8.lst @@ -742,6 +742,8 @@ macro jsr32 %opc %spreg 0180 ffff 0 sleep - - prefetch_start if(m_standby_pending) { + m_standby_time = total_cycles(); + notify_standby(1); suspend(SUSPEND_REASON_CLOCK, true); m_standby_cb(1); } else { @@ -2874,7 +2876,7 @@ macro jsr32 %opc %spreg m_TMP2 = 0xffffff00 | m_IR[0]; m_TMP1 = read8(m_TMP2); prefetch_start - bst m_IR[0] >> 4 + bst m_IR[1] >> 4 write8(m_TMP2, m_TMP1); prefetch_done(); @@ -2882,7 +2884,7 @@ macro jsr32 %opc %spreg m_TMP2 = 0xffffff00 | m_IR[0]; m_TMP1 = read8(m_TMP2); prefetch_start - bist m_IR[0] >> 4 + bist m_IR[1] >> 4 write8(m_TMP2, m_TMP1); prefetch_done(); diff --git a/src/devices/cpu/h8/h83002.cpp b/src/devices/cpu/h8/h83002.cpp index d29b7e8ef5a40..f6215e62e40a5 100644 --- a/src/devices/cpu/h8/h83002.cpp +++ b/src/devices/cpu/h8/h83002.cpp @@ -233,6 +233,19 @@ void h83002_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83002_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83002_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83002.h b/src/devices/cpu/h8/h83002.h index c45fad837113a..19bbbc12bc0b8 100644 --- a/src/devices/cpu/h8/h83002.h +++ b/src/devices/cpu/h8/h83002.h @@ -86,6 +86,7 @@ class h83002_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83003.cpp b/src/devices/cpu/h8/h83003.cpp index ba9c8aabafa5d..505d9887d2952 100644 --- a/src/devices/cpu/h8/h83003.cpp +++ b/src/devices/cpu/h8/h83003.cpp @@ -260,6 +260,19 @@ void h83003_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83003_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83003_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83003.h b/src/devices/cpu/h8/h83003.h index a10ec7e824132..34597c07048f1 100644 --- a/src/devices/cpu/h8/h83003.h +++ b/src/devices/cpu/h8/h83003.h @@ -96,6 +96,7 @@ class h83003_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83006.cpp b/src/devices/cpu/h8/h83006.cpp index 586b9d1f72055..9da44a6a85e18 100644 --- a/src/devices/cpu/h8/h83006.cpp +++ b/src/devices/cpu/h8/h83006.cpp @@ -227,6 +227,22 @@ void h83006_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83006_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_sci[2]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer8_2->notify_standby(state); + m_timer8_3->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83006_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83006.h b/src/devices/cpu/h8/h83006.h index 5271d3574465c..883452ce23c2a 100644 --- a/src/devices/cpu/h8/h83006.h +++ b/src/devices/cpu/h8/h83006.h @@ -79,6 +79,7 @@ class h83006_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83008.cpp b/src/devices/cpu/h8/h83008.cpp index 96aa5b9546e29..a1a6ee12ebed1 100644 --- a/src/devices/cpu/h8/h83008.cpp +++ b/src/devices/cpu/h8/h83008.cpp @@ -204,6 +204,21 @@ void h83008_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83008_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer8_2->notify_standby(state); + m_timer8_3->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83008_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83008.h b/src/devices/cpu/h8/h83008.h index bd23cca64b91a..30f62b539d05e 100644 --- a/src/devices/cpu/h8/h83008.h +++ b/src/devices/cpu/h8/h83008.h @@ -76,6 +76,7 @@ class h83008_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83032.cpp b/src/devices/cpu/h8/h83032.cpp index 269158d4f87e1..d47f7958dacad 100644 --- a/src/devices/cpu/h8/h83032.cpp +++ b/src/devices/cpu/h8/h83032.cpp @@ -228,6 +228,18 @@ void h83032_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83032_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83032_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83032.h b/src/devices/cpu/h8/h83032.h index fcd03d027287a..0075625b3252a 100644 --- a/src/devices/cpu/h8/h83032.h +++ b/src/devices/cpu/h8/h83032.h @@ -86,6 +86,7 @@ class h83032_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83042.cpp b/src/devices/cpu/h8/h83042.cpp index f0f35a0ea7765..70f74bc94799f 100644 --- a/src/devices/cpu/h8/h83042.cpp +++ b/src/devices/cpu/h8/h83042.cpp @@ -263,6 +263,19 @@ void h83042_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83042_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83042_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83042.h b/src/devices/cpu/h8/h83042.h index 7bec2bceccf52..c14bb217232d7 100644 --- a/src/devices/cpu/h8/h83042.h +++ b/src/devices/cpu/h8/h83042.h @@ -94,6 +94,7 @@ class h83042_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83048.cpp b/src/devices/cpu/h8/h83048.cpp index be0fdc0936cb5..2443b7a58cd65 100644 --- a/src/devices/cpu/h8/h83048.cpp +++ b/src/devices/cpu/h8/h83048.cpp @@ -268,6 +268,19 @@ void h83048_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83048_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83048_device::device_start() { h8h_device::device_start(); diff --git a/src/devices/cpu/h8/h83048.h b/src/devices/cpu/h8/h83048.h index bb14b78e10859..668e7996446e6 100644 --- a/src/devices/cpu/h8/h83048.h +++ b/src/devices/cpu/h8/h83048.h @@ -98,6 +98,7 @@ class h83048_device : public h8h_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83217.cpp b/src/devices/cpu/h8/h83217.cpp new file mode 100644 index 0000000000000..f82a77f8fec84 --- /dev/null +++ b/src/devices/cpu/h8/h83217.cpp @@ -0,0 +1,276 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert, hap +/*************************************************************************** + + h83217.cpp + + H8/3217 family emulation + + TODO: + - H8/3212 and H8/3202 have less internal modules + - PWM timer module + - Host Interface module + - optional I2C bus module + - keyboard matrix interrupt + - TCONR @ 0xff9f (timer connection) + - SEDGR @ 0xffa8 (edge sense) + - WSCR @ 0xffc2 (waitstate control) + - finish STCR emulation + - finish SYSCR emulation + +***************************************************************************/ + +#include "emu.h" +#include "h83217.h" + +DEFINE_DEVICE_TYPE(H83217, h83217_device, "h83217", "Hitachi H8/3217") +DEFINE_DEVICE_TYPE(H83216, h83216_device, "h83216", "Hitachi H8/3216") +DEFINE_DEVICE_TYPE(H83214, h83214_device, "h83214", "Hitachi H8/3214") +DEFINE_DEVICE_TYPE(H83212, h83212_device, "h83212", "Hitachi H8/3212") +DEFINE_DEVICE_TYPE(H83202, h83202_device, "h83202", "Hitachi H8/3202") + + +h83217_device::h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) : + h8_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h83217_device::map), this)), + m_intc(*this, "intc"), + m_port(*this, "port%u", 1), + m_timer8(*this, "timer8_%u", 0), + m_timer16(*this, "timer16"), + m_timer16_0(*this, "timer16:0"), + m_watchdog(*this, "watchdog"), + m_ram_view(*this, "ram_view"), + m_ram_start(start), + m_md(3) +{ +} + +h83217_device::h83217_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h83217_device(mconfig, H83217, tag, owner, clock, 0xf780) +{ +} + +h83216_device::h83216_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h83217_device(mconfig, H83216, tag, owner, clock, 0xf780) +{ +} + +h83214_device::h83214_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h83217_device(mconfig, H83214, tag, owner, clock, 0xfb80) +{ +} + +h83212_device::h83212_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h83217_device(mconfig, H83212, tag, owner, clock, 0xfd80) +{ +} + +h83202_device::h83202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h83217_device(mconfig, H83202, tag, owner, clock, 0xfd80) +{ +} + +void h83217_device::map(address_map &map) +{ + map(m_ram_start, 0xff7f).view(m_ram_view); + m_ram_view[0](m_ram_start, 0xff7f).ram().share(m_internal_ram); + + map(0xff90, 0xff90).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tcr_r), FUNC(h8325_timer16_channel_device::tcr_w)); + map(0xff91, 0xff91).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tsr_r), FUNC(h8325_timer16_channel_device::tsr_w)); + map(0xff92, 0xff93).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tcnt_r), FUNC(h8325_timer16_channel_device::tcnt_w)); + map(0xff94, 0xff95).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::ocra_r), FUNC(h8325_timer16_channel_device::ocra_w)); + map(0xff96, 0xff97).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::ocrb_r), FUNC(h8325_timer16_channel_device::ocrb_w)); + map(0xff98, 0xff99).r(m_timer16_0, FUNC(h8325_timer16_channel_device::icr_r)); + + map(0xff9a, 0xff9a).rw(m_timer8[2], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); + map(0xff9b, 0xff9b).rw(m_timer8[2], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); + map(0xff9c, 0xff9d).rw(m_timer8[2], FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)); + map(0xff9e, 0xff9e).rw(m_timer8[2], FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); + + map(0xffaa, 0xffab).rw(m_watchdog, FUNC(h8_watchdog_device::wd_r), FUNC(h8_watchdog_device::wd_w)); + + map(0xffac, 0xffac).rw(m_port[0], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffad, 0xffad).rw(m_port[1], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffae, 0xffae).rw(m_port[2], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffb0, 0xffb0).w(m_port[0], FUNC(h8_port_device::ddr_w)); + map(0xffb1, 0xffb1).w(m_port[1], FUNC(h8_port_device::ddr_w)); + map(0xffb2, 0xffb2).rw(m_port[0], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffb3, 0xffb3).rw(m_port[1], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffb4, 0xffb4).w(m_port[2], FUNC(h8_port_device::ddr_w)); + map(0xffb5, 0xffb5).w(m_port[3], FUNC(h8_port_device::ddr_w)); + map(0xffb6, 0xffb6).rw(m_port[2], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffb7, 0xffb7).rw(m_port[3], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffb8, 0xffb8).w(m_port[4], FUNC(h8_port_device::ddr_w)); + map(0xffb9, 0xffb9).w(m_port[5], FUNC(h8_port_device::ddr_w)); + map(0xffba, 0xffba).rw(m_port[4], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffbb, 0xffbb).rw(m_port[5], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + map(0xffbc, 0xffbc).w(m_port[6], FUNC(h8_port_device::ddr_w)); + map(0xffbe, 0xffbe).rw(m_port[6], FUNC(h8_port_device::port_r), FUNC(h8_port_device::dr_w)); + + map(0xffc3, 0xffc3).rw(FUNC(h83217_device::stcr_r), FUNC(h83217_device::stcr_w)); + map(0xffc4, 0xffc4).rw(FUNC(h83217_device::syscr_r), FUNC(h83217_device::syscr_w)); + map(0xffc5, 0xffc5).r(FUNC(h83217_device::mdcr_r)); + map(0xffc6, 0xffc6).lr8(NAME([this]() { return m_intc->iscr_r() | ~0x47; })); + map(0xffc6, 0xffc6).lw8(NAME([this](u8 data) { m_intc->iscr_w(data & 0x47); })); + map(0xffc7, 0xffc7).lr8(NAME([this]() { return m_intc->ier_r() | ~0x47; })); + map(0xffc7, 0xffc7).lw8(NAME([this](u8 data) { m_intc->ier_w(data & 0x47); })); + + map(0xffc8, 0xffc8).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); + map(0xffc9, 0xffc9).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); + map(0xffca, 0xffcb).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)); + map(0xffcc, 0xffcc).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); + map(0xffd0, 0xffd0).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); + map(0xffd1, 0xffd1).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); + map(0xffd2, 0xffd3).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)); + map(0xffd4, 0xffd4).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); + + map(0xffd8, 0xffd8).rw(m_sci[0], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); + map(0xffd9, 0xffd9).rw(m_sci[0], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); + map(0xffda, 0xffda).rw(m_sci[0], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); + map(0xffdb, 0xffdb).rw(m_sci[0], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); + map(0xffdc, 0xffdc).rw(m_sci[0], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); + map(0xffdd, 0xffdd).r(m_sci[0], FUNC(h8_sci_device::rdr_r)); + map(0xffe0, 0xffe0).rw(m_sci[1], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); + map(0xffe1, 0xffe1).rw(m_sci[1], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); + map(0xffe2, 0xffe2).rw(m_sci[1], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); + map(0xffe3, 0xffe3).rw(m_sci[1], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); + map(0xffe4, 0xffe4).rw(m_sci[1], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); + map(0xffe5, 0xffe5).r(m_sci[1], FUNC(h8_sci_device::rdr_r)); +} + +void h83217_device::device_add_mconfig(machine_config &config) +{ + H8_INTC(config, m_intc, *this); + H8_PORT(config, m_port[0], *this, h8_device::PORT_1, 0x00, 0x00); + H8_PORT(config, m_port[1], *this, h8_device::PORT_2, 0x00, 0x00); + H8_PORT(config, m_port[2], *this, h8_device::PORT_3, 0x00, 0x00); + H8_PORT(config, m_port[3], *this, h8_device::PORT_4, 0x00, 0x00); + H8_PORT(config, m_port[4], *this, h8_device::PORT_5, 0x00, 0xc0); + H8_PORT(config, m_port[5], *this, h8_device::PORT_6, 0x00, 0x80); + H8_PORT(config, m_port[6], *this, h8_device::PORT_7, 0x00, 0x00); + H8_TIMER8_CHANNEL(config, m_timer8[0], *this, m_intc, 23, 24, 25, 8, 2, 64, 32, 1024, 256); + H8_TIMER8_CHANNEL(config, m_timer8[1], *this, m_intc, 26, 27, 28, 8, 2, 64, 128, 1024, 2048); + H8_TIMER8_CHANNEL(config, m_timer8[2], *this, m_intc, 47, 48, 49, 1, 1, 2, 2, 512, 512); + H8_TIMER16(config, m_timer16, *this, 1, 0xff); + H8325_TIMER16_CHANNEL(config, m_timer16_0, *this, m_intc, 19); + H8_SCI(config, m_sci[0], 0, *this, m_intc, 29, 30, 31, 32); + H8_SCI(config, m_sci[1], 1, *this, m_intc, 33, 34, 35, 36); + H8_WATCHDOG(config, m_watchdog, *this, m_intc, 44, h8_watchdog_device::B); +} + +void h83217_device::execute_set_input(int inputnum, int state) +{ + m_intc->set_input(inputnum, state); +} + +void h83217_device::irq_setup() +{ + m_CCR |= F_I; +} + +void h83217_device::update_irq_filter() +{ + if(m_CCR & F_I) + m_intc->set_filter(2, -1); + else + m_intc->set_filter(0, -1); +} + +void h83217_device::interrupt_taken() +{ + standard_irq_callback(m_intc->interrupt_taken(m_taken_irq_vector), m_NPC); +} + +void h83217_device::internal_update(u64 current_time) +{ + u64 event_time = 0; + + add_event(event_time, m_sci[0]->internal_update(current_time)); + add_event(event_time, m_sci[1]->internal_update(current_time)); + add_event(event_time, m_timer8[0]->internal_update(current_time)); + add_event(event_time, m_timer8[1]->internal_update(current_time)); + add_event(event_time, m_timer8[2]->internal_update(current_time)); + add_event(event_time, m_timer16_0->internal_update(current_time)); + add_event(event_time, m_watchdog->internal_update(current_time)); + + recompute_bcount(event_time); +} + +void h83217_device::notify_standby(int state) +{ + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + + for (auto & timer8 : m_timer8) + timer8->notify_standby(state); + + m_timer16_0->notify_standby(state); + m_watchdog->notify_standby(state); +} + +void h83217_device::device_start() +{ + h8_device::device_start(); + + m_stcr = 0; + m_syscr = 0; + + save_item(NAME(m_md)); + save_item(NAME(m_stcr)); + save_item(NAME(m_syscr)); +} + +void h83217_device::device_reset() +{ + h8_device::device_reset(); + + m_stcr = 0x00; + m_syscr = 0x09; + m_ram_view.select(0); +} + +u8 h83217_device::stcr_r() +{ + return m_stcr; +} + +void h83217_device::stcr_w(u8 data) +{ + logerror("stcr = %02x\n", data); + + // ICKS0/1 + m_timer8[0]->set_extra_clock_bit(BIT(data, 0)); + m_timer8[1]->set_extra_clock_bit(BIT(data, 1)); + + m_stcr = data; +} + +u8 h83217_device::syscr_r() +{ + return m_syscr; +} + +void h83217_device::syscr_w(u8 data) +{ + logerror("syscr = %02x\n", data); + + // RAME + if (data & 1) + m_ram_view.select(0); + else + m_ram_view.disable(); + + // NMIEG + m_intc->set_nmi_edge(BIT(data, 2)); + + // SSBY + m_standby_pending = bool(data & 0x80); + + m_syscr = (m_syscr & 0x08) | (data & 0xf7); +} + +u8 h83217_device::mdcr_r() +{ + if(!machine().side_effects_disabled()) + logerror("mdcr_r\n"); + return (m_md & 0x03) | 0xe4; +} diff --git a/src/devices/cpu/h8/h83217.h b/src/devices/cpu/h8/h83217.h new file mode 100644 index 0000000000000..a0274b0e9bdde --- /dev/null +++ b/src/devices/cpu/h8/h83217.h @@ -0,0 +1,119 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert, hap +/*************************************************************************** + + h83217.h + + H8/3217 family emulation + + H8-300-based mcus. + + Variant ROM RAM + H8/3217 60K 2K + H8/3216 48K 2K + H8/3214 32K 1K + H8/3212 16K 512B + H8/3202 16K 512B + +***************************************************************************/ + +#ifndef MAME_CPU_H8_H83217_H +#define MAME_CPU_H8_H83217_H + +#pragma once + +#include "h8.h" + +#include "h8_intc.h" +#include "h8_port.h" +#include "h8_timer8.h" +#include "h8_timer16.h" +#include "h8_sci.h" +#include "h8_watchdog.h" + +class h83217_device : public h8_device { +public: + h83217_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // I/O ports + auto read_port1() { return m_read_port [PORT_1].bind(); } + auto write_port1() { return m_write_port[PORT_1].bind(); } + auto read_port2() { return m_read_port [PORT_2].bind(); } + auto write_port2() { return m_write_port[PORT_2].bind(); } + auto read_port3() { return m_read_port [PORT_3].bind(); } + auto write_port3() { return m_write_port[PORT_3].bind(); } + auto read_port4() { return m_read_port [PORT_4].bind(); } + auto write_port4() { return m_write_port[PORT_4].bind(); } + auto read_port5() { return m_read_port [PORT_5].bind(); } + auto write_port5() { return m_write_port[PORT_5].bind(); } + auto read_port6() { return m_read_port [PORT_6].bind(); } + auto write_port6() { return m_write_port[PORT_6].bind(); } + auto read_port7() { return m_read_port [PORT_7].bind(); } + auto write_port7() { return m_write_port[PORT_7].bind(); } + + // MD pins, default mode 3 (single chip) + void set_mode(u8 mode) { m_md = mode & 3; } + + u8 stcr_r(); + void stcr_w(u8 data); + u8 syscr_r(); + void syscr_w(u8 data); + u8 mdcr_r(); + +protected: + h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start); + + required_device m_intc; + required_device_array m_port; + required_device_array m_timer8; + required_device m_timer16; + required_device m_timer16_0; + required_device m_watchdog; + + memory_view m_ram_view; + + u32 m_ram_start; + u8 m_md; + u8 m_stcr; + u8 m_syscr; + + virtual void update_irq_filter() override; + virtual void interrupt_taken() override; + virtual void irq_setup() override; + virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; + virtual void device_add_mconfig(machine_config &config) override; + void map(address_map &map); + + virtual void device_start() override; + virtual void device_reset() override; + virtual void execute_set_input(int inputnum, int state) override; +}; + +class h83216_device : public h83217_device { +public: + h83216_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h83214_device : public h83217_device { +public: + h83214_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h83212_device : public h83217_device { +public: + h83212_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h83202_device : public h83217_device { +public: + h83202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +DECLARE_DEVICE_TYPE(H83217, h83217_device) +DECLARE_DEVICE_TYPE(H83216, h83216_device) +DECLARE_DEVICE_TYPE(H83214, h83214_device) +DECLARE_DEVICE_TYPE(H83212, h83212_device) +DECLARE_DEVICE_TYPE(H83202, h83202_device) + +#endif // MAME_CPU_H8_H83217_H diff --git a/src/devices/cpu/h8/h8325.cpp b/src/devices/cpu/h8/h8325.cpp index 194f9557a9ab0..40cc6b53d84f7 100644 --- a/src/devices/cpu/h8/h8325.cpp +++ b/src/devices/cpu/h8/h8325.cpp @@ -9,8 +9,8 @@ TODO: - serial controllers are slightly different, has 3 interrupt sources instead of 4 - - HCSR register @ 0xfffe (port 3 handshake) - - FNCR register @ 0xffff (16-bit timer noise canceler) + - HCSR @ 0xfffe (port 3 handshake) + - FNCR @ 0xffff (16-bit timer noise canceler) ***************************************************************************/ @@ -97,8 +97,10 @@ void h8325_device::map(address_map &map) map(0xffc4, 0xffc4).rw(FUNC(h8325_device::syscr_r), FUNC(h8325_device::syscr_w)); map(0xffc5, 0xffc5).r(FUNC(h8325_device::mdcr_r)); - map(0xffc6, 0xffc6).rw(m_intc, FUNC(h8325_intc_device::iscr_r), FUNC(h8325_intc_device::iscr_w)); - map(0xffc7, 0xffc7).rw(m_intc, FUNC(h8325_intc_device::ier_r), FUNC(h8325_intc_device::ier_w)); + map(0xffc6, 0xffc6).lr8(NAME([this]() { return m_intc->iscr_r() | ~0x77; })); + map(0xffc6, 0xffc6).lw8(NAME([this](u8 data) { m_intc->iscr_w(data & 0x77); })); + map(0xffc7, 0xffc7).lr8(NAME([this]() { return m_intc->ier_r() | ~0x07; })); + map(0xffc7, 0xffc7).lw8(NAME([this](u8 data) { m_intc->ier_w(data & 0x07); })); map(0xffc8, 0xffc8).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); map(0xffc9, 0xffc9).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); @@ -177,6 +179,15 @@ void h8325_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h8325_device::notify_standby(int state) +{ + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer8[0]->notify_standby(state); + m_timer8[1]->notify_standby(state); + m_timer16_0->notify_standby(state); +} + void h8325_device::device_start() { h8_device::device_start(); @@ -197,7 +208,7 @@ void h8325_device::device_reset() m_ram_view.select(0); // MD pins are latched at reset - m_mds = m_md & 3; + m_mds = m_md; } u8 h8325_device::syscr_r() @@ -228,5 +239,5 @@ u8 h8325_device::mdcr_r() { if(!machine().side_effects_disabled()) logerror("mdcr_r\n"); - return m_mds | 0xe4; + return (m_mds & 0x03) | 0xe4; } diff --git a/src/devices/cpu/h8/h8325.h b/src/devices/cpu/h8/h8325.h index c6ba5b2672b31..8f4ca3356a603 100644 --- a/src/devices/cpu/h8/h8325.h +++ b/src/devices/cpu/h8/h8325.h @@ -8,7 +8,7 @@ H8-300-based mcus. - Variant ROM RAM + Variant ROM RAM H8/3257 60K 2K H8/3256 48K 2K H8/325 32K 1K @@ -24,6 +24,7 @@ #pragma once #include "h8.h" + #include "h8_intc.h" #include "h8_port.h" #include "h8_timer8.h" @@ -51,7 +52,7 @@ class h8325_device : public h8_device { auto write_port7() { return m_write_port[PORT_7].bind(); } // MD pins, default mode 3 (single chip) - void set_mode(u8 mode) { m_md = mode; } + void set_mode(u8 mode) { m_md = mode & 3; } u8 syscr_r(); void syscr_w(u8 data); @@ -80,6 +81,7 @@ class h8325_device : public h8_device { virtual void interrupt_taken() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h83337.cpp b/src/devices/cpu/h8/h83337.cpp index 5fd3101dd1350..09a9482f4af82 100644 --- a/src/devices/cpu/h8/h83337.cpp +++ b/src/devices/cpu/h8/h83337.cpp @@ -7,7 +7,12 @@ H8-3337 family emulation TODO: - - 16-bit timer module is different + - 16-bit timer module is different from how it's implemented in h8_timer16.cpp + - PWM timer module + - Host Interface module + - finish WSCR emulation, CKDBL flag would need support in peripherals + - finish STCR emulation + - finish SYSCR emulation ***************************************************************************/ @@ -37,7 +42,6 @@ h83337_device::h83337_device(const machine_config &mconfig, device_type type, co m_timer16(*this, "timer16"), m_timer16_0(*this, "timer16:0"), m_watchdog(*this, "watchdog"), - m_syscr(0), m_ram_start(start) { } @@ -189,15 +193,36 @@ void h83337_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h83337_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer16_0->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h83337_device::device_start() { h8_device::device_start(); + + m_wscr = 0; + m_stcr = 0; + m_syscr = 0; + + save_item(NAME(m_wscr)); + save_item(NAME(m_stcr)); save_item(NAME(m_syscr)); } void h83337_device::device_reset() { h8_device::device_reset(); + + m_wscr = 0x08; + m_stcr = 0x00; m_syscr = 0x09; } @@ -208,30 +233,35 @@ u8 h83337_device::syscr_r() void h83337_device::syscr_w(u8 data) { - m_syscr = data; logerror("syscr = %02x\n", data); + m_syscr = (m_syscr & 0x08) | (data & 0xf7); } u8 h83337_device::wscr_r() { - return 0x00; + return m_wscr; } void h83337_device::wscr_w(u8 data) { logerror("wscr = %02x\n", data); + m_wscr = data; } u8 h83337_device::stcr_r() { - return 0x00; + return m_stcr; } void h83337_device::stcr_w(u8 data) { logerror("stcr = %02x\n", data); - m_timer8_0->set_extra_clock_bit(data & 0x01); - m_timer8_1->set_extra_clock_bit(data & 0x02); + + // ICKS0/1 + m_timer8_0->set_extra_clock_bit(BIT(data, 0)); + m_timer8_1->set_extra_clock_bit(BIT(data, 1)); + + m_stcr = data; } u8 h83337_device::mdcr_r() diff --git a/src/devices/cpu/h8/h83337.h b/src/devices/cpu/h8/h83337.h index ee4b349ae7b51..0a732b2e11af1 100644 --- a/src/devices/cpu/h8/h83337.h +++ b/src/devices/cpu/h8/h83337.h @@ -23,6 +23,7 @@ #pragma once #include "h8.h" + #include "h8_intc.h" #include "h8_adc.h" #include "h8_port.h" @@ -82,13 +83,16 @@ class h83337_device : public h8_device { required_device m_timer16_0; required_device m_watchdog; - u8 m_syscr; u32 m_ram_start; + u8 m_wscr; + u8 m_stcr; + u8 m_syscr; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h8_adc.cpp b/src/devices/cpu/h8/h8_adc.cpp index bab8bc6aa37ff..c1ad3f4b04816 100644 --- a/src/devices/cpu/h8/h8_adc.cpp +++ b/src/devices/cpu/h8/h8_adc.cpp @@ -11,7 +11,7 @@ static constexpr int V = 0; DEFINE_DEVICE_TYPE(H8_ADC_3337, h8_adc_3337_device, "h8_adc_3337", "H8/3337 ADC") DEFINE_DEVICE_TYPE(H8_ADC_3006, h8_adc_3006_device, "h8_adc_3006", "H8/3006 ADC") DEFINE_DEVICE_TYPE(H8_ADC_2245, h8_adc_2245_device, "h8_adc_2245", "H8/2245 ADC") -DEFINE_DEVICE_TYPE(H8_ADC_2320, h8_adc_2320_device, "h8_adc_2320", "H8/2320 ADC") +DEFINE_DEVICE_TYPE(H8_ADC_2319, h8_adc_2319_device, "h8_adc_2319", "H8/2319 ADC") DEFINE_DEVICE_TYPE(H8_ADC_2357, h8_adc_2357_device, "h8_adc_2357", "H8/2357 ADC") DEFINE_DEVICE_TYPE(H8_ADC_2655, h8_adc_2655_device, "h8_adc_2655", "H8/2655 ADC") @@ -149,6 +149,12 @@ u64 h8_adc_device::internal_update(u64 current_time) return m_next_event; } +void h8_adc_device::notify_standby(int state) +{ + if(!state && m_next_event) + m_next_event += m_cpu->total_cycles() - m_cpu->standby_time(); +} + void h8_adc_device::conversion_wait(bool first, bool poweron, u64 current_time) { if(current_time) @@ -358,29 +364,29 @@ void h8_adc_2245_device::mode_update() } -h8_adc_2320_device::h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8_adc_device(mconfig, H8_ADC_2320, tag, owner, clock) +h8_adc_2319_device::h8_adc_2319_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8_adc_device(mconfig, H8_ADC_2319, tag, owner, clock) { m_register_mask = 3; } -int h8_adc_2320_device::conversion_time(bool first, bool poweron) +int h8_adc_2319_device::conversion_time(bool first, bool poweron) { int tm; if(first) - if(m_adcr & 0x04) + if(m_adcr & 0x08) tm = m_adcsr & 0x08 ? 134 : 266; else - tm = m_adcsr & 0x08 ? 68 : 580; + tm = m_adcsr & 0x08 ? 68 : 530; else - if(m_adcr & 0x04) + if(m_adcr & 0x08) tm = m_adcsr & 0x08 ? 128 : 256; else tm = m_adcsr & 0x08 ? 64 : 512; return tm; } -void h8_adc_2320_device::mode_update() +void h8_adc_2319_device::mode_update() { m_trigger = 1 << ((m_adcr >> 6) & 3); diff --git a/src/devices/cpu/h8/h8_adc.h b/src/devices/cpu/h8/h8_adc.h index bb180703c64e9..2ea510e6c4a15 100644 --- a/src/devices/cpu/h8/h8_adc.h +++ b/src/devices/cpu/h8/h8_adc.h @@ -19,7 +19,11 @@ class h8_adc_device : public device_t { public: - template void set_info(T &&cpu, U &&intc, int vect) { m_cpu.set_tag(std::forward(cpu)), m_intc.set_tag(std::forward(intc)); m_intc_vector = vect; } + template void set_info(T &&cpu, U &&intc, int vect) { + m_cpu.set_tag(std::forward(cpu)); + m_intc.set_tag(std::forward(intc)); + m_intc_vector = vect; + } u8 addr8_r(offs_t offset); u16 addr16_r(offs_t offset); @@ -31,6 +35,7 @@ class h8_adc_device : public device_t { void set_suspend(bool suspend); u64 internal_update(u64 current_time); + void notify_standby(int state); protected: h8_adc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); @@ -131,11 +136,11 @@ class h8_adc_2245_device : public h8_adc_device { virtual void mode_update() override; }; -class h8_adc_2320_device : public h8_adc_device { +class h8_adc_2319_device : public h8_adc_device { public: - h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - template h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu, U &&intc, int vect) - : h8_adc_2320_device(mconfig, tag, owner, 0) + h8_adc_2319_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + template h8_adc_2319_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu, U &&intc, int vect) + : h8_adc_2319_device(mconfig, tag, owner, 0) { set_info(cpu, intc, vect); } @@ -178,7 +183,7 @@ class h8_adc_2655_device : public h8_adc_device { DECLARE_DEVICE_TYPE(H8_ADC_3337, h8_adc_3337_device) DECLARE_DEVICE_TYPE(H8_ADC_3006, h8_adc_3006_device) DECLARE_DEVICE_TYPE(H8_ADC_2245, h8_adc_2245_device) -DECLARE_DEVICE_TYPE(H8_ADC_2320, h8_adc_2320_device) +DECLARE_DEVICE_TYPE(H8_ADC_2319, h8_adc_2319_device) DECLARE_DEVICE_TYPE(H8_ADC_2357, h8_adc_2357_device) DECLARE_DEVICE_TYPE(H8_ADC_2655, h8_adc_2655_device) diff --git a/src/devices/cpu/h8/h8_intc.cpp b/src/devices/cpu/h8/h8_intc.cpp index 8a85f5802ecd1..f599f5e93dba5 100644 --- a/src/devices/cpu/h8/h8_intc.cpp +++ b/src/devices/cpu/h8/h8_intc.cpp @@ -98,7 +98,7 @@ void h8_intc_device::set_input(int inputnum, int state) default: assert(0); break; } m_nmi_input = state == ASSERT_LINE; - if(set) { + if(machine().time() > attotime::zero && set) { m_pending_irqs[0] |= 1 << m_irq_vector_nmi; update_irq_state(); } @@ -148,7 +148,7 @@ void h8_intc_device::ier_w(u8 data) void h8_intc_device::check_level_irqs(bool update) { bool set = false; - for(int i=0; i> i) & 1) { case 0: m_irq_type[i] = LEVEL_LOW; @@ -189,7 +189,7 @@ void h8_intc_device::update_irq_types() void h8_intc_device::update_irq_state() { if(m_irq_vector_count > 0) { - const unsigned mask = (1 << m_irq_vector_count) - 1; + const u32 mask = (1 << m_irq_vector_count) - 1; m_pending_irqs[0] &= ~(mask << m_irq_vector_base); m_pending_irqs[0] |= (m_isr & m_ier & mask) << m_irq_vector_base; @@ -198,10 +198,10 @@ void h8_intc_device::update_irq_state() int cur_vector = 0; int cur_level = -1; - for(int i=0; i(m_iscr >> i,0,4)) { case 0: case 1: m_irq_type[i] = LEVEL_LOW; @@ -305,16 +305,6 @@ void h8h_intc_device::icr_w(offs_t offset, u8 data) logerror("icr %d = %02x\n", offset, data); } -u8 h8h_intc_device::icrc_r() -{ - return icr_r(2); -} - -void h8h_intc_device::icrc_w(u8 data) -{ - icr_w(2, data); -} - const int h8h_intc_device::vector_to_slot[64] = { -1, -1, -1, -1, -1, -1, -1, -1, // NMI at 7 -1, -1, -1, -1, 0, 1, 2, 2, // IRQ 0-3 @@ -371,16 +361,6 @@ void h8s_intc_device::ipr_w(offs_t offset, u8 data) logerror("ipr %d = %02x\n", offset, data); } -u8 h8s_intc_device::iprk_r() -{ - return ipr_r(10); -} - -void h8s_intc_device::iprk_w(u8 data) -{ - ipr_w(10, data); -} - u8 h8s_intc_device::iscrh_r() { return m_iscr >> 8; @@ -407,7 +387,7 @@ void h8s_intc_device::iscrl_w(u8 data) void h8s_intc_device::update_irq_types() { - for(int i=0; i> (2*i)) & 3) { case 0: m_irq_type[i] = LEVEL_LOW; diff --git a/src/devices/cpu/h8/h8_intc.h b/src/devices/cpu/h8/h8_intc.h index 424137d761489..15fe2952f5f94 100644 --- a/src/devices/cpu/h8/h8_intc.h +++ b/src/devices/cpu/h8/h8_intc.h @@ -98,8 +98,6 @@ class h8h_intc_device : public h8_intc_device { void isr_w(u8 data); u8 icr_r(offs_t offset); void icr_w(offs_t offset, u8 data); - u8 icrc_r(); - void icrc_w(u8 data); protected: static const int vector_to_slot[]; @@ -125,8 +123,6 @@ class h8s_intc_device : public h8h_intc_device { u8 ipr_r(offs_t offset); void ipr_w(offs_t offset, u8 data); - u8 iprk_r(); - void iprk_w(u8 data); u8 iscrh_r(); void iscrh_w(u8 data); u8 iscrl_r(); diff --git a/src/devices/cpu/h8/h8_port.cpp b/src/devices/cpu/h8/h8_port.cpp index 3ba9c56a494fb..521cc29dedd62 100644 --- a/src/devices/cpu/h8/h8_port.cpp +++ b/src/devices/cpu/h8/h8_port.cpp @@ -26,7 +26,7 @@ h8_port_device::h8_port_device(const machine_config &mconfig, const char *tag, d void h8_port_device::ddr_w(u8 data) { - // logerror("ddr_w %02x\n", data); + //logerror("ddr_w %02x\n", data); m_ddr = data; update_output(); } @@ -38,14 +38,14 @@ u8 h8_port_device::ddr_r() void h8_port_device::dr_w(u8 data) { - // logerror("dr_w %02x\n", data); + //logerror("dr_w %02x\n", data); m_dr = data; update_output(); } u8 h8_port_device::dr_r() { - // logerror("dr_r %02x\n", (dr | mask) & 0xff); + //logerror("dr_r %02x\n", (dr | mask) & 0xff); return m_dr | m_mask; } @@ -55,7 +55,7 @@ u8 h8_port_device::port_r() if((m_ddr & ~m_mask) != u8(~m_mask)) res |= m_cpu->do_read_port(m_address) & ~m_ddr; - // logerror("port_r %02x (%02x %02x)\n", res, ddr & ~mask, u8(~mask)); + //logerror("port_r %02x (%02x %02x)\n", res, ddr & ~mask, u8(~mask)); return res; } diff --git a/src/devices/cpu/h8/h8_sci.cpp b/src/devices/cpu/h8/h8_sci.cpp index e5af601bae124..f11e8239805d4 100644 --- a/src/devices/cpu/h8/h8_sci.cpp +++ b/src/devices/cpu/h8/h8_sci.cpp @@ -7,16 +7,60 @@ #include "h8.h" #include "h8_intc.h" -// Verbosity level -// 0 = no messages -// 1 = transmitted/received bytes, reception errors and clock setup -// 2 = everything but status register reads -// 3 = everything -static constexpr int V = 0; +#define LOG_REGS (1 << 1U) // Register writes +#define LOG_RREGS (1 << 2U) // Register reads +#define LOG_RATE (1 << 3U) // Bitrate setting, beware that gk2000 changes it all the time ending up in a massive slowdown, don't leave it active +#define LOG_DATA (1 << 4U) // Bytes transmitted +#define LOG_CLOCK (1 << 5U) // Clock and transmission start/stop +#define LOG_STATE (1 << 6U) // State machine states +#define LOG_TICK (1 << 7U) // Clock ticks +#define VERBOSE (LOG_DATA) + +#include "logmacro.h" DEFINE_DEVICE_TYPE(H8_SCI, h8_sci_device, "h8_sci", "H8 Serial Communications Interface") + +// Clocking: +// Async mode: +// The circuit wants 16 events per bit. +// * Internal clocking: the cpu clock is divided by one of (1, 4, 16, 64) from the cks field of smr +// then by (brr+1) then by 2. +// * External clocking: the external clock is supposed to be 16*bitrate. +// Sync mode: +// The circuit wants 2 events per bit, a positive and a negative edge. +// * Internal clocking: the cpu clock is divided by one of (1, 4, 16, 64) from the cks field of smr +// then by (brr+1) then by 2. Events are then interpreted has been alternatively positive and +// negative (e.g. another divide-by-two, sync-wise). +// * External clocking: the external clock is supposed to be at bitrate, both edges are used. +// +// Synchronization: +// Async mode: +// Both modes use a 4-bits counter incremented on every event (16/bit). +// +// * Transmit sets the counter to 0 at transmit start. Output data line changes value +// on counter == 0. If the clock output is required, clk=1 outside of transmit, +// clk=0 on counter==0, clk=1 on counter==8. +// +// * Receive sets the counter to 0 when the data line initially goes down (start bit) +// Output line is read on counter==8. It is unknown whether the counter is reset +// on every data line level change. +// +// Sync mode: +// * Transmit changes the data line on negative edges, the clock line, following positive and +// negative edge definition, is output as long as transmit is active and is otherwise 1. +// +// * Receive reads the data line on positive edges. +// +// Framing: +// Async mode: 1 bit of start at 0, 7 or 8 bits of data, nothing or 1 bit of parity or 1 bit of multiprocessing, 1 or 2 bits of stop at 1. +// Sync mode: 8 bits of data. +// +// Multiprocessing bit is an extra bit which value can be set on transmit in bit zero of ssr. +// On receive when zero the byte is dropped. + + const char *const h8_sci_device::state_names[] = { "idle", "start", "bit", "parity", "stop", "last-tick" }; h8_sci_device::h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : @@ -24,8 +68,9 @@ h8_sci_device::h8_sci_device(const machine_config &mconfig, const char *tag, dev m_cpu(*this, finder_base::DUMMY_TAG), m_intc(*this, finder_base::DUMMY_TAG), m_external_to_internal_ratio(0), m_internal_to_external_ratio(0), m_sync_timer(nullptr), m_id(0), m_eri_int(0), m_rxi_int(0), m_txi_int(0), m_tei_int(0), - m_tx_state(0), m_rx_state(0), m_tx_bit(0), m_rx_bit(0), m_clock_state(0), m_tx_parity(0), m_rx_parity(0), m_tx_ext_clock_counter(0), m_rx_ext_clock_counter(0), m_clock_mode(clock_mode_t::INTERNAL_ASYNC), m_tx_clock_value(false), m_rx_clock_value(false), m_ext_clock_value(false), m_rx_value(false), - m_rdr(0), m_tdr(0), m_smr(0), m_scr(0), m_ssr(0), m_brr(0), m_rsr(0), m_tsr(0), m_tx_clock_base(0), m_rx_clock_base(0), m_divider(0) + m_tx_state(0), m_rx_state(0), m_tx_bit(0), m_rx_bit(0), m_clock_state(0), m_tx_parity(0), m_rx_parity(0), m_tx_clock_counter(0), m_rx_clock_counter(0), + m_clock_mode(INTERNAL_ASYNC), m_ext_clock_value(false), m_rx_value(true), + m_rdr(0), m_tdr(0), m_smr(0), m_scr(0), m_ssr(0), m_brr(0), m_rsr(0), m_tsr(0), m_clock_event(0), m_divider(0) { m_external_clock_period = attotime::never; } @@ -38,33 +83,35 @@ void h8_sci_device::do_set_external_clock_period(const attotime &period) void h8_sci_device::smr_w(u8 data) { m_smr = data; - if(V>=2) logerror("smr_w %02x %s %c%c%c%s /%d (%06x)\n", data, - data & SMR_CA ? "sync" : "async", - data & SMR_CHR ? '7' : '8', - data & SMR_PE ? data & SMR_OE ? 'o' : 'e' : 'n', - data & SMR_STOP ? '2' : '1', - data & SMR_MP ? " mp" : "", - 1 << 2*(data & SMR_CKS), - m_cpu->pc()); + + LOGMASKED(LOG_REGS, "smr_w %02x %s %c%c%c%s /%d (%06x)\n", data, + data & SMR_CA ? "sync" : "async", + data & SMR_CHR ? '7' : '8', + data & SMR_PE ? data & SMR_OE ? 'o' : 'e' : 'n', + data & SMR_STOP ? '2' : '1', + data & SMR_MP ? " mp" : "", + 1 << 2*(data & SMR_CKS), + m_cpu->pc()); + clock_update(); } u8 h8_sci_device::smr_r() { - if(V>=2) logerror("smr_r %02x (%06x)\n", m_smr, m_cpu->pc()); + LOGMASKED(LOG_RREGS, "smr_r %02x (%06x)\n", m_smr, m_cpu->pc()); return m_smr; } void h8_sci_device::brr_w(u8 data) { m_brr = data; - if(V>=2) logerror("brr_w %02x (%06x)\n", data, m_cpu->pc()); + LOGMASKED(LOG_REGS, "brr_w %02x (%06x)\n", m_brr, m_cpu->pc()); clock_update(); } u8 h8_sci_device::brr_r() { - if(V>=2) logerror("brr_r %02x (%06x)\n", m_brr, m_cpu->pc()); + LOGMASKED(LOG_RREGS, "brr_r %02x (%06x)\n", m_brr, m_cpu->pc()); return m_brr; } @@ -80,15 +127,15 @@ bool h8_sci_device::has_recv_error() const void h8_sci_device::scr_w(u8 data) { - if(V>=2) logerror("scr_w %02x%s%s%s%s%s%s clk=%d (%06x)\n", data, - data & SCR_TIE ? " txi" : "", - data & SCR_RIE ? " rxi" : "", - data & SCR_TE ? " tx" : "", - data & SCR_RE ? " rx" : "", - data & SCR_MPIE ? " mpi" : "", - data & SCR_TEIE ? " tei" : "", - data & SCR_CKE, - m_cpu->pc()); + LOGMASKED(LOG_REGS, "scr_w %02x%s%s%s%s%s%s clk=%d (%06x)\n", data, + data & SCR_TIE ? " txi" : "", + data & SCR_RIE ? " rxi" : "", + data & SCR_TE ? " tx" : "", + data & SCR_RE ? " rx" : "", + data & SCR_MPIE ? " mpi" : "", + data & SCR_TEIE ? " tei" : "", + data & SCR_CKE, + m_cpu->pc()); u8 delta = m_scr ^ data; m_scr = data; @@ -113,13 +160,13 @@ void h8_sci_device::scr_w(u8 data) u8 h8_sci_device::scr_r() { - if(V>=2) logerror("scr_r %02x (%06x)\n", m_scr, m_cpu->pc()); + LOGMASKED(LOG_RREGS, "scr_r %02x (%06x)\n", m_scr, m_cpu->pc()); return m_scr; } void h8_sci_device::tdr_w(u8 data) { - if(V>=2) logerror("tdr_w %02x (%06x)\n", data, m_cpu->pc()); + LOGMASKED(LOG_REGS, "tdr_w %02x (%06x)\n", data, m_cpu->pc()); m_tdr = data; if(m_cpu->access_is_dma()) { m_ssr &= ~SSR_TDRE; @@ -130,7 +177,7 @@ void h8_sci_device::tdr_w(u8 data) u8 h8_sci_device::tdr_r() { - if(V>=2) logerror("tdr_r %02x (%06x)\n", m_tdr, m_cpu->pc()); + LOGMASKED(LOG_RREGS, "tdr_r %02x (%06x)\n", m_tdr, m_cpu->pc()); return m_tdr; } @@ -143,7 +190,7 @@ void h8_sci_device::ssr_w(u8 data) if((m_ssr & SSR_TDRE) && !(data & SSR_TDRE)) m_ssr &= ~SSR_TEND; m_ssr = ((m_ssr & ~SSR_MPBT) | (data & SSR_MPBT)) & (data | (SSR_TEND|SSR_MPB|SSR_MPBT)); - if(V>=2) logerror("ssr_w %02x -> %02x (%06x)\n", data, m_ssr, m_cpu->pc()); + LOGMASKED(LOG_REGS, "ssr_w %02x -> %02x (%06x)\n", data, m_ssr, m_cpu->pc()); if(m_tx_state == ST_IDLE && !(m_ssr & SSR_TDRE)) tx_start(); @@ -154,83 +201,81 @@ void h8_sci_device::ssr_w(u8 data) u8 h8_sci_device::ssr_r() { - if(V>=3) logerror("ssr_r %02x (%06x)\n", m_ssr, m_cpu->pc()); + LOGMASKED(LOG_RREGS, "ssr_r %02x (%06x)\n", m_ssr, m_cpu->pc()); return m_ssr; } u8 h8_sci_device::rdr_r() { - if(V>=2) logerror("rdr_r %02x (%06x)\n", m_rdr, m_cpu->pc()); - if(m_cpu->access_is_dma()) + LOGMASKED(LOG_RREGS, "rdr_r %02x (%06x)\n", m_rdr, m_cpu->pc()); + + if(!machine().side_effects_disabled() && m_cpu->access_is_dma()) m_ssr &= ~SSR_RDRF; return m_rdr; } void h8_sci_device::scmr_w(u8 data) { - if(V>=2) logerror("scmr_w %02x (%06x)\n", data, m_cpu->pc()); + LOGMASKED(LOG_REGS, "scmr_w %02x (%06x)\n", data, m_cpu->pc()); } u8 h8_sci_device::scmr_r() { - if(V>=2) logerror("scmr_r (%06x)\n", m_cpu->pc()); + LOGMASKED(LOG_RREGS, "scmr_r (%06x)\n", m_cpu->pc()); return 0x00; } void h8_sci_device::clock_update() { - // Sync: Divider must be the time of a half-period (both edges are used, datarate*2) - // Async: Divider must be the time of one period (only rising edge used, datarate*16) - m_divider = 2 << (2*(m_smr & SMR_CKS)); m_divider *= m_brr+1; if(m_smr & SMR_CA) { if(m_scr & SCR_CKE1) - m_clock_mode = clock_mode_t::EXTERNAL_SYNC; + m_clock_mode = EXTERNAL_SYNC; else - m_clock_mode = clock_mode_t::INTERNAL_SYNC_OUT; + m_clock_mode = INTERNAL_SYNC_OUT; } else { if(m_scr & SCR_CKE1) - m_clock_mode = clock_mode_t::EXTERNAL_ASYNC; + m_clock_mode = EXTERNAL_ASYNC; else if(m_scr & SCR_CKE0) - m_clock_mode = clock_mode_t::INTERNAL_ASYNC_OUT; + m_clock_mode = INTERNAL_ASYNC_OUT; else - m_clock_mode = clock_mode_t::INTERNAL_ASYNC; + m_clock_mode = INTERNAL_ASYNC; } - if(m_clock_mode == clock_mode_t::EXTERNAL_ASYNC && !m_external_clock_period.is_never()) - m_clock_mode = clock_mode_t::EXTERNAL_RATE_ASYNC; - if(m_clock_mode == clock_mode_t::EXTERNAL_SYNC && !m_external_clock_period.is_never()) - m_clock_mode = clock_mode_t::EXTERNAL_RATE_SYNC; + if(m_clock_mode == EXTERNAL_ASYNC && !m_external_clock_period.is_never()) + m_clock_mode = EXTERNAL_RATE_ASYNC; + if(m_clock_mode == EXTERNAL_SYNC && !m_external_clock_period.is_never()) + m_clock_mode = EXTERNAL_RATE_SYNC; - if(V>=1) { + if(VERBOSE & LOG_RATE) { std::string new_message; switch(m_clock_mode) { - case clock_mode_t::INTERNAL_ASYNC: + case INTERNAL_ASYNC: new_message = util::string_format("clock internal at %d Hz, async, bitrate %d bps\n", int(m_cpu->clock() / m_divider), int(m_cpu->clock() / (m_divider*16))); break; - case clock_mode_t::INTERNAL_ASYNC_OUT: + case INTERNAL_ASYNC_OUT: new_message = util::string_format("clock internal at %d Hz, async, bitrate %d bps, output\n", int(m_cpu->clock() / m_divider), int(m_cpu->clock() / (m_divider*16))); break; - case clock_mode_t::EXTERNAL_ASYNC: + case EXTERNAL_ASYNC: new_message = "clock external, async\n"; break; - case clock_mode_t::EXTERNAL_RATE_ASYNC: + case EXTERNAL_RATE_ASYNC: new_message = util::string_format("clock external at %d Hz, async, bitrate %d bps\n", int(m_cpu->clock()*m_internal_to_external_ratio), int(m_cpu->clock()*m_internal_to_external_ratio/16)); break; - case clock_mode_t::INTERNAL_SYNC_OUT: + case INTERNAL_SYNC_OUT: new_message = util::string_format("clock internal at %d Hz, sync, output\n", int(m_cpu->clock() / (m_divider*2))); break; - case clock_mode_t::EXTERNAL_SYNC: + case EXTERNAL_SYNC: new_message = "clock external, sync\n"; break; - case clock_mode_t::EXTERNAL_RATE_SYNC: + case EXTERNAL_RATE_SYNC: new_message = util::string_format("clock external at %d Hz, sync\n", int(m_cpu->clock()*m_internal_to_external_ratio)); break; } if(new_message != m_last_clock_message) { - logerror(new_message); + (LOG_OUTPUT_FUNC)(new_message); m_last_clock_message = std::move(new_message); } } @@ -248,7 +293,6 @@ void h8_sci_device::device_start() m_internal_to_external_ratio = 1/m_external_to_internal_ratio; } - save_item(NAME(m_rdr)); save_item(NAME(m_tdr)); save_item(NAME(m_smr)); @@ -262,16 +306,15 @@ void h8_sci_device::device_start() save_item(NAME(m_rx_state)); save_item(NAME(m_tx_state)); save_item(NAME(m_tx_parity)); + save_item(NAME(m_clock_mode)); save_item(NAME(m_clock_state)); - save_item(NAME(m_tx_clock_value)); - save_item(NAME(m_rx_clock_value)); - save_item(NAME(m_tx_clock_base)); - save_item(NAME(m_rx_clock_base)); + save_item(NAME(m_clock_event)); + save_item(NAME(m_clock_step)); save_item(NAME(m_divider)); + save_item(NAME(m_rx_value)); save_item(NAME(m_ext_clock_value)); - save_item(NAME(m_tx_ext_clock_counter)); - save_item(NAME(m_rx_ext_clock_counter)); - save_item(NAME(m_cur_sync_time)); + save_item(NAME(m_tx_clock_counter)); + save_item(NAME(m_rx_clock_counter)); } void h8_sci_device::device_reset() @@ -289,25 +332,14 @@ void h8_sci_device::device_reset() m_tx_state = ST_IDLE; m_rx_state = ST_IDLE; m_clock_state = 0; - m_clock_mode = clock_mode_t::INTERNAL_ASYNC; - m_tx_clock_base = 0; - m_rx_clock_base = 0; + m_clock_mode = INTERNAL_ASYNC; + m_clock_event = 0; clock_update(); - m_tx_clock_value = true; - m_rx_clock_value = true; m_ext_clock_value = true; - m_tx_ext_clock_counter = 0; - m_rx_ext_clock_counter = 0; - m_rx_value = true; - m_cpu->do_sci_clk(m_id, m_tx_clock_value); + m_tx_clock_counter = 0; + m_rx_clock_counter = 0; + m_cpu->do_sci_clk(m_id, 1); m_cpu->do_sci_tx(m_id, 1); - m_cur_sync_time = attotime::never; -} - -void h8_sci_device::device_post_load() -{ - // Set clock_mode correctly as it's not saved - clock_update(); } TIMER_CALLBACK_MEMBER(h8_sci_device::sync_tick) @@ -317,239 +349,85 @@ TIMER_CALLBACK_MEMBER(h8_sci_device::sync_tick) void h8_sci_device::do_rx_w(int state) { + if(m_cpu->standby()) { + m_rx_value = state; + return; + } + + if(state != m_rx_value && (m_clock_state & CLK_RX)) + if(m_rx_clock_counter == 1 || m_rx_clock_counter == 15) + m_rx_clock_counter = 0; + m_rx_value = state; - if(V>=2) logerror("rx=%d\n", state); - if(!m_rx_value && !(m_clock_state & CLK_RX) && m_rx_state != ST_IDLE && !m_cpu->standby()) + if(!m_rx_value && !(m_clock_state & CLK_RX) && m_rx_state != ST_IDLE) clock_start(CLK_RX); } void h8_sci_device::do_clk_w(int state) { - if(m_ext_clock_value != state) { - m_ext_clock_value = state; - if(m_clock_state && !m_cpu->standby()) { - switch(m_clock_mode) { - case clock_mode_t::EXTERNAL_ASYNC: - if(m_ext_clock_value) { - m_tx_ext_clock_counter = (m_tx_ext_clock_counter+1) & 15; - m_rx_ext_clock_counter = (m_rx_ext_clock_counter+1) & 15; - - if((m_clock_state & CLK_TX) && m_tx_ext_clock_counter == 0) - tx_dropped_edge(); - if((m_clock_state & CLK_RX) && m_rx_ext_clock_counter == 8) - rx_raised_edge(); - } - break; - - case clock_mode_t::EXTERNAL_SYNC: - if((!m_ext_clock_value) && (m_clock_state & CLK_TX)) - tx_dropped_edge(); - - else if(m_ext_clock_value && (m_clock_state & CLK_RX)) - rx_raised_edge(); - break; - default: - // Do nothing - break; - } - } + if(m_ext_clock_value == state) + return; + + m_ext_clock_value = state; + if(!m_clock_state || m_cpu->standby()) + return; + + if(m_clock_mode == EXTERNAL_ASYNC) { + if(m_clock_state & CLK_TX) + tx_async_tick(); + if(m_clock_state & CLK_RX) + rx_async_tick(); + } else if(m_clock_mode == EXTERNAL_SYNC) { + if(m_clock_state & CLK_TX) + tx_sync_tick(); + if(m_clock_state & CLK_RX) + rx_sync_tick(); } } u64 h8_sci_device::internal_update(u64 current_time) { - u64 tx_event = 0, rx_event = 0; - switch(m_clock_mode) { - case clock_mode_t::INTERNAL_SYNC_OUT: - if(m_clock_state & CLK_TX) { - u64 fp = m_divider*2; - if(current_time >= m_tx_clock_base) { - u64 delta = current_time - m_tx_clock_base; - if(delta >= fp) { - delta -= fp; - m_tx_clock_base += fp; - } - assert(delta < fp); - - bool new_clock = delta >= m_divider; - if(new_clock != m_tx_clock_value) { - machine().scheduler().synchronize(); - if(!new_clock) - tx_dropped_edge(); - - m_tx_clock_value = new_clock; - if(m_clock_state || m_tx_clock_value) - m_cpu->do_sci_clk(m_id, m_tx_clock_value); - } - } - tx_event = m_tx_clock_base + (m_tx_clock_value ? fp : m_divider); - } - if(m_clock_state & CLK_RX) { - u64 fp = m_divider*2; - if(current_time >= m_rx_clock_base) { - u64 delta = current_time - m_rx_clock_base; - if(delta >= fp) { - delta -= fp; - m_rx_clock_base += fp; - } - assert(delta < fp); - - bool new_clock = delta >= m_divider; - if(new_clock != m_rx_clock_value) { - machine().scheduler().synchronize(); - if(new_clock) - rx_raised_edge(); - - m_rx_clock_value = new_clock; - } - } - rx_event = m_rx_clock_base + (m_rx_clock_value ? fp : m_divider); - } - break; - - case clock_mode_t::INTERNAL_ASYNC: - case clock_mode_t::INTERNAL_ASYNC_OUT: - if(m_clock_state & CLK_TX) { - u64 fp = m_divider*16; - if(current_time >= m_tx_clock_base) { - u64 delta = current_time - m_tx_clock_base; - if(delta >= fp) { - delta -= fp; - m_tx_clock_base += fp; - } - assert(delta < fp); - bool new_clock = delta >= m_divider*8; - if(new_clock != m_tx_clock_value) { - machine().scheduler().synchronize(); - if(!new_clock) - tx_dropped_edge(); - - m_tx_clock_value = new_clock; - if(m_clock_mode == clock_mode_t::INTERNAL_ASYNC_OUT && (m_clock_state || !m_tx_clock_value)) - m_cpu->do_sci_clk(m_id, m_tx_clock_value); - } - } - tx_event = m_tx_clock_base + (m_tx_clock_value ? fp : m_divider*8); - } - - if(m_clock_state & CLK_RX) { - u64 fp = m_divider*16; - if(current_time >= m_rx_clock_base) { - u64 delta = current_time - m_rx_clock_base; - if(delta >= fp) { - delta -= fp; - m_rx_clock_base += fp; - } - assert(delta < fp); - bool new_clock = delta >= m_divider*8; - if(new_clock != m_rx_clock_value) { - machine().scheduler().synchronize(); - if(new_clock) - rx_raised_edge(); - - m_rx_clock_value = new_clock; - if(m_clock_mode == clock_mode_t::INTERNAL_ASYNC_OUT && (m_clock_state || !m_rx_clock_value)) - m_cpu->do_sci_clk(m_id, m_rx_clock_value); - } - } - rx_event = m_rx_clock_base + (m_rx_clock_value ? fp : m_divider*8); - } - break; - - case clock_mode_t::EXTERNAL_RATE_SYNC: - if(m_clock_state & CLK_TX) { - u64 ctime = u64(current_time*m_internal_to_external_ratio*2); - if(ctime >= m_tx_clock_base) { - u64 delta = ctime - m_tx_clock_base; - m_tx_clock_base += delta & ~1; - delta &= 1; - bool new_clock = delta >= 1; - if(new_clock != m_tx_clock_value) { - machine().scheduler().synchronize(); - if(!new_clock) - tx_dropped_edge(); - - m_tx_clock_value = new_clock; - } - } - - tx_event = u64((m_tx_clock_base + (m_tx_clock_value ? 2 : 1))*m_external_to_internal_ratio)+1; - } + if(!m_clock_event || current_time < m_clock_event) + return m_clock_event; + + if(m_clock_mode == INTERNAL_ASYNC || m_clock_mode == INTERNAL_ASYNC_OUT || m_clock_mode == EXTERNAL_RATE_ASYNC) { + if(m_clock_state & CLK_TX) + tx_async_tick(); + if(m_clock_state & CLK_RX) + rx_async_tick(); + } else if(m_clock_mode == INTERNAL_SYNC_OUT || m_clock_mode == EXTERNAL_RATE_SYNC) { + if(m_clock_state & CLK_TX) + tx_sync_tick(); + if(m_clock_state & CLK_RX) + rx_sync_tick(); + } - if(m_clock_state & CLK_RX) { - u64 ctime = u64(current_time*m_internal_to_external_ratio*2); - if(ctime >= m_rx_clock_base) { - u64 delta = ctime - m_rx_clock_base; - m_rx_clock_base += delta & ~1; - delta &= 1; - bool new_clock = delta >= 1; - if(new_clock != m_rx_clock_value) { - machine().scheduler().synchronize(); - if(new_clock) - rx_raised_edge(); - - m_rx_clock_value = new_clock; - } - } + if(m_clock_state) { + if(m_clock_step) + m_clock_event += m_clock_step; + else if(m_clock_mode == EXTERNAL_RATE_ASYNC || m_clock_mode == EXTERNAL_RATE_SYNC) + m_clock_event = u64(u64(m_clock_event * m_internal_to_external_ratio + 1) * m_external_to_internal_ratio + 1); + else + m_clock_event = 0; - rx_event = u64((m_rx_clock_base + (m_rx_clock_value ? 2 : 1))*m_external_to_internal_ratio)+1; + if(m_clock_event) { + m_sync_timer->adjust(attotime::from_ticks(m_clock_event - m_cpu->now_as_cycles(), m_cpu->clock())); + m_cpu->internal_update(); } - break; - case clock_mode_t::EXTERNAL_RATE_ASYNC: - if(m_clock_state & CLK_TX) { - u64 ctime = u64(current_time*m_internal_to_external_ratio); - if(ctime >= m_tx_clock_base) { - u64 delta = ctime - m_tx_clock_base; - m_tx_clock_base += delta & ~15; - delta &= 15; - bool new_clock = delta >= 8; - if(new_clock != m_tx_clock_value) { - machine().scheduler().synchronize(); - if(!new_clock) - tx_dropped_edge(); - m_tx_clock_value = new_clock; - } - } - - tx_event = u64((m_tx_clock_base + (m_tx_clock_value ? 16 : 8))*m_external_to_internal_ratio)+1; - } - if(m_clock_state & CLK_RX) { - u64 ctime = u64(current_time*m_internal_to_external_ratio); - if(ctime >= m_rx_clock_base) { - u64 delta = ctime - m_rx_clock_base; - m_rx_clock_base += delta & ~15; - delta &= 15; - bool new_clock = delta >= 8; - if(new_clock != m_rx_clock_value) { - machine().scheduler().synchronize(); - if(new_clock) - rx_raised_edge(); - - m_rx_clock_value = new_clock; - } - } + } else if(!m_clock_state) { + m_clock_event = 0; + if(m_clock_mode == INTERNAL_ASYNC_OUT || m_clock_mode == INTERNAL_SYNC_OUT) + m_cpu->do_sci_clk(m_id, 1); + } - rx_event = u64((m_rx_clock_base + (m_rx_clock_value ? 16 : 8))*m_external_to_internal_ratio)+1; - } - break; + return m_clock_event; +} - case clock_mode_t::EXTERNAL_ASYNC: - case clock_mode_t::EXTERNAL_SYNC: - break; - } - u64 event = rx_event; - if(!event || (tx_event && tx_event < event)) - event = tx_event; - if(event) { - attotime ctime = machine().time(); - attotime sync_time = attotime::from_ticks(event-10, m_cpu->clock()); - if(m_cur_sync_time != sync_time && sync_time > ctime) { - m_sync_timer->adjust(sync_time - ctime); - m_cur_sync_time = sync_time; - } - } - return event; +void h8_sci_device::notify_standby(int state) +{ + if(!state && m_clock_event) + m_clock_event += m_cpu->total_cycles() - m_cpu->standby_time(); } void h8_sci_device::clock_start(int mode) @@ -558,48 +436,43 @@ void h8_sci_device::clock_start(int mode) if(m_clock_state & mode) return; - machine().scheduler().synchronize(); + if(mode == CLK_TX) + m_tx_clock_counter = 15; + else + m_rx_clock_counter = 15; + m_clock_state |= mode; - switch(m_clock_mode) { - case clock_mode_t::INTERNAL_ASYNC: - case clock_mode_t::INTERNAL_ASYNC_OUT: - case clock_mode_t::INTERNAL_SYNC_OUT: - if(V>=1) logerror("Starting internal clock\n"); - if(mode == CLK_TX) - m_tx_clock_base = machine().time().as_ticks(m_cpu->clock()); - else - m_rx_clock_base = machine().time().as_ticks(m_cpu->clock()); - m_cpu->internal_update(); - break; + if(m_clock_state != mode) + return; - case clock_mode_t::EXTERNAL_RATE_ASYNC: - if(V>=1) logerror("Simulating external clock async\n"); - if(mode == CLK_TX) - m_tx_clock_base = u64(m_cpu->total_cycles()*m_internal_to_external_ratio); - else - m_rx_clock_base = u64(m_cpu->total_cycles()*m_internal_to_external_ratio); - m_cpu->internal_update(); - break; + m_clock_step = 0; - case clock_mode_t::EXTERNAL_RATE_SYNC: - if(V>=1) logerror("Simulating external clock sync\n"); - if(mode == CLK_TX) - m_tx_clock_base = u64(m_cpu->total_cycles()*2*m_internal_to_external_ratio); - else - m_rx_clock_base = u64(m_cpu->total_cycles()*2*m_internal_to_external_ratio); + switch(m_clock_mode) { + case INTERNAL_ASYNC: + case INTERNAL_ASYNC_OUT: + case INTERNAL_SYNC_OUT: { + LOGMASKED(LOG_CLOCK, "Starting internal clock\n"); + m_clock_step = m_divider; + u64 now = mode == CLK_TX ? m_cpu->total_cycles() : m_cpu->now_as_cycles(); + m_clock_event = (now / m_clock_step + 1) * m_clock_step; + m_sync_timer->adjust(attotime::from_ticks(m_clock_event - now, m_cpu->clock())); m_cpu->internal_update(); break; + } - case clock_mode_t::EXTERNAL_ASYNC: - if(V>=1) logerror("Waiting for external clock async\n"); - if(mode == CLK_TX) - m_tx_ext_clock_counter = 15; - else - m_rx_ext_clock_counter = 15; + case EXTERNAL_RATE_ASYNC: + case EXTERNAL_RATE_SYNC: { + LOGMASKED(LOG_CLOCK, "Simulating external clock\n", m_clock_mode == EXTERNAL_RATE_ASYNC ? "async" : "sync"); + u64 now = mode == CLK_TX ? m_cpu->total_cycles() : m_cpu->now_as_cycles(); + m_clock_event = u64(u64(now * m_internal_to_external_ratio + 1) * m_external_to_internal_ratio + 1); + m_sync_timer->adjust(attotime::from_ticks(m_clock_event - now, m_cpu->clock())); + m_cpu->internal_update(); break; + } - case clock_mode_t::EXTERNAL_SYNC: - if(V>=1) logerror("Waiting for external clock sync\n"); + case EXTERNAL_ASYNC: + case EXTERNAL_SYNC: + LOGMASKED(LOG_CLOCK, "Waiting for external clock\n"); break; } } @@ -607,6 +480,11 @@ void h8_sci_device::clock_start(int mode) void h8_sci_device::clock_stop(int mode) { m_clock_state &= ~mode; + if(!m_clock_state) { + m_clock_event = 0; + m_clock_step = 0; + LOGMASKED(LOG_CLOCK, "Stopping clocks\n"); + } m_cpu->internal_update(); } @@ -615,7 +493,7 @@ void h8_sci_device::tx_start() m_ssr |= SSR_TDRE; m_tsr = m_tdr; m_tx_parity = m_smr & SMR_OE ? 0 : 1; - if(V>=1) logerror("start transmit %02x '%c'\n", m_tsr, m_tsr >= 32 && m_tsr < 127 ? m_tsr : '.'); + LOGMASKED(LOG_DATA, "start transmit %02x '%c'\n", m_tsr, m_tsr >= 32 && m_tsr < 127 ? m_tsr : '.'); if(m_scr & SCR_TIE) m_intc->internal_interrupt(m_txi_int); if(m_smr & SMR_CA) { @@ -630,9 +508,23 @@ void h8_sci_device::tx_start() rx_start(); } -void h8_sci_device::tx_dropped_edge() +void h8_sci_device::tx_async_tick() { - if(V>=2) logerror("tx_dropped_edge state=%s bit=%d\n", state_names[m_tx_state], m_tx_bit); + m_tx_clock_counter = (m_tx_clock_counter + 1) & 15; + LOGMASKED(LOG_TICK, "tx_async_tick %x\n", m_tx_clock_counter); + if(m_tx_clock_counter == 0) { + tx_async_step(); + + if(m_clock_mode == INTERNAL_ASYNC_OUT) + m_cpu->do_sci_clk(m_id, 0); + + } else if(m_tx_clock_counter == 8 && m_clock_mode == INTERNAL_ASYNC_OUT) + m_cpu->do_sci_clk(m_id, 1); +} + +void h8_sci_device::tx_async_step() +{ + LOGMASKED(LOG_STATE, "tx_async_step state=%s bit=%d\n", state_names[m_tx_state], m_tx_bit); switch(m_tx_state) { case ST_START: m_cpu->do_sci_tx(m_id, false); @@ -676,7 +568,7 @@ void h8_sci_device::tx_dropped_edge() m_tx_bit--; if(!m_tx_bit) { if(!(m_ssr & SSR_TDRE)) - tx_start(); + tx_start(); else { m_tx_state = ST_LAST_TICK; m_tx_bit = 0; @@ -701,14 +593,49 @@ void h8_sci_device::tx_dropped_edge() default: abort(); } - if(V>=2) logerror(" -> state=%s bit=%d\n", state_names[m_tx_state], m_tx_bit); + LOGMASKED(LOG_STATE, " -> state=%s bit=%d\n", state_names[m_tx_state], m_tx_bit); +} + +void h8_sci_device::tx_sync_tick() +{ + m_tx_clock_counter = (m_tx_clock_counter + 1) & 1; + LOGMASKED(LOG_TICK, "tx_sync_tick %x\n", m_tx_clock_counter); + if(m_tx_clock_counter == 0) { + tx_sync_step(); + + if(m_clock_mode == INTERNAL_SYNC_OUT && m_tx_state != ST_IDLE) + m_cpu->do_sci_clk(m_id, 0); + + } else if(m_tx_clock_counter == 1 && m_clock_mode == INTERNAL_SYNC_OUT) + m_cpu->do_sci_clk(m_id, 1); +} + +void h8_sci_device::tx_sync_step() +{ + LOGMASKED(LOG_STATE, "tx_sync_step bit=%d\n", m_tx_bit); + if(!m_tx_bit) { + m_tx_state = ST_IDLE; + clock_stop(CLK_TX); + m_cpu->do_sci_tx(m_id, 1); + m_ssr |= SSR_TEND; + if(m_scr & SCR_TEIE) + m_intc->internal_interrupt(m_tei_int); + + // if there's more to send, start the transmitter + if((m_scr & SCR_TE) && !(m_ssr & SSR_TDRE)) + tx_start(); + } else { + m_cpu->do_sci_tx(m_id, m_tsr & 1); + m_tsr >>= 1; + m_tx_bit--; + } } void h8_sci_device::rx_start() { m_rx_parity = m_smr & SMR_OE ? 0 : 1; m_rsr = 0x00; - if(V>=2) logerror("start receive\n"); + LOGMASKED(LOG_STATE, "start receive\n"); if(m_smr & SMR_CA) { m_rx_state = ST_BIT; m_rx_bit = 8; @@ -726,13 +653,13 @@ void h8_sci_device::rx_done() if(!(m_ssr & SSR_FER)) { if((m_smr & SMR_PE) && m_rx_parity) { m_ssr |= SSR_PER; - if(V>=1) logerror("Receive parity error\n"); + LOGMASKED(LOG_DATA, "Receive parity error\n"); } else if(m_ssr & SSR_RDRF) { m_ssr |= SSR_ORER; - if(V>=1) logerror("Receive overrun\n"); + LOGMASKED(LOG_DATA, "Receive overrun\n"); } else { m_ssr |= SSR_RDRF; - if(V>=1) logerror("Received %02x '%c'\n", m_rsr, m_rsr >= 32 && m_rsr < 127 ? m_rsr : '.'); + LOGMASKED(LOG_DATA, "Received %02x '%c'\n", m_rsr, m_rsr >= 32 && m_rsr < 127 ? m_rsr : '.'); m_rdr = m_rsr; } } @@ -750,9 +677,17 @@ void h8_sci_device::rx_done() } } -void h8_sci_device::rx_raised_edge() +void h8_sci_device::rx_async_tick() +{ + m_rx_clock_counter = (m_rx_clock_counter + 1) & 15; + LOGMASKED(LOG_TICK, "rx_async_tick %x\n", m_rx_clock_counter); + if(m_rx_clock_counter == 8) + rx_async_step(); +} + +void h8_sci_device::rx_async_step() { - if(V>=2) logerror("rx_raised_edge state=%s bit=%d\n", state_names[m_rx_state], m_rx_bit); + LOGMASKED(LOG_STATE, "rx_async_step state=%s bit=%d\n", state_names[m_rx_state], m_rx_bit); switch(m_rx_state) { case ST_START: if(m_rx_value) { @@ -803,5 +738,33 @@ void h8_sci_device::rx_raised_edge() default: abort(); } - if(V>=2) logerror(" -> state=%s, bit=%d\n", state_names[m_rx_state], m_rx_bit); + LOGMASKED(LOG_STATE, " -> state=%s, bit=%d\n", state_names[m_rx_state], m_rx_bit); +} + +void h8_sci_device::rx_sync_tick() +{ + m_rx_clock_counter = (m_rx_clock_counter + 1) & 1; + LOGMASKED(LOG_TICK, "rx_sync_tick %x\n", m_rx_clock_counter); + + if(m_rx_clock_counter == 0 && m_clock_mode == INTERNAL_SYNC_OUT) + m_cpu->do_sci_clk(m_id, 0); + + else if(m_rx_clock_counter == 1) { + if(m_clock_mode == INTERNAL_SYNC_OUT) + m_cpu->do_sci_clk(m_id, 1); + + rx_sync_step(); + } +} + +void h8_sci_device::rx_sync_step() +{ + LOGMASKED(LOG_STATE, "rx_sync_step bit=%d\n", m_rx_value); + m_rsr >>= 1; + if(m_rx_value) + m_rsr |= 0x80; + m_rx_bit--; + + if(!m_rx_bit) + rx_done(); } diff --git a/src/devices/cpu/h8/h8_sci.h b/src/devices/cpu/h8/h8_sci.h index 170745fa668d8..5a3671e63abf4 100644 --- a/src/devices/cpu/h8/h8_sci.h +++ b/src/devices/cpu/h8/h8_sci.h @@ -52,6 +52,7 @@ class h8_sci_device : public device_t { void do_clk_w(int state); u64 internal_update(u64 current_time); + void notify_standby(int state); protected: enum { @@ -65,7 +66,7 @@ class h8_sci_device : public device_t { CLK_RX = 2 }; - enum class clock_mode_t { + enum { INTERNAL_ASYNC, INTERNAL_ASYNC_OUT, EXTERNAL_ASYNC, @@ -106,35 +107,42 @@ class h8_sci_device : public device_t { required_device m_cpu; required_device m_intc; - attotime m_external_clock_period, m_cur_sync_time; + attotime m_external_clock_period; double m_external_to_internal_ratio, m_internal_to_external_ratio; emu_timer *m_sync_timer; int m_id, m_eri_int, m_rxi_int, m_txi_int, m_tei_int; - int m_tx_state, m_rx_state, m_tx_bit, m_rx_bit, m_clock_state, m_tx_parity, m_rx_parity, m_tx_ext_clock_counter, m_rx_ext_clock_counter; - clock_mode_t m_clock_mode; - bool m_tx_clock_value, m_rx_clock_value, m_ext_clock_value, m_rx_value; + int m_tx_state, m_rx_state, m_tx_bit, m_rx_bit, m_clock_state, m_tx_parity, m_rx_parity, m_tx_clock_counter, m_rx_clock_counter; + u32 m_clock_mode; + bool m_ext_clock_value, m_rx_value; u8 m_rdr, m_tdr, m_smr, m_scr, m_ssr, m_brr, m_rsr, m_tsr; - u64 m_tx_clock_base, m_rx_clock_base, m_divider; + u64 m_clock_event, m_clock_step, m_divider; std::string m_last_clock_message; void device_start() override; void device_reset() override; - void device_post_load() override; TIMER_CALLBACK_MEMBER(sync_tick); void clock_start(int mode); void clock_stop(int mode); void clock_update(); + void tx_start(); - void tx_dropped_edge(); + void tx_async_tick(); + void tx_async_step(); + void tx_sync_tick(); + void tx_sync_step(); + void rx_start(); void rx_done(); - void rx_raised_edge(); + void rx_async_tick(); + void rx_async_step(); + void rx_sync_tick(); + void rx_sync_step(); bool is_sync_start() const; bool has_recv_error() const; diff --git a/src/devices/cpu/h8/h8_timer16.cpp b/src/devices/cpu/h8/h8_timer16.cpp index 20ef62a7fbd45..d7aa2c2a8cfb3 100644 --- a/src/devices/cpu/h8/h8_timer16.cpp +++ b/src/devices/cpu/h8/h8_timer16.cpp @@ -12,12 +12,16 @@ Or if it's edge triggered, will it trigger an IRQ on rising edge of (irq_enable & flag)? Note that mu100 will lock up at boot if it's triggered at rising edge of (flag) or (irq_enable & flag). + - When writing 0 to the status register(s), the overflow/compare match + flags will only be cleared after a read access was done while they + were set? It's how the databook explains it, similar to HD6301. - H8/325 16-bit timer is shoehorned in and may have a bug lurking? It doesn't have TGR registers, but functionally equivalent OCR/ICR. - Make the base class more generic, and derive the devices from that, so they don't have to jumble so much with the IRQ/flag bits. The overflow IRQ/flag being hardcoded on bit 4 is also problematic. - Proper support for input capture registers. + - Add support for chained timers. ***************************************************************************/ @@ -122,7 +126,8 @@ void h8_timer16_channel_device::tier_w(u8 data) u8 h8_timer16_channel_device::tsr_r() { - update_counter(); + if(!machine().side_effects_disabled()) + update_counter(); return isr_to_sr(); } @@ -136,7 +141,8 @@ void h8_timer16_channel_device::tsr_w(u8 data) u16 h8_timer16_channel_device::tcnt_r() { - update_counter(); + if(!machine().side_effects_disabled()) + update_counter(); return m_tcnt; } @@ -163,7 +169,7 @@ void h8_timer16_channel_device::tgr_w(offs_t offset, u16 data, u16 mem_mask) u16 h8_timer16_channel_device::tbr_r(offs_t offset) { - return m_tgr[offset+m_tgr_count]; + return m_tgr[offset + m_tgr_count]; } void h8_timer16_channel_device::tbr_w(offs_t offset, u16 data, u16 mem_mask) @@ -196,7 +202,7 @@ void h8_timer16_channel_device::device_start() void h8_timer16_channel_device::device_reset() { - // Don't touch channel_active here, top level device handles it + // Don't touch channel_active here, top level device handles it. m_tcr = 0; m_tcnt = 0; memset(m_tgr, 0xff, sizeof(m_tgr)); @@ -215,14 +221,23 @@ void h8_timer16_channel_device::device_reset() u64 h8_timer16_channel_device::internal_update(u64 current_time) { - if(m_event_time && current_time >= m_event_time) { - update_counter(current_time); - recalc_event(current_time); + while(m_event_time && current_time >= m_event_time) { + update_counter(m_event_time); + recalc_event(m_event_time); } return m_event_time; } +void h8_timer16_channel_device::notify_standby(int state) +{ + if(!state && m_event_time) { + u64 delta = m_cpu->total_cycles() - m_cpu->standby_time(); + m_event_time += delta; + m_last_clock_update += delta; + } +} + void h8_timer16_channel_device::update_counter(u64 cur_time) { if(m_clock_type != DIV_1) @@ -237,29 +252,58 @@ void h8_timer16_channel_device::update_counter(u64 cur_time) } u64 base_time = m_last_clock_update; + m_last_clock_update = cur_time; u64 new_time = cur_time; if(m_clock_divider) { base_time = (base_time + m_phase) >> m_clock_divider; new_time = (new_time + m_phase) >> m_clock_divider; } + if(new_time == base_time) + return; + if(m_counter_incrementing) { - int tt = m_tcnt + new_time - base_time; - m_tcnt = tt % m_counter_cycle; + u16 prev = m_tcnt; + u64 delta = new_time - base_time; + u64 tt = m_tcnt + delta; + + if(prev >= m_counter_cycle) { + if(tt >= 0x10000) + m_tcnt = (tt - 0x10000) % m_counter_cycle; + else + m_tcnt = tt; + } + else + m_tcnt = tt % m_counter_cycle; + + for(int i = 0; i < m_tgr_count; i++) { + bool match = m_tcnt == m_tgr[i] || (tt == m_tgr[i] && tt == m_counter_cycle); + if(!match) { + // Need to do additional checks here for software that polls the flags with interrupts disabled, + // since recalc_event only schedules IRQ events. + if(prev >= m_counter_cycle) + match = (m_tgr[i] > prev && tt >= m_tgr[i]) || (m_tgr[i] <= m_counter_cycle && m_tcnt < m_counter_cycle && (delta - (0x10000 - prev)) >= m_tgr[i]); + else if(m_tgr[i] <= m_counter_cycle) + match = delta >= m_counter_cycle || (prev < m_tgr[i] && tt >= m_tgr[i]) || (m_tcnt <= prev && m_tcnt >= m_tgr[i]); + + if(match && BIT(m_ier, i) && m_interrupt[i] != -1) + logerror("update_counter unexpected TGR %d IRQ\n, i"); + } - for(int i=0; iinternal_interrupt(m_interrupt[i]); } - if(tt >= 0x10000) { + } + if(tt >= 0x10000 && (m_counter_cycle == 0x10000 || prev >= m_counter_cycle)) { m_isr |= IRQ_V; - if (m_ier & IRQ_V && m_interrupt[4] != -1) + if(m_ier & IRQ_V && m_interrupt[4] != -1) m_intc->internal_interrupt(m_interrupt[4]); } - } else - m_tcnt = (((m_tcnt ^ 0xffff) + new_time - base_time) % m_counter_cycle) ^ 0xffff; - m_last_clock_update = cur_time; + } else { + logerror("decrementing counter\n"); + exit(1); + } } void h8_timer16_channel_device::recalc_event(u64 cur_time) @@ -287,16 +331,13 @@ void h8_timer16_channel_device::recalc_event(u64 cur_time) u32 event_delay = 0xffffffff; if(m_tgr_clearing >= 0 && m_tgr[m_tgr_clearing]) m_counter_cycle = m_tgr[m_tgr_clearing]; - else { + else m_counter_cycle = 0x10000; - if(m_ier & IRQ_V) { - event_delay = m_counter_cycle - m_tcnt; - if(!event_delay) - event_delay = m_counter_cycle; - } - } - for(int i=0; i= m_counter_cycle)) + event_delay = 0x10000 - m_tcnt; + + for(int i = 0; i < m_tgr_count; i++) + if(BIT(m_ier, i) && m_interrupt[i] != -1) { u32 new_delay = 0xffffffff; if(m_tgr[i] > m_tcnt) { if(m_tcnt >= m_counter_cycle || m_tgr[i] <= m_counter_cycle) @@ -316,7 +357,6 @@ void h8_timer16_channel_device::recalc_event(u64 cur_time) m_event_time = ((((cur_time + (1ULL << m_clock_divider) - m_phase) >> m_clock_divider) + event_delay - 1) << m_clock_divider) + m_phase; else m_event_time = 0; - } else { logerror("decrementing counter\n"); exit(1); @@ -339,10 +379,10 @@ void h8_timer16_device::device_start() save_item(NAME(m_tstr)); } -void h8_timer16_device::device_reset() +void h8_timer16_device::device_reset_after_children() { m_tstr = m_default_tstr; - for(int i=0; iset_enable((m_tstr >> i) & 1); } @@ -356,7 +396,7 @@ void h8_timer16_device::tstr_w(u8 data) { if(V>=1) logerror("tstr_w %02x\n", data); m_tstr = data; - for(int i=0; iset_enable((m_tstr >> i) & 1); } @@ -413,9 +453,9 @@ void h8_timer16_device::tocr_w(u8 data) u8 h8_timer16_device::tisr_r(offs_t offset) { u8 r = 0; - for(int i=0; itisr_r(offset) << i; - for(int i=m_timer_count; i<4; i++) + for(int i = m_timer_count; i < 4; i++) r |= 0x11 <=1) logerror("tisr%c_r %02x\n", 'a'+offset, r); @@ -426,7 +466,7 @@ u8 h8_timer16_device::tisr_r(offs_t offset) void h8_timer16_device::tisr_w(offs_t offset, u8 data) { if(V>=1) logerror("tisr%c_w %02x\n", 'a'+offset, data); - for(int i=0; itisr_w(offset, data >> i); } @@ -579,7 +619,7 @@ void h8325_timer16_channel_device::isr_update(u8 val) { m_tcsr = val; - if (val & 1) + if(val & 1) m_tgr_clearing = 0; else m_tgr_clearing = TGR_CLEAR_NONE; diff --git a/src/devices/cpu/h8/h8_timer16.h b/src/devices/cpu/h8/h8_timer16.h index fb53e0bfc217c..2051bbe59fdd0 100644 --- a/src/devices/cpu/h8/h8_timer16.h +++ b/src/devices/cpu/h8/h8_timer16.h @@ -91,6 +91,7 @@ class h8_timer16_channel_device : public device_t { void tbr_w(offs_t offset, u16 data, u16 mem_mask = ~0); u64 internal_update(u64 current_time); + void notify_standby(int state); void set_ier(u8 value); void set_enable(bool enable); void tisr_w(int offset, u8 data); @@ -271,7 +272,7 @@ class h8_timer16_device : public device_t { u8 m_tstr; virtual void device_start() override; - virtual void device_reset() override; + virtual void device_reset_after_children() override; }; DECLARE_DEVICE_TYPE(H8_TIMER16, h8_timer16_device) diff --git a/src/devices/cpu/h8/h8_timer8.cpp b/src/devices/cpu/h8/h8_timer8.cpp index 1af76263a71d8..c35310df25552 100644 --- a/src/devices/cpu/h8/h8_timer8.cpp +++ b/src/devices/cpu/h8/h8_timer8.cpp @@ -11,6 +11,9 @@ while an overflow or compare match flag is 1, will it trigger an IRQ? Or if it's edge triggered, will it trigger an IRQ on rising edge of (irq_enable & flag)? + - When writing 0 to the status register(s), the overflow/compare match + flags will only be cleared after a read access was done while they + were set? It's how the databook explains it, similar to HD6301. ***************************************************************************/ @@ -169,8 +172,10 @@ void h8_timer8_channel_device::tcor_w(offs_t offset, u8 data) u8 h8_timer8_channel_device::tcnt_r() { - update_counter(); - recalc_event(); + if(!machine().side_effects_disabled()) { + update_counter(); + recalc_event(); + } return m_tcnt; } @@ -204,29 +209,51 @@ void h8_timer8_channel_device::device_reset() u64 h8_timer8_channel_device::internal_update(u64 current_time) { - if(m_event_time && current_time >= m_event_time) { - update_counter(current_time); - recalc_event(current_time); + while(m_event_time && current_time >= m_event_time) { + update_counter(m_event_time); + recalc_event(m_event_time); } return m_event_time; } -void h8_timer8_channel_device::update_counter(u64 cur_time) +void h8_timer8_channel_device::notify_standby(int state) { - if(m_clock_type != DIV) - return; + if(!state && m_event_time) { + u64 delta = m_cpu->total_cycles() - m_cpu->standby_time(); + m_event_time += delta; + m_last_clock_update += delta; + } +} - if(!cur_time) - cur_time = m_cpu->total_cycles(); +void h8_timer8_channel_device::update_counter(u64 cur_time, u64 delta) +{ + if(m_clock_type == DIV) { + if(!cur_time) + cur_time = m_cpu->total_cycles(); + + u64 base_time = (m_last_clock_update + m_clock_divider/2) / m_clock_divider; + m_last_clock_update = cur_time; + u64 new_time = (cur_time + m_clock_divider/2) / m_clock_divider; + delta = new_time - base_time; + } + + if(!delta) + return; - u64 base_time = (m_last_clock_update + m_clock_divider/2) / m_clock_divider; - u64 new_time = (cur_time + m_clock_divider/2) / m_clock_divider; + u8 prev = m_tcnt; + u64 tt = m_tcnt + delta; - int tt = m_tcnt + new_time - base_time; - m_tcnt = tt % m_counter_cycle; + if(prev >= m_counter_cycle) { + if(tt >= 0x100) + m_tcnt = (tt - 0x100) % m_counter_cycle; + else + m_tcnt = tt; + } + else + m_tcnt = tt % m_counter_cycle; - if(tt == m_tcor[0] || m_tcnt == m_tcor[0]) { + if(m_tcnt == m_tcor[0] || (tt == m_tcor[0] && tt == m_counter_cycle)) { if(m_chained_timer) m_chained_timer->chained_timer_tcora(); @@ -243,7 +270,7 @@ void h8_timer8_channel_device::update_counter(u64 cur_time) m_intc->internal_interrupt(m_irq_cb); } - if(tt >= 0x100) { + if(tt >= 0x100 && (m_counter_cycle == 0x100 || prev >= m_counter_cycle)) { if(m_chained_timer) m_chained_timer->chained_timer_overflow(); if(!(m_tcsr & TCSR_OVF)) { @@ -252,7 +279,6 @@ void h8_timer8_channel_device::update_counter(u64 cur_time) m_intc->internal_interrupt(m_irq_v); } } - m_last_clock_update = cur_time; } void h8_timer8_channel_device::recalc_event(u64 cur_time) @@ -273,12 +299,10 @@ void h8_timer8_channel_device::recalc_event(u64 cur_time) u32 event_delay = 0xffffffff; if((m_clear_type == CLEAR_A || m_clear_type == CLEAR_B) && m_tcor[m_clear_type - CLEAR_A]) m_counter_cycle = m_tcor[m_clear_type - CLEAR_A]; - else { + else m_counter_cycle = 0x100; - event_delay = m_counter_cycle - m_tcnt; - if(!event_delay) - event_delay = m_counter_cycle; - } + if(m_counter_cycle == 0x100 || m_tcnt >= m_counter_cycle) + event_delay = 0x100 - m_tcnt; for(auto &elem : m_tcor) { u32 new_delay = 0xffffffff; @@ -307,45 +331,13 @@ void h8_timer8_channel_device::recalc_event(u64 cur_time) void h8_timer8_channel_device::chained_timer_overflow() { if(m_clock_type == CHAIN_OVERFLOW) - timer_tick(); + update_counter(0, 1); } void h8_timer8_channel_device::chained_timer_tcora() { if(m_clock_type == CHAIN_A) - timer_tick(); -} - -void h8_timer8_channel_device::timer_tick() -{ - m_tcnt++; - - if(m_tcnt == m_tcor[0]) { - if(m_chained_timer) - m_chained_timer->chained_timer_tcora(); - - if(!(m_tcsr & TCSR_CMFA)) { - m_tcsr |= TCSR_CMFA; - if(m_tcr & TCR_CMIEA) - m_intc->internal_interrupt(m_irq_ca); - } - } - - if(!(m_tcsr & TCSR_CMFB) && m_tcnt == m_tcor[1]) { - m_tcsr |= TCSR_CMFB; - if(m_tcr & TCR_CMIEB) - m_intc->internal_interrupt(m_irq_cb); - } - - if(m_tcnt == 0x00) { - if(m_chained_timer) - m_chained_timer->chained_timer_overflow(); - if(!(m_tcsr & TCSR_OVF)) { - m_tcsr |= TCSR_OVF; - if(m_tcr & TCR_OVIE) - m_intc->internal_interrupt(m_irq_v); - } - } + update_counter(0, 1); } h8h_timer8_channel_device::h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : diff --git a/src/devices/cpu/h8/h8_timer8.h b/src/devices/cpu/h8/h8_timer8.h index c5f6dd98f39eb..65468a76a5d41 100644 --- a/src/devices/cpu/h8/h8_timer8.h +++ b/src/devices/cpu/h8/h8_timer8.h @@ -56,6 +56,7 @@ class h8_timer8_channel_device : public device_t { void tcnt_w(u8 data); u64 internal_update(u64 current_time); + void notify_standby(int state); void set_extra_clock_bit(bool bit); void chained_timer_overflow(); @@ -100,10 +101,9 @@ class h8_timer8_channel_device : public device_t { virtual void device_start() override; virtual void device_reset() override; - void update_counter(u64 cur_time = 0); + void update_counter(u64 cur_time = 0, u64 delta = 0); void recalc_event(u64 cur_time = 0); - void timer_tick(); void update_tcr(); }; diff --git a/src/devices/cpu/h8/h8_watchdog.cpp b/src/devices/cpu/h8/h8_watchdog.cpp index cecc47bb579aa..a998c95437760 100644 --- a/src/devices/cpu/h8/h8_watchdog.cpp +++ b/src/devices/cpu/h8/h8_watchdog.cpp @@ -1,13 +1,25 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +/*************************************************************************** + + h8_watchdog.cpp + + H8 watchdog/timer + + TODO: + - add RSTCSR for MCUs that have it (reset is only enabled when RSTI is 1) + - It will only clear the overflow flag when writing 0 after reading it + when it's set? It's how the databook explains it, similar to HD6301. + +***************************************************************************/ #include "emu.h" #include "h8_watchdog.h" DEFINE_DEVICE_TYPE(H8_WATCHDOG, h8_watchdog_device, "h8_watchdog", "H8 watchdog") -const int h8_watchdog_device::div_bh[8] = { 1, 6, 7, 9, 11, 13, 15, 17 }; -const int h8_watchdog_device::div_s [8] = { 1, 5, 6, 7, 8, 9, 11, 12 }; +const int h8_watchdog_device::div_bh[8] = { 1, 5, 6, 7, 8, 9, 11, 12 }; +const int h8_watchdog_device::div_s [8] = { 1, 6, 7, 9, 11, 13, 15, 17 }; h8_watchdog_device::h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, H8_WATCHDOG, tag, owner, clock), @@ -24,11 +36,18 @@ u64 h8_watchdog_device::internal_update(u64 current_time) int shift = (m_type == S ? div_s : div_bh)[m_tcsr & TCSR_CKS]; u64 spos = m_tcnt_cycle_base >> shift; return (spos + 0x100 - m_tcnt) << shift; - } else return 0; } +void h8_watchdog_device::notify_standby(int state) +{ + if(state) + tcnt_update(); + else + m_tcnt_cycle_base = m_cpu->total_cycles(); +} + void h8_watchdog_device::tcnt_update(u64 cur_time) { if(m_tcsr & TCSR_TME) { @@ -38,7 +57,7 @@ void h8_watchdog_device::tcnt_update(u64 cur_time) u64 spos = m_tcnt_cycle_base >> shift; u64 epos = cur_time >> shift; - int next_tcnt = m_tcnt + int(epos - spos); + u64 next_tcnt = m_tcnt + (epos - spos); m_tcnt = next_tcnt; m_tcnt_cycle_base = cur_time; //logerror("%10lld tcnt %02x -> %03x shift=%d\n", cur_time, m_tcnt, next_tcnt, shift); @@ -59,14 +78,15 @@ void h8_watchdog_device::tcnt_update(u64 cur_time) } } else m_tcnt = 0; - } u16 h8_watchdog_device::wd_r() { if(!machine().side_effects_disabled()) tcnt_update(); - return (m_tcsr << 8) | m_tcnt; + + u8 tcsr_mask = m_type == B ? 0x10 : 0x18; + return ((m_tcsr | tcsr_mask) << 8) | m_tcnt; } void h8_watchdog_device::wd_w(offs_t offset, u16 data, u16 mem_mask) @@ -78,8 +98,7 @@ void h8_watchdog_device::wd_w(offs_t offset, u16 data, u16 mem_mask) tcnt_update(); if(!(m_tcsr & TCSR_TME) && (data & TCSR_TME)) m_tcnt_cycle_base = m_cpu->total_cycles(); - m_tcsr = data & 0xff; - m_tcsr |= m_type == B ? 0x10 : 0x18; + m_tcsr = (m_tcsr & data & TCSR_OVF) | (data & 0x7f); m_cpu->internal_update(); } @@ -97,11 +116,16 @@ u16 h8_watchdog_device::rst_r() { if(!machine().side_effects_disabled()) logerror("rst_r\n"); - return 0; + + u8 rst_mask = m_type == S ? 0x1f : 0x3f; + return m_rst | rst_mask; } -void h8_watchdog_device::rst_w(u16 data) +void h8_watchdog_device::rst_w(offs_t offset, u16 data, u16 mem_mask) { + if(mem_mask != 0xffff) + return; + if((data & 0xff00) == 0xa500) logerror("wowf_w %02x\n", data & 0xff); if((data & 0xff00) == 0x5a00) @@ -118,8 +142,8 @@ void h8_watchdog_device::device_start() void h8_watchdog_device::device_reset() { - m_tcnt = 0x00; m_tcnt_cycle_base = m_cpu->total_cycles(); - m_tcsr = m_type == B ? 0x10 : 0x18; - m_rst = m_type == S ? 0x1f : 0x3f; + m_tcnt = 0x00; + m_tcsr = 0x00; + m_rst = 0x00; } diff --git a/src/devices/cpu/h8/h8_watchdog.h b/src/devices/cpu/h8/h8_watchdog.h index c6882fb1d5bba..7516816f3bc8b 100644 --- a/src/devices/cpu/h8/h8_watchdog.h +++ b/src/devices/cpu/h8/h8_watchdog.h @@ -31,11 +31,12 @@ class h8_watchdog_device : public device_t { } u64 internal_update(u64 current_time); + void notify_standby(int state); u16 wd_r(); void wd_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 rst_r(); - void rst_w(u16 data); + void rst_w(offs_t offset, u16 data, u16 mem_mask = ~0); protected: virtual void device_start() override; diff --git a/src/devices/cpu/h8/h8s2245.cpp b/src/devices/cpu/h8/h8s2245.cpp index fe93cbca22630..a7a51c26f3a98 100644 --- a/src/devices/cpu/h8/h8s2245.cpp +++ b/src/devices/cpu/h8/h8s2245.cpp @@ -73,8 +73,7 @@ void h8s2245_device::map(address_map &map) map(0xfffebd, 0xfffebd).w(m_porte, FUNC(h8_port_device::ddr_w)); map(0xfffebe, 0xfffebe).w(m_portf, FUNC(h8_port_device::ddr_w)); map(0xfffebf, 0xfffebf).w(m_portg, FUNC(h8_port_device::ddr_w)); - map(0xfffec0, 0xfffec1).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); - map(0xfffec2, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icrc_r), FUNC(h8s_intc_device::icrc_w)); + map(0xfffec0, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); map(0xffff2c, 0xffff2c).rw(m_intc, FUNC(h8s_intc_device::iscrh_r), FUNC(h8s_intc_device::iscrh_w)); map(0xffff2d, 0xffff2d).rw(m_intc, FUNC(h8s_intc_device::iscrl_r), FUNC(h8s_intc_device::iscrl_w)); map(0xffff2e, 0xffff2e).rw(m_intc, FUNC(h8s_intc_device::ier_r), FUNC(h8s_intc_device::ier_w)); @@ -190,36 +189,36 @@ void h8s2245_device::device_add_mconfig(machine_config &config) H8_PORT(config, m_porte, *this, h8_device::PORT_E, 0x00, 0x00); H8_PORT(config, m_portf, *this, h8_device::PORT_F, 0x00, 0x00); H8_PORT(config, m_portg, *this, h8_device::PORT_G, 0xe0, 0x00); - H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); - H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); + H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); + H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); H8_TIMER16(config, m_timer16, *this, 3, 0x00); H8S_TIMER16_CHANNEL(config, m_timer16_0, *this, 4, 0x60, m_intc, 32, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::INPUT_D); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::INPUT_D); H8S_TIMER16_CHANNEL(config, m_timer16_1, *this, 2, 0x4c, m_intc, 40, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); H8S_TIMER16_CHANNEL(config, m_timer16_2, *this, 2, 0x4c, m_intc, 44, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024); H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); @@ -300,6 +299,20 @@ void h8s2245_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h8s2245_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_sci[2]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h8s2245_device::device_start() { h8s2000_device::device_start(); diff --git a/src/devices/cpu/h8/h8s2245.h b/src/devices/cpu/h8/h8s2245.h index 14744418a4e39..fd01c71b928d3 100644 --- a/src/devices/cpu/h8/h8s2245.h +++ b/src/devices/cpu/h8/h8s2245.h @@ -102,6 +102,7 @@ class h8s2245_device : public h8s2000_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h8s2319.cpp b/src/devices/cpu/h8/h8s2319.cpp new file mode 100644 index 0000000000000..8a439404f4277 --- /dev/null +++ b/src/devices/cpu/h8/h8s2319.cpp @@ -0,0 +1,458 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert, hap +/*************************************************************************** + + h8s2319.cpp + + H8S-2319 family emulation + +***************************************************************************/ + +#include "emu.h" +#include "h8s2319.h" + +DEFINE_DEVICE_TYPE(H8S2310, h8s2310_device, "h8s2310", "Hitachi H8S/2310") +DEFINE_DEVICE_TYPE(H8S2311, h8s2311_device, "h8s2311", "Hitachi H8S/2311") +DEFINE_DEVICE_TYPE(H8S2312, h8s2312_device, "h8s2312", "Hitachi H8S/2312") +DEFINE_DEVICE_TYPE(H8S2313, h8s2313_device, "h8s2313", "Hitachi H8S/2313") +DEFINE_DEVICE_TYPE(H8S2315, h8s2315_device, "h8s2315", "Hitachi H8S/2315") +DEFINE_DEVICE_TYPE(H8S2316, h8s2316_device, "h8s2316", "Hitachi H8S/2316") +DEFINE_DEVICE_TYPE(H8S2317, h8s2317_device, "h8s2317", "Hitachi H8S/2317") +DEFINE_DEVICE_TYPE(H8S2318, h8s2318_device, "h8s2318", "Hitachi H8S/2318") +DEFINE_DEVICE_TYPE(H8S2319, h8s2319_device, "h8s2319", "Hitachi H8S/2319") + + +h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start) : + h8s2000_device(mconfig, type, tag, owner, clock, map_delegate), + m_intc(*this, "intc"), + m_adc(*this, "adc"), + m_dtc(*this, "dtc"), + m_portn(*this, "port%u", 1), + m_porta(*this, "port%c", 'a'), + m_timer8(*this, "timer8_%u", 0), + m_timer16(*this, "timer16"), + m_timer16c(*this, "timer16:%u", 0), + m_watchdog(*this, "watchdog"), + m_ram_view(*this, "ram_view"), + m_ram_start(start) +{ +} + +h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) : + h8s2319_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2319_device::map), this), start) +{ +} + +h8s2319_device::h8s2319_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2319, tag, owner, clock, 0xffdc00) +{ +} + +h8s2310_device::h8s2310_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2310, tag, owner, clock, 0xfff400) +{ +} + +h8s2311_device::h8s2311_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2311, tag, owner, clock, 0xfff400) +{ +} + +h8s2312_device::h8s2312_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2312, tag, owner, clock, 0xffdc00) +{ +} + +h8s2313_device::h8s2313_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2313, tag, owner, clock, 0xfff400) +{ +} + +h8s2315_device::h8s2315_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2315, tag, owner, clock, 0xffdc00) +{ +} + +h8s2316_device::h8s2316_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2316, tag, owner, clock, 0xffdc00) +{ +} + +h8s2317_device::h8s2317_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2317, tag, owner, clock, 0xffdc00) +{ +} + +h8s2318_device::h8s2318_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2319_device(mconfig, H8S2318, tag, owner, clock, 0xffdc00) +{ +} + +void h8s2319_device::map(address_map &map) +{ + map(m_ram_start, 0xfffbff).view(m_ram_view); + m_ram_view[0](m_ram_start, 0xfffbff).ram().share(m_internal_ram); + + map(0xfffe80, 0xfffe80).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xfffe81, 0xfffe81).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xfffe82, 0xfffe83).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xfffe84, 0xfffe84).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xfffe85, 0xfffe85).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xfffe86, 0xfffe87).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xfffe88, 0xfffe8f).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); + map(0xfffe90, 0xfffe90).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xfffe91, 0xfffe91).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xfffe92, 0xfffe92).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xfffe94, 0xfffe94).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xfffe95, 0xfffe95).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xfffe96, 0xfffe97).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xfffe98, 0xfffe9b).rw(m_timer16c[4], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); + map(0xfffea0, 0xfffea0).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xfffea1, 0xfffea1).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xfffea2, 0xfffea2).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xfffea4, 0xfffea4).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xfffea5, 0xfffea5).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xfffea6, 0xfffea7).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xfffea8, 0xfffeab).rw(m_timer16c[5], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); + + map(0xfffeb0, 0xfffeb0).w(m_portn[0], FUNC(h8_port_device::ddr_w)); + map(0xfffeb1, 0xfffeb1).w(m_portn[1], FUNC(h8_port_device::ddr_w)); + map(0xfffeb2, 0xfffeb2).w(m_portn[2], FUNC(h8_port_device::ddr_w)); + map(0xfffeb9, 0xfffeb9).w(m_porta[0], FUNC(h8_port_device::ddr_w)); + map(0xfffeba, 0xfffeba).w(m_porta[1], FUNC(h8_port_device::ddr_w)); + map(0xfffebb, 0xfffebb).w(m_porta[2], FUNC(h8_port_device::ddr_w)); + map(0xfffebc, 0xfffebc).w(m_porta[3], FUNC(h8_port_device::ddr_w)); + map(0xfffebd, 0xfffebd).w(m_porta[4], FUNC(h8_port_device::ddr_w)); + map(0xfffebe, 0xfffebe).w(m_porta[5], FUNC(h8_port_device::ddr_w)); + map(0xfffebf, 0xfffebf).w(m_porta[6], FUNC(h8_port_device::ddr_w)); + + map(0xfffec4, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); + map(0xffff2c, 0xffff2c).rw(m_intc, FUNC(h8s_intc_device::iscrh_r), FUNC(h8s_intc_device::iscrh_w)); + map(0xffff2d, 0xffff2d).rw(m_intc, FUNC(h8s_intc_device::iscrl_r), FUNC(h8s_intc_device::iscrl_w)); + map(0xffff2e, 0xffff2e).rw(m_intc, FUNC(h8s_intc_device::ier_r), FUNC(h8s_intc_device::ier_w)); + map(0xffff2f, 0xffff2f).rw(m_intc, FUNC(h8s_intc_device::isr_r), FUNC(h8s_intc_device::isr_w)); + map(0xffff30, 0xffff34).rw(m_dtc, FUNC(h8_dtc_device::dtcer_r), FUNC(h8_dtc_device::dtcer_w)); + map(0xffff37, 0xffff37).rw(m_dtc, FUNC(h8_dtc_device::dtvecr_r), FUNC(h8_dtc_device::dtvecr_w)); + map(0xffff38, 0xffff38).rw(FUNC(h8s2319_device::sbycr_r), FUNC(h8s2319_device::sbycr_w)); + map(0xffff39, 0xffff39).rw(FUNC(h8s2319_device::syscr_r), FUNC(h8s2319_device::syscr_w)); + + map(0xffff50, 0xffff50).r(m_portn[0], FUNC(h8_port_device::port_r)); + map(0xffff51, 0xffff51).r(m_portn[1], FUNC(h8_port_device::port_r)); + map(0xffff52, 0xffff52).r(m_portn[2], FUNC(h8_port_device::port_r)); + map(0xffff53, 0xffff53).r(m_portn[3], FUNC(h8_port_device::port_r)); + map(0xffff59, 0xffff59).r(m_porta[0], FUNC(h8_port_device::port_r)); + map(0xffff5a, 0xffff5a).r(m_porta[1], FUNC(h8_port_device::port_r)); + map(0xffff5b, 0xffff5b).r(m_porta[2], FUNC(h8_port_device::port_r)); + map(0xffff5c, 0xffff5c).r(m_porta[3], FUNC(h8_port_device::port_r)); + map(0xffff5d, 0xffff5d).r(m_porta[4], FUNC(h8_port_device::port_r)); + map(0xffff5e, 0xffff5e).r(m_porta[5], FUNC(h8_port_device::port_r)); + map(0xffff5f, 0xffff5f).r(m_porta[6], FUNC(h8_port_device::port_r)); + map(0xffff60, 0xffff60).rw(m_portn[0], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff61, 0xffff61).rw(m_portn[1], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff62, 0xffff62).rw(m_portn[2], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff69, 0xffff69).rw(m_porta[0], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6a, 0xffff6a).rw(m_porta[1], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6b, 0xffff6b).rw(m_porta[2], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6c, 0xffff6c).rw(m_porta[3], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6d, 0xffff6d).rw(m_porta[4], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6e, 0xffff6e).rw(m_porta[5], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff6f, 0xffff6f).rw(m_porta[6], FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff70, 0xffff70).rw(m_porta[0], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffff71, 0xffff71).rw(m_porta[1], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffff72, 0xffff72).rw(m_porta[2], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffff73, 0xffff73).rw(m_porta[3], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffff74, 0xffff74).rw(m_porta[4], FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); + map(0xffff76, 0xffff76).rw(m_portn[2], FUNC(h8_port_device::odr_r), FUNC(h8_port_device::odr_w)); + map(0xffff77, 0xffff77).rw(m_porta[0], FUNC(h8_port_device::odr_r), FUNC(h8_port_device::odr_w)); + + map(0xffff78, 0xffff78).rw(m_sci[0], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); + map(0xffff79, 0xffff79).rw(m_sci[0], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); + map(0xffff7a, 0xffff7a).rw(m_sci[0], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); + map(0xffff7b, 0xffff7b).rw(m_sci[0], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); + map(0xffff7c, 0xffff7c).rw(m_sci[0], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); + map(0xffff7d, 0xffff7d).r(m_sci[0], FUNC(h8_sci_device::rdr_r)); + map(0xffff7e, 0xffff7e).rw(m_sci[0], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); + map(0xffff80, 0xffff80).rw(m_sci[1], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); + map(0xffff81, 0xffff81).rw(m_sci[1], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); + map(0xffff82, 0xffff82).rw(m_sci[1], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); + map(0xffff83, 0xffff83).rw(m_sci[1], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); + map(0xffff84, 0xffff84).rw(m_sci[1], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); + map(0xffff85, 0xffff85).r(m_sci[1], FUNC(h8_sci_device::rdr_r)); + map(0xffff86, 0xffff86).rw(m_sci[1], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); + + map(0xffff90, 0xffff97).r(m_adc, FUNC(h8_adc_device::addr8_r)); + map(0xffff98, 0xffff98).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w)); + map(0xffff99, 0xffff99).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w)); + + map(0xffffb0, 0xffffb0).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); + map(0xffffb1, 0xffffb1).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); + map(0xffffb2, 0xffffb2).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); + map(0xffffb3, 0xffffb3).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); + map(0xffffb4, 0xffffb7).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)).umask16(0xff00); + map(0xffffb4, 0xffffb7).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)).umask16(0x00ff); + map(0xffffb8, 0xffffb8).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); + map(0xffffb9, 0xffffb9).rw(m_timer8[1], FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); + + map(0xffffbc, 0xffffbd).rw(m_watchdog, FUNC(h8_watchdog_device::wd_r), FUNC(h8_watchdog_device::wd_w)); + map(0xffffbe, 0xffffbf).rw(m_watchdog, FUNC(h8_watchdog_device::rst_r), FUNC(h8_watchdog_device::rst_w)); + map(0xffffc0, 0xffffc0).rw(m_timer16, FUNC(h8_timer16_device::tstr_r), FUNC(h8_timer16_device::tstr_w)); + map(0xffffc1, 0xffffc1).rw(m_timer16, FUNC(h8_timer16_device::tsyr_r), FUNC(h8_timer16_device::tsyr_w)); + + map(0xffffd0, 0xffffd0).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xffffd1, 0xffffd1).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xffffd2, 0xffffd3).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xffffd4, 0xffffd4).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xffffd5, 0xffffd5).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xffffd6, 0xffffd7).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xffffd8, 0xffffdf).rw(m_timer16c[0], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); + map(0xffffe0, 0xffffe0).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xffffe1, 0xffffe1).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xffffe2, 0xffffe2).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xffffe4, 0xffffe4).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xffffe5, 0xffffe5).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xffffe6, 0xffffe7).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xffffe8, 0xffffeb).rw(m_timer16c[1], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); + map(0xfffff0, 0xfffff0).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); + map(0xfffff1, 0xfffff1).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); + map(0xfffff2, 0xfffff2).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); + map(0xfffff4, 0xfffff4).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); + map(0xfffff5, 0xfffff5).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); + map(0xfffff6, 0xfffff7).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); + map(0xfffff8, 0xfffffb).rw(m_timer16c[2], FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); +} + +void h8s2319_device::device_add_mconfig(machine_config &config) +{ + H8S_INTC(config, m_intc, *this); + H8_ADC_2319(config, m_adc, *this, m_intc, 28); + H8_DTC(config, m_dtc, *this, m_intc, 24); + H8_PORT(config, m_portn[0], *this, h8_device::PORT_1, 0x00, 0x00); + H8_PORT(config, m_portn[1], *this, h8_device::PORT_2, 0x00, 0x00); + H8_PORT(config, m_portn[2], *this, h8_device::PORT_3, 0x00, 0xc0); + H8_PORT(config, m_portn[3], *this, h8_device::PORT_4, 0x00, 0x00); + H8_PORT(config, m_porta[0], *this, h8_device::PORT_A, 0x00, 0xf0); + H8_PORT(config, m_porta[1], *this, h8_device::PORT_B, 0x00, 0x00); + H8_PORT(config, m_porta[2], *this, h8_device::PORT_C, 0x00, 0x00); + H8_PORT(config, m_porta[3], *this, h8_device::PORT_D, 0x00, 0x00); + H8_PORT(config, m_porta[4], *this, h8_device::PORT_E, 0x00, 0x00); + H8_PORT(config, m_porta[5], *this, h8_device::PORT_F, 0x00, 0x00); + H8_PORT(config, m_porta[6], *this, h8_device::PORT_G, 0x00, 0xe0); + H8H_TIMER8_CHANNEL(config, m_timer8[0], *this, m_intc, 64, 65, 66, m_timer8[1], h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); + H8H_TIMER8_CHANNEL(config, m_timer8[1], *this, m_intc, 68, 69, 70, m_timer8[0], h8_timer8_channel_device::CHAIN_A, false, false); + H8_TIMER16(config, m_timer16, *this, 6, 0x00); + H8S_TIMER16_CHANNEL(config, m_timer16c[0], *this, 4, 0x60, m_intc, 32, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::INPUT_D); + H8S_TIMER16_CHANNEL(config, m_timer16c[1], *this, 2, 0x4c, m_intc, 40, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16c[2]); + H8S_TIMER16_CHANNEL(config, m_timer16c[2], *this, 2, 0x4c, m_intc, 44, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024); + H8S_TIMER16_CHANNEL(config, m_timer16c[3], *this, 4, 0x60, m_intc, 48, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::DIV_4096); + H8S_TIMER16_CHANNEL(config, m_timer16c[4], *this, 2, 0x4c, m_intc, 56, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16c[5]); + H8S_TIMER16_CHANNEL(config, m_timer16c[5], *this, 2, 0x4c, m_intc, 60, + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::INPUT_D); + H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); + H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); + H8_WATCHDOG(config, m_watchdog, *this, m_intc, 25, h8_watchdog_device::S); +} + +void h8s2319_device::execute_set_input(int inputnum, int state) +{ + m_intc->set_input(inputnum, state); +} + +bool h8s2319_device::exr_in_stack() const +{ + return m_syscr & 0x20; +} + +int h8s2319_device::trace_setup() +{ + m_CCR |= F_I; + m_EXR &= ~EXR_T; + return 5; +} + +int h8s2319_device::trapa_setup() +{ + m_CCR |= F_I; + if(m_syscr & 0x20) + m_EXR &= ~EXR_T; + return 8; +} + +void h8s2319_device::irq_setup() +{ + switch(m_syscr & 0x30) { + case 0x00: + m_CCR |= F_I; + break; + case 0x20: + m_EXR = m_EXR & (EXR_NC); + if(m_taken_irq_level == 8) + m_EXR |= 7; + else + m_EXR |= m_taken_irq_level; + break; + } +} + +void h8s2319_device::update_irq_filter() +{ + switch(m_syscr & 0x30) { + case 0x00: + if(m_CCR & F_I) + m_intc->set_filter(2, -1); + else + m_intc->set_filter(0, -1); + break; + case 0x20: + m_intc->set_filter(0, m_EXR & 7); + break; + } +} + +void h8s2319_device::interrupt_taken() +{ + standard_irq_callback(m_intc->interrupt_taken(m_taken_irq_vector), m_NPC); +} + +void h8s2319_device::internal_update(u64 current_time) +{ + u64 event_time = 0; + + add_event(event_time, m_adc->internal_update(current_time)); + add_event(event_time, m_sci[0]->internal_update(current_time)); + add_event(event_time, m_sci[1]->internal_update(current_time)); + + // SCI2 used by H8S-2329 + if (m_sci[2]) + add_event(event_time, m_sci[2]->internal_update(current_time)); + + add_event(event_time, m_timer8[0]->internal_update(current_time)); + add_event(event_time, m_timer8[1]->internal_update(current_time)); + add_event(event_time, m_timer16c[0]->internal_update(current_time)); + add_event(event_time, m_timer16c[1]->internal_update(current_time)); + add_event(event_time, m_timer16c[2]->internal_update(current_time)); + add_event(event_time, m_timer16c[3]->internal_update(current_time)); + add_event(event_time, m_timer16c[4]->internal_update(current_time)); + add_event(event_time, m_timer16c[5]->internal_update(current_time)); + add_event(event_time, m_watchdog->internal_update(current_time)); + + recompute_bcount(event_time); +} + +void h8s2319_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_timer8[0]->notify_standby(state); + m_timer8[1]->notify_standby(state); + + for (auto & timer16c : m_timer16c) + timer16c->notify_standby(state); + + m_watchdog->notify_standby(state); +} + +void h8s2319_device::device_start() +{ + h8s2000_device::device_start(); + m_dtc_device = m_dtc; + + m_sbycr = 0; + m_syscr = 0; + + save_item(NAME(m_sbycr)); + save_item(NAME(m_syscr)); +} + +void h8s2319_device::device_reset() +{ + h8s2000_device::device_reset(); + + m_sbycr = 0x08; + m_syscr = 0x01; + m_ram_view.select(0); +} + +u8 h8s2319_device::sbycr_r() +{ + return m_sbycr; +} + +void h8s2319_device::sbycr_w(u8 data) +{ + logerror("sbycr = %02x\n", data); + + // SSBY + m_standby_pending = bool(data & 0x80); + + m_sbycr = data & 0xf9; +} + +u8 h8s2319_device::syscr_r() +{ + return m_syscr; +} + +void h8s2319_device::syscr_w(u8 data) +{ + logerror("syscr = %02x\n", data); + + // RAME + if (data & 1) + m_ram_view.select(0); + else + m_ram_view.disable(); + + // NMIEG + m_intc->set_nmi_edge(BIT(data, 3)); + + m_syscr = data; + update_irq_filter(); +} diff --git a/src/devices/cpu/h8/h8s2319.h b/src/devices/cpu/h8/h8s2319.h new file mode 100644 index 0000000000000..a782d03d33bab --- /dev/null +++ b/src/devices/cpu/h8/h8s2319.h @@ -0,0 +1,158 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert, hap +/*************************************************************************** + + h8s2319.h + + H8S-2319 family emulation + + H8S/2000-based mcus. + + Variant ROM RAM + H8S/2310 - 2K + H8S/2311 32K 2K + H8S/2312 - 8K + H8S/2313 64K 2K + H8S/2315 384K 8K + H8S/2316 64K 8K + H8S/2317 128K 8K + H8S/2318 256K 8K + H8S/2319 512K 8K + +***************************************************************************/ + +#ifndef MAME_CPU_H8_H8S2319_H +#define MAME_CPU_H8_H8S2319_H + +#pragma once + +#include "h8s2000.h" +#include "h8_intc.h" +#include "h8_adc.h" +#include "h8_dtc.h" +#include "h8_port.h" +#include "h8_timer8.h" +#include "h8_timer16.h" +#include "h8_sci.h" +#include "h8_watchdog.h" + +class h8s2319_device : public h8s2000_device { +public: + h8s2319_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // I/O ports + auto read_port1() { return m_read_port [PORT_1].bind(); } + auto write_port1() { return m_write_port[PORT_1].bind(); } + auto read_port2() { return m_read_port [PORT_2].bind(); } + auto write_port2() { return m_write_port[PORT_2].bind(); } + auto read_port3() { return m_read_port [PORT_3].bind(); } + auto write_port3() { return m_write_port[PORT_3].bind(); } + auto read_port4() { return m_read_port [PORT_4].bind(); } + + auto read_porta() { return m_read_port [PORT_A].bind(); } + auto write_porta() { return m_write_port[PORT_A].bind(); } + auto read_portb() { return m_read_port [PORT_B].bind(); } + auto write_portb() { return m_write_port[PORT_B].bind(); } + auto read_portc() { return m_read_port [PORT_C].bind(); } + auto write_portc() { return m_write_port[PORT_C].bind(); } + auto read_portd() { return m_read_port [PORT_D].bind(); } + auto write_portd() { return m_write_port[PORT_D].bind(); } + auto read_porte() { return m_read_port [PORT_E].bind(); } + auto write_porte() { return m_write_port[PORT_E].bind(); } + auto read_portf() { return m_read_port [PORT_F].bind(); } + auto write_portf() { return m_write_port[PORT_F].bind(); } + auto read_portg() { return m_read_port [PORT_G].bind(); } + auto write_portg() { return m_write_port[PORT_G].bind(); } + + u8 sbycr_r(); + void sbycr_w(u8 data); + u8 syscr_r(); + void syscr_w(u8 data); + +protected: + required_device m_intc; + required_device m_adc; + required_device m_dtc; + required_device_array m_portn; + required_device_array m_porta; + required_device_array m_timer8; + required_device m_timer16; + required_device_array m_timer16c; + required_device m_watchdog; + + memory_view m_ram_view; + + u32 m_ram_start; + u8 m_sbycr; + u8 m_syscr; + + h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start); + h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start); + + virtual bool exr_in_stack() const override; + virtual void update_irq_filter() override; + virtual void interrupt_taken() override; + virtual int trace_setup() override; + virtual int trapa_setup() override; + virtual void irq_setup() override; + virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; + virtual void device_add_mconfig(machine_config &config) override; + void map(address_map &map); + + virtual void device_start() override; + virtual void device_reset() override; + virtual void execute_set_input(int inputnum, int state) override; +}; + +class h8s2310_device : public h8s2319_device { +public: + h8s2310_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2311_device : public h8s2319_device { +public: + h8s2311_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2312_device : public h8s2319_device { +public: + h8s2312_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2313_device : public h8s2319_device { +public: + h8s2313_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2315_device : public h8s2319_device { +public: + h8s2315_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2316_device : public h8s2319_device { +public: + h8s2316_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2317_device : public h8s2319_device { +public: + h8s2317_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2318_device : public h8s2319_device { +public: + h8s2318_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +DECLARE_DEVICE_TYPE(H8S2310, h8s2310_device) +DECLARE_DEVICE_TYPE(H8S2311, h8s2311_device) +DECLARE_DEVICE_TYPE(H8S2312, h8s2312_device) +DECLARE_DEVICE_TYPE(H8S2313, h8s2313_device) +DECLARE_DEVICE_TYPE(H8S2315, h8s2315_device) +DECLARE_DEVICE_TYPE(H8S2316, h8s2316_device) +DECLARE_DEVICE_TYPE(H8S2317, h8s2317_device) +DECLARE_DEVICE_TYPE(H8S2318, h8s2318_device) +DECLARE_DEVICE_TYPE(H8S2319, h8s2319_device) + +#endif // MAME_CPU_H8_H8S2319_H diff --git a/src/devices/cpu/h8/h8s2320.cpp b/src/devices/cpu/h8/h8s2320.cpp deleted file mode 100644 index b853310a79ebf..0000000000000 --- a/src/devices/cpu/h8/h8s2320.cpp +++ /dev/null @@ -1,464 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert -#include "emu.h" -#include "h8s2320.h" - -DEFINE_DEVICE_TYPE(H8S2320, h8s2320_device, "h8s2320", "Hitachi H8S/2320") -DEFINE_DEVICE_TYPE(H8S2321, h8s2321_device, "h8s2321", "Hitachi H8S/2321") -DEFINE_DEVICE_TYPE(H8S2322, h8s2322_device, "h8s2322", "Hitachi H8S/2322") -DEFINE_DEVICE_TYPE(H8S2323, h8s2323_device, "h8s2323", "Hitachi H8S/2323") -DEFINE_DEVICE_TYPE(H8S2324, h8s2324_device, "h8s2324", "Hitachi H8S/2324") -DEFINE_DEVICE_TYPE(H8S2326, h8s2326_device, "h8s2326", "Hitachi H8S/2326") -DEFINE_DEVICE_TYPE(H8S2327, h8s2327_device, "h8s2327", "Hitachi H8S/2327") -DEFINE_DEVICE_TYPE(H8S2328, h8s2328_device, "h8s2328", "Hitachi H8S/2328") -DEFINE_DEVICE_TYPE(H8S2329, h8s2329_device, "h8s2329", "Hitachi H8S/2329") - - -h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) : - h8s2000_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2320_device::map), this)), - m_intc(*this, "intc"), - m_adc(*this, "adc"), - m_dma(*this, "dma"), - m_dma0(*this, "dma:0"), - m_dma1(*this, "dma:1"), - m_dtc(*this, "dtc"), - m_port1(*this, "port1"), - m_port2(*this, "port2"), - m_port3(*this, "port3"), - m_port4(*this, "port4"), - m_port5(*this, "port5"), - m_port6(*this, "port6"), - m_porta(*this, "porta"), - m_portb(*this, "portb"), - m_portc(*this, "portc"), - m_portd(*this, "portd"), - m_porte(*this, "porte"), - m_portf(*this, "portf"), - m_portg(*this, "portg"), - m_timer8_0(*this, "timer8_0"), - m_timer8_1(*this, "timer8_1"), - m_timer16(*this, "timer16"), - m_timer16_0(*this, "timer16:0"), - m_timer16_1(*this, "timer16:1"), - m_timer16_2(*this, "timer16:2"), - m_timer16_3(*this, "timer16:3"), - m_timer16_4(*this, "timer16:4"), - m_timer16_5(*this, "timer16:5"), - m_watchdog(*this, "watchdog"), - m_tend_cb(*this), - m_ram_start(start), - m_syscr(0) -{ -} - -h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2320, tag, owner, clock, 0xffec00) -{ -} - -h8s2321_device::h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2321, tag, owner, clock, 0xffec00) -{ -} - -h8s2322_device::h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2322, tag, owner, clock, 0xffdc00) -{ -} - -h8s2323_device::h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2323, tag, owner, clock, 0xffdc00) -{ -} - -h8s2324_device::h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2324, tag, owner, clock, 0xff7c00) -{ -} - -h8s2326_device::h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2326, tag, owner, clock, 0xffdc00) -{ -} - -h8s2327_device::h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2327, tag, owner, clock, 0xffdc00) -{ -} - -h8s2328_device::h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2328, tag, owner, clock, 0xffdc00) -{ -} - -h8s2329_device::h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - h8s2320_device(mconfig, H8S2329, tag, owner, clock, 0xff7c00) -{ -} - -void h8s2320_device::map(address_map &map) -{ - map(m_ram_start, 0xfffbff).ram(); - - map(0xfffe80, 0xfffe80).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xfffe81, 0xfffe81).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xfffe82, 0xfffe83).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xfffe84, 0xfffe84).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xfffe85, 0xfffe85).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xfffe86, 0xfffe87).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xfffe88, 0xfffe8f).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); - map(0xfffe90, 0xfffe90).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xfffe91, 0xfffe91).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xfffe92, 0xfffe92).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xfffe94, 0xfffe94).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xfffe95, 0xfffe95).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xfffe96, 0xfffe97).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xfffe98, 0xfffe9b).rw(m_timer16_4, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); - map(0xfffea0, 0xfffea0).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xfffea1, 0xfffea1).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xfffea2, 0xfffea2).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xfffea4, 0xfffea4).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xfffea5, 0xfffea5).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xfffea6, 0xfffea7).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xfffea8, 0xfffeab).rw(m_timer16_5, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); - map(0xfffeb0, 0xfffeb0).w(m_port1, FUNC(h8_port_device::ddr_w)); - map(0xfffeb1, 0xfffeb1).w(m_port2, FUNC(h8_port_device::ddr_w)); - map(0xfffeb2, 0xfffeb2).w(m_port3, FUNC(h8_port_device::ddr_w)); - map(0xfffeb4, 0xfffeb4).w(m_port5, FUNC(h8_port_device::ddr_w)); - map(0xfffeb5, 0xfffeb5).w(m_port6, FUNC(h8_port_device::ddr_w)); - map(0xfffeb9, 0xfffeb9).w(m_porta, FUNC(h8_port_device::ddr_w)); - map(0xfffeba, 0xfffeba).w(m_portb, FUNC(h8_port_device::ddr_w)); - map(0xfffebb, 0xfffebb).w(m_portc, FUNC(h8_port_device::ddr_w)); - map(0xfffebc, 0xfffebc).w(m_portd, FUNC(h8_port_device::ddr_w)); - map(0xfffebd, 0xfffebd).w(m_porte, FUNC(h8_port_device::ddr_w)); - map(0xfffebe, 0xfffebe).w(m_portf, FUNC(h8_port_device::ddr_w)); - map(0xfffebf, 0xfffebf).w(m_portg, FUNC(h8_port_device::ddr_w)); - map(0xfffec0, 0xfffec1).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); - map(0xfffec2, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icrc_r), FUNC(h8s_intc_device::icrc_w)); - map(0xfffec4, 0xfffecd).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); - map(0xfffece, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::iprk_r), FUNC(h8s_intc_device::iprk_w)); - - if(type() != H8S2321) { - map(0xfffee0, 0xfffee1).rw(m_dma0, FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); - map(0xfffee2, 0xfffee3).rw(m_dma0, FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); - map(0xfffee4, 0xfffee5).rw(m_dma0, FUNC(h8s_dma_channel_device::ioara_r), FUNC(h8s_dma_channel_device::ioara_w)); - map(0xfffee6, 0xfffee7).rw(m_dma0, FUNC(h8s_dma_channel_device::etcra_r), FUNC(h8s_dma_channel_device::etcra_w)); - map(0xfffee8, 0xfffee9).rw(m_dma0, FUNC(h8s_dma_channel_device::marbh_r), FUNC(h8s_dma_channel_device::marbh_w)); - map(0xfffeea, 0xfffeeb).rw(m_dma0, FUNC(h8s_dma_channel_device::marbl_r), FUNC(h8s_dma_channel_device::marbl_w)); - map(0xfffeec, 0xfffeed).rw(m_dma0, FUNC(h8s_dma_channel_device::ioarb_r), FUNC(h8s_dma_channel_device::ioarb_w)); - map(0xfffeee, 0xfffeef).rw(m_dma0, FUNC(h8s_dma_channel_device::etcrb_r), FUNC(h8s_dma_channel_device::etcrb_w)); - map(0xfffef0, 0xfffef1).rw(m_dma1, FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); - map(0xfffef2, 0xfffef3).rw(m_dma1, FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); - map(0xfffef4, 0xfffef5).rw(m_dma1, FUNC(h8s_dma_channel_device::ioara_r), FUNC(h8s_dma_channel_device::ioara_w)); - map(0xfffef6, 0xfffef7).rw(m_dma1, FUNC(h8s_dma_channel_device::etcra_r), FUNC(h8s_dma_channel_device::etcra_w)); - map(0xfffef8, 0xfffef9).rw(m_dma1, FUNC(h8s_dma_channel_device::marbh_r), FUNC(h8s_dma_channel_device::marbh_w)); - map(0xfffefa, 0xfffefb).rw(m_dma1, FUNC(h8s_dma_channel_device::marbl_r), FUNC(h8s_dma_channel_device::marbl_w)); - map(0xfffefc, 0xfffefd).rw(m_dma1, FUNC(h8s_dma_channel_device::ioarb_r), FUNC(h8s_dma_channel_device::ioarb_w)); - map(0xfffefe, 0xfffeff).rw(m_dma1, FUNC(h8s_dma_channel_device::etcrb_r), FUNC(h8s_dma_channel_device::etcrb_w)); - map(0xffff00, 0xffff00).rw(m_dma, FUNC(h8s_dma_device::dmawer_r), FUNC(h8s_dma_device::dmawer_w)); - map(0xffff01, 0xffff01).rw(m_dma, FUNC(h8s_dma_device::dmatcr_r), FUNC(h8s_dma_device::dmatcr_w)); - map(0xffff02, 0xffff03).rw(m_dma0, FUNC(h8s_dma_channel_device::dmacr_r), FUNC(h8s_dma_channel_device::dmacr_w)); - map(0xffff04, 0xffff05).rw(m_dma1, FUNC(h8s_dma_channel_device::dmacr_r), FUNC(h8s_dma_channel_device::dmacr_w)); - map(0xffff06, 0xffff07).rw(m_dma, FUNC(h8s_dma_device::dmabcr_r), FUNC(h8s_dma_device::dmabcr_w)); - } - map(0xffff2c, 0xffff2c).rw(m_intc, FUNC(h8s_intc_device::iscrh_r), FUNC(h8s_intc_device::iscrh_w)); - map(0xffff2d, 0xffff2d).rw(m_intc, FUNC(h8s_intc_device::iscrl_r), FUNC(h8s_intc_device::iscrl_w)); - map(0xffff2e, 0xffff2e).rw(m_intc, FUNC(h8s_intc_device::ier_r), FUNC(h8s_intc_device::ier_w)); - map(0xffff2f, 0xffff2f).rw(m_intc, FUNC(h8s_intc_device::isr_r), FUNC(h8s_intc_device::isr_w)); - map(0xffff30, 0xffff35).rw(m_dtc, FUNC(h8_dtc_device::dtcer_r), FUNC(h8_dtc_device::dtcer_w)); - map(0xffff37, 0xffff37).rw(m_dtc, FUNC(h8_dtc_device::dtvecr_r), FUNC(h8_dtc_device::dtvecr_w)); - map(0xffff39, 0xffff39).rw(FUNC(h8s2320_device::syscr_r), FUNC(h8s2320_device::syscr_w)); - - map(0xffff50, 0xffff50).r(m_port1, FUNC(h8_port_device::port_r)); - map(0xffff51, 0xffff51).r(m_port2, FUNC(h8_port_device::port_r)); - map(0xffff52, 0xffff52).r(m_port3, FUNC(h8_port_device::port_r)); - map(0xffff53, 0xffff53).r(m_port4, FUNC(h8_port_device::port_r)); - map(0xffff54, 0xffff54).r(m_port5, FUNC(h8_port_device::port_r)); - map(0xffff55, 0xffff55).r(m_port6, FUNC(h8_port_device::port_r)); - map(0xffff59, 0xffff59).r(m_porta, FUNC(h8_port_device::port_r)); - map(0xffff5a, 0xffff5a).r(m_portb, FUNC(h8_port_device::port_r)); - map(0xffff5b, 0xffff5b).r(m_portc, FUNC(h8_port_device::port_r)); - map(0xffff5c, 0xffff5c).r(m_portd, FUNC(h8_port_device::port_r)); - map(0xffff5d, 0xffff5d).r(m_porte, FUNC(h8_port_device::port_r)); - map(0xffff5e, 0xffff5e).r(m_portf, FUNC(h8_port_device::port_r)); - map(0xffff5f, 0xffff5f).r(m_portg, FUNC(h8_port_device::port_r)); - map(0xffff60, 0xffff60).rw(m_port1, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff61, 0xffff61).rw(m_port2, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff62, 0xffff62).rw(m_port3, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff64, 0xffff64).rw(m_port5, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff65, 0xffff65).rw(m_port6, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff69, 0xffff69).rw(m_porta, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6a, 0xffff6a).rw(m_portb, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6b, 0xffff6b).rw(m_portc, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6c, 0xffff6c).rw(m_portd, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6d, 0xffff6d).rw(m_porte, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6e, 0xffff6e).rw(m_portf, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff6f, 0xffff6f).rw(m_portg, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); - map(0xffff70, 0xffff70).rw(m_porta, FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); - map(0xffff71, 0xffff71).rw(m_portb, FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); - map(0xffff72, 0xffff72).rw(m_portc, FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); - map(0xffff73, 0xffff73).rw(m_portd, FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); - map(0xffff74, 0xffff74).rw(m_porte, FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w)); - map(0xffff76, 0xffff76).rw(m_port3, FUNC(h8_port_device::odr_r), FUNC(h8_port_device::odr_w)); - map(0xffff77, 0xffff77).rw(m_porta, FUNC(h8_port_device::odr_r), FUNC(h8_port_device::odr_w)); - map(0xffff78, 0xffff78).rw(m_sci[0], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); - map(0xffff79, 0xffff79).rw(m_sci[0], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); - map(0xffff7a, 0xffff7a).rw(m_sci[0], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); - map(0xffff7b, 0xffff7b).rw(m_sci[0], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); - map(0xffff7c, 0xffff7c).rw(m_sci[0], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); - map(0xffff7d, 0xffff7d).r(m_sci[0], FUNC(h8_sci_device::rdr_r)); - map(0xffff7e, 0xffff7e).rw(m_sci[0], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); - map(0xffff80, 0xffff80).rw(m_sci[1], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); - map(0xffff81, 0xffff81).rw(m_sci[1], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); - map(0xffff82, 0xffff82).rw(m_sci[1], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); - map(0xffff83, 0xffff83).rw(m_sci[1], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); - map(0xffff84, 0xffff84).rw(m_sci[1], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); - map(0xffff85, 0xffff85).r(m_sci[1], FUNC(h8_sci_device::rdr_r)); - map(0xffff86, 0xffff86).rw(m_sci[1], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); - map(0xffff88, 0xffff88).rw(m_sci[2], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); - map(0xffff89, 0xffff89).rw(m_sci[2], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); - map(0xffff8a, 0xffff8a).rw(m_sci[2], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); - map(0xffff8b, 0xffff8b).rw(m_sci[2], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); - map(0xffff8c, 0xffff8c).rw(m_sci[2], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); - map(0xffff8d, 0xffff8d).r(m_sci[2], FUNC(h8_sci_device::rdr_r)); - map(0xffff8e, 0xffff8e).rw(m_sci[2], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); - map(0xffff90, 0xffff97).r(m_adc, FUNC(h8_adc_device::addr8_r)); - map(0xffff98, 0xffff98).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w)); - map(0xffff99, 0xffff99).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w)); - - map(0xffffb0, 0xffffb0).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); - map(0xffffb1, 0xffffb1).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); - map(0xffffb2, 0xffffb2).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); - map(0xffffb3, 0xffffb3).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); - map(0xffffb4, 0xffffb7).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)).umask16(0xff00); - map(0xffffb4, 0xffffb7).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcor_r), FUNC(h8_timer8_channel_device::tcor_w)).umask16(0x00ff); - map(0xffffb8, 0xffffb8).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); - map(0xffffb9, 0xffffb9).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcnt_r), FUNC(h8_timer8_channel_device::tcnt_w)); - map(0xffffbc, 0xffffbd).rw(m_watchdog, FUNC(h8_watchdog_device::wd_r), FUNC(h8_watchdog_device::wd_w)); - map(0xffffbe, 0xffffbf).rw(m_watchdog, FUNC(h8_watchdog_device::rst_r), FUNC(h8_watchdog_device::rst_w)); - map(0xffffc0, 0xffffc0).rw(m_timer16, FUNC(h8_timer16_device::tstr_r), FUNC(h8_timer16_device::tstr_w)); - map(0xffffc1, 0xffffc1).rw(m_timer16, FUNC(h8_timer16_device::tsyr_r), FUNC(h8_timer16_device::tsyr_w)); - - map(0xffffd0, 0xffffd0).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xffffd1, 0xffffd1).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xffffd2, 0xffffd3).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xffffd4, 0xffffd4).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xffffd5, 0xffffd5).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xffffd6, 0xffffd7).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xffffd8, 0xffffdf).rw(m_timer16_0, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); - map(0xffffe0, 0xffffe0).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xffffe1, 0xffffe1).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xffffe2, 0xffffe2).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xffffe4, 0xffffe4).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xffffe5, 0xffffe5).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xffffe6, 0xffffe7).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xffffe8, 0xffffeb).rw(m_timer16_1, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); - map(0xfffff0, 0xfffff0).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); - map(0xfffff1, 0xfffff1).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); - map(0xfffff2, 0xfffff2).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); - map(0xfffff4, 0xfffff4).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tier_r), FUNC(h8_timer16_channel_device::tier_w)); - map(0xfffff5, 0xfffff5).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); - map(0xfffff6, 0xfffff7).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); - map(0xfffff8, 0xfffffb).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); -} - -void h8s2320_device::device_add_mconfig(machine_config &config) -{ - H8S_INTC(config, m_intc, *this); - H8_ADC_2320(config, m_adc, *this, m_intc, 28); - if(type() != H8S2321) { - H8S_DMA(config, m_dma, *this); - H8S_DMA_CHANNEL(config, m_dma0, *this, m_dma, m_intc); - H8S_DMA_CHANNEL(config, m_dma1, *this, m_dma, m_intc); - } - H8_DTC(config, m_dtc, *this, m_intc, 24); - H8_PORT(config, m_port1, *this, h8_device::PORT_1, 0x00, 0x00); - H8_PORT(config, m_port2, *this, h8_device::PORT_2, 0x00, 0x00); - H8_PORT(config, m_port3, *this, h8_device::PORT_3, 0xc0, 0xc0); - H8_PORT(config, m_port4, *this, h8_device::PORT_4, 0x00, 0x00); - H8_PORT(config, m_port5, *this, h8_device::PORT_5, 0xf0, 0xf0); - H8_PORT(config, m_port6, *this, h8_device::PORT_6, 0x00, 0x00); - H8_PORT(config, m_porta, *this, h8_device::PORT_A, 0x00, 0x00); - H8_PORT(config, m_portb, *this, h8_device::PORT_B, 0x00, 0x00); - H8_PORT(config, m_portc, *this, h8_device::PORT_C, 0x00, 0x00); - H8_PORT(config, m_portd, *this, h8_device::PORT_D, 0x00, 0x00); - H8_PORT(config, m_porte, *this, h8_device::PORT_E, 0x00, 0x00); - H8_PORT(config, m_portf, *this, h8_device::PORT_F, 0x00, 0x00); - H8_PORT(config, m_portg, *this, h8_device::PORT_G, 0xe0, 0xe0); - H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); - H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); - H8_TIMER16(config, m_timer16, *this, 6, 0x00); - H8S_TIMER16_CHANNEL(config, m_timer16_0, *this, 4, 0x60, m_intc, 32, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::INPUT_D); - H8S_TIMER16_CHANNEL(config, m_timer16_1, *this, 2, 0x4c, m_intc, 40, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); - H8S_TIMER16_CHANNEL(config, m_timer16_2, *this, 2, 0x4c, m_intc, 44, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024); - H8S_TIMER16_CHANNEL(config, m_timer16_3, *this, 4, 0x60, m_intc, 48, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::DIV_4096); - H8S_TIMER16_CHANNEL(config, m_timer16_4, *this, 2, 0x4c, m_intc, 56, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_5); - H8S_TIMER16_CHANNEL(config, m_timer16_5, *this, 2, 0x4c, m_intc, 60, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::INPUT_D); - H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); - H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); - H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); - H8_WATCHDOG(config, m_watchdog, *this, m_intc, 25, h8_watchdog_device::H); -} - -void h8s2320_device::execute_set_input(int inputnum, int state) -{ - if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) - m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); - else if(inputnum == H8_INPUT_LINE_DREQ0 || inputnum == H8_INPUT_LINE_DREQ1) - m_dma->set_input(inputnum, state); - else - m_intc->set_input(inputnum, state); -} - -bool h8s2320_device::exr_in_stack() const -{ - return m_syscr & 0x20; -} - -int h8s2320_device::trace_setup() -{ - m_CCR |= F_I; - m_EXR &= ~EXR_T; - return 5; -} - -int h8s2320_device::trapa_setup() -{ - m_CCR |= F_I; - if(m_syscr & 0x20) - m_EXR &= ~EXR_T; - return 8; -} - -void h8s2320_device::irq_setup() -{ - switch(m_syscr & 0x30) { - case 0x00: - m_CCR |= F_I; - break; - case 0x20: - m_EXR = m_EXR & (EXR_NC); - if(m_taken_irq_level == 8) - m_EXR |= 7; - else - m_EXR |= m_taken_irq_level; - break; - } -} - -void h8s2320_device::update_irq_filter() -{ - switch(m_syscr & 0x30) { - case 0x00: - if(m_CCR & F_I) - m_intc->set_filter(2, -1); - else - m_intc->set_filter(0, -1); - break; - case 0x20: - m_intc->set_filter(0, m_EXR & 7); - break; - } -} - -void h8s2320_device::interrupt_taken() -{ - standard_irq_callback(m_intc->interrupt_taken(m_taken_irq_vector), m_NPC); -} - -void h8s2320_device::internal_update(u64 current_time) -{ - u64 event_time = 0; - - add_event(event_time, m_adc->internal_update(current_time)); - add_event(event_time, m_sci[0]->internal_update(current_time)); - add_event(event_time, m_sci[1]->internal_update(current_time)); - add_event(event_time, m_sci[2]->internal_update(current_time)); - add_event(event_time, m_timer8_0->internal_update(current_time)); - add_event(event_time, m_timer8_1->internal_update(current_time)); - add_event(event_time, m_timer16_0->internal_update(current_time)); - add_event(event_time, m_timer16_1->internal_update(current_time)); - add_event(event_time, m_timer16_2->internal_update(current_time)); - add_event(event_time, m_timer16_3->internal_update(current_time)); - add_event(event_time, m_timer16_4->internal_update(current_time)); - add_event(event_time, m_timer16_5->internal_update(current_time)); - add_event(event_time, m_watchdog->internal_update(current_time)); - - recompute_bcount(event_time); -} - -void h8s2320_device::device_start() -{ - h8s2000_device::device_start(); - m_dma_device = m_dma; - m_dtc_device = m_dtc; - - save_item(NAME(m_syscr)); -} - -void h8s2320_device::device_reset() -{ - h8s2000_device::device_reset(); - m_syscr = 0x01; -} - -u8 h8s2320_device::syscr_r() -{ - return m_syscr; -} - -void h8s2320_device::syscr_w(u8 data) -{ - m_syscr = data; - m_mac_saturating = m_syscr & 0x80; - update_irq_filter(); - logerror("syscr = %02x\n", data); -} diff --git a/src/devices/cpu/h8/h8s2320.h b/src/devices/cpu/h8/h8s2320.h deleted file mode 100644 index 7caea73ae4fe2..0000000000000 --- a/src/devices/cpu/h8/h8s2320.h +++ /dev/null @@ -1,181 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert -/*************************************************************************** - - h8s2320.h - - H8S-2320 family emulation - - H8S/2600-based mcus. - - Variant ROM RAM - H8S/2320 - 4K - H8S/2321 - 4K - H8S/2322 - 8K - H8S/2323 32K 8K - H8S/2324 - 32K - H8S/2326 512K 8K - H8S/2327 128K 8K - H8S/2328 256K 8K - H8S/2329 384K 32K - - - -***************************************************************************/ - -#ifndef MAME_CPU_H8_H8S2320_H -#define MAME_CPU_H8_H8S2320_H - -#pragma once - -#include "h8s2000.h" -#include "h8_intc.h" -#include "h8_adc.h" -#include "h8_dma.h" -#include "h8_dtc.h" -#include "h8_port.h" -#include "h8_timer8.h" -#include "h8_timer16.h" -#include "h8_sci.h" -#include "h8_watchdog.h" - -class h8s2320_device : public h8s2000_device { -public: - h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - - auto read_port1() { return m_read_port [PORT_1].bind(); } - auto write_port1() { return m_write_port[PORT_1].bind(); } - auto read_port2() { return m_read_port [PORT_2].bind(); } - auto write_port2() { return m_write_port[PORT_2].bind(); } - auto read_port3() { return m_read_port [PORT_3].bind(); } - auto write_port3() { return m_write_port[PORT_3].bind(); } - auto read_port4() { return m_read_port [PORT_4].bind(); } - auto read_port5() { return m_read_port [PORT_5].bind(); } - auto write_port5() { return m_write_port[PORT_5].bind(); } - auto read_port6() { return m_read_port [PORT_6].bind(); } - auto write_port6() { return m_write_port[PORT_6].bind(); } - auto read_porta() { return m_read_port [PORT_A].bind(); } - auto write_porta() { return m_write_port[PORT_A].bind(); } - auto read_portb() { return m_read_port [PORT_B].bind(); } - auto write_portb() { return m_write_port[PORT_B].bind(); } - auto read_portc() { return m_read_port [PORT_C].bind(); } - auto write_portc() { return m_write_port[PORT_C].bind(); } - auto read_portd() { return m_read_port [PORT_D].bind(); } - auto write_portd() { return m_write_port[PORT_D].bind(); } - auto read_porte() { return m_read_port [PORT_E].bind(); } - auto write_porte() { return m_write_port[PORT_E].bind(); } - auto read_portf() { return m_read_port [PORT_F].bind(); } - auto write_portf() { return m_write_port[PORT_F].bind(); } - auto read_portg() { return m_read_port [PORT_G].bind(); } - auto write_portg() { return m_write_port[PORT_G].bind(); } - - auto tend0_cb() { return m_tend_cb[0].bind(); } - auto tend1_cb() { return m_tend_cb[1].bind(); } - - u8 syscr_r(); - void syscr_w(u8 data); - -protected: - required_device m_intc; - required_device m_adc; - optional_device m_dma; - optional_device m_dma0; - optional_device m_dma1; - required_device m_dtc; - required_device m_port1; - required_device m_port2; - required_device m_port3; - required_device m_port4; - required_device m_port5; - required_device m_port6; - required_device m_porta; - required_device m_portb; - required_device m_portc; - required_device m_portd; - required_device m_porte; - required_device m_portf; - required_device m_portg; - required_device m_timer8_0; - required_device m_timer8_1; - required_device m_timer16; - required_device m_timer16_0; - required_device m_timer16_1; - required_device m_timer16_2; - required_device m_timer16_3; - required_device m_timer16_4; - required_device m_timer16_5; - required_device m_watchdog; - - devcb_write_line::array<2> m_tend_cb; - - u32 m_ram_start; - u8 m_syscr; - - h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start); - - virtual bool exr_in_stack() const override; - virtual void update_irq_filter() override; - virtual void interrupt_taken() override; - virtual int trace_setup() override; - virtual int trapa_setup() override; - virtual void irq_setup() override; - virtual void internal_update(u64 current_time) override; - virtual void device_add_mconfig(machine_config &config) override; - void map(address_map &map); - - virtual void device_start() override; - virtual void device_reset() override; - virtual void execute_set_input(int inputnum, int state) override; -}; - -class h8s2321_device : public h8s2320_device { -public: - h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2322_device : public h8s2320_device { -public: - h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2323_device : public h8s2320_device { -public: - h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2324_device : public h8s2320_device { -public: - h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2326_device : public h8s2320_device { -public: - h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2327_device : public h8s2320_device { -public: - h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2328_device : public h8s2320_device { -public: - h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -class h8s2329_device : public h8s2320_device { -public: - h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -}; - -DECLARE_DEVICE_TYPE(H8S2320, h8s2320_device) -DECLARE_DEVICE_TYPE(H8S2321, h8s2321_device) -DECLARE_DEVICE_TYPE(H8S2322, h8s2322_device) -DECLARE_DEVICE_TYPE(H8S2323, h8s2323_device) -DECLARE_DEVICE_TYPE(H8S2324, h8s2324_device) -DECLARE_DEVICE_TYPE(H8S2326, h8s2326_device) -DECLARE_DEVICE_TYPE(H8S2327, h8s2327_device) -DECLARE_DEVICE_TYPE(H8S2328, h8s2328_device) -DECLARE_DEVICE_TYPE(H8S2329, h8s2329_device) - -#endif // MAME_CPU_H8_H8S2320_H diff --git a/src/devices/cpu/h8/h8s2329.cpp b/src/devices/cpu/h8/h8s2329.cpp new file mode 100644 index 0000000000000..e7908131039ea --- /dev/null +++ b/src/devices/cpu/h8/h8s2329.cpp @@ -0,0 +1,179 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + h8s2329.cpp + + H8S-2329 family emulation + Subdevice of h8s2319.cpp + +***************************************************************************/ + +#include "emu.h" +#include "h8s2329.h" + +DEFINE_DEVICE_TYPE(H8S2320, h8s2320_device, "h8s2320", "Hitachi H8S/2320") +DEFINE_DEVICE_TYPE(H8S2321, h8s2321_device, "h8s2321", "Hitachi H8S/2321") +DEFINE_DEVICE_TYPE(H8S2322, h8s2322_device, "h8s2322", "Hitachi H8S/2322") +DEFINE_DEVICE_TYPE(H8S2323, h8s2323_device, "h8s2323", "Hitachi H8S/2323") +DEFINE_DEVICE_TYPE(H8S2324, h8s2324_device, "h8s2324", "Hitachi H8S/2324") +DEFINE_DEVICE_TYPE(H8S2326, h8s2326_device, "h8s2326", "Hitachi H8S/2326") +DEFINE_DEVICE_TYPE(H8S2327, h8s2327_device, "h8s2327", "Hitachi H8S/2327") +DEFINE_DEVICE_TYPE(H8S2328, h8s2328_device, "h8s2328", "Hitachi H8S/2328") +DEFINE_DEVICE_TYPE(H8S2329, h8s2329_device, "h8s2329", "Hitachi H8S/2329") + + +h8s2321_device::h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start) : + h8s2319_device(mconfig, type, tag, owner, clock, map_delegate, start), + m_port5(*this, "port5"), + m_port6(*this, "port6") +{ +} + +h8s2321_device::h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2321_device(mconfig, H8S2321, tag, owner, clock, address_map_constructor(FUNC(h8s2321_device::map_2321), this), 0xffec00) +{ +} + + +h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) : + h8s2321_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2320_device::map_2320), this), start), + m_dma(*this, "dma"), + m_dmac(*this, "dma:%u", 0), + m_tend_cb(*this) +{ +} + +h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2320, tag, owner, clock, 0xffec00) +{ +} + + +h8s2322_device::h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2322, tag, owner, clock, 0xffdc00) +{ +} + +h8s2323_device::h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2323, tag, owner, clock, 0xffdc00) +{ +} + +h8s2324_device::h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2324, tag, owner, clock, 0xff7c00) +{ +} + +h8s2326_device::h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2326, tag, owner, clock, 0xffdc00) +{ +} + +h8s2327_device::h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2327, tag, owner, clock, 0xffdc00) +{ +} + +h8s2328_device::h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2328, tag, owner, clock, 0xffdc00) +{ +} + +h8s2329_device::h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + h8s2320_device(mconfig, H8S2329, tag, owner, clock, 0xff7c00) +{ +} + +void h8s2321_device::map_2321(address_map &map) +{ + h8s2319_device::map(map); + + map(0xfffeb4, 0xfffeb4).w(m_port5, FUNC(h8_port_device::ddr_w)); + map(0xfffeb5, 0xfffeb5).w(m_port6, FUNC(h8_port_device::ddr_w)); + + map(0xffff30, 0xffff35).rw(m_dtc, FUNC(h8_dtc_device::dtcer_r), FUNC(h8_dtc_device::dtcer_w)); + + map(0xffff54, 0xffff54).r(m_port5, FUNC(h8_port_device::port_r)); + map(0xffff55, 0xffff55).r(m_port6, FUNC(h8_port_device::port_r)); + map(0xffff64, 0xffff64).rw(m_port5, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + map(0xffff65, 0xffff65).rw(m_port6, FUNC(h8_port_device::dr_r), FUNC(h8_port_device::dr_w)); + + map(0xffff88, 0xffff88).rw(m_sci[2], FUNC(h8_sci_device::smr_r), FUNC(h8_sci_device::smr_w)); + map(0xffff89, 0xffff89).rw(m_sci[2], FUNC(h8_sci_device::brr_r), FUNC(h8_sci_device::brr_w)); + map(0xffff8a, 0xffff8a).rw(m_sci[2], FUNC(h8_sci_device::scr_r), FUNC(h8_sci_device::scr_w)); + map(0xffff8b, 0xffff8b).rw(m_sci[2], FUNC(h8_sci_device::tdr_r), FUNC(h8_sci_device::tdr_w)); + map(0xffff8c, 0xffff8c).rw(m_sci[2], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); + map(0xffff8d, 0xffff8d).r(m_sci[2], FUNC(h8_sci_device::rdr_r)); + map(0xffff8e, 0xffff8e).rw(m_sci[2], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); +} + +void h8s2320_device::map_2320(address_map &map) +{ + map_2321(map); + + map(0xfffee0, 0xfffee1).rw(m_dmac[0], FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); + map(0xfffee2, 0xfffee3).rw(m_dmac[0], FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); + map(0xfffee4, 0xfffee5).rw(m_dmac[0], FUNC(h8s_dma_channel_device::ioara_r), FUNC(h8s_dma_channel_device::ioara_w)); + map(0xfffee6, 0xfffee7).rw(m_dmac[0], FUNC(h8s_dma_channel_device::etcra_r), FUNC(h8s_dma_channel_device::etcra_w)); + map(0xfffee8, 0xfffee9).rw(m_dmac[0], FUNC(h8s_dma_channel_device::marbh_r), FUNC(h8s_dma_channel_device::marbh_w)); + map(0xfffeea, 0xfffeeb).rw(m_dmac[0], FUNC(h8s_dma_channel_device::marbl_r), FUNC(h8s_dma_channel_device::marbl_w)); + map(0xfffeec, 0xfffeed).rw(m_dmac[0], FUNC(h8s_dma_channel_device::ioarb_r), FUNC(h8s_dma_channel_device::ioarb_w)); + map(0xfffeee, 0xfffeef).rw(m_dmac[0], FUNC(h8s_dma_channel_device::etcrb_r), FUNC(h8s_dma_channel_device::etcrb_w)); + map(0xfffef0, 0xfffef1).rw(m_dmac[1], FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); + map(0xfffef2, 0xfffef3).rw(m_dmac[1], FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); + map(0xfffef4, 0xfffef5).rw(m_dmac[1], FUNC(h8s_dma_channel_device::ioara_r), FUNC(h8s_dma_channel_device::ioara_w)); + map(0xfffef6, 0xfffef7).rw(m_dmac[1], FUNC(h8s_dma_channel_device::etcra_r), FUNC(h8s_dma_channel_device::etcra_w)); + map(0xfffef8, 0xfffef9).rw(m_dmac[1], FUNC(h8s_dma_channel_device::marbh_r), FUNC(h8s_dma_channel_device::marbh_w)); + map(0xfffefa, 0xfffefb).rw(m_dmac[1], FUNC(h8s_dma_channel_device::marbl_r), FUNC(h8s_dma_channel_device::marbl_w)); + map(0xfffefc, 0xfffefd).rw(m_dmac[1], FUNC(h8s_dma_channel_device::ioarb_r), FUNC(h8s_dma_channel_device::ioarb_w)); + map(0xfffefe, 0xfffeff).rw(m_dmac[1], FUNC(h8s_dma_channel_device::etcrb_r), FUNC(h8s_dma_channel_device::etcrb_w)); + map(0xffff00, 0xffff00).rw(m_dma, FUNC(h8s_dma_device::dmawer_r), FUNC(h8s_dma_device::dmawer_w)); + map(0xffff01, 0xffff01).rw(m_dma, FUNC(h8s_dma_device::dmatcr_r), FUNC(h8s_dma_device::dmatcr_w)); + map(0xffff02, 0xffff03).rw(m_dmac[0], FUNC(h8s_dma_channel_device::dmacr_r), FUNC(h8s_dma_channel_device::dmacr_w)); + map(0xffff04, 0xffff05).rw(m_dmac[1], FUNC(h8s_dma_channel_device::dmacr_r), FUNC(h8s_dma_channel_device::dmacr_w)); + map(0xffff06, 0xffff07).rw(m_dma, FUNC(h8s_dma_device::dmabcr_r), FUNC(h8s_dma_device::dmabcr_w)); +} + +void h8s2321_device::notify_standby(int state) +{ + h8s2319_device::notify_standby(state); + m_sci[2]->notify_standby(state); +} + +void h8s2321_device::device_add_mconfig(machine_config &config) +{ + h8s2319_device::device_add_mconfig(config); + + H8_PORT(config, m_port5, *this, h8_device::PORT_5, 0x00, 0xf0); + H8_PORT(config, m_port6, *this, h8_device::PORT_6, 0x00, 0x00); + H8_PORT(config.replace(), m_porta[0], *this, h8_device::PORT_A, 0x00, 0x00); + + H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); +} + +void h8s2320_device::device_add_mconfig(machine_config &config) +{ + h8s2321_device::device_add_mconfig(config); + + H8S_DMA(config, m_dma, *this); + H8S_DMA_CHANNEL(config, m_dmac[0], *this, m_dma, m_intc); + H8S_DMA_CHANNEL(config, m_dmac[1], *this, m_dma, m_intc); +} + +void h8s2320_device::execute_set_input(int inputnum, int state) +{ + // TEND and DREQ pins are not supported on H8S/2321 + if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) + m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); + else if(inputnum == H8_INPUT_LINE_DREQ0 || inputnum == H8_INPUT_LINE_DREQ1) + m_dma->set_input(inputnum, state); + else + h8s2319_device::execute_set_input(inputnum, state); +} + +void h8s2320_device::device_start() +{ + h8s2319_device::device_start(); + m_dma_device = m_dma; +} diff --git a/src/devices/cpu/h8/h8s2329.h b/src/devices/cpu/h8/h8s2329.h new file mode 100644 index 0000000000000..fcee3b2b0078d --- /dev/null +++ b/src/devices/cpu/h8/h8s2329.h @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + h8s2329.h + + H8S-2329 family emulation + (compared to H8S-2319 family: adds DMA, 1 more SCI) + + H8S/2000-based mcus. + + Variant ROM RAM note + H8S/2320 - 4K + H8S/2321 - 4K no DMA + H8S/2322 - 8K + H8S/2323 32K 8K + H8S/2324 - 32K + H8S/2326 512K 8K + H8S/2327 128K 8K + H8S/2328 256K 8K + H8S/2329 384K 32K + +***************************************************************************/ + +#ifndef MAME_CPU_H8_H8S2329_H +#define MAME_CPU_H8_H8S2329_H + +#pragma once + +#include "h8s2319.h" +#include "h8_dma.h" + +class h8s2321_device : public h8s2319_device { +public: + h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // see h8s2319.h for more + auto read_port5() { return m_read_port [PORT_5].bind(); } + auto write_port5() { return m_write_port[PORT_5].bind(); } + auto read_port6() { return m_read_port [PORT_6].bind(); } + auto write_port6() { return m_write_port[PORT_6].bind(); } + +protected: + h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start); + + required_device m_port5; + required_device m_port6; + + virtual void notify_standby(int state) override; + virtual void device_add_mconfig(machine_config &config) override; + void map_2321(address_map &map); +}; + +class h8s2320_device : public h8s2321_device { +public: + h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + auto tend0_cb() { return m_tend_cb[0].bind(); } + auto tend1_cb() { return m_tend_cb[1].bind(); } + +protected: + required_device m_dma; + required_device_array m_dmac; + + devcb_write_line::array<2> m_tend_cb; + + h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start); + + virtual void device_add_mconfig(machine_config &config) override; + void map_2320(address_map &map); + + virtual void device_start() override; + virtual void execute_set_input(int inputnum, int state) override; +}; + +class h8s2322_device : public h8s2320_device { +public: + h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2323_device : public h8s2320_device { +public: + h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2324_device : public h8s2320_device { +public: + h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2326_device : public h8s2320_device { +public: + h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2327_device : public h8s2320_device { +public: + h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2328_device : public h8s2320_device { +public: + h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class h8s2329_device : public h8s2320_device { +public: + h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +DECLARE_DEVICE_TYPE(H8S2320, h8s2320_device) +DECLARE_DEVICE_TYPE(H8S2321, h8s2321_device) +DECLARE_DEVICE_TYPE(H8S2322, h8s2322_device) +DECLARE_DEVICE_TYPE(H8S2323, h8s2323_device) +DECLARE_DEVICE_TYPE(H8S2324, h8s2324_device) +DECLARE_DEVICE_TYPE(H8S2326, h8s2326_device) +DECLARE_DEVICE_TYPE(H8S2327, h8s2327_device) +DECLARE_DEVICE_TYPE(H8S2328, h8s2328_device) +DECLARE_DEVICE_TYPE(H8S2329, h8s2329_device) + +#endif // MAME_CPU_H8_H8S2329_H diff --git a/src/devices/cpu/h8/h8s2357.cpp b/src/devices/cpu/h8/h8s2357.cpp index b8378575c8409..1f0baa0e1d1ed 100644 --- a/src/devices/cpu/h8/h8s2357.cpp +++ b/src/devices/cpu/h8/h8s2357.cpp @@ -111,8 +111,7 @@ void h8s2357_device::map(address_map &map) map(0xfffebd, 0xfffebd).w(m_porte, FUNC(h8_port_device::ddr_w)); map(0xfffebe, 0xfffebe).w(m_portf, FUNC(h8_port_device::ddr_w)); map(0xfffebf, 0xfffebf).w(m_portg, FUNC(h8_port_device::ddr_w)); - map(0xfffec4, 0xfffecd).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); - map(0xfffece, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::iprk_r), FUNC(h8s_intc_device::iprk_w)); + map(0xfffec4, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); map(0xfffee0, 0xfffee1).rw(m_dma0, FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); map(0xfffee2, 0xfffee3).rw(m_dma0, FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); map(0xfffee4, 0xfffee5).rw(m_dma0, FUNC(h8s_dma_channel_device::ioara_r), FUNC(h8s_dma_channel_device::ioara_w)); @@ -250,63 +249,63 @@ void h8s2357_device::device_add_mconfig(machine_config &config) H8_PORT(config, m_porte, *this, h8_device::PORT_E, 0x00, 0x00); H8_PORT(config, m_portf, *this, h8_device::PORT_F, 0x00, 0x00); H8_PORT(config, m_portg, *this, h8_device::PORT_G, 0xe0, 0xe0); - H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); - H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); + H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); + H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); H8_TIMER16(config, m_timer16, *this, 6, 0x00); H8S_TIMER16_CHANNEL(config, m_timer16_0, *this, 4, 0x60, m_intc, 32, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::INPUT_D); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::INPUT_D); H8S_TIMER16_CHANNEL(config, m_timer16_1, *this, 2, 0x4c, m_intc, 40, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); H8S_TIMER16_CHANNEL(config, m_timer16_2, *this, 2, 0x4c, m_intc, 44, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024); H8S_TIMER16_CHANNEL(config, m_timer16_3, *this, 4, 0x60, m_intc, 48, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::DIV_4096); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::DIV_4096); H8S_TIMER16_CHANNEL(config, m_timer16_4, *this, 2, 0x4c, m_intc, 56, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_5); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16_5); H8S_TIMER16_CHANNEL(config, m_timer16_5, *this, 2, 0x4c, m_intc, 60, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::INPUT_D); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::INPUT_D); H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); @@ -395,6 +394,23 @@ void h8s2357_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h8s2357_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_sci[2]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_timer16_5->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h8s2357_device::device_start() { h8s2000_device::device_start(); diff --git a/src/devices/cpu/h8/h8s2357.h b/src/devices/cpu/h8/h8s2357.h index a328e948868c3..3217f8dbf878f 100644 --- a/src/devices/cpu/h8/h8s2357.h +++ b/src/devices/cpu/h8/h8s2357.h @@ -110,6 +110,7 @@ class h8s2357_device : public h8s2000_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/h8s2655.cpp b/src/devices/cpu/h8/h8s2655.cpp index 54a644ded0621..ab4fb1fc8eb67 100644 --- a/src/devices/cpu/h8/h8s2655.cpp +++ b/src/devices/cpu/h8/h8s2655.cpp @@ -88,10 +88,8 @@ void h8s2655_device::map(address_map &map) map(0xfffebd, 0xfffebd).w(m_porte, FUNC(h8_port_device::ddr_w)); map(0xfffebe, 0xfffebe).w(m_portf, FUNC(h8_port_device::ddr_w)); map(0xfffebf, 0xfffebf).w(m_portg, FUNC(h8_port_device::ddr_w)); - map(0xfffec0, 0xfffec1).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); - map(0xfffec2, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icrc_r), FUNC(h8s_intc_device::icrc_w)); - map(0xfffec4, 0xfffecd).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); - map(0xfffece, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::iprk_r), FUNC(h8s_intc_device::iprk_w)); + map(0xfffec0, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); + map(0xfffec4, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); map(0xfffee0, 0xfffee1).rw(m_dma0, FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); map(0xfffee2, 0xfffee3).rw(m_dma0, FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); @@ -230,63 +228,63 @@ void h8s2655_device::device_add_mconfig(machine_config &config) H8_PORT(config, m_porte, *this, h8_device::PORT_E, 0x00, 0x00); H8_PORT(config, m_portf, *this, h8_device::PORT_F, 0x00, 0x00); H8_PORT(config, m_portg, *this, h8_device::PORT_G, 0xe0, 0xe0); - H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); - H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); + H8H_TIMER8_CHANNEL(config, m_timer8_0, *this, m_intc, 64, 65, 66, m_timer8_1, h8_timer8_channel_device::CHAIN_OVERFLOW, true, false); + H8H_TIMER8_CHANNEL(config, m_timer8_1, *this, m_intc, 68, 69, 70, m_timer8_0, h8_timer8_channel_device::CHAIN_A, false, false); H8_TIMER16(config, m_timer16, *this, 6, 0x00); H8S_TIMER16_CHANNEL(config, m_timer16_0, *this, 4, 0x60, m_intc, 32, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::INPUT_D); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::INPUT_D); H8S_TIMER16_CHANNEL(config, m_timer16_1, *this, 2, 0x4c, m_intc, 40, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16_2); H8S_TIMER16_CHANNEL(config, m_timer16_2, *this, 2, 0x4c, m_intc, 44, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_B, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_B, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024); H8S_TIMER16_CHANNEL(config, m_timer16_3, *this, 4, 0x60, m_intc, 48, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::DIV_4096); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::DIV_4096); H8S_TIMER16_CHANNEL(config, m_timer16_4, *this, 2, 0x4c, m_intc, 56, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_1024, - h8_timer16_channel_device::CHAIN).set_chain(m_timer16_5); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_1024, + h8_timer16_channel_device::CHAIN).set_chain(m_timer16_5); H8S_TIMER16_CHANNEL(config, m_timer16_5, *this, 2, 0x4c, m_intc, 60, - h8_timer16_channel_device::DIV_1, - h8_timer16_channel_device::DIV_4, - h8_timer16_channel_device::DIV_16, - h8_timer16_channel_device::DIV_64, - h8_timer16_channel_device::INPUT_A, - h8_timer16_channel_device::INPUT_C, - h8_timer16_channel_device::DIV_256, - h8_timer16_channel_device::INPUT_D); + h8_timer16_channel_device::DIV_1, + h8_timer16_channel_device::DIV_4, + h8_timer16_channel_device::DIV_16, + h8_timer16_channel_device::DIV_64, + h8_timer16_channel_device::INPUT_A, + h8_timer16_channel_device::INPUT_C, + h8_timer16_channel_device::DIV_256, + h8_timer16_channel_device::INPUT_D); H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); @@ -408,6 +406,23 @@ void h8s2655_device::internal_update(u64 current_time) recompute_bcount(event_time); } +void h8s2655_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_sci[2]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_timer16_5->notify_standby(state); + m_watchdog->notify_standby(state); +} + void h8s2655_device::device_start() { h8s2600_device::device_start(); diff --git a/src/devices/cpu/h8/h8s2655.h b/src/devices/cpu/h8/h8s2655.h index cd393b38deec0..d92a1e8c5bc64 100644 --- a/src/devices/cpu/h8/h8s2655.h +++ b/src/devices/cpu/h8/h8s2655.h @@ -101,6 +101,7 @@ class h8s2655_device : public h8s2600_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; void map(address_map &map); diff --git a/src/devices/cpu/h8/swx00.cpp b/src/devices/cpu/h8/swx00.cpp index c65a10e301c20..e06780fb83ed3 100644 --- a/src/devices/cpu/h8/swx00.cpp +++ b/src/devices/cpu/h8/swx00.cpp @@ -8,7 +8,6 @@ DEFINE_DEVICE_TYPE(SWX00, swx00_device, "swx00", "Yamaha SWX00") swx00_device::swx00_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, u8 mode) : h8s2000_device(mconfig, SWX00, tag, owner, clock, address_map_constructor(FUNC(swx00_device::map), this)), m_intc(*this, "intc"), -#if 0 m_adc(*this, "adc"), m_dma(*this, "dma"), m_dma0(*this, "dma:0"), @@ -36,7 +35,6 @@ swx00_device::swx00_device(const machine_config &mconfig, const char *tag, devic m_timer16_4(*this, "timer16:4"), m_timer16_5(*this, "timer16:5"), m_watchdog(*this, "watchdog"), -#endif m_data_config(mode & MODE_DUAL ? "s" : "c", ENDIANNESS_BIG, 16, mode & MODE_DUAL ? 24 : 22), m_mode(mode), m_syscr(0) @@ -46,8 +44,7 @@ swx00_device::swx00_device(const machine_config &mconfig, const char *tag, devic void swx00_device::map(address_map &map) { - map(0xffec00, 0xfffbff).ram(); -#if 0 + map(0xffe100, 0xfffbff).ram(); map(0xfffe80, 0xfffe80).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w)); map(0xfffe81, 0xfffe81).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w)); map(0xfffe82, 0xfffe83).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w)); @@ -81,10 +78,8 @@ void swx00_device::map(address_map &map) map(0xfffebd, 0xfffebd).w(m_porte, FUNC(h8_port_device::ddr_w)); map(0xfffebe, 0xfffebe).w(m_portf, FUNC(h8_port_device::ddr_w)); map(0xfffebf, 0xfffebf).w(m_portg, FUNC(h8_port_device::ddr_w)); - map(0xfffec0, 0xfffec1).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); - map(0xfffec2, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icrc_r), FUNC(h8s_intc_device::icrc_w)); - map(0xfffec4, 0xfffecd).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); - map(0xfffece, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::iprk_r), FUNC(h8s_intc_device::iprk_w)); + map(0xfffec0, 0xfffec2).rw(m_intc, FUNC(h8s_intc_device::icr_r), FUNC(h8s_intc_device::icr_w)); + map(0xfffec4, 0xfffece).rw(m_intc, FUNC(h8s_intc_device::ipr_r), FUNC(h8s_intc_device::ipr_w)); map(0xfffee0, 0xfffee1).rw(m_dma0, FUNC(h8s_dma_channel_device::marah_r), FUNC(h8s_dma_channel_device::marah_w)); map(0xfffee2, 0xfffee3).rw(m_dma0, FUNC(h8s_dma_channel_device::maral_r), FUNC(h8s_dma_channel_device::maral_w)); @@ -165,9 +160,9 @@ void swx00_device::map(address_map &map) map(0xffff8c, 0xffff8c).rw(m_sci[2], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w)); map(0xffff8d, 0xffff8d).r(m_sci[2], FUNC(h8_sci_device::rdr_r)); map(0xffff8e, 0xffff8e).rw(m_sci[2], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w)); - map(0xffff90, 0xffff9f).r(m_adc, FUNC(h8_adc_device::addr16_r)); - map(0xffffa0, 0xffffa0).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w)); - map(0xffffa1, 0xffffa1).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w)); + map(0xffff90, 0xffff97).r(m_adc, FUNC(h8_adc_device::addr8_r)); + map(0xffff98, 0xffff98).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w)); + map(0xffff99, 0xffff99).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w)); map(0xffffb0, 0xffffb0).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); map(0xffffb1, 0xffffb1).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); map(0xffffb2, 0xffffb2).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); @@ -201,14 +196,12 @@ void swx00_device::map(address_map &map) map(0xfffff5, 0xfffff5).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w)); map(0xfffff6, 0xfffff7).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w)); map(0xfffff8, 0xfffffb).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w)); -#endif } void swx00_device::device_add_mconfig(machine_config &config) { H8S_INTC(config, m_intc, *this); -#if 0 - H8_ADC_2655(config, m_adc, *this, m_intc, 28); + H8_ADC_2357(config, m_adc, *this, m_intc, 28); H8S_DMA(config, m_dma, *this); H8S_DMA_CHANNEL(config, m_dma0, *this, m_dma, m_intc); H8S_DMA_CHANNEL(config, m_dma1, *this, m_dma, m_intc); @@ -284,7 +277,6 @@ void swx00_device::device_add_mconfig(machine_config &config) h8_timer16_channel_device::INPUT_D); H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91); H8_WATCHDOG(config, m_watchdog, *this, m_intc, 25, h8_watchdog_device::S); -#endif H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83); H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87); } @@ -395,7 +387,6 @@ void swx00_device::interrupt_taken() void swx00_device::internal_update(u64 current_time) { u64 event_time = 0; -#if 0 add_event(event_time, m_adc->internal_update(current_time)); add_event(event_time, m_sci[0]->internal_update(current_time)); add_event(event_time, m_sci[1]->internal_update(current_time)); @@ -409,11 +400,27 @@ void swx00_device::internal_update(u64 current_time) add_event(event_time, m_timer16_4->internal_update(current_time)); add_event(event_time, m_timer16_5->internal_update(current_time)); add_event(event_time, m_watchdog->internal_update(current_time)); -#endif recompute_bcount(event_time); } +void swx00_device::notify_standby(int state) +{ + m_adc->notify_standby(state); + m_sci[0]->notify_standby(state); + m_sci[1]->notify_standby(state); + m_sci[2]->notify_standby(state); + m_timer8_0->notify_standby(state); + m_timer8_1->notify_standby(state); + m_timer16_0->notify_standby(state); + m_timer16_1->notify_standby(state); + m_timer16_2->notify_standby(state); + m_timer16_3->notify_standby(state); + m_timer16_4->notify_standby(state); + m_timer16_5->notify_standby(state); + m_watchdog->notify_standby(state); +} + void swx00_device::device_start() { h8s2000_device::device_start(); diff --git a/src/devices/cpu/h8/swx00.h b/src/devices/cpu/h8/swx00.h index aad63bcfced9a..3fb2426cc9245 100644 --- a/src/devices/cpu/h8/swx00.h +++ b/src/devices/cpu/h8/swx00.h @@ -50,7 +50,6 @@ class swx00_device : public h8s2000_device { int s_bus_id() const { return m_mode & MODE_DUAL ? AS_DATA : AS_PROGRAM; } int c_bus_id() const { return m_mode & MODE_DUAL ? AS_PROGRAM : AS_DATA; } -#if 0 auto read_port1() { return m_read_port [PORT_1].bind(); } auto write_port1() { return m_write_port[PORT_1].bind(); } auto read_port2() { return m_read_port [PORT_2].bind(); } @@ -76,14 +75,12 @@ class swx00_device : public h8s2000_device { auto write_portf() { return m_write_port[PORT_F].bind(); } auto read_portg() { return m_read_port [PORT_G].bind(); } auto write_portg() { return m_write_port[PORT_G].bind(); } -#endif u8 syscr_r(); void syscr_w(u8 data); protected: required_device m_intc; -#if 0 required_device m_adc; required_device m_dma; required_device m_dma0; @@ -111,7 +108,6 @@ class swx00_device : public h8s2000_device { required_device m_timer16_4; required_device m_timer16_5; required_device m_watchdog; -#endif address_space_config m_data_config; @@ -125,6 +121,7 @@ class swx00_device : public h8s2000_device { virtual int trapa_setup() override; virtual void irq_setup() override; virtual void internal_update(u64 current_time) override; + virtual void notify_standby(int state) override; virtual void device_add_mconfig(machine_config &config) override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/hcd62121/hcd62121.cpp b/src/devices/cpu/hcd62121/hcd62121.cpp index 00faac4f7a204..67d5452ebb222 100644 --- a/src/devices/cpu/hcd62121/hcd62121.cpp +++ b/src/devices/cpu/hcd62121/hcd62121.cpp @@ -61,6 +61,7 @@ hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const ch , m_dseg(0) , m_sseg(0) , m_f(0) + , m_time(0) , m_lar(0) , m_opt(0) , m_port(0) @@ -1443,11 +1444,18 @@ void hcd62121_cpu_device::execute_run() break; case 0xB1: /* unk_B1 reg/i8 - PORTx control/direction? */ - case 0xB3: /* unk_B3 reg/i8 - timer/irq related? */ logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); read_op(); break; + case 0xB3: /* timer_set i8 */ + { + u8 arg = read_op(); + + m_time = arg; + } + break; + case 0xB4: /* out koh,reg */ m_koh_cb(m_reg[read_op() & 0x7f]); break; @@ -1710,6 +1718,15 @@ void hcd62121_cpu_device::execute_run() } break; + case 0xEA: /* movw reg,pc */ + { + u8 reg1 = read_op(); + + m_reg[reg1 & 0x7f] = m_ip & 0xff; + m_reg[(reg1 + 1) & 0x7f] = m_ip >> 8; + } + break; + case 0xEB: /* movw reg,sp */ { u8 reg1 = read_op(); @@ -1719,6 +1736,14 @@ void hcd62121_cpu_device::execute_run() } break; + case 0xED: /* movb reg,ds */ + m_reg[read_op() & 0x7f] = m_dseg; + break; + + case 0xEE: /* movb reg,cs */ + m_reg[read_op() & 0x7f] = m_cseg; + break; + case 0xEF: /* movb reg,ss */ m_reg[read_op() & 0x7f] = m_sseg; break; @@ -1736,20 +1761,164 @@ void hcd62121_cpu_device::execute_run() case 0xF1: /* unk_F1 reg/i8 (out?) */ case 0xF3: /* unk_F3 reg/i8 (out?) */ case 0xF5: /* unk_F5 reg/i8 (out?) */ - case 0xF7: /* unk_F7 reg/i8 (out?) */ + case 0xF7: /* timer_ctrl i8 */ logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); read_op(); break; case 0xFC: /* unk_FC - disable interrupts/stop timer?? */ case 0xFD: /* unk_FD */ - case 0xFE: /* unk_FE - wait for/start timer */ - if (op == 0xFE) - m_icount -= 75000; // TODO: temporary value that makes emulation speed acceptable - logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); break; + case 0xFE: /* timer_wait */ + if (m_time & 0x01) { + /* + When timer control is set with operand 0xC0, the CPU periodically reads + from external RAM (address range 0x7c00..0x7fff) at an interval of + 832 clock cycles, with the reads themselves taking another 64 clock cycles. + This needs to be explicitly setup, involving writes to unknown segments + 0x11 and 0xE1 (see cfx9850.bin @ 00:00fe), otherwise there's only activity + on address lines without any reads. + + The total sum of these state reads can be approximated to the closest + power of two to define timeout values. Multiple samples were averaged, + as the state read interval can start at a distinct point in time from + the timer wait execution. + */ + const u64 TIMER_STATE_READ_CYCLES = 832 + 64; + u64 cycles_until_timeout = 0; + switch (m_time) { + case 0x11: + case 0x13: + case 0x15: + case 0x17: + case 0x19: + case 0x1b: + case 0x1d: + case 0x1f: + case 0x31: + case 0x33: + case 0x35: + case 0x37: + case 0x39: + case 0x3b: + case 0x3d: + case 0x3f: + case 0x51: + case 0x53: + case 0x55: + case 0x57: + case 0x59: + case 0x5b: + case 0x5d: + case 0x5f: + case 0x71: + case 0x73: + case 0x75: + case 0x77: + case 0x79: + case 0x7b: + case 0x7d: + case 0x7f: + case 0x91: + case 0x93: + case 0x95: + case 0x97: + case 0x99: + case 0x9b: + case 0x9d: + case 0x9f: + case 0xb1: + case 0xb3: + case 0xb5: + case 0xb7: + case 0xb9: + case 0xbb: + case 0xbd: + case 0xbf: + case 0xd1: + case 0xd3: + case 0xd5: + case 0xd7: + case 0xd9: + case 0xdb: + case 0xdd: + case 0xdf: + // Approximately 814.32us + cycles_until_timeout = 0x4 * TIMER_STATE_READ_CYCLES; + break; + case 0x21: + case 0x23: + case 0x25: + case 0x27: + case 0x29: + case 0x2b: + case 0x2d: + case 0x2f: + case 0x61: + case 0x63: + case 0x65: + case 0x67: + case 0x69: + case 0x6b: + case 0x6d: + case 0x6f: + case 0xa1: + case 0xa3: + case 0xa5: + case 0xa7: + case 0xa9: + case 0xab: + case 0xad: + case 0xaf: + // Approximately 1.63ms + cycles_until_timeout = 0x8 * TIMER_STATE_READ_CYCLES; + break; + case 0x05: + case 0x07: + case 0x0d: + case 0x0f: + case 0x45: + case 0x47: + case 0x4d: + case 0x4f: + case 0xc5: + case 0xc7: + case 0xcd: + case 0xcf: + // Approximately 209.34ms + cycles_until_timeout = 0x400 * TIMER_STATE_READ_CYCLES; + break; + case 0x49: + case 0x4b: + case 0xc9: + case 0xcb: + // Approximately 837.61ms + cycles_until_timeout = 0x1000 * TIMER_STATE_READ_CYCLES; + break; + case 0x41: + case 0x43: + case 0xc1: + case 0xc3: + // Approximately 1.68s + cycles_until_timeout = 0x2000 * TIMER_STATE_READ_CYCLES; + break; + case 0x81: + case 0x83: + // Approximately 100.58s + cycles_until_timeout = 0x7a800 * TIMER_STATE_READ_CYCLES; + break; + default: + logerror("%02x:%04x: unimplemented timer value %02x encountered\n", m_cseg, m_ip-1, m_time); + break; + } + m_icount -= cycles_until_timeout; + } else { + logerror("%02x:%04x: wait for disabled timer? value %02x\n", m_cseg, m_ip-1, m_time); + } + break; + case 0xFF: /* nop */ break; diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h index d7d35a881dd1e..785a283076ae1 100644 --- a/src/devices/cpu/hcd62121/hcd62121.h +++ b/src/devices/cpu/hcd62121/hcd62121.h @@ -91,6 +91,7 @@ class hcd62121_cpu_device : public cpu_device u8 m_dseg; u8 m_sseg; u8 m_f; + u8 m_time; u16 m_lar; u8 m_reg[0x80]; diff --git a/src/devices/cpu/m68000/tmp68301.cpp b/src/devices/cpu/m68000/tmp68301.cpp index dcbd3a4a4a700..5063f50413840 100644 --- a/src/devices/cpu/m68000/tmp68301.cpp +++ b/src/devices/cpu/m68000/tmp68301.cpp @@ -1099,8 +1099,15 @@ void tmp68301_device::serial_tx_update(int ch) nstate = m_smr[ch] & SMR_PEN ? SR_PARITY : SR_STOP; break; - case SR_PARITY: - abort(); + case SR_PARITY: { + u32 parity = m_smr[ch] & SMR_PEO ? 0 : 1; + for(u32 i = 0; i != 5 + ((m_smr[ch] >> SMR_CL_SFT) & 3); i++) + if((m_serial_tx[ch] >> i) & 1) + parity = parity ^ 1; + m_tx_cb[ch](parity); + nstate = SR_STOP; + break; + } case SR_STOP: m_tx_cb[ch](1); diff --git a/src/devices/cpu/ns32000/common.h b/src/devices/cpu/ns32000/common.h index a93259617c96f..fa978729b4970 100644 --- a/src/devices/cpu/ns32000/common.h +++ b/src/devices/cpu/ns32000/common.h @@ -32,38 +32,6 @@ namespace ns32000 }; } -class ns32000_state_interface -{ -public: - virtual void state_add(device_state_interface &parent, int &index) = 0; -}; - -class ns32000_fpu_interface - : public device_interface - , public ns32000_state_interface -{ -protected: - ns32000_fpu_interface(machine_config const &mconfig, device_t &device) - : device_interface(device, "ns32000_fpu") - { - } -}; - -class ns32000_mmu_interface - : public device_interface - , public ns32000_state_interface -{ -public: - enum translate_result : unsigned { COMPLETE, CANCEL, ABORT }; - virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool flag = false, bool suppress = false) = 0; - -protected: - ns32000_mmu_interface(machine_config const &mconfig, device_t &device) - : device_interface(device, "ns32000_mmu") - { - } -}; - class ns32000_slave_interface : public device_interface { public: @@ -75,6 +43,14 @@ class ns32000_slave_interface : public device_interface { } + enum slave_idbyte : u8 + { + FORMAT_9 = 0x3e, // fpu + FORMAT_11 = 0xbe, // fpu + FORMAT_12 = 0xfe, // fpu + FORMAT_14 = 0x1e, // mmu + }; + enum slave_status : u16 { SLAVE_Q = 0x0001, // quit (1=error) @@ -87,6 +63,8 @@ class ns32000_slave_interface : public device_interface SLAVE_OK = 0, }; + virtual void state_add(device_state_interface &parent, int &index) = 0; + protected: ns32000_slave_interface(machine_config const &mconfig, device_t &device, char const *type) : device_interface(device, type) @@ -97,31 +75,52 @@ class ns32000_slave_interface : public device_interface devcb_write_line m_out_scb; }; -class ns32000_slow_slave_interface : public ns32000_slave_interface +class ns32000_fpu_interface : public ns32000_slave_interface +{ +protected: + ns32000_fpu_interface(machine_config const &mconfig, device_t &device) + : ns32000_slave_interface(mconfig, device) + { + } +}; + +class ns32000_mmu_interface : public ns32000_slave_interface { public: - virtual void write_id(u16 data) = 0; - virtual void write_op(u16 data) = 0; - virtual u16 read_st(int *icount = nullptr) = 0; - virtual u16 read_op() = 0; + enum translate_result : unsigned { COMPLETE, CANCEL, ABORT }; + virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool flag = false, bool suppress = false) = 0; protected: - ns32000_slow_slave_interface(machine_config const &mconfig, device_t &device) + ns32000_mmu_interface(machine_config const &mconfig, device_t &device) : ns32000_slave_interface(mconfig, device) { } }; -class ns32000_fast_slave_interface : public ns32000_slave_interface +class ns32000_slow_slave_interface : public device_interface +{ +public: + virtual u16 slow_status(int *icount = nullptr) = 0; + virtual u16 slow_read() = 0; + virtual void slow_write(u16 data) = 0; + +protected: + ns32000_slow_slave_interface(machine_config const &mconfig, device_t &device) + : device_interface(device, "ns32000_slave_slow") + { + } +}; + +class ns32000_fast_slave_interface : public device_interface { public: - virtual u32 read_st32(int *icount = nullptr) = 0; - virtual u32 read() = 0; - virtual void write(u32 data) = 0; + virtual u32 fast_status(int *icount = nullptr) = 0; + virtual u32 fast_read() = 0; + virtual void fast_write(u32 data) = 0; protected: ns32000_fast_slave_interface(machine_config const &mconfig, device_t &device) - : ns32000_slave_interface(mconfig, device) + : device_interface(device, "ns32000_slave_fast") { } }; diff --git a/src/devices/cpu/ns32000/ns32000.cpp b/src/devices/cpu/ns32000/ns32000.cpp index d28d25b03ad9e..6fef593dfd8a8 100644 --- a/src/devices/cpu/ns32000/ns32000.cpp +++ b/src/devices/cpu/ns32000/ns32000.cpp @@ -3128,14 +3128,14 @@ template void ns32000_device::execute } } break; - case 0x3e: + case ns32000_slave_interface::FORMAT_9: // format 9: xxxx xyyy yyoo ofii 0011 1110 if (m_cfg & CFG_F) { u16 const opword = fetch(bytes); addr_mode mode[] = { addr_mode(BIT(opword, 11, 5)), addr_mode(BIT(opword, 6, 5)) }; - size_code const size_f = BIT(opword, 0) ? SIZE_D : SIZE_Q; + size_code const size_f = BIT(opword, 2) ? SIZE_D : SIZE_Q; size_code const size = size_code(opword & 3); switch (BIT(opword, 3, 3)) @@ -3234,7 +3234,7 @@ template void ns32000_device::execute case 0x7e: // format 10 interrupt(UND); break; - case 0xbe: + case ns32000_slave_interface::FORMAT_11: // format 11: xxxx xyyy yyoo oo0f 1011 1110 if (m_cfg & CFG_F) { @@ -3366,7 +3366,7 @@ template void ns32000_device::execute else interrupt(UND); break; - case 0xfe: + case ns32000_slave_interface::FORMAT_12: // format 12: xxxx xyyy yyoo oo0f 1111 1110 if ((m_cfg & CFG_F) && type() == NS32332) { @@ -3459,7 +3459,7 @@ template void ns32000_device::execute case 0x9e: // format 13 interrupt(UND); break; - case 0x1e: + case ns32000_slave_interface::FORMAT_14: // format 14: xxxx xsss s0oo ooii 0001 1110 if (!(m_psr & PSR_U)) { @@ -3671,7 +3671,7 @@ template u16 ns32000_device::slave(u8 { switch (opbyte) { - case 0x1e: + case ns32000_slave_interface::FORMAT_14: if (!m_mmu) fatalerror("slave mmu coprocessor not configured (%s)\n", machine().describe_context()); @@ -3681,9 +3681,9 @@ template u16 ns32000_device::slave(u8 return slave_slow(dynamic_cast(*m_mmu), opbyte, opword, op1, op2); break; - case 0x3e: - case 0xbe: - case 0xfe: + case ns32000_slave_interface::FORMAT_9: + case ns32000_slave_interface::FORMAT_11: + case ns32000_slave_interface::FORMAT_12: if (!m_fpu) fatalerror("slave fpu coprocessor not configured (%s)\n", machine().describe_context()); @@ -3701,8 +3701,8 @@ template u16 ns32000_device::slave(u8 template u16 ns32000_device::slave_slow(ns32000_slow_slave_interface &slave, u8 opbyte, u16 opword, addr_mode op1, addr_mode op2) { - slave.write_id(opbyte); - slave.write_op(swapendian_int16(opword)); + slave.slow_write(opbyte); + slave.slow_write(swapendian_int16(opword)); if ((op1.access == READ || op1.access == RMW) && !(op1.type == REG && op1.slave)) { @@ -3711,20 +3711,20 @@ template u16 ns32000_device::slave_sl switch (op1.size) { case SIZE_B: - slave.write_op(u8(data)); + slave.slow_write(u8(data)); break; case SIZE_W: - slave.write_op(u16(data)); + slave.slow_write(u16(data)); break; case SIZE_D: - slave.write_op(u16(data >> 0)); - slave.write_op(u16(data >> 16)); + slave.slow_write(u16(data >> 0)); + slave.slow_write(u16(data >> 16)); break; case SIZE_Q: - slave.write_op(u16(data >> 0)); - slave.write_op(u16(data >> 16)); - slave.write_op(u16(data >> 32)); - slave.write_op(u16(data >> 48)); + slave.slow_write(u16(data >> 0)); + slave.slow_write(u16(data >> 16)); + slave.slow_write(u16(data >> 32)); + slave.slow_write(u16(data >> 48)); break; } } @@ -3732,8 +3732,8 @@ template u16 ns32000_device::slave_sl { u32 const data = ea(op1); - slave.write_op(u16(data >> 0)); - slave.write_op(u16(data >> 16)); + slave.slow_write(u16(data >> 0)); + slave.slow_write(u16(data >> 16)); // single-byte memory read cycle mem_read(ns32000::ST_ODT, data, true); @@ -3746,41 +3746,41 @@ template u16 ns32000_device::slave_sl switch (op2.size) { case SIZE_B: - slave.write_op(u8(data)); + slave.slow_write(u8(data)); break; case SIZE_W: - slave.write_op(u16(data)); + slave.slow_write(u16(data)); break; case SIZE_D: - slave.write_op(u16(data >> 0)); - slave.write_op(u16(data >> 16)); + slave.slow_write(u16(data >> 0)); + slave.slow_write(u16(data >> 16)); break; case SIZE_Q: - slave.write_op(u16(data >> 0)); - slave.write_op(u16(data >> 16)); - slave.write_op(u16(data >> 32)); - slave.write_op(u16(data >> 48)); + slave.slow_write(u16(data >> 0)); + slave.slow_write(u16(data >> 16)); + slave.slow_write(u16(data >> 32)); + slave.slow_write(u16(data >> 48)); break; } } - u16 const status = slave.read_st(&m_icount); + u16 const status = slave.slow_status(&m_icount); if (!(status & ns32000_slave_interface::SLAVE_Q)) { if ((op2.access == WRITE || op2.access == RMW) && !(op2.type == REG && op2.slave)) { - u64 data = slave.read_op(); + u64 data = slave.slow_read(); switch (op2.size) { case SIZE_D: - data |= u64(slave.read_op()) << 16; + data |= u64(slave.slow_read()) << 16; break; case SIZE_Q: - data |= u64(slave.read_op()) << 16; - data |= u64(slave.read_op()) << 32; - data |= u64(slave.read_op()) << 48; + data |= u64(slave.slow_read()) << 16; + data |= u64(slave.slow_read()) << 32; + data |= u64(slave.slow_read()) << 48; break; default: break; @@ -3795,7 +3795,7 @@ template u16 ns32000_device::slave_sl template u16 ns32000_device::slave_fast(ns32000_fast_slave_interface &slave, u8 opbyte, u16 opword, addr_mode op1, addr_mode op2) { - slave.write(u32(opbyte) << 24 | u32(swapendian_int16(opword)) << 8); + slave.fast_write(u32(opbyte) << 24 | u32(swapendian_int16(opword)) << 8); if ((op1.access == READ || op1.access == RMW) && !(op1.type == REG && op1.slave)) { @@ -3804,17 +3804,17 @@ template u16 ns32000_device::slave_fa switch (op1.size) { case SIZE_B: - slave.write(u8(data)); + slave.fast_write(u8(data)); break; case SIZE_W: - slave.write(u16(data)); + slave.fast_write(u16(data)); break; case SIZE_D: - slave.write(u32(data)); + slave.fast_write(u32(data)); break; case SIZE_Q: - slave.write(u32(data >> 0)); - slave.write(u32(data >> 32)); + slave.fast_write(u32(data >> 0)); + slave.fast_write(u32(data >> 32)); break; } } @@ -3822,7 +3822,7 @@ template u16 ns32000_device::slave_fa { u32 const data = ea(op1); - slave.write(u32(data)); + slave.fast_write(u32(data)); // single-byte memory read cycle mem_read(ns32000::ST_ODT, data, true); @@ -3835,32 +3835,32 @@ template u16 ns32000_device::slave_fa switch (op2.size) { case SIZE_B: - slave.write(u8(data)); + slave.fast_write(u8(data)); break; case SIZE_W: - slave.write(u16(data)); + slave.fast_write(u16(data)); break; case SIZE_D: - slave.write(u32(data)); + slave.fast_write(u32(data)); break; case SIZE_Q: - slave.write(u32(data >> 0)); - slave.write(u32(data >> 32)); + slave.fast_write(u32(data >> 0)); + slave.fast_write(u32(data >> 32)); break; } } // TODO: status is optional in fast protocol - u32 const status = slave.read_st32(&m_icount); + u32 const status = slave.fast_status(&m_icount); if (!(status & ns32000_slave_interface::SLAVE_Q)) { if ((op2.access == WRITE || op2.access == RMW) && !(op2.type == REG && op2.slave)) { - u64 data = slave.read(); + u64 data = slave.fast_read(); if (op2.size == SIZE_Q) - data |= u64(slave.read()) << 32; + data |= u64(slave.fast_read()) << 32; gen_write(op2, data); } @@ -4162,7 +4162,7 @@ void ns32532_device::spr(unsigned reg, addr_mode const mode, bool user, unsigned u16 ns32532_device::slave(u8 opbyte, u16 opword, addr_mode op1, addr_mode op2) { - if (opbyte == 0x1e) + if (opbyte == FORMAT_14) { switch (BIT(opword, 2, 4)) { diff --git a/src/devices/cpu/ns32000/ns32000d.cpp b/src/devices/cpu/ns32000/ns32000d.cpp index 4b9c49f813d40..170e2c7ae88eb 100644 --- a/src/devices/cpu/ns32000/ns32000d.cpp +++ b/src/devices/cpu/ns32000/ns32000d.cpp @@ -461,7 +461,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b u16 const opword = opcodes.r16(pc + bytes); bytes += 2; addr_mode mode[] = { addr_mode(BIT(opword, 11, 5)), addr_mode(BIT(opword, 6, 5)) }; - size_code const size_f = BIT(opword, 0) ? SIZE_D : SIZE_Q; + size_code const size_f = BIT(opword, 2) ? SIZE_D : SIZE_Q; size_code const size = size_code(opword & 3); switch (BIT(opword, 3, 3)) @@ -473,7 +473,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b mode[0].size_i(size); mode[1].size_f(size_f); decode(mode, pc, opcodes, bytes); - util::stream_format(stream, "MOV%c%c %s, %s", size_char[size], BIT(opword, 0) ? 'F' : 'L', mode[0].mode, mode[1].mode); + util::stream_format(stream, "MOV%c%c %s, %s", size_char[size], BIT(opword, 2) ? 'F' : 'L', mode[0].mode, mode[1].mode); break; case 1: // LFSR src @@ -508,7 +508,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b mode[0].size_f(size_f); mode[1].size_i(size); decode(mode, pc, opcodes, bytes); - util::stream_format(stream, "ROUND%c%c %s, %s", BIT(opword, 0) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); + util::stream_format(stream, "ROUND%c%c %s, %s", BIT(opword, 2) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); break; case 5: // TRUNCfi src,dst @@ -517,7 +517,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b mode[0].size_f(size_f); mode[1].size_i(size); decode(mode, pc, opcodes, bytes); - util::stream_format(stream, "TRUNC%c%c %s, %s", BIT(opword, 0) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); + util::stream_format(stream, "TRUNC%c%c %s, %s", BIT(opword, 2) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); break; case 6: // SFSR dst @@ -534,7 +534,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b mode[0].size_f(size_f); mode[1].size_i(size); decode(mode, pc, opcodes, bytes); - util::stream_format(stream, "FLOOR%c%c %s, %s", BIT(opword, 0) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); + util::stream_format(stream, "FLOOR%c%c %s, %s", BIT(opword, 2) ? 'F' : 'L', size_char[size], mode[0].mode, mode[1].mode); break; } } diff --git a/src/devices/cpu/sh/sh7042.cpp b/src/devices/cpu/sh/sh7042.cpp index 35f559b47ce12..7ef10f19ce112 100644 --- a/src/devices/cpu/sh/sh7042.cpp +++ b/src/devices/cpu/sh/sh7042.cpp @@ -21,13 +21,61 @@ sh7043_device::sh7043_device(const machine_config &mconfig, const char *tag, dev sh7042_device::sh7042_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : sh2_device(mconfig, type, tag, owner, clock, CPU_TYPE_SH2, address_map_constructor(FUNC(sh7042_device::map), this), 32, 0xffffffff), + m_intc(*this, "intc"), + m_adc(*this, "adc"), + m_cmt(*this, "cmt"), + m_porta(*this, "porta"), + m_portb(*this, "portb"), + m_portc(*this, "portc"), + m_portd(*this, "portd"), + m_porte(*this, "porte"), + m_portf(*this, "portf"), m_read_adc(*this, 0), - m_sci_tx(*this) + m_sci_tx(*this), + m_read_port16(*this, 0xffff), + m_write_port16(*this), + m_read_port32(*this, 0xffffffff), + m_write_port32(*this) { + m_port16_names = "bcef"; + m_port32_names = "ad"; for(unsigned int i=0; i != m_read_adc.size(); i++) m_read_adc[i].bind().set([this, i]() { return adc_default(i); }); + for(unsigned int i=0; i != m_read_port16.size(); i++) { + m_read_port16[i].bind().set([this, i]() { return port16_default_r(i); }); + m_write_port16[i].bind().set([this, i](u16 data) { port16_default_w(i, data); }); + } + for(unsigned int i=0; i != m_read_port32.size(); i++) { + m_read_port32[i].bind().set([this, i]() { return port32_default_r(i); }); + m_write_port32[i].bind().set([this, i](u32 data) { port32_default_w(i, data); }); + } } +u16 sh7042_device::port16_default_r(int port) +{ + if(!machine().side_effects_disabled()) + logerror("read of un-hooked port %c\n", m_port16_names[port]); + return 0xffff; +} + +void sh7042_device::port16_default_w(int port, u16 data) +{ + logerror("write of un-hooked port %c %04x\n", m_port16_names[port], data); +} + +u32 sh7042_device::port32_default_r(int port) +{ + if(!machine().side_effects_disabled()) + logerror("read of un-hooked port %c\n", m_port32_names[port]); + return 0xffff; +} + +void sh7042_device::port32_default_w(int port, u32 data) +{ + logerror("write of un-hooked port %c %04x\n", m_port32_names[port], data); +} + + u16 sh7042_device::adc_default(int adc) { logerror("read of un-hooked adc %d\n", adc); @@ -38,70 +86,214 @@ void sh7042_device::device_start() { sh2_device::device_start(); - save_item(NAME(m_addr)); - save_item(NAME(m_adcsr)); - save_item(NAME(m_adcr)); + m_event_timer = timer_alloc(FUNC(sh7042_device::event_timer_tick), this); + + save_item(NAME(m_pcf_ah)); + save_item(NAME(m_pcf_al)); + save_item(NAME(m_pcf_b)); + save_item(NAME(m_pcf_c)); + save_item(NAME(m_pcf_dh)); + save_item(NAME(m_pcf_dl)); + save_item(NAME(m_pcf_e)); + save_item(NAME(m_pcf_if)); + + m_pcf_ah = 0; + m_pcf_al = 0; + m_pcf_b = 0; + m_pcf_c = 0; + m_pcf_dh = 0; + m_pcf_dl = 0; + m_pcf_e = 0; + m_pcf_if = 0; } void sh7042_device::device_reset() { sh2_device::device_reset(); - - memset(m_addr, 0, sizeof(m_addr)); - m_adcsr = m_adcr = 0; } + void sh7042_device::map(address_map &map) { - map(0xffff83e0, 0xffff83e0).rw(FUNC(sh7042_device::adcsr_r), FUNC(sh7042_device::adcsr_w)); - map(0xffff83e1, 0xffff83e1).rw(FUNC(sh7042_device::adcr_r), FUNC(sh7042_device::adcr_w)); - map(0xffff83f0, 0xffff83ff).r(FUNC(sh7042_device::addr_r)); + map(0xffff8348, 0xffff8357).rw(m_intc, FUNC(sh_intc_device::ipr_r), FUNC(sh_intc_device::ipr_w)); + map(0xffff8358, 0xffff8359).rw(m_intc, FUNC(sh_intc_device::icr_r), FUNC(sh_intc_device::icr_w)); + map(0xffff835a, 0xffff835b).rw(m_intc, FUNC(sh_intc_device::isr_r), FUNC(sh_intc_device::isr_w)); + + map(0xffff8380, 0xffff8383).rw(m_porta, FUNC(sh_port32_device::dr_r), FUNC(sh_port32_device::dr_w)); + map(0xffff8384, 0xffff8387).rw(m_porta, FUNC(sh_port32_device::io_r), FUNC(sh_port32_device::io_w)); + map(0xffff8388, 0xffff8389).rw(FUNC(sh7042_device::pcf_ah_r), FUNC(sh7042_device::pcf_ah_w)); + map(0xffff838c, 0xffff838f).rw(FUNC(sh7042_device::pcf_al_r), FUNC(sh7042_device::pcf_al_w)); + map(0xffff8390, 0xffff8391).rw(m_portb, FUNC(sh_port16_device::dr_r), FUNC(sh_port16_device::dr_w)); + map(0xffff8392, 0xffff8393).rw(m_portc, FUNC(sh_port16_device::dr_r), FUNC(sh_port16_device::dr_w)); + map(0xffff8394, 0xffff8395).rw(m_portb, FUNC(sh_port16_device::io_r), FUNC(sh_port16_device::io_w)); + map(0xffff8396, 0xffff8397).rw(m_portc, FUNC(sh_port16_device::io_r), FUNC(sh_port16_device::io_w)); + map(0xffff8398, 0xffff839b).rw(FUNC(sh7042_device::pcf_b_r), FUNC(sh7042_device::pcf_b_w)); + map(0xffff839c, 0xffff839d).rw(FUNC(sh7042_device::pcf_c_r), FUNC(sh7042_device::pcf_c_w)); + map(0xffff83a0, 0xffff83a3).rw(m_portd, FUNC(sh_port32_device::dr_r), FUNC(sh_port32_device::dr_w)); + map(0xffff83a4, 0xffff83a7).rw(m_portd, FUNC(sh_port32_device::io_r), FUNC(sh_port32_device::io_w)); + map(0xffff83a8, 0xffff83ab).rw(FUNC(sh7042_device::pcf_dh_r), FUNC(sh7042_device::pcf_dh_w)); + map(0xffff83ac, 0xffff83ad).rw(FUNC(sh7042_device::pcf_dl_r), FUNC(sh7042_device::pcf_dl_w)); + map(0xffff83b0, 0xffff83b1).rw(m_porte, FUNC(sh_port16_device::dr_r), FUNC(sh_port16_device::dr_w)); + map(0xffff83b2, 0xffff83b3).r (m_portf, FUNC(sh_port16_device::dr_r)); + map(0xffff83b4, 0xffff83b5).rw(m_porte, FUNC(sh_port16_device::io_r), FUNC(sh_port16_device::io_w)); + map(0xffff83b8, 0xffff83bb).rw(FUNC(sh7042_device::pcf_e_r), FUNC(sh7042_device::pcf_e_w)); + map(0xffff83c8, 0xffff83c9).rw(FUNC(sh7042_device::pcf_if_r), FUNC(sh7042_device::pcf_if_w)); + + map(0xffff83d0, 0xffff83d1).rw(m_cmt, FUNC(sh_cmt_device::cmstr_r), FUNC(sh_cmt_device::cmstr_w)); + map(0xffff83d2, 0xffff83d3).rw(m_cmt, FUNC(sh_cmt_device::cmcsr0_r), FUNC(sh_cmt_device::cmcsr0_w)); + map(0xffff83d4, 0xffff83d5).rw(m_cmt, FUNC(sh_cmt_device::cmcnt0_r), FUNC(sh_cmt_device::cmcnt0_w)); + map(0xffff83d6, 0xffff83d7).rw(m_cmt, FUNC(sh_cmt_device::cmcor0_r), FUNC(sh_cmt_device::cmcor0_w)); + map(0xffff83d8, 0xffff83d9).rw(m_cmt, FUNC(sh_cmt_device::cmcsr1_r), FUNC(sh_cmt_device::cmcsr1_w)); + map(0xffff83da, 0xffff83db).rw(m_cmt, FUNC(sh_cmt_device::cmcnt1_r), FUNC(sh_cmt_device::cmcnt1_w)); + map(0xffff83dc, 0xffff83dd).rw(m_cmt, FUNC(sh_cmt_device::cmcor1_r), FUNC(sh_cmt_device::cmcor1_w)); + + map(0xffff83e0, 0xffff83e0).rw(m_adc, FUNC(sh_adc_device::adcsr_r), FUNC(sh_adc_device::adcsr_w)); + map(0xffff83e1, 0xffff83e1).rw(m_adc, FUNC(sh_adc_device::adcr_r), FUNC(sh_adc_device::adcr_w)); + map(0xffff83f0, 0xffff83ff).r(m_adc, FUNC(sh_adc_device::addr_r)); map(0xfffff000, 0xffffffff).ram(); } +void sh7042_device::device_add_mconfig(machine_config &config) +{ + SH_INTC(config, m_intc, *this); + SH_ADC(config, m_adc, *this, m_intc, 136); + SH_CMT(config, m_cmt, *this, m_intc, 144, 148); + SH_PORT32(config, m_porta, *this, 0, 0x00000000, 0xff000000); + SH_PORT16(config, m_portb, *this, 0, 0x0000, 0xfc00); + SH_PORT16(config, m_portc, *this, 1, 0x0000, 0x0000); + SH_PORT32(config, m_portd, *this, 1, 0x0000, 0x0000); + SH_PORT16(config, m_porte, *this, 2, 0x0000, 0x0000); + SH_PORT16(config, m_portf, *this, 3, 0x0000, 0xff00); +} -// ADC section +void sh7042_device::do_sci_w(int sci, int state) +{ + logerror("sci %d %d\n", sci, state); +} -u16 sh7042_device::addr_r(offs_t offset) +void sh7042_device::internal_update() { - logerror("addr16_r %d %03x\n", offset, m_addr[offset]); - return m_addr[offset]; + internal_update(current_cycles()); } -u8 sh7042_device::adcsr_r() +void sh7042_device::add_event(u64 &event_time, u64 new_event) { - logerror("adcsr_r %02x\n", m_adcsr); - return m_adcsr; + if(!new_event) + return; + if(!event_time || event_time > new_event) + event_time = new_event; } -u8 sh7042_device::adcr_r() +void sh7042_device::recompute_timer(u64 event_time) { - logerror("adcr_r %02x\n", m_adcr); - return m_adcr; + if(!event_time) { + m_event_timer->adjust(attotime::never); + return; + } + + m_event_timer->adjust(attotime::from_ticks(2*event_time + 1, 2*clock()) - machine().time()); } -void sh7042_device::adcsr_w(u8 data) +TIMER_CALLBACK_MEMBER(sh7042_device::event_timer_tick) { - logerror("adcsr_w %02x\n", data); - // u8 prev = m_adcsr; - m_adcsr = (data & 0x7f) | (m_adcsr & data & CSR_ADF); + internal_update(); } -void sh7042_device::adcr_w(u8 data) +void sh7042_device::internal_update(u64 current_time) { - static const char *const tg_modes[4] = { "soft", "mtu", "?", "external" }; - static const char *const buf_modes[4] = { "normal", "a->b", "a,b->c,d", "a->b->c->d" }; - logerror("adcr_w speed=%d trigger=%s mode=%s sampling=%s buffering=%s\n", - BIT(data, 6) ? "high" : "low", - tg_modes[(data >> 4) & 3], - BIT(data, 3) ? "scan" : "single", - BIT(data, 2) ? "simultaneous" : "normal", - buf_modes[data & 3]); - m_adcr = data; + u64 event_time = 0; + + add_event(event_time, m_adc->internal_update(current_time)); + add_event(event_time, m_cmt->internal_update(current_time)); + + recompute_timer(event_time); } -void sh7042_device::do_sci_w(int sci, int state) +u16 sh7042_device::pcf_ah_r() { - logerror("sci %d %d\n", sci, state); + return m_pcf_ah; +} + +void sh7042_device::pcf_ah_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_pcf_ah); + logerror("pcf ah = %04x\n", m_pcf_ah); +} + +u32 sh7042_device::pcf_al_r() +{ + return m_pcf_al; +} + +void sh7042_device::pcf_al_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_pcf_al); + logerror("pcf al = %08x\n", m_pcf_al); +} + +u32 sh7042_device::pcf_b_r() +{ + return m_pcf_b; +} + +void sh7042_device::pcf_b_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_pcf_b); + logerror("pcf b = %08x\n", m_pcf_b); +} + +u16 sh7042_device::pcf_c_r() +{ + return m_pcf_c; +} + +void sh7042_device::pcf_c_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_pcf_c); + logerror("pcf c = %04x\n", m_pcf_c); +} + +u32 sh7042_device::pcf_dh_r() +{ + return m_pcf_dh; +} + +void sh7042_device::pcf_dh_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_pcf_dh); + logerror("pcf dh = %08x\n", m_pcf_dh); +} + +u16 sh7042_device::pcf_dl_r() +{ + return m_pcf_dl; +} + +void sh7042_device::pcf_dl_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_pcf_dl); + logerror("pcf dl = %04x\n", m_pcf_dl); +} + +u32 sh7042_device::pcf_e_r() +{ + return m_pcf_e; +} + +void sh7042_device::pcf_e_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_pcf_e); + logerror("pcf e = %08x\n", m_pcf_e); +} + +u16 sh7042_device::pcf_if_r() +{ + return m_pcf_if; +} + +void sh7042_device::pcf_if_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_pcf_if); + logerror("pcf if = %04x\n", m_pcf_if); } diff --git a/src/devices/cpu/sh/sh7042.h b/src/devices/cpu/sh/sh7042.h index dabcb7c272b4b..55795fd8282fb 100644 --- a/src/devices/cpu/sh/sh7042.h +++ b/src/devices/cpu/sh/sh7042.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -// SH7042, sh2 variant +// SH704x, sh2 variant #ifndef MAME_CPU_SH_SH7042_H #define MAME_CPU_SH_SH7042_H @@ -9,6 +9,10 @@ #pragma once #include "sh2.h" +#include "sh_intc.h" +#include "sh_adc.h" +#include "sh_cmt.h" +#include "sh_port.h" class sh7042_device : public sh2_device { @@ -19,8 +23,30 @@ class sh7042_device : public sh2_device template void sci_rx_w(int state) { do_sci_w(Sci, state); } template auto write_sci_tx() { return m_sci_tx[Sci].bind(); } + auto read_porta() { return m_read_port32 [0].bind(); } + auto write_porta() { return m_write_port32[0].bind(); } + auto read_portb() { return m_read_port16 [0].bind(); } + auto write_portb() { return m_write_port16[0].bind(); } + auto read_portc() { return m_read_port16 [1].bind(); } + auto write_portc() { return m_write_port16[1].bind(); } + auto read_portd() { return m_read_port32 [1].bind(); } + auto write_portd() { return m_write_port32[1].bind(); } + auto read_porte() { return m_read_port16 [2].bind(); } + auto write_porte() { return m_write_port16[2].bind(); } + auto read_portf() { return m_read_port16 [3].bind(); } + + void internal_update(); + u16 do_read_adc(int port) { return m_read_adc[port](); } + u16 do_read_port16(int port) { return m_read_port16[port](); } + void do_write_port16(int port, u16 data, u16 ddr) { m_write_port16[port](0, data, ddr); } + u32 do_read_port32(int port) { return m_read_port32[port](); } + void do_write_port32(int port, u32 data, u32 ddr) { m_write_port32[port](0, data, ddr); } + + u64 current_cycles() { return machine().time().as_ticks(clock()); } protected: + const char *m_port16_names; + const char *m_port32_names; enum { CSR_ADF = 0x80, CSR_ADIE = 0x40, @@ -42,25 +68,68 @@ class sh7042_device : public sh2_device virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; private: + required_device m_intc; + required_device m_adc; + required_device m_cmt; + required_device m_porta; + required_device m_portb; + required_device m_portc; + required_device m_portd; + required_device m_porte; + required_device m_portf; + devcb_read16::array<8> m_read_adc; devcb_write_line::array<2> m_sci_tx; + devcb_read16::array<4> m_read_port16; + devcb_write16::array<4> m_write_port16; + devcb_read32::array<2> m_read_port32; + devcb_write32::array<2> m_write_port32; + + emu_timer *m_event_timer; + + u16 m_pcf_ah; + u32 m_pcf_al; + u32 m_pcf_b; + u16 m_pcf_c; + u32 m_pcf_dh; + u16 m_pcf_dl; + u32 m_pcf_e; + u16 m_pcf_if; void map(address_map &map); - // ADC section - uint16_t m_addr[8]; - uint8_t m_adcsr, m_adcr; - u16 adc_default(int adc); - u16 addr_r(offs_t offset); - u8 adcsr_r(); - u8 adcr_r(); - void adcsr_w(u8 data); - void adcr_w(u8 data); - + u16 port16_default_r(int port); + void port16_default_w(int port, u16 data); + u32 port32_default_r(int port); + void port32_default_w(int port, u32 data); + + void add_event(u64 &event_time, u64 new_event); + void recompute_timer(u64 event_time); + TIMER_CALLBACK_MEMBER(event_timer_tick); + void internal_update(u64 current_time); + void do_sci_w(int sci, int state); + + u16 pcf_ah_r(); + void pcf_ah_w(offs_t, u16 data, u16 mem_mask); + u32 pcf_al_r(); + void pcf_al_w(offs_t, u32 data, u32 mem_mask); + u32 pcf_b_r(); + void pcf_b_w(offs_t, u32 data, u32 mem_mask); + u16 pcf_c_r(); + void pcf_c_w(offs_t, u16 data, u16 mem_mask); + u32 pcf_dh_r(); + void pcf_dh_w(offs_t, u32 data, u32 mem_mask); + u16 pcf_dl_r(); + void pcf_dl_w(offs_t, u16 data, u16 mem_mask); + u32 pcf_e_r(); + void pcf_e_w(offs_t, u32 data, u32 mem_mask); + u16 pcf_if_r(); + void pcf_if_w(offs_t, u16 data, u16 mem_mask); }; class sh7043_device : public sh7042_device diff --git a/src/devices/cpu/sh/sh_adc.cpp b/src/devices/cpu/sh/sh_adc.cpp new file mode 100644 index 0000000000000..d9e1da0192102 --- /dev/null +++ b/src/devices/cpu/sh/sh_adc.cpp @@ -0,0 +1,315 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert + +#include "emu.h" +#include "sh_adc.h" +#include "sh7042.h" +#include "sh_intc.h" + +// Verbosity level +// 0 = no messages +// 1 = everything +static constexpr int V = 0; + +DEFINE_DEVICE_TYPE(SH_ADC, sh_adc_device, "sh_adc", "SH2/704x ADC") + +sh_adc_device::sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SH_ADC, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG), + m_intc(*this, finder_base::DUMMY_TAG), + m_intc_vector(0), m_adcsr(0), m_adcr(0), m_register_mask(0), m_trigger(0), m_start_mode(0), m_start_channel(0), + m_end_channel(0), m_start_count(0), m_mode(0), m_channel(0), m_count(0), m_analog_powered(false), m_adtrg(false), m_next_event(0) +{ + m_suspend_on_interrupt = true; + m_register_mask = 7; + m_analog_power_control = false; +} + +u16 sh_adc_device::addr_r(offs_t offset) +{ + if(V>=1) logerror("addr_r %d %03x\n", offset, m_addr[offset]); + return m_addr[offset]; +} + +u8 sh_adc_device::adcsr_r() +{ + if(V>=1) logerror("adcsr_r %02x\n", m_adcsr); + return m_adcsr; +} + +u8 sh_adc_device::adcr_r() +{ + if(V>=1) logerror("adcr_r %02x\n", m_adcr); + return m_adcr; +} + +void sh_adc_device::adcsr_w(u8 data) +{ + if(V>=1) logerror("adcsr_w %02x\n", data); + u8 prev = m_adcsr; + m_adcsr = (data & 0x7f) | (m_adcsr & data & F_ADF); + mode_update(); + if((prev & F_ADF) && !(m_adcsr & F_ADF)) { + if(m_mode & HALTED) { + m_mode &= ~HALTED; + if(!(m_adcsr & F_ADST)) { + sampling(); + conversion_wait(false, false); + } else + done(); + } + } + + if(!(prev & F_ADST) && (m_adcsr & F_ADST)) + start_conversion(); +} + +void sh_adc_device::adcr_w(u8 data) +{ + if(V>=1) logerror("adcr_w %02x\n", data); + m_adcr = data; + mode_update(); +} + +void sh_adc_device::adtrg_w(int state) +{ + if(state != m_adtrg) { + m_adtrg = state; + if(!m_adtrg && (m_trigger & T_EXT) && !(m_adcsr & F_ADST)) { + m_adcsr |= F_ADST; + start_conversion(); + } + } +} + +void sh_adc_device::set_suspend(bool suspend) +{ +} + +void sh_adc_device::device_start() +{ + save_item(NAME(m_addr)); + save_item(NAME(m_buf)); + save_item(NAME(m_adcsr)); + save_item(NAME(m_adcr)); + save_item(NAME(m_trigger)); + save_item(NAME(m_start_mode)); + save_item(NAME(m_start_channel)); + save_item(NAME(m_end_channel)); + save_item(NAME(m_start_count)); + save_item(NAME(m_suspend_on_interrupt)); + save_item(NAME(m_analog_power_control)); + save_item(NAME(m_mode)); + save_item(NAME(m_channel)); + save_item(NAME(m_count)); + save_item(NAME(m_analog_powered)); + save_item(NAME(m_next_event)); + save_item(NAME(m_adtrg)); +} + +void sh_adc_device::device_reset() +{ + memset(m_addr, 0, sizeof(m_addr)); + memset(m_buf, 0, sizeof(m_buf)); + m_adcsr = m_adcr = 0; + m_trigger = T_SOFT; + m_start_mode = IDLE; + m_start_channel = m_end_channel = 0; + m_start_count = 1; + m_mode = IDLE; + m_channel = 0; + m_count = 0; + m_next_event = 0; + mode_update(); + m_analog_powered = !m_analog_power_control; + m_adtrg = true; +} + +void sh_adc_device::done() +{ + m_mode = IDLE; + m_adcsr &= ~F_ADST; + if(m_analog_power_control) + m_analog_powered = false; +} + +u64 sh_adc_device::internal_update(u64 current_time) +{ + if(m_next_event && m_next_event <= current_time) { + m_next_event = 0; + timeout(current_time); + } + return m_next_event; +} + +void sh_adc_device::conversion_wait(bool first, bool poweron, u64 current_time) +{ + if(current_time) + m_next_event = current_time + conversion_time(first, poweron); + else { + m_next_event = m_cpu->total_cycles() + conversion_time(first, poweron); + m_cpu->internal_update(); + } +} + +void sh_adc_device::buffer_value(int port, int buffer) +{ + m_buf[buffer] = m_cpu->do_read_adc(port); + if(V>=1) logerror("adc buffer %d -> %d:%03x\n", port, buffer, m_buf[buffer]); +} + +void sh_adc_device::commit_value(int reg, int buffer) +{ + reg &= m_register_mask; + if(V>=1) logerror("adc commit %d -> %d:%03x\n", buffer, reg, m_buf[buffer]); + m_addr[reg] = m_buf[buffer]; +} + +void sh_adc_device::sampling() +{ + if(m_mode & COUNTED) + m_channel = get_channel_index(m_start_count - m_count); + if(m_mode & DUAL) { + buffer_value(m_channel, 0); + buffer_value(m_channel+1, 1); + } else + buffer_value(m_channel); +} + +void sh_adc_device::start_conversion() +{ + m_mode = m_start_mode; + m_channel = m_start_channel; + m_count = m_start_count; + sampling(); + conversion_wait(true, !m_analog_powered); + m_analog_powered = true; +} + +void sh_adc_device::timeout(u64 current_time) +{ + if(m_mode & BUFFER) { + do_buffering((m_mode & DUAL) && (m_channel & 1)); + if((m_mode & DUAL) && !(m_channel & 1)) { + m_channel++; + conversion_wait(false, false, current_time); + return; + } + } else { + if(m_mode & DUAL) { + if(m_channel & 1) + commit_value(m_channel, 1); + else { + commit_value(m_channel, 0); + m_channel++; + conversion_wait(false, false, current_time); + return; + } + } else + commit_value(m_channel); + } + + if(m_mode & ROTATE) { + if(m_channel != m_end_channel) { + m_channel++; + sampling(); + conversion_wait(false, false, current_time); + return; + } + m_channel = m_start_channel; + } + + if(m_mode & COUNTED) { + m_count--; + if(m_count) { + sampling(); + conversion_wait(false, false, current_time); + return; + } + } + + m_adcsr |= F_ADF; + if(m_adcsr & F_ADIE) + m_intc->internal_interrupt(m_intc_vector); + + if(m_mode & REPEAT) { + if(m_suspend_on_interrupt && (m_adcsr & F_ADIE)) { + m_mode |= HALTED; + return; + } + m_channel = m_start_channel; + m_count = m_start_count; + sampling(); + conversion_wait(false, false, current_time); + return; + } + + done(); +} + +int sh_adc_device::conversion_time(bool first, bool poweron) +{ + int tm = m_adcsr & 0x10 ? 44 : 24; + if(first) + tm += m_adcsr & 0x10 ? 20 : 10; + if(poweron) + tm += 200; + return tm; +} + +void sh_adc_device::mode_update() +{ + m_trigger = 1 << ((m_adcr >> 4) & 3); + m_analog_power_control = !(m_adcr & 0x40); + + m_mode = ACTIVE | (m_adcr & 0x08 ? REPEAT : 0); + + if(m_adcsr & 0x03) { + m_mode |= BUFFER; + + } + + if(m_adcsr & 0x08) { + m_mode |= ROTATE; + m_start_channel = 0; + if(m_adcr & 0x04) { + m_mode |= DUAL; + m_end_channel = (m_adcsr & 6)+1; + } else + m_end_channel = m_adcsr & 7; + } else + m_start_channel = m_end_channel = m_adcsr & 7; + +} + +void sh_adc_device::do_buffering(int buffer) +{ + if((m_mode & COUNTED) && m_channel >= 2) { + commit_value(m_channel, buffer); + return; + } + switch(m_adcsr & 3) { + case 0: + commit_value(m_channel, buffer); + break; + case 1: + m_addr[1] = m_addr[0]; + commit_value(0, buffer); + break; + case 2: + m_addr[2+buffer] = m_addr[buffer]; + commit_value(buffer, buffer); + break; + case 3: + m_addr[3] = m_addr[2]; + m_addr[2] = m_addr[1]; + m_addr[1] = m_addr[0]; + commit_value(0, buffer); + break; + } +} + +int sh_adc_device::get_channel_index(int count) +{ + abort(); +} diff --git a/src/devices/cpu/sh/sh_adc.h b/src/devices/cpu/sh/sh_adc.h new file mode 100644 index 0000000000000..9a48e3f804b2c --- /dev/null +++ b/src/devices/cpu/sh/sh_adc.h @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_adc.h + + SH Analog to Digital Converter subsystem + + +***************************************************************************/ + +#ifndef MAME_CPU_SH_SH_ADC_H +#define MAME_CPU_SH_SH_ADC_H + +#pragma once + +class sh7042_device; +class sh_intc_device; + +class sh_adc_device : public device_t { +public: + sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + template sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, + T &&cpu, U &&intc, int vect) : + sh_adc_device(mconfig, tag, owner) + { + m_cpu.set_tag(std::forward(cpu)); + m_intc.set_tag(std::forward(intc)); + m_intc_vector = vect; + } + + u16 addr_r(offs_t offset); + u8 adcsr_r(); + u8 adcr_r(); + void adcsr_w(u8 data); + void adcr_w(u8 data); + void adtrg_w(int state); + + void set_suspend(bool suspend); + u64 internal_update(u64 current_time); + +protected: + required_device m_cpu; + required_device m_intc; + int m_intc_vector; + + enum { + T_SOFT = 1<<0, + T_TPU = 1<<1, + T_TIMER = 1<<2, + T_EXT = 1<<3 + }; + + enum { + F_ADF = 0x80, + F_ADIE = 0x40, + F_ADST = 0x20 + }; + + enum { + IDLE = 0, + ACTIVE = 1, + HALTED = 2, + REPEAT = 4, + ROTATE = 8, + DUAL = 16, + BUFFER = 32, + COUNTED = 64 + }; + + u16 m_addr[8], m_buf[2]; + u8 m_adcsr, m_adcr; + int m_register_mask; + int m_trigger, m_start_mode, m_start_channel, m_end_channel, m_start_count; + bool m_suspend_on_interrupt, m_analog_power_control; + int m_mode, m_channel, m_count; + bool m_analog_powered, m_adtrg; + u64 m_next_event; + + virtual void device_start() override; + virtual void device_reset() override; + + void sampling(); + void start_conversion(); + void conversion_wait(bool first, bool poweron, u64 current_time = 0); + void buffer_value(int port, int buffer = 0); + void commit_value(int reg, int buffer = 0); + void timeout(u64 current_time); + void done(); + + int conversion_time(bool first, bool poweron); + void mode_update(); + void do_buffering(int buffer); + int get_channel_index(int count); +}; + +DECLARE_DEVICE_TYPE(SH_ADC, sh_adc_device) + +#endif // MAME_CPU_SH_SH_ADC_H diff --git a/src/devices/cpu/sh/sh_cmt.cpp b/src/devices/cpu/sh/sh_cmt.cpp new file mode 100644 index 0000000000000..1e659080e7533 --- /dev/null +++ b/src/devices/cpu/sh/sh_cmt.cpp @@ -0,0 +1,197 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_cmt.h + + SH Compare/Match timer subsystem + + +***************************************************************************/ + +#include "emu.h" +#include "sh7042.h" +#include "sh_intc.h" + +DEFINE_DEVICE_TYPE(SH_CMT, sh_cmt_device, "sh_cmt", "SH2/704x CMT") + +sh_cmt_device::sh_cmt_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SH_CMT, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG), + m_intc(*this, finder_base::DUMMY_TAG), + m_intc_vector{0, 0}, + m_str(0), + m_csr{ 0, 0 }, + m_cnt{ 0, 0 }, + m_cor{ 0xffff, 0xffff } +{ +} + +void sh_cmt_device::device_start() +{ +} + +void sh_cmt_device::device_reset() +{ +} + +u64 sh_cmt_device::internal_update(u64 current_time) +{ + u64 next = 0; + for(int i = 0; i != 2; i++) { + if(m_next_event[i] && current_time >= m_next_event[i]) { + m_csr[i] |= 0x80; + if(BIT(m_csr[i], 6)) + m_intc->internal_interrupt(m_intc_vector[i]); + cnt_update(i, current_time); + } + if(!next || (m_next_event[i] && m_next_event[i] < next)) + next = m_next_event[i]; + } + return next; +} + + +u16 sh_cmt_device::cmstr_r() +{ + return m_str; +} + +u16 sh_cmt_device::cmcsr0_r() +{ + return m_csr[0]; +} + +u16 sh_cmt_device::cmcnt0_r() +{ + cnt_update(0, m_cpu->current_cycles()); + return m_cnt[0]; +} + +u16 sh_cmt_device::cmcor0_r() +{ + return m_cor[0]; +} + +u16 sh_cmt_device::cmcsr1_r() +{ + return m_csr[1]; +} + +u16 sh_cmt_device::cmcnt1_r() +{ + cnt_update(1, m_cpu->current_cycles()); + return m_cnt[1]; +} + +u16 sh_cmt_device::cmcor1_r() +{ + return m_cor[1]; +} + +void sh_cmt_device::cmcsr0_w(offs_t, u16 data, u16 mem_mask) +{ + csr_w(0, data, mem_mask); +} + +void sh_cmt_device::cmcsr1_w(offs_t, u16 data, u16 mem_mask) +{ + csr_w(1, data, mem_mask); +} + +void sh_cmt_device::cmcnt0_w(offs_t, u16 data, u16 mem_mask) +{ + cnt_w(0, data, mem_mask); +} + +void sh_cmt_device::cmcnt1_w(offs_t, u16 data, u16 mem_mask) +{ + cnt_w(1, data, mem_mask); +} + +void sh_cmt_device::cmcor0_w(offs_t, u16 data, u16 mem_mask) +{ + cor_w(0, data, mem_mask); +} + +void sh_cmt_device::cmcor1_w(offs_t, u16 data, u16 mem_mask) +{ + cor_w(1, data, mem_mask); +} + +void sh_cmt_device::cmstr_w(offs_t, u16 data, u16 mem_mask) +{ + cnt_update(0, m_cpu->current_cycles()); + cnt_update(1, m_cpu->current_cycles()); + u16 old = m_str; + COMBINE_DATA(&m_str); + logerror("active %c %c\n", m_str & 1 ? '0' : '-', m_str & 2 ? '1' : '-'); + for(int i=0; i != 2; i++) + if(!BIT(old, i) && BIT(m_str, i)) + clock_start(i); + else if(!BIT(m_str, i)) + m_next_event[i] = 0; + m_cpu->internal_update(); +} + +void sh_cmt_device::csr_w(int reg, u16 data, u16 mem_mask) +{ + cnt_update(reg, m_cpu->current_cycles()); + u16 old = m_csr[reg]; + COMBINE_DATA(&m_csr[reg]); + if(!(old & 0x80)) + m_csr[reg] &= ~0x80; + if((old ^ m_csr[reg]) & 0x7f) + logerror("csr_w %d f=%d ie=%d div=%d\n", reg, BIT(m_csr[reg], 7), BIT(m_csr[reg], 6), 8 << (2*BIT(m_csr[reg], 0, 2))); +} + +void sh_cmt_device::cnt_w(int reg, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_cnt[reg]); + logerror("cnt_w %d, %04x\n", reg, m_cnt[reg]); + if((m_str >> reg) & 1) { + compute_next_event(reg); + m_cpu->internal_update(); + } +} + +void sh_cmt_device::cor_w(int reg, u16 data, u16 mem_mask) +{ + cnt_update(reg, m_cpu->current_cycles()); + COMBINE_DATA(&m_cor[reg]); + logerror("cor_w %d, %04x\n", reg, m_cor[reg]); + if((m_str >> reg) & 1) { + compute_next_event(reg); + m_cpu->internal_update(); + } +} + +void sh_cmt_device::clock_start(int clk) +{ + logerror("start clock %d %dHz\n", clk, (m_cpu->clock() >> (3 + 2*BIT(m_csr[clk], 0, 2))) / (m_cor[clk] + 1)); + compute_next_event(clk); +} + +void sh_cmt_device::compute_next_event(int clk) +{ + u64 step1 = 1 << (3 + 2*BIT(m_csr[clk], 0, 2)); + u64 time = m_cpu->current_cycles(); + if(time & (step1 - 1)) + time = (time | (step1 - 1)) + 1; + s32 counts = m_cor[clk] + 1 - m_cnt[clk]; + if(counts < 0) + counts += 0x10000; + time += step1 * counts; + m_next_event[clk] = time; +} + +void sh_cmt_device::cnt_update(int clk, u64 current_time) +{ + if(!((m_str >> clk) & 1)) + return; + u64 step = (m_cor[clk] + 1) << (3 + 2*BIT(m_csr[clk], 0, 2)); + while(current_time >= m_next_event[clk]) + m_next_event[clk] += step; + u64 delta = m_next_event[clk] - current_time; + m_cnt[clk] = m_cor[clk] - ((delta - 1) >> (3 + 2*BIT(m_csr[clk], 0, 2))); +} diff --git a/src/devices/cpu/sh/sh_cmt.h b/src/devices/cpu/sh/sh_cmt.h new file mode 100644 index 0000000000000..e365be37fb1ed --- /dev/null +++ b/src/devices/cpu/sh/sh_cmt.h @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_cmt.h + + SH Compare/Match timer subsystem + + +***************************************************************************/ + +#ifndef MAME_CPU_SH_SH_CMT_H +#define MAME_CPU_SH_SH_CMT_H + +#pragma once + +class sh7042_device; +class sh_intc_device; + +class sh_cmt_device : public device_t { +public: + sh_cmt_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + template sh_cmt_device(const machine_config &mconfig, const char *tag, device_t *owner, + T &&cpu, U &&intc, int vect0, int vect1) : + sh_cmt_device(mconfig, tag, owner) + { + m_cpu.set_tag(std::forward(cpu)); + m_intc.set_tag(std::forward(intc)); + m_intc_vector[0] = vect0; + m_intc_vector[1] = vect1; + } + + u64 internal_update(u64 current_time); + + u16 cmstr_r(); + void cmstr_w(offs_t, u16 data, u16 mem_mask); + u16 cmcsr0_r(); + void cmcsr0_w(offs_t, u16 data, u16 mem_mask); + u16 cmcnt0_r(); + void cmcnt0_w(offs_t, u16 data, u16 mem_mask); + u16 cmcor0_r(); + void cmcor0_w(offs_t, u16 data, u16 mem_mask); + u16 cmcsr1_r(); + void cmcsr1_w(offs_t, u16 data, u16 mem_mask); + u16 cmcnt1_r(); + void cmcnt1_w(offs_t, u16 data, u16 mem_mask); + u16 cmcor1_r(); + void cmcor1_w(offs_t, u16 data, u16 mem_mask); + +protected: + required_device m_cpu; + required_device m_intc; + std::array m_next_event; + std::array m_intc_vector; + u16 m_str; + std::array m_csr; + std::array m_cnt; + std::array m_cor; + + virtual void device_start() override; + virtual void device_reset() override; + + void csr_w(int reg, u16 data, u16 mem_mask); + void cnt_w(int reg, u16 data, u16 mem_mask); + void cor_w(int reg, u16 data, u16 mem_mask); + + void clock_start(int clk); + void compute_next_event(int clk); + void cnt_update(int clk, u64 current_time); +}; + +DECLARE_DEVICE_TYPE(SH_CMT, sh_cmt_device) + +#endif // MAME_CPU_SH_SH_CMT_H diff --git a/src/devices/cpu/sh/sh_intc.cpp b/src/devices/cpu/sh/sh_intc.cpp new file mode 100644 index 0000000000000..d13f8f55853fe --- /dev/null +++ b/src/devices/cpu/sh/sh_intc.cpp @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_intc.cpp + + SH interrupt controllers family + +***************************************************************************/ + +#include "emu.h" +#include "sh_intc.h" + +#include "sh7042.h" + +DEFINE_DEVICE_TYPE(SH_INTC, sh_intc_device, "sh_intc", "SH interrupt controller") + +sh_intc_device::sh_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SH_INTC, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG) +{ +} + +void sh_intc_device::device_start() +{ +} + +void sh_intc_device::device_reset() +{ +} + +int sh_intc_device::interrupt_taken(int vector) +{ + return 0; +} + +void sh_intc_device::internal_interrupt(int vector) +{ + logerror("Internal interrupt %d\n", vector); +} + +void sh_intc_device::set_input(int inputnum, int state) +{ +} + +u16 sh_intc_device::icr_r() +{ + return 0; +} + +void sh_intc_device::icr_w(offs_t, u16 data, u16 mem_mask) +{ + logerror("icr_w %04x @ %04x\n", data, mem_mask); +} + +u16 sh_intc_device::isr_r() +{ + return 0; +} + +void sh_intc_device::isr_w(offs_t, u16 data, u16 mem_mask) +{ + logerror("isr_w %04x @ %04x\n", data, mem_mask); +} + +u16 sh_intc_device::ipr_r(offs_t offset) +{ + return 0; +} + +void sh_intc_device::ipr_w(offs_t offset, u16 data, u16 mem_mask) +{ + logerror("ipr_w %x, %04x @ %04x\n", offset, data, mem_mask); +} + diff --git a/src/devices/cpu/sh/sh_intc.h b/src/devices/cpu/sh/sh_intc.h new file mode 100644 index 0000000000000..b93444d8e3254 --- /dev/null +++ b/src/devices/cpu/sh/sh_intc.h @@ -0,0 +1,47 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_intc.h + + SH interrupt controllers family + +***************************************************************************/ + +#ifndef MAME_CPU_SH_SH_INTC_H +#define MAME_CPU_SH_SH_INTC_H + +#pragma once + +class sh7042_device; + +class sh_intc_device : public device_t { +public: + sh_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + template sh_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu) : + sh_intc_device(mconfig, tag, owner) + { + m_cpu.set_tag(std::forward(cpu)); + } + + int interrupt_taken(int vector); + void internal_interrupt(int vector); + void set_input(int inputnum, int state); + + u16 icr_r(); + void icr_w(offs_t, u16 data, u16 mem_mask); + u16 isr_r(); + void isr_w(offs_t, u16 data, u16 mem_mask); + u16 ipr_r(offs_t offset); + void ipr_w(offs_t offset, u16 data, u16 mem_mask); + +protected: + required_device m_cpu; + + virtual void device_start() override; + virtual void device_reset() override; +}; + +DECLARE_DEVICE_TYPE(SH_INTC, sh_intc_device) + +#endif // MAME_CPU_SH_SH_INTC_H diff --git a/src/devices/cpu/sh/sh_port.cpp b/src/devices/cpu/sh/sh_port.cpp new file mode 100644 index 0000000000000..ddd93a1a4e23e --- /dev/null +++ b/src/devices/cpu/sh/sh_port.cpp @@ -0,0 +1,109 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_port.h + + SH i/o ports + +***************************************************************************/ + +#include "emu.h" +#include "sh_intc.h" + +#include "sh7042.h" + +DEFINE_DEVICE_TYPE(SH_PORT16, sh_port16_device, "sh_port16", "SH 16-bits port") +DEFINE_DEVICE_TYPE(SH_PORT32, sh_port32_device, "sh_port32", "SH 32-bits port") + +sh_port16_device::sh_port16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SH_PORT16, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG) +{ +} + +void sh_port16_device::device_start() +{ + m_io = m_default_io; + save_item(NAME(m_dr)); + save_item(NAME(m_io)); +} + +void sh_port16_device::device_reset() +{ +} + +u16 sh_port16_device::dr_r() +{ + if(~m_io & ~m_mask) + return (m_dr & m_io) | (m_cpu->do_read_port16(m_index) & ~m_io); + return m_dr; +} + +void sh_port16_device::dr_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_dr); + m_dr &= ~m_mask; + if(m_io) + m_cpu->do_write_port16(m_index, m_dr & m_io, m_io); +} + +u16 sh_port16_device::io_r() +{ + return m_io; +} + +void sh_port16_device::io_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_io); + m_io &= ~m_mask; + if(m_io) + m_cpu->do_write_port16(m_index, m_dr & m_io, m_io); +} + + +sh_port32_device::sh_port32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SH_PORT32, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG) +{ +} + +void sh_port32_device::device_start() +{ + m_io = m_default_io; + save_item(NAME(m_dr)); + save_item(NAME(m_io)); +} + +void sh_port32_device::device_reset() +{ +} + +u32 sh_port32_device::dr_r() +{ + if((~m_io) & (~m_mask)) + return (m_dr & m_io) | (m_cpu->do_read_port32(m_index) & ~m_io); + return m_dr; +} + +void sh_port32_device::dr_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_dr); + m_dr &= ~m_mask; + if(m_io) + m_cpu->do_write_port32(m_index, m_dr & m_io, m_io); +} + +u32 sh_port32_device::io_r() +{ + return m_io; +} + +void sh_port32_device::io_w(offs_t, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_io); + m_io &= ~m_mask; + if(m_io) + m_cpu->do_write_port32(m_index, m_dr & m_io, m_io); +} + diff --git a/src/devices/cpu/sh/sh_port.h b/src/devices/cpu/sh/sh_port.h new file mode 100644 index 0000000000000..ec2a19228ee59 --- /dev/null +++ b/src/devices/cpu/sh/sh_port.h @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + sh_port.h + + SH i/o ports + +***************************************************************************/ + +#ifndef MAME_CPU_SH_SH_PORT_H +#define MAME_CPU_SH_SH_PORT_H + +#pragma once + +class sh7042_device; + +class sh_port16_device : public device_t { +public: + sh_port16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + template sh_port16_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu, int index, u16 default_io, u16 mask) : + sh_port16_device(mconfig, tag, owner) + { + m_index = index; + m_default_io = default_io; + m_mask = mask; + m_cpu.set_tag(std::forward(cpu)); + } + + u16 dr_r(); + void dr_w(offs_t, u16 data, u16 mem_mask); + u16 io_r(); + void io_w(offs_t, u16 data, u16 mem_mask); + +protected: + required_device m_cpu; + int m_index; + u16 m_default_io, m_mask; + u16 m_dr, m_io; + + virtual void device_start() override; + virtual void device_reset() override; +}; + +class sh_port32_device : public device_t { +public: + sh_port32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + template sh_port32_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu, int index, u32 default_io, u32 mask) : + sh_port32_device(mconfig, tag, owner) + { + m_index = index; + m_default_io = default_io; + m_mask = mask; + m_cpu.set_tag(std::forward(cpu)); + } + + u32 dr_r(); + void dr_w(offs_t, u32 data, u32 mem_mask); + u32 io_r(); + void io_w(offs_t, u32 data, u32 mem_mask); + +protected: + required_device m_cpu; + int m_index; + u32 m_default_io, m_mask; + u32 m_dr, m_io; + + virtual void device_start() override; + virtual void device_reset() override; +}; + +DECLARE_DEVICE_TYPE(SH_PORT16, sh_port16_device) +DECLARE_DEVICE_TYPE(SH_PORT32, sh_port32_device) + +#endif // MAME_CPU_SH_SH_PORT_H diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp index 3f822838894fb..62c8954e93e10 100644 --- a/src/devices/imagedev/midiin.cpp +++ b/src/devices/imagedev/midiin.cpp @@ -10,8 +10,10 @@ #include "emu.h" #include "midiin.h" + #include "osdepend.h" + /*************************************************************************** IMPLEMENTATION ***************************************************************************/ @@ -183,11 +185,9 @@ std::pair midiin_device::call_load() } else { - m_midi = machine().osd().create_midi_device(); - - if (!m_midi->open_input(filename())) + m_midi = machine().osd().create_midi_input(filename()); + if (!m_midi) { - m_midi.reset(); return std::make_pair(image_error::UNSPECIFIED, std::string()); } @@ -202,11 +202,7 @@ std::pair midiin_device::call_load() void midiin_device::call_unload() { - if (m_midi) - { - m_midi->close(); - } - else + if (!m_midi) { // send "all notes off" CC if unloading a MIDI file for (u8 channel = 0; channel < 0x10; channel++) diff --git a/src/devices/imagedev/midiin.h b/src/devices/imagedev/midiin.h index 2bcba3720cccb..d557a47b7c412 100644 --- a/src/devices/imagedev/midiin.h +++ b/src/devices/imagedev/midiin.h @@ -15,6 +15,8 @@ #include "diserial.h" +#include "interface/midiport.h" + #include #include #include @@ -67,7 +69,7 @@ class midiin_device : public device_t, void xmit_char(uint8_t data); - std::unique_ptr m_midi; + std::unique_ptr m_midi; required_ioport m_config; emu_timer *m_timer; devcb_write_line m_input_cb; diff --git a/src/devices/imagedev/midiout.cpp b/src/devices/imagedev/midiout.cpp index 89ac487233266..67efce46f93e1 100644 --- a/src/devices/imagedev/midiout.cpp +++ b/src/devices/imagedev/midiout.cpp @@ -10,8 +10,10 @@ #include "emu.h" #include "midiout.h" + #include "osdepend.h" + /*************************************************************************** IMPLEMENTATION ***************************************************************************/ @@ -57,11 +59,9 @@ void midiout_device::device_reset() std::pair midiout_device::call_load() { - m_midi = machine().osd().create_midi_device(); - - if (!m_midi->open_output(filename())) + m_midi = machine().osd().create_midi_output(filename()); + if (!m_midi) { - m_midi.reset(); return std::make_pair(image_error::UNSPECIFIED, std::string()); } @@ -74,11 +74,7 @@ std::pair midiout_device::call_load() void midiout_device::call_unload() { - if (m_midi) - { - m_midi->close(); - m_midi.reset(); - } + m_midi.reset(); } void midiout_device::rcv_complete() // Rx completed receiving byte diff --git a/src/devices/imagedev/midiout.h b/src/devices/imagedev/midiout.h index 67a572fd5e241..e22c92e87a49e 100644 --- a/src/devices/imagedev/midiout.h +++ b/src/devices/imagedev/midiout.h @@ -15,6 +15,8 @@ #include "diserial.h" +#include "interface/midiport.h" + #include #include #include @@ -59,7 +61,7 @@ class midiout_device : public device_t, virtual void rcv_complete() override; // Rx completed receiving byte private: - std::unique_ptr m_midi; + std::unique_ptr m_midi; }; // device type definition diff --git a/src/devices/machine/1801vp128.cpp b/src/devices/machine/1801vp128.cpp new file mode 100644 index 0000000000000..58d399dbd2df9 --- /dev/null +++ b/src/devices/machine/1801vp128.cpp @@ -0,0 +1,785 @@ +// license:BSD-3-Clause +// copyright-holders:Sergey Svishchev +/********************************************************************** + + 1801VP1-128 gate array (MFM codec for floppy controllers) + + https://github.com/1801BM1/k1801/tree/master/128 + https://felixl.com/UKNC_FDD_1801vp1-128 + https://zx-pk.ru/threads/20406-emulyatsiya-1801vp1-128-v-plis.html + + To do: + - DRQ status in read and write modes is tracked separately (TR bit) + - missing MFM clock is added by MFM encoder for every 00 sequence + - deep internals of CRC, GDR bits; read/write mode switching + - optional external timer for PY device + +**********************************************************************/ + +#include "emu.h" +#include "1801vp128.h" + +#define LOG_WARN (1U << 1) // Show warnings +#define LOG_SHIFT (1U << 2) // Shows shift register contents +#define LOG_REGS (1U << 6) // Register I/O +#define LOG_STATE (1U << 11) // State machine +#define LOG_LIVE (1U << 12) // Live states + +//#define VERBOSE (LOG_GENERAL | LOG_REGS | LOG_STATE) +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) +#define LOGSHIFT(...) LOGMASKED(LOG_SHIFT, __VA_ARGS__) +#define LOGREGS(...) LOGMASKED(LOG_REGS, __VA_ARGS__) +#define LOGLIVE(...) LOGMASKED(LOG_LIVE, __VA_ARGS__) +#define LOGSTATE(...) LOGMASKED(LOG_STATE, __VA_ARGS__) + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(K1801VP128, k1801vp128_device, "1801vp1-128", "1801VP1-128") + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// k1801vp128_device - constructor +//------------------------------------------------- + +k1801vp128_device::k1801vp128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, K1801VP128, tag, owner, clock) + , m_connectors(*this, "%u", 0U) + , m_read_ds(*this, -1) +{ + memset(&cur_live, 0x00, sizeof(cur_live)); + cur_live.tm = attotime::never; + cur_live.state = IDLE; + cur_live.next_state = -1; +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void k1801vp128_device::device_start() +{ + for (int i = 0; i != 4; i++) + { + flopi[i].tm = timer_alloc(FUNC(k1801vp128_device::update_floppy), this); + flopi[i].id = i; + if (m_connectors[i]) + { + flopi[i].dev = m_connectors[i]->get_device(); + if (flopi[i].dev != nullptr) + flopi[i].dev->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(&k1801vp128_device::index_callback, this)); + } + else + flopi[i].dev = nullptr; + + flopi[i].main_state = IDLE; + flopi[i].sub_state = IDLE; + flopi[i].live = false; + } + + m_wbuf = m_rbuf = 0; + + // register for state saving + save_item(NAME(selected_drive)); + save_item(NAME(m_cr)); + save_item(NAME(m_sr)); + save_item(NAME(m_rbuf)); + save_item(NAME(m_wbuf)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void k1801vp128_device::device_reset() +{ + for (int i = 0; i < 4; i++) + { + flopi[i].main_state = IDLE; + flopi[i].sub_state = IDLE; + flopi[i].live = false; + } + live_abort(); + m_cr = m_sr = 0; + set_ds(-1); +} + +//------------------------------------------------- +// read - register read +//------------------------------------------------- + +uint16_t k1801vp128_device::read(offs_t offset) +{ + uint16_t data = 0; + + switch (offset & 1) + { + case 0: + data = m_sr; + if (selected_drive != -1) + { + floppy_info &fi = flopi[selected_drive]; + data = (fi.dev->trk00_r() ^ 1) | (fi.dev->ready_r() << 1) | (fi.dev->wpt_r() << 2) | (fi.dev->idx_r() << 15) | m_sr; + } + break; + + case 1: + data = m_rbuf; + if (!machine().side_effects_disabled()) + { + m_sr &= ~CSR_R_TR; + if (selected_drive != -1) + { + floppy_info &fi = flopi[selected_drive]; + if (fi.main_state == WRITE_DATA) + { + // semi-read mode + live_abort(); + fi.main_state = READ_DATA; + fi.sub_state = SCAN_ID; + read_data_continue(fi); + } + } + } + break; + } + + return data; +} + + +//------------------------------------------------- +// write - register write +//------------------------------------------------- + +void k1801vp128_device::write(offs_t offset, uint16_t data) +{ + LOGREGS("%s W %06o <- %06o\n", machine().describe_context(), 0177130 + (offset << 1), data); + + switch (offset & 1) + { + case 0: + set_ds((int16_t)m_read_ds(data & (CSR_W_DS | CSR_W_REZ))); + if (selected_drive != -1) + { + floppy_info &fi = flopi[selected_drive]; + fi.dev->mon_w(!BIT(data, 4)); + fi.dev->ss_w(BIT(data, 5)); + if (BIT(data, 7)) + { + LOG("COMMAND STEP %d %s\n", fi.id, BIT(data, 6) ? "+1" : "-1"); + execute_command(CMD_SEEK); + } + if (BIT(m_cr ^ data, 8) && !BIT(data, 8)) + { + LOG("COMMAND READ drive %d c:h %d:%d\n", selected_drive, fi.dev->get_cyl(), BIT(data, 5)); + m_sr &= ~CSR_R_TR; + execute_command(CMD_READ); + } + } + m_cr = data; + break; + + case 1: + m_wbuf = data; + m_sr &= ~CSR_R_TR; + if (selected_drive != -1) + { + floppy_info &fi = flopi[selected_drive]; + if (fi.main_state != WRITE_DATA) + { + LOG("COMMAND WRITE drive %d c:h %d:%d\n", selected_drive, fi.dev->get_cyl(), BIT(m_cr, 5)); + execute_command(CMD_WRITE); + } + } + break; + } +} + +void k1801vp128_device::execute_command(int command) +{ + live_abort(); + + switch (command) + { + case CMD_READ: + read_data_start(flopi[selected_drive]); + break; + + case CMD_WRITE: + write_data_start(flopi[selected_drive]); + break; + + case CMD_SEEK: + seek_start(flopi[selected_drive]); + break; + } +} + + +//------------------------------------------------- +// update_tick - pump the device life cycle +//------------------------------------------------- + +TIMER_CALLBACK_MEMBER(k1801vp128_device::update_floppy) +{ + live_sync(); + + floppy_info &fi = flopi[param]; + switch (fi.sub_state) + { + case SEEK_WAIT_STEP_SIGNAL_TIME: + fi.sub_state = SEEK_WAIT_STEP_SIGNAL_TIME_DONE; + break; + case SEEK_WAIT_STEP_TIME: + fi.sub_state = SEEK_WAIT_STEP_TIME_DONE; + break; + } + + general_continue(fi); +} + +void k1801vp128_device::live_start(floppy_info &fi, int state) +{ + cur_live.tm = machine().time(); + cur_live.state = state; + cur_live.next_state = -1; + cur_live.fi = &fi; + cur_live.shift_reg = 0; + cur_live.crc = 0xffff; + cur_live.crc_init = false; + cur_live.bit_counter = 0; + cur_live.data_separator_phase = false; + cur_live.data_reg = 0; + cur_live.data_bit_context = false; + cur_live.pll.reset(cur_live.tm); + cur_live.pll.set_clock(attotime::from_hz(500000)); + checkpoint_live = cur_live; + fi.live = true; + + live_run(); +} + +void k1801vp128_device::checkpoint() +{ + if (cur_live.fi) + cur_live.pll.commit(cur_live.fi->dev, cur_live.tm); + checkpoint_live = cur_live; +} + +void k1801vp128_device::rollback() +{ + cur_live = checkpoint_live; +} + +void k1801vp128_device::live_delay(int state) +{ + cur_live.next_state = state; + if (cur_live.tm != machine().time()) + cur_live.fi->tm->adjust(cur_live.tm - machine().time(), cur_live.fi->id); + else + live_sync(); +} + +void k1801vp128_device::live_sync() +{ + if (!cur_live.tm.is_never()) + { + if (cur_live.tm > machine().time()) + { + rollback(); + live_run(machine().time()); + cur_live.pll.commit(cur_live.fi->dev, cur_live.tm); + } + else + { + cur_live.pll.commit(cur_live.fi->dev, cur_live.tm); + if (cur_live.next_state != -1) + { + cur_live.state = cur_live.next_state; + cur_live.next_state = -1; + } + if (cur_live.state == IDLE) + { + cur_live.pll.stop_writing(cur_live.fi->dev, cur_live.tm); + cur_live.tm = attotime::never; + cur_live.fi->live = false; + cur_live.fi = nullptr; + } + } + cur_live.next_state = -1; + checkpoint(); + } +} + +void k1801vp128_device::live_abort() +{ + if (!cur_live.tm.is_never() && cur_live.tm > machine().time()) + { + rollback(); + live_run(machine().time()); + } + + if (cur_live.fi) + { + cur_live.pll.stop_writing(cur_live.fi->dev, cur_live.tm); + cur_live.fi->live = false; + cur_live.fi = nullptr; + } + + cur_live.tm = attotime::never; + cur_live.state = IDLE; + cur_live.next_state = -1; +} + +void k1801vp128_device::live_run(attotime limit) +{ + if (cur_live.state == IDLE || cur_live.next_state != -1) + return; + + if (limit == attotime::never) + { + if (cur_live.fi->dev) + limit = cur_live.fi->dev->time_next_index(); + if (limit == attotime::never) + { + // Happens when there's no disk or if the fdc is not + // connected to a drive, hence no index pulse. Force a + // sync from time to time in that case, so that the main + // cpu timeout isn't too painful. Avoids looping into + // infinity looking for data too. + + limit = machine().time() + attotime::from_msec(1); + cur_live.fi->tm->adjust(attotime::from_msec(1), cur_live.fi->id); + } + } + + for (;;) + { + switch (cur_live.state) + { + case SEARCH_ADDRESS_MARK_HEADER: + if (read_one_bit(limit)) + return; + + if (!(cur_live.bit_counter & 255)) + { + LOGSHIFT("%s (%s): shift = %04x data=%02x c=%d\n", cur_live.tm.to_string(), limit.to_string(), cur_live.shift_reg, + bitswap<8>(cur_live.shift_reg, 14, 12, 10, 8, 6, 4, 2, 0), cur_live.bit_counter); + } + + if (cur_live.shift_reg == 0x4489) + { + LOGLIVE("%s: Found A1\n", cur_live.tm.to_string()); + cur_live.crc = 0x443b; + cur_live.data_separator_phase = false; + cur_live.bit_counter = 0; + cur_live.state = READ_DATA_LOW; + cur_live.data_reg = 0xa1; + m_sr &= ~CSR_R_CRC; + checkpoint(); + } + break; + + case READ_DATA_HIGH: + if (read_one_bit(limit)) + return; + if (cur_live.bit_counter & 15) + break; + live_delay(READ_DATA_HIGH_BYTE); + return; + + case READ_DATA_HIGH_BYTE: + cur_live.state = READ_DATA_LOW; + checkpoint(); + break; + + case READ_DATA_LOW: + if (read_one_bit(limit)) + return; + if (cur_live.bit_counter & 15) + break; + live_delay(READ_DATA_LOW_BYTE); + return; + + case READ_DATA_LOW_BYTE: + m_rbuf = cur_live.data_reg; + if (cur_live.crc == 0) + { + m_sr |= CSR_R_CRC; + } + m_sr |= CSR_R_TR; + LOGLIVE("%s: Read %04x (CRC %04x)\n", cur_live.tm.to_string(), cur_live.data_reg, cur_live.crc); + cur_live.state = READ_DATA_HIGH; + checkpoint(); + break; + + case WRITE_MFM_DATA_LOW: + if ((m_wbuf & 255) == 0xa1 && cur_live.crc_init == false && !(m_sr & CSR_R_CRC)) + { + cur_live.crc_init = true; + cur_live.crc = 0xffff; + } + // if DRQ has not been serviced, write CRC + // if DRQ has not been serviced AND CRC has been written, write zeros + if (m_sr & CSR_R_TR) + { + if (cur_live.crc_init) + { + LOGLIVE("%s: Write CRC %04x\n", cur_live.tm.to_string(), cur_live.crc); + m_sr |= CSR_R_CRC; + m_sr &= ~CSR_R_TR; + cur_live.crc_init = false; + } + else + { + LOGLIVE("%s: Write after CRC\n", cur_live.tm.to_string()); + m_wbuf = 0; + } + } + live_write_mfm((m_sr & CSR_R_CRC) ? (cur_live.crc >> 8) : m_wbuf, BIT(m_cr, 9)); + cur_live.state++; + cur_live.bit_counter = 16; + checkpoint(); + break; + + case WRITE_MFM_DATA_HIGH: + live_write_mfm((m_sr & CSR_R_CRC) ? cur_live.crc : (m_wbuf >> 8), BIT(m_cr, 9)); + LOGLIVE("%s: Write next %s\n", cur_live.tm.to_string(), (m_sr & CSR_R_TR)?"TR":""); + if (!(m_sr & CSR_R_CRC)) + m_sr |= CSR_R_TR; + cur_live.state++; + cur_live.bit_counter = 16; + checkpoint(); + break; + + case WRITE_MFM_DATA_LOW_BYTE: + if (write_one_bit(limit)) + return; + if (cur_live.bit_counter == 0) + { + live_delay(WRITE_MFM_DATA_HIGH); + return; + } + break; + + case WRITE_MFM_DATA_HIGH_BYTE: + if (write_one_bit(limit)) + return; + if (cur_live.bit_counter == 0) + { + live_delay(WRITE_MFM_DATA_LOW); + m_sr &= ~CSR_R_CRC; + return; + } + break; + + default: + LOGWARN("%s: Unknown live state %d\n", cur_live.tm.to_string(), cur_live.state); + return; + } + } +} + + +void k1801vp128_device::seek_start(floppy_info &fi) +{ + fi.sub_state = SEEK_MOVE; + fi.dir = !BIT(m_cr, 6); + general_continue(fi); +} + + +void k1801vp128_device::read_data_start(floppy_info &fi) +{ + fi.main_state = READ_DATA; + fi.sub_state = WAIT_INDEX_DONE; + m_sr &= ~CSR_R_CRC; + read_data_continue(fi); +} + +void k1801vp128_device::read_data_continue(floppy_info &fi) +{ + for (;;) + { + switch (fi.sub_state) + { + case SEEK_MOVE: + LOGSTATE("sub %d SEEK_MOVE\n", fi.id); + fi.sub_state = SEEK_WAIT_STEP_SIGNAL_TIME; + fi.tm->adjust(attotime::from_msec(2), fi.id); + return; + + case SEEK_WAIT_STEP_SIGNAL_TIME: + LOGSTATE("sub %d SEEK_WAIT_STEP_SIGNAL_TIME\n", fi.id); + return; + + case SEEK_WAIT_STEP_SIGNAL_TIME_DONE: + LOGSTATE("sub %d SEEK_WAIT_STEP_SIGNAL_TIME_DONE\n", fi.id); + if (fi.dev) + { + fi.dev->dir_w(fi.dir); + fi.dev->stp_w(0); + fi.dev->stp_w(1); + fi.sub_state = WAIT_INDEX_DONE; + } + else + fi.main_state = fi.sub_state = IDLE; + break; + + case WAIT_INDEX: + LOGSTATE("sub %d WAIT_INDEX\n", fi.id); + return; + + case WAIT_INDEX_DONE: + LOGSTATE("sub %d WAIT_INDEX_DONE\n", fi.id); + fi.counter = 0; + fi.sub_state = SCAN_ID; + LOGSTATE("live %d SEARCH_ADDRESS_MARK_HEADER\n", fi.id); + live_start(fi, SEARCH_ADDRESS_MARK_HEADER); + return; + + case SCAN_ID: + LOGSTATE("sub %d SCAN_ID\n", fi.id); + fi.sub_state = TRACK_READ; + LOGSTATE("live %d READ_DATA_HIGH\n", fi.id); + live_start(fi, READ_DATA_HIGH); + return; + + case SCAN_ID_FAILED: + LOGSTATE("sub %d SCAN_ID_FAILED\n", fi.id); + fi.sub_state = COMMAND_DONE; + break; + + case TRACK_READ: + LOGSTATE("sub %d TRACK_READ\n", fi.id); + fi.sub_state = COMMAND_DONE; + break; + + case COMMAND_DONE: + LOGSTATE("sub %d COMMAND_DONE\n", fi.id); + fi.main_state = fi.sub_state = IDLE; + return; + + default: + LOGWARN("%s: read sector unknown sub-state %d\n", ttsn(), fi.sub_state); + return; + } + } +} + +void k1801vp128_device::write_data_start(floppy_info &fi) +{ + fi.main_state = WRITE_DATA; + fi.sub_state = WAIT_INDEX_DONE; + m_sr &= ~CSR_R_CRC; + write_data_continue(fi); +} + +void k1801vp128_device::write_data_continue(floppy_info &fi) +{ + for (;;) + { + switch (fi.sub_state) + { + case WAIT_INDEX: + LOGSTATE("sub %d WAIT_INDEX\n", fi.id); + return; + + case WAIT_INDEX_DONE: + LOGSTATE("sub %d WAIT_INDEX_DONE\n", fi.id); + fi.sub_state = TRACK_WRITTEN; + LOGSTATE("live %d WRITE_MFM_DATA_LOW\n", fi.id); + live_start(fi, WRITE_MFM_DATA_LOW); + return; + + case TRACK_WRITTEN: + LOGSTATE("sub %d TRACK_WRITTEN\n", fi.id); + fi.sub_state = COMMAND_DONE; + break; + + case COMMAND_DONE: + LOGSTATE("sub %d COMMAND_DONE\n", fi.id); + fi.main_state = fi.sub_state = IDLE; + return; + + default: + LOGWARN("%s: write sector unknown sub-state %d\n", ttsn(), fi.sub_state); + return; + } + } +} + + +void k1801vp128_device::index_callback(floppy_image_device *floppy, int state) +{ + LOGLIVE("%s: Pulse %d\n", machine().time().to_string(), state); + for (floppy_info &fi : flopi) + { + if (fi.dev != floppy) + continue; + + if (!state) + { + general_continue(fi); + continue; + } + + switch (fi.sub_state) + { + case IDLE: + case SEEK_MOVE: + case SEEK_WAIT_STEP_SIGNAL_TIME: + case SEEK_WAIT_STEP_SIGNAL_TIME_DONE: + case SEEK_WAIT_STEP_TIME: + case SEEK_WAIT_STEP_TIME_DONE: + case HEAD_LOAD: + case HEAD_LOAD_DONE: + case SCAN_ID: + case SCAN_ID_FAILED: + break; + + case TRACK_READ: + fi.sub_state = IDLE; + break; + + case WAIT_INDEX: + fi.sub_state = WAIT_INDEX_DONE; + live_abort(); + break; + + default: + LOGWARN("%s: Index pulse on unknown sub-state %d\n", ttsn(), fi.sub_state); + break; + } + + general_continue(fi); + } +} + + +void k1801vp128_device::general_continue(floppy_info &fi) +{ + if (fi.live && cur_live.state != IDLE) + { + live_run(); + if (cur_live.state != IDLE) + return; + } + + switch (fi.main_state) + { + case IDLE: + break; + + case READ_DATA: + read_data_continue(fi); + break; + + case WRITE_DATA: + write_data_continue(fi); + break; + + default: + LOGWARN("%s: general_continue on unknown main-state %d\n", ttsn(), fi.main_state); + break; + } +} + + +bool k1801vp128_device::read_one_bit(const attotime &limit) +{ + int bit = cur_live.pll.get_next_bit(cur_live.tm, cur_live.fi->dev, limit); + if (bit < 0) + return true; + cur_live.shift_reg = (cur_live.shift_reg << 1) | bit; + cur_live.bit_counter++; + if (cur_live.data_separator_phase) + { + cur_live.data_reg = (cur_live.data_reg << 1) | bit; + if ((cur_live.crc ^ (bit ? 0x8000 : 0x0000)) & 0x8000) + cur_live.crc = (cur_live.crc << 1) ^ 0x1021; + else + cur_live.crc = cur_live.crc << 1; + } + cur_live.data_separator_phase = !cur_live.data_separator_phase; + return false; +} + +bool k1801vp128_device::write_one_bit(const attotime &limit) +{ + bool bit = cur_live.shift_reg & 0x8000; + if (cur_live.pll.write_next_bit(bit, cur_live.tm, cur_live.fi->dev, limit)) + return true; + if ((cur_live.bit_counter & 1) && cur_live.crc_init) + { + if ((cur_live.crc ^ (bit ? 0x8000 : 0x0000)) & 0x8000) + cur_live.crc = (cur_live.crc << 1) ^ 0x1021; + else + cur_live.crc = cur_live.crc << 1; + } + cur_live.shift_reg = cur_live.shift_reg << 1; + cur_live.bit_counter--; + return false; +} + +void k1801vp128_device::live_write_mfm(uint8_t mfm, bool marker) +{ + bool context = cur_live.data_bit_context; + uint16_t raw = 0; + for (int i = 0; i < 8; i++) + { + bool bit = mfm & (0x80 >> i); + if (!(bit || context)) + raw |= 0x8000 >> (2*i); + if (bit) + raw |= 0x4000 >> (2*i); + context = bit; + } + if (marker && (mfm & 0xc) == 0) raw &= 0xffdf; // A1 and C2 sync sequences + cur_live.data_reg = mfm; + cur_live.shift_reg = raw; + cur_live.data_bit_context = context; + LOGLIVE("%s: write %02x %04x %04x\n", cur_live.tm.to_string(), mfm, cur_live.crc, raw); +} + + +void k1801vp128_device::set_ds(int fid) +{ + if (selected_drive == fid) + return; + + live_abort(); + + // pass drive select to connected drives + for (floppy_info &fi : flopi) + if (fi.dev) + fi.dev->ds_w(fid); + + // record selected drive + selected_drive = fid; + + if (fid != -1) + { + LOG("COMMAND ~READ drive %d c:h %d:%d\n", selected_drive, flopi[fid].dev->get_cyl(), BIT(m_cr, 5)); + m_sr &= ~CSR_R_TR; + execute_command(CMD_READ); + } +} diff --git a/src/devices/machine/1801vp128.h b/src/devices/machine/1801vp128.h new file mode 100644 index 0000000000000..339ddcbd423cb --- /dev/null +++ b/src/devices/machine/1801vp128.h @@ -0,0 +1,209 @@ +// license:BSD-3-Clause +// copyright-holders:Sergey Svishchev +/********************************************************************** + + 1801VP1-128 gate array (MFM codec for floppy controllers) + +********************************************************************** + _____ _____ + _AD0 1 |* \_/ | 42 +5V + _AD1 2 | | 41 _DS0 + _AD2 3 | | 30 _DS1 + _AD3 4 | | 39 _DS2 + _AD4 5 | | 38 _DS3 + _AD5 6 | | 37 _MSW + _AD6 7 | | 36 HS + _AD7 8 | | 35 DIR + _AD8 9 | | 34 _ST + _AD9 10 | | 33 TR0 + _AD10 11 | 1801VP1-128 | 32 RDY + _AD11 12 | | 31 WPR + _AD12 13 | | 30 _REZ + _AD13 14 | | 29 DI + _AD14 15 | | 28 _WRE + _AD15 16 | | 27 _D01 + _SYNC 17 | | 26 _D02 + _DIN 18 | | 25 _D03 + _DOUT 19 | | 24 IND + _INIT 20 | | 23 _RPLY + GND 21 |_____________| 22 CLC + +**********************************************************************/ + +#ifndef MAME_MACHINE_1801VP128_H +#define MAME_MACHINE_1801VP128_H + +#pragma once + +#include "imagedev/floppy.h" +#include "machine/pdp11.h" + +#include "fdc_pll.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> k1801vp128_device + +class k1801vp128_device : public device_t +{ +public: + // construction/destruction + k1801vp128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + auto ds_in_callback() { return m_read_ds.bind(); } + + uint16_t read(offs_t offset); + void write(offs_t offset, uint16_t data); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + TIMER_CALLBACK_MEMBER(update_floppy); + +private: + enum { + CMD_READ, + CMD_WRITE, + CMD_SEEK + }; + + enum { + IDLE, + + // Main states + READ_DATA, + WRITE_DATA, + + // Sub-states + COMMAND_DONE, + + SEEK_MOVE, + SEEK_WAIT_STEP_SIGNAL_TIME, + SEEK_WAIT_STEP_SIGNAL_TIME_DONE, + SEEK_WAIT_STEP_TIME, + SEEK_WAIT_STEP_TIME_DONE, + SEEK_WAIT_DONE, + SEEK_DONE, + + HEAD_LOAD, + HEAD_LOAD_DONE, + + WAIT_INDEX, + WAIT_INDEX_DONE, + + SCAN_ID, + SCAN_ID_FAILED, + + TRACK_READ, + TRACK_WRITTEN, + + // Live states + SEARCH_ADDRESS_MARK_HEADER, + READ_DATA_HIGH, + READ_DATA_HIGH_BYTE, + READ_DATA_LOW, + READ_DATA_LOW_BYTE, + + WRITE_MFM_DATA_HIGH, + WRITE_MFM_DATA_HIGH_BYTE, + WRITE_MFM_DATA_LOW, + WRITE_MFM_DATA_LOW_BYTE, + }; + + enum { + CSR_R_TR0 = 0000001, + CSR_R_RDY = 0000002, + CSR_R_WPR = 0000004, + CSR_R_TR = CSR_DONE, + CSR_R_CRC = 0040000, + CSR_R_IND = 0100000, + + CSR_W_DS0 = 0000001, + CSR_W_DS1 = 0000002, + CSR_W_DS2 = 0000004, + CSR_W_DS3 = 0000010, + CSR_W_MSW = 0000020, // motor + CSR_W_HS = 0000040, // head select + CSR_W_DIR = 0000100, // step direction + CSR_W_ST = 0000200, // step pulse + CSR_W_GDR = 0000400, + CSR_W_WM = 0001000, + CSR_W_REZ = 0002000, + CSR_W_DS = 0000017, + }; + + struct floppy_info + { + emu_timer *tm; + floppy_image_device *dev; + int id; + int main_state, sub_state; + int dir, counter; + bool live, index; + }; + + struct live_info + { + attotime tm; + int state, next_state; + floppy_info *fi; + uint16_t shift_reg, crc; + int bit_counter; + bool data_separator_phase, data_bit_context, crc_init; + uint16_t data_reg; + fdc_pll_t pll; + }; + + required_device_array m_connectors; + devcb_read16 m_read_ds; + + std::string ttsn() const; + + floppy_info flopi[4]; + int selected_drive; + + uint16_t m_cr; + uint16_t m_sr; + uint16_t m_rbuf; + uint16_t m_wbuf; + + live_info cur_live, checkpoint_live; + + void execute_command(int command); + void set_ds(int fid); + + void seek_start(floppy_info &fi); + void seek_continue(floppy_info &fi); + + void read_data_start(floppy_info &fi); + void read_data_continue(floppy_info &fi); + + void write_data_start(floppy_info &fi); + void write_data_continue(floppy_info &fi); + + void general_continue(floppy_info &fi); + void index_callback(floppy_image_device *floppy, int state); + + void live_start(floppy_info &fi, int live_state); + void live_abort(); + void checkpoint(); + void rollback(); + void live_delay(int state); + void live_sync(); + void live_run(attotime limit = attotime::never); + void live_write_mfm(uint8_t mfm, bool marker); + + bool read_one_bit(const attotime &limit); + bool write_one_bit(const attotime &limit); +}; + + +// device type definition +DECLARE_DEVICE_TYPE(K1801VP128, k1801vp128_device) + +#endif // MAME_MACHINE_1801VP128_H diff --git a/src/devices/machine/ns32081.cpp b/src/devices/machine/ns32081.cpp index ca64842370177..ab406a84d04bd 100644 --- a/src/devices/machine/ns32081.cpp +++ b/src/devices/machine/ns32081.cpp @@ -8,7 +8,9 @@ * - Microprocessor Databook, Series 32000, NSC800, 1989 Edition, National Semiconductor * * TODO: - * - NS32381 + * - poly/scalb/logb/dot + * - ns32381 timing + * - no-result operations */ #include "emu.h" @@ -21,6 +23,7 @@ #include "logmacro.h" DEFINE_DEVICE_TYPE(NS32081, ns32081_device, "ns32081", "National Semiconductor NS32081 Floating-Point Unit") +DEFINE_DEVICE_TYPE(NS32381, ns32381_device, "ns32381", "National Semiconductor NS32381 Floating-Point Unit") enum fsr_mask : u32 { @@ -31,6 +34,7 @@ enum fsr_mask : u32 FSR_IF = 0x00000040, // inexact result flag FSR_RM = 0x00000180, // rounding mode FSR_SWF = 0x0000fe00, // software field + FSR_RMB = 0x00010000, // (32381 only) register modify bit }; enum rm_mask : u32 @@ -61,149 +65,159 @@ enum state : unsigned RESULT = 5, // result word available }; -enum idbyte : u8 -{ - FORMAT_9 = 0x3e, - FORMAT_11 = 0xbe, -}; - enum operand_length : unsigned { LENGTH_F = 4, // single precision LENGTH_L = 8, // double precision }; -enum size_code : unsigned -{ - SIZE_B = 0, - SIZE_W = 1, - SIZE_D = 3, -}; - -ns32081_device::ns32081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) - : device_t(mconfig, NS32081, tag, owner, clock) - , ns32000_slow_slave_interface(mconfig, *this) +ns32081_device_base::ns32081_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) , ns32000_fpu_interface(mconfig, *this) { } -void ns32081_device::device_start() +void ns32081_device_base::device_start() { save_item(NAME(m_fsr)); - save_item(NAME(m_f)); + save_item(NAME(m_state)); save_item(NAME(m_idbyte)); save_item(NAME(m_opword)); + save_item(STRUCT_MEMBER(m_op, expected)); save_item(STRUCT_MEMBER(m_op, issued)); save_item(STRUCT_MEMBER(m_op, value)); - save_item(NAME(m_status)); - save_item(NAME(m_state)); + save_item(NAME(m_status)); save_item(NAME(m_tcy)); m_complete = timer_alloc(FUNC(ns32081_device::complete), this); } -void ns32081_device::device_reset() +void ns32081_device_base::device_reset() { m_fsr = 0; - std::fill(std::begin(m_f), std::end(m_f), 0); - m_state = IDLE; + m_idbyte = 0; + m_opword = 0; + m_status = 0; + m_tcy = 0; } -void ns32081_device::state_add(device_state_interface &parent, int &index) +void ns32081_device_base::state_add(device_state_interface &parent, int &index) { parent.state_add(index++, "FSR", m_fsr).formatstr("%04X"); - - for (unsigned i = 0; i < 8; i++) - parent.state_add(index++, util::string_format("F%d", i).c_str(), m_f[i]).formatstr("%08X"); } -u16 ns32081_device::read_st(int *icount) +template T ns32081_device_base::read() { - if (m_state == STATUS) + if (m_state == RESULT && m_op[2].issued < m_op[2].expected) { - m_state = (m_op[2].issued == m_op[2].expected) ? IDLE : RESULT; + T const data = m_op[2].value >> (m_op[2].issued * 8); - if (icount) - *icount -= m_tcy; + m_op[2].issued += sizeof(T); - LOG("read_st status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, - (m_state == RESULT ? "results pending" : "complete"), machine().describe_context()); + LOG("read %d data 0x%0*x (%s)\n", + m_op[2].issued / sizeof(T), sizeof(T) * 2, data, machine().describe_context()); - return m_status; + if (m_op[2].issued == m_op[2].expected) + { + LOG("read complete\n"); + m_state = IDLE; + } + + return data; } - logerror("protocol error reading status word (%s)\n", machine().describe_context()); + logerror("read protocol error (%s)\n", machine().describe_context()); return 0; } -u16 ns32081_device::read_op() +template void ns32081_device_base::write(T data) { - if (m_state == RESULT && m_op[2].issued < m_op[2].expected) + switch (m_state) { - u16 const data = u16(m_op[2].value >> (m_op[2].issued * 8)); - LOG("read_op word %d data 0x%04x (%s)\n", m_op[2].issued >> 1, data, machine().describe_context()); - - m_op[2].issued += 2; + case IDLE: + if (sizeof(T) == 4) + { + // decode instruction + if (!decode(BIT(data, 24, 8), swapendian_int16(BIT(data, 8, 16)))) + return; - if (m_op[2].issued == m_op[2].expected) + m_state = OPERAND; + } + else { - LOG("read_op last result word issued\n"); - m_state = IDLE; + LOG("write idbyte 0x%04x (%s)\n", data, machine().describe_context()); + if ((data == FORMAT_9) || (data == FORMAT_11) || (type() == NS32381 && data == FORMAT_12)) + { + // record idbyte + m_idbyte = data; + + m_state = OPERATION; + } } + break; - return data; - } + case OPERATION: + LOG("write opword 0x%0*x (%s)\n", sizeof(T) * 2, data, machine().describe_context()); - logerror("protocol error reading result word (%s)\n", machine().describe_context()); - return 0; -} + // decode instruction + decode(m_idbyte, swapendian_int16(data)); -void ns32081_device::write_id(u16 data) -{ - bool const match = (data == FORMAT_9) || (data == FORMAT_11); + m_state = OPERAND; + break; - if (match) - { - LOG("write_id match 0x%04x (%s)\n", data, machine().describe_context()); - m_state = OPERATION; - } - else - { - LOG("write_id ignore 0x%04x (%s)\n", data, machine().describe_context()); - m_state = IDLE; + case OPERAND: + // check awaiting operand data + if (m_op[0].issued < m_op[0].expected || m_op[1].issued < m_op[1].expected) + { + unsigned const n = (m_op[0].issued < m_op[0].expected) ? 0 : 1; + operand &op = m_op[n]; + + LOG("write operand %d data 0x%0*x (%s)\n", + n, sizeof(T) * 2, data, machine().describe_context()); + + // insert data into operand value + op.value |= u64(data) << (op.issued * 8); + op.issued += sizeof(T); + } + else + logerror("write protocol error unexpected operand data 0x%0*x (%s)\n", + sizeof(T) * 2, data, machine().describe_context()); + break; } - m_idbyte = u8(data); + // start execution when all operands are available + if (m_state == OPERAND && m_op[0].issued >= m_op[0].expected && m_op[1].issued >= m_op[1].expected) + execute(); } -void ns32081_device::write_op(u16 data) +bool ns32081_device_base::decode(u8 const idbyte, u16 const opword) { - switch (m_state) - { - case OPERATION: - m_opword = swapendian_int16(data); - LOG("write_op opword 0x%04x (%s)\n", m_opword, machine().describe_context()); + LOG("decode idbyte 0x%02x opword 0x%04x (%s)\n", idbyte, opword, machine().describe_context()); - // initialize operands - for (operand &op : m_op) - { - op.expected = 0; - op.issued = 0; - op.value = 0; - } + m_idbyte = idbyte; + m_opword = opword; + + // initialize operands + for (operand &op : m_op) + { + op.expected = 0; + op.issued = 0; + op.value = 0; + } - // decode operands - if (m_idbyte == FORMAT_9) + switch (m_idbyte) + { + case FORMAT_9: { // format 9: 1111 1222 22oo ofii unsigned const f_length = BIT(m_opword, 2) ? LENGTH_F : LENGTH_L; unsigned const size = m_opword & 3; - switch ((m_opword >> 3) & 7) + switch (BIT(m_opword, 3, 3)) { case 0: // movif m_op[0].expected = size + 1; @@ -231,10 +245,11 @@ void ns32081_device::write_op(u16 data) break; } } - else if (m_idbyte == FORMAT_11) + break; + case FORMAT_11: { // format 11: 1111 1222 22oo oo0f - unsigned const opcode = (m_opword >> 2) & 15; + unsigned const opcode = BIT(m_opword, 2, 4); unsigned const f_length = BIT(m_opword, 0) ? LENGTH_F : LENGTH_L; m_op[0].expected = f_length; @@ -247,69 +262,65 @@ void ns32081_device::write_op(u16 data) if (opcode != 2) m_op[2].expected = f_length; } - - // operand 1 in register - if (m_op[0].expected && !(m_opword & 0xc000)) + break; + case FORMAT_12: { - // exclude integer operands - if (m_idbyte == FORMAT_11 || ((m_opword >> 3) & 7) > 1) - { - unsigned const reg = (m_opword >> 11) & 7; - LOG("write_op read f%d\n", reg); - - m_op[0].value = m_f[reg ^ 0]; - if (m_op[0].expected == 8) - m_op[0].value |= u64(m_f[reg ^ 1]) << 32; + // format 12: 1111 1222 22oo oo0f + unsigned const f_length = BIT(m_opword, 0) ? LENGTH_F : LENGTH_L; - m_op[0].issued = m_op[0].expected; + switch (BIT(m_opword, 2, 4)) + { + case 2: // polyf + case 3: // dotf + m_op[0].expected = f_length; + m_op[1].expected = f_length; + break; + case 4: // scalbf + m_op[0].expected = f_length; + m_op[1].expected = f_length; + m_op[2].expected = f_length; + break; + case 5: // logbf + m_op[0].expected = f_length; + m_op[2].expected = f_length; + break; } } + break; + default: + LOG("decode idbyte 0x%02x unknown (%s)\n", m_idbyte, machine().describe_context()); + return false; + } - // operand 2 in register - if (m_op[1].expected && !(m_opword & 0x0600)) + // operand 1 in register + if (m_op[0].expected && !BIT(m_opword, 14, 2)) + { + // exclude integer operands + if (m_idbyte != FORMAT_9 || (BIT(m_opword, 3, 3) > 1)) { - unsigned const reg = (m_opword >> 6) & 7; - LOG("write_op read f%d\n", reg); + reg_get(m_op[0].expected, m_op[0].value, BIT(m_opword, 11, 3)); - m_op[1].value = m_f[reg ^ 0]; - if (m_op[1].expected == 8) - m_op[1].value |= u64(m_f[reg ^ 1]) << 32; - - m_op[1].issued = m_op[1].expected; + m_op[0].issued = m_op[0].expected; } + } - m_state = OPERAND; - break; - - case OPERAND: - // check awaiting operand word - if (m_op[0].issued < m_op[0].expected || m_op[1].issued < m_op[1].expected) - { - unsigned const n = (m_op[0].issued < m_op[0].expected) ? 0 : 1; - operand &op = m_op[n]; - - LOG("write_op op%d data 0x%04x (%s)\n", n, data, machine().describe_context()); + // operand 2 in register + if (m_op[1].expected && !BIT(m_opword, 9, 2)) + { + reg_get(m_op[1].expected, m_op[1].value, BIT(m_opword, 6, 3)); - // insert word into operand value - op.value |= u64(data) << (op.issued * 8); - op.issued += 2; - } - else - logerror("protocol error unexpected operand word 0x%04x (%s)\n", data, machine().describe_context()); - break; + m_op[1].issued = m_op[1].expected; } - // start execution when all operands are available - if (m_state == OPERAND && m_op[0].issued >= m_op[0].expected && m_op[1].issued >= m_op[1].expected) - execute(); + return true; } -void ns32081_device::execute() +void ns32081_device_base::execute() { - softfloat_exceptionFlags = 0; u32 const fsr = m_fsr; m_fsr &= ~FSR_TT; + softfloat_exceptionFlags = 0; m_status = 0; m_tcy = 0; @@ -317,235 +328,247 @@ void ns32081_device::execute() { case FORMAT_9: // format 9: 1111 1222 22oo ofii + switch (BIT(m_opword, 3, 3)) { - bool const single = BIT(m_opword, 2); - unsigned const f_length = single ? LENGTH_F : LENGTH_L; - unsigned const size = m_opword & 3; - - switch ((m_opword >> 3) & 7) + case 0: + // MOVif src,dest + // gen,gen + // read.i,write.f { - case 0: - // MOVif src,dest - // gen,gen - // read.i,write.f - { - s32 const src = - (size == SIZE_D) ? s32(m_op[0].value) : - (size == SIZE_W) ? s16(m_op[0].value) : - s8(m_op[0].value); - - if (single) - m_op[2].value = i32_to_f32(src).v; - else - m_op[2].value = i32_to_f64(src).v; - m_op[2].expected = f_length; - m_tcy = 53; - } - break; - case 1: - // LFSR src - // gen - // read.D - m_fsr = u16(m_op[0].value); - - switch (m_fsr & FSR_RM) - { - case RM_N: softfloat_roundingMode = softfloat_round_near_even; break; - case RM_Z: softfloat_roundingMode = softfloat_round_minMag; break; - case RM_U: softfloat_roundingMode = softfloat_round_max; break; - case RM_D: softfloat_roundingMode = softfloat_round_min; break; - } - m_tcy = 18; - break; - case 2: - // MOVLF src,dest - // gen,gen - // read.L,write.F - m_op[2].value = f64_to_f32(float64_t{ m_op[0].value }).v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc000) ? 23 : 27; - break; - case 3: - // MOVFL src,dest - // gen,gen - // read.F,write.L - m_op[2].value = f32_to_f64(float32_t{ u32(m_op[0].value) }).v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc000) ? 22 : 26; - break; - case 4: - // ROUNDfi src,dest - // gen,gen - // read.f,write.i - if (single) - m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_near_even, true); - else - m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_near_even, true); - - if ((size == SIZE_D && s64(m_op[2].value) != s32(m_op[2].value)) - || (size == SIZE_W && s64(m_op[2].value) != s16(m_op[2].value)) - || (size == SIZE_B && s64(m_op[2].value) != s8(m_op[2].value))) - softfloat_exceptionFlags |= softfloat_flag_overflow; + s32 const src = util::sext(m_op[0].value, m_op[0].expected * 8); - m_op[2].expected = size + 1; - m_tcy = (m_opword & 0xc000) ? 53 : 66; - break; - case 5: - // TRUNCfi src,dest - // gen,gen - // read.f,write.i - if (single) - m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_minMag, true); + if (m_op[2].expected == LENGTH_F) + m_op[2].value = i32_to_f32(src).v; else - m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_minMag, true); + m_op[2].value = i32_to_f64(src).v; - if ((size == SIZE_D && s64(m_op[2].value) != s32(m_op[2].value)) - || (size == SIZE_W && s64(m_op[2].value) != s16(m_op[2].value)) - || (size == SIZE_B && s64(m_op[2].value) != s8(m_op[2].value))) - softfloat_exceptionFlags |= softfloat_flag_overflow; - - m_op[2].expected = size + 1; - m_tcy = (m_opword & 0xc000) ? 53 : 66; - break; - case 6: - // SFSR dest - // gen - // write.D - m_op[2].value = fsr; - m_op[2].expected = 4; - m_tcy = 13; - break; - case 7: - // FLOORfi src,dest - // gen,gen - // read.f,write.i - if (single) - m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_min, true); - else - m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_min, true); - - if ((size == SIZE_D && s64(m_op[2].value) != s32(m_op[2].value)) - || (size == SIZE_W && s64(m_op[2].value) != s16(m_op[2].value)) - || (size == SIZE_B && s64(m_op[2].value) != s8(m_op[2].value))) - softfloat_exceptionFlags |= softfloat_flag_overflow; - - m_op[2].expected = size + 1; - m_tcy = (m_opword & 0xc000) ? 53 : 66; - break; + m_tcy = 53; + } + break; + case 1: + // LFSR src + // gen + // read.D + m_fsr = u16(m_op[0].value); + + switch (m_fsr & FSR_RM) + { + case RM_N: softfloat_roundingMode = softfloat_round_near_even; break; + case RM_Z: softfloat_roundingMode = softfloat_round_minMag; break; + case RM_U: softfloat_roundingMode = softfloat_round_max; break; + case RM_D: softfloat_roundingMode = softfloat_round_min; break; } + m_tcy = 18; + break; + case 2: + // MOVLF src,dest + // gen,gen + // read.L,write.F + m_op[2].value = f64_to_f32(float64_t{ m_op[0].value }).v; + + m_tcy = BIT(m_opword, 14, 2) ? 23 : 27; + break; + case 3: + // MOVFL src,dest + // gen,gen + // read.F,write.L + m_op[2].value = f32_to_f64(float32_t{ u32(m_op[0].value) }).v; + + m_tcy = BIT(m_opword, 14, 2) ? 22 : 26; + break; + case 4: + // ROUNDfi src,dest + // gen,gen + // read.f,write.i + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_near_even, true); + else + m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_near_even, true); + + if (s64(m_op[2].value) != util::sext(m_op[2].value, m_op[2].expected * 8)) + softfloat_exceptionFlags |= softfloat_flag_overflow; + + m_tcy = BIT(m_opword, 14, 2) ? 53 : 66; + break; + case 5: + // TRUNCfi src,dest + // gen,gen + // read.f,write.i + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_minMag, true); + else + m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_minMag, true); + + if (s64(m_op[2].value) != util::sext(m_op[2].value, m_op[2].expected * 8)) + softfloat_exceptionFlags |= softfloat_flag_overflow; + + m_tcy = BIT(m_opword, 14, 2) ? 53 : 66; + break; + case 6: + // SFSR dest + // gen + // write.D + m_op[2].value = fsr; + + m_tcy = 13; + break; + case 7: + // FLOORfi src,dest + // gen,gen + // read.f,write.i + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_to_i64(float32_t{ u32(m_op[0].value) }, softfloat_round_min, true); + else + m_op[2].value = f64_to_i64(float64_t{ m_op[0].value }, softfloat_round_min, true); + + if (s64(m_op[2].value) != util::sext(m_op[2].value, m_op[2].expected * 8)) + softfloat_exceptionFlags |= softfloat_flag_overflow; + + m_tcy = BIT(m_opword, 14, 2) ? 53 : 66; + break; } break; case FORMAT_11: - // format 11: 1111122222oooo0f + // format 11: 1111 1222 22oo oo0f + switch (BIT(m_opword, 2, 4)) { - bool const single = BIT(m_opword, 0); - unsigned const f_length = single ? LENGTH_F : LENGTH_L; - - switch ((m_opword >> 2) & 15) - { - case 0x0: - // ADDf src,dest - // gen,gen - // read.f,rmw.f - if (single) - m_op[2].value = f32_add(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; - else - m_op[2].value = f64_add(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc600) ? 70 : 74; - break; - case 0x1: - // MOVf src,dest - // gen,gen - // read.f,write.f - m_op[2].value = m_op[0].value; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc000) ? 23 : 27; - break; - case 0x2: - // CMPf src1,src2 - // gen,gen - // read.f,read.f - if (m_op[0].value == m_op[1].value) - m_status |= SLAVE_Z; - if ((single && f32_le(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) })) - || (!single && f64_le(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }))) - m_status |= SLAVE_N; - m_tcy = (m_opword & 0xc600) ? 45 : 49; - break; - case 0x3: - // Trap(SLAVE) - m_fsr |= TT_ILL; - m_status = SLAVE_Q; - break; - case 0x4: - // SUBf src,dest - // gen,gen - // read.f,rmw.f - if (single) - m_op[2].value = f32_sub(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; - else - m_op[2].value = f64_sub(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc600) ? 70 : 74; - break; - case 0x5: - // NEGf src,dest - // gen,gen - // read.f,write.f - if (single) + case 0x0: + // ADDf src,dest + // gen,gen + // read.f,rmw.f + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_add(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; + else + m_op[2].value = f64_add(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; + + m_tcy = (m_opword & 0xc600) ? 70 : 74; + break; + case 0x1: + // MOVf src,dest + // gen,gen + // read.f,write.f + m_op[2].value = m_op[0].value; + + m_tcy = BIT(m_opword, 14, 2) ? 23 : 27; + break; + case 0x2: + // CMPf src1,src2 + // gen,gen + // read.f,read.f + if (m_op[0].value == m_op[1].value) + m_status |= SLAVE_Z; + if ((m_op[0].expected == LENGTH_F && f32_le(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) })) + || (m_op[0].expected == LENGTH_L && f64_le(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }))) + m_status |= SLAVE_N; + + m_tcy = (m_opword & 0xc600) ? 45 : 49; + break; + case 0x3: + // Trap(SLAVE) + m_fsr |= TT_ILL; + m_status = SLAVE_Q; + break; + case 0x4: + // SUBf src,dest + // gen,gen + // read.f,rmw.f + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_sub(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; + else + m_op[2].value = f64_sub(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; + + m_tcy = (m_opword & 0xc600) ? 70 : 74; + break; + case 0x5: + // NEGf src,dest + // gen,gen + // read.f,write.f + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_mul(float32_t{ u32(m_op[0].value) }, i32_to_f32(-1)).v; + else + m_op[2].value = f64_mul(float64_t{ m_op[0].value }, i32_to_f64(-1)).v; + + m_tcy = BIT(m_opword, 14, 2) ? 20 : 24; + break; + case 0x8: + // DIVf src,dest + // gen,gen + // read.f,rmw.f + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_div(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; + else + m_op[2].value = f64_div(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; + + m_tcy = ((m_opword & 0xc600) ? 55 : 59) + (m_op[0].expected == LENGTH_F ? 30 : 60); + break; + case 0x9: + // Trap(SLAVE) + m_fsr |= TT_ILL; + m_status = SLAVE_Q; + break; + case 0xc: + // MULf src,dest + // gen,gen + // read.f,rmw.f + if (m_op[0].expected == LENGTH_F) + m_op[2].value = f32_mul(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; + else + m_op[2].value = f64_mul(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; + + m_tcy = ((m_opword & 0xc600) ? 30 : 34) + (m_op[0].expected == LENGTH_F ? 14 : 28); + break; + case 0xd: + // ABSf src,dest + // gen,gen + // read.f,write.f + if (m_op[0].expected == LENGTH_F) + if (f32_lt(float32_t{ u32(m_op[0].value) }, float32_t{ 0 })) m_op[2].value = f32_mul(float32_t{ u32(m_op[0].value) }, i32_to_f32(-1)).v; else + m_op[2].value = float32_t{ u32(m_op[0].value) }.v; + else + if (f64_lt(float64_t{ m_op[0].value }, float64_t{ 0 })) m_op[2].value = f64_mul(float64_t{ m_op[0].value }, i32_to_f64(-1)).v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc000) ? 20 : 24; - break; - case 0x8: - // DIVf src,dest - // gen,gen - // read.f,rmw.f - if (single) - m_op[2].value = f32_div(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; else - m_op[2].value = f64_div(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; - m_op[2].expected = f_length; - m_tcy = ((m_opword & 0xc600) ? 55 : 59) + (single ? 30 : 60); - break; - case 0x9: - // Trap(SLAVE) - m_fsr |= TT_ILL; - m_status = SLAVE_Q; - break; - case 0xc: - // MULf src,dest - // gen,gen - // read.f,rmw.f - if (single) - m_op[2].value = f32_mul(float32_t{ u32(m_op[1].value) }, float32_t{ u32(m_op[0].value) }).v; - else - m_op[2].value = f64_mul(float64_t{ m_op[1].value }, float64_t{ m_op[0].value }).v; - m_op[2].expected = f_length; - m_tcy = ((m_opword & 0xc600) ? 30 : 34) + (single ? 14 : 28); - break; - case 0xd: - // ABSf src,dest - // gen,gen - // read.f,write.f - if (single) - if (f32_lt(float32_t{ u32(m_op[0].value) }, float32_t{ 0 })) - m_op[2].value = f32_mul(float32_t{ u32(m_op[0].value) }, i32_to_f32(-1)).v; - else - m_op[2].value = float32_t{ u32(m_op[0].value) }.v; - else - if (f64_lt(float64_t{ m_op[0].value }, float64_t{ 0 })) - m_op[2].value = f64_mul(float64_t{ m_op[0].value }, i32_to_f64(-1)).v; - else - m_op[2].value = float64_t{ m_op[0].value }.v; - m_op[2].expected = f_length; - m_tcy = (m_opword & 0xc000) ? 20 : 24; - break; - } + m_op[2].value = float64_t{ m_op[0].value }.v; + + m_tcy = BIT(m_opword, 14, 2) ? 20 : 24; + break; + } + break; + + case FORMAT_12: + // format 12: 1111 1222 22oo oo0f + switch (BIT(m_opword, 2, 4)) + { + case 0x2: + // POLYf src1,src2 + // gen,gen + // read.f,read.f + m_fsr |= FSR_RMB; + break; + case 0x3: + // DOTf src1,src2 + // gen,gen + // read.f,read.f + m_fsr |= FSR_RMB; + break; + case 0x4: + // SCALBf src,dest + // gen,gen + // read.f,rmw.f + break; + case 0x5: + // LOGBf src,dest + // gen,gen + // read.f,write.f + break; + default: + // Trap(SLAVE) + m_fsr |= TT_ILL; + m_status = SLAVE_Q; + break; } break; } @@ -595,47 +618,177 @@ void ns32081_device::execute() "addf", "movf", "cmpf", nullptr, "subf", "negf", nullptr, nullptr, "divf", nullptr, nullptr, nullptr, "mulf", "absf", nullptr, nullptr }; + static char const *format12[] = + { + nullptr, nullptr, "polyf", "dotf", "scalbf", "logbf", nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr + }; + + char const *operation = nullptr; + switch (m_idbyte) + { + case FORMAT_9: operation = format9[BIT(m_opword, 3, 3)]; break; + case FORMAT_11: operation = format11[BIT(m_opword, 2, 4)]; break; + case FORMAT_12: operation = format12[BIT(m_opword, 2, 4)]; break; + } if (m_status & SLAVE_Q) - LOG("execute %s 0x%x,0x%x exception\n", - (m_idbyte == FORMAT_9) - ? format9[(m_opword >> 3) & 7] - : format11[(m_opword >> 2) & 15], - m_op[0].value, m_op[1].value); + LOG("execute %s 0x%x,0x%x exception\n", operation, m_op[0].value, m_op[1].value); else - LOG("execute %s 0x%x,0x%x result 0x%x\n", - (m_idbyte == FORMAT_9) - ? format9[(m_opword >> 3) & 7] - : format11[(m_opword >> 2) & 15], - m_op[0].value, m_op[1].value, m_op[2].value); + LOG("execute %s 0x%x,0x%x result 0x%x\n", operation, m_op[0].value, m_op[1].value, m_op[2].value); } // write-back floating point register results - if (m_op[2].expected && !(m_opword & 0x0600)) + if (m_op[2].expected && !BIT(m_opword, 9, 2)) { // exclude integer results (roundfi, truncfi, sfsr, floorfi) - if (m_idbyte == FORMAT_11 || ((m_opword >> 3) & 7) < 4) + if (m_idbyte != FORMAT_9 || (BIT(m_opword, 3, 3) < 4)) { - unsigned const reg = (m_opword >> 6) & 7; + reg_set(BIT(m_opword, 6, 3), m_op[2].expected, m_op[2].value); - LOG("execute write-back f%d\n", reg); - - m_f[reg ^ 0] = u32(m_op[2].value >> 0); - if (m_op[2].expected == 8) - m_f[reg ^ 1] = u32(m_op[2].value >> 32); + if (type() == NS32381) + m_fsr |= FSR_RMB; m_op[2].issued = m_op[2].expected; } } - m_state = STATUS; - if (!m_out_scb.isunset()) m_complete->adjust(attotime::from_ticks(m_tcy, clock())); + + m_state = STATUS; +} + +u16 ns32081_device_base::status(int *icount) +{ + if (m_state == STATUS) + { + m_state = (m_op[2].issued == m_op[2].expected) ? IDLE : RESULT; + + if (icount) + *icount -= m_tcy; + + LOG("status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, + (m_state == RESULT ? "results pending" : "complete"), machine().describe_context()); + + return m_status; + } + + logerror("status protocol error (%s)\n", machine().describe_context()); + return 0; } -void ns32081_device::complete(s32 param) +void ns32081_device_base::complete(s32 param) { m_out_scb(0); m_out_scb(1); } + +ns32081_device::ns32081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : ns32081_device_base(mconfig, NS32081, tag, owner, clock) + , ns32000_slow_slave_interface(mconfig, *this) +{ +} + +void ns32081_device::device_start() +{ + ns32081_device_base::device_start(); + + save_item(NAME(m_f)); +} + +void ns32081_device::device_reset() +{ + ns32081_device_base::device_reset(); + + std::fill(std::begin(m_f), std::end(m_f), 0); +} + +void ns32081_device::state_add(device_state_interface &parent, int &index) +{ + ns32081_device_base::state_add(parent, index); + + for (unsigned i = 0; i < 8; i++) + parent.state_add(index++, util::string_format("F%d", i).c_str(), m_f[i]).formatstr("%08X"); +} + +void ns32081_device::reg_get(unsigned const op_size, u64 &op_value, unsigned const reg) const +{ + op_value = m_f[reg ^ 0]; + if (op_size == LENGTH_L) + op_value |= u64(m_f[reg ^ 1]) << 32; + + if (op_size == LENGTH_L) + LOG("reg_get f%d:%d data 0x%016x\n", reg ^ 1, reg ^ 0, op_value); + else + LOG("reg_get f%d data 0x%08x\n", reg, op_value); +} + +void ns32081_device::reg_set(unsigned const reg, unsigned const op_size, u64 const op_value) +{ + if (op_size == LENGTH_L) + LOG("reg_set f%d:%d data 0x%016x\n", reg ^ 1, reg ^ 0, op_value); + else + LOG("reg_set f%d data 0x%08x\n", reg, op_value); + + m_f[reg ^ 0] = u32(op_value >> 0); + if (op_size == LENGTH_L) + m_f[reg ^ 1] = u32(op_value >> 32); +} + +ns32381_device::ns32381_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : ns32081_device_base(mconfig, NS32381, tag, owner, clock) + , ns32000_slow_slave_interface(mconfig, *this) + , ns32000_fast_slave_interface(mconfig, *this) +{ +} + +void ns32381_device::device_start() +{ + ns32081_device_base::device_start(); + + save_item(NAME(m_l)); +} + +void ns32381_device::device_reset() +{ + std::fill(std::begin(m_l), std::end(m_l), 0); +} + +void ns32381_device::state_add(device_state_interface &parent, int &index) +{ + ns32081_device_base::state_add(parent, index); + + for (unsigned i = 0; i < 8; i++) + parent.state_add(index++, util::string_format("L%d", i).c_str(), m_l[i]).formatstr("%016X"); +} + +void ns32381_device::reg_get(unsigned const op_size, u64 &op_value, unsigned const reg) const +{ + if (op_size == LENGTH_L) + op_value = m_l[reg]; + else if (reg & 1) + op_value = m_l[reg & 6] >> 32; + else + op_value = u32(m_l[reg & 6]); + + if (op_size == LENGTH_L) + LOG("reg_get l%d data 0x%016x\n", reg, op_value); + else + LOG("reg_get f%d data 0x%08x\n", reg, op_value); +} + +void ns32381_device::reg_set(unsigned const reg, unsigned const op_size, u64 const op_value) +{ + if (op_size == LENGTH_L) + LOG("reg_set l%d data 0x%016x\n", reg, op_value); + else + LOG("reg_set f%d data 0x%08x\n", reg, op_value); + + if (op_size == LENGTH_L) + m_l[reg] = op_value; + else if (reg & 1) + m_l[reg & 6] = (op_value << 32) | u32(m_l[reg & 6]); + else + m_l[reg & 6] = (m_l[reg & 6] & 0xffff'ffff'0000'0000ULL) | u32(op_value); +} diff --git a/src/devices/machine/ns32081.h b/src/devices/machine/ns32081.h index 89847175e43f9..12a50d9434dd0 100644 --- a/src/devices/machine/ns32081.h +++ b/src/devices/machine/ns32081.h @@ -8,54 +8,119 @@ #include "cpu/ns32000/common.h" -class ns32081_device +class ns32081_device_base : public device_t - , public ns32000_slow_slave_interface , public ns32000_fpu_interface { -public: - ns32081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); - - virtual void state_add(device_state_interface &parent, int &index) override; - - virtual u16 read_st(int *icount = nullptr) override; - virtual u16 read_op() override; - - virtual void write_id(u16 data) override; - virtual void write_op(u16 data) override; - protected: + ns32081_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); + // device_t implementation virtual void device_start() override; virtual void device_reset() override; + // ns32000_slave_interface implementation + virtual void state_add(device_state_interface &parent, int &index) override; + + // slave interface handlers + template T read(); + template void write(T data); + + // execution helpers + bool decode(u8 const idbyte, u16 const opword); void execute(); + u16 status(int *icount); void complete(s32 param); + // register helpers + virtual void reg_get(unsigned const op_size, u64 &op_value, unsigned const reg) const = 0; + virtual void reg_set(unsigned const reg, unsigned const op_size, u64 const op_value) = 0; + private: emu_timer *m_complete; - // registers - u32 m_fsr; - u32 m_f[8]; + u32 m_fsr; // floating-point status register // operating state + u32 m_state; u8 m_idbyte; u16 m_opword; struct operand { - unsigned expected; - unsigned issued; + u32 expected; + u32 issued; u64 value; } m_op[3]; u16 m_status; + u32 m_tcy; +}; - // implementation state - unsigned m_state; - unsigned m_tcy; +class ns32081_device + : public ns32081_device_base + , public ns32000_slow_slave_interface +{ +public: + ns32081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + + // ns32000_slave_interface implementation + virtual void state_add(device_state_interface &parent, int &index) override; + + // ns32000_slow_slave_interface implementation + virtual u16 slow_status(int *icount = nullptr) override { return status(icount); } + virtual u16 slow_read() override { return read(); } + virtual void slow_write(u16 data) override { write(data); } + +protected: + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + // register helpers + virtual void reg_get(unsigned const op_size, u64 &op_value, unsigned const reg) const override; + virtual void reg_set(unsigned const reg, unsigned const op_size, u64 const op_value) override; + +private: + // registers + u32 m_f[8]; +}; + +class ns32381_device + : public ns32081_device_base + , public ns32000_slow_slave_interface + , public ns32000_fast_slave_interface +{ +public: + ns32381_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + + // ns32000_slave_interface implementation + virtual void state_add(device_state_interface &parent, int &index) override; + + // ns32000_slow_slave_interface implementation + virtual u16 slow_status(int *icount = nullptr) override { return status(icount); } + virtual u16 slow_read() override { return read(); } + virtual void slow_write(u16 data) override { write(data); } + + // ns32000_fast_slave_interface implementation + virtual u32 fast_status(int *icount = nullptr) override { return status(icount); } + virtual u32 fast_read() override { return read(); } + virtual void fast_write(u32 data) override { write(data); } + +protected: + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + // register helpers + virtual void reg_get(unsigned const op_size, u64 &op_value, unsigned const reg) const override; + virtual void reg_set(unsigned const reg, unsigned const op_size, u64 const op_value) override; + +private: + // registers + u64 m_l[8]; }; DECLARE_DEVICE_TYPE(NS32081, ns32081_device) +DECLARE_DEVICE_TYPE(NS32381, ns32381_device) #endif // MAME_MACHINE_NS32081_H diff --git a/src/devices/machine/ns32082.cpp b/src/devices/machine/ns32082.cpp index e58cf546e62f0..4fb26bf5219f1 100644 --- a/src/devices/machine/ns32082.cpp +++ b/src/devices/machine/ns32082.cpp @@ -34,11 +34,6 @@ enum state : unsigned RESULT = 6, // result word available }; -enum idbyte : u8 -{ - FORMAT_14 = 0x1e, -}; - enum reg_mask : unsigned { BPR0 = 0x0, // breakpoint register 0 @@ -127,8 +122,8 @@ enum eia_mask : u32 ns32082_device::ns32082_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, NS32082, tag, owner, clock) - , ns32000_slow_slave_interface(mconfig, *this) , ns32000_mmu_interface(mconfig, *this) + , ns32000_slow_slave_interface(mconfig, *this) , m_bpr{} , m_pf{} , m_sc(0) @@ -172,7 +167,7 @@ void ns32082_device::state_add(device_state_interface &parent, int &index) parent.state_add(index++, "MSR", m_msr).formatstr("%08X"); } -u16 ns32082_device::read_st(int *icount) +u16 ns32082_device::slow_status(int *icount) { if (m_state == STATUS) { @@ -181,63 +176,54 @@ u16 ns32082_device::read_st(int *icount) if (icount) *icount -= m_tcy; - LOG("read_st status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, + LOG("status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, (m_state == RESULT ? "results pending" : "complete"), machine().describe_context()); return m_status; } - logerror("read_st protocol error reading status word (%s)\n", machine().describe_context()); + logerror("status protocol error (%s)\n", machine().describe_context()); return 0; } -u16 ns32082_device::read_op() +u16 ns32082_device::slow_read() { if (m_state == RESULT && m_op[2].issued < m_op[2].expected) { u16 const data = u16(m_op[2].value >> (m_op[2].issued * 8)); - LOG("read_op word %d data 0x%04x (%s)\n", m_op[2].issued >> 1, data, machine().describe_context()); + LOG("read %d data 0x%04x (%s)\n", m_op[2].issued >> 1, data, machine().describe_context()); m_op[2].issued += 2; if (m_op[2].issued == m_op[2].expected) { - LOG("read_op last result word issued\n"); + LOG("read complete\n"); m_state = IDLE; } return data; } - logerror("read_op protocol error reading result word (%s)\n", machine().describe_context()); + logerror("read protocol error (%s)\n", machine().describe_context()); return 0; } -void ns32082_device::write_id(u16 data) -{ - bool const match = (data == FORMAT_14); - - if (match) - { - LOG("write_id match 0x%04x (%s)\n", data, machine().describe_context()); - m_state = OPERATION; - } - else - { - LOG("write_id ignore 0x%04x (%s)\n", data, machine().describe_context()); - m_state = IDLE; - } - - m_idbyte = u8(data); -} - -void ns32082_device::write_op(u16 data) +void ns32082_device::slow_write(u16 data) { switch (m_state) { + case IDLE: + LOG("write idbyte 0x%04x (%s)\n", data, machine().describe_context()); + if (data == FORMAT_14) + { + m_idbyte = u8(data); + m_state = OPERATION; + } + break; + case OPERATION: m_opword = swapendian_int16(data); - LOG("write_op opword 0x%04x (%s)\n", m_opword, machine().describe_context()); + LOG("write opword 0x%04x (%s)\n", m_opword, machine().describe_context()); m_tcy = 0; @@ -282,14 +268,16 @@ void ns32082_device::write_op(u16 data) unsigned const n = (m_op[0].issued < m_op[0].expected) ? 0 : 1; operand &op = m_op[n]; - LOG("write_op op%d data 0x%04x (%s)\n", n, data, machine().describe_context()); + LOG("write operand %d data 0x%04x (%s)\n", + n, data, machine().describe_context()); // insert word into operand value op.value |= u64(data) << (op.issued * 8); op.issued += 2; } else - logerror("write_op protocol error unexpected operand word 0x%04x (%s)\n", data, machine().describe_context()); + logerror("write protocol error unexpected operand data 0x%04x (%s)\n", + data, machine().describe_context()); break; } diff --git a/src/devices/machine/ns32082.h b/src/devices/machine/ns32082.h index 41986941bb2f8..b8232e2511617 100644 --- a/src/devices/machine/ns32082.h +++ b/src/devices/machine/ns32082.h @@ -10,24 +10,25 @@ class ns32082_device : public device_t - , public ns32000_slow_slave_interface , public ns32000_mmu_interface + , public ns32000_slow_slave_interface { public: ns32082_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + // ns32000_slave_interface implementation virtual void state_add(device_state_interface &parent, int &index) override; - virtual u16 read_st(int *icount = nullptr) override; - virtual u16 read_op() override; - - virtual void write_id(u16 data) override; - virtual void write_op(u16 data) override; + // ns32000_slow_slave_interface implementation + virtual u16 slow_status(int *icount = nullptr) override; + virtual u16 slow_read() override; + virtual void slow_write(u16 data) override; + // ns32000_mmu_interface implementation virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool pfs = false, bool suppress = false) override; protected: - // device_t overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -51,16 +52,16 @@ class ns32082_device u16 m_opword; struct operand { - unsigned expected; - unsigned issued; + u32 expected; + u32 issued; u64 value; } m_op[3]; u16 m_status; // implementation state - unsigned m_state; - unsigned m_tcy; + u32 m_state; + u32 m_tcy; }; DECLARE_DEVICE_TYPE(NS32082, ns32082_device) diff --git a/src/devices/machine/ns32382.cpp b/src/devices/machine/ns32382.cpp index 18250bb80dd51..105bc55b1a28c 100644 --- a/src/devices/machine/ns32382.cpp +++ b/src/devices/machine/ns32382.cpp @@ -2,7 +2,7 @@ // copyright-holders:Patrick Mackinlay /* - * National Semiconductor 32382 Memory Management Unit. + * National Semiconductor NS32382 Memory Management Unit. * * Sources: * - Microprocessor Databook, Series 32000, NSC800, 1989 Edition, National Semiconductor @@ -23,7 +23,7 @@ #include "logmacro.h" -DEFINE_DEVICE_TYPE(NS32382, ns32382_device, "ns32382", "National Semiconductor 32382 Memory Management Unit") +DEFINE_DEVICE_TYPE(NS32382, ns32382_device, "ns32382", "National Semiconductor NS32382 Memory Management Unit") enum state : unsigned { @@ -35,11 +35,6 @@ enum state : unsigned RESULT = 6, // result word available }; -enum idbyte : u8 -{ - FORMAT_14 = 0x1e, -}; - enum reg_mask : unsigned { BAR = 0x0, // breakpoint address register @@ -125,8 +120,8 @@ enum va_mask : u32 ns32382_device::ns32382_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, NS32382, tag, owner, clock) - , ns32000_fast_slave_interface(mconfig, *this) , ns32000_mmu_interface(mconfig, *this) + , ns32000_fast_slave_interface(mconfig, *this) { } @@ -165,7 +160,7 @@ void ns32382_device::state_add(device_state_interface &parent, int &index) parent.state_add(index++, "MSR", m_msr).formatstr("%08X"); } -u32 ns32382_device::read_st32(int *icount) +u32 ns32382_device::fast_status(int *icount) { if (m_state == STATUS) { @@ -174,48 +169,49 @@ u32 ns32382_device::read_st32(int *icount) if (icount) *icount -= m_tcy; - LOG("read_st status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, + LOG("status 0x%04x tcy %d %s (%s)\n", m_status, m_tcy, (m_state == RESULT ? "results pending" : "complete"), machine().describe_context()); return m_status; } - logerror("read_st protocol error reading status (%s)\n", machine().describe_context()); + logerror("status protocol error (%s)\n", machine().describe_context()); return 0; } -u32 ns32382_device::read() +u32 ns32382_device::fast_read() { if (m_state == RESULT && m_op[2].issued < m_op[2].expected) { u32 const data = u32(m_op[2].value >> (m_op[2].issued * 8)); - LOG("read_op dword %d data 0x%08x (%s)\n", m_op[2].issued >> 2, data, machine().describe_context()); + LOG("read %d data 0x%08x (%s)\n", m_op[2].issued >> 2, data, machine().describe_context()); m_op[2].issued += 4; if (m_op[2].issued == m_op[2].expected) { - LOG("read_op last result dword issued\n"); + LOG("read complete\n"); m_state = IDLE; } return data; } - logerror("read_op protocol error reading result dword (%s)\n", machine().describe_context()); + logerror("read protocol error (%s)\n", machine().describe_context()); return 0; } -void ns32382_device::write(u32 data) +void ns32382_device::fast_write(u32 data) { switch (m_state) { case IDLE: if (BIT(data, 24, 8) == FORMAT_14) { - LOG("write_fast match 0x%08x (%s)\n", data, machine().describe_context()); - m_opword = swapendian_int16(data >> 8); + + LOG("write idbyte 0x%02x opword 0x%04x (%s)\n", FORMAT_14, m_opword, machine().describe_context()); + m_tcy = 0; // initialize operands @@ -254,14 +250,15 @@ void ns32382_device::write(u32 data) unsigned const n = (m_op[0].issued < m_op[0].expected) ? 0 : 1; operand &op = m_op[n]; - LOG("write_op op%d data 0x%04x (%s)\n", n, data, machine().describe_context()); + LOG("write opword 0x%08x (%s)\n", data, machine().describe_context()); // insert dword into operand value op.value |= u64(data) << (op.issued * 8); op.issued += 4; } else - logerror("write_fast protocol error unexpected operand 0x%08x (%s)\n", data, machine().describe_context()); + logerror("write protocol error unexpected operand data 0x%08x (%s)\n", + data, machine().describe_context()); break; } @@ -274,7 +271,7 @@ void ns32382_device::execute() { m_status = 0; - // format 14: xxxx xsss s0oo ooii 0001 1110 + // format 14: xxxx xsss s0oo ooii unsigned const quick = BIT(m_opword, 7, 4); switch (BIT(m_opword, 2, 4)) diff --git a/src/devices/machine/ns32382.h b/src/devices/machine/ns32382.h index eea3a0ef7d43e..a60c6d27f5fbf 100644 --- a/src/devices/machine/ns32382.h +++ b/src/devices/machine/ns32382.h @@ -10,25 +10,25 @@ class ns32382_device : public device_t - , public ns32000_fast_slave_interface , public ns32000_mmu_interface + , public ns32000_fast_slave_interface { public: ns32382_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); - // ns32000_slave_interface overrides + // ns32000_slave_interface implementation virtual void state_add(device_state_interface &parent, int &index) override; - // ns32000_fast_slave_interface overrides - virtual u32 read_st32(int *icount = nullptr) override; - virtual void write(u32 data) override; - virtual u32 read() override; + // ns32000_fast_slave_interface implementation + virtual u32 fast_status(int *icount = nullptr) override; + virtual u32 fast_read() override; + virtual void fast_write(u32 data) override; - // ns32000_mmu_interface overrides + // ns32000_mmu_interface implementation virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool pfs = false, bool debug = false) override; protected: - // device_t overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/pc87306.cpp b/src/devices/machine/pc87306.cpp index bc26d2e5c8218..8512e44d084c2 100644 --- a/src/devices/machine/pc87306.cpp +++ b/src/devices/machine/pc87306.cpp @@ -1,13 +1,14 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese -/*************************************************************************** +/************************************************************************************************** National Semiconductor PC87306 Super I/O TODO: -- Barely enough to make it surpass POST test 0x05 in misc/odyssey.cpp +- Barely enough to make it surpass POST test 0x05 in misc/odyssey.cpp; +- COM1/COM2/LPT1 address and irq select; -***************************************************************************/ +**************************************************************************************************/ #include "emu.h" #include "bus/isa/isa.h" @@ -32,18 +33,19 @@ pc87306_device::pc87306_device(const machine_config &mconfig, const char *tag, d , m_space_config("superio_config_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(pc87306_device::config_map), this)) , m_kbdc(*this, "pc_kbdc") , m_rtc(*this, "rtc") - //, m_logical_view(*this, "logical_view") + , m_pc_com(*this, "uart%d", 0U) + , m_pc_lpt(*this, "lpta") , m_gp20_reset_callback(*this) , m_gp25_gatea20_callback(*this) , m_irq1_callback(*this) , m_irq8_callback(*this) , m_irq9_callback(*this) -// , m_txd1_callback(*this) -// , m_ndtr1_callback(*this) -// , m_nrts1_callback(*this) -// , m_txd2_callback(*this) -// , m_ndtr2_callback(*this) -// , m_nrts2_callback(*this) + , m_txd1_callback(*this) + , m_ndtr1_callback(*this) + , m_nrts1_callback(*this) + , m_txd2_callback(*this) + , m_ndtr2_callback(*this) + , m_nrts2_callback(*this) { } @@ -89,6 +91,21 @@ void pc87306_device::device_add_mconfig(machine_config &config) at_keyboard_device &at_keyb(AT_KEYB(config, "at_keyboard", pc_keyboard_device::KEYBOARD_TYPE::AT, 1)); at_keyb.keypress().set(m_kbdc, FUNC(kbdc8042_device::keyboard_w)); + + PC_LPT(config, m_pc_lpt); + m_pc_lpt->irq_handler().set(FUNC(pc87306_device::irq_parallel_w)); + + NS16550(config, m_pc_com[0], XTAL(1'843'200)); + m_pc_com[0]->out_int_callback().set(FUNC(pc87306_device::irq_serial1_w)); + m_pc_com[0]->out_tx_callback().set(FUNC(pc87306_device::txd_serial1_w)); + m_pc_com[0]->out_dtr_callback().set(FUNC(pc87306_device::dtr_serial1_w)); + m_pc_com[0]->out_rts_callback().set(FUNC(pc87306_device::rts_serial1_w)); + + NS16550(config, m_pc_com[1], XTAL(1'843'200)); + m_pc_com[1]->out_int_callback().set(FUNC(pc87306_device::irq_serial2_w)); + m_pc_com[1]->out_tx_callback().set(FUNC(pc87306_device::txd_serial2_w)); + m_pc_com[1]->out_dtr_callback().set(FUNC(pc87306_device::dtr_serial2_w)); + m_pc_com[1]->out_rts_callback().set(FUNC(pc87306_device::rts_serial2_w)); } void pc87306_device::remap(int space_id, offs_t start, offs_t end) @@ -107,6 +124,16 @@ void pc87306_device::remap(int space_id, offs_t start, offs_t end) if (BIT(m_krr, 3)) m_isa->install_device(0x70, 0x71, read8sm_delegate(*this, FUNC(pc87306_device::rtc_r)), write8sm_delegate(*this, FUNC(pc87306_device::rtc_w))); + + if (BIT(m_fer, 0)) + m_isa->install_device(0x378, 0x37f, read8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::read)), write8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::write))); + + if (BIT(m_fer, 1)) + m_isa->install_device(0x3f8, 0x3ff, read8sm_delegate(*m_pc_com[0], FUNC(ns16450_device::ins8250_r)), write8sm_delegate(*m_pc_com[0], FUNC(ns16450_device::ins8250_w))); + + if (BIT(m_fer, 2)) + m_isa->install_device(0x2f8, 0x2ff, read8sm_delegate(*m_pc_com[1], FUNC(ns16450_device::ins8250_r)), write8sm_delegate(*m_pc_com[1], FUNC(ns16450_device::ins8250_w))); + } } @@ -140,8 +167,8 @@ void pc87306_device::write(offs_t offset, u8 data) void pc87306_device::config_map(address_map &map) { -// map(0x00, 0x00) FER Function Enable Register -// map(0x01, 0x01) FAR Function Address Register + map(0x00, 0x00).rw(FUNC(pc87306_device::fer_r), FUNC(pc87306_device::fer_w)); + map(0x01, 0x01).rw(FUNC(pc87306_device::far_r), FUNC(pc87306_device::far_w)); // map(0x02, 0x02) PTR Power and Test Register // map(0x03, 0x03) FCR Function Control Register // map(0x04, 0x04) PCR Printer Control Register @@ -171,8 +198,49 @@ void pc87306_device::config_map(address_map &map) // map(0x1c, 0x1c) PNP1 Plug and Play Configuration 1 Register } -// [0x05] KRR KBC and RTC Control Register /* + * [0x00] FER Function Enable Register + * x--- ---- IDE address select + * -x-- ---- IDE i/f enable + * --x- ---- FDC address select + * ---x ---- (0) x2 floppy drives (1) x4 floppy drives + * ---- x--- FDC enable + * ---- -x-- UART2 enable + * ---- --x- UART1 enable + * ---- ---x Parallel Port enable + */ +u8 pc87306_device::fer_r(offs_t offset) +{ + return m_fer; +} + +void pc87306_device::fer_w(offs_t offset, u8 data) +{ + m_fer = data; + remap(AS_IO, 0, 0x400); +} + +/* + * [0x01] FAR Function Address Register + * xxxx ---- UART2 address select + * xx-- xx-- UART1 address select + * ---- --xx parallel address select + */ +u8 pc87306_device::far_r(offs_t offset) +{ + return m_far; +} + +void pc87306_device::far_w(offs_t offset, u8 data) +{ + m_far = data; + remap(AS_IO, 0, 0x400); +} + + +/* + * [0x05] KRR KBC and RTC Control Register + * * x--- ---- KBC clock source select (0) X1 clock (1) SYSCLK * --x- ---- RAMSREL RTC bank select * ---- x--- RTC enable bit @@ -254,6 +322,128 @@ void pc87306_device::irq_mouse_w(int state) request_irq(12, state ? ASSERT_LINE : CLEAR_LINE); } +/* + * Serial + */ + +void pc87306_device::irq_serial1_w(int state) +{ + if (!(BIT(m_fer, 1))) + return; + request_irq(3, state ? ASSERT_LINE : CLEAR_LINE); +} + +void pc87306_device::irq_serial2_w(int state) +{ + if (!(BIT(m_fer, 2))) + return; + request_irq(4, state ? ASSERT_LINE : CLEAR_LINE); +} + +void pc87306_device::txd_serial1_w(int state) +{ + if (!(BIT(m_fer, 1))) + return; + m_txd1_callback(state); +} + +void pc87306_device::txd_serial2_w(int state) +{ + if (!(BIT(m_fer, 2))) + return; + m_txd2_callback(state); +} + +void pc87306_device::dtr_serial1_w(int state) +{ + if (!(BIT(m_fer, 1))) + return; + m_ndtr1_callback(state); +} + +void pc87306_device::dtr_serial2_w(int state) +{ + if (!(BIT(m_fer, 2))) + return; + m_ndtr2_callback(state); +} + +void pc87306_device::rts_serial1_w(int state) +{ + if (!(BIT(m_fer, 1))) + return; + m_nrts1_callback(state); +} + +void pc87306_device::rts_serial2_w(int state) +{ + if (!(BIT(m_fer, 2))) + return; + m_nrts2_callback(state); +} + +void pc87306_device::rxd1_w(int state) +{ + m_pc_com[0]->rx_w(state); +} + +void pc87306_device::ndcd1_w(int state) +{ + m_pc_com[0]->dcd_w(state); +} + +void pc87306_device::ndsr1_w(int state) +{ + m_pc_com[0]->dsr_w(state); +} + +void pc87306_device::nri1_w(int state) +{ + m_pc_com[0]->ri_w(state); +} + +void pc87306_device::ncts1_w(int state) +{ + m_pc_com[0]->cts_w(state); +} + +void pc87306_device::rxd2_w(int state) +{ + m_pc_com[1]->rx_w(state); +} + +void pc87306_device::ndcd2_w(int state) +{ + m_pc_com[1]->dcd_w(state); +} + +void pc87306_device::ndsr2_w(int state) +{ + m_pc_com[1]->dsr_w(state); +} + +void pc87306_device::nri2_w(int state) +{ + m_pc_com[1]->ri_w(state); +} + +void pc87306_device::ncts2_w(int state) +{ + m_pc_com[1]->cts_w(state); +} + +/* + * Parallel + */ + +void pc87306_device::irq_parallel_w(int state) +{ + if (!(BIT(m_fer, 0))) + return; + request_irq(5, state ? ASSERT_LINE : CLEAR_LINE); +} + + void pc87306_device::request_irq(int irq, int state) { switch (irq) diff --git a/src/devices/machine/pc87306.h b/src/devices/machine/pc87306.h index 1ab9c5826277c..4b1256e1e5284 100644 --- a/src/devices/machine/pc87306.h +++ b/src/devices/machine/pc87306.h @@ -9,6 +9,8 @@ #include "bus/isa/isa.h" #include "machine/8042kbdc.h" #include "machine/ds128x.h" +#include "machine/ins8250.h" +#include "machine/pc_lpt.h" class pc87306_device : public device_t, public device_isa16_card_interface, @@ -25,12 +27,23 @@ class pc87306_device : public device_t, auto irq1() { return m_irq1_callback.bind(); } auto irq8() { return m_irq8_callback.bind(); } auto irq9() { return m_irq9_callback.bind(); } -// auto txd1() { return m_txd1_callback.bind(); } -// auto ndtr1() { return m_ndtr1_callback.bind(); } -// auto nrts1() { return m_nrts1_callback.bind(); } -// auto txd2() { return m_txd2_callback.bind(); } -// auto ndtr2() { return m_ndtr2_callback.bind(); } -// auto nrts2() { return m_nrts2_callback.bind(); } + auto txd1() { return m_txd1_callback.bind(); } + auto ndtr1() { return m_ndtr1_callback.bind(); } + auto nrts1() { return m_nrts1_callback.bind(); } + auto txd2() { return m_txd2_callback.bind(); } + auto ndtr2() { return m_ndtr2_callback.bind(); } + auto nrts2() { return m_nrts2_callback.bind(); } + + void rxd1_w(int state); + void ndcd1_w(int state); + void ndsr1_w(int state); + void nri1_w(int state); + void ncts1_w(int state); + void rxd2_w(int state); + void ndcd2_w(int state); + void ndsr2_w(int state); + void nri2_w(int state); + void ncts2_w(int state); protected: virtual void device_start() override; @@ -44,19 +57,20 @@ class pc87306_device : public device_t, required_device m_kbdc; required_device m_rtc; -// memory_view m_logical_view; + required_device_array m_pc_com; + required_device m_pc_lpt; devcb_write_line m_gp20_reset_callback; devcb_write_line m_gp25_gatea20_callback; devcb_write_line m_irq1_callback; devcb_write_line m_irq8_callback; devcb_write_line m_irq9_callback; -// devcb_write_line m_txd1_callback; -// devcb_write_line m_ndtr1_callback; -// devcb_write_line m_nrts1_callback; -// devcb_write_line m_txd2_callback; -// devcb_write_line m_ndtr2_callback; -// devcb_write_line m_nrts2_callback; + devcb_write_line m_txd1_callback; + devcb_write_line m_ndtr1_callback; + devcb_write_line m_nrts1_callback; + devcb_write_line m_txd2_callback; + devcb_write_line m_ndtr2_callback; + devcb_write_line m_nrts2_callback; void request_irq(int irq, int state); @@ -65,6 +79,12 @@ class pc87306_device : public device_t, void config_map(address_map &map); + u8 far_r(offs_t offset); + void far_w(offs_t offset, u8 data); + + u8 fer_r(offs_t offset); + void fer_w(offs_t offset, u8 data); + u8 keybc_status_r(offs_t offset); void keybc_command_w(offs_t offset, u8 data); u8 rtc_r(offs_t offset); @@ -79,10 +99,23 @@ class pc87306_device : public device_t, u8 krr_r(offs_t offset); void krr_w(offs_t offset, u8 data); + void irq_parallel_w(int state); + + void irq_serial1_w(int state); + void txd_serial1_w(int state); + void dtr_serial1_w(int state); + void rts_serial1_w(int state); + void irq_serial2_w(int state); + void txd_serial2_w(int state); + void dtr_serial2_w(int state); + void rts_serial2_w(int state); + u8 m_index = 0; u8 m_locked_state = 2; u8 m_krr = 0; + u8 m_fer = 0; + u8 m_far = 0; }; DECLARE_DEVICE_TYPE(PC87306, pc87306_device); diff --git a/src/devices/machine/sis5513_ide.cpp b/src/devices/machine/sis5513_ide.cpp index de0167fc5e7fc..f29c91fecf019 100644 --- a/src/devices/machine/sis5513_ide.cpp +++ b/src/devices/machine/sis5513_ide.cpp @@ -144,6 +144,7 @@ void sis5513_ide_device::device_reset() pci_device::device_reset(); command = 0x0000; + command_mask = 5; status = 0x0000; pclass = 0x01018a; m_ide_ctrl0 = 0; diff --git a/src/devices/machine/sis5513_ide.h b/src/devices/machine/sis5513_ide.h index 89d4916c47bd4..58a1ef0beb6ba 100644 --- a/src/devices/machine/sis5513_ide.h +++ b/src/devices/machine/sis5513_ide.h @@ -7,7 +7,7 @@ #pragma once #include "pci.h" -#include "machine/pci-ide.h" +#include "idectrl.h" class sis5513_ide_device : public pci_device { @@ -40,11 +40,6 @@ class sis5513_ide_device : public pci_device virtual void config_map(address_map &map) override; - void ide1_command_map(address_map &map); - void ide1_control_map(address_map &map); - void ide2_command_map(address_map &map); - void ide2_control_map(address_map &map); - void bus_master_ide_control_map(address_map &map); private: required_device m_ide1; required_device m_ide2; @@ -52,6 +47,12 @@ class sis5513_ide_device : public pci_device devcb_write_line m_irq_sec_callback; required_address_space m_bus_master_space; + void ide1_command_map(address_map &map); + void ide1_control_map(address_map &map); + void ide2_command_map(address_map &map); + void ide2_control_map(address_map &map); + void bus_master_ide_control_map(address_map &map); + bool ide1_mode(); bool ide2_mode(); diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index 45cc3c9ae664a..bc2f52e547d28 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -34,6 +34,7 @@ void sis85c496_host_device::config_map(address_map &map) ); map(0x58, 0x59).rw(FUNC(sis85c496_host_device::ide_vesa_config_r), FUNC(sis85c496_host_device::ide_vesa_config_w)); map(0x5a, 0x5a).rw(FUNC(sis85c496_host_device::smram_ctrl_r), FUNC(sis85c496_host_device::smram_ctrl_w)); + map(0xc0, 0xc3).rw(FUNC(sis85c496_host_device::pirqrc_r), FUNC(sis85c496_host_device::pirqrc_w)); map(0xc8, 0xcb).rw(FUNC(sis85c496_host_device::mailbox_r), FUNC(sis85c496_host_device::mailbox_w)); map(0xd0, 0xd0).rw(FUNC(sis85c496_host_device::bios_config_r), FUNC(sis85c496_host_device::bios_config_w)); map(0xd1, 0xd1).rw(FUNC(sis85c496_host_device::isa_decoder_r), FUNC(sis85c496_host_device::isa_decoder_w)); @@ -43,14 +44,15 @@ void sis85c496_host_device::internal_io_map(address_map &map) { pci_host_device::io_configuration_access_map(map); map(0x0000, 0x001f).rw("dma8237_1", FUNC(am9517a_device::read), FUNC(am9517a_device::write)); - map(0x0020, 0x003f).rw("pic8259_master", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0x0020, 0x0021).rw("pic8259_master", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); +// map(0x0022, 0x0023) 85C497 super I/O map(0x0040, 0x005f).rw("pit8254", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); map(0x0060, 0x0063).rw(FUNC(sis85c496_host_device::at_keybc_r), FUNC(sis85c496_host_device::at_keybc_w)); map(0x0064, 0x0067).rw("keybc", FUNC(at_keyboard_controller_device::status_r), FUNC(at_keyboard_controller_device::command_w)); - map(0x0070, 0x007f).w(FUNC(sis85c496_host_device::rtc_nmi_w)).umask32(0x00ff00ff); - map(0x0070, 0x007f).rw("rtc", FUNC(ds12885_device::data_r), FUNC(ds12885_device::data_w)).umask32(0xff00ff00); + map(0x0070, 0x0070).lr8(NAME([this] () { return m_ds12885->get_address(); })).w(FUNC(sis85c496_host_device::rtc_address_nmi_w)); + map(0x0071, 0x0071).rw("rtc", FUNC(ds12885_device::data_r), FUNC(ds12885_device::data_w)); map(0x0080, 0x009f).rw(FUNC(sis85c496_host_device::at_page8_r), FUNC(sis85c496_host_device::at_page8_w)); - map(0x00a0, 0x00bf).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0x00a0, 0x00a1).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); map(0x00c0, 0x00df).rw(FUNC(sis85c496_host_device::at_dma8237_2_r), FUNC(sis85c496_host_device::at_dma8237_2_w)); map(0x00e0, 0x00ef).noprw(); } @@ -127,6 +129,25 @@ void sis85c496_host_device::device_add_mconfig(machine_config &config) ISA16(config, m_isabus, 0); m_isabus->set_memspace(m_maincpu, AS_PROGRAM); m_isabus->set_iospace(m_maincpu, AS_IO); + m_isabus->irq3_callback().set(FUNC(sis85c496_host_device::pc_irq3_w)); + m_isabus->irq4_callback().set(FUNC(sis85c496_host_device::pc_irq4_w)); + m_isabus->irq5_callback().set(FUNC(sis85c496_host_device::pc_irq5_w)); + m_isabus->irq6_callback().set(FUNC(sis85c496_host_device::pc_irq6_w)); + m_isabus->irq7_callback().set(FUNC(sis85c496_host_device::pc_irq7_w)); + m_isabus->irq2_callback().set(FUNC(sis85c496_host_device::pc_irq9_w)); + m_isabus->irq10_callback().set(FUNC(sis85c496_host_device::pc_irq10_w)); + m_isabus->irq11_callback().set(FUNC(sis85c496_host_device::pc_irq11_w)); + m_isabus->irq12_callback().set(FUNC(sis85c496_host_device::pc_irq12m_w)); + m_isabus->irq14_callback().set(FUNC(sis85c496_host_device::pc_irq14_w)); + m_isabus->irq15_callback().set(FUNC(sis85c496_host_device::pc_irq15_w)); + m_isabus->drq0_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq0_w)); + m_isabus->drq1_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq1_w)); + m_isabus->drq2_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq2_w)); + m_isabus->drq3_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq3_w)); + m_isabus->drq5_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq1_w)); + m_isabus->drq6_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq2_w)); + m_isabus->drq7_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq3_w)); + m_isabus->iochck_callback().set(FUNC(sis85c496_host_device::iochck_w)); IDE_CONTROLLER_32(config, m_ide[0]).options(ata_devices, "hdd", nullptr, false); m_ide[0]->irq_handler().set(m_pic8259_slave, FUNC(pic8259_device::ir6_w)); @@ -174,6 +195,9 @@ void sis85c496_host_device::device_start() set_spaces(&m_maincpu->space(AS_PROGRAM), &m_maincpu->space(AS_IO)); + m_pci_root->set_pin_mapper(pci_pin_mapper(*this, FUNC(sis85c496_host_device::pin_mapper))); + m_pci_root->set_irq_handler(pci_irq_handler(*this, FUNC(sis85c496_host_device::irq_handler))); + memory_window_start = 0; memory_window_end = 0xffffffff; memory_offset = 0; @@ -215,6 +239,8 @@ void sis85c496_host_device::device_reset() m_shadctrl = 0; m_smramctrl = 0; m_ide_vesa_ctrl = 0; + + memset(m_pirqrc, 0x80, sizeof(m_pirqrc)); } void sis85c496_host_device::device_config_complete() @@ -562,6 +588,129 @@ void sis85c496_host_device::pc_dack5_w(int state) { pc_select_dma_channel(5, sta void sis85c496_host_device::pc_dack6_w(int state) { pc_select_dma_channel(6, state); } void sis85c496_host_device::pc_dack7_w(int state) { pc_select_dma_channel(7, state); } +void sis85c496_host_device::pc_irq1_w(int state) { m_pic8259_master->ir1_w(state); } +void sis85c496_host_device::pc_irq3_w(int state) { m_pic8259_master->ir3_w(state); } +void sis85c496_host_device::pc_irq4_w(int state) { m_pic8259_master->ir4_w(state); } +void sis85c496_host_device::pc_irq5_w(int state) { m_pic8259_master->ir5_w(state); } +void sis85c496_host_device::pc_irq6_w(int state) { m_pic8259_master->ir6_w(state); } +void sis85c496_host_device::pc_irq7_w(int state) { m_pic8259_master->ir7_w(state); } +void sis85c496_host_device::pc_irq8n_w(int state) { m_pic8259_slave->ir0_w(state); } +void sis85c496_host_device::pc_irq9_w(int state) { m_pic8259_slave->ir1_w(state); } +void sis85c496_host_device::pc_irq10_w(int state) { m_pic8259_slave->ir2_w(state); } +void sis85c496_host_device::pc_irq11_w(int state) { m_pic8259_slave->ir3_w(state); } +void sis85c496_host_device::pc_irq12m_w(int state) { m_pic8259_slave->ir4_w(state); } +void sis85c496_host_device::pc_irq14_w(int state) { m_pic8259_slave->ir6_w(state); } +void sis85c496_host_device::pc_irq15_w(int state) { m_pic8259_slave->ir7_w(state); } + +uint8_t sis85c496_host_device::pirqrc_r(offs_t offset) +{ + return m_pirqrc[offset]; +} + +void sis85c496_host_device::pirqrc_w(offs_t offset, uint8_t data) +{ + m_pirqrc[offset] = data; + logerror("pirqrc[%d] = %02x\n", offset, m_pirqrc[offset]); +} + +int sis85c496_host_device::pin_mapper(int pin) +{ + if(pin < 0 || pin >= 4 || (m_pirqrc[pin] & 0x80)) + return -1; + return m_pirqrc[pin]; +} + +void sis85c496_host_device::irq_handler(int line, int state) +{ + if(line < 0 && line >= 16) + return; + + logerror("irq_handler %d %d\n", line, state); + redirect_irq(line, state); +} + +void sis85c496_host_device::pc_pirqa_w(int state) +{ + int irq = m_pirqrc[0] & 15; + + if (!(BIT(m_pirqrc[0], 7))) + return; + redirect_irq(irq, state); +} + +void sis85c496_host_device::pc_pirqb_w(int state) +{ + int irq = m_pirqrc[1] & 15; + + if (!(BIT(m_pirqrc[1], 7))) + return; + redirect_irq(irq, state); +} + +void sis85c496_host_device::pc_pirqc_w(int state) +{ + int irq = m_pirqrc[2] & 15; + + if (!(BIT(m_pirqrc[2], 7))) + return; + redirect_irq(irq, state); +} + +void sis85c496_host_device::pc_pirqd_w(int state) +{ + int irq = m_pirqrc[3] & 15; + + if (!(BIT(m_pirqrc[3], 7))) + return; + redirect_irq(irq, state); +} + +void sis85c496_host_device::redirect_irq(int irq, int state) +{ + switch (irq) + { + case 0: + case 1: + case 2: + case 8: + case 13: + break; + case 3: + m_pic8259_master->ir3_w(state); + break; + case 4: + m_pic8259_master->ir4_w(state); + break; + case 5: + m_pic8259_master->ir5_w(state); + break; + case 6: + m_pic8259_master->ir6_w(state); + break; + case 7: + m_pic8259_master->ir7_w(state); + break; + case 9: + m_pic8259_slave->ir1_w(state); + break; + case 10: + m_pic8259_slave->ir2_w(state); + break; + case 11: + m_pic8259_slave->ir3_w(state); + break; + case 12: + m_pic8259_slave->ir4_w(state); + break; + case 14: + m_pic8259_slave->ir6_w(state); + break; + case 15: + m_pic8259_slave->ir7_w(state); + break; + } +} + uint8_t sis85c496_host_device::at_portb_r() { uint8_t data = m_at_speaker; @@ -584,17 +733,24 @@ void sis85c496_host_device::at_portb_w(uint8_t data) m_pit8254->write_gate2(BIT(data, 0)); at_speaker_set_spkrdata( BIT(data, 1)); m_channel_check = BIT(data, 3); - //m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0)); + if (m_channel_check) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); +} + +void sis85c496_host_device::iochck_w(int state) +{ + if (!state && !m_channel_check && m_nmi_enabled) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } uint8_t sis85c496_host_device::at_dma8237_2_r(offs_t offset) { - return m_dma8237_2->read( offset / 2); + return m_dma8237_2->read(offset / 2); } void sis85c496_host_device::at_dma8237_2_w(offs_t offset, uint8_t data) { - m_dma8237_2->write( offset / 2, data); + m_dma8237_2->write(offset / 2, data); } uint8_t sis85c496_host_device::at_keybc_r(offs_t offset) @@ -617,10 +773,9 @@ void sis85c496_host_device::at_keybc_w(offs_t offset, uint8_t data) } } - -void sis85c496_host_device::rtc_nmi_w(uint8_t data) +void sis85c496_host_device::rtc_address_nmi_w(uint8_t data) { - m_nmi_enabled = BIT(data,7); + m_nmi_enabled = BIT(data, 7); //m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0)); m_ds12885->address_w(data); } diff --git a/src/devices/machine/sis85c496.h b/src/devices/machine/sis85c496.h index 1636b2177e0bd..47cb0729655bb 100644 --- a/src/devices/machine/sis85c496.h +++ b/src/devices/machine/sis85c496.h @@ -46,6 +46,25 @@ class sis85c496_host_device : public pci_host_device { void set_cpu_tag(const char *tag); void set_ram_size(int ram_size); + void pc_pirqa_w(int state); + void pc_pirqb_w(int state); + void pc_pirqc_w(int state); + void pc_pirqd_w(int state); + + void pc_irq1_w(int state); + void pc_irq3_w(int state); + void pc_irq4_w(int state); + void pc_irq5_w(int state); + void pc_irq6_w(int state); + void pc_irq7_w(int state); + void pc_irq8n_w(int state); + void pc_irq9_w(int state); + void pc_irq10_w(int state); + void pc_irq11_w(int state); + void pc_irq12m_w(int state); + void pc_irq14_w(int state); + void pc_irq15_w(int state); + protected: virtual void device_start() override; virtual void device_reset() override; @@ -90,6 +109,8 @@ class sis85c496_host_device : public pci_host_device { uint8_t m_channel_check; uint8_t m_nmi_enabled; + uint8_t m_pirqrc[4]; + int ram_size; std::vector ram; uint32_t m_mailbox; @@ -150,15 +171,24 @@ class sis85c496_host_device : public pci_host_device { void pc_dack7_w(int state); uint8_t at_dma8237_2_r(offs_t offset); void at_dma8237_2_w(offs_t offset, uint8_t data); + void iochck_w(int state); uint8_t at_keybc_r(offs_t offset); void at_keybc_w(offs_t offset, uint8_t data); - void rtc_nmi_w(uint8_t data); + u8 rtc_address_r(); + void rtc_address_nmi_w(uint8_t data); uint8_t pc_dma_read_byte(offs_t offset); void pc_dma_write_byte(offs_t offset, uint8_t data); uint8_t pc_dma_read_word(offs_t offset); void pc_dma_write_word(offs_t offset, uint8_t data); void cpu_a20_w(int state); void cpu_reset_w(int state); + + uint8_t pirqrc_r(offs_t offset); + void pirqrc_w(offs_t offset, uint8_t data); + void redirect_irq(int irq, int state); + + int pin_mapper(int pin); + void irq_handler(int line, int state); }; DECLARE_DEVICE_TYPE(SIS85C496_HOST, sis85c496_host_device) diff --git a/src/devices/machine/spi_sdcard.cpp b/src/devices/machine/spi_sdcard.cpp index 57ef4e8796994..5ceb121108cfb 100644 --- a/src/devices/machine/spi_sdcard.cpp +++ b/src/devices/machine/spi_sdcard.cpp @@ -34,8 +34,8 @@ #define LOG_COMMAND (1U << 1) #define LOG_SPI (1U << 2) -//#define VERBOSE (LOG_COMMAND) -#define LOG_OUTPUT_FUNC osd_printf_info +//#define VERBOSE (LOG_GENERAL | LOG_COMMAND) +//#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" @@ -259,8 +259,43 @@ void spi_sdcard_device::do_command() break; case 9: // CMD9 - SEND_CSD - m_data[0] = 0x00; // TODO - send_data(1, SD_STATE_STBY); + m_data[0] = 0x00; + m_data[1] = 0xff; + m_data[2] = 0xfe; + + //if (m_type == SD_TYPE_V2) // CSD Version 1.0 + { + u8 block_len = 9; + for (auto i = m_blksize >> 10; i; i >>= 1, ++block_len); + + m_data[3] = 0x00; // 127: CSD_STRUCTURE:2 (00b) 0:6 + m_data[4] = 0x0e; // 119: TAAC:8 + m_data[5] = 0x00; // 111: NSAC:8 + m_data[6] = 0x32; // 103: TRAN_SPEED:8 (32h or 5Ah) + m_data[7] = 0x5b; // 95: CCC:12 (01x110110101b) + m_data[8] = 0x50; // .. READ_BL_LN:4 + m_data[8] |= block_len; + m_data[9] = 0x83; // 79: READ_BL_PARTIAL:1 (1b) WRITE_BLK_MISALIGN:1 READ_BLK_MISALIGN:1 DSR_IMP:1 0:2 C_SIZE:12 + m_data[10] = 0xff; // .. + m_data[11] = 0xed; // .. VDD_R_CURR_MIN:3 VDD_R_CURR_MAX:3 + m_data[12] = 0xb7; // 55: VDD_W_CURR_MIN:3 VDD_W_CURR_MAX:3 C_SIZE_MUL:3 + m_data[13] = 0xbf; // .. ERASE_BLK_EN:1 SECTOR_SIZE:7 + m_data[14] = 0xbf; // .. WP_GRP_SIZE:7 + m_data[15] = 0x04; // 31: WP_GRP_ENABLE:1 0:2 R2W_FACTOR:3 WRITE_BL_LEN:4 + m_data[15] |= (block_len >> 2); + m_data[16] = 0x00; /// .. WRITE_BL_PARTIAL:1 0:5 + m_data[16] |= (block_len & 3) << 6; + m_data[17] = 0x00; // 15: FILE_FORMAT_GRP:1 COPY:1 PERM_WRITE_PROTECT:1 TMP_WRITE_PROTECT:1 FILE_FORMAT:2 WP_UPC:1 0:1 + m_data[18] = 0x01; // 7: CRC7 1:1 + } + /* + else // SD_TYPE_HC: CSD Version 2.0 + { + m_data[3] = 0x40; + } + */ + + send_data(3 + 16, SD_STATE_STBY); break; case 10: // CMD10 - SEND_CID diff --git a/src/devices/machine/w83787f.cpp b/src/devices/machine/w83787f.cpp new file mode 100644 index 0000000000000..03ea4d935442d --- /dev/null +++ b/src/devices/machine/w83787f.cpp @@ -0,0 +1,346 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +Winbond W83787IF / W83787F + +'F is the base, 'IF adds IrDA. +Looks similar in design to National PC87306 (including similar reg names) + +**************************************************************************************************/ + +#include "emu.h" +#include "bus/isa/isa.h" +#include "machine/w83787f.h" + +#define LOG_WARN (1U << 1) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) + +DEFINE_DEVICE_TYPE(W83787F, w83787f_device, "w83787f", "National Semiconductor W83787F Super I/O Enhanced Sidewinder Lite") + +w83787f_device::w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, W83787F, tag, owner, clock) + , device_isa16_card_interface(mconfig, *this) + , device_memory_interface(mconfig, *this) + , m_space_config("superio_config_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(w83787f_device::config_map), this)) + , m_pc_com(*this, "uart%d", 0U) + , m_pc_lpt(*this, "lpta") + , m_irq1_callback(*this) + , m_irq8_callback(*this) + , m_irq9_callback(*this) + , m_txd1_callback(*this) + , m_ndtr1_callback(*this) + , m_nrts1_callback(*this) + , m_txd2_callback(*this) + , m_ndtr2_callback(*this) + , m_nrts2_callback(*this) +{ } + + +void w83787f_device::device_start() +{ + set_isa_device(); + //m_isa->set_dma_channel(0, this, true); + //m_isa->set_dma_channel(1, this, true); + //m_isa->set_dma_channel(2, this, true); + //m_isa->set_dma_channel(3, this, true); + remap(AS_IO, 0, 0x400); +} + +void w83787f_device::device_reset() +{ + m_locked_state = true; + m_cr1 = 0; +} + +device_memory_interface::space_config_vector w83787f_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(0, &m_space_config) + }; +} + +void w83787f_device::device_add_mconfig(machine_config &config) +{ + PC_LPT(config, m_pc_lpt); + m_pc_lpt->irq_handler().set(FUNC(w83787f_device::irq_parallel_w)); + + NS16550(config, m_pc_com[0], XTAL(1'843'200)); + m_pc_com[0]->out_int_callback().set(FUNC(w83787f_device::irq_serial1_w)); + m_pc_com[0]->out_tx_callback().set(FUNC(w83787f_device::txd_serial1_w)); + m_pc_com[0]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial1_w)); + m_pc_com[0]->out_rts_callback().set(FUNC(w83787f_device::rts_serial1_w)); + + NS16550(config, m_pc_com[1], XTAL(1'843'200)); + m_pc_com[1]->out_int_callback().set(FUNC(w83787f_device::irq_serial2_w)); + m_pc_com[1]->out_tx_callback().set(FUNC(w83787f_device::txd_serial2_w)); + m_pc_com[1]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial2_w)); + m_pc_com[1]->out_rts_callback().set(FUNC(w83787f_device::rts_serial2_w)); +} + +void w83787f_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_IO) + { + m_isa->install_device(0x0250, 0x0252, read8sm_delegate(*this, FUNC(w83787f_device::read)), write8sm_delegate(*this, FUNC(w83787f_device::write))); + + //if (BIT(m_fer, 0)) + const u8 lpt_setting = (m_cr1 >> 4) & 3; + if (lpt_setting != 3) + { + const u16 lpt_port[3] = { 0x3bc, 0x278, 0x378 }; + const u16 lpt_addr = lpt_port[lpt_setting & 3]; + LOG("Map LPT1 to I/O port %04x-%04x\n", lpt_addr, lpt_addr + 3); + + m_isa->install_device(lpt_addr, lpt_addr + 3, read8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::read)), write8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::write))); + } + + for (int i = 0; i < 2; i++) + { + const u8 uart_setting = (BIT(m_cr1, 2 + i) >> 1) | (BIT(m_cr1, i)); + if (uart_setting != 3) + { + const u16 uart_port[3] = { 0x2e8, 0x3e8, 0x3f8 }; + const u16 uart_addr = uart_port[uart_setting & 3] ^ (i ? 0x100 : 0x000); + LOG("Map UART%c to I/O port %04x-%04x\n", i ? 'A' : 'B', uart_addr, uart_addr + 7); + m_isa->install_device(uart_addr, uart_addr + 7, read8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_r)), write8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_w))); + } + } + } +} + +u8 w83787f_device::read(offs_t offset) +{ + if (offset != 2 && !machine().side_effects_disabled()) + { + LOGWARN("Invalid %s access read\n", offset & 1 ? "EFIR" : "EFIR"); + return space().unmap(); + } + + if (m_locked_state) + return space().unmap(); + + return space().read_byte(m_index); +} + +void w83787f_device::write(offs_t offset, u8 data) +{ + switch (offset) + { + // EFER + // TODO: 0x89 with GMRD# pin + case 0: m_locked_state = (data != 0x88); break; + // EFIR + case 1: m_index = data; break; + // EFDR + case 2: + if (!m_locked_state) + space().write_byte(m_index, data); + break; + } +} + +// none of these regs have a real naming, they are all CR* +void w83787f_device::config_map(address_map &map) +{ +// map(0x00, 0x00) IDE & FDC + map(0x01, 0x01).lrw8( + NAME([this] (offs_t offset) { + return m_cr1; + }), + NAME([this] (offs_t offset, u8 data) { + m_cr1 = data; + remap(AS_IO, 0, 0x400); + }) + ); +// map(0x02, 0x02) extension adapter mode +// map(0x03, 0x03) game port, UART clocks +// map(0x04, 0x04) game port, UARTA/B power-down tristate +// map(0x05, 0x05) ECP FIFO threshold +// map(0x06, 0x06) 2x / x4 FDD select, FDC power-down tristate, IDE power-down tristate +// map(0x07, 0x07) FDDs type +// map(0x08, 0x08) automatic power-down, FDD write protect +// map(0x09, 0x09) CHIP ID, lock alias, operating mode +// map(0x0a, 0x0a) LPT pins +// map(0x0c, 0x0c) UARTA/B clock source, lock select +// map(0x0d, 0x0d) IrDA select +// map(0x0e, 0x0f) +// map(0x10, 0x10) GIO0 address select 7-0 +// map(0x11, 0x11) GIO0 address select 10-8, GI0 address MODE0-1 +// map(0x12, 0x12) GIO1 address select 7-0 +// map(0x13, 0x13) GIO1 address select 10-8, GI0 address MODE0-1 +// map(0x14, 0x14) GIO0 ddr/mode +// map(0x15, 0x15) GIO1 ddr/mode +} + +/* + * Serial + */ + +void w83787f_device::irq_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + request_irq(3, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::irq_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + request_irq(4, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::txd_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_txd1_callback(state); +} + +void w83787f_device::txd_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_txd2_callback(state); +} + +void w83787f_device::dtr_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_ndtr1_callback(state); +} + +void w83787f_device::dtr_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_ndtr2_callback(state); +} + +void w83787f_device::rts_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_nrts1_callback(state); +} + +void w83787f_device::rts_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_nrts2_callback(state); +} + +void w83787f_device::rxd1_w(int state) +{ + m_pc_com[0]->rx_w(state); +} + +void w83787f_device::ndcd1_w(int state) +{ + m_pc_com[0]->dcd_w(state); +} + +void w83787f_device::ndsr1_w(int state) +{ + m_pc_com[0]->dsr_w(state); +} + +void w83787f_device::nri1_w(int state) +{ + m_pc_com[0]->ri_w(state); +} + +void w83787f_device::ncts1_w(int state) +{ + m_pc_com[0]->cts_w(state); +} + +void w83787f_device::rxd2_w(int state) +{ + m_pc_com[1]->rx_w(state); +} + +void w83787f_device::ndcd2_w(int state) +{ + m_pc_com[1]->dcd_w(state); +} + +void w83787f_device::ndsr2_w(int state) +{ + m_pc_com[1]->dsr_w(state); +} + +void w83787f_device::nri2_w(int state) +{ + m_pc_com[1]->ri_w(state); +} + +void w83787f_device::ncts2_w(int state) +{ + m_pc_com[1]->cts_w(state); +} + +/* + * Parallel + */ + +void w83787f_device::irq_parallel_w(int state) +{ + if ((m_cr1 & 0x30) == 0x30) + return; + request_irq(5, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::request_irq(int irq, int state) +{ + switch (irq) + { + case 1: + m_irq1_callback(state); + break; + case 3: + m_isa->irq3_w(state); + break; + case 4: + m_isa->irq4_w(state); + break; + case 5: + m_isa->irq5_w(state); + break; + case 6: + m_isa->irq6_w(state); + break; + case 7: + m_isa->irq7_w(state); + break; + case 8: + m_irq8_callback(state); + break; + case 9: + m_irq9_callback(state); + break; + case 10: + m_isa->irq10_w(state); + break; + case 11: + m_isa->irq11_w(state); + break; + case 12: + m_isa->irq12_w(state); + break; + case 14: + m_isa->irq14_w(state); + break; + case 15: + m_isa->irq15_w(state); + break; + } +} diff --git a/src/devices/machine/w83787f.h b/src/devices/machine/w83787f.h new file mode 100644 index 0000000000000..3fa9e6e4b8c50 --- /dev/null +++ b/src/devices/machine/w83787f.h @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese + +#ifndef MAME_MACHINE_W83787F_H +#define MAME_MACHINE_W83787F_H + +#pragma once + +#include "bus/isa/isa.h" +#include "machine/ins8250.h" +#include "machine/pc_lpt.h" + +class w83787f_device : public device_t, + public device_isa16_card_interface, + public device_memory_interface +{ +public: + w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ~w83787f_device() {} + + void remap(int space_id, offs_t start, offs_t end) override; + +// auto gp20_reset() { return m_gp20_reset_callback.bind(); } +// auto gp25_gatea20() { return m_gp25_gatea20_callback.bind(); } + auto irq1() { return m_irq1_callback.bind(); } + auto irq8() { return m_irq8_callback.bind(); } + auto irq9() { return m_irq9_callback.bind(); } + auto txd1() { return m_txd1_callback.bind(); } + auto ndtr1() { return m_ndtr1_callback.bind(); } + auto nrts1() { return m_nrts1_callback.bind(); } + auto txd2() { return m_txd2_callback.bind(); } + auto ndtr2() { return m_ndtr2_callback.bind(); } + auto nrts2() { return m_nrts2_callback.bind(); } + + void rxd1_w(int state); + void ndcd1_w(int state); + void ndsr1_w(int state); + void nri1_w(int state); + void ncts1_w(int state); + void rxd2_w(int state); + void ndcd2_w(int state); + void ndsr2_w(int state); + void nri2_w(int state); + void ncts2_w(int state); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + virtual space_config_vector memory_space_config() const override; + virtual void device_add_mconfig(machine_config &config) override; + +private: + const address_space_config m_space_config; + + required_device_array m_pc_com; + required_device m_pc_lpt; + + devcb_write_line m_irq1_callback; + devcb_write_line m_irq8_callback; + devcb_write_line m_irq9_callback; + devcb_write_line m_txd1_callback; + devcb_write_line m_ndtr1_callback; + devcb_write_line m_nrts1_callback; + devcb_write_line m_txd2_callback; + devcb_write_line m_ndtr2_callback; + devcb_write_line m_nrts2_callback; + + void request_irq(int irq, int state); + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + + void config_map(address_map &map); + + void irq_parallel_w(int state); + + void irq_serial1_w(int state); + void txd_serial1_w(int state); + void dtr_serial1_w(int state); + void rts_serial1_w(int state); + void irq_serial2_w(int state); + void txd_serial2_w(int state); + void dtr_serial2_w(int state); + void rts_serial2_w(int state); + + u8 m_index = 0; + + bool m_locked_state = true; + u8 m_cr1 = 0; +}; + +DECLARE_DEVICE_TYPE(W83787F, w83787f_device); + +#endif // MAME_MACHINE_W83787F_H diff --git a/src/devices/sound/okim6258.cpp b/src/devices/sound/okim6258.cpp index 349fe9ca13c91..171100e208097 100644 --- a/src/devices/sound/okim6258.cpp +++ b/src/devices/sound/okim6258.cpp @@ -2,15 +2,15 @@ // copyright-holders:Barry Rodewald /********************************************************************************************** * - * OKI MSM6258 ADPCM + * OKI MSM6258 ADPCM Speech Processor * * TODO: - * 3-bit ADPCM support - * Recording? + * - 3-bit ADPCM support + * - Use okiadpcm.* helper? + * - Recording? * **********************************************************************************************/ - #include "emu.h" #include "okim6258.h" @@ -46,19 +46,19 @@ DEFINE_DEVICE_TYPE(OKIM6258, okim6258_device, "okim6258", "OKI MSM6258 ADPCM") // okim6258_device - constructor //------------------------------------------------- -okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, OKIM6258, tag, owner, clock), - device_sound_interface(mconfig, *this), - m_status(0), - m_start_divider(0), - m_divider(512), - m_adpcm_type(0), - m_data_in(0), - m_nibble_shift(0), - m_stream(nullptr), - m_output_bits(0), - m_signal(0), - m_step(0) +okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, OKIM6258, tag, owner, clock), + device_sound_interface(mconfig, *this), + m_status(0), + m_start_divider(0), + m_divider(512), + m_adpcm_type(0), + m_data_in(0), + m_nibble_shift(0), + m_stream(nullptr), + m_output_bits(0), + m_signal(0), + m_step(0) { } @@ -93,7 +93,7 @@ static void compute_tables() for (nib = 0; nib < 16; nib++) { diff_lookup[step*16 + nib] = nbl2bit[nib][0] * - (stepval * nbl2bit[nib][1] + + (stepval * nbl2bit[nib][1] + stepval/2 * nbl2bit[nib][2] + stepval/4 * nbl2bit[nib][3] + stepval/8); @@ -119,7 +119,13 @@ void okim6258_device::device_start() m_signal = -2; m_step = 0; - state_save_register(); + // register for savestates + save_item(NAME(m_status)); + save_item(NAME(m_divider)); + save_item(NAME(m_data_in)); + save_item(NAME(m_nibble_shift)); + save_item(NAME(m_signal)); + save_item(NAME(m_step)); } @@ -171,25 +177,6 @@ void okim6258_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; private: - void state_save_register(); int16_t clock_adpcm(uint8_t nibble); uint8_t m_status; uint32_t m_start_divider; - uint32_t m_divider; /* master clock divider */ - uint8_t m_adpcm_type; /* 3/4 bit ADPCM select */ - uint8_t m_data_in; /* ADPCM data-in register */ - uint8_t m_nibble_shift; /* nibble select */ - sound_stream *m_stream; /* which stream are we playing on? */ - - uint8_t m_output_bits; /* D/A precision is 10-bits but 12-bit data can be - output serially to an external DAC */ + uint32_t m_divider; // master clock divider + uint8_t m_adpcm_type; // 3/4 bit ADPCM select + uint8_t m_data_in; // ADPCM data-in register + uint8_t m_nibble_shift; // nibble select + sound_stream *m_stream; // which stream are we playing on? + + uint8_t m_output_bits; // D/A precision is 10-bits but 12-bit data can be output serially to an external DAC int32_t m_signal; int32_t m_step; diff --git a/src/devices/sound/okim6588.cpp b/src/devices/sound/okim6588.cpp new file mode 100644 index 0000000000000..84b1a9a303380 --- /dev/null +++ b/src/devices/sound/okim6588.cpp @@ -0,0 +1,230 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + +OKI MSM6588 ADPCM Recorder + +It has similar functionality to MSM6258. + +TODO: +- it only supports MCU mode EXT playback, nothing else emulated yet +- status register read (eg. BUSY flag) + +*/ + +#include "emu.h" +#include "okim6588.h" + + +DEFINE_DEVICE_TYPE(OKIM6588, okim6588_device, "okim6588", "OKI MSM6588 ADPCM Recorder") + +//------------------------------------------------- +// constructor +//------------------------------------------------- + +okim6588_device::okim6588_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, OKIM6588, tag, owner, clock), + device_sound_interface(mconfig, *this), + m_write_mon(*this), + m_chip_mode(CHIP_MODE_STANDALONE) +{ } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +// allow save_item on a non-fundamental type +ALLOW_SAVE_TYPE(okim6588_device::chip_mode); +ALLOW_SAVE_TYPE(okim6588_device::command_state); +ALLOW_SAVE_TYPE(okim6588_device::run_state); + +void okim6588_device::device_start() +{ + // initialize + m_stream = stream_alloc(0, 1, clock() / 128); + + m_adpcm_timer = timer_alloc(FUNC(okim6588_device::clock_adpcm), this); + m_mon_timer = timer_alloc(FUNC(okim6588_device::set_mon), this); + + m_command_state = COMMAND_READY; + m_run_state = RUN_STOP; + m_adpcm_data = 0; + + m_vds_bit = (m_chip_mode == CHIP_MODE_MCU) ? 1 : 0; + m_samp_fdiv = 512; + m_rec_mode = false; + + // register for savestates + save_item(NAME(m_chip_mode)); + save_item(NAME(m_command_state)); + save_item(NAME(m_run_state)); + save_item(NAME(m_adpcm_data)); + save_item(NAME(m_adpcm.m_signal)); + save_item(NAME(m_adpcm.m_step)); + save_item(NAME(m_rec_mode)); + save_item(NAME(m_samp_fdiv)); + save_item(NAME(m_vds_bit)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void okim6588_device::device_reset() +{ + m_command_state = COMMAND_READY; + m_run_state = RUN_STOP; + reset_adpcm(); + + m_adpcm_timer->adjust(attotime::never); + m_mon_timer->adjust(attotime::never); + m_write_mon(0); +} + + +//------------------------------------------------- +// internal handlers +//------------------------------------------------- + +void okim6588_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +{ + // simply fill the buffer with the current sample + outputs[0].fill(m_adpcm.output() / 2048.0); +} + +TIMER_CALLBACK_MEMBER(okim6588_device::clock_adpcm) +{ + switch (m_run_state) + { + case RUN_STOP: + reset_adpcm(); + break; + + case RUN_PLAY_EXT: + // strobe MON + m_write_mon(1); + m_mon_timer->adjust(attotime::from_ticks(m_samp_fdiv / 4, clock()), 0); + m_command_state = COMMAND_EXT; + + m_stream->update(); + get_adpcm_sample(m_adpcm_data); + break; + + default: + break; + } + + if (m_run_state != RUN_STOP && m_run_state != RUN_PAUSE) + m_adpcm_timer->adjust(attotime::from_ticks(m_samp_fdiv, clock())); +} + +TIMER_CALLBACK_MEMBER(okim6588_device::set_mon) +{ + m_write_mon(param ? 1 : 0); +} + +s16 okim6588_device::get_adpcm_sample(u8 data) +{ + // 4-bit or 3-bit input + if (m_vds_bit) + return m_adpcm.clock(data & 0xf); + else + return m_adpcm.clock((data & 0xc) | (data >> 1 & 1)); +} + +void okim6588_device::reset_adpcm() +{ + m_stream->update(); + m_adpcm_data = 0; + m_adpcm.reset(); +} + + +//------------------------------------------------- +// public handlers +//------------------------------------------------- + +u8 okim6588_device::data_r() +{ + if (m_chip_mode != CHIP_MODE_MCU) + return 0; + + return 0; +} + +void okim6588_device::data_w(u8 data) +{ + if (m_chip_mode != CHIP_MODE_MCU) + return; + + data &= 0xf; + + switch (m_command_state) + { + case COMMAND_READY: + switch (data & 0xf) + { + // NOP + case 0x0: + break; + + // PLAY/REC + case 0x2: case 0x3: + m_rec_mode = bool(data & 1); + break; + + // STOP + case 0x5: + m_run_state = RUN_STOP; + break; + + // SAMP + case 0x6: + m_command_state = COMMAND_SAMP; + break; + + // VDS + case 0xc: + m_command_state = COMMAND_VDS; + break; + + // EXT + case 0xb: + m_run_state = m_rec_mode ? RUN_RECORD_EXT : RUN_PLAY_EXT; + reset_adpcm(); + + // minimum delay is 1 sample + m_adpcm_timer->adjust(attotime::from_ticks(m_samp_fdiv, clock())); + m_command_state = COMMAND_EXT; + break; + + default: + break; + } + break; + + case COMMAND_SAMP: + { + static const u16 div[4] = { 1024, 768, 640, 512 }; + m_samp_fdiv = div[data & 3]; + m_command_state = COMMAND_READY; + break; + } + + case COMMAND_EXT: + m_adpcm_data = data; + m_command_state = COMMAND_READY; + break; + + case COMMAND_VDS: + m_vds_bit = BIT(data, 2); + m_command_state = COMMAND_READY; + break; + + default: + // shouldn't get here + break; + } +} diff --git a/src/devices/sound/okim6588.h b/src/devices/sound/okim6588.h new file mode 100644 index 0000000000000..28bcec029aabc --- /dev/null +++ b/src/devices/sound/okim6588.h @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + OKI MSM6588 ADPCM Recorder + +*/ + +#ifndef MAME_SOUND_OKIM6588_H +#define MAME_SOUND_OKIM6588_H + +#pragma once + +#include "sound/okiadpcm.h" + + +class okim6588_device : public device_t, public device_sound_interface +{ +public: + okim6588_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // configuration helpers + auto write_mon() { return m_write_mon.bind(); } + void set_mcum_pin(int state) { m_chip_mode = state ? CHIP_MODE_MCU : CHIP_MODE_STANDALONE; } + + // D0-D3 (MCU mode) + void data_w(u8 data); + u8 data_r(); + +protected: + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; + +private: + enum chip_mode : u8 + { + CHIP_MODE_STANDALONE = 0, + CHIP_MODE_MCU + }; + + enum command_state : u8 + { + COMMAND_READY = 0, + COMMAND_SAMP, + COMMAND_EXT, + COMMAND_VDS + }; + + enum run_state : u8 + { + RUN_STOP = 0, + RUN_PAUSE, + RUN_PLAY_SERIAL, + RUN_PLAY_EXT, + RUN_RECORD_SERIAL, + RUN_RECORD_EXT, + }; + + devcb_write_line m_write_mon; + + chip_mode m_chip_mode; + command_state m_command_state; + run_state m_run_state; + + sound_stream *m_stream; + + u8 m_adpcm_data; + oki_adpcm_state m_adpcm; + bool m_rec_mode; + u16 m_samp_fdiv; + u8 m_vds_bit; + + emu_timer *m_adpcm_timer; + emu_timer *m_mon_timer; + + TIMER_CALLBACK_MEMBER(clock_adpcm); + TIMER_CALLBACK_MEMBER(set_mon); + s16 get_adpcm_sample(u8 data); + void reset_adpcm(); +}; + + +DECLARE_DEVICE_TYPE(OKIM6588, okim6588_device) + +#endif // MAME_SOUND_OKIM6588_H diff --git a/src/devices/video/hd61603.cpp b/src/devices/video/hd61603.cpp index bdc2cd7aa6637..d9187fd78fa66 100644 --- a/src/devices/video/hd61603.cpp +++ b/src/devices/video/hd61603.cpp @@ -14,7 +14,7 @@ Hitachi HD61603 LCD Driver */ #include "emu.h" -#include "video/hd61603.h" +#include "hd61603.h" DEFINE_DEVICE_TYPE(HD61603, hd61603_device, "hd61603", "Hitachi HD61603 LCD Driver") diff --git a/src/devices/video/hd61603.h b/src/devices/video/hd61603.h index 8de7c8797612b..bffb2b73848a0 100644 --- a/src/devices/video/hd61603.h +++ b/src/devices/video/hd61603.h @@ -45,7 +45,7 @@ class hd61603_device : public device_t void data_w(u8 data); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/video/lc7580.cpp b/src/devices/video/lc7580.cpp index 81b705769f945..42b2a6783d7b9 100644 --- a/src/devices/video/lc7580.cpp +++ b/src/devices/video/lc7580.cpp @@ -134,7 +134,7 @@ void lc7580_device::clk_w(int state) state = (state) ? 1 : 0; // clock shift register - if (!state && m_clk) + if (state && !m_clk) m_shift = m_shift >> 1 | u64(m_data) << 55; m_clk = state; diff --git a/src/devices/video/pc_vga_ati.cpp b/src/devices/video/pc_vga_ati.cpp index 171ab494a375c..39564407f46e2 100644 --- a/src/devices/video/pc_vga_ati.cpp +++ b/src/devices/video/pc_vga_ati.cpp @@ -12,7 +12,7 @@ #define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) -DEFINE_DEVICE_TYPE(ATI_VGA, ati_vga_device, "ati_vga", "ATi VGA") +DEFINE_DEVICE_TYPE(ATI_VGA, ati_vga_device, "ati_vga", "ATi VGA i/f") ati_vga_device::ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ati_vga_device(mconfig, ATI_VGA, tag, owner, clock) diff --git a/src/devices/video/pc_vga_cirrus.cpp b/src/devices/video/pc_vga_cirrus.cpp index 4240eea56806c..deda877381e42 100644 --- a/src/devices/video/pc_vga_cirrus.cpp +++ b/src/devices/video/pc_vga_cirrus.cpp @@ -51,9 +51,9 @@ #define TEXT_COPY_9COLUMN(ch) (((ch & 0xe0) == 0xc0)&&(vga.attribute.data[0x10]&4)) -DEFINE_DEVICE_TYPE(CIRRUS_GD5428, cirrus_gd5428_device, "clgd5428", "Cirrus Logic GD5428") -DEFINE_DEVICE_TYPE(CIRRUS_GD5430, cirrus_gd5430_device, "clgd5430", "Cirrus Logic GD5430") -DEFINE_DEVICE_TYPE(CIRRUS_GD5446, cirrus_gd5446_device, "clgd5446", "Cirrus Logic GD5446") +DEFINE_DEVICE_TYPE(CIRRUS_GD5428, cirrus_gd5428_device, "clgd5428", "Cirrus Logic GD5428 i/f") +DEFINE_DEVICE_TYPE(CIRRUS_GD5430, cirrus_gd5430_device, "clgd5430", "Cirrus Logic GD5430 i/f") +DEFINE_DEVICE_TYPE(CIRRUS_GD5446, cirrus_gd5446_device, "clgd5446", "Cirrus Logic GD5446 i/f") cirrus_gd5428_device::cirrus_gd5428_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) diff --git a/src/devices/video/pc_vga_matrox.cpp b/src/devices/video/pc_vga_matrox.cpp index 1d2650fb5832b..181c2581a2c7a 100644 --- a/src/devices/video/pc_vga_matrox.cpp +++ b/src/devices/video/pc_vga_matrox.cpp @@ -6,7 +6,7 @@ #define DEBUG_VRAM_VIEWER 0 -DEFINE_DEVICE_TYPE(MATROX_VGA, matrox_vga_device, "matrox_vga", "Matrox MGA2064W VGA") +DEFINE_DEVICE_TYPE(MATROX_VGA, matrox_vga_device, "matrox_vga", "Matrox MGA2064W VGA i/f") matrox_vga_device::matrox_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, MATROX_VGA, tag, owner, clock) diff --git a/src/devices/video/pc_vga_oak.cpp b/src/devices/video/pc_vga_oak.cpp index e5654a14b0c0c..88245f9cf5196 100644 --- a/src/devices/video/pc_vga_oak.cpp +++ b/src/devices/video/pc_vga_oak.cpp @@ -13,7 +13,7 @@ #define LOGBANK(...) LOGMASKED(LOG_BANK, __VA_ARGS__) -DEFINE_DEVICE_TYPE(OTI111, oak_oti111_vga_device, "oti111_vga", "Oak Technologies Spitfire 64111") +DEFINE_DEVICE_TYPE(OTI111, oak_oti111_vga_device, "oti111_vga", "Oak Technologies Spitfire 64111 i/f") oak_oti111_vga_device::oak_oti111_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, OTI111, tag, owner, clock) diff --git a/src/devices/video/pc_vga_paradise.cpp b/src/devices/video/pc_vga_paradise.cpp index 006eb812944c5..6c2d543429dc1 100644 --- a/src/devices/video/pc_vga_paradise.cpp +++ b/src/devices/video/pc_vga_paradise.cpp @@ -44,12 +44,12 @@ Paradise / Western Digital (S)VGA chipsets #define LOGLOCKED(...) LOGMASKED(LOG_LOCKED, __VA_ARGS__) -DEFINE_DEVICE_TYPE(PVGA1A, pvga1a_vga_device, "pvga1a_vga", "Paradise Systems PVGA1A") -DEFINE_DEVICE_TYPE(WD90C00, wd90c00_vga_device, "wd90c00_vga", "Western Digital WD90C00 \"PVGA1B\" VGA Controller") -DEFINE_DEVICE_TYPE(WD90C11A, wd90c11a_vga_device, "wd90c11a_vga", "Western Digital WD90C11A \"PVGA1C\" VGA Controller") -DEFINE_DEVICE_TYPE(WD90C30, wd90c30_vga_device, "wd90c30_vga", "Western Digital WD90C30 \"PVGA1D\" VGA Controller") -DEFINE_DEVICE_TYPE(WD90C31, wd90c31_vga_device, "wd90c31_vga", "Western Digital WD90C31 VGA Controller") -DEFINE_DEVICE_TYPE(WD90C33, wd90c33_vga_device, "wd90c33_vga", "Western Digital WD90C33 VGA Controller") +DEFINE_DEVICE_TYPE(PVGA1A, pvga1a_vga_device, "pvga1a_vga", "Paradise Systems PVGA1A i/f") +DEFINE_DEVICE_TYPE(WD90C00, wd90c00_vga_device, "wd90c00_vga", "Western Digital WD90C00 \"PVGA1B\" VGA i/f") +DEFINE_DEVICE_TYPE(WD90C11A, wd90c11a_vga_device, "wd90c11a_vga", "Western Digital WD90C11A \"PVGA1C\" VGA i/f") +DEFINE_DEVICE_TYPE(WD90C30, wd90c30_vga_device, "wd90c30_vga", "Western Digital WD90C30 \"PVGA1D\" VGA i/f") +DEFINE_DEVICE_TYPE(WD90C31, wd90c31_vga_device, "wd90c31_vga", "Western Digital WD90C31 VGA i/f") +DEFINE_DEVICE_TYPE(WD90C33, wd90c33_vga_device, "wd90c33_vga", "Western Digital WD90C33 VGA i/f") pvga1a_vga_device::pvga1a_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) diff --git a/src/devices/video/pc_vga_s3.cpp b/src/devices/video/pc_vga_s3.cpp index 2bab4deef24bb..4dc582141ed10 100644 --- a/src/devices/video/pc_vga_s3.cpp +++ b/src/devices/video/pc_vga_s3.cpp @@ -21,39 +21,44 @@ enum MACH8_DRAWING_SCAN }; +DEFINE_DEVICE_TYPE(S3_VISION864_VGA, s3vision864_vga_device, "s3_86c864_vga", "S3 86c864 Vision864 VGA i/f") +DEFINE_DEVICE_TYPE(S3_VISION964_VGA, s3vision964_vga_device, "s3_86c964_vga", "S3 86c964 Vision964 VGA i/f") +DEFINE_DEVICE_TYPE(S3_VISION968_VGA, s3vision968_vga_device, "s3_86c968_vga", "S3 86c968 Vision968 VGA i/f") +DEFINE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device, "s3_86c764_vga", "S3 86c764 Trio64 VGA i/f") -DEFINE_DEVICE_TYPE(S3_VGA, s3_vga_device, "s3_vga", "S3 Graphics VGA") - -s3_vga_device::s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : s3_vga_device(mconfig, S3_VGA, tag, owner, clock) +s3vision864_vga_device::s3vision864_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision864_vga_device(mconfig, S3_VISION864_VGA, tag, owner, clock) { - } -s3_vga_device::s3_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +s3vision864_vga_device::s3vision864_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, type, tag, owner, clock) { - m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3_vga_device::crtc_map), this)); - m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3_vga_device::sequencer_map), this)); + m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3vision864_vga_device::crtc_map), this)); + m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3vision864_vga_device::sequencer_map), this)); } -void s3_vga_device::device_add_mconfig(machine_config &config) +void s3vision864_vga_device::device_add_mconfig(machine_config &config) { IBM8514A(config, "8514a", 0).set_vga_owner(); } -TIMER_CALLBACK_MEMBER(s3_vga_device::vblank_timer_cb) +TIMER_CALLBACK_MEMBER(s3vision864_vga_device::vblank_timer_cb) { - // not sure if this is correct, but XF86_S3 seems to expect the viewport scrolling to be faster if(s3.memory_config & 0x08) - vga.crtc.start_addr = vga.crtc.start_addr_latch << 2; + { + // - SDD scrolling test expects a << 2 for 8bpp and no shift for anything else + // - Slackware 3.x XF86_S3 expect a << 2 shift (to be confirmed) + // - przonegd expect no shift (RGB16) + vga.crtc.start_addr = vga.crtc.start_addr_latch << (svga.rgb8_en ? 2 : 0); + } else vga.crtc.start_addr = vga.crtc.start_addr_latch; vga.attribute.pel_shift = vga.attribute.pel_shift_latch; m_vblank_timer->adjust( screen().time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); } -void s3_vga_device::device_start() +void s3vision864_vga_device::device_start() { svga_device::device_start(); memset(&s3, 0, sizeof(s3)); @@ -65,30 +70,29 @@ void s3_vga_device::device_start() s3.cursor_bg[x] = 0x00; } m_8514 = subdevice("8514a"); - // set device ID - s3.id_high = 0x88; // CR2D - s3.id_low = 0x11; // CR2E - s3.revision = 0x00; // CR2F - s3.id_cr30 = 0xe1; // CR30 + + s3.id_high = s3.id_low = s3.revision = 0; // + s3.id_cr30 = 0xc1; } -void s3_vga_device::device_reset() +void s3vision864_vga_device::device_reset() { vga_device::device_reset(); // Power-on strapping bits. Sampled at reset, but can be modified later. // These are just assumed defaults. + // TODO: expose as configuration option (PD pins) s3.strapping = 0x000f0b1e; s3.sr10 = 0x42; s3.sr11 = 0x41; } -u16 s3_vga_device::line_compare_mask() +u16 s3vision864_vga_device::line_compare_mask() { // TODO: pinpoint condition return svga.rgb8_en ? 0x7ff : 0x3ff; } -uint16_t s3_vga_device::offset() +uint16_t s3vision864_vga_device::offset() { //popmessage("Offset: %04x %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(s3.memory_config & 0x08)?"31":"--"); if(s3.memory_config & 0x08) @@ -96,7 +100,7 @@ uint16_t s3_vga_device::offset() return vga_device::offset(); } -void s3_vga_device::s3_define_video_mode() +void s3vision864_vga_device::s3_define_video_mode() { int divisor = 1; int xtal = ((vga.miscellaneous_output & 0xc) ? XTAL(28'636'363) : XTAL(25'174'800)).value(); @@ -115,17 +119,32 @@ void s3_vga_device::s3_define_video_mode() svga.rgb15_en = 0; svga.rgb16_en = 0; svga.rgb32_en = 0; + // FIXME: vision864 has only first 7 modes switch((s3.ext_misc_ctrl_2) >> 4) { + // 0001 Mode 8: 2x 8-bit 1 VCLK/2 pixels case 0x01: svga.rgb8_en = 1; break; + // 0010 Mode 1: 15-bit 2 VCLK/pixel + case 0x02: svga.rgb15_en = 1; break; + // 0011 Mode 9: 15-bit 1 VCLK/pixel case 0x03: svga.rgb15_en = 1; divisor = 2; break; + // 0100 Mode 2: 24-bit 3 VCLK/pixel + case 0x04: svga.rgb24_en = 1; break; + // 0101 Mode 10: 16-bit 1 VCLK/pixel case 0x05: svga.rgb16_en = 1; divisor = 2; break; + // 0110 Mode 3: 16-bit 2 VCLK/pixel + case 0x06: svga.rgb16_en = 1; break; + // 0111 Mode 11: 24/32-bit 2 VCLK/pixel + case 0x07: svga.rgb32_en = 1; divisor = 4; break; case 0x0d: svga.rgb32_en = 1; divisor = 1; break; - default: fatalerror("TODO: S3 colour mode not implemented %02x\n",((s3.ext_misc_ctrl_2) >> 4)); + default: + popmessage("pc_vga_s3: PA16B-COLOR-MODE %02x\n",((s3.ext_misc_ctrl_2) >> 4)); + break; } } else { + // 0000: Mode 0 8-bit 1 VCLK/pixel svga.rgb8_en = (s3.memory_config & 8) >> 3; svga.rgb15_en = 0; svga.rgb16_en = 0; @@ -134,7 +153,7 @@ void s3_vga_device::s3_define_video_mode() recompute_params_clock(divisor, xtal); } -void s3_vga_device::refresh_pitch_offset() +void s3vision864_vga_device::refresh_pitch_offset() { // bit 2 = bit 8 of offset register, but only if bits 4-5 of CR51 are 00h. vga.crtc.offset &= 0xff; @@ -144,7 +163,7 @@ void s3_vga_device::refresh_pitch_offset() vga.crtc.offset |= (s3.cr51 & 0x30) << 4; } -void s3_vga_device::crtc_map(address_map &map) +void s3vision864_vga_device::crtc_map(address_map &map) { svga_device::crtc_map(map); map(0x2d, 0x2d).lr8( @@ -180,6 +199,7 @@ void s3_vga_device::crtc_map(address_map &map) s3_define_video_mode(); }) ); + // TODO: CR32, CR33 & CR34 (backward compatibility) map(0x35, 0x35).lrw8( NAME([this] (offs_t offset) { return s3.crt_reg_lock; @@ -213,6 +233,7 @@ void s3_vga_device::crtc_map(address_map &map) return (s3.strapping & 0x0000ff00) >> 8; // enable chipset, 64k BIOS size, internal DCLK/MCLK }), NAME([this] (offs_t offset, u8 data) { + // TODO: monitor ID at 7-5 (PD15-13) if(s3.reg_lock2 == 0xa5) { s3.strapping = (s3.strapping & 0xffff00ff) | (data << 8); @@ -516,6 +537,7 @@ bit 0-1 DAC Register Select Bits. Passed to the RS2 and RS3 pins on the s3.extended_dac_ctrl = data; }) ); + // TODO: bits 7-4 (w/o?) for GPIO map(0x5c, 0x5c).lr8( NAME([this] (offs_t offset) { u8 res = 0; @@ -645,9 +667,10 @@ bit 0 Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h ); } -void s3_vga_device::sequencer_map(address_map &map) +void s3vision864_vga_device::sequencer_map(address_map &map) { svga_device::sequencer_map(map); + // TODO: SR8 (unlocks SRD) // Memory CLK PLL map(0x10, 0x10).lrw8( NAME([this] (offs_t offset) { return s3.sr10; }), @@ -700,7 +723,7 @@ void s3_vga_device::sequencer_map(address_map &map) ); } -uint8_t s3_vga_device::mem_r(offs_t offset) +uint8_t s3vision864_vga_device::mem_r(offs_t offset) { if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en) { @@ -734,7 +757,7 @@ uint8_t s3_vga_device::mem_r(offs_t offset) return 0xff; } -void s3_vga_device::mem_w(offs_t offset, uint8_t data) +void s3vision864_vga_device::mem_w(offs_t offset, uint8_t data) { ibm8514a_device* dev = get_8514(); // bit 4 of CR53 enables memory-mapped I/O @@ -1004,7 +1027,7 @@ void s3_vga_device::mem_w(offs_t offset, uint8_t data) } -uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3vision864_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { svga_device::screen_update(screen, bitmap, cliprect); @@ -1127,3 +1150,76 @@ uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma } return 0; } + +/****************** + * + * Vision 964 + * + *****************/ + +s3vision964_vga_device::s3vision964_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision964_vga_device(mconfig, S3_VISION964_VGA, tag, owner, clock) +{ +} + +s3vision964_vga_device::s3vision964_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision864_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3vision964_vga_device::device_start() +{ + s3vision864_vga_device::device_start(); + s3.id_high = s3.id_low = s3.revision = 0; // + s3.id_cr30 = 0xd0; // CR30, assume rev 0 +} + +/****************** + * + * Vision968 + * + *****************/ + +s3vision968_vga_device::s3vision968_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision968_vga_device(mconfig, S3_VISION968_VGA, tag, owner, clock) +{ +} + +s3vision968_vga_device::s3vision968_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision964_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3vision968_vga_device::device_start() +{ + s3vision964_vga_device::device_start(); + s3.id_high = 0x88; // CR2D + s3.id_low = 0xf0; // CR2E + s3.revision = 0x00; // CR2F + s3.id_cr30 = 0xe1; // CR30 +} + +/****************** + * + * Trio 64 + * + *****************/ + +s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3trio64_vga_device(mconfig, S3_TRIO64_VGA, tag, owner, clock) +{ +} + +s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision968_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3trio64_vga_device::device_start() +{ + s3vision968_vga_device::device_start(); + s3.id_high = 0x88; // CR2D + s3.id_low = 0x11; // CR2E + s3.revision = 0x00; // CR2F + s3.id_cr30 = 0xe1; // CR30 +} diff --git a/src/devices/video/pc_vga_s3.h b/src/devices/video/pc_vga_s3.h index b3a4060a67df7..90d54dbad85e6 100644 --- a/src/devices/video/pc_vga_s3.h +++ b/src/devices/video/pc_vga_s3.h @@ -10,12 +10,11 @@ #include "screen.h" - -class s3_vga_device : public svga_device +class s3vision864_vga_device : public svga_device { public: // construction/destruction - s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3vision864_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual uint8_t mem_r(offs_t offset) override; virtual void mem_w(offs_t offset, uint8_t data) override; @@ -27,7 +26,7 @@ class s3_vga_device : public svga_device ibm8514a_device* get_8514() { return m_8514; } protected: - s3_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + s3vision864_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; @@ -97,7 +96,40 @@ class s3_vga_device : public svga_device void refresh_pitch_offset(); }; +class s3vision964_vga_device : public s3vision864_vga_device +{ +public: + s3vision964_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3vision964_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + +class s3vision968_vga_device : public s3vision964_vga_device +{ +public: + s3vision968_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3vision968_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + +class s3trio64_vga_device : public s3vision968_vga_device +{ +public: + s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + // device type definition -DECLARE_DEVICE_TYPE(S3_VGA, s3_vga_device) +DECLARE_DEVICE_TYPE(S3_VISION864_VGA, s3vision864_vga_device) +DECLARE_DEVICE_TYPE(S3_VISION964_VGA, s3vision964_vga_device) +DECLARE_DEVICE_TYPE(S3_VISION968_VGA, s3vision968_vga_device) +DECLARE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device) #endif // MAME_VIDEO_PC_VGA_S3_H diff --git a/src/devices/video/pc_vga_sis.cpp b/src/devices/video/pc_vga_sis.cpp index ee1a1d04f7f06..944034613b483 100644 --- a/src/devices/video/pc_vga_sis.cpp +++ b/src/devices/video/pc_vga_sis.cpp @@ -34,7 +34,7 @@ VBE 3.0, Multi Buffering & Virtual Scrolling available // TODO: later variant of 5598 // (definitely doesn't have dual segment mode for instance) -DEFINE_DEVICE_TYPE(SIS630_SVGA, sis630_svga_device, "sis630_svga", "SiS 630 SVGA") +DEFINE_DEVICE_TYPE(SIS630_SVGA, sis630_svga_device, "sis630_svga", "SiS 630 VGA i/f") sis630_svga_device::sis630_svga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, SIS630_SVGA, tag, owner, clock) diff --git a/src/devices/video/pc_vga_trident.cpp b/src/devices/video/pc_vga_trident.cpp index 7d45171c50afc..f12c03e46c3e6 100644 --- a/src/devices/video/pc_vga_trident.cpp +++ b/src/devices/video/pc_vga_trident.cpp @@ -41,8 +41,8 @@ #define LOGTODO(...) LOGMASKED(LOG_TODO, __VA_ARGS__) #define LOGCRTC(...) LOGMASKED(LOG_CRTC, __VA_ARGS__) -DEFINE_DEVICE_TYPE(TRIDENT_VGA, tgui9860_device, "trident_vga", "Trident TGUI9860") -DEFINE_DEVICE_TYPE(TVGA9000_VGA, tvga9000_device, "tvga9000_vga", "Trident TVGA9000") +DEFINE_DEVICE_TYPE(TRIDENT_VGA, tgui9860_device, "trident_vga", "Trident TGUI9860 VGA i/f") +DEFINE_DEVICE_TYPE(TVGA9000_VGA, tvga9000_device, "tvga9000_vga", "Trident TVGA9000 VGA i/f") trident_vga_device::trident_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, type, tag, owner, clock) diff --git a/src/devices/video/pc_vga_tseng.cpp b/src/devices/video/pc_vga_tseng.cpp index 9d85a96c37e5a..288ac1bc85081 100644 --- a/src/devices/video/pc_vga_tseng.cpp +++ b/src/devices/video/pc_vga_tseng.cpp @@ -19,7 +19,7 @@ // TODO: refactor this macro #define GRAPHIC_MODE (vga.gc.alpha_dis) /* else text mode */ -DEFINE_DEVICE_TYPE(TSENG_VGA, tseng_vga_device, "tseng_vga", "Tseng Labs ET4000AX SVGA") +DEFINE_DEVICE_TYPE(TSENG_VGA, tseng_vga_device, "tseng_vga", "Tseng Labs ET4000AX VGA i/f") tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, TSENG_VGA, tag, owner, clock) diff --git a/src/devices/video/s3virge.cpp b/src/devices/video/s3virge.cpp index 86bb320af0b7d..0c433b718643d 100644 --- a/src/devices/video/s3virge.cpp +++ b/src/devices/video/s3virge.cpp @@ -62,7 +62,7 @@ s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, const char } s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : s3_vga_device(mconfig, type, tag, owner, clock) + : s3trio64_vga_device(mconfig, type, tag, owner, clock) , m_linear_config_changed_cb(*this) { } @@ -169,7 +169,7 @@ void s3virge_vga_device::s3d_reset() void s3virge_vga_device::device_reset() { - s3_vga_device::device_reset(); + s3trio64_vga_device::device_reset(); // Power-on strapping bits. Sampled at reset, but can be modified later. // These are just assumed defaults. s3.strapping = 0x000f0912; @@ -200,12 +200,12 @@ uint16_t s3virge_vga_device::offset() // this breaks VBETest, which detects these VESA modes as 32bpp. if(svga.rgb24_en) return vga.crtc.offset * 6; - return s3_vga_device::offset(); + return s3trio64_vga_device::offset(); } void s3virge_vga_device::crtc_map(address_map &map) { - s3_vga_device::crtc_map(map); + s3trio64_vga_device::crtc_map(map); // TODO: verify these overrides map(0x3a, 0x3a).lw8( NAME([this] (offs_t offset, u8 data) { diff --git a/src/devices/video/s3virge.h b/src/devices/video/s3virge.h index 00fe1282241dc..d1288abcc0b90 100644 --- a/src/devices/video/s3virge.h +++ b/src/devices/video/s3virge.h @@ -16,7 +16,7 @@ // ======================> s3virge_vga_device -class s3virge_vga_device : public s3_vga_device +class s3virge_vga_device : public s3trio64_vga_device { public: // construction/destruction diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index b3b8af01388da..ed34dfa85b27a 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -49,7 +49,7 @@ scn2674_device::scn2674_device(const machine_config &mconfig, device_type type, , m_mbc_char_cb(*this, 0) , m_mbc_attr_cb(*this, 0) , m_IR_pointer(0) - , m_screen1_address(0), m_screen2_address(0) + , m_screen1_address(0), m_screen2_address(0), m_screen2_address_start(0) , m_cursor_address(0) , m_irq_register(0), m_status_register(0), m_irq_mask(0) , m_gfx_enabled(false) @@ -121,6 +121,7 @@ void scn2674_device::device_start() save_item(NAME(m_linecounter)); save_item(NAME(m_screen1_address)); save_item(NAME(m_screen2_address)); + save_item(NAME(m_screen2_address_start)); save_item(NAME(m_cursor_address)); save_item(NAME(m_IR_pointer)); save_item(NAME(m_irq_register)); @@ -174,6 +175,7 @@ void scn2674_device::device_reset() { m_screen1_address = 0; m_screen2_address = 0; + m_screen2_address_start = 0; m_cursor_address = 0; m_irq_register = 0; m_status_register = 0; @@ -975,6 +977,7 @@ void scn2674_device::write_screen2_address(bool msb, uint8_t data) } else m_screen2_address = (m_screen2_address & 0x3f00) | data; + m_screen2_address_start = m_screen2_address; } void scn2672_device::write_screen2_address(bool msb, uint8_t data) @@ -1197,6 +1200,7 @@ TIMER_CALLBACK_MEMBER(scn2674_device::vblank_timer) m_irq_register |= 0x10; m_intr_cb(ASSERT_LINE); } + m_screen2_address = m_screen2_address_start; } uint32_t scn2674_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/devices/video/scn2674.h b/src/devices/video/scn2674.h index 0304982bbc087..8654cd839c4f5 100644 --- a/src/devices/video/scn2674.h +++ b/src/devices/video/scn2674.h @@ -62,6 +62,7 @@ class scn2674_device : public device_t, uint8_t m_IR_pointer; uint16_t m_screen1_address; uint16_t m_screen2_address; + uint16_t m_screen2_address_start; uint16_t m_cursor_address; uint8_t m_irq_register; uint8_t m_status_register; diff --git a/src/devices/video/voodoo_pci.cpp b/src/devices/video/voodoo_pci.cpp index 864be7c6b1be5..69d5eb51451a7 100644 --- a/src/devices/video/voodoo_pci.cpp +++ b/src/devices/video/voodoo_pci.cpp @@ -122,13 +122,25 @@ void voodoo_1_pci_device::device_start() void voodoo_2_pci_device::device_start() { - // FIXME: proper PCI values (check manual) + // TODO: straps class code from fb_addr_a[6] (if =1 then 0x040000) set_ids(0x121a0002, 0x02, 0x038000, 0x000000); voodoo_pci_device::device_start(); add_map(16 * 1024 * 1024, M_MEM | M_PREF, *m_voodoo, FUNC(voodoo_2_device::core_map)); bank_infos[0].adr = 0xff000000; + + command = 0; + command_mask = 2; + // FIXME: straps from fb_addr_b[1] (AGP) / fb_addr_a[8] + // (fast back-to-back & fast/medium DEVSEL#) + //status = 0x0280; + status = 0; + + // reported with default 0 + intr_line = 0; + // INTA# + intr_pin = 1; } void voodoo_banshee_pci_device::device_start() diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 5c5a186e2aa1d..fd0093bd28323 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -25,7 +25,6 @@ #include "uiinput.h" #include "corestr.h" -#include "coreutil.h" #include "osdepend.h" #include "xmlfile.h" @@ -1727,7 +1726,7 @@ u32 device_debug::compute_opcode_crc32(offs_t pc) const buffer.data_get(pc, dasmresult & util::disasm_interface::LENGTHMASK, true, opbuf); // return a CRC of the exact count of opcode bytes - return core_crc32(0, &opbuf[0], opbuf.size()); + return util::crc32_creator::simple(&opbuf[0], opbuf.size()); } diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h index fe6ae26cb2ccf..89e15e4c54140 100644 --- a/src/emu/emufwd.h +++ b/src/emu/emufwd.h @@ -38,7 +38,6 @@ class output_module; // declared in osdepend.h class osd_font; class osd_interface; -class osd_midi_device; diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index 2712a5121a707..60ea12f9400e2 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -16,7 +16,6 @@ #include "render.h" #include "corestr.h" -#include "coreutil.h" #include "multibyte.h" #include "path.h" @@ -883,7 +882,7 @@ bool render_font::load_cached_bdf(std::string_view filename) m_rawdata.clear(); return false; } - u32 const hash(core_crc32(0, reinterpret_cast(&m_rawdata[0]), bytes)); + u32 const hash(util::crc32_creator::simple(&m_rawdata[0], bytes)); // create the cached filename, changing the 'F' to a 'C' on the extension std::string cachedname(filename, 0, filename.length() - ((4U < filename.length()) && core_filename_ends_with(filename, ".bdf") ? 4 : 0)); diff --git a/src/emu/save.cpp b/src/emu/save.cpp index 6f49e6b2b0614..8c3329e7b38b7 100644 --- a/src/emu/save.cpp +++ b/src/emu/save.cpp @@ -27,7 +27,6 @@ #include "main.h" -#include "util/coreutil.h" #include "util/ioprocs.h" #include "util/ioprocsfilter.h" @@ -495,11 +494,11 @@ inline save_error save_manager::do_read(T check_length, U read_block, V start_he u32 save_manager::signature() const { // iterate over entries - u32 crc = 0; + util::crc32_creator crc; for (auto &entry : m_entry_list) { // add the entry name to the CRC - crc = core_crc32(crc, (u8 *)entry->m_name.c_str(), entry->m_name.length()); + crc.append(entry->m_name.data(), entry->m_name.length()); // add the type and size to the CRC u32 temp[4]; @@ -507,9 +506,9 @@ u32 save_manager::signature() const temp[1] = little_endianize_int32(entry->m_typecount); temp[2] = little_endianize_int32(entry->m_blockcount); temp[3] = little_endianize_int32(entry->m_stride); - crc = core_crc32(crc, (u8 *)&temp[0], sizeof(temp)); + crc.append(&temp[0], sizeof(temp)); } - return crc; + return crc.finish(); } diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index c05d01159fa2c..8ed4e64fac3d8 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -200,19 +200,21 @@ bool menu_network_devices::handle(event const *ev) } else if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT) { + // FIXME: this conflates presumably arbitrary interface ID numbers with 0-based indices device_network_interface *const network = (device_network_interface *)ev->itemref; + auto const &interfaces = get_netdev_list(); int curr = network->get_interface(); if (ev->iptkey == IPT_UI_LEFT) curr--; else curr++; if (curr == -2) - curr = netdev_count() - 1; + curr = interfaces.size() - 1; network->set_interface(curr); curr = network->get_interface(); const char *title = nullptr; - for (auto &entry : get_netdev_list()) + for (auto &entry : interfaces) { if (entry->id == curr) { diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp index ec978817a6e36..cb18b2036c9fa 100644 --- a/src/lib/formats/flopimg.cpp +++ b/src/lib/formats/flopimg.cpp @@ -864,7 +864,7 @@ void floppy_image_format_t::generate_track_from_bitstream(int track, int head, c normalize_times(dest, track_size*2); - if(splice >= 0 || splice < track_size) { + if(splice >= 0 && splice < track_size) { int splpos = uint64_t(200000000) * splice / track_size; image.set_write_splice_position(track, head, splpos, subtrack); } diff --git a/src/lib/util/bitstream.h b/src/lib/util/bitstream.h index 2866d28c20d39..eb8b200532973 100644 --- a/src/lib/util/bitstream.h +++ b/src/lib/util/bitstream.h @@ -175,6 +175,10 @@ inline uint32_t bitstream_in::read_offset() const result--; bits -= 8; } + + if (m_dbitoffs > bits) + result++; + return result; } @@ -190,7 +194,11 @@ inline uint32_t bitstream_in::flush() m_doffset--; m_bits -= 8; } - m_bits = m_buffer = 0; + + if (m_dbitoffs > m_bits) + m_doffset++; + + m_bits = m_buffer = m_dbitoffs = 0; return m_doffset; } diff --git a/src/lib/util/coreutil.cpp b/src/lib/util/coreutil.cpp index 94ec6dec27364..cebbceb037e66 100644 --- a/src/lib/util/coreutil.cpp +++ b/src/lib/util/coreutil.cpp @@ -10,7 +10,6 @@ #include "coreutil.h" #include -#include /*************************************************************************** @@ -55,14 +54,3 @@ uint32_t bcd_2_dec(uint32_t a) } return result; } - - - -/*************************************************************************** - MISC -***************************************************************************/ - -uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len) -{ - return crc32(crc, buf, len); -} diff --git a/src/lib/util/coreutil.h b/src/lib/util/coreutil.h index 1f487232619ef..813deb27a837f 100644 --- a/src/lib/util/coreutil.h +++ b/src/lib/util/coreutil.h @@ -72,11 +72,4 @@ inline int gregorian_days_in_month(int month, int year) return result; } - -/*************************************************************************** - MISC -***************************************************************************/ - -uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len); - #endif // MAME_UTIL_COREUTIL_H diff --git a/src/mame/apple/maclc.cpp b/src/mame/apple/maclc.cpp index 7be70f0efc4b1..05bc7205cca41 100644 --- a/src/mame/apple/maclc.cpp +++ b/src/mame/apple/maclc.cpp @@ -3,11 +3,21 @@ /**************************************************************************** maclc.cpp - Mac LC, LC II, Classic II, Color Classic + Mac LC, LC II, Classic II, Color Classic, Macintosh TV By R. Belmont These are all lower-end machines based on versions of the "V8" system - controller, which has a 10 MB hard limit on RAM. + controller, which has a 10 MB hard limit on RAM (8MB in the Mac TV). + + Mac TV video input chips: + TEA63330T - Sound fader control unit for car stereos + I2C: address 1000000x + TDA8708BT - Video analog input interface + SAA7197 T - Clock signal generator circuit for desktop video systems + SAA7191 WP - Digital multistandard colour decoder + I2C: address 1000101x + SAA7186 H - Digital video scaler + I2C: address 1011100x ****************************************************************************/ @@ -39,7 +49,6 @@ #include "screen.h" #include "softlist_dev.h" - namespace { #define C32M (31.3344_MHz_XTAL) @@ -73,6 +82,7 @@ class maclc_state : public driver_device void maclc2(machine_config &config); void macclas2(machine_config &config); void maccclas(machine_config &config); + void mactv(machine_config &config); void maclc_map(address_map &map); void maccclassic_map(address_map &map); @@ -335,7 +345,7 @@ void maclc_state::maclc_base(machine_config &config) m_scsihelp->timeout_error_callback().set(FUNC(maclc_state::scsi_berr_w)); SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd"); - SOFTWARE_LIST(config, "cd_list").set_original("mac_cdrom").set_filter("MC68020"); + SOFTWARE_LIST(config, "cd_list").set_original("mac_cdrom").set_filter("MC68020,MC68020_32"); SOFTWARE_LIST(config, "flop35hd_list").set_original("mac_hdflop"); SCC85C30(config, m_scc, C7M); @@ -416,7 +426,7 @@ void maclc_state::maclc2(machine_config &config) m_ram->set_extra_options("6M,8M,10M"); m_v8->set_baseram_is_4M(true); - SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030"); + SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030,MC68030_32"); } void maclc_state::maccclas(machine_config &config) @@ -454,7 +464,46 @@ void maclc_state::maccclas(machine_config &config) m_ram->set_extra_options("6M,8M,10M"); m_v8->set_baseram_is_4M(true); - SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030"); + SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030,MC68030_32"); +} + +void maclc_state::mactv(machine_config &config) +{ + maclc_base(config); + + M68030(config.replace(), m_maincpu, C32M); + m_maincpu->set_addrmap(AS_PROGRAM, &maclc_state::maccclassic_map); + m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override"); + + config.device_remove("egret"); + config.device_remove("fdc"); + + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0788"); + m_cuda->reset_callback().set(FUNC(maclc_state::egret_reset_w)); + m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); + m_cuda->via_clock_callback().set(m_v8, FUNC(v8_device::cb1_w)); + m_cuda->via_data_callback().set(m_v8, FUNC(v8_device::cb2_w)); + m_macadb->adb_data_callback().set(m_cuda, FUNC(cuda_device::set_adb_line)); + config.set_perfect_quantum(m_maincpu); + + TINKERBELL(config.replace(), m_v8, C15M); + m_v8->set_maincpu_tag("maincpu"); + m_v8->set_rom_tag("bootrom"); + m_v8->hdsel_callback().set(FUNC(maclc_state::hdsel_w)); + m_v8->pb3_callback().set(m_cuda, FUNC(cuda_device::get_treq)); + m_v8->pb4_callback().set(m_cuda, FUNC(cuda_device::set_byteack)); + m_v8->pb5_callback().set(m_cuda, FUNC(cuda_device::set_tip)); + m_v8->cb2_callback().set(m_cuda, FUNC(cuda_device::set_via_data)); + + // Mac TV doesn't have an LC PDS + config.device_remove("pds"); + + m_ram->set_default_size("4M"); + m_ram->set_extra_options("5M,6M,8M"); + m_v8->set_baseram_is_4M(true); + + SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030,MC68030_32"); } void maclc_state::macclas2(machine_config &config) @@ -481,7 +530,7 @@ void maclc_state::macclas2(machine_config &config) m_ram->set_extra_options("6M,8M,10M"); m_v8->set_baseram_is_4M(true); - SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030"); + SOFTWARE_LIST(config.replace(), "cd_list").set_original("mac_cdrom").set_filter("MC68030,MC68030_32"); } ROM_START(maclc) @@ -510,9 +559,15 @@ ROM_START(maccclas) ROM_LOAD("ecd99dc0.rom", 0x000000, 0x100000, CRC(c84c3aa5) SHA1(fd9e852e2d77fe17287ba678709b9334d4d74f1e)) ROM_END +ROM_START(mactv) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("eaf1678d.bin", 0x000000, 0x100000, CRC(0644f05b) SHA1(74975c60d3a560fac9ad63125bb65a750fceaede)) +ROM_END + } // anonymous namespace COMP(1990, maclc, 0, 0, maclc, maclc, maclc_state, empty_init, "Apple Computer", "Macintosh LC", MACHINE_SUPPORTS_SAVE) COMP(1991, maclc2, 0, 0, maclc2, maclc, maclc_state, empty_init, "Apple Computer", "Macintosh LC II", MACHINE_SUPPORTS_SAVE) COMP(1991, macclas2, 0, 0, macclas2, maclc, maclc_state, empty_init, "Apple Computer", "Macintosh Classic II", MACHINE_SUPPORTS_SAVE) COMP(1993, maccclas, 0, 0, maccclas, maclc, maclc_state, empty_init, "Apple Computer", "Macintosh Color Classic", MACHINE_SUPPORTS_SAVE) +COMP(1994, mactv, 0, 0, mactv, maclc, maclc_state, empty_init, "Apple Computer", "Macintosh TV", MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/apple/v8.cpp b/src/mame/apple/v8.cpp index 02ecfbb4b8d2d..485c83762cfb1 100644 --- a/src/mame/apple/v8.cpp +++ b/src/mame/apple/v8.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont /* - Apple "V8", "Eagle", and "Spice" system ASICs + Apple "V8", "Eagle", "Spice", and "Tinkerbell" system ASICs Emulation by R. Belmont V8 (343S0116 or 343-0155) contains the following: @@ -22,6 +22,10 @@ and adds the option for an optional ROM expansion plus support for pushbutton sound volume and display intensity controls and power saver mode. + Tinker Bell (343S1109) is an evolution of Spice with a simpler memory controller that has + an 8MB limit (4MB on the motherboard, 1, 2, or 4MB in the SIMM slot) and support for the + Macintosh TV's video input feature. + VISA (343S0101) is a predecessor of V8 and Eagle without support for dedicated VRAM banks or VGA modes. It was coupled to a non-customized Bt450 RAMDAC on the Elsie prototype, and did not offer video modes with more than 4 bits per pixel. @@ -34,12 +38,13 @@ #include "emu.h" #include "v8.h" +#include "cpu/m68000/m68030.h" #include "formats/ap_dsk35.h" #include "layout/generic.h" #define LOG_RAM (1U << 1) -#define VERBOSE (LOG_RAM) +#define VERBOSE (0) #include "logmacro.h" static constexpr u32 C7M = 7833600; @@ -52,6 +57,7 @@ static constexpr u32 C15M = (C7M * 2); DEFINE_DEVICE_TYPE(V8, v8_device, "v8", "Apple V8 system ASIC") DEFINE_DEVICE_TYPE(EAGLE, eagle_device, "v8eagle", "Apple Eagle system ASIC") DEFINE_DEVICE_TYPE(SPICE, spice_device, "v8spice", "Apple Spice system ASIC") +DEFINE_DEVICE_TYPE(TINKERBELL, tinkerbell_device, "v8tkbell", "Apple Tinker Bell system ASIC") static INPUT_PORTS_START( v8 ) PORT_START("MONTYPE") @@ -94,8 +100,6 @@ void v8_device::device_add_mconfig(machine_config &config) { SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(25175000, 800, 0, 640, 525, 0, 480); - m_screen->set_size(1024, 768); - m_screen->set_visarea(0, 640 - 1, 0, 480 - 1); m_screen->set_screen_update(FUNC(v8_device::screen_update)); m_screen->screen_vblank().set(FUNC(v8_device::slot_irq_w<0x40>)); config.set_default_layout(layout_monitors); @@ -133,6 +137,7 @@ v8_device::v8_device(const machine_config &mconfig, device_type type, const char m_screen(*this, "screen"), m_palette(*this, "palette"), m_asc(*this, "asc"), + m_overlay(false), write_pb4(*this), write_pb5(*this), write_cb2(*this), @@ -142,7 +147,6 @@ v8_device::v8_device(const machine_config &mconfig, device_type type, const char m_montype(*this, "MONTYPE"), m_via1(*this, "via1"), m_rom(*this, finder_base::DUMMY_TAG), - m_overlay(false), m_baseIs4M(false) { } @@ -966,12 +970,17 @@ void spice_device::device_add_mconfig(machine_config &config) applefdintf_device::add_35_nc(config, m_floppy[1]); } +spice_device::spice_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : v8_device(mconfig, type, tag, owner, clock), + m_fdc(*this, "fdc"), + m_floppy(*this, "fdc:%d", 0U), + m_cur_floppy(nullptr), + m_hdsel(0) +{ +} + spice_device::spice_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : v8_device(mconfig, SPICE, tag, owner, clock), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:%d", 0U), - m_cur_floppy(nullptr), - m_hdsel(0) + : spice_device(mconfig, SPICE, tag, owner, clock) { } @@ -1166,3 +1175,181 @@ void spice_device::bright_contrast_w(offs_t offset, u8 data) // offset 1 = contrast (0-255) } +// ================ tinkerbell_device + +void tinkerbell_device::device_add_mconfig(machine_config &config) +{ + spice_device::device_add_mconfig(config); + m_screen->set_raw(25175000, 800, 0, 640, 525, 0, 480); +} + +tinkerbell_device::tinkerbell_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : spice_device(mconfig, TINKERBELL, tag, owner, clock) +{ +} + +u8 tinkerbell_device::via_in_a() +{ + return 0x84; +} + +u8 tinkerbell_device::pseudovia_r(offs_t offset) +{ + if (offset < 0x100) + { + if (offset == 0x10) + { + return 0x06 << 3; // ID as an Apple 13" 640x480 monitor + } + } + + return v8_device::pseudovia_r(offset); +} + +u32 tinkerbell_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + int hres, vres; + hres = 640; + vres = 480; + + const pen_t *pens = m_palette->pens(); + switch (m_pseudovia_regs[0x10] & 7) + { + case 0: // 1bpp + { + auto const vram8 = util::big_endian_cast(&m_vram[0]); + + for (int y = 0; y < vres; y++) + { + u32 *scanline = &bitmap.pix(y); + for (int x = 0; x < hres; x += 8) + { + u8 const pixels = vram8[(y * 1024) + (x / 8)]; + + *scanline++ = pens[0x7f | (pixels & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 1) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 2) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 3) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 4) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 5) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 6) & 0x80)]; + *scanline++ = pens[0x7f | ((pixels << 7) & 0x80)]; + } + } + } + break; + + case 1: // 2bpp + { + auto const vram8 = util::big_endian_cast(&m_vram[0]); + + for (int y = 0; y < vres; y++) + { + u32 *scanline = &bitmap.pix(y); + for (int x = 0; x < hres / 4; x++) + { + u8 const pixels = vram8[(y * 1024) + x]; + + *scanline++ = pens[0x3f | (pixels & 0xc0)]; + *scanline++ = pens[0x3f | ((pixels << 2) & 0xc0)]; + *scanline++ = pens[0x3f | ((pixels << 4) & 0xc0)]; + *scanline++ = pens[0x3f | ((pixels << 6) & 0xc0)]; + } + } + } + break; + + case 2: // 4bpp + { + auto const vram8 = util::big_endian_cast(&m_vram[0]); + + for (int y = 0; y < vres; y++) + { + u32 *scanline = &bitmap.pix(y); + + for (int x = 0; x < hres / 2; x++) + { + u8 const pixels = vram8[(y * 1024) + x]; + + *scanline++ = pens[0x0f | (pixels & 0xf0)]; + *scanline++ = pens[0x0f | ((pixels << 4) & 0xf0)]; + } + } + } + break; + + case 3: // 8bpp + { + auto const vram8 = util::big_endian_cast(&m_vram[0]); + + for (int y = 0; y < vres; y++) + { + u32 *scanline = &bitmap.pix(y); + + for (int x = 0; x < hres; x++) + { + u8 const pixels = vram8[(y * 1024) + x]; + *scanline++ = pens[pixels]; + } + } + } + break; + + case 4: // 16bpp + { + auto const vram16 = util::big_endian_cast(&m_vram[0]); + + for (int y = 0; y < vres; y++) + { + u32 *scanline = &bitmap.pix(y); + for (int x = 0; x < hres; x++) + { + u16 const pixels = vram16[(y * hres) + x]; + *scanline++ = rgb_t(((pixels >> 10) & 0x1f) << 3, ((pixels >> 5) & 0x1f) << 3, (pixels & 0x1f) << 3); + } + } + } + break; + } + + return 0; +} + +/* + Tinker Bell is different from the V8, but it still needs to kind of act like one. + The major difference: the RAM limit is 8MB instead of 10, and no RAM appears + above 0x7FFFFFFF. Also, when the bits are set for what on V8 would be 8MB SIMM + and no motherboard RAM except the 0x800000 image, that means 4MB of motherboard + and 4MB of SIMM here. +*/ +void tinkerbell_device::ram_size(u8 config) +{ + if (!m_overlay) + { + address_space &space = m_maincpu->space(AS_PROGRAM); + const void *mb_ram = m_ram_ptr; + u32 simm_size = m_ram_size - 0x400000; + void *simm_ram = &m_ram_ptr[0x400000 / 4]; + + space.unmap_readwrite(0x000000, 0x9fffff); + + // place the motherboard RAM at 0 + LOGMASKED(LOG_RAM, "Motherboard RAM at 0x00000000 to 0x003fffff\n"); + space.install_ram(0, 0x3fffff, 0, (void *)mb_ram); + + // is SIMM RAM present? it always goes at 0x400000 + if (simm_size > 0) + { + if ((config & 0xc0) != 0) + { + LOGMASKED(LOG_RAM, "SIMM RAM at 0x400000 to %x\n", simm_size - 1); + space.install_ram(0x400000, (0x400000 + simm_size) - 1, 0, (void *)simm_ram); + } + } + else + { + LOGMASKED(LOG_RAM, "Base config, no SIMM\n"); + } + } +} + diff --git a/src/mame/apple/v8.h b/src/mame/apple/v8.h index 411250f29e285..10cc8ec4cb72a 100644 --- a/src/mame/apple/v8.h +++ b/src/mame/apple/v8.h @@ -52,6 +52,8 @@ class v8_device : public device_t u8 m_pseudovia_regs[256]; u32 *m_ram_ptr; + u32 m_ram_size; + bool m_overlay; v8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); @@ -65,6 +67,8 @@ class v8_device : public device_t void asc_irq(int state); + virtual void ram_size(u8 config); + private: devcb_write_line write_pb4, write_pb5, write_cb2, write_hdsel, write_hmmu_enable; devcb_read_line read_pb3; @@ -77,13 +81,10 @@ class v8_device : public device_t int m_via_interrupt, m_via2_interrupt, m_scc_interrupt, m_last_taken_interrupt; u8 m_pseudovia_ier, m_pseudovia_ifr; u8 m_pal_address, m_pal_idx, m_pal_control, m_pal_colkey; - bool m_overlay; - u32 m_ram_size; bool m_baseIs4M; u32 rom_switch_r(offs_t offset); - void ram_size(u8 config); void pseudovia_w(offs_t offset, u8 data); void pseudovia_recalc_irqs(); @@ -140,30 +141,52 @@ class spice_device : public v8_device required_device_array m_floppy; protected: + spice_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; + void phases_w(u8 phases); + void devsel_w(u8 devsel); + private: floppy_image_device *m_cur_floppy = nullptr; int m_hdsel; - u8 via_in_a() override; + virtual u8 via_in_a() override; virtual void via_out_a(u8 data) override; - u8 pseudovia_r(offs_t offset) override; + virtual u8 pseudovia_r(offs_t offset) override; virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; - void phases_w(u8 phases); - void devsel_w(u8 devsel); u16 swim_r(offs_t offset, u16 mem_mask); void swim_w(offs_t offset, u16 data, u16 mem_mask); void bright_contrast_w(offs_t offset, u8 data); }; +// ======================> tinkerbell_device + +class tinkerbell_device : public spice_device +{ +public: + tinkerbell_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override; + + virtual void ram_size(u8 config) override; + +private: + virtual u8 via_in_a() override; + virtual u8 pseudovia_r(offs_t offset) override; + virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; +}; + // device type definition DECLARE_DEVICE_TYPE(V8, v8_device) DECLARE_DEVICE_TYPE(EAGLE, eagle_device) DECLARE_DEVICE_TYPE(SPICE, spice_device) +DECLARE_DEVICE_TYPE(TINKERBELL, tinkerbell_device) #endif // MAME_APPLE_V8_H diff --git a/src/mame/appliedconcepts/ggm.cpp b/src/mame/appliedconcepts/ggm.cpp index c18609978a148..5451f8dcd8c96 100644 --- a/src/mame/appliedconcepts/ggm.cpp +++ b/src/mame/appliedconcepts/ggm.cpp @@ -463,7 +463,7 @@ static INPUT_PORTS_START( overlay_lasvegas ) PORT_MODIFY("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_L) PORT_NAME("Split") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_U) PORT_NAME("Shuffle Point") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_P) PORT_NAME("Shuffle Point") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_A) PORT_NAME("Audio") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_T) PORT_NAME("Total") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") @@ -485,7 +485,7 @@ static INPUT_PORTS_START( overlay_odin ) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_U) PORT_NAME("Audio") PORT_MODIFY("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_Y) PORT_NAME("Play / -") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_P) PORT_NAME("Play / -") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_W) PORT_NAME("B/W") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_K) PORT_NAME("Rank") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_T) PORT_NAME("Time") diff --git a/src/mame/misc/cave.cpp b/src/mame/atlus/cave.cpp similarity index 99% rename from src/mame/misc/cave.cpp rename to src/mame/atlus/cave.cpp index 19760b7e05050..c5193da93b4a4 100644 --- a/src/mame/misc/cave.cpp +++ b/src/mame/atlus/cave.cpp @@ -46,6 +46,9 @@ Year + Game License PCB Tilemaps Sprites To Do: +- Modernize state objects for each PCB sub-variant, rename to something more + apt than "cave_state"; + - Sprite lag in some games (e.g. metmqstr). The sprites chip probably generates interrupts (unknown_irq) diff --git a/src/mame/misc/cave.h b/src/mame/atlus/cave.h similarity index 99% rename from src/mame/misc/cave.h rename to src/mame/atlus/cave.h index 09e875d701086..04cc9772cedab 100644 --- a/src/mame/misc/cave.h +++ b/src/mame/atlus/cave.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Luca Elia -#ifndef MAME_MISC_CAVE_H -#define MAME_MISC_CAVE_H +#ifndef MAME_ATLUS_CAVE_H +#define MAME_ATLUS_CAVE_H #pragma once @@ -391,4 +391,4 @@ class ppsatan_state : public cave_state void ppsatan_map(address_map &map); }; -#endif // MAME_MISC_CAVE_H +#endif // MAME_ATLUS_CAVE_H diff --git a/src/mame/misc/cave_v.cpp b/src/mame/atlus/cave_v.cpp similarity index 100% rename from src/mame/misc/cave_v.cpp rename to src/mame/atlus/cave_v.cpp diff --git a/src/mame/casio/cfx9850.cpp b/src/mame/casio/cfx9850.cpp index 1eba48b0037b4..bb3bcf98069ab 100644 --- a/src/mame/casio/cfx9850.cpp +++ b/src/mame/casio/cfx9850.cpp @@ -308,10 +308,12 @@ void cfx9850_state::cfx9850(machine_config &config) PALETTE(config, "palette", FUNC(cfx9850_state::cfx9850_palette), 4); } +#define ROM_MAINCPU \ + ROM_REGION(0x8000, "maincpu", 0) \ + ROM_LOAD("hcd62121.bin", 0x0000, 0x8000, CRC(e72075f8) SHA1(f50d176e1c225dab69abfc67702c9dfb296b6a78)) ROM_START(cfx9850) - ROM_REGION(0x8000, "maincpu", 0) - ROM_LOAD("hcd62121.bin", 0x0000, 0x8000, CRC(e72075f8) SHA1(f50d176e1c225dab69abfc67702c9dfb296b6a78)) + ROM_MAINCPU ROM_REGION(0x80000, "bios", 0) // Unknown yet which rom is which version. @@ -321,7 +323,18 @@ ROM_START(cfx9850) ROMX_LOAD("cfx9850b.bin", 0x00000, 0x80000, CRC(cd3c497f) SHA1(1d1aa38205eec7aba3ed6bef7389767e38afe075), ROM_BIOS(1)) ROM_END +ROM_START(cfx9850gb) + ROM_MAINCPU + + ROM_REGION(0x100000, "bios", 0) + // White model + // Back case revision: G359-21 + // PCB revision: PWB-GY355-E4 RJA509401-1 / PWB-GY357-1 RJA509402-1 + ROM_LOAD("r27v802d-34.lsi2", 0x00000, 0x100000, CRC(7ad44c51) SHA1(7cde6074758b5ae474b4eb3ee7396dbfb481ddcf)) +ROM_END + } // anonymous namespace -COMP(1996, cfx9850, 0, 0, cfx9850, cfx9850, cfx9850_state, empty_init, "Casio", "CFX-9850G", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +COMP(1996, cfx9850, 0, 0, cfx9850, cfx9850, cfx9850_state, empty_init, "Casio", "CFX-9850G", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +COMP(1996, cfx9850gb, cfx9850, 0, cfx9850, cfx9850, cfx9850_state, empty_init, "Casio", "CFX-9850GB Plus", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) diff --git a/src/mame/misc/cavepc.cpp b/src/mame/cave/cavepc.cpp similarity index 100% rename from src/mame/misc/cavepc.cpp rename to src/mame/cave/cavepc.cpp diff --git a/src/mame/misc/cv1k.cpp b/src/mame/cave/cv1k.cpp similarity index 99% rename from src/mame/misc/cv1k.cpp rename to src/mame/cave/cv1k.cpp index c1e65968362c7..503b199a06025 100644 --- a/src/mame/misc/cv1k.cpp +++ b/src/mame/cave/cv1k.cpp @@ -190,12 +190,13 @@ Timing #include "emu.h" +#include "ep1c12.h" + #include "cpu/sh/sh3comn.h" #include "cpu/sh/sh4.h" #include "machine/nandflash.h" #include "machine/rtc9701.h" #include "sound/ymz770.h" -#include "video/epic12.h" #include "screen.h" #include "speaker.h" @@ -234,7 +235,7 @@ class cv1k_state : public driver_device private: required_device m_maincpu; - required_device m_blitter; + required_device m_blitter; required_device m_nand; required_device m_eeprom; @@ -386,7 +387,7 @@ void cv1k_state::cv1k_port(address_map &map) map(SH3_PORT_E, SH3_PORT_E+7).r(FUNC(cv1k_state::flash_port_e_r)); map(SH3_PORT_F, SH3_PORT_F+7).portr("PORT_F"); map(SH3_PORT_L, SH3_PORT_L+7).portr("PORT_L"); - map(SH3_PORT_J, SH3_PORT_J+7).rw(m_blitter, FUNC(epic12_device::fpga_r), FUNC(epic12_device::fpga_w)); + map(SH3_PORT_J, SH3_PORT_J+7).rw(m_blitter, FUNC(ep1c12_device::fpga_r), FUNC(ep1c12_device::fpga_w)); } @@ -494,7 +495,7 @@ void cv1k_state::cv1k(machine_config &config) SPEAKER(config, "mono").front_center(); YMZ770(config, "ymz770", 16.384_MHz_XTAL).add_route(1, "mono", 1.0); // only Right output used, Left is not connected - EPIC12(config, m_blitter, 0); + EP1C12(config, m_blitter, 0); m_blitter->set_cpu(m_maincpu); m_blitter->port_r_callback().set_ioport("DSW"); m_blitter->set_mainramsize(0x800000); @@ -945,9 +946,10 @@ ROM_END uint64_t cv1k_state::speedup_r() { - offs_t pc = m_maincpu->pc(); + const offs_t pc = m_maincpu->pc(); - if (pc == m_idlepc || pc == m_idlepc + 2) m_maincpu->spin_until_time(attotime::from_usec(10)); + if (pc == m_idlepc || pc == m_idlepc + 2) + m_maincpu->spin_until_time(attotime::from_usec(10)); return m_ram[m_idleramoffs / 8]; } diff --git a/src/devices/video/epic12.cpp b/src/mame/cave/ep1c12.cpp similarity index 53% rename from src/devices/video/epic12.cpp rename to src/mame/cave/ep1c12.cpp index 515c29929a3e3..e7d780015f9f8 100644 --- a/src/devices/video/epic12.cpp +++ b/src/mame/cave/ep1c12.cpp @@ -3,7 +3,7 @@ // emulation of Altera Cyclone EP1C12 FPGA programmed as a blitter #include "emu.h" -#include "epic12.h" +#include "ep1c12.h" #include "screen.h" @@ -15,7 +15,7 @@ #define LOGDBG(...) LOGMASKED(LOG_DEBUG, __VA_ARGS__) -DEFINE_DEVICE_TYPE(EPIC12, epic12_device, "epic12", "EPIC12 Blitter") +DEFINE_DEVICE_TYPE(EP1C12, ep1c12_device, "ep1c12", "EP1C12 Blitter") static constexpr int EP1C_VRAM_CLK_NANOSEC = 13; static constexpr int EP1C_SRAM_CLK_NANOSEC = 20; @@ -30,8 +30,8 @@ static constexpr int EP1C_CLIP_OPERATION_SIZE_BYTES = 2; // from the VRAM borders or other buffers in all games. static constexpr int EP1C_CLIP_MARGIN = 32; -epic12_device::epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, EPIC12, tag, owner, clock) +ep1c12_device::ep1c12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, EP1C12, tag, owner, clock) , device_video_interface(mconfig, *this) , m_ram16(nullptr), m_gfx_size(0), m_bitmaps(nullptr), m_use_ram(nullptr) , m_main_ramsize(0), m_main_rammask(0), m_ram16_copy(nullptr), m_work_queue(nullptr) @@ -53,13 +53,13 @@ epic12_device::epic12_device(const machine_config &mconfig, const char *tag, dev m_blit_idle_op_bytes = 0; } -TIMER_CALLBACK_MEMBER(epic12_device::blitter_delay_callback) +TIMER_CALLBACK_MEMBER(ep1c12_device::blitter_delay_callback) { m_blitter_busy = 0; } -void epic12_device::device_start() +void ep1c12_device::device_start() { m_gfx_size = 0x2000 * 0x1000; m_bitmaps = std::make_unique(0x2000, 0x1000); @@ -75,7 +75,7 @@ void epic12_device::device_start() m_ram16_copy = std::make_unique(m_main_ramsize / 2); - m_blitter_delay_timer = timer_alloc(FUNC(epic12_device::blitter_delay_callback), this); + m_blitter_delay_timer = timer_alloc(FUNC(ep1c12_device::blitter_delay_callback), this); m_blitter_delay_timer->adjust(attotime::never); m_firmware_pos = 0; @@ -102,7 +102,7 @@ void epic12_device::device_start() save_item(NAME(m_blit_idle_op_bytes)); } -void epic12_device::device_reset() +void ep1c12_device::device_reset() { m_use_ram = m_ram16_copy.get(); m_work_queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_HIGH_FREQ); @@ -129,12 +129,12 @@ void epic12_device::device_reset() m_blitter_busy = 0; } -// todo, get these into the device class without ruining performance -u8 epic12_device::colrtable[0x20][0x40]; -u8 epic12_device::colrtable_rev[0x20][0x40]; -u8 epic12_device::colrtable_add[0x20][0x20]; +// TODO: get these into the device class without ruining performance +u8 ep1c12_device::colrtable[0x20][0x40]; +u8 ep1c12_device::colrtable_rev[0x20][0x40]; +u8 ep1c12_device::colrtable_add[0x20][0x20]; -inline u16 epic12_device::READ_NEXT_WORD(offs_t *addr) +inline u16 ep1c12_device::READ_NEXT_WORD(offs_t *addr) { // u16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower const u16 data = m_use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; @@ -144,7 +144,7 @@ inline u16 epic12_device::READ_NEXT_WORD(offs_t *addr) return data; } -inline u16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) +inline u16 ep1c12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) { // u16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower const u16 data = m_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; @@ -173,7 +173,7 @@ inline u16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) 10...10 + (Width * Height * 2) Source GFX data (ARGB1555 format) */ -inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t *addr) +inline void ep1c12_device::gfx_upload_shadow_copy(address_space &space, offs_t *addr) { COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); @@ -206,7 +206,7 @@ inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t * m_blit_idle_op_bytes = 0; } -inline void epic12_device::gfx_upload(offs_t *addr) +inline void ep1c12_device::gfx_upload(offs_t *addr) { // 0x20000000 READ_NEXT_WORD(addr); @@ -247,101 +247,101 @@ inline void epic12_device::gfx_upload(offs_t *addr) #define draw_params m_bitmaps.get(), &m_clip, &m_bitmaps->pix(0,0),src_x,src_y, x,y, dimx,dimy, flipy, s_alpha, d_alpha, &tint_clr -const epic12_device::blitfunction epic12_device::f0_ti1_tr1_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f0_ti1_tr1_blit_funcs[64] = { - epic12_device::draw_sprite_f0_ti1_tr1_s0_d0, epic12_device::draw_sprite_f0_ti1_tr1_s1_d0, epic12_device::draw_sprite_f0_ti1_tr1_s2_d0, epic12_device::draw_sprite_f0_ti1_tr1_s3_d0, epic12_device::draw_sprite_f0_ti1_tr1_s4_d0, epic12_device::draw_sprite_f0_ti1_tr1_s5_d0, epic12_device::draw_sprite_f0_ti1_tr1_s6_d0, epic12_device::draw_sprite_f0_ti1_tr1_s7_d0, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d1, epic12_device::draw_sprite_f0_ti1_tr1_s1_d1, epic12_device::draw_sprite_f0_ti1_tr1_s2_d1, epic12_device::draw_sprite_f0_ti1_tr1_s3_d1, epic12_device::draw_sprite_f0_ti1_tr1_s4_d1, epic12_device::draw_sprite_f0_ti1_tr1_s5_d1, epic12_device::draw_sprite_f0_ti1_tr1_s6_d1, epic12_device::draw_sprite_f0_ti1_tr1_s7_d1, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d2, epic12_device::draw_sprite_f0_ti1_tr1_s1_d2, epic12_device::draw_sprite_f0_ti1_tr1_s2_d2, epic12_device::draw_sprite_f0_ti1_tr1_s3_d2, epic12_device::draw_sprite_f0_ti1_tr1_s4_d2, epic12_device::draw_sprite_f0_ti1_tr1_s5_d2, epic12_device::draw_sprite_f0_ti1_tr1_s6_d2, epic12_device::draw_sprite_f0_ti1_tr1_s7_d2, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d3, epic12_device::draw_sprite_f0_ti1_tr1_s1_d3, epic12_device::draw_sprite_f0_ti1_tr1_s2_d3, epic12_device::draw_sprite_f0_ti1_tr1_s3_d3, epic12_device::draw_sprite_f0_ti1_tr1_s4_d3, epic12_device::draw_sprite_f0_ti1_tr1_s5_d3, epic12_device::draw_sprite_f0_ti1_tr1_s6_d3, epic12_device::draw_sprite_f0_ti1_tr1_s7_d3, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d4, epic12_device::draw_sprite_f0_ti1_tr1_s1_d4, epic12_device::draw_sprite_f0_ti1_tr1_s2_d4, epic12_device::draw_sprite_f0_ti1_tr1_s3_d4, epic12_device::draw_sprite_f0_ti1_tr1_s4_d4, epic12_device::draw_sprite_f0_ti1_tr1_s5_d4, epic12_device::draw_sprite_f0_ti1_tr1_s6_d4, epic12_device::draw_sprite_f0_ti1_tr1_s7_d4, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d5, epic12_device::draw_sprite_f0_ti1_tr1_s1_d5, epic12_device::draw_sprite_f0_ti1_tr1_s2_d5, epic12_device::draw_sprite_f0_ti1_tr1_s3_d5, epic12_device::draw_sprite_f0_ti1_tr1_s4_d5, epic12_device::draw_sprite_f0_ti1_tr1_s5_d5, epic12_device::draw_sprite_f0_ti1_tr1_s6_d5, epic12_device::draw_sprite_f0_ti1_tr1_s7_d5, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d6, epic12_device::draw_sprite_f0_ti1_tr1_s1_d6, epic12_device::draw_sprite_f0_ti1_tr1_s2_d6, epic12_device::draw_sprite_f0_ti1_tr1_s3_d6, epic12_device::draw_sprite_f0_ti1_tr1_s4_d6, epic12_device::draw_sprite_f0_ti1_tr1_s5_d6, epic12_device::draw_sprite_f0_ti1_tr1_s6_d6, epic12_device::draw_sprite_f0_ti1_tr1_s7_d6, - epic12_device::draw_sprite_f0_ti1_tr1_s0_d7, epic12_device::draw_sprite_f0_ti1_tr1_s1_d7, epic12_device::draw_sprite_f0_ti1_tr1_s2_d7, epic12_device::draw_sprite_f0_ti1_tr1_s3_d7, epic12_device::draw_sprite_f0_ti1_tr1_s4_d7, epic12_device::draw_sprite_f0_ti1_tr1_s5_d7, epic12_device::draw_sprite_f0_ti1_tr1_s6_d7, epic12_device::draw_sprite_f0_ti1_tr1_s7_d7, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d0, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d0, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d1, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d1, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d2, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d2, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d3, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d3, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d4, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d4, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d5, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d5, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d6, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d6, + ep1c12_device::draw_sprite_f0_ti1_tr1_s0_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s1_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s2_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s3_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s4_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s5_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s6_d7, ep1c12_device::draw_sprite_f0_ti1_tr1_s7_d7, }; -const epic12_device::blitfunction epic12_device::f0_ti1_tr0_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f0_ti1_tr0_blit_funcs[64] = { - epic12_device::draw_sprite_f0_ti1_tr0_s0_d0, epic12_device::draw_sprite_f0_ti1_tr0_s1_d0, epic12_device::draw_sprite_f0_ti1_tr0_s2_d0, epic12_device::draw_sprite_f0_ti1_tr0_s3_d0, epic12_device::draw_sprite_f0_ti1_tr0_s4_d0, epic12_device::draw_sprite_f0_ti1_tr0_s5_d0, epic12_device::draw_sprite_f0_ti1_tr0_s6_d0, epic12_device::draw_sprite_f0_ti1_tr0_s7_d0, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d1, epic12_device::draw_sprite_f0_ti1_tr0_s1_d1, epic12_device::draw_sprite_f0_ti1_tr0_s2_d1, epic12_device::draw_sprite_f0_ti1_tr0_s3_d1, epic12_device::draw_sprite_f0_ti1_tr0_s4_d1, epic12_device::draw_sprite_f0_ti1_tr0_s5_d1, epic12_device::draw_sprite_f0_ti1_tr0_s6_d1, epic12_device::draw_sprite_f0_ti1_tr0_s7_d1, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d2, epic12_device::draw_sprite_f0_ti1_tr0_s1_d2, epic12_device::draw_sprite_f0_ti1_tr0_s2_d2, epic12_device::draw_sprite_f0_ti1_tr0_s3_d2, epic12_device::draw_sprite_f0_ti1_tr0_s4_d2, epic12_device::draw_sprite_f0_ti1_tr0_s5_d2, epic12_device::draw_sprite_f0_ti1_tr0_s6_d2, epic12_device::draw_sprite_f0_ti1_tr0_s7_d2, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d3, epic12_device::draw_sprite_f0_ti1_tr0_s1_d3, epic12_device::draw_sprite_f0_ti1_tr0_s2_d3, epic12_device::draw_sprite_f0_ti1_tr0_s3_d3, epic12_device::draw_sprite_f0_ti1_tr0_s4_d3, epic12_device::draw_sprite_f0_ti1_tr0_s5_d3, epic12_device::draw_sprite_f0_ti1_tr0_s6_d3, epic12_device::draw_sprite_f0_ti1_tr0_s7_d3, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d4, epic12_device::draw_sprite_f0_ti1_tr0_s1_d4, epic12_device::draw_sprite_f0_ti1_tr0_s2_d4, epic12_device::draw_sprite_f0_ti1_tr0_s3_d4, epic12_device::draw_sprite_f0_ti1_tr0_s4_d4, epic12_device::draw_sprite_f0_ti1_tr0_s5_d4, epic12_device::draw_sprite_f0_ti1_tr0_s6_d4, epic12_device::draw_sprite_f0_ti1_tr0_s7_d4, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d5, epic12_device::draw_sprite_f0_ti1_tr0_s1_d5, epic12_device::draw_sprite_f0_ti1_tr0_s2_d5, epic12_device::draw_sprite_f0_ti1_tr0_s3_d5, epic12_device::draw_sprite_f0_ti1_tr0_s4_d5, epic12_device::draw_sprite_f0_ti1_tr0_s5_d5, epic12_device::draw_sprite_f0_ti1_tr0_s6_d5, epic12_device::draw_sprite_f0_ti1_tr0_s7_d5, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d6, epic12_device::draw_sprite_f0_ti1_tr0_s1_d6, epic12_device::draw_sprite_f0_ti1_tr0_s2_d6, epic12_device::draw_sprite_f0_ti1_tr0_s3_d6, epic12_device::draw_sprite_f0_ti1_tr0_s4_d6, epic12_device::draw_sprite_f0_ti1_tr0_s5_d6, epic12_device::draw_sprite_f0_ti1_tr0_s6_d6, epic12_device::draw_sprite_f0_ti1_tr0_s7_d6, - epic12_device::draw_sprite_f0_ti1_tr0_s0_d7, epic12_device::draw_sprite_f0_ti1_tr0_s1_d7, epic12_device::draw_sprite_f0_ti1_tr0_s2_d7, epic12_device::draw_sprite_f0_ti1_tr0_s3_d7, epic12_device::draw_sprite_f0_ti1_tr0_s4_d7, epic12_device::draw_sprite_f0_ti1_tr0_s5_d7, epic12_device::draw_sprite_f0_ti1_tr0_s6_d7, epic12_device::draw_sprite_f0_ti1_tr0_s7_d7, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d0, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d0, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d1, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d1, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d2, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d2, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d3, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d3, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d4, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d4, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d5, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d5, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d6, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d6, + ep1c12_device::draw_sprite_f0_ti1_tr0_s0_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s1_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s2_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s3_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s4_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s5_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s6_d7, ep1c12_device::draw_sprite_f0_ti1_tr0_s7_d7, }; -const epic12_device::blitfunction epic12_device::f1_ti1_tr1_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f1_ti1_tr1_blit_funcs[64] = { - epic12_device::draw_sprite_f1_ti1_tr1_s0_d0, epic12_device::draw_sprite_f1_ti1_tr1_s1_d0, epic12_device::draw_sprite_f1_ti1_tr1_s2_d0, epic12_device::draw_sprite_f1_ti1_tr1_s3_d0, epic12_device::draw_sprite_f1_ti1_tr1_s4_d0, epic12_device::draw_sprite_f1_ti1_tr1_s5_d0, epic12_device::draw_sprite_f1_ti1_tr1_s6_d0, epic12_device::draw_sprite_f1_ti1_tr1_s7_d0, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d1, epic12_device::draw_sprite_f1_ti1_tr1_s1_d1, epic12_device::draw_sprite_f1_ti1_tr1_s2_d1, epic12_device::draw_sprite_f1_ti1_tr1_s3_d1, epic12_device::draw_sprite_f1_ti1_tr1_s4_d1, epic12_device::draw_sprite_f1_ti1_tr1_s5_d1, epic12_device::draw_sprite_f1_ti1_tr1_s6_d1, epic12_device::draw_sprite_f1_ti1_tr1_s7_d1, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d2, epic12_device::draw_sprite_f1_ti1_tr1_s1_d2, epic12_device::draw_sprite_f1_ti1_tr1_s2_d2, epic12_device::draw_sprite_f1_ti1_tr1_s3_d2, epic12_device::draw_sprite_f1_ti1_tr1_s4_d2, epic12_device::draw_sprite_f1_ti1_tr1_s5_d2, epic12_device::draw_sprite_f1_ti1_tr1_s6_d2, epic12_device::draw_sprite_f1_ti1_tr1_s7_d2, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d3, epic12_device::draw_sprite_f1_ti1_tr1_s1_d3, epic12_device::draw_sprite_f1_ti1_tr1_s2_d3, epic12_device::draw_sprite_f1_ti1_tr1_s3_d3, epic12_device::draw_sprite_f1_ti1_tr1_s4_d3, epic12_device::draw_sprite_f1_ti1_tr1_s5_d3, epic12_device::draw_sprite_f1_ti1_tr1_s6_d3, epic12_device::draw_sprite_f1_ti1_tr1_s7_d3, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d4, epic12_device::draw_sprite_f1_ti1_tr1_s1_d4, epic12_device::draw_sprite_f1_ti1_tr1_s2_d4, epic12_device::draw_sprite_f1_ti1_tr1_s3_d4, epic12_device::draw_sprite_f1_ti1_tr1_s4_d4, epic12_device::draw_sprite_f1_ti1_tr1_s5_d4, epic12_device::draw_sprite_f1_ti1_tr1_s6_d4, epic12_device::draw_sprite_f1_ti1_tr1_s7_d4, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d5, epic12_device::draw_sprite_f1_ti1_tr1_s1_d5, epic12_device::draw_sprite_f1_ti1_tr1_s2_d5, epic12_device::draw_sprite_f1_ti1_tr1_s3_d5, epic12_device::draw_sprite_f1_ti1_tr1_s4_d5, epic12_device::draw_sprite_f1_ti1_tr1_s5_d5, epic12_device::draw_sprite_f1_ti1_tr1_s6_d5, epic12_device::draw_sprite_f1_ti1_tr1_s7_d5, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d6, epic12_device::draw_sprite_f1_ti1_tr1_s1_d6, epic12_device::draw_sprite_f1_ti1_tr1_s2_d6, epic12_device::draw_sprite_f1_ti1_tr1_s3_d6, epic12_device::draw_sprite_f1_ti1_tr1_s4_d6, epic12_device::draw_sprite_f1_ti1_tr1_s5_d6, epic12_device::draw_sprite_f1_ti1_tr1_s6_d6, epic12_device::draw_sprite_f1_ti1_tr1_s7_d6, - epic12_device::draw_sprite_f1_ti1_tr1_s0_d7, epic12_device::draw_sprite_f1_ti1_tr1_s1_d7, epic12_device::draw_sprite_f1_ti1_tr1_s2_d7, epic12_device::draw_sprite_f1_ti1_tr1_s3_d7, epic12_device::draw_sprite_f1_ti1_tr1_s4_d7, epic12_device::draw_sprite_f1_ti1_tr1_s5_d7, epic12_device::draw_sprite_f1_ti1_tr1_s6_d7, epic12_device::draw_sprite_f1_ti1_tr1_s7_d7, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d0, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d0, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d1, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d1, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d2, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d2, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d3, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d3, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d4, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d4, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d5, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d5, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d6, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d6, + ep1c12_device::draw_sprite_f1_ti1_tr1_s0_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s1_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s2_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s3_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s4_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s5_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s6_d7, ep1c12_device::draw_sprite_f1_ti1_tr1_s7_d7, }; -const epic12_device::blitfunction epic12_device::f1_ti1_tr0_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f1_ti1_tr0_blit_funcs[64] = { - epic12_device::draw_sprite_f1_ti1_tr0_s0_d0, epic12_device::draw_sprite_f1_ti1_tr0_s1_d0, epic12_device::draw_sprite_f1_ti1_tr0_s2_d0, epic12_device::draw_sprite_f1_ti1_tr0_s3_d0, epic12_device::draw_sprite_f1_ti1_tr0_s4_d0, epic12_device::draw_sprite_f1_ti1_tr0_s5_d0, epic12_device::draw_sprite_f1_ti1_tr0_s6_d0, epic12_device::draw_sprite_f1_ti1_tr0_s7_d0, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d1, epic12_device::draw_sprite_f1_ti1_tr0_s1_d1, epic12_device::draw_sprite_f1_ti1_tr0_s2_d1, epic12_device::draw_sprite_f1_ti1_tr0_s3_d1, epic12_device::draw_sprite_f1_ti1_tr0_s4_d1, epic12_device::draw_sprite_f1_ti1_tr0_s5_d1, epic12_device::draw_sprite_f1_ti1_tr0_s6_d1, epic12_device::draw_sprite_f1_ti1_tr0_s7_d1, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d2, epic12_device::draw_sprite_f1_ti1_tr0_s1_d2, epic12_device::draw_sprite_f1_ti1_tr0_s2_d2, epic12_device::draw_sprite_f1_ti1_tr0_s3_d2, epic12_device::draw_sprite_f1_ti1_tr0_s4_d2, epic12_device::draw_sprite_f1_ti1_tr0_s5_d2, epic12_device::draw_sprite_f1_ti1_tr0_s6_d2, epic12_device::draw_sprite_f1_ti1_tr0_s7_d2, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d3, epic12_device::draw_sprite_f1_ti1_tr0_s1_d3, epic12_device::draw_sprite_f1_ti1_tr0_s2_d3, epic12_device::draw_sprite_f1_ti1_tr0_s3_d3, epic12_device::draw_sprite_f1_ti1_tr0_s4_d3, epic12_device::draw_sprite_f1_ti1_tr0_s5_d3, epic12_device::draw_sprite_f1_ti1_tr0_s6_d3, epic12_device::draw_sprite_f1_ti1_tr0_s7_d3, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d4, epic12_device::draw_sprite_f1_ti1_tr0_s1_d4, epic12_device::draw_sprite_f1_ti1_tr0_s2_d4, epic12_device::draw_sprite_f1_ti1_tr0_s3_d4, epic12_device::draw_sprite_f1_ti1_tr0_s4_d4, epic12_device::draw_sprite_f1_ti1_tr0_s5_d4, epic12_device::draw_sprite_f1_ti1_tr0_s6_d4, epic12_device::draw_sprite_f1_ti1_tr0_s7_d4, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d5, epic12_device::draw_sprite_f1_ti1_tr0_s1_d5, epic12_device::draw_sprite_f1_ti1_tr0_s2_d5, epic12_device::draw_sprite_f1_ti1_tr0_s3_d5, epic12_device::draw_sprite_f1_ti1_tr0_s4_d5, epic12_device::draw_sprite_f1_ti1_tr0_s5_d5, epic12_device::draw_sprite_f1_ti1_tr0_s6_d5, epic12_device::draw_sprite_f1_ti1_tr0_s7_d5, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d6, epic12_device::draw_sprite_f1_ti1_tr0_s1_d6, epic12_device::draw_sprite_f1_ti1_tr0_s2_d6, epic12_device::draw_sprite_f1_ti1_tr0_s3_d6, epic12_device::draw_sprite_f1_ti1_tr0_s4_d6, epic12_device::draw_sprite_f1_ti1_tr0_s5_d6, epic12_device::draw_sprite_f1_ti1_tr0_s6_d6, epic12_device::draw_sprite_f1_ti1_tr0_s7_d6, - epic12_device::draw_sprite_f1_ti1_tr0_s0_d7, epic12_device::draw_sprite_f1_ti1_tr0_s1_d7, epic12_device::draw_sprite_f1_ti1_tr0_s2_d7, epic12_device::draw_sprite_f1_ti1_tr0_s3_d7, epic12_device::draw_sprite_f1_ti1_tr0_s4_d7, epic12_device::draw_sprite_f1_ti1_tr0_s5_d7, epic12_device::draw_sprite_f1_ti1_tr0_s6_d7, epic12_device::draw_sprite_f1_ti1_tr0_s7_d7, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d0, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d0, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d1, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d1, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d2, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d2, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d3, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d3, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d4, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d4, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d5, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d5, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d6, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d6, + ep1c12_device::draw_sprite_f1_ti1_tr0_s0_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s1_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s2_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s3_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s4_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s5_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s6_d7, ep1c12_device::draw_sprite_f1_ti1_tr0_s7_d7, }; -const epic12_device::blitfunction epic12_device::f0_ti0_tr1_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f0_ti0_tr1_blit_funcs[64] = { - epic12_device::draw_sprite_f0_ti0_tr1_s0_d0, epic12_device::draw_sprite_f0_ti0_tr1_s1_d0, epic12_device::draw_sprite_f0_ti0_tr1_s2_d0, epic12_device::draw_sprite_f0_ti0_tr1_s3_d0, epic12_device::draw_sprite_f0_ti0_tr1_s4_d0, epic12_device::draw_sprite_f0_ti0_tr1_s5_d0, epic12_device::draw_sprite_f0_ti0_tr1_s6_d0, epic12_device::draw_sprite_f0_ti0_tr1_s7_d0, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d1, epic12_device::draw_sprite_f0_ti0_tr1_s1_d1, epic12_device::draw_sprite_f0_ti0_tr1_s2_d1, epic12_device::draw_sprite_f0_ti0_tr1_s3_d1, epic12_device::draw_sprite_f0_ti0_tr1_s4_d1, epic12_device::draw_sprite_f0_ti0_tr1_s5_d1, epic12_device::draw_sprite_f0_ti0_tr1_s6_d1, epic12_device::draw_sprite_f0_ti0_tr1_s7_d1, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d2, epic12_device::draw_sprite_f0_ti0_tr1_s1_d2, epic12_device::draw_sprite_f0_ti0_tr1_s2_d2, epic12_device::draw_sprite_f0_ti0_tr1_s3_d2, epic12_device::draw_sprite_f0_ti0_tr1_s4_d2, epic12_device::draw_sprite_f0_ti0_tr1_s5_d2, epic12_device::draw_sprite_f0_ti0_tr1_s6_d2, epic12_device::draw_sprite_f0_ti0_tr1_s7_d2, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d3, epic12_device::draw_sprite_f0_ti0_tr1_s1_d3, epic12_device::draw_sprite_f0_ti0_tr1_s2_d3, epic12_device::draw_sprite_f0_ti0_tr1_s3_d3, epic12_device::draw_sprite_f0_ti0_tr1_s4_d3, epic12_device::draw_sprite_f0_ti0_tr1_s5_d3, epic12_device::draw_sprite_f0_ti0_tr1_s6_d3, epic12_device::draw_sprite_f0_ti0_tr1_s7_d3, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d4, epic12_device::draw_sprite_f0_ti0_tr1_s1_d4, epic12_device::draw_sprite_f0_ti0_tr1_s2_d4, epic12_device::draw_sprite_f0_ti0_tr1_s3_d4, epic12_device::draw_sprite_f0_ti0_tr1_s4_d4, epic12_device::draw_sprite_f0_ti0_tr1_s5_d4, epic12_device::draw_sprite_f0_ti0_tr1_s6_d4, epic12_device::draw_sprite_f0_ti0_tr1_s7_d4, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d5, epic12_device::draw_sprite_f0_ti0_tr1_s1_d5, epic12_device::draw_sprite_f0_ti0_tr1_s2_d5, epic12_device::draw_sprite_f0_ti0_tr1_s3_d5, epic12_device::draw_sprite_f0_ti0_tr1_s4_d5, epic12_device::draw_sprite_f0_ti0_tr1_s5_d5, epic12_device::draw_sprite_f0_ti0_tr1_s6_d5, epic12_device::draw_sprite_f0_ti0_tr1_s7_d5, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d6, epic12_device::draw_sprite_f0_ti0_tr1_s1_d6, epic12_device::draw_sprite_f0_ti0_tr1_s2_d6, epic12_device::draw_sprite_f0_ti0_tr1_s3_d6, epic12_device::draw_sprite_f0_ti0_tr1_s4_d6, epic12_device::draw_sprite_f0_ti0_tr1_s5_d6, epic12_device::draw_sprite_f0_ti0_tr1_s6_d6, epic12_device::draw_sprite_f0_ti0_tr1_s7_d6, - epic12_device::draw_sprite_f0_ti0_tr1_s0_d7, epic12_device::draw_sprite_f0_ti0_tr1_s1_d7, epic12_device::draw_sprite_f0_ti0_tr1_s2_d7, epic12_device::draw_sprite_f0_ti0_tr1_s3_d7, epic12_device::draw_sprite_f0_ti0_tr1_s4_d7, epic12_device::draw_sprite_f0_ti0_tr1_s5_d7, epic12_device::draw_sprite_f0_ti0_tr1_s6_d7, epic12_device::draw_sprite_f0_ti0_tr1_s7_d7, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d0, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d0, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d1, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d1, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d2, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d2, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d3, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d3, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d4, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d4, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d5, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d5, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d6, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d6, + ep1c12_device::draw_sprite_f0_ti0_tr1_s0_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s1_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s2_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s3_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s4_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s5_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s6_d7, ep1c12_device::draw_sprite_f0_ti0_tr1_s7_d7, }; -const epic12_device::blitfunction epic12_device::f0_ti0_tr0_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f0_ti0_tr0_blit_funcs[64] = { - epic12_device::draw_sprite_f0_ti0_tr0_s0_d0, epic12_device::draw_sprite_f0_ti0_tr0_s1_d0, epic12_device::draw_sprite_f0_ti0_tr0_s2_d0, epic12_device::draw_sprite_f0_ti0_tr0_s3_d0, epic12_device::draw_sprite_f0_ti0_tr0_s4_d0, epic12_device::draw_sprite_f0_ti0_tr0_s5_d0, epic12_device::draw_sprite_f0_ti0_tr0_s6_d0, epic12_device::draw_sprite_f0_ti0_tr0_s7_d0, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d1, epic12_device::draw_sprite_f0_ti0_tr0_s1_d1, epic12_device::draw_sprite_f0_ti0_tr0_s2_d1, epic12_device::draw_sprite_f0_ti0_tr0_s3_d1, epic12_device::draw_sprite_f0_ti0_tr0_s4_d1, epic12_device::draw_sprite_f0_ti0_tr0_s5_d1, epic12_device::draw_sprite_f0_ti0_tr0_s6_d1, epic12_device::draw_sprite_f0_ti0_tr0_s7_d1, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d2, epic12_device::draw_sprite_f0_ti0_tr0_s1_d2, epic12_device::draw_sprite_f0_ti0_tr0_s2_d2, epic12_device::draw_sprite_f0_ti0_tr0_s3_d2, epic12_device::draw_sprite_f0_ti0_tr0_s4_d2, epic12_device::draw_sprite_f0_ti0_tr0_s5_d2, epic12_device::draw_sprite_f0_ti0_tr0_s6_d2, epic12_device::draw_sprite_f0_ti0_tr0_s7_d2, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d3, epic12_device::draw_sprite_f0_ti0_tr0_s1_d3, epic12_device::draw_sprite_f0_ti0_tr0_s2_d3, epic12_device::draw_sprite_f0_ti0_tr0_s3_d3, epic12_device::draw_sprite_f0_ti0_tr0_s4_d3, epic12_device::draw_sprite_f0_ti0_tr0_s5_d3, epic12_device::draw_sprite_f0_ti0_tr0_s6_d3, epic12_device::draw_sprite_f0_ti0_tr0_s7_d3, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d4, epic12_device::draw_sprite_f0_ti0_tr0_s1_d4, epic12_device::draw_sprite_f0_ti0_tr0_s2_d4, epic12_device::draw_sprite_f0_ti0_tr0_s3_d4, epic12_device::draw_sprite_f0_ti0_tr0_s4_d4, epic12_device::draw_sprite_f0_ti0_tr0_s5_d4, epic12_device::draw_sprite_f0_ti0_tr0_s6_d4, epic12_device::draw_sprite_f0_ti0_tr0_s7_d4, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d5, epic12_device::draw_sprite_f0_ti0_tr0_s1_d5, epic12_device::draw_sprite_f0_ti0_tr0_s2_d5, epic12_device::draw_sprite_f0_ti0_tr0_s3_d5, epic12_device::draw_sprite_f0_ti0_tr0_s4_d5, epic12_device::draw_sprite_f0_ti0_tr0_s5_d5, epic12_device::draw_sprite_f0_ti0_tr0_s6_d5, epic12_device::draw_sprite_f0_ti0_tr0_s7_d5, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d6, epic12_device::draw_sprite_f0_ti0_tr0_s1_d6, epic12_device::draw_sprite_f0_ti0_tr0_s2_d6, epic12_device::draw_sprite_f0_ti0_tr0_s3_d6, epic12_device::draw_sprite_f0_ti0_tr0_s4_d6, epic12_device::draw_sprite_f0_ti0_tr0_s5_d6, epic12_device::draw_sprite_f0_ti0_tr0_s6_d6, epic12_device::draw_sprite_f0_ti0_tr0_s7_d6, - epic12_device::draw_sprite_f0_ti0_tr0_s0_d7, epic12_device::draw_sprite_f0_ti0_tr0_s1_d7, epic12_device::draw_sprite_f0_ti0_tr0_s2_d7, epic12_device::draw_sprite_f0_ti0_tr0_s3_d7, epic12_device::draw_sprite_f0_ti0_tr0_s4_d7, epic12_device::draw_sprite_f0_ti0_tr0_s5_d7, epic12_device::draw_sprite_f0_ti0_tr0_s6_d7, epic12_device::draw_sprite_f0_ti0_tr0_s7_d7, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d0, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d0, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d1, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d1, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d2, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d2, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d3, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d3, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d4, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d4, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d5, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d5, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d6, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d6, + ep1c12_device::draw_sprite_f0_ti0_tr0_s0_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s1_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s2_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s3_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s4_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s5_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s6_d7, ep1c12_device::draw_sprite_f0_ti0_tr0_s7_d7, }; -const epic12_device::blitfunction epic12_device::f1_ti0_tr1_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f1_ti0_tr1_blit_funcs[64] = { - epic12_device::draw_sprite_f1_ti0_tr1_s0_d0, epic12_device::draw_sprite_f1_ti0_tr1_s1_d0, epic12_device::draw_sprite_f1_ti0_tr1_s2_d0, epic12_device::draw_sprite_f1_ti0_tr1_s3_d0, epic12_device::draw_sprite_f1_ti0_tr1_s4_d0, epic12_device::draw_sprite_f1_ti0_tr1_s5_d0, epic12_device::draw_sprite_f1_ti0_tr1_s6_d0, epic12_device::draw_sprite_f1_ti0_tr1_s7_d0, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d1, epic12_device::draw_sprite_f1_ti0_tr1_s1_d1, epic12_device::draw_sprite_f1_ti0_tr1_s2_d1, epic12_device::draw_sprite_f1_ti0_tr1_s3_d1, epic12_device::draw_sprite_f1_ti0_tr1_s4_d1, epic12_device::draw_sprite_f1_ti0_tr1_s5_d1, epic12_device::draw_sprite_f1_ti0_tr1_s6_d1, epic12_device::draw_sprite_f1_ti0_tr1_s7_d1, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d2, epic12_device::draw_sprite_f1_ti0_tr1_s1_d2, epic12_device::draw_sprite_f1_ti0_tr1_s2_d2, epic12_device::draw_sprite_f1_ti0_tr1_s3_d2, epic12_device::draw_sprite_f1_ti0_tr1_s4_d2, epic12_device::draw_sprite_f1_ti0_tr1_s5_d2, epic12_device::draw_sprite_f1_ti0_tr1_s6_d2, epic12_device::draw_sprite_f1_ti0_tr1_s7_d2, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d3, epic12_device::draw_sprite_f1_ti0_tr1_s1_d3, epic12_device::draw_sprite_f1_ti0_tr1_s2_d3, epic12_device::draw_sprite_f1_ti0_tr1_s3_d3, epic12_device::draw_sprite_f1_ti0_tr1_s4_d3, epic12_device::draw_sprite_f1_ti0_tr1_s5_d3, epic12_device::draw_sprite_f1_ti0_tr1_s6_d3, epic12_device::draw_sprite_f1_ti0_tr1_s7_d3, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d4, epic12_device::draw_sprite_f1_ti0_tr1_s1_d4, epic12_device::draw_sprite_f1_ti0_tr1_s2_d4, epic12_device::draw_sprite_f1_ti0_tr1_s3_d4, epic12_device::draw_sprite_f1_ti0_tr1_s4_d4, epic12_device::draw_sprite_f1_ti0_tr1_s5_d4, epic12_device::draw_sprite_f1_ti0_tr1_s6_d4, epic12_device::draw_sprite_f1_ti0_tr1_s7_d4, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d5, epic12_device::draw_sprite_f1_ti0_tr1_s1_d5, epic12_device::draw_sprite_f1_ti0_tr1_s2_d5, epic12_device::draw_sprite_f1_ti0_tr1_s3_d5, epic12_device::draw_sprite_f1_ti0_tr1_s4_d5, epic12_device::draw_sprite_f1_ti0_tr1_s5_d5, epic12_device::draw_sprite_f1_ti0_tr1_s6_d5, epic12_device::draw_sprite_f1_ti0_tr1_s7_d5, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d6, epic12_device::draw_sprite_f1_ti0_tr1_s1_d6, epic12_device::draw_sprite_f1_ti0_tr1_s2_d6, epic12_device::draw_sprite_f1_ti0_tr1_s3_d6, epic12_device::draw_sprite_f1_ti0_tr1_s4_d6, epic12_device::draw_sprite_f1_ti0_tr1_s5_d6, epic12_device::draw_sprite_f1_ti0_tr1_s6_d6, epic12_device::draw_sprite_f1_ti0_tr1_s7_d6, - epic12_device::draw_sprite_f1_ti0_tr1_s0_d7, epic12_device::draw_sprite_f1_ti0_tr1_s1_d7, epic12_device::draw_sprite_f1_ti0_tr1_s2_d7, epic12_device::draw_sprite_f1_ti0_tr1_s3_d7, epic12_device::draw_sprite_f1_ti0_tr1_s4_d7, epic12_device::draw_sprite_f1_ti0_tr1_s5_d7, epic12_device::draw_sprite_f1_ti0_tr1_s6_d7, epic12_device::draw_sprite_f1_ti0_tr1_s7_d7, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d0, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d0, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d1, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d1, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d2, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d2, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d3, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d3, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d4, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d4, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d5, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d5, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d6, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d6, + ep1c12_device::draw_sprite_f1_ti0_tr1_s0_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s1_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s2_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s3_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s4_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s5_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s6_d7, ep1c12_device::draw_sprite_f1_ti0_tr1_s7_d7, }; -const epic12_device::blitfunction epic12_device::f1_ti0_tr0_blit_funcs[64] = +const ep1c12_device::blitfunction ep1c12_device::f1_ti0_tr0_blit_funcs[64] = { - epic12_device::draw_sprite_f1_ti0_tr0_s0_d0, epic12_device::draw_sprite_f1_ti0_tr0_s1_d0, epic12_device::draw_sprite_f1_ti0_tr0_s2_d0, epic12_device::draw_sprite_f1_ti0_tr0_s3_d0, epic12_device::draw_sprite_f1_ti0_tr0_s4_d0, epic12_device::draw_sprite_f1_ti0_tr0_s5_d0, epic12_device::draw_sprite_f1_ti0_tr0_s6_d0, epic12_device::draw_sprite_f1_ti0_tr0_s7_d0, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d1, epic12_device::draw_sprite_f1_ti0_tr0_s1_d1, epic12_device::draw_sprite_f1_ti0_tr0_s2_d1, epic12_device::draw_sprite_f1_ti0_tr0_s3_d1, epic12_device::draw_sprite_f1_ti0_tr0_s4_d1, epic12_device::draw_sprite_f1_ti0_tr0_s5_d1, epic12_device::draw_sprite_f1_ti0_tr0_s6_d1, epic12_device::draw_sprite_f1_ti0_tr0_s7_d1, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d2, epic12_device::draw_sprite_f1_ti0_tr0_s1_d2, epic12_device::draw_sprite_f1_ti0_tr0_s2_d2, epic12_device::draw_sprite_f1_ti0_tr0_s3_d2, epic12_device::draw_sprite_f1_ti0_tr0_s4_d2, epic12_device::draw_sprite_f1_ti0_tr0_s5_d2, epic12_device::draw_sprite_f1_ti0_tr0_s6_d2, epic12_device::draw_sprite_f1_ti0_tr0_s7_d2, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d3, epic12_device::draw_sprite_f1_ti0_tr0_s1_d3, epic12_device::draw_sprite_f1_ti0_tr0_s2_d3, epic12_device::draw_sprite_f1_ti0_tr0_s3_d3, epic12_device::draw_sprite_f1_ti0_tr0_s4_d3, epic12_device::draw_sprite_f1_ti0_tr0_s5_d3, epic12_device::draw_sprite_f1_ti0_tr0_s6_d3, epic12_device::draw_sprite_f1_ti0_tr0_s7_d3, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d4, epic12_device::draw_sprite_f1_ti0_tr0_s1_d4, epic12_device::draw_sprite_f1_ti0_tr0_s2_d4, epic12_device::draw_sprite_f1_ti0_tr0_s3_d4, epic12_device::draw_sprite_f1_ti0_tr0_s4_d4, epic12_device::draw_sprite_f1_ti0_tr0_s5_d4, epic12_device::draw_sprite_f1_ti0_tr0_s6_d4, epic12_device::draw_sprite_f1_ti0_tr0_s7_d4, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d5, epic12_device::draw_sprite_f1_ti0_tr0_s1_d5, epic12_device::draw_sprite_f1_ti0_tr0_s2_d5, epic12_device::draw_sprite_f1_ti0_tr0_s3_d5, epic12_device::draw_sprite_f1_ti0_tr0_s4_d5, epic12_device::draw_sprite_f1_ti0_tr0_s5_d5, epic12_device::draw_sprite_f1_ti0_tr0_s6_d5, epic12_device::draw_sprite_f1_ti0_tr0_s7_d5, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d6, epic12_device::draw_sprite_f1_ti0_tr0_s1_d6, epic12_device::draw_sprite_f1_ti0_tr0_s2_d6, epic12_device::draw_sprite_f1_ti0_tr0_s3_d6, epic12_device::draw_sprite_f1_ti0_tr0_s4_d6, epic12_device::draw_sprite_f1_ti0_tr0_s5_d6, epic12_device::draw_sprite_f1_ti0_tr0_s6_d6, epic12_device::draw_sprite_f1_ti0_tr0_s7_d6, - epic12_device::draw_sprite_f1_ti0_tr0_s0_d7, epic12_device::draw_sprite_f1_ti0_tr0_s1_d7, epic12_device::draw_sprite_f1_ti0_tr0_s2_d7, epic12_device::draw_sprite_f1_ti0_tr0_s3_d7, epic12_device::draw_sprite_f1_ti0_tr0_s4_d7, epic12_device::draw_sprite_f1_ti0_tr0_s5_d7, epic12_device::draw_sprite_f1_ti0_tr0_s6_d7, epic12_device::draw_sprite_f1_ti0_tr0_s7_d7, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d0, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d0, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d1, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d1, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d2, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d2, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d3, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d3, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d4, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d4, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d5, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d5, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d6, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d6, + ep1c12_device::draw_sprite_f1_ti0_tr0_s0_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s1_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s2_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s3_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s4_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s5_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s6_d7, ep1c12_device::draw_sprite_f1_ti0_tr0_s7_d7, }; /* @@ -405,7 +405,7 @@ inline u16 calculate_vram_accesses(u16 start_x, u16 start_y, u16 dimx, u16 dimy) others are reserved/disable? */ -inline void epic12_device::gfx_draw_shadow_copy(address_space &space, offs_t *addr) +inline void ep1c12_device::gfx_draw_shadow_copy(address_space &space, offs_t *addr) { COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); @@ -475,7 +475,7 @@ inline void epic12_device::gfx_draw_shadow_copy(address_space &space, offs_t *ad m_blit_delay_ns += num_vram_clk * EP1C_VRAM_CLK_NANOSEC; } -inline void epic12_device::gfx_draw(offs_t *addr) +inline void ep1c12_device::gfx_draw(offs_t *addr) { clr_t tint_clr; bool tinted = false; @@ -683,7 +683,7 @@ inline void epic12_device::gfx_draw(offs_t *addr) } -void epic12_device::gfx_create_shadow_copy(address_space &space) +void ep1c12_device::gfx_create_shadow_copy(address_space &space) { offs_t addr = m_gfx_addr & 0x1fffffff; @@ -727,7 +727,7 @@ void epic12_device::gfx_create_shadow_copy(address_space &space) } -void epic12_device::gfx_exec(void) +void ep1c12_device::gfx_exec() { offs_t addr = m_gfx_addr_shadowcopy & 0x1fffffff; m_clip.set(m_gfx_clip_x_shadowcopy - EP1C_CLIP_MARGIN, m_gfx_clip_x_shadowcopy + 320 - 1 + EP1C_CLIP_MARGIN, @@ -771,20 +771,20 @@ void epic12_device::gfx_exec(void) } } -void *epic12_device::blit_request_callback(void *param, int threadid) +void *ep1c12_device::blit_request_callback(void *param, int threadid) { - epic12_device *object = reinterpret_cast(param); + ep1c12_device *object = reinterpret_cast(param); object->gfx_exec(); return nullptr; } -u32 epic12_device::gfx_ready_r() +u32 ep1c12_device::gfx_ready_r() { return m_blitter_busy ? 0x00000000 : 0x00000010; } -void epic12_device::gfx_exec_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) +void ep1c12_device::gfx_exec_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) { if (ACCESSING_BITS_0_7) { @@ -828,7 +828,7 @@ void epic12_device::gfx_exec_w(address_space &space, offs_t offset, u32 data, u3 } } -void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) +void ep1c12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_blitter_request) { @@ -865,7 +865,6 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) int scroll_x = -m_gfx_scroll_x; int scroll_y = -m_gfx_scroll_y; - #if DEBUG_VRAM_VIEWER if (m_debug_vram_view_en) copybitmap(bitmap, *m_bitmaps, 0, 0, 0, 0, cliprect); @@ -875,7 +874,7 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) } -u32 epic12_device::blitter_r(offs_t offset, u32 mem_mask) +u32 ep1c12_device::blitter_r(offs_t offset, u32 mem_mask) { switch (offset * 4) { @@ -899,7 +898,7 @@ u32 epic12_device::blitter_r(offs_t offset, u32 mem_mask) return 0; } -void epic12_device::blitter_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) +void ep1c12_device::blitter_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) { switch (offset * 4) { @@ -938,26 +937,20 @@ void epic12_device::blitter_w(address_space &space, offs_t offset, u32 data, u32 } } -void epic12_device::install_handlers(int addr1, int addr2) +void ep1c12_device::install_handlers(int addr1, int addr2) { address_space &space = m_maincpu->space(AS_PROGRAM); - read32s_delegate read(*this); - write32_delegate write(*this); - - read = read32s_delegate(*this, FUNC(epic12_device::blitter_r)); - write = write32_delegate(*this, FUNC(epic12_device::blitter_w)); - - space.install_read_handler(addr1, addr2, std::move(read), 0xffffffffffffffffU); - space.install_write_handler(addr1, addr2, std::move(write), 0xffffffffffffffffU); + space.install_read_handler(addr1, addr2, emu::rw_delegate(*this, FUNC(ep1c12_device::blitter_r)), 0xffffffffffffffffU); + space.install_write_handler(addr1, addr2, emu::rw_delegate(*this, FUNC(ep1c12_device::blitter_w)), 0xffffffffffffffffU); } -u64 epic12_device::fpga_r() +u64 ep1c12_device::fpga_r() { return 0xff; } -void epic12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask) +void ep1c12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask) { if (ACCESSING_BITS_0_7) { @@ -977,7 +970,7 @@ void epic12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask) if (m_firmware_pos == 2323240) { u8 checksum = 0; - for(u8 c : m_firmware) + for (u8 c : m_firmware) checksum += c; switch (checksum) diff --git a/src/devices/video/epic12.h b/src/mame/cave/ep1c12.h similarity index 99% rename from src/devices/video/epic12.h rename to src/mame/cave/ep1c12.h index a314468139b22..3c0153f70ed38 100644 --- a/src/devices/video/epic12.h +++ b/src/mame/cave/ep1c12.h @@ -1,17 +1,17 @@ // license:BSD-3-Clause // copyright-holders:David Haywood, Luca Elia, MetalliC -/* emulation of Altera Cyclone EPIC12 FPGA programmed as a blitter */ -#ifndef MAME_VIDEO_EPIC12_H -#define MAME_VIDEO_EPIC12_H +/* emulation of Altera Cyclone EP1C12 FPGA programmed as a blitter */ +#ifndef MAME_CAVE_EP1C12_H +#define MAME_CAVE_EP1C12_H #pragma once #define DEBUG_VRAM_VIEWER 0 // VRAM viewer for debug -class epic12_device : public device_t, public device_video_interface +class ep1c12_device : public device_t, public device_video_interface { public: - epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + ep1c12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); template void set_cpu(T &&maintag) { m_maincpu.set_tag(std::forward(maintag)); } auto port_r_callback() { return m_port_r_cb.bind(); } @@ -58,7 +58,7 @@ class epic12_device : public device_t, public device_video_interface inline void gfx_draw_shadow_copy(address_space &space, offs_t *addr); inline void gfx_upload(offs_t *addr); inline void gfx_draw(offs_t *addr); - void gfx_exec(void); + void gfx_exec(); u32 gfx_ready_r(); void gfx_exec_w(address_space &space, offs_t offset, u32 data, u32 mem_mask = ~0); @@ -888,6 +888,6 @@ class epic12_device : public device_t, public device_video_interface }; -DECLARE_DEVICE_TYPE(EPIC12, epic12_device) +DECLARE_DEVICE_TYPE(EP1C12, ep1c12_device) -#endif // MAME_VIDEO_EPIC12_H +#endif // MAME_CAVE_EP1C12_H diff --git a/src/devices/video/epic12_blit0.cpp b/src/mame/cave/ep1c12_blit0.cpp similarity index 84% rename from src/devices/video/epic12_blit0.cpp rename to src/mame/cave/ep1c12_blit0.cpp index 3bf5072d0da2b..5cbc5aa8eb6fd 100644 --- a/src/devices/video/epic12_blit0.cpp +++ b/src/mame/cave/ep1c12_blit0.cpp @@ -8,12 +8,12 @@ #define TINT 0 #define TRANSPARENT 1 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f0_ti0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr1_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit1.cpp b/src/mame/cave/ep1c12_blit1.cpp similarity index 84% rename from src/devices/video/epic12_blit1.cpp rename to src/mame/cave/ep1c12_blit1.cpp index 8b21e25f72ca4..f5f4717f98bca 100644 --- a/src/devices/video/epic12_blit1.cpp +++ b/src/mame/cave/ep1c12_blit1.cpp @@ -8,12 +8,12 @@ #define TINT 0 #define TRANSPARENT 0 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti0_tr0_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit2.cpp b/src/mame/cave/ep1c12_blit2.cpp similarity index 84% rename from src/devices/video/epic12_blit2.cpp rename to src/mame/cave/ep1c12_blit2.cpp index f483a9c4c8cf1..476731c93d1a1 100644 --- a/src/devices/video/epic12_blit2.cpp +++ b/src/mame/cave/ep1c12_blit2.cpp @@ -8,12 +8,12 @@ #define TINT 0 #define TRANSPARENT 1 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f1_ti0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr1_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit3.cpp b/src/mame/cave/ep1c12_blit3.cpp similarity index 84% rename from src/devices/video/epic12_blit3.cpp rename to src/mame/cave/ep1c12_blit3.cpp index 5f90b58095214..d88a41c4af339 100644 --- a/src/devices/video/epic12_blit3.cpp +++ b/src/mame/cave/ep1c12_blit3.cpp @@ -8,12 +8,12 @@ #define TINT 0 #define TRANSPARENT 0 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti0_tr0_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit4.cpp b/src/mame/cave/ep1c12_blit4.cpp similarity index 84% rename from src/devices/video/epic12_blit4.cpp rename to src/mame/cave/ep1c12_blit4.cpp index 4220977d2b256..ab0f29e24c1f2 100644 --- a/src/devices/video/epic12_blit4.cpp +++ b/src/mame/cave/ep1c12_blit4.cpp @@ -8,12 +8,12 @@ #define TINT 1 #define TRANSPARENT 1 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr1_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit5.cpp b/src/mame/cave/ep1c12_blit5.cpp similarity index 84% rename from src/devices/video/epic12_blit5.cpp rename to src/mame/cave/ep1c12_blit5.cpp index d8c694d8ebfd9..a5933eed1ff24 100644 --- a/src/devices/video/epic12_blit5.cpp +++ b/src/mame/cave/ep1c12_blit5.cpp @@ -8,12 +8,12 @@ #define TINT 1 #define TRANSPARENT 0 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f0_ti1_tr0_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit6.cpp b/src/mame/cave/ep1c12_blit6.cpp similarity index 84% rename from src/devices/video/epic12_blit6.cpp rename to src/mame/cave/ep1c12_blit6.cpp index eedab81025fa4..c15ab1c91c8d3 100644 --- a/src/devices/video/epic12_blit6.cpp +++ b/src/mame/cave/ep1c12_blit6.cpp @@ -8,12 +8,12 @@ #define TINT 1 #define TRANSPARENT 1 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr1_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit7.cpp b/src/mame/cave/ep1c12_blit7.cpp similarity index 84% rename from src/devices/video/epic12_blit7.cpp rename to src/mame/cave/ep1c12_blit7.cpp index adfadba8e0e62..684a802087693 100644 --- a/src/devices/video/epic12_blit7.cpp +++ b/src/mame/cave/ep1c12_blit7.cpp @@ -8,12 +8,12 @@ #define TINT 1 #define TRANSPARENT 0 -#include "epic12.h" +#include "ep1c12.h" /* Special Case */ #define BLENDED 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_plain -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef BLENDED @@ -23,7 +23,7 @@ #define _SMODE 0 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -31,7 +31,7 @@ #define _SMODE 1 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -39,7 +39,7 @@ #define _SMODE 2 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -47,7 +47,7 @@ #define _SMODE 3 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -55,7 +55,7 @@ #define _SMODE 4 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -63,7 +63,7 @@ #define _SMODE 5 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -71,7 +71,7 @@ #define _SMODE 6 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -79,7 +79,7 @@ #define _SMODE 7 #define _DMODE 0 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d0 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -90,7 +90,7 @@ #define _SMODE 0 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -98,7 +98,7 @@ #define _SMODE 1 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -106,7 +106,7 @@ #define _SMODE 2 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -114,7 +114,7 @@ #define _SMODE 3 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -122,7 +122,7 @@ #define _SMODE 4 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -130,7 +130,7 @@ #define _SMODE 5 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -138,7 +138,7 @@ #define _SMODE 6 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -146,7 +146,7 @@ #define _SMODE 7 #define _DMODE 1 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d1 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -157,7 +157,7 @@ #define _SMODE 0 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -165,7 +165,7 @@ #define _SMODE 1 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -173,7 +173,7 @@ #define _SMODE 2 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -181,7 +181,7 @@ #define _SMODE 3 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -189,7 +189,7 @@ #define _SMODE 4 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -197,7 +197,7 @@ #define _SMODE 5 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -205,7 +205,7 @@ #define _SMODE 6 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -213,7 +213,7 @@ #define _SMODE 7 #define _DMODE 2 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d2 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -224,7 +224,7 @@ #define _SMODE 0 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -232,7 +232,7 @@ #define _SMODE 1 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -240,7 +240,7 @@ #define _SMODE 2 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -248,7 +248,7 @@ #define _SMODE 3 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -256,7 +256,7 @@ #define _SMODE 4 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -264,7 +264,7 @@ #define _SMODE 5 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -272,7 +272,7 @@ #define _SMODE 6 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -280,7 +280,7 @@ #define _SMODE 7 #define _DMODE 3 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d3 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -291,7 +291,7 @@ #define _SMODE 0 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -299,7 +299,7 @@ #define _SMODE 1 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -307,7 +307,7 @@ #define _SMODE 2 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -315,7 +315,7 @@ #define _SMODE 3 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -323,7 +323,7 @@ #define _SMODE 4 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -331,7 +331,7 @@ #define _SMODE 5 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -339,7 +339,7 @@ #define _SMODE 6 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -347,7 +347,7 @@ #define _SMODE 7 #define _DMODE 4 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d4 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -357,7 +357,7 @@ #define _SMODE 0 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -365,7 +365,7 @@ #define _SMODE 1 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -373,7 +373,7 @@ #define _SMODE 2 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -381,7 +381,7 @@ #define _SMODE 3 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -389,7 +389,7 @@ #define _SMODE 4 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -397,7 +397,7 @@ #define _SMODE 5 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -405,7 +405,7 @@ #define _SMODE 6 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -413,7 +413,7 @@ #define _SMODE 7 #define _DMODE 5 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d5 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -423,7 +423,7 @@ #define _SMODE 0 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -431,7 +431,7 @@ #define _SMODE 1 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -439,7 +439,7 @@ #define _SMODE 2 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -447,7 +447,7 @@ #define _SMODE 3 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -455,7 +455,7 @@ #define _SMODE 4 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -463,7 +463,7 @@ #define _SMODE 5 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -471,7 +471,7 @@ #define _SMODE 6 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -479,7 +479,7 @@ #define _SMODE 7 #define _DMODE 6 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d6 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -490,7 +490,7 @@ #define _SMODE 0 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s0_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -498,7 +498,7 @@ #define _SMODE 1 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s1_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -506,7 +506,7 @@ #define _SMODE 2 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s2_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -514,7 +514,7 @@ #define _SMODE 3 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s3_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -522,7 +522,7 @@ #define _SMODE 4 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s4_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -530,7 +530,7 @@ #define _SMODE 5 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s5_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -538,7 +538,7 @@ #define _SMODE 6 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s6_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE @@ -546,7 +546,7 @@ #define _SMODE 7 #define _DMODE 7 #define FUNCNAME draw_sprite_f1_ti1_tr0_s7_d7 -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef _SMODE #undef _DMODE diff --git a/src/devices/video/epic12_blit8.cpp b/src/mame/cave/ep1c12_blit8.cpp similarity index 85% rename from src/devices/video/epic12_blit8.cpp rename to src/mame/cave/ep1c12_blit8.cpp index fb0ff8a7e24a2..18cf340740907 100644 --- a/src/devices/video/epic12_blit8.cpp +++ b/src/mame/cave/ep1c12_blit8.cpp @@ -3,7 +3,7 @@ /* Special case 'Really Simple' blitters, no blending, no tinting etc.*/ #include "emu.h" -#include "epic12.h" +#include "ep1c12.h" #define REALLY_SIMPLE 1 @@ -12,13 +12,13 @@ #define TRANSPARENT 1 #define FLIPX 0 #define FUNCNAME draw_sprite_f0_ti0_tr1_simple -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef FLIPX #define FLIPX 1 #define FUNCNAME draw_sprite_f1_ti0_tr1_simple -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef FLIPX #undef TRANSPARENT @@ -27,13 +27,13 @@ #define TRANSPARENT 0 #define FLIPX 0 #define FUNCNAME draw_sprite_f0_ti0_tr0_simple -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef FLIPX #define FLIPX 1 #define FUNCNAME draw_sprite_f1_ti0_tr0_simple -#include "epic12in.hxx" +#include "ep1c12in.ipp" #undef FUNCNAME #undef FLIPX #undef TRANSPARENT diff --git a/src/devices/video/epic12in.hxx b/src/mame/cave/ep1c12in.ipp similarity index 89% rename from src/devices/video/epic12in.hxx rename to src/mame/cave/ep1c12in.ipp index 23d6a07f65e63..ea23630eb06fc 100644 --- a/src/devices/video/epic12in.hxx +++ b/src/mame/cave/ep1c12in.ipp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood /* blitter function */ -void epic12_device::FUNCNAME(BLIT_PARAMS) +void ep1c12_device::FUNCNAME(BLIT_PARAMS) { int yf; @@ -130,21 +130,21 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) while (bigblocks) { - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" - #include "epic12pixel.hxx" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" + #include "ep1c12pixel.ipp" bigblocks--; } #endif while (bmp < end) { - #include "epic12pixel.hxx" + #include "ep1c12pixel.ipp" } } diff --git a/src/devices/video/epic12pixel.hxx b/src/mame/cave/ep1c12pixel.ipp similarity index 100% rename from src/devices/video/epic12pixel.hxx rename to src/mame/cave/ep1c12pixel.ipp diff --git a/src/mame/cave/fstgfish.cpp b/src/mame/cave/fstgfish.cpp new file mode 100644 index 0000000000000..a08ee6074547a --- /dev/null +++ b/src/mame/cave/fstgfish.cpp @@ -0,0 +1,150 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + +Festival: Goldfish Scoop (c) 2008 CAVE/PLABI/SEVENGEARS/cavia + +PCIe era with Gigabyte GA-G31M-S2L (rev. 1.1/2.0), connected cards doesn't matter as long as the +CV1000XP/CV2000XP is connected thru USB. + +- Intel G31 + ICH7 +- IT8718 Super I/O +GA-G31M-S2L/GA-G31M-S2C datasheet reports these two (mutually exclusive?) +- RTL8111C (PCIe Integrated Gigabit Ethernet Controller) +- RTL8102E (PCIe Fast Ethernet NIC) + +Notes: +- CF card looks sysprep-ed, can't boot in shutms11. +- Following are drivers found in C:\WINDOWS\INF folder: +\- Several OEM*.inf files, targeting the chipset above; +\- eGalax Touchscreen Controller (VID=0eef, PID=0001/0002) +\- Renesas USB serial ports driver (VID=045b, PID=0020) + +=================================================================================================== + +Technical +========= + +The system consists of a standard motherboard and the CV1000XP board. +(ETA: alt setup seen with CV2000XP Rev. 1.0 on it) + +The CV1000XP has the following connectors and switches. + +IDC connectors. + +CN1: goes to the F_PANEL (Front Panel Header) on the motherboard. + Power switch, Reset switch, IDE LED, Sleep LED +CN2: goes to the F_USB1 header on the motherboard. This supplies + 5V as well. The 5V is always on regardless it is used for the + soft start. + +Molex connector. + +CN7: Standard molex, although it is plugged in it has no effect since + JP3 is in the position where power is taken from the F_USB1 connector. + +Switches: + +SW1 : Soft power off +SW5 : Reset + +Hacking +======= + +Game boots up on the HW but cannot be controlled due to lack of +touch screen. + +On a standard XP machine the game boots with an error due +to the missing CV1000XP card. + +Connecting directly into the CV1000XP CN2 with a standard +USB cable results in the message: USB device not recognized. Attempts to +increase the current on the 5V have not been succesful. + +Make a dd of the image, and write to an SSD disk, +the game will boot happily. Rename cvgame.exe to +goldfish.exe and copy in cmd.exe as cvgame.exe will +get us a command prompt. + +PS2 keyboard is working, USB keyboard and mouse have been +disabled in BIOS. BIOS is easily accessible using: DEL + +Use portmon to log the serial connection to the CV1000XP (COM3) +then start up the game. This gives a nice log of the communication. + +**************************************************************************************************/ + + +#include "emu.h" +#include "cpu/i386/i386.h" +#include "machine/pci.h" + + +namespace { + +class fstgfish_state : public driver_device +{ +public: + fstgfish_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + + void fstgfish(machine_config &config); + +private: + required_device m_maincpu; + void main_io(address_map &map); + void main_map(address_map &map); +}; + +/*****************************************************************************/ + +void fstgfish_state::main_map(address_map &map) +{ + map(0x00000000, 0x0009ffff).ram(); + map(0x000e0000, 0x000fffff).rom().region("bios", 0x60000); + map(0xfff80000, 0xffffffff).rom().region("bios", 0); +} + +void fstgfish_state::main_io(address_map &map) +{ +} + +/*****************************************************************************/ + + +static INPUT_PORTS_START(fstgfish) +INPUT_PORTS_END + + +void fstgfish_state::fstgfish(machine_config &config) +{ + PENTIUM3(config, m_maincpu, 200'000'000); /* Intel Core 2 Duo, 333/266/200 FSB clocks */ + m_maincpu->set_addrmap(AS_PROGRAM, &fstgfish_state::main_map); + m_maincpu->set_addrmap(AS_IO, &fstgfish_state::main_io); + + PCI_ROOT(config, "pci", 0); + // ... +} + +ROM_START(fstgfish) + ROM_REGION32_LE(0x80000, "bios", 0) + ROM_LOAD( "g31ms2l.f7", 0x000000, 0x80000, CRC(4f92f678) SHA1(c29ce14f093b5d6ef308f674fe4d514eb10e4742) ) + + DISK_REGION( "cfcard" ) + // CF with Windows XP embedded + DISK_IMAGE( "x11_15305", 0, SHA1(67bce99fb55760d0c06d698e68656eebbda8a28f) ) + + // H8S/2218 on CV2000XP board, assume with internal ROM + ROM_REGION(0x20000, "cv2000xp", ROMREGION_ERASEFF) + ROM_LOAD( "h8s2218.bin", 0x000000, 0x20000, NO_DUMP ) +ROM_END + +} // anonymous namespace + + +/*****************************************************************************/ + +GAME(2008, fstgfish, 0, fstgfish, fstgfish, fstgfish_state, empty_init, ROT0, "Cave", "Festival: Goldfish Scoop", MACHINE_IS_SKELETON ) diff --git a/src/mame/chess/tasc.cpp b/src/mame/chess/tasc.cpp index 4cfc9ad592627..52b410b0738ca 100644 --- a/src/mame/chess/tasc.cpp +++ b/src/mame/chess/tasc.cpp @@ -267,23 +267,23 @@ void tasc_state::main_map(address_map &map) static INPUT_PORTS_START( tasc ) PORT_START("IN.0") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("PLAY") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("LEFT") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("IN.1") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACK") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("RIGHT") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("IN.2") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MENU") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("UP") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Menu") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Left Clock") PORT_START("IN.3") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("ENTER") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("DOWN") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Right Clock") PORT_START("CPU") diff --git a/src/mame/chess/yeno_301xl.cpp b/src/mame/chess/yeno_301xl.cpp index a7b6bf350ca68..51d3ad323b672 100644 --- a/src/mame/chess/yeno_301xl.cpp +++ b/src/mame/chess/yeno_301xl.cpp @@ -175,7 +175,7 @@ static INPUT_PORTS_START( y301xl ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New") diff --git a/src/mame/chess/yeno_532xl.cpp b/src/mame/chess/yeno_532xl.cpp index 50121c4ba14dc..fd60cf1a8dd8a 100644 --- a/src/mame/chess/yeno_532xl.cpp +++ b/src/mame/chess/yeno_532xl.cpp @@ -204,7 +204,7 @@ static INPUT_PORTS_START( y532xl ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Show Move") PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game / Clear Board") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set Up") diff --git a/src/mame/cxg/dominator.cpp b/src/mame/cxg/dominator.cpp index dca2e66ddadd7..d99cfdc0f156a 100644 --- a/src/mame/cxg/dominator.cpp +++ b/src/mame/cxg/dominator.cpp @@ -79,7 +79,7 @@ class dominator_state : public driver_device void galaxy_map(address_map &map); // I/O handlers - void lcd_s_w(offs_t offset, u64 data); + void lcd_output_w(offs_t offset, u64 data); void control_w(u8 data); void leds_w(offs_t offset, u8 data); u8 input_r(offs_t offset); @@ -99,7 +99,7 @@ void dominator_state::machine_start() // LC7582 LCD -void dominator_state::lcd_s_w(offs_t offset, u64 data) +void dominator_state::lcd_output_w(offs_t offset, u64 data) { // output individual segments for (int i = 0; i < 52; i++) @@ -131,9 +131,9 @@ void dominator_state::lcd_s_w(offs_t offset, u64 data) void dominator_state::control_w(u8 data) { - // d2: LC7582 CE - // d1: LC7582 CLK // d0: LC7582 DATA + // d1: LC7582 CLK + // d2: LC7582 CE m_lcd->data_w(BIT(data, 0)); m_lcd->clk_w(BIT(data, 1)); m_lcd->ce_w(BIT(data, 2)); @@ -267,7 +267,7 @@ void dominator_state::dominator(machine_config &config) // video hardware LC7582(config, m_lcd, 0); - m_lcd->write_segs().set(FUNC(dominator_state::lcd_s_w)); + m_lcd->write_segs().set(FUNC(dominator_state::lcd_output_w)); PWM_DISPLAY(config, m_display).set_size(8+1, 8); config.set_default_layout(layout_cxg_dominator); diff --git a/src/mame/cxg/professor.cpp b/src/mame/cxg/professor.cpp index 41b9806c42db8..c52a1b6873927 100644 --- a/src/mame/cxg/professor.cpp +++ b/src/mame/cxg/professor.cpp @@ -70,7 +70,7 @@ class professor_state : public driver_device u16 m_inp_mux = 0; // I/O handlers - void lcd_s_w(offs_t offset, u64 data); + void lcd_output_w(offs_t offset, u64 data); template void leds_w(u8 data); void control_w(u8 data); u8 input_r(); @@ -98,7 +98,7 @@ INPUT_CHANGED_MEMBER(professor_state::on_button) m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); } -void professor_state::lcd_s_w(offs_t offset, u64 data) +void professor_state::lcd_output_w(offs_t offset, u64 data) { for (int i = 0; i < 52; i++) m_out_lcd[offset][i] = BIT(data, i); @@ -119,9 +119,9 @@ void professor_state::control_w(u8 data) // P23: speaker out m_dac->write(BIT(data, 3)); - // P26: LC7580 CE - // P25: LC7580 CLK // P24: LC7580 DATA + // P25: LC7580 CLK + // P26: LC7580 CE m_lcd->data_w(BIT(data, 4)); m_lcd->clk_w(BIT(data, 5)); m_lcd->ce_w(BIT(data, 6)); @@ -170,7 +170,7 @@ static INPUT_PORTS_START( professor ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_N) PORT_NAME("Reset") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Color") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Test") @@ -198,8 +198,8 @@ void professor_state::professor(machine_config &config) HD6301Y0(config, m_maincpu, 8_MHz_XTAL); m_maincpu->nvram_enable_backup(true); m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y_cpu_device::nvram_set_battery)); - m_maincpu->standby_cb().append(m_lcd, FUNC(lc7580_device::inh_w)); m_maincpu->standby_cb().append([this](int state) { if (state) m_display->clear(); }); + m_maincpu->standby_cb().append(m_lcd, FUNC(lc7580_device::inh_w)); m_maincpu->out_p1_cb().set(FUNC(professor_state::leds_w<0>)); m_maincpu->out_p4_cb().set(FUNC(professor_state::leds_w<1>)); m_maincpu->out_p2_cb().set(FUNC(professor_state::control_w)); @@ -213,7 +213,7 @@ void professor_state::professor(machine_config &config) // video hardware LC7580(config, m_lcd, 0); - m_lcd->write_segs().set(FUNC(professor_state::lcd_s_w)); + m_lcd->write_segs().set(FUNC(professor_state::lcd_output_w)); m_lcd->nvram_enable_backup(true); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); diff --git a/src/mame/cxg/senterprise.cpp b/src/mame/cxg/senterprise.cpp index 82001789c0224..1d9a74e653d1a 100644 --- a/src/mame/cxg/senterprise.cpp +++ b/src/mame/cxg/senterprise.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:hap -// thanks-to:Sean Riddle +// thanks-to:Sean Riddle, Berger /******************************************************************************* CXG Super Enterprise @@ -13,14 +13,20 @@ If this is not done, NVRAM won't save properly. TODO: - if/when MAME supports an exit callback, hook up power-off switch to that -- dump/add model 210.C (it has two small LCDs like Sphinx Galaxy) Hardware notes: -- PCB label (Super Crown): CXG 218-600-001 + +Super Crown: +- PCB label: CXG 218-600-001 - Hitachi HD6301Y0P (mode 2), 8MHz XTAL - 2KB battery-backed RAM (HM6116LP-3) - chessboard buttons, 24 LEDs, piezo +Super Enterprise (model 210.C): +- PCB label: 210C 600-002 +- Sanyo LC7580, same LCDs as Sphinx Galaxy +- rest is same as above + 210 MCU is used in: - CXG Super Enterprise (model 210, black/brown/blue) - CXG Advanced Star Chess (model 211) @@ -39,16 +45,20 @@ Hardware notes: #include "machine/nvram.h" #include "machine/sensorboard.h" #include "sound/dac.h" +#include "video/lc7580.h" #include "video/pwm.h" #include "speaker.h" // internal artwork #include "cxg_senterprise.lh" +#include "cxg_senterprisec.lh" namespace { +// model 210 / shared + class senterp_state : public driver_device { public: @@ -67,15 +77,16 @@ class senterp_state : public driver_device protected: virtual void machine_start() override; + virtual void machine_reset() override; -private: // devices/pointers required_device m_maincpu; required_device m_board; required_device m_display; - required_device m_dac; - required_ioport_array<2> m_inputs; + required_device m_dac; + required_ioport_array<3> m_inputs; + emu_timer *m_standbytimer; u8 m_inp_mux = 0; void main_map(address_map &map); @@ -83,28 +94,90 @@ class senterp_state : public driver_device // I/O handlers u8 input1_r(); u8 input2_r(); - void control_w(u8 data); + void leds_w(u8 data); void mux_w(u8 data); + + TIMER_CALLBACK_MEMBER(set_standby); }; void senterp_state::machine_start() { + m_standbytimer = timer_alloc(FUNC(senterp_state::set_standby), this); + + // register for savestates save_item(NAME(m_inp_mux)); } +// model 210.C + +class senterpc_state : public senterp_state +{ +public: + senterpc_state(const machine_config &mconfig, device_type type, const char *tag) : + senterp_state(mconfig, type, tag), + m_lcd(*this, "lcd"), + m_out_digit(*this, "digit%u", 0U), + m_out_lcd(*this, "s%u.%u", 0U, 0U) + { } + + void senterpc(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_lcd; + output_finder<8> m_out_digit; + output_finder<2, 52> m_out_lcd; + + void lcd_output_w(offs_t offset, u64 data); + void lcd_w(u8 data); +}; + +void senterpc_state::machine_start() +{ + senterp_state::machine_start(); + + // resolve handlers + m_out_digit.resolve(); + m_out_lcd.resolve(); +} + /******************************************************************************* - I/O + Power *******************************************************************************/ +void senterp_state::machine_reset() +{ + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_maincpu->set_input_line(M6801_STBY_LINE, CLEAR_LINE); +} + +TIMER_CALLBACK_MEMBER(senterp_state::set_standby) +{ + m_maincpu->set_input_line(M6801_STBY_LINE, ASSERT_LINE); +} + INPUT_CHANGED_MEMBER(senterp_state::power_off) { - // NMI when power switch is set to SAVE, which will trigger standby mode if (newval && !m_maincpu->standby()) - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); + { + // NMI when power switch is set to SAVE, followed by STBY (internal or STBY pin) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_standbytimer->adjust(attotime::from_msec(10)); + } } + + +/******************************************************************************* + I/O +*******************************************************************************/ + +// common + u8 senterp_state::input1_r() { u8 data = 0; @@ -114,8 +187,9 @@ u8 senterp_state::input1_r() if (m_inp_mux & m_inputs[i]->read()) data |= 1 << i; - // P26,P27: freq sel - return ~data ^ 0x80; + // P26,P27: freq sel (senterp) + data |= m_inputs[2]->read(); + return ~data; } u8 senterp_state::input2_r() @@ -130,11 +204,8 @@ u8 senterp_state::input2_r() return ~data; } -void senterp_state::control_w(u8 data) +void senterp_state::leds_w(u8 data) { - // P22: speaker out - m_dac->write(BIT(data, 2)); - // P23-P25: led select m_display->write_my(~data >> 3 & 7); } @@ -147,6 +218,49 @@ void senterp_state::mux_w(u8 data) } +// LCD (senterpc) + +void senterpc_state::lcd_output_w(offs_t offset, u64 data) +{ + // output individual segments + for (int i = 0; i < 52; i++) + m_out_lcd[offset][i] = BIT(data, i); + + // unscramble digit 7segs + static const u8 seg2digit[4*7] = + { + 0x03, 0x04, 0x00, 0x40, 0x41, 0x02, 0x42, + 0x05, 0x06, 0x07, 0x48, 0x44, 0x45, 0x46, + 0x0c, 0x0d, 0x0b, 0x0a, 0x4a, 0x4c, 0x4b, + 0x0e, 0x0f, 0x10, 0x50, 0x4d, 0x4e, 0x4f + }; + + for (int i = 0; i < 8; i++) + { + u8 digit = 0; + for (int seg = 0; seg < 7; seg++) + { + u8 bit = seg2digit[7 * (i & 3) + seg] + 26 * (i >> 2); + digit |= m_out_lcd[BIT(bit, 6)][bit & 0x3f] << seg; + } + m_out_digit[i] = digit; + } +} + +void senterpc_state::lcd_w(u8 data) +{ + // P22: LC7580 DATA + // P26: LC7580 CLK + // P27: LC7580 CE + m_lcd->data_w(BIT(data, 2)); + m_lcd->clk_w(BIT(data, 6)); + m_lcd->ce_w(BIT(data, 7)); + + // P22+P27: piezo + m_dac->write(BIT(data, 2) & BIT(~data, 7)); +} + + /******************************************************************************* Address Maps @@ -184,10 +298,25 @@ static INPUT_PORTS_START( senterp ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Enter Position") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + PORT_START("IN.2") + PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) // " + PORT_START("POWER") // needs to be triggered for nvram to work PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, senterp_state, power_off, 0) PORT_NAME("Power Off") INPUT_PORTS_END +static INPUT_PORTS_START( senterpc ) + PORT_INCLUDE( senterp ) + + PORT_MODIFY("IN.1") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Replay") + + PORT_MODIFY("IN.2") + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) +INPUT_PORTS_END + /******************************************************************************* @@ -203,7 +332,8 @@ void senterp_state::senterp(machine_config &config) m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery)); m_maincpu->standby_cb().append([this](int state) { if (state) m_display->clear(); }); m_maincpu->in_p2_cb().set(FUNC(senterp_state::input1_r)); - m_maincpu->out_p2_cb().set(FUNC(senterp_state::control_w)); + m_maincpu->out_p2_cb().set(FUNC(senterp_state::leds_w)); + m_maincpu->out_p2_cb().append(m_dac, FUNC(dac_1bit_device::write)).bit(2); m_maincpu->in_p5_cb().set(FUNC(senterp_state::input2_r)); m_maincpu->out_p6_cb().set(FUNC(senterp_state::mux_w)); @@ -223,6 +353,22 @@ void senterp_state::senterp(machine_config &config) DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); } +void senterpc_state::senterpc(machine_config &config) +{ + senterp(config); + + // basic machine hardware + m_maincpu->standby_cb().append(m_lcd, FUNC(lc7580_device::inh_w)); + m_maincpu->out_p2_cb().set(FUNC(senterpc_state::leds_w)); + m_maincpu->out_p2_cb().append(FUNC(senterpc_state::lcd_w)); + + // video hardware + LC7580(config, m_lcd, 0); + m_lcd->write_segs().set(FUNC(senterpc_state::lcd_output_w)); + + config.set_default_layout(layout_cxg_senterprisec); +} + /******************************************************************************* @@ -234,6 +380,11 @@ ROM_START( senterp ) ROM_LOAD("1985_210_newcrest_hd6301y0a14p", 0x0000, 0x4000, CRC(871719c8) SHA1(8c0f5bef2573b9cbebe87be3a899fec6308603be) ) ROM_END +ROM_START( senterpc ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD("1986_210c_cxg_systems_hd6301y0b27p", 0x0000, 0x4000, CRC(5bb67dd6) SHA1(753c33643a5c45e899d0f4743d3ccf7a0728bd48) ) +ROM_END + } // anonymous namespace @@ -242,5 +393,6 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1986, senterp, 0, 0, senterp, senterp, senterp_state, empty_init, "CXG Systems / Newcrest Technology", "Super Enterprise (model 210)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1986, senterp, 0, 0, senterp, senterp, senterp_state, empty_init, "CXG Systems / Newcrest Technology", "Super Enterprise (model 210)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1986, senterpc, senterp, 0, senterpc, senterpc, senterpc_state, empty_init, "CXG Systems / Newcrest Technology", "Super Enterprise (model 210.C)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/cybiko/cybiko.h b/src/mame/cybiko/cybiko.h index 4be92ca6f840a..d7f865b77cf7d 100644 --- a/src/mame/cybiko/cybiko.h +++ b/src/mame/cybiko/cybiko.h @@ -20,7 +20,7 @@ #include "bus/rs232/rs232.h" #include "cpu/h8/h8s2245.h" -#include "cpu/h8/h8s2320.h" +#include "cpu/h8/h8s2329.h" #include "imagedev/snapquik.h" diff --git a/src/mame/dataeast/bwing.cpp b/src/mame/dataeast/bwing.cpp index eb70b5b024740..f6f5d617a557e 100644 --- a/src/mame/dataeast/bwing.cpp +++ b/src/mame/dataeast/bwing.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Acho A. Tang, Alex W. Jackson +// copyright-holders: Acho A. Tang, Alex W. Jackson + /***************************************************************************** B-Wings (c) 1984 Data East Corporation @@ -22,48 +23,360 @@ Known issues: - "RGB dip-switch" looks kludgy at best; *****************************************************************************/ -// Directives + #include "emu.h" -#include "bwing.h" #include "cpu/m6502/deco16.h" #include "cpu/m6809/m6809.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "sound/dac.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class bwing_state : public driver_device +{ +public: + bwing_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_subcpu(*this, "subcpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_paletteram(*this, "paletteram"), + m_fgscrollram(*this, "fgscrollram"), + m_bgscrollram(*this, "bgscrollram"), + m_gfxram(*this, "gfxram", 0x6000, ENDIANNESS_BIG), + m_vramview(*this, "vramview") { } + + void init_bwing(); + void bwing(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + DECLARE_INPUT_CHANGED_MEMBER(tilt_pressed); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + virtual void device_post_load() override; + +private: + required_device m_maincpu; + required_device m_subcpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + required_shared_ptr m_fgscrollram; + required_shared_ptr m_bgscrollram; + memory_share_creator m_gfxram; + memory_view m_vramview; + + // video-related + tilemap_t *m_charmap = nullptr; + tilemap_t *m_fgmap = nullptr; + tilemap_t *m_bgmap = nullptr; + uint8_t m_sreg[8]{}; + uint8_t m_palatch = 0U; + uint8_t m_mapmask = 0U; + + // sound-related + uint8_t m_p3_nmimask = 0U; + uint8_t m_p3_u8f_d = 0; + + void p3_u8f_w(uint8_t data); + void p3_nmimask_w(uint8_t data); + void p3_nmiack_w(uint8_t data); + void p1_ctrl_w(offs_t offset, uint8_t data); + void p2_ctrl_w(offs_t offset, uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void fgscrollram_w(offs_t offset, uint8_t data); + void bgscrollram_w(offs_t offset, uint8_t data); + template void gfxram_w(offs_t offset, uint8_t data); + void scrollreg_w(offs_t offset, uint8_t data); + void paletteram_w(offs_t offset, uint8_t data); + + TILE_GET_INFO_MEMBER(get_fgtileinfo); + TILE_GET_INFO_MEMBER(get_bgtileinfo); + TILE_GET_INFO_MEMBER(get_charinfo); + TILEMAP_MAPPER_MEMBER(scan_cols); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bmp, const rectangle &clip, uint8_t *ram, int pri); + + INTERRUPT_GEN_MEMBER(p3_interrupt); + void bank_map(address_map &map); + void p1_map(address_map &map); + void p2_map(address_map &map); + void p3_io_map(address_map &map); + void p3_map(address_map &map); +}; + + +// video + +void bwing_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_charmap->mark_tile_dirty(offset); +} + + +void bwing_state::fgscrollram_w(offs_t offset, uint8_t data) +{ + m_fgscrollram[offset] = data; + m_fgmap->mark_tile_dirty(offset); +} + + +void bwing_state::bgscrollram_w(offs_t offset, uint8_t data) +{ + m_bgscrollram[offset] = data; + m_bgmap->mark_tile_dirty(offset); +} + + +template +void bwing_state::gfxram_w(offs_t offset, uint8_t data) +{ + offset += (Which * 0x2000); + m_gfxram[offset] = data; + int whichgfx = (offset & 0x1000) ? 3 : 2; + m_gfxdecode->gfx(whichgfx)->mark_dirty((offset & 0xfff) / 32); +} + +void bwing_state::scrollreg_w(offs_t offset, uint8_t data) +{ + m_sreg[offset] = data; + + switch (offset) + { + case 6: m_palatch = data; break; // one of the palette components is latched through I/O(yike) + + case 7: + m_mapmask = data; + m_vramview.select(data >> 6); + break; + } +} + + +void bwing_state::paletteram_w(offs_t offset, uint8_t data) +{ + static const float rgb[4][3] = { + {0.85f, 0.95f, 1.00f}, + {0.90f, 1.00f, 1.00f}, + {0.80f, 1.00f, 1.00f}, + {0.75f, 0.90f, 1.10f} + }; + + m_paletteram[offset] = data; + + int r = ~data & 7; + int g = ~(data >> 4) & 7; + int b = ~m_palatch & 7; + + r = ((r << 5) + (r << 2) + (r >> 1)); + g = ((g << 5) + (g << 2) + (g >> 1)); + b = ((b << 5) + (b << 2) + (b >> 1)); + + int i; + + if ((i = ioport("EXTRA")->read()) < 4) + { + r = (float)r * rgb[i][0]; + g = (float)g * rgb[i][1]; + b = (float)b * rgb[i][2]; + if (r > 0xff) r = 0xff; + if (g > 0xff) g = 0xff; + if (b > 0xff) b = 0xff; + } + + m_palette->set_pen_color(offset, rgb_t(r, g, b)); +} + +//**************************************************************************** +// Initializations + +TILE_GET_INFO_MEMBER(bwing_state::get_fgtileinfo) +{ + tileinfo.set(2, m_fgscrollram[tile_index] & 0x7f, m_fgscrollram[tile_index] >> 7, 0); +} + +TILE_GET_INFO_MEMBER(bwing_state::get_bgtileinfo) +{ + tileinfo.set(3, m_bgscrollram[tile_index] & 0x7f, m_bgscrollram[tile_index] >> 7, 0); +} + +TILE_GET_INFO_MEMBER(bwing_state::get_charinfo) +{ + tileinfo.set(0, m_videoram[tile_index], 0, 0); +} + +TILEMAP_MAPPER_MEMBER(bwing_state::scan_cols) +{ + return (row & 0xf) | ((col & 0xf) << 4) | ((row & 0x30) << 4) | ((col & 0x30) << 6); +} + + +void bwing_state::video_start() +{ + m_charmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_charinfo)), TILEMAP_SCAN_COLS, 8, 8, 32, 32); + m_fgmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_fgtileinfo)), tilemap_mapper_delegate(*this, FUNC(bwing_state::scan_cols)), 16, 16, 64, 64); + m_bgmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_bgtileinfo)), tilemap_mapper_delegate(*this, FUNC(bwing_state::scan_cols)), 16, 16, 64, 64); + + m_charmap->set_transparent_pen(0); + m_fgmap->set_transparent_pen(0); + + for (int i = 0; i < 8; i++) + m_sreg[i] = 0; +} + +//**************************************************************************** +// Realtime + +void bwing_state::draw_sprites(bitmap_ind16 &bmp, const rectangle &clip, uint8_t *ram, int pri) +{ + gfx_element *gfx = m_gfxdecode->gfx(1); + + for (int i = 0; i < 0x200; i += 4) + { + int const attrib = ram[i]; + int code = ram[i + 1]; + int y = ram[i + 2]; + int x = ram[i + 3]; + int const color = (attrib >> 3) & 1; + + if (!(attrib & 1) || color != pri) + continue; + + code += (attrib << 3) & 0x100; + y -= (attrib << 1) & 0x100; + x -= (attrib << 2) & 0x100; + + int fx = attrib & 0x04; + int fy = ~attrib & 0x02; + + // normal/cocktail + if (m_mapmask & 0x20) + { + fx = !fx; + fy = !fy; + x = 240 - x; + y = 240 - y; + } + + // single/double + if (!(attrib & 0x10)) + gfx->transpen(bmp, clip, code, color, fx, fy, x, y, 0); + else + gfx->zoom_transpen(bmp, clip, code, color, fx, fy, x, y, 1 << 16, 2 << 16, 0); + } +} + + +uint32_t bwing_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + unsigned flip, x, y, shiftx; + + if (m_mapmask & 0x20) + { + flip = TILEMAP_FLIPX; + shiftx = -8; + } + else + { + flip = TILEMAP_FLIPY; + shiftx = 8; + } + + // draw background + if (!(m_mapmask & 1)) + { + m_bgmap->set_flip(flip); + x = ((m_sreg[1] << 2 & 0x300) + m_sreg[2] + shiftx) & 0x3ff; + m_bgmap->set_scrollx(0, x); + y = (m_sreg[1] << 4 & 0x300) + m_sreg[3]; + m_bgmap->set_scrolly(0, y); + m_bgmap->draw(screen, bitmap, cliprect, 0, 0); + } + else + bitmap.fill(m_palette->black_pen(), cliprect); + + // draw low priority sprites + draw_sprites(bitmap, cliprect, m_spriteram, 0); + + // draw foreground + if (!(m_mapmask & 2)) + { + m_fgmap->set_flip(flip); + x = ((m_sreg[1] << 6 & 0x300) + m_sreg[4] + shiftx) & 0x3ff; + m_fgmap->set_scrollx(0, x); + y = (m_sreg[1] << 8 & 0x300) + m_sreg[5]; + m_fgmap->set_scrolly(0, y); + m_fgmap->draw(screen, bitmap, cliprect, 0, 0); + } + + // draw high priority sprites + draw_sprites(bitmap, cliprect, m_spriteram, 1); + + // draw text layer +// if (m_mapmask & 4) + { + m_charmap->set_flip(flip); + m_charmap->draw(screen, bitmap, cliprect, 0, 0); + } + return 0; +} + + +// machine //**************************************************************************** // Interrupt Handlers -INTERRUPT_GEN_MEMBER(bwing_state::bwp3_interrupt) +INTERRUPT_GEN_MEMBER(bwing_state::p3_interrupt) { - if (!m_bwp3_nmimask) + if (!m_p3_nmimask) device.execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } //**************************************************************************** // Memory and I/O Handlers -void bwing_state::bwp3_u8F_w(uint8_t data) +void bwing_state::p3_u8f_w(uint8_t data) { - m_bwp3_u8F_d = data; // prepares custom chip for various operations + m_p3_u8f_d = data; // prepares custom chip for various operations } -void bwing_state::bwp3_nmimask_w(uint8_t data) +void bwing_state::p3_nmimask_w(uint8_t data) { - m_bwp3_nmimask = data & 0x80; + m_p3_nmimask = data & 0x80; } -void bwing_state::bwp3_nmiack_w(uint8_t data) +void bwing_state::p3_nmiack_w(uint8_t data) { m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } -void bwing_state::bwp1_ctrl_w(offs_t offset, uint8_t data) +void bwing_state::p1_ctrl_w(offs_t offset, uint8_t data) { switch (offset) { @@ -102,7 +415,7 @@ void bwing_state::bwp1_ctrl_w(offs_t offset, uint8_t data) } -void bwing_state::bwp2_ctrl_w(offs_t offset, uint8_t data) +void bwing_state::p2_ctrl_w(offs_t offset, uint8_t data) { switch (offset) { @@ -120,13 +433,13 @@ void bwing_state::bwp2_ctrl_w(offs_t offset, uint8_t data) // CPU Memory Maps // Main CPU -void bwing_state::bwp1_map(address_map &map) +void bwing_state::p1_map(address_map &map) { map(0x0000, 0x07ff).ram().share("sharedram"); map(0x0800, 0x0fff).ram(); - map(0x1000, 0x13ff).ram().w(FUNC(bwing_state::videoram_w)).share("videoram"); + map(0x1000, 0x13ff).ram().w(FUNC(bwing_state::videoram_w)).share(m_videoram); map(0x1400, 0x17ff).ram(); - map(0x1800, 0x19ff).ram().share("spriteram"); + map(0x1800, 0x19ff).ram().share(m_spriteram); map(0x1a00, 0x1aff).ram().w(FUNC(bwing_state::paletteram_w)).share("paletteram"); map(0x1b00, 0x1b00).portr("DSW0"); map(0x1b01, 0x1b01).portr("DSW1"); @@ -134,48 +447,45 @@ void bwing_state::bwp1_map(address_map &map) map(0x1b03, 0x1b03).portr("IN1"); map(0x1b04, 0x1b04).portr("IN2"); map(0x1b00, 0x1b07).w(FUNC(bwing_state::scrollreg_w)); - map(0x1c00, 0x1c07).ram().w(FUNC(bwing_state::bwp1_ctrl_w)); - map(0x2000, 0x3fff).m(m_vrambank, FUNC(address_map_bank_device::amap8)); + map(0x1c00, 0x1c07).ram().w(FUNC(bwing_state::p1_ctrl_w)); + map(0x2000, 0x3fff).view(m_vramview); + m_vramview[0](0x2000, 0x2fff).ram().w(FUNC(bwing_state::fgscrollram_w)).share(m_fgscrollram); + m_vramview[0](0x3000, 0x3fff).ram().w(FUNC(bwing_state::bgscrollram_w)).share(m_bgscrollram); + m_vramview[1](0x2000, 0x3fff).ram().w(FUNC(bwing_state::gfxram_w<0>)); + m_vramview[2](0x2000, 0x3fff).ram().w(FUNC(bwing_state::gfxram_w<1>)); + m_vramview[3](0x2000, 0x3fff).ram().w(FUNC(bwing_state::gfxram_w<2>)); map(0x4000, 0xffff).rom(); // "B-Wings US" writes to 9631-9632(debug?) } -// Banked video RAM -void bwing_state::bank_map(address_map &map) -{ - map(0x0000, 0x0fff).ram().w(FUNC(bwing_state::fgscrollram_w)).share("fgscrollram"); - map(0x1000, 0x1fff).ram().w(FUNC(bwing_state::bgscrollram_w)).share("bgscrollram"); - map(0x2000, 0x7fff).ram().w(FUNC(bwing_state::gfxram_w)).share("gfxram"); -} - // Sub CPU -void bwing_state::bwp2_map(address_map &map) +void bwing_state::p2_map(address_map &map) { map(0x0000, 0x07ff).ram().share("sharedram"); map(0x0800, 0x0fff).ram(); - map(0x1800, 0x1803).w(FUNC(bwing_state::bwp2_ctrl_w)); + map(0x1800, 0x1803).w(FUNC(bwing_state::p2_ctrl_w)); map(0xa000, 0xffff).rom(); } // Sound CPU -void bwing_state::bwp3_map(address_map &map) +void bwing_state::p3_map(address_map &map) { map(0x0000, 0x01ff).ram(); map(0x0200, 0x0200).w("dac", FUNC(dac_byte_interface::data_w)); - map(0x1000, 0x1000).w(FUNC(bwing_state::bwp3_nmiack_w)); + map(0x1000, 0x1000).w(FUNC(bwing_state::p3_nmiack_w)); map(0x2000, 0x2000).w("ay1", FUNC(ay8912_device::data_w)); map(0x4000, 0x4000).w("ay1", FUNC(ay8912_device::address_w)); map(0x6000, 0x6000).w("ay2", FUNC(ay8912_device::data_w)); map(0x8000, 0x8000).w("ay2", FUNC(ay8912_device::address_w)); map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - map(0xd000, 0xd000).w(FUNC(bwing_state::bwp3_nmimask_w)); + map(0xd000, 0xd000).w(FUNC(bwing_state::p3_nmimask_w)); map(0xe000, 0xffff).rom().region("audiocpu", 0); } -void bwing_state::bwp3_io_map(address_map &map) +void bwing_state::p3_io_map(address_map &map) { - map(0x00, 0x00).portr("VBLANK").w(FUNC(bwing_state::bwp3_u8F_w)); + map(0x00, 0x00).portr("VBLANK").w(FUNC(bwing_state::p3_u8f_w)); } //**************************************************************************** @@ -220,7 +530,7 @@ static INPUT_PORTS_START( bwing ) PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x00, "5" ) PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:2,3") /* Listed as "Not Used" in the manual */ + PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:2,3") // Listed as "Not Used" in the manual PORT_DIPSETTING( 0x00, "40000" ) PORT_DIPSETTING( 0x02, "20000 80000" ) PORT_DIPSETTING( 0x04, "20000 60000" ) @@ -231,13 +541,13 @@ static INPUT_PORTS_START( bwing ) PORT_DIPNAME( 0x10, 0x10, "Enemy Missiles" ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) - PORT_DIPNAME( 0x20, 0x20, "Freeze" ) PORT_DIPLOCATION("SW2:6") /* Listed as "Not Used" in the manual */ + PORT_DIPNAME( 0x20, 0x20, "Freeze" ) PORT_DIPLOCATION("SW2:6") // Listed as "Not Used" in the manual PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Country" ) PORT_DIPLOCATION("SW2:7") /* Listed as "Not Used" in the manual */ + PORT_DIPNAME( 0x40, 0x00, "Country" ) PORT_DIPLOCATION("SW2:7") // Listed as "Not Used" in the manual PORT_DIPSETTING( 0x00, "Japan/US" ) PORT_DIPSETTING( 0x40, "Japan Only" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Not Used" in the manual */ + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") // Listed as "Not Used" in the manual PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -325,8 +635,8 @@ static const gfx_layout ram_tilelayout = }; static GFXDECODE_START( gfx_bwing ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x00, 1 ) // chars - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x20, 2 ) // sprites + GFXDECODE_ENTRY( "chars", 0, charlayout, 0x00, 1 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x20, 2 ) GFXDECODE_RAM( "gfxram", 0, ram_tilelayout, 0x10, 2 ) // foreground tiles GFXDECODE_RAM( "gfxram", 0x1000, ram_tilelayout, 0x30, 2 ) // background tiles GFXDECODE_END @@ -338,12 +648,10 @@ void bwing_state::machine_start() { save_item(NAME(m_palatch)); save_item(NAME(m_mapmask)); - save_item(NAME(m_bwp3_nmimask)); - save_item(NAME(m_bwp3_u8F_d)); + save_item(NAME(m_p3_nmimask)); + save_item(NAME(m_p3_u8f_d)); save_item(NAME(m_sreg)); - - machine().save().register_postload(save_prepost_delegate(FUNC(bwing_state::bwing_postload), this)); } void bwing_state::machine_reset() @@ -351,11 +659,11 @@ void bwing_state::machine_reset() m_palatch = 0; m_mapmask = 0; - m_bwp3_nmimask = 0; - m_bwp3_u8F_d = 0; + m_p3_nmimask = 0; + m_p3_u8f_d = 0; } -void bwing_state::bwing_postload() +void bwing_state::device_post_load() { m_gfxdecode->gfx(2)->mark_all_dirty(); m_gfxdecode->gfx(3)->mark_all_dirty(); @@ -365,20 +673,18 @@ void bwing_state::bwing_postload() void bwing_state::bwing(machine_config &config) { // basic machine hardware - MC6809E(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &bwing_state::bwp1_map); - - MC6809E(config, m_subcpu, 2000000); - m_subcpu->set_addrmap(AS_PROGRAM, &bwing_state::bwp2_map); + MC6809E(config, m_maincpu, 2'000'000); + m_maincpu->set_addrmap(AS_PROGRAM, &bwing_state::p1_map); - DECO16(config, m_audiocpu, 2000000); - m_audiocpu->set_addrmap(AS_PROGRAM, &bwing_state::bwp3_map); - m_audiocpu->set_addrmap(AS_IO, &bwing_state::bwp3_io_map); - m_audiocpu->set_periodic_int(FUNC(bwing_state::bwp3_interrupt), attotime::from_hz(1000)); + MC6809E(config, m_subcpu, 2'000'000); + m_subcpu->set_addrmap(AS_PROGRAM, &bwing_state::p2_map); - config.set_maximum_quantum(attotime::from_hz(18000)); // high enough? + DECO16(config, m_audiocpu, 2'000'000); + m_audiocpu->set_addrmap(AS_PROGRAM, &bwing_state::p3_map); + m_audiocpu->set_addrmap(AS_IO, &bwing_state::p3_io_map); + m_audiocpu->set_periodic_int(FUNC(bwing_state::p3_interrupt), attotime::from_hz(1'000)); - ADDRESS_MAP_BANK(config, "vrambank").set_map(&bwing_state::bank_map).set_options(ENDIANNESS_BIG, 8, 15, 0x2000); + config.set_maximum_quantum(attotime::from_hz(18'000)); // high enough? // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -411,25 +717,25 @@ void bwing_state::bwing(machine_config &config) ROM_START( bwings ) // Top Board(SCU-01) - ROM_REGION( 0x10000, "maincpu", 0 ) // main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "bw_bv-02-.10a",0x04000, 0x04000, CRC(6074a86b) SHA1(0ce1bd74450144fd3c6556787d6c5c5d4531d830) ) // different ROM_LOAD( "bw_bv-01.7a", 0x08000, 0x04000, CRC(b960c707) SHA1(086cb0f22fb59922bf0369bf6b382a241d979ec3) ) ROM_LOAD( "bw_bv-00-.4a", 0x0c000, 0x04000, CRC(1f83804c) SHA1(afd5eb0822db4fd982062945ca27e66ed9680645) ) // different - ROM_REGION( 0x10000, "sub", 0 ) // sub CPU + ROM_REGION( 0x10000, "subcpu", 0 ) ROM_LOAD( "bw_bv-06-.10d",0x0a000, 0x02000, CRC(eca00fcb) SHA1(c7affbb900e3940257f8cebc91266328a4a5dca3) ) // different ROM_LOAD( "bw_bv-05-.9d", 0x0c000, 0x02000, CRC(1e393300) SHA1(8d847256eb5dbccf5f524ec3aa836073d70b4edc) ) // different ROM_LOAD( "bw_bv-04-.7d", 0x0e000, 0x02000, CRC(6548c5bb) SHA1(d12cc8d0d5692c3de766f5c42c818dd8f685760a) ) // different - ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) + ROM_REGION( 0x2000, "audiocpu", 0 ) // encrypted ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) // Bottom Board(CCU-01) - ROM_REGION( 0x01000, "gfx1", 0 ) // chars + ROM_REGION( 0x01000, "chars", 0 ) ROM_LOAD( "bw_bv-10.5c", 0x00000, 0x01000, CRC(edca6901) SHA1(402c80e7519cf3a43b9fef52c9923961220a48b6) ) // Middle Board(MCU-01) - ROM_REGION( 0x0c000, "gfx2", 0 ) // sprites + ROM_REGION( 0x0c000, "sprites", 0 ) ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) @@ -438,25 +744,25 @@ ROM_END ROM_START( bwingso ) // Top Board(SCU-01) - ROM_REGION( 0x10000, "maincpu", 0 ) // main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "bw_bv-02.10a", 0x04000, 0x04000, CRC(5ce74ab5) SHA1(b414f0bbe1c4c5b4c810bb4b9fba16aaf86520ff) ) ROM_LOAD( "bw_bv-01.7a", 0x08000, 0x04000, CRC(b960c707) SHA1(086cb0f22fb59922bf0369bf6b382a241d979ec3) ) ROM_LOAD( "bw_bv-00.4a", 0x0c000, 0x04000, CRC(926bef63) SHA1(d4bd2e91fa0abc5e9472d4b684c076bdc3c29f5b) ) - ROM_REGION( 0x10000, "sub", 0 ) // sub CPU + ROM_REGION( 0x10000, "subcpu", 0 ) ROM_LOAD( "bw_bv-06.10d", 0x0a000, 0x02000, CRC(91a21a4c) SHA1(042eed60119a861f6b3ccfbe68d880f182a8a8e1) ) ROM_LOAD( "bw_bv-05.9d", 0x0c000, 0x02000, CRC(f283f39a) SHA1(9f7f4c39d49f4dfff73fe74cd457480e8a43a3c5) ) ROM_LOAD( "bw_bv-04.7d", 0x0e000, 0x02000, CRC(29ae75b6) SHA1(48c94e996857f2ac995bcd25f0e67b9f7c17d807) ) - ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) + ROM_REGION( 0x2000, "audiocpu", 0 ) // encrypted ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) // Bottom Board(CCU-01) - ROM_REGION( 0x01000, "gfx1", 0 ) // chars + ROM_REGION( 0x01000, "chars", 0 ) ROM_LOAD( "bw_bv-10.5c", 0x00000, 0x01000, CRC(edca6901) SHA1(402c80e7519cf3a43b9fef52c9923961220a48b6) ) // Middle Board(MCU-01) - ROM_REGION( 0x0c000, "gfx2", 0 ) // sprites + ROM_REGION( 0x0c000, "sprites", 0 ) ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) @@ -465,26 +771,26 @@ ROM_END ROM_START( bwingsa ) // Top Board(SCU-01) - ROM_REGION( 0x10000, "maincpu", 0 ) // main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "bw_bv-02.10a", 0x04000, 0x04000, CRC(5ce74ab5) SHA1(b414f0bbe1c4c5b4c810bb4b9fba16aaf86520ff) ) ROM_LOAD( "bv02.bin", 0x06000, 0x02000, CRC(2f84654e) SHA1(11b5343219b46d03f686ea348181c509121b9e3c) ) // only the lower 8k is different ROM_LOAD( "bw_bv-01.7a", 0x08000, 0x04000, CRC(b960c707) SHA1(086cb0f22fb59922bf0369bf6b382a241d979ec3) ) ROM_LOAD( "bv00.bin", 0x0c000, 0x04000, CRC(0bbc1222) SHA1(cfdf621a423a5ce4ba44a980e683d2abf044d6b9) ) // different - ROM_REGION( 0x10000, "sub", 0 ) // sub CPU + ROM_REGION( 0x10000, "subcpu", 0 ) ROM_LOAD( "bw_bv-06.10d", 0x0a000, 0x02000, CRC(91a21a4c) SHA1(042eed60119a861f6b3ccfbe68d880f182a8a8e1) ) ROM_LOAD( "bw_bv-05.9d", 0x0c000, 0x02000, CRC(f283f39a) SHA1(9f7f4c39d49f4dfff73fe74cd457480e8a43a3c5) ) ROM_LOAD( "bw_bv-04.7d", 0x0e000, 0x02000, CRC(29ae75b6) SHA1(48c94e996857f2ac995bcd25f0e67b9f7c17d807) ) - ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) + ROM_REGION( 0x2000, "audiocpu", 0 ) // encrypted ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) // Bottom Board(CCU-01) - ROM_REGION( 0x01000, "gfx1", 0 ) // chars + ROM_REGION( 0x01000, "chars", 0 ) ROM_LOAD( "bw_bv-10.5c", 0x00000, 0x01000, CRC(edca6901) SHA1(402c80e7519cf3a43b9fef52c9923961220a48b6) ) // Middle Board(MCU-01) - ROM_REGION( 0x0c000, "gfx2", 0 ) // sprites + ROM_REGION( 0x0c000, "sprites", 0 ) ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) @@ -492,25 +798,25 @@ ROM_END ROM_START( zaviga ) // Top Board(DE-0169-0) - ROM_REGION( 0x10000, "maincpu", 0 ) // main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "as04.10a", 0x04000, 0x04000, CRC(b79f5da2) SHA1(b39748666d3f7fb1ac46d282cce09fe9531df6b1) ) ROM_LOAD( "as02.7a", 0x08000, 0x04000, CRC(6addd16a) SHA1(940637c49bf9f38c77176ed2ae212048e9e7fd8f) ) ROM_LOAD( "as00.4a", 0x0c000, 0x04000, CRC(c6ae4af0) SHA1(6f6f14385b20f9c9c312f816036c608fe8514b00) ) - ROM_REGION( 0x10000, "sub", 0 ) // sub CPU + ROM_REGION( 0x10000, "subcpu", 0 ) ROM_LOAD( "as08.10d", 0x0a000, 0x02000, CRC(b6187b3a) SHA1(d2d7c5b185f59986f45d8ec3ddf9b95364e57d96) ) ROM_LOAD( "as07.9d", 0x0c000, 0x02000, CRC(dc1170e3) SHA1(c8e4d1564fd272d726d0e4ffd4f33f67f1b37cd7) ) ROM_LOAD( "as06.7d", 0x0e000, 0x02000, CRC(ba888f84) SHA1(f94de8553cd4704d9b3349ded881a7cc62fa9b57) ) - ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) + ROM_REGION( 0x2000, "audiocpu", 0 ) // encrypted ROM_LOAD( "as05.13a", 0x00000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) // Bottom Board(DE-0170-0) - ROM_REGION( 0x01000, "gfx1", 0 ) // chars + ROM_REGION( 0x01000, "chars", 0 ) ROM_LOAD( "as14.5c", 0x00000, 0x01000, CRC(62132c1d) SHA1(6b101e220a440488da17de8446f4e2c8ec7c7de9) ) // Middle Board(DE-0171-0) - ROM_REGION( 0x0c000, "gfx2", 0 ) // sprites + ROM_REGION( 0x0c000, "sprites", 0 ) ROM_LOAD( "as11.1l", 0x00000, 0x04000, CRC(aa84af24) SHA1(af4ff085dc44b3d1493ec1c8b4a8d18dccecc872) ) ROM_LOAD( "as12.1k", 0x04000, 0x04000, CRC(84af9041) SHA1(8fbd5995ca8e708cd7fb9cdfcdb174e12084f526) ) ROM_LOAD( "as13.1h", 0x08000, 0x04000, CRC(15d0922b) SHA1(b8d715a9e610531472d516c19f6035adbce93c84) ) @@ -519,25 +825,25 @@ ROM_END ROM_START( zavigaj ) // Top Board(DE-0169-0) - ROM_REGION( 0x10000, "maincpu", 0 ) // main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "as04.10a", 0x04000, 0x04000, CRC(b79f5da2) SHA1(b39748666d3f7fb1ac46d282cce09fe9531df6b1) ) ROM_LOAD( "as02.7a", 0x08000, 0x04000, CRC(6addd16a) SHA1(940637c49bf9f38c77176ed2ae212048e9e7fd8f) ) ROM_LOAD( "as00.4a", 0x0c000, 0x04000, CRC(c6ae4af0) SHA1(6f6f14385b20f9c9c312f816036c608fe8514b00) ) - ROM_REGION( 0x10000, "sub", 0 ) // sub CPU + ROM_REGION( 0x10000, "subcpu", 0 ) ROM_LOAD( "as08.10d", 0x0a000, 0x02000, CRC(b6187b3a) SHA1(d2d7c5b185f59986f45d8ec3ddf9b95364e57d96) ) ROM_LOAD( "as07.9d", 0x0c000, 0x02000, CRC(dc1170e3) SHA1(c8e4d1564fd272d726d0e4ffd4f33f67f1b37cd7) ) ROM_LOAD( "as06-.7d", 0x0e000, 0x02000, CRC(b02d270c) SHA1(beea3d44d367543b5b5075c5892580e690691e75) ) // different - ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) + ROM_REGION( 0x2000, "audiocpu", 0 ) // encrypted ROM_LOAD( "as05.13a", 0x00000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) // Bottom Board(DE-0170-0) - ROM_REGION( 0x01000, "gfx1", 0 ) // chars + ROM_REGION( 0x01000, "chars", 0 ) ROM_LOAD( "as14.5c", 0x00000, 0x01000, CRC(62132c1d) SHA1(6b101e220a440488da17de8446f4e2c8ec7c7de9) ) // Middle Board(DE-0171-0) - ROM_REGION( 0x0c000, "gfx2", 0 ) // sprites + ROM_REGION( 0x0c000, "sprites", 0 ) ROM_LOAD( "as11.1l", 0x00000, 0x04000, CRC(aa84af24) SHA1(af4ff085dc44b3d1493ec1c8b4a8d18dccecc872) ) ROM_LOAD( "as12.1k", 0x04000, 0x04000, CRC(84af9041) SHA1(8fbd5995ca8e708cd7fb9cdfcdb174e12084f526) ) ROM_LOAD( "as13.1h", 0x08000, 0x04000, CRC(15d0922b) SHA1(b8d715a9e610531472d516c19f6035adbce93c84) ) @@ -560,12 +866,14 @@ void bwing_state::init_bwing() rom[j - (0x10 - 0x5)] = rom[j - (0x10 - 0xa)] = rom[j - (0x10 - 0x7)]; } +} // anonymous namespace + //**************************************************************************** // Game Entries -GAME( 1984, bwings, 0, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "B-Wings (Japan new Ver.)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, bwings, 0, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "B-Wings (Japan new Ver.)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, bwingso, bwings, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "B-Wings (Japan old Ver.)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, bwingsa, bwings, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "B-Wings (Alt Ver.?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, bwingsa, bwings, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "B-Wings (Alt Ver.?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, zaviga, 0, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "Zaviga", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, zavigaj, zaviga, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "Zaviga (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, zaviga, 0, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "Zaviga", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, zavigaj, zaviga, bwing, bwing, bwing_state, init_bwing, ROT90, "Data East Corporation", "Zaviga (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/bwing.h b/src/mame/dataeast/bwing.h deleted file mode 100644 index 8e45ef1868296..0000000000000 --- a/src/mame/dataeast/bwing.h +++ /dev/null @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Acho A. Tang, Alex W. Jackson -/*************************************************************************** - - B-Wings - -***************************************************************************/ - -#include "machine/bankdev.h" -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -#define BW_DEBUG 0 - -class bwing_state : public driver_device -{ -public: - bwing_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub"), - m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_vrambank(*this, "vrambank"), - m_soundlatch(*this, "soundlatch"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_paletteram(*this, "paletteram"), - m_fgscrollram(*this, "fgscrollram"), - m_bgscrollram(*this, "bgscrollram"), - m_gfxram(*this, "gfxram") { } - - void init_bwing(); - void bwing(machine_config &config); - DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - DECLARE_INPUT_CHANGED_MEMBER(tilt_pressed); - -private: - /* device */ - required_device m_maincpu; - required_device m_subcpu; - required_device m_audiocpu; - required_device m_gfxdecode; - required_device m_palette; - required_device m_vrambank; - required_device m_soundlatch; - - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - required_shared_ptr m_fgscrollram; - required_shared_ptr m_bgscrollram; - required_shared_ptr m_gfxram; - - /* video-related */ - tilemap_t *m_charmap = nullptr; - tilemap_t *m_fgmap = nullptr; - tilemap_t *m_bgmap = nullptr; - unsigned m_sreg[8]{}; - unsigned m_palatch = 0U; - unsigned m_mapmask = 0U; - - /* sound-related */ - int m_bwp3_nmimask = 0; - int m_bwp3_u8F_d = 0; - - void bwp3_u8F_w(uint8_t data); - void bwp3_nmimask_w(uint8_t data); - void bwp3_nmiack_w(uint8_t data); - void bwp1_ctrl_w(offs_t offset, uint8_t data); - void bwp2_ctrl_w(offs_t offset, uint8_t data); - void videoram_w(offs_t offset, uint8_t data); - void fgscrollram_w(offs_t offset, uint8_t data); - void bgscrollram_w(offs_t offset, uint8_t data); - void gfxram_w(offs_t offset, uint8_t data); - void scrollreg_w(offs_t offset, uint8_t data); - void paletteram_w(offs_t offset, uint8_t data); - - TILE_GET_INFO_MEMBER(get_fgtileinfo); - TILE_GET_INFO_MEMBER(get_bgtileinfo); - TILE_GET_INFO_MEMBER(get_charinfo); - TILEMAP_MAPPER_MEMBER(scan_cols); - - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void bwing_postload(); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bmp, const rectangle &clip, uint8_t *ram, int pri ); - - INTERRUPT_GEN_MEMBER(bwp3_interrupt); - void bank_map(address_map &map); - void bwp1_map(address_map &map); - void bwp2_map(address_map &map); - void bwp3_io_map(address_map &map); - void bwp3_map(address_map &map); -}; diff --git a/src/mame/dataeast/bwing_v.cpp b/src/mame/dataeast/bwing_v.cpp deleted file mode 100644 index 32887c5dae1c6..0000000000000 --- a/src/mame/dataeast/bwing_v.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Acho A. Tang, Alex W. Jackson -/***************************************************************************** - -B-Wings (c) 1984 Data East Corporation -Zaviga (c) 1984 Data East Corporation - -drivers by Acho A. Tang -revised by Alex W. Jackson - -*****************************************************************************/ -// Directives - -#include "emu.h" -#include "bwing.h" - - -//**************************************************************************** -// Exports - - -void bwing_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_charmap->mark_tile_dirty(offset); -} - - -void bwing_state::fgscrollram_w(offs_t offset, uint8_t data) -{ - m_fgscrollram[offset] = data; - m_fgmap->mark_tile_dirty(offset); -} - - -void bwing_state::bgscrollram_w(offs_t offset, uint8_t data) -{ - m_bgscrollram[offset] = data; - m_bgmap->mark_tile_dirty(offset); -} - - -void bwing_state::gfxram_w(offs_t offset, uint8_t data) -{ - m_gfxram[offset] = data; - int whichgfx = (offset & 0x1000) ? 3 : 2; - m_gfxdecode->gfx(whichgfx)->mark_dirty((offset & 0xfff) / 32); -} - - -void bwing_state::scrollreg_w(offs_t offset, uint8_t data) -{ - m_sreg[offset] = data; - - switch (offset) - { - case 6: m_palatch = data; break; // one of the palette components is latched through I/O(yike) - - case 7: - m_mapmask = data; - m_vrambank->set_bank(data >> 6); - break; - } -} - - -void bwing_state::paletteram_w(offs_t offset, uint8_t data) -{ - static const float rgb[4][3] = { - {0.85f, 0.95f, 1.00f}, - {0.90f, 1.00f, 1.00f}, - {0.80f, 1.00f, 1.00f}, - {0.75f, 0.90f, 1.10f} - }; - int r, g, b, i; - - m_paletteram[offset] = data; - - r = ~data & 7; - g = ~(data >> 4) & 7; - b = ~m_palatch & 7; - - r = ((r << 5) + (r << 2) + (r >> 1)); - g = ((g << 5) + (g << 2) + (g >> 1)); - b = ((b << 5) + (b << 2) + (b >> 1)); - - if ((i = ioport("EXTRA")->read()) < 4) - { - r = (float)r * rgb[i][0]; - g = (float)g * rgb[i][1]; - b = (float)b * rgb[i][2]; - if (r > 0xff) r = 0xff; - if (g > 0xff) g = 0xff; - if (b > 0xff) b = 0xff; - } - - m_palette->set_pen_color(offset, rgb_t(r, g, b)); -} - -//**************************************************************************** -// Initializations - -TILE_GET_INFO_MEMBER(bwing_state::get_fgtileinfo) -{ - tileinfo.set(2, m_fgscrollram[tile_index] & 0x7f, m_fgscrollram[tile_index] >> 7, 0); -} - -TILE_GET_INFO_MEMBER(bwing_state::get_bgtileinfo) -{ - tileinfo.set(3, m_bgscrollram[tile_index] & 0x7f, m_bgscrollram[tile_index] >> 7, 0); -} - -TILE_GET_INFO_MEMBER(bwing_state::get_charinfo) -{ - tileinfo.set(0, m_videoram[tile_index], 0, 0); -} - -TILEMAP_MAPPER_MEMBER(bwing_state::scan_cols) -{ - return (row & 0xf) | ((col & 0xf) << 4) | ((row & 0x30) << 4) | ((col & 0x30) << 6); -} - - -void bwing_state::video_start() -{ - int i; - - m_charmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_charinfo)), TILEMAP_SCAN_COLS, 8, 8, 32, 32); - m_fgmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_fgtileinfo)), tilemap_mapper_delegate(*this, FUNC(bwing_state::scan_cols)), 16, 16, 64, 64); - m_bgmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bwing_state::get_bgtileinfo)), tilemap_mapper_delegate(*this, FUNC(bwing_state::scan_cols)), 16, 16, 64, 64); - - m_charmap->set_transparent_pen(0); - m_fgmap->set_transparent_pen(0); - - for (i = 0; i < 8; i++) - m_sreg[i] = 0; -} - -//**************************************************************************** -// Realtime - -void bwing_state::draw_sprites( bitmap_ind16 &bmp, const rectangle &clip, uint8_t *ram, int pri ) -{ - int attrib, fx, fy, code, x, y, color, i; - gfx_element *gfx = m_gfxdecode->gfx(1); - - for (i = 0; i < 0x200; i += 4) - { - attrib = ram[i]; - code = ram[i + 1]; - y = ram[i + 2]; - x = ram[i + 3]; - color = (attrib >> 3) & 1; - - if (!(attrib & 1) || color != pri) - continue; - - code += (attrib << 3) & 0x100; - y -= (attrib << 1) & 0x100; - x -= (attrib << 2) & 0x100; - - fx = attrib & 0x04; - fy = ~attrib & 0x02; - - // normal/cocktail - if (m_mapmask & 0x20) - { - fx = !fx; - fy = !fy; - x = 240 - x; - y = 240 - y; - } - - // single/double - if (!(attrib & 0x10)) - gfx->transpen(bmp,clip, code, color, fx, fy, x, y, 0); - else - gfx->zoom_transpen(bmp,clip, code, color, fx, fy, x, y, 1<<16, 2<<16, 0); - } -} - - -uint32_t bwing_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - unsigned flip, x, y, shiftx; - - if (m_mapmask & 0x20) - { - flip = TILEMAP_FLIPX; - shiftx = -8; - } - else - { - flip = TILEMAP_FLIPY; - shiftx = 8; - } - - // draw background - if (!(m_mapmask & 1)) - { - m_bgmap->set_flip(flip); - x = ((m_sreg[1]<<2 & 0x300) + m_sreg[2] + shiftx) & 0x3ff; - m_bgmap->set_scrollx(0, x); - y = (m_sreg[1]<<4 & 0x300) + m_sreg[3]; - m_bgmap->set_scrolly(0, y); - m_bgmap->draw(screen, bitmap, cliprect, 0, 0); - } - else - bitmap.fill(m_palette->black_pen(), cliprect); - - // draw low priority sprites - draw_sprites(bitmap, cliprect, m_spriteram, 0); - - // draw foreground - if (!(m_mapmask & 2)) - { - m_fgmap->set_flip(flip); - x = ((m_sreg[1] << 6 & 0x300) + m_sreg[4] + shiftx) & 0x3ff; - m_fgmap->set_scrollx(0, x); - y = (m_sreg[1] << 8 & 0x300) + m_sreg[5]; - m_fgmap->set_scrolly(0, y); - m_fgmap->draw(screen, bitmap, cliprect, 0, 0); - } - - // draw high priority sprites - draw_sprites(bitmap, cliprect, m_spriteram, 1); - - // draw text layer -// if (m_mapmask & 4) - { - m_charmap->set_flip(flip); - m_charmap->draw(screen, bitmap, cliprect, 0, 0); - } - return 0; -} diff --git a/src/mame/dataeast/lemmings.cpp b/src/mame/dataeast/lemmings.cpp index 705ec7aff330d..85d711e36d1ec 100644 --- a/src/mame/dataeast/lemmings.cpp +++ b/src/mame/dataeast/lemmings.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders: Bryan McPhail + /*************************************************************************** Lemmings (c) 1991 Data East USA (DE-0357) @@ -11,74 +12,308 @@ arcade hardware. As prototype software it seems to have a couple of non-critical bugs, - the palette ram check and vram check both overrun their actual ramsize. + the palette RAM check and VRAM check both overrun their actual RAM size. Emulation by Bryan McPhail, mish@tendril.co.uk ***************************************************************************/ #include "emu.h" -#include "lemmings.h" + +#include "deco146.h" +#include "decospr.h" #include "cpu/m6809/m6809.h" #include "cpu/m68000/m68000.h" +#include "machine/gen_latch.h" #include "sound/okim6295.h" #include "sound/ymopm.h" +#include "video/bufsprite.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class lemmings_state : public driver_device +{ +public: + lemmings_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_bitmap0(2048, 256) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_deco146(*this, "ioprot") + , m_spriteram(*this, "spriteram%u", 1) + , m_sprgen(*this, "spritegen%u", 1) + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_soundlatch(*this, "soundlatch") + , m_control_data(*this, "control_data") + , m_vram_data(*this, "vram_data") + , m_pixel_data(*this, "pixel_%u_data", 0) + , m_trackball_io(*this, "AN%u", 0) + { + } + + void lemmings(machine_config &config); + +protected: + virtual void video_start() override; + +private: + // video-related + bitmap_ind16 m_bitmap0{}; + tilemap_t *m_vram_tilemap = nullptr; + std::unique_ptr m_sprite_triple_buffer[2]{}; + std::unique_ptr m_vram_buffer{}; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_deco146; + required_device_array m_spriteram; + required_device_array m_sprgen; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + + // memory pointers + required_shared_ptr m_control_data; + required_shared_ptr m_vram_data; + required_shared_ptr_array m_pixel_data; + + required_ioport_array<4> m_trackball_io; + + void control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t trackball_r(offs_t offset); + void pixel_0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void pixel_1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + void copy_bitmap(bitmap_rgb32 &bitmap, int *xscroll, int *yscroll, const rectangle &cliprect); + + uint16_t protection_region_0_146_r(offs_t offset); + void protection_region_0_146_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/************************************************************************** + + There are two sets of sprites, the combination of custom chips 52 & 71. + There is a background pixel layer implemented with discrete logic + rather than a custom chip and a foreground VRAM tilemap layer that the + game mostly uses as a pixel layer (the VRAM format is arranged as + sequential pixels, rather than sequential characters). + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(lemmings_state::get_tile_info) +{ + uint16_t const tile = m_vram_data[tile_index]; + tileinfo.set(2, + tile & 0x7ff, + (tile >> 12) & 0xf, + 0); +} + +void lemmings_state::video_start() +{ + m_vram_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(lemmings_state::get_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); + + m_vram_tilemap->set_transparent_pen(0); + m_bitmap0.fill(0x100); + + m_vram_buffer = make_unique_clear(2048 * 64); // 64 bytes per VRAM character + m_gfxdecode->gfx(2)->set_source(m_vram_buffer.get()); + + m_sprgen[0]->alloc_sprite_bitmap(); + m_sprgen[1]->alloc_sprite_bitmap(); + + m_sprite_triple_buffer[0] = make_unique_clear(0x800 / 2); + m_sprite_triple_buffer[1] = make_unique_clear(0x800 / 2); + + save_item(NAME(m_bitmap0)); + save_pointer(NAME(m_vram_buffer), 2048 * 64); + save_pointer(NAME(m_sprite_triple_buffer[0]), 0x800 / 2, 0); + save_pointer(NAME(m_sprite_triple_buffer[1]), 0x800 / 2, 1); +} + +void lemmings_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + for (int chip = 0; chip < 2; chip++) + std::copy_n(&m_spriteram[chip]->buffer()[0], 0x800 / 2, &m_sprite_triple_buffer[chip][0]); + } +} -void lemmings_state::lemmings_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) +/******************************************************************************/ + +// RAM based +void lemmings_state::pixel_0_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - /* Offset==0 Pixel layer X scroll */ + int const old = m_pixel_data[0][offset]; + COMBINE_DATA(&m_pixel_data[0][offset]); + int const src = m_pixel_data[0][offset]; + if (old == src) + return; + + int const sy = (offset << 1) >> 11; + int const sx = (offset << 1) & 0x7ff; + + if (sx > 2047 || sy > 255) + return; + + m_bitmap0.pix(sy, sx + 0) = ((src >> 8) & 0xf) | 0x100; + m_bitmap0.pix(sy, sx + 1) = ((src >> 0) & 0xf) | 0x100; +} + +// RAM based tiles for the FG tilemap +void lemmings_state::pixel_1_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_pixel_data[1][offset]); + int const src = m_pixel_data[1][offset]; + + int const sy = (offset << 1) >> 9; + int sx = (offset << 1) & 0x1ff; + + // Copy pixel to buffer for easier decoding later + int const tile = ((sx / 8) * 32) + (sy / 8); + m_gfxdecode->gfx(2)->mark_dirty(tile); + m_vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 8) & 0xf; + + sx += 1; // Update both pixels in the word + m_vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 0) & 0xf; +} + +void lemmings_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_vram_data[offset]); + m_vram_tilemap->mark_tile_dirty(offset); +} + + +void lemmings_state::copy_bitmap(bitmap_rgb32 &bitmap, int *xscroll, int *yscroll, const rectangle &cliprect) +{ + pen_t const *const paldata = m_palette->pens(); + + for (int y = cliprect.top(); y < cliprect.bottom(); y++) + { + uint32_t *const dst = &bitmap.pix(y, 0); + + for (int x = cliprect.left(); x < cliprect.right(); x++) + { + uint16_t const src = m_bitmap0.pix((y - *yscroll) & 0xff, (x - *xscroll) & 0x7ff); + + if (src != 0x100) + dst[x] = paldata[src]; + } + } +} + +uint32_t lemmings_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + int x1 = -m_control_data[0]; + int x0 = -m_control_data[2]; + int y = 0; + rectangle rect(0, 0, cliprect.top(), cliprect.bottom()); + + // sprites are flipped relative to tilemaps + m_sprgen[0]->set_flip_screen(true); + m_sprgen[1]->set_flip_screen(true); + m_sprgen[0]->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer[1].get(), 0x400); + m_sprgen[1]->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer[0].get(), 0x400); + + bitmap.fill(m_palette->black_pen(), cliprect); + m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff); + + // Pixel layer can be windowed in hardware (two player mode) + if ((m_control_data[6] & 2) == 0) + { + copy_bitmap(bitmap, &x1, &y, cliprect); + } + else + { + rect.setx(0, 159); + copy_bitmap(bitmap, &x0, &y, rect); + + rect.setx(160, 319); + copy_bitmap(bitmap, &x1, &y, rect); + } + + m_sprgen[1]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff); + m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff); + m_vram_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_sprgen[1]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0xff); + return 0; +} + + +// machine + +void lemmings_state::control_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + // Offset==0 Pixel layer X scroll if (offset == 4) - return; /* Watchdog or IRQ ack */ + return; // Watchdog or IRQ ack COMBINE_DATA(&m_control_data[offset]); } -uint16_t lemmings_state::lemmings_trackball_r(offs_t offset) +uint16_t lemmings_state::trackball_r(offs_t offset) { if ((offset & 2) == 0) return m_trackball_io[(offset & 1) | ((offset & 4) >> 1)]->read(); return 0; } -uint16_t lemmings_state::lem_protection_region_0_146_r(offs_t offset) +uint16_t lemmings_state::protection_region_0_146_r(offs_t offset) { - int real_address = 0 + (offset *2); - int deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; + int const real_address = 0 + (offset *2); + int const deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; uint8_t cs = 0; - uint16_t data = m_deco146->read_data( deco146_addr, cs ); + uint16_t data = m_deco146->read_data(deco146_addr, cs); return data; } -void lemmings_state::lem_protection_region_0_146_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void lemmings_state::protection_region_0_146_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - int real_address = 0 + (offset *2); - int deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; + int const real_address = 0 + (offset *2); + int const deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; uint8_t cs = 0; - m_deco146->write_data( deco146_addr, data, mem_mask, cs ); + m_deco146->write_data(deco146_addr, data, mem_mask, cs); } /******************************************************************************/ -void lemmings_state::lemmings_map(address_map &map) +void lemmings_state::main_map(address_map &map) { map(0x000000, 0x0fffff).rom(); map(0x100000, 0x10ffff).ram(); map(0x120000, 0x1207ff).ram().share("spriteram1"); map(0x140000, 0x1407ff).ram().share("spriteram2"); map(0x160000, 0x160fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x170000, 0x17000f).ram().w(FUNC(lemmings_state::lemmings_control_w)).share("control_data"); - map(0x190000, 0x19000f).r(FUNC(lemmings_state::lemmings_trackball_r)); - map(0x1a0000, 0x1a3fff).rw(FUNC(lemmings_state::lem_protection_region_0_146_r), FUNC(lemmings_state::lem_protection_region_0_146_w)).share("prot16ram"); /* Protection device */ - map(0x1c0000, 0x1c0001).w(m_spriteram[0], FUNC(buffered_spriteram16_device::write)); /* 1 written once a frame */ - map(0x1e0000, 0x1e0001).w(m_spriteram[1], FUNC(buffered_spriteram16_device::write)); /* 1 written once a frame */ - map(0x200000, 0x201fff).ram().w(FUNC(lemmings_state::lemmings_vram_w)).share("vram_data"); + map(0x170000, 0x17000f).ram().w(FUNC(lemmings_state::control_w)).share(m_control_data); + map(0x190000, 0x19000f).r(FUNC(lemmings_state::trackball_r)); + map(0x1a0000, 0x1a3fff).rw(FUNC(lemmings_state::protection_region_0_146_r), FUNC(lemmings_state::protection_region_0_146_w)).share("prot16ram"); // Protection device + map(0x1c0000, 0x1c0001).w(m_spriteram[0], FUNC(buffered_spriteram16_device::write)); // 1 written once a frame + map(0x1e0000, 0x1e0001).w(m_spriteram[1], FUNC(buffered_spriteram16_device::write)); // 1 written once a frame + map(0x200000, 0x201fff).ram().w(FUNC(lemmings_state::vram_w)).share(m_vram_data); map(0x202000, 0x202fff).ram(); - map(0x300000, 0x37ffff).ram().w(FUNC(lemmings_state::lemmings_pixel_0_w)).share("pixel_0_data"); - map(0x380000, 0x39ffff).ram().w(FUNC(lemmings_state::lemmings_pixel_1_w)).share("pixel_1_data"); + map(0x300000, 0x37ffff).ram().w(FUNC(lemmings_state::pixel_0_w)).share(m_pixel_data[0]); + map(0x380000, 0x39ffff).ram().w(FUNC(lemmings_state::pixel_1_w)).share(m_pixel_data[1]); } /******************************************************************************/ @@ -202,28 +437,24 @@ static const gfx_layout sprite_layout = }; static GFXDECODE_START( gfx_lemmings ) - GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 512, 16 ) /* Sprites 16x16 */ - GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 768, 16 ) /* Sprites 16x16 */ - GFXDECODE_ENTRY( nullptr,0, charlayout, 0, 16 ) /* Dynamically modified */ + GFXDECODE_ENTRY( "sprites1", 0, sprite_layout, 512, 16 ) // Sprites 16x16 + GFXDECODE_ENTRY( "sprites2", 0, sprite_layout, 768, 16 ) // Sprites 16x16 + GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 16 ) // Dynamically modified GFXDECODE_END /******************************************************************************/ -void lemmings_state::machine_start() -{ -} - void lemmings_state::lemmings(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M68000(config, m_maincpu, 28_MHz_XTAL / 2); // Data East 59 - m_maincpu->set_addrmap(AS_PROGRAM, &lemmings_state::lemmings_map); + m_maincpu->set_addrmap(AS_PROGRAM, &lemmings_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(lemmings_state::irq6_line_hold)); MC6809E(config, m_audiocpu, 32.22_MHz_XTAL / 24); // MC68B09EP; clock not verified m_audiocpu->set_addrmap(AS_PROGRAM, &lemmings_state::sound_map); - /* video hardware */ + // video hardware BUFFERED_SPRITERAM16(config, m_spriteram[0]); BUFFERED_SPRITERAM16(config, m_spriteram[1]); @@ -232,8 +463,8 @@ void lemmings_state::lemmings(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(529)); screen.set_size(40*8, 32*8); screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(lemmings_state::screen_update_lemmings)); - screen.screen_vblank().set(FUNC(lemmings_state::screen_vblank_lemmings)); + screen.set_screen_update(FUNC(lemmings_state::screen_update)); + screen.screen_vblank().set(FUNC(lemmings_state::screen_vblank)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_lemmings); PALETTE(config, m_palette).set_format(palette_device::xBGR_888, 1024); @@ -253,7 +484,7 @@ void lemmings_state::lemmings(machine_config &config) m_deco146->set_use_magic_read_address_xor(true); m_deco146->soundlatch_irq_cb().set_inputline(m_audiocpu, M6809_FIRQ_LINE); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -272,7 +503,7 @@ void lemmings_state::lemmings(machine_config &config) /******************************************************************************/ ROM_START( lemmings ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "lemmings.5", 0x00000, 0x20000, CRC(e9a2b439) SHA1(873723a06d71bb41772951f451a75578b30267d5) ) ROM_LOAD16_BYTE( "lemmings.1", 0x00001, 0x20000, CRC(bf52293b) SHA1(47a1ed64bf02776db086fdce80997b8a0c068791) ) ROM_LOAD16_BYTE( "lemmings.6", 0x40000, 0x20000, CRC(0e3dc0ea) SHA1(533abf66ca4b578d03566d5de922dc5828c26eca) ) @@ -282,23 +513,26 @@ ROM_START( lemmings ) ROM_LOAD16_BYTE( "lemmings.8", 0xc0000, 0x20000, CRC(9166ce09) SHA1(7f0970cc07ebdbfc9a738342259d07d37b397161) ) ROM_LOAD16_BYTE( "lemmings.4", 0xc0001, 0x20000, CRC(aa845488) SHA1(d17ec80f43d2a0123e93fad83d4e1319eb18d7c7) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "lemmings.15", 0x00000, 0x10000, CRC(f0b24a35) SHA1(1aaeb1e6faee04d2e433161fd7aa965b58e3b8a7) ) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASE00 ) /* 3bpp data but sprite chip expects 4 */ + ROM_REGION( 0x40000, "sprites1", ROMREGION_ERASE00 ) // 3bpp data but sprite chip expects 4 ROM_LOAD32_BYTE( "lemmings.9", 0x000003, 0x10000, CRC(e06442f5) SHA1(d9c8b681cce1d0257a0446bc820c7d679e2a1168) ) ROM_LOAD32_BYTE( "lemmings.10", 0x000002, 0x10000, CRC(36398848) SHA1(6c6956607f889c35367e6df4a32359042fad695e) ) ROM_LOAD32_BYTE( "lemmings.11", 0x000001, 0x10000, CRC(b46a54e5) SHA1(53b053346f80357aecff4ab888a8562f99cb318f) ) - ROM_REGION( 0x40000, "gfx2", ROMREGION_ERASE00 ) /* 3bpp data but sprite chip expects 4 */ + ROM_REGION( 0x40000, "sprites2", ROMREGION_ERASE00 ) // 3bpp data but sprite chip expects 4 ROM_LOAD32_BYTE( "lemmings.12", 0x000003, 0x10000, CRC(dc9047ff) SHA1(1bbe573fa51127a9e8b970a353f3cceab00f486a) ) ROM_LOAD32_BYTE( "lemmings.13", 0x000002, 0x10000, CRC(7cc15491) SHA1(73c1c11b2738f6679c70cae8ac4c55cdc9b8fc27) ) ROM_LOAD32_BYTE( "lemmings.14", 0x000001, 0x10000, CRC(c162788f) SHA1(e1f669efa59699cd1b7da71b112701ee79240c18) ) - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "lemmings.16", 0x00000, 0x20000, CRC(f747847c) SHA1(00880fa6dff979e5d15daea61938bd18c768c92f) ) ROM_END +} // anonymous namespace + + /******************************************************************************/ GAME( 1991, lemmings, 0, lemmings, lemmings, lemmings_state, empty_init, ROT0, "Data East USA", "Lemmings (US prototype)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/lemmings.h b/src/mame/dataeast/lemmings.h deleted file mode 100644 index 850b17ef8b25f..0000000000000 --- a/src/mame/dataeast/lemmings.h +++ /dev/null @@ -1,73 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -#include "video/bufsprite.h" -#include "decospr.h" -#include "deco146.h" -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -class lemmings_state : public driver_device -{ -public: - lemmings_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_bitmap0(2048, 256) - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_deco146(*this, "ioprot") - , m_spriteram(*this, "spriteram%u", 1) - , m_sprgen(*this, "spritegen%u", 1) - , m_gfxdecode(*this, "gfxdecode") - , m_palette(*this, "palette") - , m_soundlatch(*this, "soundlatch") - , m_control_data(*this, "control_data") - , m_vram_data(*this, "vram_data") - , m_pixel_data(*this, "pixel_%u_data", 0) - , m_trackball_io(*this, "AN%u", 0) - { - } - - void lemmings(machine_config &config); - -private: - /* video-related */ - bitmap_ind16 m_bitmap0{}; - tilemap_t *m_vram_tilemap = nullptr; - std::unique_ptr m_sprite_triple_buffer[2]{}; - std::unique_ptr m_vram_buffer{}; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_deco146; - required_device_array m_spriteram; - required_device_array m_sprgen; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - /* memory pointers */ - required_shared_ptr m_control_data; - required_shared_ptr m_vram_data; - required_shared_ptr_array m_pixel_data; - - required_ioport_array<4> m_trackball_io; - - void lemmings_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t lemmings_trackball_r(offs_t offset); - void lemmings_pixel_0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void lemmings_pixel_1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void lemmings_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void video_start() override; - uint32_t screen_update_lemmings(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void screen_vblank_lemmings(int state); - void lemmings_copy_bitmap(bitmap_rgb32& bitmap, int* xscroll, int* yscroll, const rectangle& cliprect); - - uint16_t lem_protection_region_0_146_r(offs_t offset); - void lem_protection_region_0_146_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void lemmings_map(address_map &map); - void sound_map(address_map &map); -}; diff --git a/src/mame/dataeast/lemmings_v.cpp b/src/mame/dataeast/lemmings_v.cpp deleted file mode 100644 index 22fb247d18183..0000000000000 --- a/src/mame/dataeast/lemmings_v.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -/*************************************************************************** - - Lemmings video emulation - Bryan McPhail, mish@tendril.co.uk - -********************************************************************* - - There are two sets of sprites, the combination of custom chips 52 & 71. - There is a background pixel layer implemented with discrete logic - rather than a custom chip and a foreground VRAM tilemap layer that the - game mostly uses as a pixel layer (the vram format is arranged as - sequential pixels, rather than sequential characters). - -***************************************************************************/ - -#include "emu.h" -#include "lemmings.h" - -#include - -/******************************************************************************/ - -TILE_GET_INFO_MEMBER(lemmings_state::get_tile_info) -{ - uint16_t tile = m_vram_data[tile_index]; - - tileinfo.set(2, - tile&0x7ff, - (tile>>12)&0xf, - 0); -} - -void lemmings_state::video_start() -{ - m_vram_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(lemmings_state::get_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); - - m_vram_tilemap->set_transparent_pen(0); - m_bitmap0.fill(0x100); - - m_vram_buffer = make_unique_clear(2048 * 64); // 64 bytes per VRAM character - m_gfxdecode->gfx(2)->set_source(m_vram_buffer.get()); - - m_sprgen[0]->alloc_sprite_bitmap(); - m_sprgen[1]->alloc_sprite_bitmap(); - - m_sprite_triple_buffer[0] = make_unique_clear(0x800/2); - m_sprite_triple_buffer[1] = make_unique_clear(0x800/2); - - save_item(NAME(m_bitmap0)); - save_pointer(NAME(m_vram_buffer), 2048 * 64); - save_pointer(NAME(m_sprite_triple_buffer[0]), 0x800/2, 0); - save_pointer(NAME(m_sprite_triple_buffer[1]), 0x800/2, 1); -} - -void lemmings_state::screen_vblank_lemmings(int state) -{ - // rising edge - if (state) - { - for (int chip = 0; chip < 2; chip++) - std::copy_n(&m_spriteram[chip]->buffer()[0], 0x800/2, &m_sprite_triple_buffer[chip][0]); - } -} - -/******************************************************************************/ - -// RAM based -void lemmings_state::lemmings_pixel_0_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - int const old = m_pixel_data[0][offset]; - COMBINE_DATA(&m_pixel_data[0][offset]); - int const src = m_pixel_data[0][offset]; - if (old == src) - return; - - int const sy = (offset << 1) >> 11; - int const sx = (offset << 1) & 0x7ff; - - if (sx > 2047 || sy > 255) - return; - - m_bitmap0.pix(sy, sx + 0) = ((src >> 8) & 0xf) | 0x100; - m_bitmap0.pix(sy, sx + 1) = ((src >> 0) & 0xf) | 0x100; -} - -// RAM based tiles for the FG tilemap -void lemmings_state::lemmings_pixel_1_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - int sx, sy, src, tile; - - COMBINE_DATA(&m_pixel_data[1][offset]); - src = m_pixel_data[1][offset]; - - sy = (offset << 1) >> 9; - sx = (offset << 1) & 0x1ff; - - /* Copy pixel to buffer for easier decoding later */ - tile = ((sx / 8) * 32) + (sy / 8); - m_gfxdecode->gfx(2)->mark_dirty(tile); - m_vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 8) & 0xf; - - sx += 1; /* Update both pixels in the word */ - m_vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 0) & 0xf; -} - -void lemmings_state::lemmings_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_vram_data[offset]); - m_vram_tilemap->mark_tile_dirty(offset); -} - - -void lemmings_state::lemmings_copy_bitmap(bitmap_rgb32& bitmap, int* xscroll, int* yscroll, const rectangle& cliprect) -{ - pen_t const *const paldata = m_palette->pens(); - - for (int y=cliprect.top(); yset_flip_screen(true); - m_sprgen[1]->set_flip_screen(true); - m_sprgen[0]->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer[1].get(), 0x400); - m_sprgen[1]->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer[0].get(), 0x400); - - bitmap.fill(m_palette->black_pen(), cliprect); - m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff); - - /* Pixel layer can be windowed in hardware (two player mode) */ - if ((m_control_data[6] & 2) == 0) - { - lemmings_copy_bitmap(bitmap, &x1, &y, cliprect); - } - else - { - rect.setx(0, 159); - lemmings_copy_bitmap(bitmap, &x0, &y, rect); - - rect.setx(160, 319); - lemmings_copy_bitmap(bitmap, &x1, &y, rect); - } - - m_sprgen[1]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff); - m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff); - m_vram_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_sprgen[1]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0xff); - return 0; -} diff --git a/src/mame/ddr/chessmstdm.cpp b/src/mame/ddr/chessmstdm.cpp index aaf92c7fa25a6..be9650a92d159 100644 --- a/src/mame/ddr/chessmstdm.cpp +++ b/src/mame/ddr/chessmstdm.cpp @@ -264,7 +264,7 @@ static INPUT_PORTS_START( chessmstdm ) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Move Back") PORT_CODE(KEYCODE_LEFT) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Board") PORT_CODE(KEYCODE_B) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Match / Time") PORT_CODE(KEYCODE_M) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Parameter / Information") PORT_CODE(KEYCODE_I) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Parameter / Information") PORT_CODE(KEYCODE_P) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Selection / Dialogue") PORT_CODE(KEYCODE_S) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / Notation") PORT_CODE(KEYCODE_F) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) diff --git a/src/mame/ddr/sc2.cpp b/src/mame/ddr/sc2.cpp index b998b7ac8a5d8..0014d620ce6a9 100644 --- a/src/mame/ddr/sc2.cpp +++ b/src/mame/ddr/sc2.cpp @@ -185,7 +185,7 @@ static INPUT_PORTS_START( sc2 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, sc2_state, reset_button, 0) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_P) INPUT_PORTS_END diff --git a/src/mame/exidy/exidyttl.cpp b/src/mame/exidy/exidyttl.cpp index 289c5d3df1350..e4794dfcc4ecc 100644 --- a/src/mame/exidy/exidyttl.cpp +++ b/src/mame/exidy/exidyttl.cpp @@ -55,20 +55,11 @@ class exidyttl_state : public driver_device } void attack(machine_config &config); - void deathrac(machine_config &config); - void destdrby(machine_config &config); private: // devices required_device m_maincpu; required_device m_video; - - // driver_device overrides - virtual void machine_start() override; - virtual void machine_reset() override; - - virtual void video_start() override; - }; @@ -86,20 +77,6 @@ static NETLIST_START(attack) } - -void exidyttl_state::machine_start() -{ -} - -void exidyttl_state::machine_reset() -{ -} - - -void exidyttl_state::video_start() -{ -} - void exidyttl_state::attack(machine_config &config) { /* basic machine hardware */ @@ -115,25 +92,6 @@ void exidyttl_state::attack(machine_config &config) m_video->set_threshold(0.30); } -void exidyttl_state::destdrby(machine_config &config) -{ - /* basic machine hardware */ - NETLIST_CPU(config, m_maincpu, netlist::config::DEFAULT_CLOCK()).set_source(netlist_attack); - - /* video hardware */ - 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-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL); - m_video->set_vert_params(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL); - m_video->set_fieldcount(1); - m_video->set_threshold(0.30); -} - -void exidyttl_state::deathrac(machine_config& config) -{ - destdrby(config); -} /*************************************************************************** @@ -154,7 +112,7 @@ ROM_START( attckexd ) ROM_LOAD( "attack.k6", 0x0000, 0x0100, CRC(e120839f) SHA1(74dc19a732238d35e467d814ead581a60463aaa2) ) ROM_END -ROM_START( attckexd2 ) // These are likely an overdump, but we are waiting for confirmation before removing the files +ROM_START( attckexd2 ) // These are likely an overdump, but confirmation is needed before removing the files ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_REGION( 0x0400, "roms", ROMREGION_ERASE00 ) @@ -254,24 +212,24 @@ ROM_START( deathrac ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_REGION( 0x0400, "roms", ROMREGION_ERASE00 ) - ROM_LOAD( "6331-31.a11", 0x0000, 0x0020, CRC(f304a1fb) SHA1(0f029274bb99723ebcc271d761e1500ca50b2738) ) - ROM_LOAD( "6331-32.c12", 0x0000, 0x0020, CRC(f8dbd779) SHA1(55bdaf9eb1ba6185e20512c4874ebb625861508e) ) - ROM_LOAD( "6331-33.p14", 0x0000, 0x0020, CRC(2e83bf80) SHA1(02fcc1e879c06759a21ef4f004fe7aa790814112) ) + ROM_LOAD( "6331-31.11a", 0x0000, 0x0020, CRC(f304a1fb) SHA1(0f029274bb99723ebcc271d761e1500ca50b2738) ) + ROM_LOAD( "6331-32.12c", 0x0000, 0x0020, CRC(f8dbd779) SHA1(55bdaf9eb1ba6185e20512c4874ebb625861508e) ) + ROM_LOAD( "6331-33.14p", 0x0000, 0x0020, CRC(2e83bf80) SHA1(02fcc1e879c06759a21ef4f004fe7aa790814112) ) // Note: Image for 36 has all zeros in the second half, which is unused. This is verified correct from a real board. - // Other roms in this series (34,35) all have duplicate content in the second half - ROM_LOAD( "6331-36.e7", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) - ROM_LOAD( "6331-35.g7", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) - ROM_LOAD( "6331-36.r7", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) - ROM_LOAD( "6331-35.t7", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) - - ROM_LOAD( "6301-91.j10", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) - ROM_LOAD( "6301-91.v10", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) - ROM_LOAD( "6301-92.j5", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) - ROM_LOAD( "6301-92.v5", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) - ROM_LOAD( "6301-97.m11", 0x0000, 0x0100, CRC(2b02444f) SHA1(e1fc01f7271109515438542a223efc0042f794a5) ) - ROM_LOAD( "6301-98.l11", 0x0000, 0x0100, CRC(0bdaf1eb) SHA1(67976e73bfdc4d42a520212d020dd52d51667674) ) - ROM_LOAD( "6301-99.k11", 0x0000, 0x0100, CRC(34763c8f) SHA1(2012ace666e8b82a89a0c15511ee80173d9700bc) ) - ROM_LOAD( "6301-100.j11", 0x0000, 0x0100, CRC(d751bd57) SHA1(a6208af40661bf3cd50363d2ece38cd3b9f6a7a0) ) + // Other ROMs in this series (34,35) all have duplicate content in the second half + ROM_LOAD( "6331-36.7e", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) + ROM_LOAD( "6331-35.7g", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) + ROM_LOAD( "6331-36.7r", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) + ROM_LOAD( "6331-35.7t", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) + + ROM_LOAD( "6301-91.10j", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) + ROM_LOAD( "6301-91.10v", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) + ROM_LOAD( "6301-92.5j", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) + ROM_LOAD( "6301-92.5v", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) + ROM_LOAD( "6301-97.11m", 0x0000, 0x0100, CRC(2b02444f) SHA1(e1fc01f7271109515438542a223efc0042f794a5) ) + ROM_LOAD( "6301-98.11l", 0x0000, 0x0100, CRC(0bdaf1eb) SHA1(67976e73bfdc4d42a520212d020dd52d51667674) ) + ROM_LOAD( "6301-99.11k", 0x0000, 0x0100, CRC(34763c8f) SHA1(2012ace666e8b82a89a0c15511ee80173d9700bc) ) + ROM_LOAD( "6301-100.11j", 0x0000, 0x0100, CRC(d751bd57) SHA1(a6208af40661bf3cd50363d2ece38cd3b9f6a7a0) ) ROM_END #define rom_rhunting rom_deathrac @@ -279,8 +237,8 @@ ROM_END } // anonymous namespace -GAME( 1977, attckexd, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 1) [TTL]", MACHINE_IS_SKELETON ) -GAME( 1977, attckexd2, attckexd, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 2) [TTL]", MACHINE_IS_SKELETON ) -GAME( 1976, deathrac, 0, deathrac, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Death Race [TTL]", MACHINE_IS_SKELETON ) -GAME( 1976, destdrby, 0, destdrby, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Destruction Derby [TTL]", MACHINE_IS_SKELETON) -GAME( 1976, rhunting, deathrac, deathrac, 0, exidyttl_state, empty_init, ROT0, "bootleg", "Robot Hunting (bootleg of Death Race) [TTL]",MACHINE_IS_SKELETON ) +GAME( 1977, attckexd, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 1) [TTL]", MACHINE_IS_SKELETON ) +GAME( 1977, attckexd2, attckexd, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 2) [TTL]", MACHINE_IS_SKELETON ) +GAME( 1976, deathrac, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Death Race [TTL]", MACHINE_IS_SKELETON ) +GAME( 1976, destdrby, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Destruction Derby [TTL]", MACHINE_IS_SKELETON) +GAME( 1976, rhunting, deathrac, attack, 0, exidyttl_state, empty_init, ROT0, "bootleg", "Robot Hunting (bootleg of Death Race) [TTL]",MACHINE_IS_SKELETON ) diff --git a/src/mame/fidelity/cc1.cpp b/src/mame/fidelity/cc1.cpp index 4217e0f22a106..0faec2b91801e 100644 --- a/src/mame/fidelity/cc1.cpp +++ b/src/mame/fidelity/cc1.cpp @@ -243,7 +243,7 @@ static INPUT_PORTS_START( cc10c ) PORT_INCLUDE( cc3 ) PORT_MODIFY("IN.1") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM / PB") PORT_CODE(KEYCODE_M) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM / PB") PORT_CODE(KEYCODE_M) PORT_CODE(KEYCODE_P) INPUT_PORTS_END diff --git a/src/mame/fidelity/cc10.cpp b/src/mame/fidelity/cc10.cpp index 3ecfc7759f7cf..7f25925edd6cd 100644 --- a/src/mame/fidelity/cc10.cpp +++ b/src/mame/fidelity/cc10.cpp @@ -236,7 +236,7 @@ static INPUT_PORTS_START( ccx ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) diff --git a/src/mame/fidelity/cc7.cpp b/src/mame/fidelity/cc7.cpp index 969cbc5d3ca27..4975e9266c549 100644 --- a/src/mame/fidelity/cc7.cpp +++ b/src/mame/fidelity/cc7.cpp @@ -174,12 +174,12 @@ static INPUT_PORTS_START( bcc ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_X) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("B2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_B) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("F6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_F) @@ -205,14 +205,14 @@ static INPUT_PORTS_START( bkc ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("GM") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("GM") PORT_CODE(KEYCODE_G) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PV") PORT_CODE(KEYCODE_V) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) INPUT_PORTS_END diff --git a/src/mame/fidelity/vcc.cpp b/src/mame/fidelity/vcc.cpp index 9606db3514496..7d24b5ca225f6 100644 --- a/src/mame/fidelity/vcc.cpp +++ b/src/mame/fidelity/vcc.cpp @@ -302,7 +302,7 @@ static INPUT_PORTS_START( vcc ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) diff --git a/src/mame/handheld/hh_cop400.cpp b/src/mame/handheld/hh_cop400.cpp index 3333131876295..fac54e5e6a9b3 100644 --- a/src/mame/handheld/hh_cop400.cpp +++ b/src/mame/handheld/hh_cop400.cpp @@ -2827,7 +2827,7 @@ SYST( 1980, minspace, 0, 0, minspace, minspace, minspace_stat SYST( 1980, plus1, 0, 0, plus1, plus1, plus1_state, empty_init, "Milton Bradley", "Plus One", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_CONTROLS ) // *** SYST( 1981, lightfgt, 0, 0, lightfgt, lightfgt, lightfgt_state, empty_init, "Milton Bradley", "Electronic Lightfight: The Games of Dueling Lights", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1982, bshipg, bship, 0, bshipg, bshipg, bshipg_state, empty_init, "Milton Bradley", "Electronic Battleship (COP420 version, Rev. G)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // *** +SYST( 1982, bshipg, bship, 0, bshipg, bshipg, bshipg_state, empty_init, "Milton Bradley", "Electronic Battleship (COP420 version, rev. G)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // *** SYST( 1979, qkracera, qkracer, 0, qkracera, qkracera, qkracera_state, empty_init, "National Semiconductor", "QuizKid Racer (COP420 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) SYST( 1982, copspa, 0, 0, mdallas, copspa, mdallas_state, empty_init, "National Semiconductor", "COPS Pocket Assistant", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/handheld/hh_hmcs40.cpp b/src/mame/handheld/hh_hmcs40.cpp index 98995a25d1160..94ce348f3248a 100644 --- a/src/mame/handheld/hh_hmcs40.cpp +++ b/src/mame/handheld/hh_hmcs40.cpp @@ -5388,8 +5388,8 @@ SYST( 1984, pairmtch, 0, 0, pairmtch, pairmtch, pairmtch_state, SYST( 1981, alnattck, 0, 0, alnattck, alnattck, alnattck_state, empty_init, "Coleco", "Alien Attack", MACHINE_SUPPORTS_SAVE ) SYST( 1982, cdkong, 0, 0, cdkong, cdkong, cdkong_state, empty_init, "Coleco", "Donkey Kong (Coleco)", MACHINE_SUPPORTS_SAVE ) SYST( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, cgalaxn_state, empty_init, "Coleco", "Galaxian (Coleco)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) -SYST( 1981, cpacman, 0, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 29)", MACHINE_SUPPORTS_SAVE ) -SYST( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 28)", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, cpacman, 0, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, rev. 29)", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, rev. 28)", MACHINE_SUPPORTS_SAVE ) SYST( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, cmspacmn_state, empty_init, "Coleco", "Ms. Pac-Man (Coleco)", MACHINE_SUPPORTS_SAVE ) SYST( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, egalaxn2_state, empty_init, "Entex", "Galaxian 2 (Entex)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/handheld/hh_pic16.cpp b/src/mame/handheld/hh_pic16.cpp index 31f1fe4e4eb1d..6fa04f8d54b1a 100644 --- a/src/mame/handheld/hh_pic16.cpp +++ b/src/mame/handheld/hh_pic16.cpp @@ -2193,7 +2193,7 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1979, touchme, 0, 0, touchme, touchme, touchme_state, empty_init, "Atari", "Touch Me (handheld, Rev. 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1979, touchme, 0, 0, touchme, touchme, touchme_state, empty_init, "Atari", "Touch Me (handheld, rev. 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) SYST( 1979, pabball, 0, 0, pabball, pabball, pabball_state, empty_init, "Calfax / Caprice Electronics", "Pro-Action Electronic-Computerized Baseball", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) diff --git a/src/mame/handheld/hh_pps41.cpp b/src/mame/handheld/hh_pps41.cpp index 8b02c1ffe72d8..b2ef2c96cb26e 100644 --- a/src/mame/handheld/hh_pps41.cpp +++ b/src/mame/handheld/hh_pps41.cpp @@ -388,7 +388,7 @@ static INPUT_PORTS_START( ftri1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Swing / S2 V") PORT_START("RESET") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CHANGED_MEMBER(DEVICE_SELF, ftri1_state, reset_button, 0) PORT_CODE(KEYCODE_F1) PORT_NAME("Game Reset") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_MEMBER(DEVICE_SELF, ftri1_state, reset_button, 0) PORT_NAME("Game Reset") INPUT_PORTS_END // config @@ -800,7 +800,7 @@ static INPUT_PORTS_START( memoquiz ) PORT_START("IN.3") // DIO3 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("?") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("PE") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("PE") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("CD") PORT_START("IN.4") @@ -1753,7 +1753,7 @@ static INPUT_PORTS_START( rdqa ) PORT_START("IN.3") // DIO3 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Right") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Wrong") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Pass") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Pass") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index bf7bdfa2a7405..e15073449dac9 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -304,6 +304,7 @@ on Joerg Woerner's datamath.org: http://www.datamath.org/IC_List.htm #include "h2hfootb.lh" #include "h2hhockey.lh" #include "horseran.lh" +#include "lilprof.lh" #include "litelrn.lh" #include "liveafb.lh" #include "lostreas.lh" @@ -356,7 +357,6 @@ on Joerg Woerner's datamath.org: http://www.datamath.org/IC_List.htm #include "tmvolleyb.lh" #include "uboat.lh" #include "vclock3.lh" -#include "wizatron.lh" #include "xl25.lh" #include "zodiac.lh" @@ -1596,7 +1596,7 @@ static INPUT_PORTS_START( palmf31 ) PORT_START("IN.5") // R5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME(u8"π") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME(u8"π") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME(u8"x²") PORT_START("IN.6") // R6 @@ -2226,7 +2226,7 @@ u8 zodiac_state::read_k() // inputs -/* The physical button layout and labels are like this: +/* physical button layout and labels are like this: [P] [A] [ 1 ] [ 2 ] [ 3 ] @@ -2236,45 +2236,38 @@ u8 zodiac_state::read_k() [.__.__.__.] OFF H P A - -Despite that this layout features a typical digital keypad and distances -the letter buttons from it, the 8-character encoding for date input uses -letters and digits in combination. This fact and the use of the P key are -why the digit buttons are mapped here as keyboard inputs rather than as a -keypad. - */ static INPUT_PORTS_START( zodiac ) PORT_START("IN.0") // R0 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('3') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("D") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") PORT_START("IN.3") // R3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("P") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("L") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("J") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("E") PORT_START("IN.4") // R4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_CHAR(13) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_CHAR(8) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_START("IN.5") // R8 PORT_CONFNAME( 0x03, 0x01, "Mode") @@ -7818,7 +7811,7 @@ static INPUT_PORTS_START( starwbc ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("Basic Game") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("Intermediate Game") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("Advanced Game") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Player Number") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Player Number") PORT_START("IN.1") // R1 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Start Turn") @@ -9817,7 +9810,7 @@ ROM_END /******************************************************************************* Milton Bradley Dark Tower - * TMS1400NLL MP7332-N1.U1(Rev. B) or MP7332-N2LL(Rev. C) (die label: + * TMS1400NLL MP7332-N1.U1(rev. B) or MP7332-N2LL(rev. C) (die label: TMS1400, MP7332, 28L 01D D100 R100) (assume same ROM between revisions) * SN75494N MOS-to-LED digit driver * motorized rotating reel + lightsensor, 1bit-sound @@ -10271,7 +10264,7 @@ static INPUT_PORTS_START( cnsector ) PORT_START("IN.2") // O2 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Recall") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("Evasive Sub") // expert button + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Evasive Sub") // expert button PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fire") @@ -10279,7 +10272,7 @@ static INPUT_PORTS_START( cnsector ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Slower") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Sub Finder") // expert button + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Sub Finder") // expert button PORT_START("IN.4") // O4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Move Ship") @@ -13658,11 +13651,7 @@ ROM_END refreshable Braille cells. The TI-30 itself is slightly modified to wire the original LED display to a 25-pin D-Sub connector. - TI Business Analyst, TI Business Analyst-I, TI Money Manager, TI-31, TI-41 - * TMS0980 MCU label TMC0982NL (die label: 0980B-82F) - - TI Programmer - * TMS0980 MCU label ZA0675NL, JP0983AT (die label: 0980B-83) + See further below for TI Business Analyst and TI Programmer. *******************************************************************************/ @@ -13764,64 +13753,59 @@ static INPUT_PORTS_START( ti30 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, false) INPUT_PORTS_END -static INPUT_PORTS_START( tiprog ) - PORT_START("IN.0") // O0 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("K") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("SHF") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("E") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("d") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("F") +// config - PORT_START("IN.1") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("OR") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") +void ti30_state::ti30(machine_config &config) +{ + // basic machine hardware + TMS0980(config, m_maincpu, 400000); // guessed + m_maincpu->read_k().set(FUNC(ti30_state::read_k)); + m_maincpu->write_o().set(FUNC(ti30_state::write_o)); + m_maincpu->write_r().set(FUNC(ti30_state::write_r)); + m_maincpu->power_off().set(FUNC(ti30_state::auto_power_off)); - PORT_START("IN.2") // O2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("AND") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 8); + m_display->set_segmask(0x1fe, 0xff); + m_display->set_segmask(0x001, 0xe2); // 1st digit only has segments B,F,G,DP + config.set_default_layout(layout_ti30); - PORT_START("IN.3") // O4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_NAME("1'sC") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("b") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("C") + // no sound! +} - PORT_START("IN.4") // O5 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("XOR") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") +// roms - PORT_START("IN.5") // O6 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME(")") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("STO") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("SUM") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("RCL") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("(") +ROM_START( ti30 ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD16_WORD( "tmc0981nl", 0x0000, 0x1000, CRC(41298a14) SHA1(06f654c70add4044a612d3a38b0c2831c188fd0c) ) - PORT_START("IN.6") // O7 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") + ROM_REGION( 1246, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0980_common1_instr.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) + ROM_REGION( 1982, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0980_common1_micro.pla", 0, 1982, CRC(3709014f) SHA1(d28ee59ded7f3b9dc3f0594a32a98391b6e9c961) ) + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0980_ti30_output.pla", 0, 352, CRC(00475f99) SHA1(70e04c1472639bd35d4adaab0b9f1ae4a0e394be) ) + ROM_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0980_common1_segment.pla", 0, 157, CRC(399aa481) SHA1(72c56c58fde3fbb657d69647a9543b5f8fc74279) ) +ROM_END - // note: even though power buttons are on the matrix, they are not CPU-controlled - PORT_START("IN.7") // Vss - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/ON") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, true) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("DEC") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("OCT") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("HEX") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, false) -INPUT_PORTS_END + + + + +/******************************************************************************* + + TI Business Analyst, TI Business Analyst-I, TI Money Manager, TI-31, TI-41 + * TMS0980 MCU label TMC0982NL (die label: 0980B-82F) + * 9-digit 7seg LED display + + It's on the same hardware as TI-30. + +*******************************************************************************/ + +// class/handlers: uses the ones in ti30_state + +// inputs static INPUT_PORTS_START( tibusan ) // PORT_NAME lists functions under [2nd] as secondaries. @@ -13883,42 +13867,8 @@ static INPUT_PORTS_START( tibusan ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, false) INPUT_PORTS_END -// config - -void ti30_state::ti30(machine_config &config) -{ - // basic machine hardware - TMS0980(config, m_maincpu, 400000); // guessed - m_maincpu->read_k().set(FUNC(ti30_state::read_k)); - m_maincpu->write_o().set(FUNC(ti30_state::write_o)); - m_maincpu->write_r().set(FUNC(ti30_state::write_r)); - m_maincpu->power_off().set(FUNC(ti30_state::auto_power_off)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 8); - m_display->set_segmask(0x1fe, 0xff); - m_display->set_segmask(0x001, 0xe2); // 1st digit only has segments B,F,G,DP - config.set_default_layout(layout_ti30); - - // no sound! -} - // roms -ROM_START( ti30 ) - ROM_REGION( 0x1000, "maincpu", 0 ) - ROM_LOAD16_WORD( "tmc0981nl", 0x0000, 0x1000, CRC(41298a14) SHA1(06f654c70add4044a612d3a38b0c2831c188fd0c) ) - - ROM_REGION( 1246, "maincpu:ipla", 0 ) - ROM_LOAD( "tms0980_common1_instr.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) - ROM_REGION( 1982, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0980_common1_micro.pla", 0, 1982, CRC(3709014f) SHA1(d28ee59ded7f3b9dc3f0594a32a98391b6e9c961) ) - ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0980_ti30_output.pla", 0, 352, CRC(00475f99) SHA1(70e04c1472639bd35d4adaab0b9f1ae4a0e394be) ) - ROM_REGION( 157, "maincpu:spla", 0 ) - ROM_LOAD( "tms0980_common1_segment.pla", 0, 157, CRC(399aa481) SHA1(72c56c58fde3fbb657d69647a9543b5f8fc74279) ) -ROM_END - ROM_START( tibusan ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "tmc0982nl", 0x0000, 0x1000, CRC(6954560a) SHA1(6c153a0c9239a811e3514a43d809964c06f8f88e) ) @@ -13933,6 +13883,85 @@ ROM_START( tibusan ) ROM_LOAD( "tms0980_common1_segment.pla", 0, 157, CRC(399aa481) SHA1(72c56c58fde3fbb657d69647a9543b5f8fc74279) ) ROM_END + + + + +/******************************************************************************* + + TI Programmer + * TMS0980 MCU label ZA0675NL, JP0983AT (die label: 0980B-83) + * 9-digit 7seg LED display + + Like TI Business Analyst, it's on the same hardware as TI-30. + +*******************************************************************************/ + +// class/handlers: uses the ones in ti30_state + +// inputs + +static INPUT_PORTS_START( tiprog ) + PORT_START("IN.0") // O0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("K") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("SHF") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("E") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("d") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("F") + + PORT_START("IN.1") // O1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("OR") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + + PORT_START("IN.2") // O2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("AND") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + + PORT_START("IN.3") // O4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_NAME("1'sC") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("b") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("C") + + PORT_START("IN.4") // O5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("XOR") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + + PORT_START("IN.5") // O6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME(")") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("STO") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("SUM") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("RCL") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("(") + + PORT_START("IN.6") // O7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") + + // note: even though power buttons are on the matrix, they are not CPU-controlled + PORT_START("IN.7") // Vss + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/ON") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, true) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("DEC") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("OCT") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("HEX") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, false) +INPUT_PORTS_END + +// roms + ROM_START( tiprog ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "za0675nl", 0x0000, 0x1000, CRC(82355854) SHA1(03fab373bce04df8ea3fe25352525e8539213626) ) @@ -14074,35 +14103,43 @@ ROM_END /******************************************************************************* - Texas Instruments WIZ-A-TRON - * TMS0970 MCU label TMC0907NL ZA0379, DP0907BS (die label: 0970F-07B) + Texas Instruments Little Professor (1976 version, rev. A) + * TMS0970 MCU label TMS0975NL ZA0356, AP (die label: 0970D-75A) * 9-digit 7seg LED display(one custom digit) + Texas Instruments Little Professor (1976 version, rev. B) + * TMS0970 MCU label TMS0975NL ZA0356, BP (die label: 0970D-75B) + + Texas Instruments Little Professor (1976 version, rev. C) + * TMS0970 MCU label TMS0975NL ZA0356, CSP/GP0975CS (die label: 0970D-75C) + *******************************************************************************/ -class wizatron_state : public hh_tms1k_state +class lilprofo_state : public hh_tms1k_state { public: - wizatron_state(const machine_config &mconfig, device_type type, const char *tag) : + lilprofo_state(const machine_config &mconfig, device_type type, const char *tag) : hh_tms1k_state(mconfig, type, tag) { } - void wizatron(machine_config &config); + void lilprofo(machine_config &config); + void lilprofoc(machine_config &config); protected: - virtual void write_o(u16 data); - virtual void write_r(u32 data); - virtual u8 read_k(); + void write_o(u16 data); + void write_o7(u16 data); + void write_r(u32 data); + u8 read_k(); }; // handlers -void wizatron_state::write_r(u32 data) +void lilprofo_state::write_r(u32 data) { // R0-R8: select digit // 3rd digit only has A and G for =, though some newer hardware revisions - // (goes for both wizatron and lilprof) use a custom equals-sign digit here + // (goes for both lilprof and wizatron) use a custom equals-sign digit here // 6th digit is custom(not 7seg), for math symbols, like this: // \./ GAB @@ -14111,28 +14148,34 @@ void wizatron_state::write_r(u32 data) m_display->matrix(data, m_o); } -void wizatron_state::write_o(u16 data) +void lilprofo_state::write_o(u16 data) { - // O1-O4: input mux + // O1-O5: input mux // O0-O6: digit segments A-G - // O7: N/C - m_inp_mux = data >> 1 & 0xf; + m_inp_mux = (data >> 1 & 0x1f); m_o = data & 0x7f; } -u8 wizatron_state::read_k() +void lilprofo_state::write_o7(u16 data) +{ + // level switch is on O7 + write_o(data); + m_inp_mux = (m_inp_mux & 0xf) | (data >> 3 & 0x10); +} + +u8 lilprofo_state::read_k() { // K: multiplexed inputs - return read_inputs(4); + return read_inputs(5); } // inputs -static INPUT_PORTS_START( wizatron ) +static INPUT_PORTS_START( lilprofo ) PORT_START("IN.0") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_CODE(KEYCODE_DEL) PORT_NAME("Set") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_START("IN.1") // O2 @@ -14152,128 +14195,125 @@ static INPUT_PORTS_START( wizatron ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") + + PORT_START("IN.4") // O5/O7 + PORT_CONFNAME( 0x0f, 0x01, "Level") + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFSETTING( 0x08, "4" ) INPUT_PORTS_END // config -void wizatron_state::wizatron(machine_config &config) +void lilprofo_state::lilprofo(machine_config &config) { // basic machine hardware TMS0970(config, m_maincpu, 250000); // approximation - m_maincpu->read_k().set(FUNC(wizatron_state::read_k)); - m_maincpu->write_o().set(FUNC(wizatron_state::write_o)); - m_maincpu->write_r().set(FUNC(wizatron_state::write_r)); + m_maincpu->read_k().set(FUNC(lilprofo_state::read_k)); + m_maincpu->write_o().set(FUNC(lilprofo_state::write_o)); + m_maincpu->write_r().set(FUNC(lilprofo_state::write_r)); // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); - m_display->set_segmask(0x1ff^8, 0x7f); + m_display->set_segmask(0x1f7, 0x7f); m_display->set_segmask(8, 0x41); // equals sign - config.set_default_layout(layout_wizatron); + config.set_default_layout(layout_lilprof); // no sound! } +void lilprofo_state::lilprofoc(machine_config &config) +{ + lilprofo(config); + m_maincpu->write_o().set(FUNC(lilprofo_state::write_o7)); +} + // roms -ROM_START( wizatron ) +ROM_START( lilprofo ) ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "tmc0907nl_za0379", 0x0000, 0x0400, CRC(5a6af094) SHA1(b1f27e1f13f4db3b052dd50fb08dbf9c4d8db26e) ) + ROM_LOAD( "tms0975nl_za0356_csp", 0x0000, 0x0400, CRC(fef9dd39) SHA1(5c9614c9c5092d55dabeee2d6e0387d50d6ad4d5) ) ROM_REGION( 782, "maincpu:ipla", 0 ) ROM_LOAD( "tms0970_common1_instr.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) ROM_REGION( 860, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0970_common2_micro.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) + ROM_LOAD( "tms0970_common1_micro.pla", 0, 860, CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0980_wizatron_output.pla", 0, 352, CRC(c0ee5c04) SHA1(e9fadcef688309adbe6c1c0545aac6883ce4a1ac) ) + ROM_LOAD( "tms0980_lilprofo_output.pla", 0, 352, CRC(73f9ca93) SHA1(9d6c559e2c1886c62bcd57e3c3aa897e8829b4d2) ) ROM_REGION( 157, "maincpu:spla", 0 ) ROM_LOAD( "tms0980_common2_segment.pla", 0, 157, CRC(c03cccd8) SHA1(08bc4b597686a7aa8b2c9f43b85b62747ffd455b) ) ROM_END +ROM_START( lilprofob ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tms0975nl_za0356_bp", 0x0000, 0x0400, CRC(00c8357f) SHA1(32ab47e979e117bda889ab1c72c1c239cfa0f386) ) + ROM_REGION( 782, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0970_common1_instr.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) + ROM_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_common1_micro.pla", 0, 860, CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0980_lilprofo_output.pla", 0, 352, CRC(73f9ca93) SHA1(9d6c559e2c1886c62bcd57e3c3aa897e8829b4d2) ) + ROM_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0980_common2_segment.pla", 0, 157, CRC(c03cccd8) SHA1(08bc4b597686a7aa8b2c9f43b85b62747ffd455b) ) +ROM_END +ROM_START( lilprofoa ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tms0975nl_za0356_ap", 0x0000, 0x0400, CRC(ab77b595) SHA1(8ec5a00d9eb0780b9bb2937c4c023efb2470b287) ) + ROM_REGION( 782, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0970_common1_instr.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) + ROM_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_common1_micro.pla", 0, 860, CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0980_lilprofo_output.pla", 0, 352, CRC(73f9ca93) SHA1(9d6c559e2c1886c62bcd57e3c3aa897e8829b4d2) ) + ROM_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0980_common2_segment.pla", 0, 157, CRC(c03cccd8) SHA1(08bc4b597686a7aa8b2c9f43b85b62747ffd455b) ) +ROM_END -/******************************************************************************* - - Texas Instruments Little Professor (1976 version) - * TMS0970 MCU label TMS0975NL ZA0356, GP0975CS (die label: 0970D-75C) - * 9-digit 7seg LED display(one custom digit) - The hardware is nearly identical to Wiz-A-Tron (or vice versa, since this - one is older). -*******************************************************************************/ -class lilprof_state : public wizatron_state -{ -public: - lilprof_state(const machine_config &mconfig, device_type type, const char *tag) : - wizatron_state(mconfig, type, tag) - { } - void lilprof(machine_config &config); +/******************************************************************************* -private: - virtual void write_o(u16 data) override; - virtual u8 read_k() override; -}; + Texas Instruments WIZ-A-TRON + * TMS0970 MCU label TMC0907NL ZA0379, DP0907BS (die label: 0970F-07B) + * 9-digit 7seg LED display(one custom digit) -// handlers + The hardware is nearly identical to Little Professor (1976 version). -void lilprof_state::write_o(u16 data) -{ - // O1-O4,O7: input mux - // O0-O6: digit segments A-G - m_inp_mux = (data >> 1 & 0xf) | (data >> 3 & 0x10); - m_o = data; -} +*******************************************************************************/ -u8 lilprof_state::read_k() -{ - // K: multiplexed inputs - return read_inputs(5); -} +// class/handlers: uses the ones in lilprofo_state // inputs -static INPUT_PORTS_START( lilprof ) - PORT_INCLUDE( wizatron ) +static INPUT_PORTS_START( wizatron ) + PORT_INCLUDE( lilprofo ) PORT_MODIFY("IN.0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_CODE(KEYCODE_DEL) PORT_NAME("Set") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") - PORT_START("IN.4") // O7 - PORT_CONFNAME( 0x0f, 0x01, "Level") - PORT_CONFSETTING( 0x01, "1" ) - PORT_CONFSETTING( 0x02, "2" ) - PORT_CONFSETTING( 0x04, "3" ) - PORT_CONFSETTING( 0x08, "4" ) + PORT_MODIFY("IN.4") + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -// config - -void lilprof_state::lilprof(machine_config &config) -{ - wizatron(config); - - // basic machine hardware - m_maincpu->read_k().set(FUNC(lilprof_state::read_k)); - m_maincpu->write_o().set(FUNC(lilprof_state::write_o)); -} - // roms -ROM_START( lilprof ) +ROM_START( wizatron ) ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "tms0975nl_za0356", 0x0000, 0x0400, CRC(fef9dd39) SHA1(5c9614c9c5092d55dabeee2d6e0387d50d6ad4d5) ) + ROM_LOAD( "tmc0907nl_za0379", 0x0000, 0x0400, CRC(5a6af094) SHA1(b1f27e1f13f4db3b052dd50fb08dbf9c4d8db26e) ) ROM_REGION( 782, "maincpu:ipla", 0 ) ROM_LOAD( "tms0970_common1_instr.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) ROM_REGION( 860, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0970_common1_micro.pla", 0, 860, CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) + ROM_LOAD( "tms0970_common2_micro.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0980_lilprof_output.pla", 0, 352, CRC(73f9ca93) SHA1(9d6c559e2c1886c62bcd57e3c3aa897e8829b4d2) ) + ROM_LOAD( "tms0980_wizatron_output.pla", 0, 352, CRC(c0ee5c04) SHA1(e9fadcef688309adbe6c1c0545aac6883ce4a1ac) ) ROM_REGION( 157, "maincpu:spla", 0 ) ROM_LOAD( "tms0980_common2_segment.pla", 0, 157, CRC(c03cccd8) SHA1(08bc4b597686a7aa8b2c9f43b85b62747ffd455b) ) ROM_END @@ -14293,14 +14333,14 @@ ROM_END *******************************************************************************/ -class lilprofa_state : public hh_tms1k_state +class lilprof_state : public hh_tms1k_state { public: - lilprofa_state(const machine_config &mconfig, device_type type, const char *tag) : + lilprof_state(const machine_config &mconfig, device_type type, const char *tag) : hh_tms1k_state(mconfig, type, tag) { } - void lilprofa(machine_config &config); + void lilprof(machine_config &config); private: void write_o(u16 data); @@ -14310,7 +14350,7 @@ class lilprofa_state : public hh_tms1k_state // handlers -void lilprofa_state::write_r(u32 data) +void lilprof_state::write_r(u32 data) { // update leds state u8 seg = bitswap<8>(m_o,7,4,3,2,1,0,6,5) & 0x7f; @@ -14320,11 +14360,11 @@ void lilprofa_state::write_r(u32 data) // 3rd digit A/G(equals sign) is from O7 m_display->write_row(3, (r != 0 && m_o & 0x80) ? 0x41 : 0); - // 6th digit is a custom 7seg for math symbols (see wizatron_state write_r) + // 6th digit is a custom 7seg for math symbols (see lilprofo_state write_r) m_display->write_row(6, bitswap<8>(m_display->read_row(6),7,6,1,4,2,3,5,0)); } -void lilprofa_state::write_o(u16 data) +void lilprof_state::write_o(u16 data) { // O0-O3,O5(?): input mux // O0-O6: digit segments A-G @@ -14333,7 +14373,7 @@ void lilprofa_state::write_o(u16 data) m_o = data; } -u8 lilprofa_state::read_k() +u8 lilprof_state::read_k() { // K: multiplexed inputs return read_inputs(5); @@ -14341,7 +14381,7 @@ u8 lilprofa_state::read_k() // inputs -static INPUT_PORTS_START( lilprofa ) +static INPUT_PORTS_START( lilprof ) PORT_START("IN.0") // O0 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") @@ -14376,25 +14416,25 @@ INPUT_PORTS_END // config -void lilprofa_state::lilprofa(machine_config &config) +void lilprof_state::lilprof(machine_config &config) { // basic machine hardware TMS1990(config, m_maincpu, 250000); // approximation - m_maincpu->read_k().set(FUNC(lilprofa_state::read_k)); - m_maincpu->write_o().set(FUNC(lilprofa_state::write_o)); - m_maincpu->write_r().set(FUNC(lilprofa_state::write_r)); + m_maincpu->read_k().set(FUNC(lilprof_state::read_k)); + m_maincpu->write_o().set(FUNC(lilprof_state::write_o)); + m_maincpu->write_r().set(FUNC(lilprof_state::write_r)); // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x1ff, 0x7f); - config.set_default_layout(layout_wizatron); + config.set_default_layout(layout_lilprof); // no sound! } // roms -ROM_START( lilprofa ) +ROM_START( lilprof ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "tmc1993nl", 0x0000, 0x0400, CRC(e941316b) SHA1(7e1542045d1e731cea81a639c9ac9e91bb233b15) ) @@ -14403,7 +14443,7 @@ ROM_START( lilprofa ) ROM_REGION( 860, "maincpu:mpla", 0 ) ROM_LOAD( "tms0970_common2_micro.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0980_lilprofa_output.pla", 0, 352, CRC(b7416cc0) SHA1(57891ffeaf34aafe8a915086c6d2feb78f5113af) ) + ROM_LOAD( "tms0980_lilprof_output.pla", 0, 352, CRC(b7416cc0) SHA1(57891ffeaf34aafe8a915086c6d2feb78f5113af) ) ROM_REGION( 157, "maincpu:spla", 0 ) ROM_LOAD( "tms0980_common3_segment.pla", 0, 157, CRC(b5b3153f) SHA1(e0145c729695a4f962970aee0571d42cee6f5a9e) ) ROM_END @@ -14579,10 +14619,10 @@ class dataman_state : public hh_tms1k_state void dataman(machine_config &config); protected: - virtual void update_display(); - virtual void write_o(u16 data); - virtual void write_r(u32 data); - virtual u8 read_k(); + void update_display(); + void write_o(u16 data); + void write_r(u32 data); + u8 read_k(); }; // handlers @@ -14711,21 +14751,9 @@ class mathmarv_state : public dataman_state { } void mathmarv(machine_config &config); - -private: - virtual void write_r(u32 data) override; }; -// handlers - -void mathmarv_state::write_r(u32 data) -{ - // R8: speaker out - m_speaker->level_w(data >> 8 & 1); - - // rest is same as dataman - dataman_state::write_r(data); -} +// handlers: uses the ones in dataman_state // inputs @@ -14750,7 +14778,7 @@ void mathmarv_state::mathmarv(machine_config &config) dataman(config); // basic machine hardware - m_maincpu->write_r().set(FUNC(mathmarv_state::write_r)); + m_maincpu->write_r().append(m_speaker, FUNC(speaker_sound_device::level_w)).bit(8); config.set_default_layout(layout_mathmarv); @@ -17337,10 +17365,10 @@ SYST( 1979, horseran, 0, 0, horseran, horseran, horseran_state, SYST( 1980, mdndclab, 0, 0, mdndclab, mdndclab, mdndclab_state, empty_init, "Mattel Electronics", "Dungeons & Dragons: Computer Labyrinth Game", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS ) // *** SYST( 1977, comp4, 0, 0, comp4, comp4, comp4_state, empty_init, "Milton Bradley", "Comp IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NO_SOUND_HW ) -SYST( 1977, bship, 0, 0, bship, bship, bship_state, empty_init, "Milton Bradley", "Electronic Battleship (TMS1000 version, Rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) // *** -SYST( 1978, bshipb, bship, 0, bshipb, bship, bshipb_state, empty_init, "Milton Bradley", "Electronic Battleship (TMS1000 version, Rev. B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // *** -SYST( 1978, simon, 0, 0, simon, simon, simon_state, empty_init, "Milton Bradley", "Simon (Rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -SYST( 1979, simonf, simon, 0, simon, simon, simon_state, empty_init, "Milton Bradley", "Simon (Rev. F)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1977, bship, 0, 0, bship, bship, bship_state, empty_init, "Milton Bradley", "Electronic Battleship (TMS1000 version, rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) // *** +SYST( 1978, bshipb, bship, 0, bshipb, bship, bshipb_state, empty_init, "Milton Bradley", "Electronic Battleship (TMS1000 version, rev. B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // *** +SYST( 1978, simon, 0, 0, simon, simon, simon_state, empty_init, "Milton Bradley", "Simon (rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +SYST( 1979, simonf, simon, 0, simon, simon, simon_state, empty_init, "Milton Bradley", "Simon (rev. F)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) SYST( 1979, ssimon, 0, 0, ssimon, ssimon, ssimon_state, empty_init, "Milton Bradley", "Super Simon", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) SYST( 1979, bigtrak, 0, 0, bigtrak, bigtrak, bigtrak_state, empty_init, "Milton Bradley", "Big Trak", MACHINE_SUPPORTS_SAVE | MACHINE_MECHANICAL ) // *** SYST( 1981, mbdtower, 0, 0, mbdtower, mbdtower, mbdtower_state, empty_init, "Milton Bradley", "Dark Tower (Milton Bradley)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_MECHANICAL ) // *** @@ -17382,9 +17410,12 @@ SYST( 1976, ti30, 0, 0, ti30, ti30, ti30_state, SYST( 1976, tibusan, 0, 0, ti30, tibusan, ti30_state, empty_init, "Texas Instruments", "TI Business Analyst", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) SYST( 1977, tiprog, 0, 0, ti30, tiprog, ti30_state, empty_init, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) SYST( 1977, ti1000, 0, 0, ti1000, ti1000, ti1000_state, empty_init, "Texas Instruments", "TI-1000 (1977 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) -SYST( 1977, wizatron, 0, 0, wizatron, wizatron, wizatron_state, empty_init, "Texas Instruments", "Wiz-A-Tron", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) -SYST( 1976, lilprof, 0, 0, lilprof, lilprof, lilprof_state, empty_init, "Texas Instruments", "Little Professor (1976 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) -SYST( 1978, lilprofa, lilprof, 0, lilprofa, lilprofa, lilprofa_state, empty_init, "Texas Instruments", "Little Professor (1978 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +SYST( 1977, wizatron, 0, 0, lilprofo, wizatron, lilprofo_state, empty_init, "Texas Instruments", "Wiz-A-Tron", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +SYST( 1978, lilprof, 0, 0, lilprof, lilprof, lilprof_state, empty_init, "Texas Instruments", "Little Professor (1978 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +SYST( 1976, lilprofoa, lilprof, 0, lilprofo, lilprofo, lilprofo_state, empty_init, "Texas Instruments", "Little Professor (1976 version, rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +SYST( 1976, lilprofob, lilprof, 0, lilprofo, lilprofo, lilprofo_state, empty_init, "Texas Instruments", "Little Professor (1976 version, rev. B)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +SYST( 1976, lilprofo, lilprof, 0, lilprofoc, lilprofo, lilprofo_state, empty_init, "Texas Instruments", "Little Professor (1976 version, rev. C)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) + SYST( 1977, ti1680, 0, 0, ti1680, ti1680, ti1680_state, empty_init, "Texas Instruments", "TI-1680", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) SYST( 1977, dataman, 0, 0, dataman, dataman, dataman_state, empty_init, "Texas Instruments", "DataMan", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) SYST( 1980, mathmarv, 0, 0, mathmarv, mathmarv, mathmarv_state, empty_init, "Texas Instruments", "Math Marvel", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/handheld/hh_ucom4.cpp b/src/mame/handheld/hh_ucom4.cpp index 1f7f5ae407f70..ea4f54fbb2811 100644 --- a/src/mame/handheld/hh_ucom4.cpp +++ b/src/mame/handheld/hh_ucom4.cpp @@ -3346,8 +3346,8 @@ SYST( 1980, ctntune, 0, 0, ctntune, ctntune, ctntune_state, empt SYST( 1980, einspace, 0, 0, einspace, einspace, einspace_state, empty_init, "Epoch", "Invader From Space", MACHINE_SUPPORTS_SAVE ) SYST( 1980, efball, 0, 0, efball, efball, efball_state, empty_init, "Epoch", "Electronic Football (Epoch)", MACHINE_SUPPORTS_SAVE ) -SYST( 1981, galaxy2, 0, 0, galaxy2, galaxy2, galaxy2_state, empty_init, "Epoch", "Galaxy II (VFD Rev. D)", MACHINE_SUPPORTS_SAVE ) -SYST( 1981, galaxy2b, galaxy2, 0, galaxy2b, galaxy2, galaxy2_state, empty_init, "Epoch", "Galaxy II (VFD Rev. B)", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, galaxy2, 0, 0, galaxy2, galaxy2, galaxy2_state, empty_init, "Epoch", "Galaxy II (VFD rev. D)", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, galaxy2b, galaxy2, 0, galaxy2b, galaxy2, galaxy2_state, empty_init, "Epoch", "Galaxy II (VFD rev. B)", MACHINE_SUPPORTS_SAVE ) SYST( 1982, astrocmd, 0, 0, astrocmd, astrocmd, astrocmd_state, empty_init, "Epoch", "Astro Command", MACHINE_SUPPORTS_SAVE ) SYST( 1982, edracula, 0, 0, edracula, edracula, edracula_state, empty_init, "Epoch", "Dracula (Epoch)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/handheld/pensebem.cpp b/src/mame/handheld/pensebem.cpp index ec2c3c229db9a..849e5e636c13e 100644 --- a/src/mame/handheld/pensebem.cpp +++ b/src/mame/handheld/pensebem.cpp @@ -241,23 +241,23 @@ static INPUT_PORTS_START( pensebem2017 ) PORT_START("ROW1") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Adicao") PORT_CODE(KEYCODE_Q) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Subtracao") PORT_CODE(KEYCODE_W) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH_PAD) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("*") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Adição") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Subtração") PORT_CODE(KEYCODE_W) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"÷") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"×") PORT_CODE(KEYCODE_ASTERISK) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS_PAD) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("+") PORT_CODE(KEYCODE_PLUS_PAD) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_START("ROW2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Multiplicacao") PORT_CODE(KEYCODE_E) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Aritmetica") PORT_CODE(KEYCODE_T) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Divisao") PORT_CODE(KEYCODE_R) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Adivinhe o Número") PORT_CODE(KEYCODE_P) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Número do Meio") PORT_CODE(KEYCODE_O) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Memória Tons") PORT_CODE(KEYCODE_I) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Siga-me") PORT_CODE(KEYCODE_U) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Operacao") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Multiplicação") PORT_CODE(KEYCODE_E) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Aritmética") PORT_CODE(KEYCODE_T) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Divisão") PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Adivinhe o Número") PORT_CODE(KEYCODE_P) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Número do Meio") PORT_CODE(KEYCODE_O) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Memória Tons") PORT_CODE(KEYCODE_I) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Siga-me") PORT_CODE(KEYCODE_U) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Operação") PORT_CODE(KEYCODE_Y) PORT_START("ROW3") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) diff --git a/src/mame/heathkit/h17_fdc.cpp b/src/mame/heathkit/h17_fdc.cpp new file mode 100644 index 0000000000000..f1ac88de5f7df --- /dev/null +++ b/src/mame/heathkit/h17_fdc.cpp @@ -0,0 +1,295 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + Heathkit H-17 Floppy controller + + This was an option for both the Heathkit H8 and H89 computer systems. + + TODO + - define hard-sectored disk format + - incoming floppy data should drive receive clock of the ami 2350. + +****************************************************************************/ + +#include "emu.h" + +#include "h17_fdc.h" + +// Register setup +#define LOG_REG (1U << 1) +// Control lines +#define LOG_LINES (1U << 2) +// Drive select +#define LOG_DRIVE (1U << 3) +// Function calls +#define LOG_FUNC (1U << 4) + +//#define VERBOSE (0xff) + +#include "logmacro.h" + +#define LOGREG(...) LOGMASKED(LOG_REG, __VA_ARGS__) +#define LOGLINES(...) LOGMASKED(LOG_LINES, __VA_ARGS__) +#define LOGDRIVE(...) LOGMASKED(LOG_DRIVE, __VA_ARGS__) +#define LOGFUNC(...) LOGMASKED(LOG_FUNC, __VA_ARGS__) + +#ifdef _MSC_VER +#define FUNCNAME __func__ +#else +#define FUNCNAME __PRETTY_FUNCTION__ +#endif + + +DEFINE_DEVICE_TYPE(HEATH_H17_FDC, heath_h17_fdc_device, "heath_h17_fdc", "Heath H-17 Hard-sectored Controller"); + + +heath_h17_fdc_device::heath_h17_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock): + device_t(mconfig, HEATH_H17_FDC, tag, owner, 0), + m_floppy_ram_wp(*this), + m_s2350(*this, "s2350"), + m_floppies(*this, "floppy%u", 0U), + m_tx_timer(*this, "tx_timer"), + m_floppy(nullptr) +{ +} + +void heath_h17_fdc_device::write(offs_t reg, u8 val) +{ + LOGFUNC("%s: reg: %d val: 0x%02x\n", FUNCNAME, reg, val); + + switch (reg) + { + case 0: // data port + m_s2350->transmitter_holding_reg_w(val); + break; + case 1: // fill character + m_s2350->transmit_fill_reg_w(val); + break; + case 2: // sync port + m_s2350->receiver_sync_reg_w(val); + break; + case 3: // control port + ctrl_w(val); + break; + } +} + +void heath_h17_fdc_device::set_floppy(floppy_image_device *floppy) +{ + if (m_floppy == floppy) + { + return; + } + + LOGDRIVE("%s: selecting new drive\n", FUNCNAME); + + m_floppy = floppy; + + // set any latched signals + { + m_floppy->ss_w(m_side); + } +} + +void heath_h17_fdc_device::side_select_w(int state) +{ + m_side = BIT(state, 0); + + if (m_floppy) + { + m_floppy->ss_w(m_side); + } +} + +void heath_h17_fdc_device::dir_w(int state) +{ + if (m_floppy) + { + LOGFUNC("%s: step dir: 0x%02x\n", FUNCNAME, state); + + m_floppy->dir_w(state); + } +} + +void heath_h17_fdc_device::step_w(int state) +{ + if (m_floppy) + { + LOGFUNC("%s: step dir: 0x%02x\n", FUNCNAME, state); + + m_floppy->stp_w(state); + } +} + +void heath_h17_fdc_device::set_motor(bool motor_on) +{ + if (m_motor_on == motor_on) + { + return; + } + + m_motor_on = motor_on; + + for (auto &elem : m_floppies) + { + floppy_image_device *floppy = elem->get_device(); + if (floppy) + { + LOGFUNC("%s: motor: %d\n", FUNCNAME, motor_on); + + floppy->mon_w(!motor_on); + } + } +} + +void heath_h17_fdc_device::ctrl_w(u8 val) +{ + m_write_gate = bool(BIT(val, CTRL_WRITE_GATE)); + + set_motor(bool(BIT(val, CTRL_MOTOR_ON))); + + if (BIT(val, CTRL_DRIVE_SELECT_0)) + { + LOGFUNC("%s: set drive 0\n", FUNCNAME); + + set_floppy(m_floppies[0]->get_device()); + } + else if (BIT(val, CTRL_DRIVE_SELECT_1)) + { + LOGFUNC("%s: set drive 1\n", FUNCNAME); + + set_floppy(m_floppies[1]->get_device()); + } + else if (BIT(val, CTRL_DRIVE_SELECT_2)) + { + LOGFUNC("%s: set drive 2\n", FUNCNAME); + + set_floppy(m_floppies[2]->get_device()); + } + else + { + LOGFUNC("%s: set drive none\n", FUNCNAME); + + set_floppy(nullptr); + } + + dir_w(!BIT(val, CTRL_DIRECTION)); + + step_w(!BIT(val, CTRL_STEP_COMMAND)); + + m_floppy_ram_wp(BIT(val, CTRL_WRITE_ENABLE_RAM)); +} + +u8 heath_h17_fdc_device::read(offs_t reg) +{ + // default return for the h89 + u8 val = 0xff; + + switch (reg) + { + case 0: // data port + val = m_s2350->receiver_output_reg_r(); + break; + case 1: // status port + val = m_s2350->status_word_r(); + break; + case 2: // sync port + val = m_s2350->receiver_sync_search(); + break; + case 3: // floppy status port + val = floppy_status_r(); + break; + } + + LOGREG("%s: reg: %d val: 0x%02x\n", FUNCNAME, reg, val); + + return val; +} + +u8 heath_h17_fdc_device::floppy_status_r() +{ + u8 val = 0; + + // statuses from the floppy drive + if (m_floppy) + { + // index/sector hole + val |= m_floppy->idx_r() ? 0x00 : 0x01; + + // track 0 + val |= m_floppy->trk00_r() ? 0x00 : 0x02; + + // disk is write-protected + val |= m_floppy->wpt_r() ? 0x00 : 0x04; + } + else + { + LOGREG("%s: no drive selected\n", FUNCNAME); + } + + // status from USRT + val |= m_sync_char_received ? 0x08 : 0x00; + + LOGFUNC("%s: val: 0x%02x\n", FUNCNAME, val); + + return val; +} + +void heath_h17_fdc_device::device_start() +{ + save_item(NAME(m_motor_on)); + save_item(NAME(m_write_gate)); + save_item(NAME(m_sync_char_received)); + save_item(NAME(m_step_direction)); + save_item(NAME(m_side)); +} + +void heath_h17_fdc_device::device_reset() +{ + LOGFUNC("%s\n", FUNCNAME); + + m_motor_on = false; + m_write_gate = false; + m_sync_char_received = false; + + m_tx_timer->adjust(attotime::from_hz(USRT_TX_CLOCK), 0, attotime::from_hz(USRT_TX_CLOCK)); +} + +static void h17_floppies(device_slot_interface &device) +{ + // H-17-1 + device.option_add("ssdd", FLOPPY_525_SSDD); + + // Future plans - test and verify higher capacity drives with LLC's BIOS-80 for CP/M and an HUG's enhanced HDOS driver + // - FLOPPY_525_SSQD + // - FLOPPY_525_DD + // - FLOPPY_525_QD (H-17-4) +} + +TIMER_DEVICE_CALLBACK_MEMBER(heath_h17_fdc_device::tx_timer_cb) +{ + m_s2350->tcp_w(); +} + +void heath_h17_fdc_device::device_add_mconfig(machine_config &config) +{ + S2350(config, m_s2350, 0); + m_s2350->sync_character_received_cb().set(FUNC(heath_h17_fdc_device::sync_character_received)); + + for (int i = 0; i < MAX_FLOPPY_DRIVES; i++) + { + // TODO -> add (and define) heath hard-sectored floppy formats. + FLOPPY_CONNECTOR(config, m_floppies[i], h17_floppies, "ssdd", floppy_image_device::default_fm_floppy_formats); + m_floppies[i]->enable_sound(true); + } + + TIMER(config, m_tx_timer).configure_generic(FUNC(heath_h17_fdc_device::tx_timer_cb)); +} + +void heath_h17_fdc_device::sync_character_received(int state) +{ + LOGFUNC("%s: state: %d\n", FUNCNAME, state); + + m_sync_char_received = bool(!BIT(state, 0)); +} diff --git a/src/mame/heathkit/h17_fdc.h b/src/mame/heathkit/h17_fdc.h new file mode 100644 index 0000000000000..75dd4460e9348 --- /dev/null +++ b/src/mame/heathkit/h17_fdc.h @@ -0,0 +1,90 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + Heathkit H-17 Floppy Disk Controller + + + Model number: H-88-1 + + TODO + - Mame core must support hard-sectored disk images. + - used floppy clock bits to clock USRT received clock. + - Add support for a heath hard-sectored disk support (h17disk). + +****************************************************************************/ + +#ifndef MAME_HEATHKIT_H17_FDC_H +#define MAME_HEATHKIT_H17_FDC_H + +#pragma once + +#include "imagedev/floppy.h" +#include "machine/s2350.h" + + +class heath_h17_fdc_device : public device_t +{ +public: + heath_h17_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + auto floppy_ram_wp_cb() { return m_floppy_ram_wp.bind(); } + + void write(offs_t reg, u8 val); + u8 read(offs_t reg); + + void side_select_w(int state); + +protected: + static constexpr u8 MAX_FLOPPY_DRIVES = 3; + + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + void ctrl_w(u8 val); + u8 floppy_status_r(); + + void set_floppy(floppy_image_device *floppy); + void step_w(int state); + void dir_w(int state); + void set_motor(bool motor_on); + + void sync_character_received(int state); + + TIMER_DEVICE_CALLBACK_MEMBER(tx_timer_cb); + + devcb_write_line m_floppy_ram_wp; + + required_device m_s2350; + required_device_array m_floppies; + required_device m_tx_timer; + + bool m_motor_on; + bool m_write_gate; + bool m_sync_char_received; + u8 m_step_direction; + u8 m_side; + + floppy_image_device *m_floppy; + + /// write bit control port + static constexpr u8 CTRL_WRITE_GATE = 0; + static constexpr u8 CTRL_DRIVE_SELECT_0 = 1; + static constexpr u8 CTRL_DRIVE_SELECT_1 = 2; + static constexpr u8 CTRL_DRIVE_SELECT_2 = 3; + static constexpr u8 CTRL_MOTOR_ON = 4; // Controls all the drives + static constexpr u8 CTRL_DIRECTION = 5; // (0 = out) + static constexpr u8 CTRL_STEP_COMMAND = 6; // (Active high) + static constexpr u8 CTRL_WRITE_ENABLE_RAM = 7; // 0 - write protected + + // USRT clock + static constexpr XTAL USRT_BASE_CLOCK = XTAL(12'288'000) / 6 / 16; + static constexpr u32 USRT_TX_CLOCK = USRT_BASE_CLOCK.value(); +}; + + +DECLARE_DEVICE_TYPE(HEATH_H17_FDC, heath_h17_fdc_device) + + +#endif // MAME_HEATHKIT_H17_FDC_H diff --git a/src/mame/heathkit/h19.cpp b/src/mame/heathkit/h19.cpp index ed35cd43a40e6..aeb8a79902732 100644 --- a/src/mame/heathkit/h19.cpp +++ b/src/mame/heathkit/h19.cpp @@ -14,6 +14,9 @@ #include "tlb.h" #include "bus/rs232/rs232.h" +#include "h19.lh" + + namespace { class h19_state : public driver_device @@ -45,6 +48,8 @@ static void tlb_options(device_slot_interface &device) void h19_state::h19(machine_config &config) { + config.set_default_layout(layout_h19); + HEATH_TLB_CONNECTOR(config, m_tlbc, tlb_options, "heath"); m_tlbc->serial_data_callback().set("dte", FUNC(rs232_port_device::write_txd)); m_tlbc->dtr_callback().set("dte", FUNC(rs232_port_device::write_dtr)); diff --git a/src/mame/heathkit/h89.cpp b/src/mame/heathkit/h89.cpp index 91a2757f0b51e..7ed6861ee2a6a 100644 --- a/src/mame/heathkit/h89.cpp +++ b/src/mame/heathkit/h89.cpp @@ -56,6 +56,9 @@ #include "softlist_dev.h" +#include "h89.lh" + + // Single Step #define LOG_SS (1U << 1) @@ -834,6 +837,8 @@ static void intr_ctrl_options(device_slot_interface &device) void h89_base_state::h89_base(machine_config &config) { + config.set_default_layout(layout_h89); + // basic machine hardware Z80(config, m_maincpu, H89_CLOCK); m_maincpu->set_m1_map(&h89_base_state::map_fetch); diff --git a/src/mame/heathkit/tlb.cpp b/src/mame/heathkit/tlb.cpp index 363c5d043b317..bdf7eee926daf 100644 --- a/src/mame/heathkit/tlb.cpp +++ b/src/mame/heathkit/tlb.cpp @@ -1074,7 +1074,7 @@ void heath_tlb_device::device_add_mconfig(machine_config &config) // MC 6845 uses a character clock, divide the DOT clock by 8. MC6845(config, m_crtc, BASE_DOT_CLOCK / 8); m_crtc->set_screen("screen"); - m_crtc->set_show_border_area(true); + m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); m_crtc->set_update_row_callback(FUNC(heath_tlb_device::crtc_update_row)); // frame pulse diff --git a/src/mame/hegenerglaser/academy.cpp b/src/mame/hegenerglaser/academy.cpp index 4747486222ea2..6d92ab6537ed3 100644 --- a/src/mame/hegenerglaser/academy.cpp +++ b/src/mame/hegenerglaser/academy.cpp @@ -114,7 +114,7 @@ static INPUT_PORTS_START( academy ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRAIN") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/amsterdam.cpp b/src/mame/hegenerglaser/amsterdam.cpp index 740ec49e5f123..e097eae67d846 100644 --- a/src/mame/hegenerglaser/amsterdam.cpp +++ b/src/mame/hegenerglaser/amsterdam.cpp @@ -147,7 +147,7 @@ void amsterdam_state::dallas32_mem(address_map &map) static INPUT_PORTS_START( amsterdam ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) diff --git a/src/mame/hegenerglaser/brikett.cpp b/src/mame/hegenerglaser/brikett.cpp index f2de6825cd77d..2f03ba464c868 100644 --- a/src/mame/hegenerglaser/brikett.cpp +++ b/src/mame/hegenerglaser/brikett.cpp @@ -409,7 +409,7 @@ static INPUT_PORTS_START( mephisto3 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("INFO") PORT_MODIFY("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("POS") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left / Black / 9") PORT_MODIFY("IN.3") diff --git a/src/mame/hegenerglaser/europa.cpp b/src/mame/hegenerglaser/europa.cpp index 5fd289f732884..f6b904ec22fcb 100644 --- a/src/mame/hegenerglaser/europa.cpp +++ b/src/mame/hegenerglaser/europa.cpp @@ -144,7 +144,7 @@ void europa_state::board_w(u8 data) static INPUT_PORTS_START( europa ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("PLAY") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("POS") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MEM") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("ENT") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("White / Black") diff --git a/src/mame/hegenerglaser/glasgow.cpp b/src/mame/hegenerglaser/glasgow.cpp index ae539b9f5763e..ea9d2e4c8860d 100644 --- a/src/mame/hegenerglaser/glasgow.cpp +++ b/src/mame/hegenerglaser/glasgow.cpp @@ -150,7 +150,7 @@ static INPUT_PORTS_START( glasgow ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("E / 5 / Rook") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Right / White / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_RIGHT) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("H / 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G / 7 / King") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) diff --git a/src/mame/hegenerglaser/milano.cpp b/src/mame/hegenerglaser/milano.cpp index f5c6df5eb60b1..b728a72869516 100644 --- a/src/mame/hegenerglaser/milano.cpp +++ b/src/mame/hegenerglaser/milano.cpp @@ -147,7 +147,7 @@ static INPUT_PORTS_START( milano ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Training / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/mm1.cpp b/src/mame/hegenerglaser/mm1.cpp index 3051677c02c3d..738bdb312fb71 100644 --- a/src/mame/hegenerglaser/mm1.cpp +++ b/src/mame/hegenerglaser/mm1.cpp @@ -193,7 +193,7 @@ static INPUT_PORTS_START( mm1 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("E / 5 / Rook") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("INFO") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right / White / 0") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("POS") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H / 8") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LEV") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G / 7 / King") diff --git a/src/mame/hegenerglaser/mm2.cpp b/src/mame/hegenerglaser/mm2.cpp index 0270b17feb463..0a8e626743ee7 100644 --- a/src/mame/hegenerglaser/mm2.cpp +++ b/src/mame/hegenerglaser/mm2.cpp @@ -267,7 +267,7 @@ void mm2_state::mm4_mem(address_map &map) static INPUT_PORTS_START( mm2 ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) @@ -312,7 +312,7 @@ static INPUT_PORTS_START( bup ) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BEST") PORT_CODE(KEYCODE_S) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MON") PORT_CODE(KEYCODE_N) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) INPUT_PORTS_END diff --git a/src/mame/hegenerglaser/modena.cpp b/src/mame/hegenerglaser/modena.cpp index 93363a36a3d71..8b0786274e04f 100644 --- a/src/mame/hegenerglaser/modena.cpp +++ b/src/mame/hegenerglaser/modena.cpp @@ -154,7 +154,7 @@ static INPUT_PORTS_START( modena ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Book / Pawn") PORT_CODE(KEYCODE_B) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/mondial.cpp b/src/mame/hegenerglaser/mondial.cpp index 5519881044235..709d36a992b5e 100644 --- a/src/mame/hegenerglaser/mondial.cpp +++ b/src/mame/hegenerglaser/mondial.cpp @@ -148,7 +148,7 @@ static INPUT_PORTS_START( mondial ) PORT_START("KEY.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PLAY") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) diff --git a/src/mame/hegenerglaser/mondial2.cpp b/src/mame/hegenerglaser/mondial2.cpp index 5de2f691c8574..b91eab10fcc88 100644 --- a/src/mame/hegenerglaser/mondial2.cpp +++ b/src/mame/hegenerglaser/mondial2.cpp @@ -155,7 +155,7 @@ static INPUT_PORTS_START( mondial2 ) PORT_START("KEY.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PLAY") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) diff --git a/src/mame/hegenerglaser/mondial68k.cpp b/src/mame/hegenerglaser/mondial68k.cpp index e73eb1903bc37..fa41e3f5f4b13 100644 --- a/src/mame/hegenerglaser/mondial68k.cpp +++ b/src/mame/hegenerglaser/mondial68k.cpp @@ -178,7 +178,7 @@ static INPUT_PORTS_START( mondial68k ) PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("D / 4 / Bishop") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("H / 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine ENT/CL for NEW GAME PORT_START("CLICKABLE") // helper for clickable artwork diff --git a/src/mame/hegenerglaser/montec.cpp b/src/mame/hegenerglaser/montec.cpp index 276e084660a37..6fbdca465a58e 100644 --- a/src/mame/hegenerglaser/montec.cpp +++ b/src/mame/hegenerglaser/montec.cpp @@ -151,7 +151,7 @@ void montec_state::montec_mem(address_map &map) static INPUT_PORTS_START( montec ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BOOK / 9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_B) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) diff --git a/src/mame/hegenerglaser/polgar.cpp b/src/mame/hegenerglaser/polgar.cpp index 3719803f0f2d2..a88e604505c1a 100644 --- a/src/mame/hegenerglaser/polgar.cpp +++ b/src/mame/hegenerglaser/polgar.cpp @@ -92,7 +92,7 @@ static INPUT_PORTS_START( polgar ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/risc.cpp b/src/mame/hegenerglaser/risc.cpp index bea66e69035f5..a79eb32205277 100644 --- a/src/mame/hegenerglaser/risc.cpp +++ b/src/mame/hegenerglaser/risc.cpp @@ -128,7 +128,7 @@ static INPUT_PORTS_START( mrisc ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/roma2.cpp b/src/mame/hegenerglaser/roma2.cpp index 3212782e81c80..bab69bcb7fcf8 100644 --- a/src/mame/hegenerglaser/roma2.cpp +++ b/src/mame/hegenerglaser/roma2.cpp @@ -130,7 +130,7 @@ void roma2_state::main_map(address_map &map) static INPUT_PORTS_START( montreal ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) diff --git a/src/mame/hegenerglaser/smondial.cpp b/src/mame/hegenerglaser/smondial.cpp index c634cfc2c4e8a..7df1af359550a 100644 --- a/src/mame/hegenerglaser/smondial.cpp +++ b/src/mame/hegenerglaser/smondial.cpp @@ -235,7 +235,7 @@ static INPUT_PORTS_START( smondial ) PORT_START("KEY.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Knight / 2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King / 6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_P) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_START("KEY.2") @@ -263,7 +263,7 @@ static INPUT_PORTS_START( smondial2 ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_MODIFY("KEY.2") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_MODIFY("KEY.3") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) diff --git a/src/mame/homebrew/pc532.cpp b/src/mame/homebrew/pc532.cpp index b168505b8f3fd..d05b9f317e2c6 100644 --- a/src/mame/homebrew/pc532.cpp +++ b/src/mame/homebrew/pc532.cpp @@ -10,7 +10,6 @@ * - https://www.nic.funet.fi/pub/misc/pc532/ * * TODO: - * - ns32381 * - et532 * * WIP: @@ -47,7 +46,7 @@ class pc532_state : public driver_device pc532_state(machine_config const &mconfig, device_type type, char const *tag) : driver_device(mconfig, type, tag) , m_cpu(*this, "cpu") - //, m_fpu(*this, "fpu") + , m_fpu(*this, "fpu") , m_icu(*this, "icu") , m_rtc(*this, "rtc") , m_ncr5380(*this, "slot:7:ncr5380") @@ -61,7 +60,6 @@ class pc532_state : public driver_device { } - void init(); void pc532(machine_config &config); protected: @@ -71,7 +69,7 @@ class pc532_state : public driver_device template void cpu_map(address_map &map); required_device m_cpu; - //required_device m_fpu; + required_device m_fpu; required_device m_icu; required_device m_rtc; @@ -113,12 +111,6 @@ class pc532_state : public driver_device m_state; }; -void pc532_state::init() -{ - // HACK: disable unemulated FPU - m_eprom[0x7c00 >> 2] &= ~0x02; -} - void pc532_state::machine_start() { // install phantom rtc using memory taps @@ -312,8 +304,8 @@ void pc532_state::pc532(machine_config &config) // ODT required because system software uses explicit MOV instead of RETI instructions m_cpu->set_addrmap(ns32000::ST_ODT, &pc532_state::cpu_map); - //NS32381(config, m_fpu, 50_MHz_XTAL / 2); - //m_cpu->set_fpu(m_fpu); + NS32381(config, m_fpu, 50_MHz_XTAL / 2); + m_cpu->set_fpu(m_fpu); NS32202(config, m_icu, 3.6864_MHz_XTAL); m_icu->out_int().set_inputline(m_cpu, INPUT_LINE_IRQ0).invert(); @@ -327,7 +319,7 @@ void pc532_state::pc532(machine_config &config) NSCSI_CONNECTOR(config, "slot:1", scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "slot:2", scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "slot:3", scsi_devices, nullptr, false); - NSCSI_CONNECTOR(config, "slot:7").option_set("ncr5380", NCR5380).machine_config( + NSCSI_CONNECTOR(config, "slot:7").option_set("ncr5380", NCR5380).machine_config( // DP8490 [this](device_t *device) { ncr5380_device &ncr5380(downcast(*device)); @@ -412,5 +404,5 @@ ROM_END } // anonymous namespace -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP(1989, pc532, 0, 0, pc532, 0, pc532_state, init, "George Scolaro", "pc532", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP(1989, pc532, 0, 0, pc532, 0, pc532_state, empty_init, "George Scolaro", "pc532", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/igt/gkigt.cpp b/src/mame/igt/gkigt.cpp index 727244e3ee002..24bc75247bf18 100644 --- a/src/mame/igt/gkigt.cpp +++ b/src/mame/igt/gkigt.cpp @@ -890,6 +890,7 @@ ROM_END ROM_START( gkkey ) ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD( "key00016,1-4002.bin", 0x00000, 0x80000, CRC(97f43f33) SHA1(1485a343f7865f3600ba9cd80eedc489ea75ae40) ) ROM_LOAD( "key00017,1-4002.bin", 0x00000, 0x80000, CRC(1579739f) SHA1(7b6257d17f74599a4ada3014d02a2e7c6686ab3f) ) /* non WAP keychip */ ROM_LOAD( "key00018,1-4002.bin", 0x00000, 0x80000, CRC(b35b8888) SHA1(60adc02d17ab0a163e9a6bfbac1f46eeb4a77243) ) /* WAP keychip */ ROM_LOAD( "key00021,1-4002.bin", 0x00000, 0x80000, CRC(4d1ef12f) SHA1(ab9eebe0ba84d8e27496864adbfe7d1639a6375e) ) /* MD3 WAP keychip & memory clear */ @@ -914,9 +915,8 @@ ROM_START( gkkey ) ROM_LOAD( "cvs00080,1-4002.bin", 0x00000, 0x80000, CRC(f58a3040) SHA1(906ed54aeafdf2cf58ee8425405498a8c64b52e1) ) ROM_LOAD( "ivc00097,1-4002.bin", 0x00000, 0x80000, CRC(f0a59fd1) SHA1(8e980e9eb80e6899fe3bbcd21ccbd39f9fdccaca) ) /* Vision Ram/E-Square Clear (Replaces IVC00070) */ - ROM_REGION( 0x80000, "miscbad", 0 ) - // these are also bad dumps, again they never contains the byte value 0x0d (uploaded in ASCII mode with carriage return stripped out?) - ROM_LOAD( "key00016,1-4002.bin", 0x00000, 0x07ff9a, BAD_DUMP CRC(80c0c2c4) SHA1(e8df4e516c058aeacf1492151c38b5e73f161c8c) ) // should be 0x80000 +// ROM_REGION( 0x80000, "miscbad", 0 ) +// these are also bad dumps, again they never contains the byte value 0x0d (uploaded in ASCII mode with carriage return stripped out?) ROM_REGION32_LE( 0x200000, "game", ROMREGION_ERASEFF ) ROM_REGION( 0x100000, "cg", ROMREGION_ERASEFF ) diff --git a/src/mame/konami/blockhl.cpp b/src/mame/konami/blockhl.cpp index 56e2656b71df1..65cfb7dce4c38 100644 --- a/src/mame/konami/blockhl.cpp +++ b/src/mame/konami/blockhl.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Nicola Salmoria +// copyright-holders: Nicola Salmoria + /******************************************************************************* Block Hole (GX973) (c) 1989 Konami @@ -18,16 +19,16 @@ *******************************************************************************/ #include "emu.h" + +#include "k051960.h" +#include "k052109.h" #include "konamipt.h" #include "cpu/m6809/konami.h" #include "cpu/z80/z80.h" -#include "machine/bankdev.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ymopm.h" -#include "k052109.h" -#include "k051960.h" #include "emupal.h" #include "speaker.h" @@ -45,13 +46,26 @@ class blockhl_state : public driver_device blockhl_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_bank5800(*this, "bank5800"), m_audiocpu(*this, "audiocpu"), m_k052109(*this, "k052109"), m_k051960(*this, "k051960"), - m_rombank(*this, "rombank") + m_rombank(*this, "rombank"), + m_view5800(*this, "view5800") { } + void blockhl(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_k052109; + required_device m_k051960; + required_memory_bank m_rombank; + memory_view m_view5800; + K052109_CB_MEMBER(tile_callback); K051960_CB_MEMBER(sprite_callback); uint32_t screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -62,20 +76,8 @@ class blockhl_state : public driver_device void banking_callback(uint8_t data); - void blockhl(machine_config &config); void audio_map(address_map &map); - void bank5800_map(address_map &map); void main_map(address_map &map); -protected: - virtual void machine_start() override; - -private: - required_device m_maincpu; - required_device m_bank5800; - required_device m_audiocpu; - required_device m_k052109; - required_device m_k051960; - required_memory_bank m_rombank; }; @@ -95,17 +97,13 @@ void blockhl_state::main_map(address_map &map) map(0x1f97, 0x1f97).portr("DSW1"); map(0x1f98, 0x1f98).portr("DSW2"); map(0x4000, 0x57ff).ram(); - map(0x5800, 0x5fff).m(m_bank5800, FUNC(address_map_bank_device::amap8)); + map(0x5800, 0x5fff).view(m_view5800); + m_view5800[0](0x5800, 0x5fff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); + m_view5800[1](0x5800, 0x5fff).ram(); map(0x6000, 0x7fff).bankr("rombank"); map(0x8000, 0xffff).rom().region("maincpu", 0x8000); } -void blockhl_state::bank5800_map(address_map &map) -{ - map(0x0000, 0x07ff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); - map(0x0800, 0x0fff).ram(); -} - void blockhl_state::audio_map(address_map &map) { map(0x0000, 0x7fff).rom(); @@ -120,7 +118,7 @@ void blockhl_state::audio_map(address_map &map) // VIDEO EMULATION //************************************************************************** -K052109_CB_MEMBER( blockhl_state::tile_callback ) +K052109_CB_MEMBER(blockhl_state::tile_callback) { static const int layer_colorbase[] = { 0 / 16, 256 / 16, 512 / 16 }; @@ -128,7 +126,7 @@ K052109_CB_MEMBER( blockhl_state::tile_callback ) *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); } -K051960_CB_MEMBER( blockhl_state::sprite_callback ) +K051960_CB_MEMBER(blockhl_state::sprite_callback) { enum { sprite_colorbase = 768 / 16 }; @@ -194,6 +192,8 @@ void blockhl_state::machine_start() { // the first 0x8000 are banked, the remaining 0x8000 are directly accessible m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x2000); + + m_view5800.select(0); } void blockhl_state::banking_callback(uint8_t data) @@ -208,7 +208,7 @@ void blockhl_state::banking_callback(uint8_t data) machine().bookkeeping().coin_counter_w(1, data & 0x10); // bit 5 = select palette RAM or work RAM at 5800-5fff - m_bank5800->set_bank(BIT(data, 5)); + m_view5800.select(BIT(data, 5)); // bit 6 = enable char ROM reading through the video RAM m_k052109->set_rmrd_line(BIT(data, 6) ? ASSERT_LINE : CLEAR_LINE); @@ -284,12 +284,10 @@ INPUT_PORTS_END void blockhl_state::blockhl(machine_config &config) { // basic machine hardware - KONAMI(config, m_maincpu, XTAL(24'000'000)/2); // Konami 052526 + KONAMI(config, m_maincpu, XTAL(24'000'000) / 2); // Konami 052526 m_maincpu->set_addrmap(AS_PROGRAM, &blockhl_state::main_map); m_maincpu->line().set(FUNC(blockhl_state::banking_callback)); - ADDRESS_MAP_BANK(config, "bank5800").set_map(&blockhl_state::bank5800_map).set_options(ENDIANNESS_BIG, 8, 12, 0x800); - Z80(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &blockhl_state::audio_map); @@ -297,9 +295,9 @@ void blockhl_state::blockhl(machine_config &config) // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(24'000'000)/3, 528, 112, 400, 256, 16, 240); + screen.set_raw(XTAL(24'000'000) / 3, 528, 112, 400, 256, 16, 240); // 6MHz dotclock is more realistic, however needs drawing updates. replace when ready -// screen.set_raw(XTAL(24'000'000)/4, 396, hbend, hbstart, 256, 16, 240); +// screen.set_raw(XTAL(24'000'000) / 4, 396, hbend, hbstart, 256, 16, 240); screen.set_screen_update(FUNC(blockhl_state::screen_update_blockhl)); screen.set_palette("palette"); @@ -330,10 +328,10 @@ void blockhl_state::blockhl(machine_config &config) //************************************************************************** ROM_START( blockhl ) - ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "973l02.e21", 0x00000, 0x10000, CRC(e14f849a) SHA1(d44cf178cc98998b72ed32c6e20b6ebdf1f97579) ) - ROM_REGION( 0x08000, "audiocpu", 0 ) // 32k for the sound CPU + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) ) ROM_REGION( 0x20000, "k052109", 0 ) // tiles @@ -348,15 +346,15 @@ ROM_START( blockhl ) ROM_LOAD32_BYTE( "973f04.k7", 0x00002, 0x08000, CRC(69ca41bd) SHA1(9b0b1c888efd2f2d5525f14778e18fb4a7353eb6) ) ROM_LOAD32_BYTE( "973f03.k4", 0x00003, 0x08000, CRC(21e98472) SHA1(8c697d369a1f57be0825c33b4e9107ce1b02a130) ) - ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used) + ROM_REGION( 0x0100, "priority", 0 ) // not used ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) ) ROM_END ROM_START( quarth ) - ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "973j02.e21", 0x00000, 0x10000, CRC(27a90118) SHA1(51309385b93db29b9277d14252166c4ea1746303) ) - ROM_REGION( 0x08000, "audiocpu", 0 ) // 32k for the sound CPU + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) ) ROM_REGION( 0x20000, "k052109", 0 ) // tiles @@ -371,7 +369,7 @@ ROM_START( quarth ) ROM_LOAD32_BYTE( "973e04.k7", 0x00002, 0x08000, CRC(d70f4a2c) SHA1(25f835a17bacf2b8debb2eb8a3cff90cab3f402a) ) ROM_LOAD32_BYTE( "973e03.k4", 0x00003, 0x08000, CRC(2c5a4b4b) SHA1(e2991dd78b9cd96cf93ebd6de0d4e060d346ab9c) ) - ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used) + ROM_REGION( 0x0100, "priority", 0 ) // not used ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) ) ROM_END diff --git a/src/mame/korg/microkorg.cpp b/src/mame/korg/microkorg.cpp index 4d69500f29af0..0cd0595471aaa 100644 --- a/src/mame/korg/microkorg.cpp +++ b/src/mame/korg/microkorg.cpp @@ -9,7 +9,7 @@ ****************************************************************************/ #include "emu.h" -#include "cpu/h8/h8s2320.h" +#include "cpu/h8/h8s2329.h" #include "machine/intelfsh.h" diff --git a/src/mame/layout/cxg_senterprisec.lay b/src/mame/layout/cxg_senterprisec.lay new file mode 100644 index 0000000000000..b7a21fbe19ae6 --- /dev/null +++ b/src/mame/layout/cxg_senterprisec.lay @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/h19.lay b/src/mame/layout/h19.lay new file mode 100644 index 0000000000000..df0b827421074 --- /dev/null +++ b/src/mame/layout/h19.lay @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + ]]> + + + + + + + + + + + + + + diff --git a/src/mame/layout/h89.lay b/src/mame/layout/h89.lay new file mode 100644 index 0000000000000..0904b630eb189 --- /dev/null +++ b/src/mame/layout/h89.lay @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + ]]> + + + + + + + + + + + + + + diff --git a/src/mame/layout/wizatron.lay b/src/mame/layout/lilprof.lay similarity index 100% rename from src/mame/layout/wizatron.lay rename to src/mame/layout/lilprof.lay diff --git a/src/mame/layout/mastmind.lay b/src/mame/layout/mastmind.lay index 64bdbf6b33356..f732bd27c72d5 100644 --- a/src/mame/layout/mastmind.lay +++ b/src/mame/layout/mastmind.lay @@ -9,22 +9,20 @@ authors:hap - - - - - - - - - - - - - - - - + + + + + + + + + + + + + ]]> @@ -43,7 +41,7 @@ authors:hap - + diff --git a/src/mame/layout/novag_mentor16.lay b/src/mame/layout/novag_mentor16.lay index 8ff15f4b77bdd..eed791d85e5d8 100644 --- a/src/mame/layout/novag_mentor16.lay +++ b/src/mame/layout/novag_mentor16.lay @@ -377,9 +377,9 @@ authors:hap - + - + @@ -413,40 +413,33 @@ authors:hap - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - - - @@ -484,14 +477,14 @@ authors:hap - - - - - - - - + + + + + + + + @@ -504,14 +497,41 @@ authors:hap - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_chessac.lay b/src/mame/layout/saitek_chessac.lay new file mode 100644 index 0000000000000..602a6929de6f3 --- /dev/null +++ b/src/mame/layout/saitek_chessac.lay @@ -0,0 +1,525 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/smastmind.lay b/src/mame/layout/smastmind.lay index 2c9d9201237eb..e29685ac59fe5 100644 --- a/src/mame/layout/smastmind.lay +++ b/src/mame/layout/smastmind.lay @@ -9,27 +9,25 @@ authors:hap - - - + + + - - - - - - - + + + + + + + - - - - - - - - - + + + + + + ]]> @@ -49,7 +47,7 @@ authors:hap - + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0a7e0143ca3fe..597ee3e49f953 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -887,6 +887,7 @@ maclc // 1990 Apple Macintosh LC maclc2 // 1991 Apple Macintosh LC II macclas2 // 1991 Apple Macintosh Classic II maccclas // 1993 Apple Macintosh Color Classic +mactv // 1994 Apple Macintosh TV @source:apple/maclc3.cpp maclc3 // 1993 Apple Macintosh LC III @@ -2154,6 +2155,76 @@ xybotsg // 136054 (c) 1987 @source:atlus/bowltry.cpp bowltry // (c) 200? Atlus +@source:atlus/cave.cpp +agallet // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalleth // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletj // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletk // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agallett // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletu // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalleta // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletah // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletaj // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletak // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletat // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +agalletau // (c) 1996 Banpresto / Gazelle (country is in EEPROM) +crusherm // (c) 1999 Takumi +ddonpach // (c) 1997 Atlus/Cave +ddonpacha // hack +ddonpachj // (c) 1997 Atlus/Cave +dfeveron // (c) 1998 Cave + Nihon System license +donpachi // (c) 1995 Atlus/Cave +donpachihk // (c) 1995 Atlus/Cave +donpachij // (c) 1995 Atlus/Cave +donpachijs // (c) 1995 Atlus/Cave +donpachikr // (c) 1995 Atlus/Cave +esprade // (c) 1998 Atlus/Cave +espradej // (c) 1998 Atlus/Cave (Japan) +espradejo // (c) 1998 Atlus/Cave (Japan) +feversos // (c) 1998 Cave + Nihon System license +gaia // (c) 1999 Noise Factory +guwange // (c) 1999 Atlus/Cave +guwanges // (c) 1999 Atlus/Cave +hotdogst // (c) 1996 Marble +korokoro // (c) 1999 Takumi +mazinger // (c) 1994 Banpresto (country is in EEPROM) +mazingerj // (c) 1994 Banpresto (country is in EEPROM) +metmqstr // (c) 1995 Banpresto / Pandorabox +nmaster // (c) 1995 Banpresto / Pandorabox +paccarn // (c) 1996 Namco +paceight // (c) 1996 Namco +pacslot // (c) 1996 Namco +plegends // (c) 1994 Atlus +plegendsj // (c) 1994 Atlus +ppsatan // (c) 1996 +pwrinst2 // (c) 1994 Atlus +pwrinst2a // (c) 1994 Atlus +pwrinst2j // (c) 1994 Atlus +sailormn // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +sailormnh // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +sailormnj // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +sailormnk // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +sailormnn // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormnnh // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormnnj // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormnnk // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormnnt // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormnnu // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) +sailormno // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnoh // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnoj // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnok // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnot // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnou // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) +sailormnt // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +sailormnu // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) +tekkenbs // (c) 1998 Namco +tekkencw // (c) 1997 Namco +theroes // (c) 2001 Primetek Investments +tjumpman // (c) 1999 Namco +uopoko // (c) 1998 Cave + Jaleco license +uopokoj // (c) 1998 Cave + Jaleco license + @source:atlus/ohmygod.cpp naname // (c) 1994 Atlus (Japan) ohmygod // (c) 1993 Atlus (Japan) @@ -15899,6 +15970,7 @@ casloopy // @source:casio/cfx9850.cpp cfx9850 // Casio CFX-9850 +cfx9850gb // Casio CFX-9850GB Plus @source:casio/ctk2000.cpp ctk2100 // @@ -15959,6 +16031,43 @@ sk10 // @source:casio/sx1000.cpp sx1010 // Casio SX1010 +@source:cave/cavepc.cpp +deathsm2 // + +@source:cave/cv1k.cpp +ddpdfk // (c) 2008 Cave (AMI license) - 2008/06/23 MASTER VER 1.5 +ddpdfk10 // (c) 2008 Cave (AMI license) - 2008/05/16 MASTER VER +deathsml // (c) 2007 Cave (AMI license) - 2007/10/09 MASTER VER +dfkbl // (c) 2010 Cave (AMI license) - 2010/1/18 BLACK LABEL +dsmbl // (c) 2008 Cave (AMI license) - 2008/10/06 MEGABLACK LABEL VER +espgal2 // (c) 2005 Cave (AMI license) - 2005/11/14.MASTER VER. +espgal2a // (c) 2005 Cave (AMI license) - 2005/11/14 MASTER VER +espgal2b // (c) 2005 Cave (AMI license) - 2005/11/14 MASTER VER +futari10 // (c) 2006 Cave (AMI license) - 2006/10/23 MASTER VER. +futari15 // (c) 2006 Cave (AMI license) - 2006/12/8.MASTER VER. 1.54. +futari15a // (c) 2006 Cave (AMI license) - 2006/12/8 MASTER VER 1.54 +futaribl // (c) 2007 Cave (AMI license) - 2009/11/27 INTERNATIONAL BL - Another Ver +futariblj // (c) 2007 Cave (AMI license) - 2007/12/11 BLACK LABEL VER +ibara // (c) 2005 Cave (AMI license) - 2005/03/22 MASTER VER.. '06. 3. 7 ver. +ibarao // (c) 2005 Cave (AMI license) - 2005/03/22 MASTER VER.. +ibarablk // (c) 2005 Cave (AMI license) - 2006/02/06. MASTER VER. +ibarablka // (c) 2005 Cave (AMI license) - 2006/02/06 MASTER VER. +mmmbanc // (c) 2007 Cave (AMI license) - 2007/06/05 MASTER VER. +mmpork // (c) 2007 Cave (AMI license) - 2007/ 4/17 MASTER VER. +mushisam // (c) 2004 Cave (AMI license) - 2004/10/12.MASTER VER. +mushisama // (c) 2004 Cave (AMI license) - 2004/10/12 MASTER VER. +mushisamb // (c) 2004 Cave (AMI license) - 2004/10/12 MASTER VER +mushitam // (c) 2005 Cave (AMI license) - 2005/09/09.MASTER VER +mushitama // (c) 2005 Cave (AMI license) - 2005/09/09 MASTER VER +pinkswts // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER.... +pinkswtsa // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER... +pinkswtsb // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER. +pinkswtsx // (c) 2006 Cave (AMI license) - 2006/xx/xx MASTER VER. +pinkswtssc // bootleg + +@source:cave/fstgfish.cpp +fstgfish // (c) 2008 Cave + @source:cce/mc1000.cpp mc1000 // @@ -16446,6 +16555,7 @@ scprof @source:cxg/senterprise.cpp senterp +senterpc @source:cxg/sphinx40.cpp sphinx40 @@ -19119,7 +19229,9 @@ h2hfootb // Coleco h2hhockey // Coleco horseran // Mattel lilprof // Texas Instruments -lilprofa // Texas Instruments +lilprofo // Texas Instruments +lilprofoa // Texas Instruments +lilprofob // Texas Instruments litelrn // Concept 2000 liveafb // Kenner lostreas // Parker Bros @@ -28612,6 +28724,9 @@ showhand // (c) 2000 Astro Corp. skilldrp // (c) 2002 Astro Corp. skilldrpa // (c) 2002 Astro Corp. speeddrp // (c) 2003 Astro Corp. +speedmst // (c) 2004 D2 Enterprises +speedmsta // (c) 2003 D2 Enterprises +speedmstb // (c) 2004 D2 Enterprises westvent // (c) 2007? Astro Corp. winbingo // (c) 2006 Astro Corp. winbingoa // (c) 2006 Astro Corp. @@ -28817,79 +28932,6 @@ carrera // (c) 19?? BS Electronics castfpt // Fortune Pot castrev // Revolution -@source:misc/cave.cpp -agallet // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalleth // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletj // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletk // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agallett // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletu // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalleta // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletah // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletaj // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletak // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletat // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -agalletau // (c) 1996 Banpresto / Gazelle (country is in EEPROM) -crusherm // (c) 1999 Takumi -ddonpach // (c) 1997 Atlus/Cave -ddonpacha // hack -ddonpachj // (c) 1997 Atlus/Cave -dfeveron // (c) 1998 Cave + Nihon System license -donpachi // (c) 1995 Atlus/Cave -donpachihk // (c) 1995 Atlus/Cave -donpachij // (c) 1995 Atlus/Cave -donpachijs // (c) 1995 Atlus/Cave -donpachikr // (c) 1995 Atlus/Cave -esprade // (c) 1998 Atlus/Cave -espradej // (c) 1998 Atlus/Cave (Japan) -espradejo // (c) 1998 Atlus/Cave (Japan) -feversos // (c) 1998 Cave + Nihon System license -gaia // (c) 1999 Noise Factory -guwange // (c) 1999 Atlus/Cave -guwanges // (c) 1999 Atlus/Cave -hotdogst // (c) 1996 Marble -korokoro // (c) 1999 Takumi -mazinger // (c) 1994 Banpresto (country is in EEPROM) -mazingerj // (c) 1994 Banpresto (country is in EEPROM) -metmqstr // (c) 1995 Banpresto / Pandorabox -nmaster // (c) 1995 Banpresto / Pandorabox -paccarn // (c) 1996 Namco -paceight // (c) 1996 Namco -pacslot // (c) 1996 Namco -plegends // (c) 1994 Atlus -plegendsj // (c) 1994 Atlus -ppsatan // (c) 1996 -pwrinst2 // (c) 1994 Atlus -pwrinst2a // (c) 1994 Atlus -pwrinst2j // (c) 1994 Atlus -sailormn // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -sailormnh // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -sailormnj // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -sailormnk // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -sailormnn // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormnnh // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormnnj // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormnnk // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormnnt // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormnnu // (c) 1995 Banpresto (Ver. 95/03/22, country is in EEPROM) -sailormno // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnoh // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnoj // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnok // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnot // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnou // (c) 1995 Banpresto (Ver. 95/03/21, country is in EEPROM) -sailormnt // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -sailormnu // (c) 1995 Banpresto (Ver. 95/03/22B, country is in EEPROM) -tekkenbs // (c) 1998 Namco -tekkencw // (c) 1997 Namco -theroes // (c) 2001 Primetek Investments -tjumpman // (c) 1999 Namco -uopoko // (c) 1998 Cave + Jaleco license -uopokoj // (c) 1998 Cave + Jaleco license - -@source:misc/cavepc.cpp -deathsm2 // - @source:misc/cb2001.cpp cb2001 // (c) 2001 Dyna Electronics scherrym // (c) 2001? Dyna Electronics @@ -29024,37 +29066,6 @@ gangrose // tsarevna // tsarevnaa // -@source:misc/cv1k.cpp -ddpdfk // (c) 2008 Cave (AMI license) - 2008/06/23 MASTER VER 1.5 -ddpdfk10 // (c) 2008 Cave (AMI license) - 2008/05/16 MASTER VER -deathsml // (c) 2007 Cave (AMI license) - 2007/10/09 MASTER VER -dfkbl // (c) 2010 Cave (AMI license) - 2010/1/18 BLACK LABEL -dsmbl // (c) 2008 Cave (AMI license) - 2008/10/06 MEGABLACK LABEL VER -espgal2 // (c) 2005 Cave (AMI license) - 2005/11/14.MASTER VER. -espgal2a // (c) 2005 Cave (AMI license) - 2005/11/14 MASTER VER -espgal2b // (c) 2005 Cave (AMI license) - 2005/11/14 MASTER VER -futari10 // (c) 2006 Cave (AMI license) - 2006/10/23 MASTER VER. -futari15 // (c) 2006 Cave (AMI license) - 2006/12/8.MASTER VER. 1.54. -futari15a // (c) 2006 Cave (AMI license) - 2006/12/8 MASTER VER 1.54 -futaribl // (c) 2007 Cave (AMI license) - 2009/11/27 INTERNATIONAL BL - Another Ver -futariblj // (c) 2007 Cave (AMI license) - 2007/12/11 BLACK LABEL VER -ibara // (c) 2005 Cave (AMI license) - 2005/03/22 MASTER VER.. '06. 3. 7 ver. -ibarao // (c) 2005 Cave (AMI license) - 2005/03/22 MASTER VER.. -ibarablk // (c) 2005 Cave (AMI license) - 2006/02/06. MASTER VER. -ibarablka // (c) 2005 Cave (AMI license) - 2006/02/06 MASTER VER. -mmmbanc // (c) 2007 Cave (AMI license) - 2007/06/05 MASTER VER. -mmpork // (c) 2007 Cave (AMI license) - 2007/ 4/17 MASTER VER. -mushisam // (c) 2004 Cave (AMI license) - 2004/10/12.MASTER VER. -mushisama // (c) 2004 Cave (AMI license) - 2004/10/12 MASTER VER. -mushisamb // (c) 2004 Cave (AMI license) - 2004/10/12 MASTER VER -mushitam // (c) 2005 Cave (AMI license) - 2005/09/09.MASTER VER -mushitama // (c) 2005 Cave (AMI license) - 2005/09/09 MASTER VER -pinkswts // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER.... -pinkswtsa // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER... -pinkswtsb // (c) 2006 Cave (AMI license) - 2006/04/06 MASTER VER. -pinkswtsx // (c) 2006 Cave (AMI license) - 2006/xx/xx MASTER VER. -pinkswtssc // bootleg - @source:misc/cwheel.cpp cwheel // (c) 19?? Gamebar @@ -32109,6 +32120,7 @@ filthyrr // (c) 1997 WMS - Filthy Rich (Russian) hottop // (c) 2003 WMS - Hot Toppings (English) hottopa // (c) 2001 WMS - Hot Toppings (Russian?) inwinner // (c) 1998 WMS - Instant Winner (Russian) +inwinners // (c) 1998 WMS - Instant Winner (Spanish) jptparty // (c) 1998 WMS - Jackpot Party (Russian) leprgld // (c) 2001 WMS - Leprechaun's Gold (Russian) leprglds // (c) 2001 WMS - Leprechaun's Gold (Spanish) @@ -34228,6 +34240,7 @@ smb3bl @source:nintendo/nes_clone.cpp afbm7800 +croaky dancexpt digezlg dnce2000 @@ -35481,6 +35494,7 @@ smih0107 // unknown 386 AT clone with Forex chipset sy012 // SY-012 16/25 386MB VER: 5.2 motherboard (386) sy019hi // Soyo SY-019H and SY-019I motherboards (386) sybaby386 // SOYO Baby AT 386 +t4000 // Tandy 4000 tam25p2 // AUVA TAM/25-P2 motherboard (386) tam3340ma0 // TAM/33/40-MA0 (CM318R00,M31-R00) um82c481af // motherboards using the UMC UM82C481AF chipset (386) @@ -35816,6 +35830,9 @@ tetriskr // (c) 1988? bootleg @source:pc/poisk1.cpp poisk1 // +@source:pc/przone.cpp +przonegd + @source:pc/ps2.cpp i8530286 // IBM PS/2 Model 30-286 i8530h31 // IBM PS/2 8530-H31 (Model 30/286) @@ -37006,6 +37023,7 @@ taxi_l4 // taxi_lg1 // taxi_lu1 // taxi_p5 // +tsptr_l1 // tsptr_l3 // whirl_l2 // whirl_l3 // @@ -38521,6 +38539,13 @@ r9751 // ROLM 9751 phone system @source:sage/sage2.cpp sage2 +@source:saitek/chessac.cpp +chessac + +@source:saitek/chesstrv.cpp +chesstrv +chesstrvi + @source:saitek/companion.cpp compan @@ -38529,10 +38554,6 @@ compan2 enterp expchess -@source:saitek/chesstrv.cpp -chesstrv -chesstrvi - @source:saitek/corona.cpp corona coronaa @@ -40152,6 +40173,7 @@ pdriftj // 1988.09 Power Drift (Japan) pdriftl // rchase // 1991.09 Rail Chase (World) rchasej // 1991.09 Rail Chase (Japan) +rchasejb // 1991.09 Rail Chase (Japan) strkfgtr // 1991.06 Strike Fighter (World) strkfgtrj // 1991.06 Strike Fighter (Japan) @@ -41718,6 +41740,7 @@ ht68k // marimba // poembase poemgolf +poemspoo poemzet poemzet2 @@ -43033,6 +43056,9 @@ halleyscj // A62 (c) 1986 Taito Corporation (Japan, rev 1) halleyscja // A62 (c) 1986 Taito Corporation (Japan) halleyscjp // A62 (c) 1985 Taito Corporation (Japan, prototype) +@source:taito/haplucky.cpp +haplucky // A58 + @source:taito/heromem.cpp heromem // E34 (c) 1997 Taito @@ -44920,6 +44946,7 @@ comil // decathln decathlna doraglob // (c) 2007 VTech +doraglobf doraglobg doraphon // (c) 2006 VTech doraphonf @@ -44935,6 +44962,7 @@ jeuint jjstrip jouet knd +lexiart lxairjet lxspidaj mattelcs // @@ -45153,6 +45181,7 @@ epo_epp3 // epo_eppk // epo_esdx // epo_guru // +epo_tfp2 // evio // gcslottv // gungunad // @@ -45315,6 +45344,7 @@ idsoccera // ???? (c) 1985 idsoccert // 8461A (c) 1985 jjack // ???? (c) 1984 kickridr // ???? (c) 1984 +runrun // bootleg spiero // ???? (c) 1987 @source:universal/getaway.cpp @@ -46029,6 +46059,7 @@ notetakr // bigboard // mk82 // mk83 // +mojmikro // x168 // x820 // x820ii // diff --git a/src/mame/microterm/mt440.cpp b/src/mame/microterm/mt440.cpp index 79c0c64d2c1cf..6807db86d213a 100644 --- a/src/mame/microterm/mt440.cpp +++ b/src/mame/microterm/mt440.cpp @@ -48,6 +48,8 @@ #include "emu.h" #include "cpu/z80/z80.h" +#include "emupal.h" + namespace { @@ -101,6 +103,27 @@ static INPUT_PORTS_START( mt440 ) INPUT_PORTS_END +//************************************************************************** +// VIDEO EMULATION +//************************************************************************** + +static const gfx_layout char_layout = +{ + 8, 10, + 128, + 1, + { 0 }, + { STEP8(0, 1) }, + { 0*0x80*8, 1*0x80*8, 2*0x80*8, 3*0x80*8, 4*0x80*8, 5*0x80*8, 6*0x80*8, 7*0x80*8, 8*0x80*8, 9*0x80*8 }, + 8 +}; + +static GFXDECODE_START(chars) + GFXDECODE_ENTRY("cg", 0x000, char_layout, 0, 1) + GFXDECODE_ENTRY("cg", 0x800, char_layout, 0, 1) +GFXDECODE_END + + //************************************************************************** // MACHINE EMULATION //************************************************************************** @@ -123,6 +146,10 @@ void mt440_state::mt440(machine_config &config) Z80(config, m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &mt440_state::mem_map); m_maincpu->set_addrmap(AS_IO, &mt440_state::io_map); + + PALETTE(config, "palette", palette_device::MONOCHROME_HIGHLIGHT); + + GFXDECODE(config, "gfxdecode", "palette", chars); } @@ -137,6 +164,7 @@ ROM_START( mt440 ) ROM_LOAD("1965_mp_r40.u9", 0xa000, 0x1000, CRC(e39d145c) SHA1(79c4a8dd62398b6f2f6e7e8004ec42b2511016de)) ROM_REGION(0x1000, "cg", 0) + // bad? gfxdecode shows missing pixels ROM_LOAD("mt425_cg_rev21.u37", 0x0000, 0x1000, CRC(3ba34cf4) SHA1(dddddf69d736f04a17aae2019f47257484e88377)) ROM_REGION(0x800, "attr", 0) diff --git a/src/mame/misc/astrcorp.cpp b/src/mame/misc/astrcorp.cpp index d7d31ca1f50a3..503204b13ac10 100644 --- a/src/mame/misc/astrcorp.cpp +++ b/src/mame/misc/astrcorp.cpp @@ -23,10 +23,13 @@ Year + Game PCB ID CPU Video 02 Skill Drop GA None JX-1689F1028N ASTRO V02 pLSI1016-60LJ 02? Keno 21 ? ASTRO V102? ASTRO V05 ASTRO F02? not dumped 03 Speed Drop None JX-1689HP ASTRO V05 pLSI1016-60LJ +03 Speed Master (V1.0) M02 AST-V102PX scratched scratched Encrypted 04 Zoo M1.1 ASTRO V102PX-005? ASTRO V06 ASTRO F02 2005-02-18 Encrypted 04 Magic Bomb (NB6.1) J (CS350P001 + CS350P033) ASTRO V102PX-014? ASTRO V07 ?, Encrypted, select CGA / VGA via jumper 04 Go & Stop K2 (CS350P011) no markings ASTRO V05 ASTRO F01 2007-06-03 Encrypted 04 Magic Bomb (AA.72C) M1.1 ASTRO V102PX-014? ASTRO V05 ASTRO F02 2005-02-18 Encrypted +04 Speed Master (V1.0) M02 AST-V102PX scratched scratched Encrypted +04 Speed Master (V1.0) CS350P003 scratched scratched scratched Encrypted 05 Monkey Land (AA.13B) M1 ASTRO V102PX-005? ASTRO V06 ASTRO F02 2004-05-18 Encrypted 05 Monkey Land (AA.21A) M1.1 ASTRO V102PX-005? ASTRO V06 ASTRO F02 2004-12-04 Encrypted 05 Dino Dino T-3802A ASTRO V102PX-010? ASTRO V05 ASTRO F02 2003-03-12 Encrypted @@ -61,7 +64,8 @@ Year + Game PCB ID CPU Video - astoneag, dinodino, magibombd, magibombg: exiting from test menu goes haywire (requires a soft-reset with F3). - magibombg: needs RE of the CPU code and correct EEPROM. - gostopac: stops with 'S4' message during boot. Needs RE of the CPU code and emulation of its peculiarities. -- monkeyl,a: Needs RE of the CPU code, inputs and layout. After reset it initializes. +- monkeyl,a: need RE of the CPU code, inputs and layout. After reset it initializes. +- speedmst,a,b: need RE of the CPU code, correct EEPROM. Won't boot right now. *************************************************************************************************************/ @@ -291,6 +295,7 @@ class zoo_state : public astrocorp_state void magibombd(machine_config &config); void magibombg(machine_config &config); void monkeyl(machine_config &config); + void speedmst(machine_config &config); void winbingo(machine_config &config); void zoo(machine_config &config); @@ -301,6 +306,9 @@ class zoo_state : public astrocorp_state void init_magibombg(); void init_monkeyl(); void init_monkeyla(); + void init_speedmst(); + void init_speedmsta(); + void init_speedmstb(); void init_winbingo(); void init_winbingoa(); void init_zoo(); @@ -339,13 +347,13 @@ class zoo_state : public astrocorp_state void magibombd_map(address_map &map); void magibombg_map(address_map &map); void monkeyl_map(address_map &map); + void speedmst_map(address_map &map); void winbingo_map(address_map &map); void zoo_map(address_map &map); static const decryption_info dinodino_table; static const decryption_info gostop_table; static const decryption_info magibombd_table; - static const decryption_info monkeyl_table; static const decryption_info winbingo_table; static const decryption_info zoo_table; }; @@ -934,6 +942,23 @@ void zoo_state::monkeyl_map(address_map &map) map(0xe80001, 0xe80001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } +void zoo_state::speedmst_map(address_map &map) +{ + map(0x000000, 0x03ffff).rom().mirror(0x800000); // POST checks for ROM checksum at mirror + map(0x850000, 0x850001).nopr().w(FUNC(zoo_state::screen_enable_w)).umask16(0x00ff); + map(0x860000, 0x863fff).ram().share("nvram"); // battery + map(0x880000, 0x880fff).ram().share("spriteram"); + map(0x882000, 0x882001).nopr().w(FUNC(zoo_state::draw_sprites_w)); + map(0x884000, 0x884001).portr("INPUTS"); + map(0x886000, 0x8861ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x888001, 0x888001).w(FUNC(zoo_state::eeprom_w)); + map(0x88a000, 0x88a001).w(FUNC(zoo_state::magibomb_outputs_w)); + map(0x890000, 0x890001).portr("EEPROM_IN"); + map(0x8a0000, 0x8a0001).portr("CPUCODE_IN"); + //map(0x8c0001, 0x8c0001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + //map(0x??0001, 0x??0001).w(FUNC(zoo_state::oki_bank_w)) +} + void astoneag_state::astoneag_map(address_map &map) { map(0x000000, 0x03ffff).rom().mirror(0x800000); // POST checks for ROM checksum at mirror @@ -1369,6 +1394,12 @@ void zoo_state::monkeyl(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &zoo_state::monkeyl_map); } +void zoo_state::speedmst(machine_config &config) +{ + gostop(config); + m_maincpu->set_addrmap(AS_PROGRAM, &zoo_state::speedmst_map); +} + void astoneag_state::ramdac_map(address_map &map) { map(0x000, 0x2ff).rw(m_ramdac, FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); @@ -2342,6 +2373,84 @@ ROM_START( monkeyla ) // MIN BET 1-XXX, % = LEVELS 1-8 ROM_LOAD( "monkeyl_cpucode.key", 0x00, 0x02, NO_DUMP ) ROM_END +ROM_START( speedmst ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "1_s.m._d2.01.c.u23", 0x00000, 0x10000, CRC(f98cdc5f) SHA1(59088d649ec47c94469de3d409d75ab29ebdd4ec) ) // 27C512 + ROM_LOAD16_BYTE( "2_s.m._d2.01.c.u22", 0x00001, 0x10000, CRC(f5017c91) SHA1(fa5e4888ff819dbaa5f10f089c6de2f32b8888ac) ) // 27C512 + ROM_FILL( 0x20000, 0x20000, 0xff ) + + ROM_REGION( 0x1000000, "sprites", 0 ) + ROM_LOAD( "mx29f1610ml.u31", 0x000000, 0x200000, BAD_DUMP CRC(70b33a01) SHA1(d8330c5ff0a47127d00bad313963becf6bc92280) ) // chip wouldn't read, taken from other sets + ROM_RELOAD( 0x200000, 0x200000 ) + ROM_RELOAD( 0x400000, 0x200000 ) + ROM_RELOAD( 0x600000, 0x200000 ) + ROM_RELOAD( 0x800000, 0x200000 ) + ROM_RELOAD( 0xa00000, 0x200000 ) + ROM_RELOAD( 0xc00000, 0x200000 ) + ROM_RELOAD( 0xe00000, 0x200000 ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "5_speed_master.u44", 0x00000, 0x80000, CRC(5eacf25c) SHA1(affbf8176b6cbc406a281793c0a9c79e7175942d) ) // 27C4000 + + ROM_REGION16_LE( 0x80, "eeprom", 0 ) + ROM_LOAD( "93c46.u9", 0x0000, 0x0080, NO_DUMP ) + + ROM_REGION16_LE( 0x02, "astro_cpucode", 0 ) + ROM_LOAD( "speedmst_cpucode.key", 0x00, 0x02, NO_DUMP ) +ROM_END + +ROM_START( speedmsta ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "speed_master_1.u23", 0x00000, 0x10000, CRC(c99200af) SHA1(0573ebc4bd866850aa6c16a0b9db7d7229865dbf) ) // 27C512 + ROM_LOAD16_BYTE( "speed_master_2.u22", 0x00001, 0x10000, CRC(041ff0de) SHA1(63b129605d1c330836fdd5fa8a654f5d20170f0d) ) // 27C512 + ROM_FILL( 0x20000, 0x20000, 0xff ) + + ROM_REGION( 0x1000000, "sprites", 0 ) + ROM_LOAD( "mx29f1610ml.u31", 0x000000, 0x200000, CRC(70b33a01) SHA1(d8330c5ff0a47127d00bad313963becf6bc92280) ) + ROM_RELOAD( 0x200000, 0x200000 ) + ROM_RELOAD( 0x400000, 0x200000 ) + ROM_RELOAD( 0x600000, 0x200000 ) + ROM_RELOAD( 0x800000, 0x200000 ) + ROM_RELOAD( 0xa00000, 0x200000 ) + ROM_RELOAD( 0xc00000, 0x200000 ) + ROM_RELOAD( 0xe00000, 0x200000 ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "5_speed_master.u44", 0x00000, 0x80000, CRC(d2c7025f) SHA1(3337216811c8b81ce72cfdd1ed9eecd4b0622dc7) ) // SLDH, 27C4001 + + ROM_REGION16_LE( 0x80, "eeprom", 0 ) + ROM_LOAD( "93c46.u9", 0x0000, 0x0080, NO_DUMP ) + + ROM_REGION16_LE( 0x02, "astro_cpucode", 0 ) + ROM_LOAD( "speedmsta_cpucode.key", 0x00, 0x02, NO_DUMP ) +ROM_END + +ROM_START( speedmstb ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "1_speed_master_d1.6.u23", 0x00000, 0x10000, CRC(beb8bcb8) SHA1(a06f4cb151ae6e80a4d5335a774be06d2c1feb2b) ) // 27C512 + ROM_LOAD16_BYTE( "2_speed_master_d1.6.u22", 0x00001, 0x10000, CRC(2a0912fd) SHA1(e83bb6f131ea0d6dd5dc8e71e21a76b1f1ba1f09) ) // 27C512 + ROM_FILL( 0x20000, 0x20000, 0xff ) + + ROM_REGION( 0x1000000, "sprites", 0 ) + ROM_LOAD( "mx29f1610ml.u31", 0x000000, 0x200000, CRC(70b33a01) SHA1(d8330c5ff0a47127d00bad313963becf6bc92280) ) + ROM_RELOAD( 0x200000, 0x200000 ) + ROM_RELOAD( 0x400000, 0x200000 ) + ROM_RELOAD( 0x600000, 0x200000 ) + ROM_RELOAD( 0x800000, 0x200000 ) + ROM_RELOAD( 0xa00000, 0x200000 ) + ROM_RELOAD( 0xc00000, 0x200000 ) + ROM_RELOAD( 0xe00000, 0x200000 ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "5_speed_master.u44", 0x00000, 0x80000, CRC(d2c7025f) SHA1(3337216811c8b81ce72cfdd1ed9eecd4b0622dc7) ) // 27C040 + + ROM_REGION16_LE( 0x80, "eeprom", 0 ) + ROM_LOAD( "93c46.u9", 0x0000, 0x0080, NO_DUMP ) + + ROM_REGION16_LE( 0x02, "astro_cpucode", 0 ) + ROM_LOAD( "speedmstb_cpucode.key", 0x00, 0x02, NO_DUMP ) +ROM_END + void astrocorp_state::init_showhand() { #if 0 @@ -2730,41 +2839,9 @@ void zoo_state::init_gostop() #endif } -const zoo_state::decryption_info zoo_state::monkeyl_table = { - { - { - { 8, 9, 10 }, - { - { { 7, 5, 4, 6, 0, 3, 2, 1 }, 0x00 }, - { { 1, 4, 6, 0, 2, 5, 3, 7 }, 0xd0 }, - { { 1, 7, 4, 3, 6, 5, 0, 2 }, 0x88 }, - { { 6, 5, 2, 3, 7, 1, 0, 4 }, 0xd1 }, - { { 6, 1, 7, 2, 4, 0, 3, 5 }, 0x64 }, - { { 1, 7, 2, 6, 5, 4, 3, 0 }, 0x83 }, - { { 6, 7, 4, 2, 5, 0, 1, 3 }, 0x81 }, - { { 7, 5, 1, 0, 2, 4, 6, 3 }, 0xea }, - } - }, - { - { 12, 9, 11 }, - { - { { 6, 5, 4, 3, 2, 1, 0, 7 }, 0x90 }, - { { 2, 4, 0, 7, 5, 6, 3, 1 }, 0x32 }, - { { 7, 1, 0, 6, 5, 2, 3, 4 }, 0xa9 }, - { { 2, 0, 3, 5, 1, 4, 6, 7 }, 0xa2 }, - { { 3, 0, 6, 5, 2, 1, 4, 7 }, 0x02 }, - { { 0, 1, 6, 4, 5, 2, 7, 3 }, 0x30 }, - { { 3, 5, 2, 7, 6, 1, 4, 0 }, 0x0a }, - { { 0, 6, 4, 2, 7, 3, 1, 5 }, 0x81 }, - } - } - }, - { 12, 10, 8, 11, 9, 7, 5, 3, 6, 2, 4 } -}; - void zoo_state::init_monkeyl() { - decrypt_rom(monkeyl_table); + decrypt_rom(zoo_table); #if 1 // TODO: There's more stuff happening for addresses < 0x400... // override reset vector for now @@ -2780,7 +2857,7 @@ void zoo_state::init_monkeyl() void zoo_state::init_monkeyla() { - decrypt_rom(monkeyl_table); + decrypt_rom(zoo_table); #if 1 // TODO: There's more stuff happening for addresses < 0x400... // override reset vector for now @@ -2794,6 +2871,48 @@ void zoo_state::init_monkeyla() #endif } +void zoo_state::init_speedmst() +{ + decrypt_rom(zoo_table); +#if 1 + // TODO: There's more stuff happening for addresses < 0x400... + // override reset vector for now + u16 * const rom = (u16 *)memregion("maincpu")->base(); + rom[0x00004/2] = 0x0000; + rom[0x00006/2] = 0x0400; + + rom[0x08736/2] = 0x4e71; // Mirror ROM word checksum (it expects 0) +#endif +} + +void zoo_state::init_speedmsta() +{ + decrypt_rom(zoo_table); +#if 1 + // TODO: There's more stuff happening for addresses < 0x400... + // override reset vector for now + u16 * const rom = (u16 *)memregion("maincpu")->base(); + rom[0x00004/2] = 0x0000; + rom[0x00006/2] = 0x0400; + + rom[0x086fc/2] = 0x4e71; // Mirror ROM word checksum (it expects 0) +#endif +} + +void zoo_state::init_speedmstb() +{ + decrypt_rom(zoo_table); +#if 1 + // TODO: There's more stuff happening for addresses < 0x400... + // override reset vector for now + u16 * const rom = (u16 *)memregion("maincpu")->base(); + rom[0x00004/2] = 0x0000; + rom[0x00006/2] = 0x0400; + + rom[0x0871a/2] = 0x4e71; // Mirror ROM word checksum (it expects 0) +#endif +} + const astoneag_state::decryption_info astoneag_state::astoneag_table = { { { @@ -2856,7 +2975,7 @@ void astoneag_state::interleave_sprites_16x32() rom[i] = tmp[(i & ~0xff) | (bitswap<8>(i, 7,6,5, 3,2,1, 4, 0) ^ 2)]; } -} // Anonymous namespace +} // anonymous namespace // YEAR NAME PARENT MACHINE INPUTS STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT GAMEL( 2000, showhand, 0, showhand, showhand, astrocorp_state, init_showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", MACHINE_SUPPORTS_SAVE, layout_showhand ) @@ -2886,6 +3005,9 @@ GAME( 2004, monkeyla, monkeyl, monkeyl, magibombd, zoo_state, init_m GAMEL( 2005, magibombd, magibomb, magibombd, magibombd, zoo_state, init_magibombd, ROT0, "Astro Corp.", "Magic Bomb (Ver. AA.72.D, 14/11/05)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_magibombb ) // 15/11/05 09:31 GAMEL( 2005, magibombj, magibomb, magibombd, magibombd, zoo_state, init_magibombd, ROT0, "Astro Corp.", "Magic Bomb (Ver. AA.72.C, 25/05/05)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_magibombb ) // 25/05/05 11:26 GAMEL( 2004, magibombg, magibomb, magibombg, magibombg, zoo_state, init_magibombg, ROT0, "Astro Corp.", "Magic Bomb (Ver. NB6.1, 26/04/04)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_magibomb ) // 26/04/04. Undumped sprite ROM +GAMEL( 2004, speedmst, 0, speedmst, magibombg, zoo_state, init_speedmst, ROT0, "D2 Enterprises", "Speed Master (Ver. V1.0, Apr 29 2004)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING, layout_magibomb ) // Apr 29 2004 16:29:35 +GAMEL( 2003, speedmsta, speedmst, speedmst, magibombg, zoo_state, init_speedmsta, ROT0, "D2 Enterprises", "Speed Master (Ver. V1.0, May 23 2003)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING, layout_magibomb ) // May 23 2003 16:38:02 +GAMEL( 2003, speedmstb, speedmst, speedmst, magibombg, zoo_state, init_speedmstb, ROT0, "D2 Enterprises", "Speed Master (Ver. V1.0, Apr 28 2004)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING, layout_magibomb ) // Apr 28 2004 17:21:26 GAMEL( 2006, winbingo, 0, winbingo, winbingo, zoo_state, init_winbingo, ROT0, "Astro Corp.", "Win Win Bingo (Ver. GM.03.3, Feb 23 2006)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION, layout_winbingo ) // 15:47:48 Feb 23 2006 GAMEL( 2006, winbingoa, winbingo, winbingo, winbingo, zoo_state, init_winbingoa, ROT0, "Astro Corp.", "Win Win Bingo (Ver. GM.05.1, May 11 2006)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_winbingo ) // 11:02:07 May 11 2006. Undumped sprite ROMs GAMEL( 2005, hacher, winbingo, hacher, winbingo, zoo_state, init_hacher, ROT0, "bootleg (Gametron)", "Hacher (hack of Win Win Bingo EN.01.6)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS, layout_winbingo ) // 14:25:46 Mar 10 2005. One bad sprite ROM diff --git a/src/mame/misc/astropc.cpp b/src/mame/misc/astropc.cpp index a50901396ccf0..369a1765532af 100644 --- a/src/mame/misc/astropc.cpp +++ b/src/mame/misc/astropc.cpp @@ -19,6 +19,9 @@ It appears to contain 508 bytes of XOR-encrypted code which is decrypted by the game's executable. See the "ProtectCode" function, which writes the decrypted "PutJtx" function into the program in memory. +TODO: +- (with basic VGA core hooked up) hangs at Astro logo, attempts to write in the $cxxxx range (UMA?) + Known games Title Dumped Notes @@ -44,8 +47,21 @@ Hawaii YES #include "emu.h" + +#include "bus/isa/isa_cards.h" +#include "bus/pci/rivatnt.h" #include "cpu/i386/i386.h" +#include "machine/8042kbdc.h" +#include "machine/mc146818.h" +#include "machine/mediagx_cs5530_bridge.h" +#include "machine/mediagx_cs5530_ide.h" +#include "machine/mediagx_host.h" +#include "machine/pci.h" +#include "machine/zfmicro_usb.h" +#include "screen.h" + +#define ENABLE_VGA 0 namespace { @@ -53,8 +69,10 @@ class astropc_state : public driver_device { public: astropc_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_rtc(*this, "rtc") + , m_kbdc(*this, "kbdc") { } void astropc(machine_config &config); @@ -62,20 +80,19 @@ class astropc_state : public driver_device void init_astropc(); private: - void astropc_io(address_map &map); - void astropc_map(address_map &map); + void main_map(address_map &map); + void main_io(address_map &map); - // devices required_device m_maincpu; + required_device m_rtc; + required_device m_kbdc; }; -void astropc_state::astropc_map(address_map &map) +void astropc_state::main_map(address_map &map) { - map(0x000c0000, 0x000fffff).rom().region("bios", 0); - map(0xfffc0000, 0xffffffff).rom().region("bios", 0); } -void astropc_state::astropc_io(address_map &map) +void astropc_state::main_io(address_map &map) { } @@ -84,13 +101,62 @@ static INPUT_PORTS_START( astropc ) INPUT_PORTS_END - void astropc_state::astropc(machine_config &config) { - /* basic machine hardware */ - I486(config, m_maincpu, 40000000 ); // ?? - m_maincpu->set_addrmap(AS_PROGRAM, &astropc_state::astropc_map); - m_maincpu->set_addrmap(AS_IO, &astropc_state::astropc_io); + MEDIAGX(config, m_maincpu, 233'000'000); // Cyrix MediaGX GXm-266GP + m_maincpu->set_addrmap(AS_PROGRAM, &astropc_state::main_map); + m_maincpu->set_addrmap(AS_IO, &astropc_state::main_io); + m_maincpu->set_irq_acknowledge_callback("pci:12.0:pic8259_master", FUNC(pic8259_device::inta_cb)); + + // TODO: copied from misc/matrix.cpp, verify if this has a working super I/O + DS1287(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->set_binary(true); + m_rtc->set_epoch(1980); + m_rtc->irq().set("pci:12.0", FUNC(mediagx_cs5530_bridge_device::pc_irq8n_w)); + + KBDC8042(config, m_kbdc, 0); + // TODO: PS/2 mouse + m_kbdc->set_keyboard_type(kbdc8042_device::KBDC8042_STANDARD); + m_kbdc->system_reset_callback().set_inputline(":maincpu", INPUT_LINE_RESET); + m_kbdc->gate_a20_callback().set_inputline(":maincpu", INPUT_LINE_A20); + m_kbdc->input_buffer_full_callback().set(":pci:12.0", FUNC(mediagx_cs5530_bridge_device::pc_irq1_w)); + m_kbdc->set_keyboard_tag("at_keyboard"); + + at_keyboard_device &at_keyb(AT_KEYB(config, "at_keyboard", pc_keyboard_device::KEYBOARD_TYPE::AT, 1)); + at_keyb.keypress().set(m_kbdc, FUNC(kbdc8042_device::keyboard_w)); + + PCI_ROOT(config, "pci", 0); + MEDIAGX_HOST(config, "pci:00.0", 0, "maincpu", 128*1024*1024); + // TODO: again copied from misc/matrix.cpp, verify usage here + PCI_BRIDGE(config, "pci:01.0", 0, 0x10780000, 0); +#if ENABLE_VGA + // NOTE: most MediaGX boards don't even provide an AGP port, at best you get PCI slots. + PCI_SLOT(config, "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt").set_fixed(true); +#endif + + // "pci:12.0" or "pci:10.0" depending on pin H26 (readable in bridge thru PCI index $44) + mediagx_cs5530_bridge_device &isa(MEDIAGX_CS5530_BRIDGE(config, "pci:12.0", 0, "maincpu", "pci:12.2")); + isa.set_kbdc_tag("kbdc"); + isa.boot_state_hook().set([](u8 data) { /* printf("%02x\n", data); */ }); + //isa.smi().set_inputline("maincpu", INPUT_LINE_SMI); + isa.rtcale().set([this](u8 data) { m_rtc->address_w(data); }); + isa.rtccs_read().set([this]() { return m_rtc->data_r(); }); + isa.rtccs_write().set([this](u8 data) { m_rtc->data_w(data); }); + + // "pci:12.1" SMI & ACPI + + mediagx_cs5530_ide_device &ide(MEDIAGX_CS5530_IDE(config, "pci:12.2", 0, "maincpu")); + ide.irq_pri().set("pci:12.0", FUNC(mediagx_cs5530_bridge_device::pc_irq14_w)); + ide.irq_sec().set("pci:12.0", FUNC(mediagx_cs5530_bridge_device::pc_irq15_w)); + + // "pci:12.3" XpressAUDIO + // "pci:12.4" XpressVIDEO + + ZFMICRO_USB(config, "pci:13.0", 0); + + // 2 PCI slots, 2 ISA slots + ISA16_SLOT(config, "isa1", 0, "pci:12.0:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa2", 0, "pci:12.0:isabus", pc_isa16_cards, nullptr, false); } @@ -98,7 +164,7 @@ ROM_START( blackbd ) // Название игры : BLACK BEARD GAMES // Тип игры : Многолинейный видео-слот // Разработчик : ASTRO CORP. - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -115,7 +181,7 @@ ROM_END ROM_START( blackbda ) - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -132,7 +198,7 @@ ROM_START( blackbdb ) // Название игры : BLACK BEARD GAMES // Тип игры : Многолинейный видео-слот // Разработчик : ASTRO CORP. - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -152,7 +218,7 @@ ROM_START( dslayrr ) // VERMAJOR = 15 // VERMINOR = B // RELEASE = 1 - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -172,7 +238,7 @@ ROM_START( dslayrra ) // VERMAJOR = 16 // VERMINOR = B // RELEASE = 1 - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -187,7 +253,7 @@ ROM_START( hawaii ) // GAME NAME : HAWAII GAMES // GAME TYPE : MULTI-LINER // DEVELOPER : ASTRO CORP. - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -202,7 +268,7 @@ ROM_START( oligam ) // GAME NAME : OLYMPIAN GAMES // GAME TYPE : MULTI-LINER // DEVELOPER : ASTRO CORP. - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) @@ -217,7 +283,7 @@ ROM_START( rasce ) // GAME NAME : RA'S SCEPTER GAMES // GAME TYPE : MULTI-LINER // DEVELOPER : ASTRO CORP. - ROM_REGION32_LE(0x40000, "bios", 0) /* motherboard bios */ // wasn't in this set! + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ // wasn't in this set! ROM_LOAD( "bios.002", 0x0000, 0x040000, CRC(45333544) SHA1(bcc03b4f77b2e447192a1e5ed9f4cc09d0289714) ) ROM_REGION(0x20000, "rom", 0) diff --git a/src/mame/misc/coinmvga.cpp b/src/mame/misc/coinmvga.cpp index 7114281c1f50e..8d2bf031e9092 100644 --- a/src/mame/misc/coinmvga.cpp +++ b/src/mame/misc/coinmvga.cpp @@ -219,12 +219,14 @@ *******************************************************************************/ #include "emu.h" + #include "cpu/h8/h83002.h" //#include "cpu/h8/h83006.h" #include "sound/ymz280b.h" #include "machine/i2cmem.h" #include "machine/msm6242.h" #include "video/ramdac.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -250,9 +252,6 @@ class coinmvga_state : public driver_device , m_palette(*this, "palette%u", 0U) { } - void init_colorama(); - void init_cmrltv75(); - void coinmvga(machine_config &config); protected: @@ -938,19 +937,6 @@ ROM_START( cmkenospa ) ROM_LOAD( "rwc497ym.sp4", 0x300000, 0x100000, CRC(b5729ae7) SHA1(0e63fbb81ff5f2fef3c653f769db8073dff1214b) ) ROM_END - -/************************* -* Driver Init * -*************************/ - -void coinmvga_state::init_colorama() -{ -} - -void coinmvga_state::init_cmrltv75() -{ -} - } // anonymous namespace @@ -958,11 +944,11 @@ void coinmvga_state::init_cmrltv75() * Game Drivers * *************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 2000, colorama, 0, coinmvga, coinmvga, coinmvga_state, init_colorama, ROT0, "Coinmaster-Gaming, Ltd.", "Colorama (P521, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2000, coloramas, colorama, coinmvga, coinmvga, coinmvga_state, init_colorama, ROT0, "Coinmaster-Gaming, Ltd.", "Colorama (P521 V13, Spanish)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2000, wof_v16, 0, coinmvga, coinmvga, coinmvga_state, init_colorama, ROT0, "Coinmaster-Gaming, Ltd.", "Wheel of Fortune (P517 V16, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2000, wof_v11, wof_v16, coinmvga, coinmvga, coinmvga_state, init_colorama, ROT0, "Coinmaster-Gaming, Ltd.", "Wheel of Fortune (P517 V11, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2001, cmrltv75, 0, coinmvga, coinmvga, coinmvga_state, init_cmrltv75, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Roulette P497 V75 (Y2K, Spanish)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2000, cmkenosp, 0, coinmvga, coinmvga, coinmvga_state, empty_init, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Keno (Y2K, Spanish, 2000-12-14)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2000, cmkenospa, cmkenosp, coinmvga, coinmvga, coinmvga_state, empty_init, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Keno (Y2K, Spanish, 2000-12-02)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 2000, colorama, 0, coinmvga, coinmvga, coinmvga_state, empty_init, ROT0, "Coinmaster-Gaming, Ltd.", "Colorama (P521, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2000, coloramas, colorama, coinmvga, coinmvga, coinmvga_state, empty_init, ROT0, "Coinmaster-Gaming, Ltd.", "Colorama (P521 V13, Spanish)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2000, wof_v16, 0, coinmvga, coinmvga, coinmvga_state, empty_init, ROT0, "Coinmaster-Gaming, Ltd.", "Wheel of Fortune (P517 V16, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2000, wof_v11, wof_v16, coinmvga, coinmvga, coinmvga_state, empty_init, ROT0, "Coinmaster-Gaming, Ltd.", "Wheel of Fortune (P517 V11, English)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2001, cmrltv75, 0, coinmvga, coinmvga, coinmvga_state, empty_init, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Roulette P497 V75 (Y2K, Spanish)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2000, cmkenosp, 0, coinmvga, coinmvga, coinmvga_state, empty_init, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Keno (Y2K, Spanish, 2000-12-14)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2000, cmkenospa, cmkenosp, coinmvga, coinmvga, coinmvga_state, empty_init, ROT90, "Coinmaster-Gaming, Ltd.", "Coinmaster Keno (Y2K, Spanish, 2000-12-02)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/misc/ez2d.cpp b/src/mame/misc/ez2d.cpp index 413969222f9b1..df40993618a29 100644 --- a/src/mame/misc/ez2d.cpp +++ b/src/mame/misc/ez2d.cpp @@ -7,7 +7,6 @@ $3a000 contains an "= Award Decompression BIOS =" header. Original ASUS CUBX BIOSes actually have valid opcodes in that range, the dump should be bad. - ASUS CUBX fails reading RTC, needs virtualizing thru ISA. -- Needs Riva TNT2 to be a proper PCI device; - In pcipc ez2d2m HDD boots to a Korean Windows 98SE, it will error out with a "Error 7 : Set up the system correctly." after driver installation. Follows dump heuristics: @@ -189,14 +188,14 @@ void ez2d_state::cubx(machine_config &config) serport1.cts_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::ncts2_w)); #endif - PCI_SLOT(config, "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt").set_fixed(true); + PCI_SLOT(config, "pci:01.0:1", agp_cards, 0, 0, 1, 2, 3, "rivatnt").set_fixed(true); } void ez2d_state::ez2d(machine_config &config) { ez2d_state::cubx(config); - PCI_SLOT(config.replace(), "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt2_m64").set_fixed(true); + PCI_SLOT(config.replace(), "pci:01.0:1", agp_cards, 0, 0, 1, 2, 3, "rivatnt2_m64").set_fixed(true); // TODO: Sound Blaster Live CT4830 } diff --git a/src/mame/misc/gammagic.cpp b/src/mame/misc/gammagic.cpp index b5e7088d4fc0c..a5646d132772e 100644 --- a/src/mame/misc/gammagic.cpp +++ b/src/mame/misc/gammagic.cpp @@ -55,16 +55,9 @@ Additional CD-ROM games: "99 Bottles of Beer" #include "bus/rs232/terminal.h" #include "cpu/i386/i386.h" #include "machine/fdc37c93x.h" -#include "machine/i82371eb_acpi.h" -#include "machine/i82371eb_ide.h" -#include "machine/i82371eb_isa.h" -#include "machine/i82371eb_usb.h" #include "machine/i82371sb.h" #include "machine/i82439hx.h" -#include "machine/i82439tx.h" -#include "machine/i82443bx_host.h" #include "machine/pci.h" -#include "machine/pci-ide.h" #include "video/voodoo_pci.h" namespace { @@ -178,7 +171,7 @@ void gammagic_state::gammagic(machine_config &config) ISA16_SLOT(config, "isa3", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa4", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); - rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); // "microsoft_mouse")); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); serport0.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd1_w)); serport0.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd1_w)); serport0.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr1_w)); diff --git a/src/mame/misc/itgamble.cpp b/src/mame/misc/itgamble.cpp index 17e9d189c9a18..7524005c5db0c 100644 --- a/src/mame/misc/itgamble.cpp +++ b/src/mame/misc/itgamble.cpp @@ -4,7 +4,7 @@ Nazionale Elettronica + others (mostly Italian) Gambling games mostly based on H8/3048 + OKI 6295 or similar. -. + These all use MCUs with internal ROM for their programs, they can't be dumped easily, and thus we can't emulate them at the moment because there is nothing to emulate diff --git a/src/mame/misc/matrix.cpp b/src/mame/misc/matrix.cpp index 5146648d653c0..027070d451e2d 100644 --- a/src/mame/misc/matrix.cpp +++ b/src/mame/misc/matrix.cpp @@ -79,7 +79,6 @@ INPUT_PORTS_END void matrix_state::matrix(machine_config &config) { - // basic machine hardware MEDIAGX(config, m_maincpu, 233'000'000); // Cyrix MediaGX GXm-266GP m_maincpu->set_addrmap(AS_PROGRAM, &matrix_state::main_map); m_maincpu->set_irq_acknowledge_callback("pci:12.0:pic8259_master", FUNC(pic8259_device::inta_cb)); diff --git a/src/mame/misc/odyssey.cpp b/src/mame/misc/odyssey.cpp index d5500819c30d3..94048f0e2b277 100644 --- a/src/mame/misc/odyssey.cpp +++ b/src/mame/misc/odyssey.cpp @@ -10,8 +10,9 @@ TODO: - bp f7ae6,1,{eip+=0xf;g} fails ISA state $0f; - - Accesses S3 video in Old MMIO mode, draws 32-bit color mode GFXs; - - Hangs after playing with LPT1; + - Accesses S3 video in New MMIO mode, core fumbles on video mode setup + (prepares linear for 32bpp, core sets SVGA 8bpp instead) + - Hangs after playing with LPT1 & IDE checks; ******************************************************************************* @@ -78,12 +79,12 @@ #include "machine/i82371sb.h" #include "machine/i82439hx.h" #include "bus/isa/isa_cards.h" -#include "bus/pci/virge_pci.h" +#include "bus/pci/vision.h" //#include "bus/rs232/hlemouse.h" //#include "bus/rs232/null_modem.h" -//#include "bus/rs232/rs232.h" +#include "bus/rs232/rs232.h" //#include "bus/rs232/sun_kbd.h" -//#include "bus/rs232/terminal.h" +#include "bus/rs232/terminal.h" #include "machine/pc87306.h" @@ -136,17 +137,14 @@ void odyssey_state::national_superio_config(device_t *device) fdc.gp25_gatea20().set_inputline(":maincpu", INPUT_LINE_A20); fdc.irq1().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq1_w)); fdc.irq8().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq8n_w)); -#if 0 fdc.txd1().set(":serport0", FUNC(rs232_port_device::write_txd)); fdc.ndtr1().set(":serport0", FUNC(rs232_port_device::write_dtr)); fdc.nrts1().set(":serport0", FUNC(rs232_port_device::write_rts)); fdc.txd2().set(":serport1", FUNC(rs232_port_device::write_txd)); fdc.ndtr2().set(":serport1", FUNC(rs232_port_device::write_dtr)); fdc.nrts2().set(":serport1", FUNC(rs232_port_device::write_rts)); -#endif } -#if 0 static void isa_com(device_slot_interface &device) { // device.option_add("microsoft_mouse", MSFT_HLE_SERIAL_MOUSE); @@ -154,11 +152,10 @@ static void isa_com(device_slot_interface &device) // device.option_add("wheel_mouse", WHEEL_HLE_SERIAL_MOUSE); // device.option_add("msystems_mouse", MSYSTEMS_HLE_SERIAL_MOUSE); // device.option_add("rotatable_mouse", ROTATABLE_HLE_SERIAL_MOUSE); -// device.option_add("terminal", SERIAL_TERMINAL); + device.option_add("terminal", SERIAL_TERMINAL); // device.option_add("null_modem", NULL_MODEM); // device.option_add("sun_kbd", SUN_KBD_ADAPTOR); } -#endif // This emulates a Tucson / Triton-II chipset, earlier i430fx TBD // PCI config space is trusted by Intel TC430HX "Technical Product Specification" page 39 @@ -188,8 +185,7 @@ void odyssey_state::odyssey(machine_config &config) // TODO: 82371FB USB at 07.2 // On-board S3 Vision 968 - // FIXME: replace once we have a core for it - VIRGE_PCI(config, "pci:08.0", 0); + VISION968_PCI(config, "pci:08.0", 0); // pci:0d.0 (J4E1) PCI expansion slot 1 //PCI_SLOT(config, "pci:1", pci_cards, 13, 0, 1, 2, 3, nullptr); @@ -210,21 +206,19 @@ void odyssey_state::odyssey(machine_config &config) ISA16_SLOT(config, "isa4", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa5", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); -#if 0 - rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); // "microsoft_mouse")); - serport0.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd1_w)); - serport0.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd1_w)); - serport0.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr1_w)); - serport0.ri_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::nri1_w)); - serport0.cts_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ncts1_w)); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); + serport0.rxd_handler().set("board4:pc87306", FUNC(pc87306_device::rxd1_w)); + serport0.dcd_handler().set("board4:pc87306", FUNC(pc87306_device::ndcd1_w)); + serport0.dsr_handler().set("board4:pc87306", FUNC(pc87306_device::ndsr1_w)); + serport0.ri_handler().set("board4:pc87306", FUNC(pc87306_device::nri1_w)); + serport0.cts_handler().set("board4:pc87306", FUNC(pc87306_device::ncts1_w)); rs232_port_device &serport1(RS232_PORT(config, "serport1", isa_com, nullptr)); - serport1.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd2_w)); - serport1.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd2_w)); - serport1.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr2_w)); - serport1.ri_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::nri2_w)); - serport1.cts_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ncts2_w)); -#endif + serport1.rxd_handler().set("board4:pc87306", FUNC(pc87306_device::rxd2_w)); + serport1.dcd_handler().set("board4:pc87306", FUNC(pc87306_device::ndcd2_w)); + serport1.dsr_handler().set("board4:pc87306", FUNC(pc87306_device::ndsr2_w)); + serport1.ri_handler().set("board4:pc87306", FUNC(pc87306_device::nri2_w)); + serport1.cts_handler().set("board4:pc87306", FUNC(pc87306_device::ncts2_w)); } @@ -290,4 +284,4 @@ ROM_END **************************************/ /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 1998, odyssey, 0, odyssey, odyssey, odyssey_state, empty_init, ROT0, "Silicon Gaming", "Odyssey", MACHINE_IS_SKELETON ) +GAME( 1998, odyssey, 0, odyssey, odyssey, odyssey_state, empty_init, ROT270, "Silicon Gaming", "Odyssey", MACHINE_IS_SKELETON ) diff --git a/src/mame/misc/rawthrillspc.cpp b/src/mame/misc/rawthrillspc.cpp index f4e64b32d85d5..708fc4dd68c38 100644 --- a/src/mame/misc/rawthrillspc.cpp +++ b/src/mame/misc/rawthrillspc.cpp @@ -147,5 +147,5 @@ ROM_END } // Anonymous namespace GAME(2013, doodlejmp, 0, rawthrillspc, rawthrillspc, rawthrillspc_state, empty_init, ROT0, "ICE / Raw Thrills (Lima Sky license)", "Doodle Jump Arcade (v1.16)", MACHINE_IS_SKELETON) -GAME(2004, fnf, 0, rawthrillspc, rawthrillspc, rawthrillspc_state, empty_init, ROT0, "Raw Thrills", "The Fast And The Furious (v3.06)", MACHINE_IS_SKELETON) +GAME(2004, fnf, 0, rawthrillspc, rawthrillspc, rawthrillspc_state, empty_init, ROT0, "Raw Thrills", "The Fast And The Furious (v3.06)", MACHINE_IS_SKELETON) GAME(2008, guitarheroac, 0, rawthrillspc, rawthrillspc, rawthrillspc_state, empty_init, ROT0, "Raw Thrills (Activision / Konami license)", "Guitar Hero Arcade (v1.0.5)", MACHINE_IS_SKELETON) diff --git a/src/mame/misc/savquest.cpp b/src/mame/misc/savquest.cpp index 103e9dfa5698e..a59d87baa974f 100644 --- a/src/mame/misc/savquest.cpp +++ b/src/mame/misc/savquest.cpp @@ -112,7 +112,7 @@ class savquest_state : public pcat_base_state std::unique_ptr m_smram; - required_device m_vga; + required_device m_vga; required_device m_voodoo; int m_haspind = 0; @@ -788,7 +788,7 @@ void savquest_state::savquest_io(address_map &map) map(0x0170, 0x0177).rw("ide2", FUNC(ide_controller_32_device::cs0_r), FUNC(ide_controller_32_device::cs0_w)); map(0x01f0, 0x01f7).rw("ide", FUNC(ide_controller_32_device::cs0_r), FUNC(ide_controller_32_device::cs0_w)); map(0x0378, 0x037b).rw(FUNC(savquest_state::parallel_port_r), FUNC(savquest_state::parallel_port_w)); - map(0x03b0, 0x03df).m("vga", FUNC(s3_vga_device::io_map)); + map(0x03b0, 0x03df).m("vga", FUNC(s3trio64_vga_device::io_map)); map(0x0370, 0x0377).rw("ide2", FUNC(ide_controller_32_device::cs1_r), FUNC(ide_controller_32_device::cs1_w)); map(0x03f0, 0x03f7).rw("ide", FUNC(ide_controller_32_device::cs1_r), FUNC(ide_controller_32_device::cs1_w)); @@ -871,9 +871,9 @@ void savquest_state::savquest(machine_config &config) // TODO: map to ISA bus, make sure that the Voodoo can override s3 in screen update screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(25.1748_MHz_XTAL, 900, 0, 640, 526, 0, 480); - screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update)); + screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update)); - s3_vga_device &vga(S3_VGA(config, "vga", 0)); + s3trio64_vga_device &vga(S3_TRIO64_VGA(config, "vga", 0)); vga.set_screen("screen"); vga.set_vram_size(0x100000); diff --git a/src/mame/misc/wms.cpp b/src/mame/misc/wms.cpp index d4d6099610492..e4a661f45afad 100644 --- a/src/mame/misc/wms.cpp +++ b/src/mame/misc/wms.cpp @@ -349,6 +349,19 @@ ROM_START( inwinner ) // Instant Winner (Russian) / U5 11/25/98 ROM_LOAD( "xu-18.bin", 0x0000, 0x100000, CRC(8a42ac41) SHA1(3e56e369938d4789d4677f8ad0a7c0e1eb38942d) ) ROM_END +ROM_START( inwinners ) // Instant Winner (Spanish) + ROM_REGION(0x100000, "maincpu", 0) + ROM_LOAD( "instant_winner_xu3_spanish.bin", 0x0000, 0x100000, CRC(8c3f81bb) SHA1(ae1722763f5b9d2a1b72f3889752979af150b8b0) ) + + ROM_REGION(0x100000, "rom", 0) + ROM_LOAD( "instant_winner_xu2_spanish.bin", 0x0000, 0x100000, CRC(54895461) SHA1(6b2cb92fc82ddbe96924758c130e271848bf5b0b) ) + // sound + ROM_LOAD( "instant_winner_xu30_spanish.bin", 0x0000, 0x100000, CRC(c2e6f321) SHA1(e4251b0c42fd03932cd94d18edca8d33a42d9670) ) + ROM_LOAD( "instant_winner_xu31_spanish.bin", 0x0000, 0x100000, CRC(9dcd7705) SHA1(8c543b4be6e51edfc512c2449086e418f8d32310) ) + ROM_LOAD( "instant_winner_xu17_spanish.bin", 0x0000, 0x100000, CRC(8cbf7b46) SHA1(b95fbd1c11bbbb2e97a06e541442bd5c396b500f) ) + ROM_LOAD( "instant_winner_xu18_spanish.bin", 0x0000, 0x100000, CRC(906451f6) SHA1(9da2ff04d28632fd68ab08cb3786aa19b904fdc9) ) +ROM_END + ROM_START( jptparty ) // Jackpot Party (Russian) / U5 04/01/98 ROM_REGION(0x100000, "maincpu", 0) @@ -650,6 +663,7 @@ GAME( 1997, filthyrr, filthyr, wms, wms, wms_state, init_wms, ROT0, GAME( 2003, hottop, 0, wms, wms, wms_state, init_wms, ROT0, "WMS", "Hot Toppings (English)", MACHINE_IS_SKELETON ) // U5 04/22/103 GAME( 2001, hottopa, hottop, wms, wms, wms_state, init_wms, ROT0, "WMS", "Hot Toppings (Russian?)", MACHINE_IS_SKELETON ) // U5 06/26/101 GAME( 1998, inwinner, 0, wms, wms, wms_state, init_wms, ROT0, "WMS", "Instant Winner (Russian)", MACHINE_IS_SKELETON ) // U5 11/25/98 +GAME( 1998, inwinners, inwinner, wms, wms, wms_state, init_wms, ROT0, "WMS", "Instant Winner (Spanish)", MACHINE_IS_SKELETON ) // ??? GAME( 1998, jptparty, 0, wms, wms, wms_state, init_wms, ROT0, "WMS", "Jackpot Party (Russian)", MACHINE_IS_SKELETON ) // U5 04/01/98 GAME( 2001, leprgld, 0, wms, wms, wms_state, init_wms, ROT0, "WMS", "Leprechaun's Gold (Russian)", MACHINE_IS_SKELETON ) // U5 08/20/101 GAME( 2001, leprglds, leprgld, wms, wms, wms_state, init_wms, ROT0, "WMS", "Leprechaun's Gold (Spanish)", MACHINE_IS_SKELETON ) // U5 08/20/101 diff --git a/src/mame/namco/namcos2.cpp b/src/mame/namco/namcos2.cpp index 7cef91669bcec..a61313a303a2b 100644 --- a/src/mame/namco/namcos2.cpp +++ b/src/mame/namco/namcos2.cpp @@ -2426,6 +2426,9 @@ ROM_START( cosmogng ) ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ ROM_LOAD16_BYTE( "co2voi1.bin", 0x000000, 0x080000, CRC(5a301349) SHA1(e333ea5955a66ac8d7c94cd50047efaf6fa95b15) ) ROM_LOAD16_BYTE( "co2voi2.bin", 0x100000, 0x080000, CRC(a27cb45a) SHA1(08ccaaf43369e8358e31b213877829bdfd61479e) ) + + ROM_REGION( 0x2000, "user2", 0 ) /* zoom */ + ROM_LOAD( "04544191.6n", 0, 0x2000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) ROM_END /* COSMO GANG THE VIDEO (JAPAN) */ @@ -2469,6 +2472,9 @@ ROM_START( cosmogngj ) ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ ROM_LOAD16_BYTE( "co1voi1.bin", 0x000000, 0x080000, CRC(b5ba8f15) SHA1(9e54b9ba1cd44353782adf337376dff9eec4e937) ) ROM_LOAD16_BYTE( "co1voi2.bin", 0x100000, 0x080000, CRC(b566b105) SHA1(b5530b0f3dea0135f28419044aee923d855f382c) ) + + ROM_REGION( 0x2000, "user2", 0 ) /* zoom */ + ROM_LOAD( "04544191.6n", 0, 0x2000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) ROM_END /* DIRT FOX (JAPAN) */ diff --git a/src/mame/namco/namcos23.cpp b/src/mame/namco/namcos23.cpp index bfc88453a04a7..07884d40f1e3e 100644 --- a/src/mame/namco/namcos23.cpp +++ b/src/mame/namco/namcos23.cpp @@ -3365,7 +3365,7 @@ void namcos23_state::s23iobrdmap(address_map &map) { map(0x0000, 0x1fff).rom().region("iocpu", 0); map(0x6000, 0x6001).portr("IN01"); - map(0x6002, 0x6003).portr("IN23"); + map(0x6002, 0x6003).portr("IN23").nopw(); map(0x6004, 0x6005).nopw(); map(0x6006, 0x6007).noprw(); map(0xc000, 0xfb7f).ram(); diff --git a/src/mame/nintendo/nes_clone.cpp b/src/mame/nintendo/nes_clone.cpp index 4b3a7364f3203..38c5149cd2289 100644 --- a/src/mame/nintendo/nes_clone.cpp +++ b/src/mame/nintendo/nes_clone.cpp @@ -1311,6 +1311,11 @@ ROM_START( dnce2000 ) // use Mapper 241 if you want to run this in a NES emulato ROM_LOAD( "dance.bin", 0x00000, 0x40000, CRC(0982bb50) SHA1(bd608159d7e624ea345f2a188de51cb1aa116421) ) ROM_END +ROM_START( croaky ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD( "croakykaraoke_16in1.bin", 0x00000, 0x80000, CRC(5f939fd6) SHA1(9dd56b1ee5f27a7d9b42c2638c6a06fac5554c9b) ) +ROM_END + ROM_START( vtvppong ) ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASE00 ) // high bit is never set in the first 0x28000 bytes of this ROM, probably 7-bit sound data? code might need opcode bits swapping ROM_LOAD( "vtvpongcpu.bin", 0x00000, 0x40000, CRC(52df95fa) SHA1(3015bcc90eee862b3568f122b402c9defa566aab) ) @@ -1369,6 +1374,8 @@ CONS( 2004, afbm7800, 0, 0, nes_clone_afbm7800, nes_clone, nes_clone_afbm7 CONS( 200?, dnce2000, 0, 0, nes_clone_dnce2000, dnce2000, nes_clone_dnce2000_state, init_nes_clone, "Shenzhen Soyin Electric Appliance Ind. Co., Ltd.", "Dance 2000 / Hot 2000 (Jin Bao TV Dancing Carpet, SY-2000-04)", 0 ) +CONS( 2002, croaky, 0, 0, nes_clone_dnce2000, nes_clone, nes_clone_dnce2000_state, init_nes_clone, "", "Croaky Karaoke 16-in-1", MACHINE_NOT_WORKING ) // no inputs + // 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 // Alt. version was released with 'New York Times' titlescreen diff --git a/src/mame/novadesitec/novadesitec_fr004.cpp b/src/mame/novadesitec/novadesitec_fr004.cpp index 969ef00e04014..58204f9691da6 100644 --- a/src/mame/novadesitec/novadesitec_fr004.cpp +++ b/src/mame/novadesitec/novadesitec_fr004.cpp @@ -19,7 +19,7 @@ Not much can be done until the MCU is somehow dumped. #include "emu.h" -#include "cpu/h8/h8s2320.h" +#include "cpu/h8/h8s2319.h" #include "sound/okim6376.h" #include "screen.h" @@ -92,7 +92,7 @@ INPUT_PORTS_END void novadesitec_fr004_state::fr004(machine_config &config) { // basic machine hardware - H8S2328(config, m_maincpu, 50_MHz_XTAL); // actually H8S2318, divisor? + H8S2318(config, m_maincpu, 50_MHz_XTAL); // divisor? m_maincpu->set_addrmap(AS_PROGRAM, &novadesitec_fr004_state::main_map); // video hardware diff --git a/src/mame/novadesitec/novadesitec_fr009.cpp b/src/mame/novadesitec/novadesitec_fr009.cpp index 77739fc79e3d4..20dd6f584da35 100644 --- a/src/mame/novadesitec/novadesitec_fr009.cpp +++ b/src/mame/novadesitec/novadesitec_fr009.cpp @@ -19,7 +19,7 @@ Not much can be done until the MCU is somehow dumped. #include "emu.h" -#include "cpu/h8/h8s2320.h" +#include "cpu/h8/h8s2319.h" #include "screen.h" #include "speaker.h" @@ -91,7 +91,7 @@ INPUT_PORTS_END void novadesitec_fr009_state::fr009(machine_config &config) { // basic machine hardware - H8S2328(config, m_maincpu, 32_MHz_XTAL); // actually H8S2318, divisor? + H8S2318(config, m_maincpu, 32_MHz_XTAL); // divisor? m_maincpu->set_addrmap(AS_PROGRAM, &novadesitec_fr009_state::main_map); // video hardware diff --git a/src/mame/novag/mentor16.cpp b/src/mame/novag/mentor16.cpp index 5e8db50f62872..1076df1cd99c8 100644 --- a/src/mame/novag/mentor16.cpp +++ b/src/mame/novag/mentor16.cpp @@ -179,19 +179,18 @@ void mentor16_state::update_piezo(s32 param) void mentor16_state::p2_w(u8 data) { // P20-P27: input mux, led data - m_inp_mux = bitswap<8>(~data,0,1,2,3,4,5,6,7); - m_led_pwm->write_mx(m_inp_mux); + m_inp_mux = ~data; + m_led_pwm->write_mx(~data); } u8 mentor16_state::p5_r() { - // P50-P57: read chessboard u8 data = 0; - // read chessboard + // P50-P57: read chessboard for (int i = 0; i < 8; i++) if (BIT(m_inp_mux, i)) - data |= m_board->read_rank(i); + data |= m_board->read_rank(i ^ 7); return ~data; } @@ -231,24 +230,24 @@ void mentor16_state::p6_w(u8 data) static INPUT_PORTS_START( mentor16 ) PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Take Back") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Set Level") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Autoplay / Pawn") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Depth Search / Rook") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Solve Mate / Knight") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Sound / Bishop") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Random / Queen") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Player/Player / King") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Player/Player / King") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Random / Queen") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Sound / Bishop") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Solve Mate / Knight") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Depth Search / Rook") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Autoplay / Pawn") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Set Level") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Take Back") PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Hint / Show Moves") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Move Time") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Acc. Time") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Clear Board") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Change Color") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Set Up / Verify") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Set Up / Verify") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Change Color") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Clear Board") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Acc. Time") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Move Time") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Hint / Show Moves") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") PORT_START("POWER") // needs to be triggered for nvram to work PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, mentor16_state, power_off, 0) PORT_NAME("Power Off") diff --git a/src/mame/novag/vip.cpp b/src/mame/novag/vip.cpp index b7249fc24dfc4..13820328112c6 100644 --- a/src/mame/novag/vip.cpp +++ b/src/mame/novag/vip.cpp @@ -235,8 +235,8 @@ void vip_state::svip_map(address_map &map) static INPUT_PORTS_START( vip ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("GO") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Restore") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Hint") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/CB") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Verify/Setup") @@ -277,8 +277,8 @@ static INPUT_PORTS_START( svip ) PORT_INCLUDE( vip ) PORT_MODIFY("IN.0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore / Replay") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint / Human") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Restore / Replay") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Hint / Human") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color / Video") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random / Autoclock") diff --git a/src/mame/novation/basssta.cpp b/src/mame/novation/basssta.cpp index 040ebab0d2e2e..6ac7c887f6490 100644 --- a/src/mame/novation/basssta.cpp +++ b/src/mame/novation/basssta.cpp @@ -19,22 +19,52 @@ class basssta_state : public driver_device basssta_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_inputs(*this, "IN%u", 0U) + , m_input_select(0xff) { } void bassstr(machine_config &config); void sbasssta(machine_config &config); +protected: + virtual void machine_start() override; + private: + void input_select_w(u8 data); + u8 input_r(); + void bassstr_prog(address_map &map); void sbasssta_prog(address_map &map); void bassstr_data(address_map &map); void sbasssta_data(address_map &map); required_device m_maincpu; + required_ioport_array<4> m_inputs; + + u8 m_input_select; }; +void basssta_state::machine_start() +{ + save_item(NAME(m_input_select)); +} + +void basssta_state::input_select_w(u8 data) +{ + m_input_select = data; +} + +u8 basssta_state::input_r() +{ + u8 ret = 0xff; + for (int n = 0; n < 4; n++) + if (!BIT(m_input_select, n)) + ret &= m_inputs[n]->read(); + return ret; +} + void basssta_state::bassstr_prog(address_map &map) { map(0x0000, 0x7fff).rom().region("program", 0); @@ -51,8 +81,10 @@ void basssta_state::bassstr_data(address_map &map) map(0x0003, 0x0003).noprw(); map(0x000f, 0x000f).noprw(); map(0x001f, 0x001f).noprw(); - map(0x0060, 0x03cf).ram(); + map(0x0060, 0x03cf).ram(); // TODO: this plus everything above is probably internal to CPU map(0x8000, 0x87ff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)); + map(0x8800, 0x8800).r(FUNC(basssta_state::input_r)); + map(0xa800, 0xa800).w(FUNC(basssta_state::input_select_w)); } void basssta_state::sbasssta_data(address_map &map) @@ -70,14 +102,54 @@ void basssta_state::sbasssta_data(address_map &map) map(0x0034, 0x0034).nopw(); map(0x0036, 0x0036).nopw(); map(0x005d, 0x005d).noprw(); - map(0x0060, 0x07ff).ram(); // TODO: probably internal to CPU + map(0x0060, 0x07ff).ram(); // TODO: this plus everything above is probably internal to CPU map(0x6000, 0x7fff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)); - map(0x8001, 0x8004).nopw(); - map(0xc000, 0xc000).nopr(); + map(0x8001, 0x8001).w(FUNC(basssta_state::input_select_w)); + map(0x8002, 0x8004).nopw(); + map(0xc000, 0xc000).r(FUNC(basssta_state::input_r)); } static INPUT_PORTS_START(basssta) + PORT_START("IN0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) + + PORT_START("IN1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) + + PORT_START("IN2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) + + PORT_START("IN3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) INPUT_PORTS_END void basssta_state::bassstr(machine_config &config) diff --git a/src/mame/pc/at.cpp b/src/mame/pc/at.cpp index c1080b2a18041..1044e069696a1 100644 --- a/src/mame/pc/at.cpp +++ b/src/mame/pc/at.cpp @@ -3841,6 +3841,15 @@ ROM_START( opti495xlc ) ROMX_LOAD( "3opm002.bin", 0x10000, 0x10000, CRC(2d9dcbd1) SHA1(d8b0d1411b09767e10e66b455ebc74295bd1b896), ROM_BIOS(3) ) ROM_END +// Tandy 4000 + +ROM_START( t4000 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_SYSTEM_BIOS(0, "v010301", "01.03.01") + ROMX_LOAD( "t4000_even.u32", 0x18000, 0x4000, CRC(f728ae11) SHA1(3bc151b8d704dde7c340a66072c1a418b7eab7db), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD( "t4000_odd.u25", 0x18001, 0x4000, CRC(6bedcf61) SHA1(df08347f163d6e45bdf9e1b64a811222bffba80a), ROM_SKIP(1) | ROM_BIOS(0)) +ROM_END + // 386sx motherboards using the SARC (or CYCLONE) RC2016A5 chipset @@ -5963,6 +5972,7 @@ COMP( 199?, op82c381, ibm5170, 0, at386, 0, at_state, init_at COMP( 199?, op82c391, ibm5170, 0, at386, 0, at_state, init_at, "", "386 motherboards using the OPTi 82C391 chipset", MACHINE_NOT_WORKING ) COMP( 199?, opti495slc,ibm5170, 0, at386, 0, at_state, init_at, "", "386 motherboards using a OPTi 82C495SLC chipset", MACHINE_NOT_WORKING ) COMP( 199?, opti495xlc,ibm5170, 0, at386, 0, at_state, init_at, "", "386 motherboards using a OPTi 82C495XLC chipset", MACHINE_NOT_WORKING ) +COMP( 1987, t4000, ibm5170, 0, at386, 0, at_state, init_at, "Tandy Radio Shack", "Tandy 4000", 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?, p386dx40, ibm5170, 0, at386, 0, at_state, init_at, "Peacock", "P386DX-40", MACHINE_NOT_WORKING ) COMP( 1989, pc2386, ibm5170, 0, at386l, 0, at_state, init_at, "Amstrad plc", "PC2386", MACHINE_NOT_WORKING ) diff --git a/src/mame/pc/calchase.cpp b/src/mame/pc/calchase.cpp index 5f4e58ef920d4..5ce8582b7ac94 100644 --- a/src/mame/pc/calchase.cpp +++ b/src/mame/pc/calchase.cpp @@ -154,6 +154,8 @@ class isa16_calchase_jamma_if : public device_t, public device_isa16_card_interf virtual void device_add_mconfig(machine_config &config) override; + // TODO: implement me once conversion to PCI kicks in +// virtual void remap(int space_id, offs_t start, offs_t end) override; private: required_ioport_array<5> m_iocard; std::unique_ptr m_nvram_data; diff --git a/src/mame/pc/pcipc.cpp b/src/mame/pc/pcipc.cpp index 19bf5ff83dd72..668362d98115a 100644 --- a/src/mame/pc/pcipc.cpp +++ b/src/mame/pc/pcipc.cpp @@ -39,7 +39,6 @@ #include "machine/pci.h" #include "machine/pci-ide.h" #include "machine/w83977tf.h" -#include "video/clgd546x_laguna.h" // enable ISA verbose messaging at I/O $80 // NOTE: xubuntu 6.10 will ping the port a lot once it gets to GNOME. @@ -588,7 +587,7 @@ void pcipc_state::pcipc(machine_config &config) ISA16_SLOT(config, "isa4", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa5", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); - rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); // "microsoft_mouse")); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); serport0.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd1_w)); serport0.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd1_w)); serport0.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr1_w)); @@ -625,7 +624,7 @@ void pcipc_state::pcipctx(machine_config &config) void pcipc_state::pciagp(machine_config &config) { - // TODO: starts at 233'000'000 + // TODO: starts at 233'000'000, consider adding FSB & AGP clocks here pentium2_device &maincpu(PENTIUM2(config, "maincpu", 90'000'000)); maincpu.set_addrmap(AS_PROGRAM, &pcipc_state::pcipc_map); maincpu.set_addrmap(AS_IO, &pcipc_state::pcipc_map_io); @@ -634,8 +633,7 @@ void pcipc_state::pciagp(machine_config &config) PCI_ROOT(config, "pci", 0); I82443BX_HOST(config, "pci:00.0", 0, "maincpu", 128*1024*1024); - I82443BX_BRIDGE(config, "pci:01.0", 0 ); //"pci:01.0:00.0"); - //I82443BX_AGP (config, "pci:01.0:00.0"); + I82443BX_BRIDGE(config, "pci:01.0", 0 ); i82371eb_isa_device &isa(I82371EB_ISA(config, "pci:07.0", 0, "maincpu")); isa.boot_state_hook().set(FUNC(pcipc_state::boot_state_award_w)); @@ -656,7 +654,7 @@ void pcipc_state::pciagp(machine_config &config) ISA16_SLOT(config, "isa3", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); #if 0 - rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); // "microsoft_mouse")); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); serport0.rxd_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::rxd1_w)); serport0.dcd_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::ndcd1_w)); serport0.dsr_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::ndsr1_w)); @@ -671,8 +669,13 @@ void pcipc_state::pciagp(machine_config &config) serport1.cts_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::ncts2_w)); #endif - // TODO: temp link, to be moved to quakeat.cpp - CIRRUS_GD5465_LAGUNA3D(config, "pci:01.0:00.0", 0); + // FIXME: int mapping is unchecked for all slots + PCI_SLOT(config, "pci:01.0:1", agp_cards, 1, 0, 1, 2, 3, "riva128"); + + PCI_SLOT(config, "pci:1", pci_cards, 15, 1, 2, 3, 0, nullptr); + PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr); + PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr); + PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, nullptr); } ROM_START(pcipc) @@ -714,4 +717,4 @@ INPUT_PORTS_END COMP(1998, pcipc, 0, 0, pcipc, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430HX)", MACHINE_NO_SOUND ) COMP(1998, pcipctx, 0, 0, pcipctx, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430TX)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // unemulated super I/O -COMP(1999, pciagp, 0, 0, pciagp, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI/AGP PC (440BX)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // errors out with ISA state 0x05 (keyboard), does stuff if bypassed but eventually PnP breaks OS booting +COMP(1999, pciagp, 0, 0, pciagp, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI/AGP PC (440BX)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // errors out with ISA state $05 (keyboard, blame 8042kbdc.cpp) bp e140c,1,{eax&=~1;g}) does stuff if bypassed but eventually PnP breaks OS booting diff --git a/src/mame/pc/pcipc_sis.cpp b/src/mame/pc/pcipc_sis.cpp index 8d8eb902bb5a8..9fa42529dd5bd 100644 --- a/src/mame/pc/pcipc_sis.cpp +++ b/src/mame/pc/pcipc_sis.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese /* - * Sandbox for SiS based x86 PCs, targeting the new PCI model + * Sandbox for SiS based 496/497 x86 PCs, targeting the new PCI model * * Notes: * - sis85c471 doesn't belong here, it's a full on ISA PC/AT @@ -16,11 +16,19 @@ #include "emu.h" #include "bus/isa/isa_cards.h" +#include "bus/pci/pci_slot.h" +#include "bus/rs232/hlemouse.h" +#include "bus/rs232/null_modem.h" +#include "bus/rs232/rs232.h" +#include "bus/rs232/sun_kbd.h" +#include "bus/rs232/terminal.h" #include "cpu/i386/i386.h" #include "machine/pci.h" #include "machine/sis85c496.h" +#include "machine/w83787f.h" #include "video/voodoo_pci.h" + class sis496_state : public driver_device { public: @@ -33,9 +41,12 @@ class sis496_state : public driver_device protected: required_device m_maincpu; + private: void main_io(address_map &map); void main_map(address_map &map); + + static void winbond_superio_config(device_t *device); }; #define PCI_ID_VIDEO "pci:09.0" @@ -66,6 +77,39 @@ void sis496_state::main_io(address_map &map) map.unmap_value_high(); } +static void isa_com(device_slot_interface &device) +{ + device.option_add("microsoft_mouse", MSFT_HLE_SERIAL_MOUSE); + device.option_add("logitech_mouse", LOGITECH_HLE_SERIAL_MOUSE); + device.option_add("wheel_mouse", WHEEL_HLE_SERIAL_MOUSE); + device.option_add("msystems_mouse", MSYSTEMS_HLE_SERIAL_MOUSE); + device.option_add("rotatable_mouse", ROTATABLE_HLE_SERIAL_MOUSE); + device.option_add("terminal", SERIAL_TERMINAL); + device.option_add("null_modem", NULL_MODEM); + device.option_add("sun_kbd", SUN_KBD_ADAPTOR); +} + +static void isa_internal_devices(device_slot_interface &device) +{ + device.option_add("w83787f", W83787F); +} + +void sis496_state::winbond_superio_config(device_t *device) +{ + w83787f_device &fdc = *downcast(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.irq1().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq1_w)); + fdc.irq8().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq8n_w)); + fdc.txd1().set(":serport0", FUNC(rs232_port_device::write_txd)); + fdc.ndtr1().set(":serport0", FUNC(rs232_port_device::write_dtr)); + fdc.nrts1().set(":serport0", FUNC(rs232_port_device::write_rts)); + fdc.txd2().set(":serport1", FUNC(rs232_port_device::write_txd)); + fdc.ndtr2().set(":serport1", FUNC(rs232_port_device::write_dtr)); + fdc.nrts2().set(":serport1", FUNC(rs232_port_device::write_rts)); +} + void sis496_state::sis496(machine_config &config) { // Basic machine hardware @@ -77,10 +121,25 @@ void sis496_state::sis496(machine_config &config) PCI_ROOT(config, "pci", 0); SIS85C496_HOST(config, "pci:05.0", 0, "maincpu", 32*1024*1024); - ISA16_SLOT(config, "isa1", 0, "pci:05.0:isabus", pc_isa16_cards, "svga_et4k", false); + ISA16_SLOT(config, "board4", 0, "pci:05.0:isabus", isa_internal_devices, "w83787f", true).set_option_machine_config("w83787f", winbond_superio_config); + ISA16_SLOT(config, "isa1", 0, "pci:05.0:isabus", pc_isa16_cards, "wd90c31_lr", false); ISA16_SLOT(config, "isa2", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa3", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, "logitech_mouse")); + serport0.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd1_w)); + serport0.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd1_w)); + serport0.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr1_w)); + serport0.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri1_w)); + serport0.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts1_w)); + + rs232_port_device &serport1(RS232_PORT(config, "serport1", isa_com, nullptr)); + serport1.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd2_w)); + serport1.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd2_w)); + serport1.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr2_w)); + serport1.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri2_w)); + serport1.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts2_w)); + // TODO: 9-10-11-12 for PCI_SLOT (according to BIOS) } @@ -91,6 +150,7 @@ void sis496_voodoo1_state::sis496_voodoo1(machine_config &config) VOODOO_1_PCI(config, m_voodoo, 0, m_maincpu, m_screen); m_voodoo->set_fbmem(2); m_voodoo->set_tmumem(4, 0); + // TODO: games are very annoyed with Direct3D 5 init/teardown fns around this. m_voodoo->set_status_cycles(1000); // TODO: wrong, needs VGA passthru @@ -99,20 +159,32 @@ void sis496_voodoo1_state::sis496_voodoo1(machine_config &config) m_screen->set_size(640, 480); m_screen->set_visarea(0, 640 - 1, 0, 480 - 1); m_screen->set_screen_update(PCI_ID_VIDEO, FUNC(voodoo_1_pci_device::screen_update)); + + PCI_SLOT(config, "pci:1", pci_cards, 10, 0, 1, 2, 3, nullptr); + PCI_SLOT(config, "pci:2", pci_cards, 11, 1, 2, 3, 0, nullptr); } // generic placeholder for unknown BIOS types // Funworld BIOS is temporary until we rewrite funworld/photoply.cpp ROM_START( sis85c496 ) ROM_REGION32_LE(0x20000, "pci:05.0", 0) - ROM_SYSTEM_BIOS(0, "funworld", "Award 486e BIOS with W83787") + ROM_SYSTEM_BIOS(0, "funworld", "Award 486e BIOS with W83787 (photoply)") // Photoplay BIOS + // Lucky Star LS-486EF REV:B ROMX_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68), ROM_BIOS(0) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT29C010A + // MegaTouch XL BIOSes + // 09/11/96-SiS-496-SMC665-2A4IBU41C-00 + ROM_SYSTEM_BIOS(1, "merit", "Award 486e BIOS Telco (mtouchxl)") + ROMX_LOAD( "094572516 bios - 486.bin", 0x000000, 0x020000, CRC(1c0b3ba0) SHA1(ff86dd6e476405e716ac7a4de4a216d2d2b49f15), ROM_BIOS(1) ) + // AMI BIOS, Jetway branded MB? + // 40-040B-001276-00101111-040493-OP495SLC-0 + //ROMX_LOAD("prom.mb", 0x10000, 0x10000, BAD_DUMP CRC(e44bfd3c) SHA1(c07ec94e11efa30e001f39560010112f73cc0016) ) + // 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_SYSTEM_BIOS(1, "4sim002", "AMI ISA BIOS (unknown)") - ROMX_LOAD( "4sim002.bin", 0x00000, 0x20000, BAD_DUMP CRC(ea898f85) SHA1(7236cd2fc985985f21979e4808cb708be8d0445f), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS(2, "4sim002", "AMI ISA unknown BIOS") + ROMX_LOAD( "4sim002.bin", 0x00000, 0x20000, BAD_DUMP CRC(ea898f85) SHA1(7236cd2fc985985f21979e4808cb708be8d0445f), ROM_BIOS(2) ) ROM_END // A-Trend ATC-1425A - Chipset: SiS 85C496, 85C497 - RAM: 4xSIMM72, Cache: 4x32pin + TAG - ISA16: 4, PCI: 3 diff --git a/src/mame/pc/przone.cpp b/src/mame/pc/przone.cpp new file mode 100644 index 0000000000000..f4846b5343c84 --- /dev/null +++ b/src/mame/pc/przone.cpp @@ -0,0 +1,318 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +Prize Zone (c) 199? Lazer-Tron + +TODO: +- identify proper motherboard/BIOS; +- hookup vibra16 ISA card in place of sblaster_16; +- Printer error B0 keeps popping in attract/game select (disable in service mode as workaround); +- Trackball in place of PS/2 mouse (may run thru a COM? autoexec.bat logs hint that the driver is +loaded at CD time); +- CD-ROM reading test is too fast (739% of what is reported as 8X); +- Tri-Scraper / Super Solitaire / Super 11's: timer doesn't count down (goes only up), + it does with mouse click, likely bug for wrong input device? + +=================================================================================================== + +Prize Zone Gold Version 2.01 its a CDRDAO dumped cd +The redemption arcade game uses an old Pentium I - 200Mhz 233MMX etc SB16 vibra16, +a S3 virge vga card and a custom ISA IO card. +It has games like gem run, chip away, squirm (a centipede rip off) scud attack (a middle command +rip off) these are games that atari got mad about and were later removed + +This one doesnt have a dongle +but the sound card, s3 virge video card +and isa custom board has to be there +or the disc wont load and gives an error + +**************************************************************************************************/ + +#include "emu.h" + +#include "bus/isa/isa_cards.h" +#include "bus/pci/pci_slot.h" +#include "bus/rs232/hlemouse.h" +#include "bus/rs232/null_modem.h" +#include "bus/rs232/rs232.h" +#include "bus/rs232/sun_kbd.h" +#include "bus/rs232/terminal.h" +#include "cpu/i386/i386.h" +#include "machine/fdc37c93x.h" +#include "machine/i82371sb.h" +#include "machine/i82439hx.h" +#include "machine/pci.h" + +class isa16_przone_jamma_if : public device_t, public device_isa16_card_interface +{ +public: + // construction/destruction + isa16_przone_jamma_if(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ioport_constructor device_input_ports() const override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + virtual void device_add_mconfig(machine_config &config) override; + + virtual void remap(int space_id, offs_t start, offs_t end) override; + +private: + std::unique_ptr m_nvram_data; + //required_ioport_array<5> m_iocard; + required_ioport m_iocard; + + void mem_map(address_map &map); + void io_map(address_map &map); + + uint16_t iocard_r(); + uint8_t nvram_r(offs_t offset); + void nvram_w(offs_t offset, uint8_t data); +}; + +DEFINE_DEVICE_TYPE(ISA16_PRZONE_JAMMA_IF, isa16_przone_jamma_if, "przone_jamma_if", "ISA16 Prize Zone custom JAMMA I/F") + +isa16_przone_jamma_if::isa16_przone_jamma_if(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, ISA16_PRZONE_JAMMA_IF, tag, owner, clock) + , device_isa16_card_interface(mconfig, *this) + , m_iocard(*this, "IOCARD") +{ +} + +void isa16_przone_jamma_if::device_add_mconfig(machine_config &config) +{ + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // unknown NVRAM type +} + +void isa16_przone_jamma_if::device_start() +{ + set_isa_device(); + + // 0x4000 enough to pass initial string check at $d0000-7, + // 0x8000 confirmed later thru NVRAM test in service mode + m_nvram_data = std::make_unique(0x8000); + subdevice("nvram")->set_base(m_nvram_data.get(), 0x8000); +} + +void isa16_przone_jamma_if::device_reset() +{ +} + +void isa16_przone_jamma_if::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_PROGRAM) + { + m_isa->install_memory(0x000d0000, 0x000d7fff, *this, &isa16_przone_jamma_if::mem_map); + } + + if (space_id == AS_IO) + { + m_isa->install_device(0x0300, 0x0307, *this, &isa16_przone_jamma_if::io_map); + } +} + +uint8_t isa16_przone_jamma_if::nvram_r(offs_t offset) +{ + return m_nvram_data[offset]; +} + +void isa16_przone_jamma_if::nvram_w(offs_t offset, uint8_t data) +{ + m_nvram_data[offset] = data; +} + +void isa16_przone_jamma_if::mem_map(address_map &map) +{ + map(0x0000, 0x7fff).rw(FUNC(isa16_przone_jamma_if::nvram_r), FUNC(isa16_przone_jamma_if::nvram_w)); +} + +void isa16_przone_jamma_if::io_map(address_map &map) +{ + map(0x04, 0x05).lr16(NAME([this] () { return m_iocard->read(); })); +} + +static INPUT_PORTS_START( przone_jamma ) + PORT_START("IOCARD") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN5 ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN6 ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "1-1" ) + 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 + +ioport_constructor isa16_przone_jamma_if::device_input_ports() const +{ + return INPUT_PORTS_NAME(przone_jamma); +} + +namespace { + +class przone_state : public driver_device +{ +public: + przone_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + { } + + void przone(machine_config &config); + +private: + void main_io(address_map &map); + void main_map(address_map &map); + + static void smc_superio_config(device_t *device); +}; + +void przone_state::main_map(address_map &map) +{ + map.unmap_value_high(); +} + +void przone_state::main_io(address_map &map) +{ + map.unmap_value_high(); +} + +static INPUT_PORTS_START( przone ) +INPUT_PORTS_END + +static void isa_internal_devices(device_slot_interface &device) +{ + device.option_add("fdc37c93x", FDC37C93X); +} + +void przone_isa16_cards(device_slot_interface &device) +{ + device.option_add("przone_jamma_if", ISA16_PRZONE_JAMMA_IF); +} + +static void isa_com(device_slot_interface &device) +{ + device.option_add("microsoft_mouse", MSFT_HLE_SERIAL_MOUSE); + device.option_add("logitech_mouse", LOGITECH_HLE_SERIAL_MOUSE); + device.option_add("wheel_mouse", WHEEL_HLE_SERIAL_MOUSE); + device.option_add("msystems_mouse", MSYSTEMS_HLE_SERIAL_MOUSE); + device.option_add("rotatable_mouse", ROTATABLE_HLE_SERIAL_MOUSE); + device.option_add("terminal", SERIAL_TERMINAL); + device.option_add("null_modem", NULL_MODEM); + device.option_add("sun_kbd", SUN_KBD_ADAPTOR); +} + +void przone_state::smc_superio_config(device_t *device) +{ + fdc37c93x_device &fdc = *downcast(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.irq1().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq1_w)); + fdc.irq8().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq8n_w)); + fdc.txd1().set(":serport0", FUNC(rs232_port_device::write_txd)); + fdc.ndtr1().set(":serport0", FUNC(rs232_port_device::write_dtr)); + fdc.nrts1().set(":serport0", FUNC(rs232_port_device::write_rts)); + fdc.txd2().set(":serport1", FUNC(rs232_port_device::write_txd)); + fdc.ndtr2().set(":serport1", FUNC(rs232_port_device::write_dtr)); + fdc.nrts2().set(":serport1", FUNC(rs232_port_device::write_rts)); +} + +void przone_state::przone(machine_config &config) +{ + // unknown CPU, lowered to PCI clock for ViRGE being really the bottleneck here. + pentium_device &maincpu(PENTIUM(config, "maincpu", 33'333'333)); + maincpu.set_addrmap(AS_PROGRAM, &przone_state::main_map); + maincpu.set_addrmap(AS_IO, &przone_state::main_io); + maincpu.set_irq_acknowledge_callback("pci:07.0:pic8259_master", FUNC(pic8259_device::inta_cb)); + maincpu.smiact().set("pci:00.0", FUNC(i82439hx_host_device::smi_act_w)); + + PCI_ROOT(config, "pci", 0); + // TODO: confirm size + I82439HX(config, "pci:00.0", 0, "maincpu", 256*1024*1024); + + i82371sb_isa_device &isa(I82371SB_ISA(config, "pci:07.0", 0, "maincpu")); + isa.boot_state_hook().set([](u8 data) { /* printf("%02x\n", data); */ }); + isa.smi().set_inputline("maincpu", INPUT_LINE_SMI); + + i82371sb_ide_device &ide(I82371SB_IDE(config, "pci:07.1", 0, "maincpu")); + ide.irq_pri().set("pci:07.0", FUNC(i82371sb_isa_device::pc_irq14_w)); + ide.irq_sec().set("pci:07.0", FUNC(i82371sb_isa_device::pc_mirq0_w)); + ide.subdevice("ide1")->slot(0).set_default_option("cdrom"); +// ide.subdevice("ide1")->slot(0).set_option_machine_config("cdrom", cdrom_config); + ide.subdevice("ide2")->slot(0).set_default_option(nullptr); + + PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr); + PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr); + PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr); + PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "virge"); + + ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", smc_superio_config); + ISA16_SLOT(config, "isa1", 0, "pci:07.0:isabus", przone_isa16_cards, "przone_jamma_if", true); + // TODO: one slot for vibra16 + ISA16_SLOT(config, "isa2", 0, "pci:07.0:isabus", pc_isa16_cards, "sblaster_16", false); + ISA16_SLOT(config, "isa3", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); + + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, nullptr)); + serport0.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd1_w)); + serport0.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd1_w)); + serport0.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr1_w)); + serport0.ri_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::nri1_w)); + serport0.cts_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ncts1_w)); + + rs232_port_device &serport1(RS232_PORT(config, "serport1", isa_com, nullptr)); + serport1.rxd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::rxd2_w)); + serport1.dcd_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndcd2_w)); + serport1.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr2_w)); + serport1.ri_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::nri2_w)); + serport1.cts_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ncts2_w)); +} + + +ROM_START( przonegd ) + ROM_REGION32_LE(0x40000, "pci:07.0", 0) + // borrowed from pcipc -bios 2 (El Torito), technically a BAD_DUMP + ROM_LOAD("m7s04.rom", 0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef)) + + DISK_REGION( "pci:07.1:ide1:0:cdrom" ) + DISK_IMAGE_READONLY( "prizezonegold_201", 0, SHA1(54eec0d7b8629f8e8a4c9b99184ece0be0e8eb06) ) +ROM_END + +} // anonymous namespace + + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + + +GAME( 1997, przonegd, 0, przone, przone, przone_state, empty_init, ROT0, "Lazer-Tron", "Prize Zone Gold (USA, v2.01)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Wed Dec 31 11:13:17 1997 diff --git a/src/mame/pc/quakeat.cpp b/src/mame/pc/quakeat.cpp index 2b7d46a791656..e928b6a182366 100644 --- a/src/mame/pc/quakeat.cpp +++ b/src/mame/pc/quakeat.cpp @@ -93,8 +93,10 @@ HDD image contains remnants of an Actua Soccer Arcade installation. //#include "bus/rs232/rs232.h" //#include "bus/rs232/sun_kbd.h" //#include "bus/rs232/terminal.h" -#include "video/clgd546x_laguna.h" +#include "video/voodoo_pci.h" +// TODO: change me up to agp_slot +#define PCI_AGP_ID "pci:01.0:00.0" namespace { @@ -104,6 +106,7 @@ class quakeat_state : public driver_device quakeat_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_voodoo(*this, PCI_AGP_ID) { } void ga6la7(machine_config &config); @@ -111,6 +114,7 @@ class quakeat_state : public driver_device private: required_device m_maincpu; + required_device m_voodoo; void ga6la7_map(address_map &map); void ga6la7_io(address_map &map); @@ -129,13 +133,6 @@ void quakeat_state::ga6la7_io(address_map &map) map.unmap_value_high(); } -// temp, to be removed -void quakeat_state::quake_map(address_map &map) -{ - map(0x000e0000, 0x000fffff).rom().region("pc_bios", 0); - map(0xfffe0000, 0xffffffff).rom().region("pc_bios", 0); -} - static INPUT_PORTS_START( quake ) INPUT_PORTS_END @@ -195,17 +192,22 @@ void quakeat_state::ga6la7(machine_config &config) ISA16_SLOT(config, "isa2", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa3", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); - // TODO: really has a Voodoo Banshee instead - CIRRUS_GD5465_LAGUNA3D(config, "pci:01.0:00.0", 0); + VOODOO_BANSHEE_X86_PCI(config, m_voodoo, 0, m_maincpu, "screen"); // "pci:0d.0" J4D2 + m_voodoo->set_fbmem(8); + m_voodoo->set_status_cycles(1000); +// subdevice(PCI_AGP_ID":voodoo")->vblank_callback().set("pci:07.0", FUNC(i82371eb_isa_device::pc_irq5_w)); + + // TODO: fix legacy raw setup here + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57); + screen.set_size(640, 480); + screen.set_visarea(0, 640 - 1, 0, 480 - 1); + screen.set_screen_update(PCI_AGP_ID, FUNC(voodoo_banshee_pci_device::screen_update)); } void quakeat_state::quake(machine_config &config) { - PENTIUM2(config, m_maincpu, 233'000'000); /* Pentium II, 233MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &quakeat_state::quake_map); -// m_maincpu->set_disable(); - - PCI_ROOT(config, "pci", 0); + ga6la7(config); // ... } @@ -216,7 +218,7 @@ ROM_END ROM_START(quake) // 4N4XL0X0.86A.0011.P05 - ROM_REGION32_LE(0x20000, "pc_bios", 0) /* motherboard bios */ + ROM_REGION32_LE(0x20000, "pci:07.0", 0) /* motherboard bios */ // TODO: compressed // ROM_LOAD("p05-0011.bio", 0x000000, 0x10000, NO_DUMP ) // ROM_CONTINUE( 0x1ffff-0xa0, 0xa0 ) diff --git a/src/mame/pinball/s11b.cpp b/src/mame/pinball/s11b.cpp index 4c2ff9ae05e1b..48655ffec88b1 100644 --- a/src/mame/pinball/s11b.cpp +++ b/src/mame/pinball/s11b.cpp @@ -1563,6 +1563,28 @@ ROM_START(tsptr_l3) ROM_RELOAD(0x58000,0x8000) ROM_END +ROM_START(tsptr_l1) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("transporter-la1-u26-checksumb412.l1", 0x4000, 0x4000, CRC(3504300f) SHA1(1a8b779b7375e4087e42b31c1aa17a8a32c6d6aa)) + ROM_LOAD("transporter-la1-u27-checksum01cf.l1", 0x8000, 0x8000, CRC(49635399) SHA1(8cdc700c501f0d611152010d5ae28bcd84d06861)) + ROM_REGION(0x10000, "audiocpu", ROMREGION_ERASEFF) + ROM_LOAD("transporter-u21-checksumca54.l1", 0x8000, 0x8000, CRC(2b194ca6) SHA1(20cb956143622409a7f4b918ab1699db1b6e6b07)) + ROM_LOAD("transporter-u22-checksumd84c.l1", 0x0000, 0x8000, CRC(4c7ba6d7) SHA1(0134dce454c29c572c4ee0e0139a8ad5f0249b99)) + ROM_REGION(0x80000, "bg:cpu", ROMREGION_ERASEFF) + ROM_LOAD("transporter-u4-checksum58b0.l1", 0x00000, 0x8000, CRC(63e92f8b) SHA1(57f2841419415fc3560d46a63119c76f98cade9b)) + ROM_RELOAD(0x08000,0x8000) + ROM_RELOAD(0x10000,0x8000) + ROM_RELOAD(0x18000,0x8000) + ROM_LOAD("transporter-u19-checksumc7af.l1", 0x20000, 0x8000, CRC(3cfde8b0) SHA1(7bdc71ba1ba4fd337f052354323c86fd97b2b881)) // only common ROM with L3 + ROM_RELOAD(0x28000,0x8000) + ROM_RELOAD(0x30000,0x8000) + ROM_RELOAD(0x38000,0x8000) + ROM_LOAD("transporter-u20-checksum21ae.l1", 0x40000, 0x8000, CRC(fabddaaf) SHA1(7c014bb5b1ac8da61ffd265ba98bcb8256c5f666)) + ROM_RELOAD(0x48000,0x8000) + ROM_RELOAD(0x50000,0x8000) + ROM_RELOAD(0x58000,0x8000) +ROM_END + /*----------------------- / Whirlwind 4/90 (#574) /-----------------------*/ @@ -1735,6 +1757,7 @@ GAME(1988, taxi_lu1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, R GAME(1988, taxi_lg1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (L-1) Germany", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1988, taxi_p5, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (P-5)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1989, tsptr_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Transporter the Rescue (L-3)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, tsptr_l1, tsptr_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Transporter the Rescue (LA-1)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1990, whirl_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (LA-3)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1990, whirl_l2, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (LU-2)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1990, whirl_lg3, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (LG-3)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/chessac.cpp b/src/mame/saitek/chessac.cpp new file mode 100644 index 0000000000000..b72ba69f7f63e --- /dev/null +++ b/src/mame/saitek/chessac.cpp @@ -0,0 +1,408 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/******************************************************************************* + +Saitek Kasparov Chess Academy / Mephisto Schachakademie (both were later rebranded +to Mephisto Talking Chess Academy) + +The chess engine is by Frans Morsch, similar to the one in GK 2000. Other features, +such as the tutorials, were supposedly added by Craig Barnes. + +Hardware notes: +- Hitachi H8/3214 MCU, 16MHz XTAL +- same LCD as GK 2000 +- OKI MSM6588 ADPCM Recorder @ 4MHz, small daughterboard with 4MB ROM under epoxy +- 8*8 LEDs, button sensors chessboard + +TODO: +- it does a cold boot at every reset, so nvram won't work properly unless MAME + has some kind of auxillary autosave state feature at power-off +- dump/add German speech ROM (Mephisto Schachakademie, MCU is same) +- does a French speech version exist? + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/h8/h83217.h" +#include "machine/sensorboard.h" +#include "sound/okim6588.h" +#include "video/pwm.h" + +#include "screen.h" +#include "speaker.h" + +// internal artwork +#include "saitek_chessac.lh" + + +namespace { + +class chessac_state : public driver_device +{ +public: + chessac_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_adpcm_rom(*this, "adpcm"), + m_led_pwm(*this, "led_pwm"), + m_lcd_pwm(*this, "lcd_pwm"), + m_okim6588(*this, "okim6588"), + m_inputs(*this, "IN.%u", 0), + m_out_lcd(*this, "s%u.%u", 0U, 0U) + { } + + void chessac(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(go_button); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device m_maincpu; + required_device m_board; + required_region_ptr m_adpcm_rom; + required_device m_led_pwm; + required_device m_lcd_pwm; + required_device m_okim6588; + required_ioport_array<3> m_inputs; + output_finder<2, 24> m_out_lcd; + + u16 m_inp_mux = 0; + u32 m_lcd_segs = 0; + u8 m_lcd_com = 0; + u8 m_led_select = 0; + u8 m_led_data = 0; + u32 m_adpdm_address = 0; + + u8 m_port3 = 0; + u8 m_port5 = 0; + u8 m_port7 = 0; + + void main_map(address_map &map); + + // I/O handlers + void lcd_pwm_w(offs_t offset, u8 data); + void update_lcd(); + template void lcd_segs_w(u8 data); + + void standby(int state); + + void update_leds(); + void update_adpcm_address(); + + void p3_w(u8 data); + u8 p4_r(); + void p5_w(u8 data); + void p6_w(u8 data); + u8 p7_r(); + void p7_w(u8 data); +}; + +void chessac_state::machine_start() +{ + m_out_lcd.resolve(); + + // register for savestates + save_item(NAME(m_inp_mux)); + save_item(NAME(m_lcd_segs)); + save_item(NAME(m_lcd_com)); + save_item(NAME(m_led_select)); + save_item(NAME(m_led_data)); + save_item(NAME(m_adpdm_address)); + save_item(NAME(m_port3)); + save_item(NAME(m_port5)); + save_item(NAME(m_port7)); +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +// power + +void chessac_state::standby(int state) +{ + // clear display + if (state) + { + m_lcd_pwm->clear(); + m_led_pwm->clear(); + } +} + +INPUT_CHANGED_MEMBER(chessac_state::go_button) +{ + m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE); +} + + +// LCD + +void chessac_state::lcd_pwm_w(offs_t offset, u8 data) +{ + m_out_lcd[offset & 0x3f][offset >> 6] = data; +} + +void chessac_state::update_lcd() +{ + // LCD latch from P1x + if (m_port5 & 1) + m_lcd_segs = (m_lcd_segs << 8 & 0xff0000) | (m_lcd_segs & 0xffff); + + u32 lcd_segs = bitswap<24>(m_lcd_segs,11,18,19,20,21,12,13,14,15,22,23,0,1,2,3,4,5,6,7,16,17,8,9,10); + + for (int i = 0; i < 2; i++) + { + // LCD common is analog (voltage level) + const u8 com = population_count_32(m_lcd_com >> (i * 2) & 3); + const u32 data = (com == 0) ? lcd_segs : (com == 2) ? ~lcd_segs : 0; + m_lcd_pwm->write_row(i, data); + } +} + +template +void chessac_state::lcd_segs_w(u8 data) +{ + // P1x, P2x: LCD segments + const u8 shift = 8 * N; + m_lcd_segs = (m_lcd_segs & ~(0xff << shift)) | (data << shift); + update_lcd(); +} + + +// misc + +void chessac_state::update_leds() +{ + if (m_port5 & 0x10) + m_led_select = ~m_port7; + if (m_port5 & 0x20) + m_led_data = m_port7; + + m_led_pwm->matrix(m_led_select, m_led_data); +} + +void chessac_state::update_adpcm_address() +{ + for (int i = 0; i < 3; i++) + if (BIT(m_port3, i)) + { + const u8 shift = 8 * i; + m_adpdm_address = (m_adpdm_address & ~(0xff << shift)) | (m_port7 << shift); + } +} + +void chessac_state::p3_w(u8 data) +{ + // P37: MSM6588 RESET + if (m_port3 & 0x80 && ~data & 0x80) + m_okim6588->reset(); + + // P34: MSM6588 RD + // P35: MSM6588 WR + // P36: MSM6588 CE + if ((data & 0xc0) == 0x80 && m_port3 & 0x20 && ~data & 0x20) + m_okim6588->data_w(m_port7); + + // P33: ADPCM ROM CE + // P30-P33: enable ADPCM ROM address latches + m_port3 = data; + update_adpcm_address(); +} + +u8 chessac_state::p4_r() +{ + // P40-P47: multiplexed inputs + u8 data = 0; + + // read buttons + for (int i = 0; i < 2; i++) + if (BIT(m_inp_mux, i + 8)) + data |= m_inputs[i]->read(); + + // read chessboard + for (int i = 0; i < 8; i++) + if (BIT(m_inp_mux, i)) + data |= m_board->read_file(i, true); + + return ~data; +} + +void chessac_state::p5_w(u8 data) +{ + // P50: enable LCD latch + m_port5 = data; + update_lcd(); + + // P51: ext power (no need to emulate it) + // P52,P53: N/C + + // P54,P55: enable LED latches + update_leds(); +} + +void chessac_state::p6_w(u8 data) +{ + // P60-P63: LCD common + m_lcd_com = data & 0xf; + update_lcd(); + + // P65,P66: input mux (buttons) + m_inp_mux = (m_inp_mux & 0xff) | (~data << 3 & 0x300); +} + +u8 chessac_state::p7_r() +{ + u8 data = 0xff; + + // P70-P77: read ADPCM ROM + if (~m_port3 & 8) + data &= m_adpcm_rom[m_adpdm_address & (m_adpcm_rom.bytes() - 1)]; + + // P70-P73: read MSM6588 status + if ((m_port3 & 0xf0) == 0xa0) + data &= (m_okim6588->data_r() | 0xf0); + + return data; +} + +void chessac_state::p7_w(u8 data) +{ + // P70-P77: input mux (chessboard) + m_inp_mux = (m_inp_mux & 0x300) | (data ^ 0xff); + + // also data for LED latches, ADPCM address latches, and MSM6588 + m_port7 = data; + update_leds(); + update_adpcm_address(); +} + + + +/******************************************************************************* + Address Maps +*******************************************************************************/ + +void chessac_state::main_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( chessac ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Yes") PORT_CODE(KEYCODE_F1) // combine for NEW GAME + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("No") PORT_CODE(KEYCODE_F1) // " + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Hint / Info") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(KEYCODE_B) PORT_NAME("Fwd / Black") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Rook") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King") + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Option") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Tutorial") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Say Again") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_W) PORT_NAME("Back / White") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") + + PORT_START("IN.2") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, chessac_state, go_button, 0) PORT_NAME("Go / Stop") + PORT_BIT(0xef, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("CLICKABLE") // helper for clickable artwork + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void chessac_state::chessac(machine_config &config) +{ + // basic machine hardware + H83214(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &chessac_state::main_map); + m_maincpu->nvram_enable_backup(true); + m_maincpu->standby_cb().set(m_maincpu, FUNC(h83214_device::nvram_set_battery)); + m_maincpu->standby_cb().append(FUNC(chessac_state::standby)); + m_maincpu->write_port1().set(FUNC(chessac_state::lcd_segs_w<1>)); + m_maincpu->write_port2().set(FUNC(chessac_state::lcd_segs_w<0>)); + m_maincpu->write_port3().set(FUNC(chessac_state::p3_w)); + m_maincpu->read_port4().set(FUNC(chessac_state::p4_r)); + m_maincpu->write_port5().set(FUNC(chessac_state::p5_w)); + m_maincpu->read_port6().set_ioport("IN.2").invert(); + m_maincpu->write_port6().set(FUNC(chessac_state::p6_w)); + m_maincpu->read_port7().set(FUNC(chessac_state::p7_r)); + m_maincpu->write_port7().set(FUNC(chessac_state::p7_w)); + + 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)); + //m_board->set_nvram_enable(true); + + // video hardware + PWM_DISPLAY(config, m_lcd_pwm).set_size(2, 24); + m_lcd_pwm->output_x().set(FUNC(chessac_state::lcd_pwm_w)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_refresh_hz(60); + screen.set_size(1920/5, 804/5); + screen.set_visarea_full(); + + PWM_DISPLAY(config, m_led_pwm).set_size(8, 8); + config.set_default_layout(layout_saitek_chessac); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + + OKIM6588(config, m_okim6588, 4_MHz_XTAL).add_route(ALL_OUTPUTS, "speaker", 0.5); + m_okim6588->write_mon().set_inputline(m_maincpu, INPUT_LINE_NMI).invert(); + m_okim6588->set_mcum_pin(1); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( chessac ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD("97_saitek_86165400831_hd6433214a08f.u1", 0x0000, 0x8000, CRC(29d06d6a) SHA1(08b6f4093b240b0a34d9da67c9acffc576ba1d2d) ) + + ROM_REGION( 0x400000, "adpcm", 0 ) + ROM_LOAD("adpcm.u10", 0x000000, 0x400000, CRC(73d9650c) SHA1(ecf3bd72fc954528fa72f64eac91e225d11150c6) ) // no label + + ROM_REGION( 68501, "screen", 0 ) + ROM_LOAD("gk2000.svg", 0, 68501, CRC(80554c49) SHA1(88f06ec8f403eaaf7cbce4cc84807b5742ce7108) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1997, chessac, 0, 0, chessac, chessac, chessac_state, empty_init, "Saitek", "Kasparov Chess Academy", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/saitek/chesstrv.cpp b/src/mame/saitek/chesstrv.cpp index ebbd883449d5f..c5c27363dd370 100644 --- a/src/mame/saitek/chesstrv.cpp +++ b/src/mame/saitek/chesstrv.cpp @@ -212,8 +212,8 @@ static INPUT_PORTS_START( chesstrv ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LV / CS") // level/clear square - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("FP") // find position - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("EP") // enter position + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("FP") // find position + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("EP") // enter position PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("CB") // clear board PORT_START("IN.3") @@ -233,8 +233,8 @@ static INPUT_PORTS_START( chesstrvi ) PORT_MODIFY("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level / CS") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Find Position") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Enter Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Find Position") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Enter Position") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_MODIFY("IN.3") diff --git a/src/mame/saitek/companion2.cpp b/src/mame/saitek/companion2.cpp index 03889c6605ae4..9dcb5f6144828 100644 --- a/src/mame/saitek/companion2.cpp +++ b/src/mame/saitek/companion2.cpp @@ -301,7 +301,7 @@ static INPUT_PORTS_START( expchess ) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level / Sound") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play / PVP") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play / PVP") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") @@ -319,7 +319,7 @@ static INPUT_PORTS_START( compan2 ) PORT_MODIFY("IN.1") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Enter Position") PORT_MODIFY("IN.2") diff --git a/src/mame/saitek/ecbackg.cpp b/src/mame/saitek/ecbackg.cpp index 074e8b2f72030..047c8f32a68f0 100644 --- a/src/mame/saitek/ecbackg.cpp +++ b/src/mame/saitek/ecbackg.cpp @@ -446,7 +446,7 @@ static INPUT_PORTS_START( ecbackg ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_A) PORT_NAME("Double / Accept") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Reject") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Game Option") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index 621f3e868e673..277b98bc88628 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -11,7 +11,7 @@ same hardware. Hardware notes: - Hitachi H8/323 MCU, 20MHz XTAL - LCD with custom segments -- piezo, 16 leds, button sensors chessboard +- piezo, 16 LEDs, button sensors chessboard A13 MCU is used in: - Saitek GK 2000 (86071220X12) @@ -87,6 +87,8 @@ class gk2000_state : public driver_device template void lcd_segs_w(u8 data); void lcd_com_w(u8 data); + void standby(int state); + void p2_w(u8 data); u8 p4_r(); void p5_w(offs_t offset, u8 data, u8 mem_mask); @@ -104,8 +106,8 @@ void gk2000_state::machine_start() INPUT_CHANGED_MEMBER(gk2000_state::change_cpu_freq) { - // only 20MHz and 14MHz versions are known to exist, but the software supports others (-1 is invalid) - static const int xm[9] = { 8, 20, 24, 28, 32, -1, -1, -1, 14 }; // XTAL in MHz + // only 20MHz and 14MHz versions are known to exist, but the software supports others + static const int xm[9] = { 8, 20, 24, 28, 32, -1, -1, -1, 14 }; // XTAL in MHz (-1 is invalid) int mhz = xm[(count_leading_zeros_32(bitswap<8>(newval,0,1,2,3,4,5,6,7)) - 24) % 9]; if (mhz > 0) @@ -118,6 +120,24 @@ INPUT_CHANGED_MEMBER(gk2000_state::change_cpu_freq) I/O *******************************************************************************/ +// power + +void gk2000_state::standby(int state) +{ + // clear display + if (state) + { + m_lcd_pwm->clear(); + m_led_pwm->clear(); + } +} + +INPUT_CHANGED_MEMBER(gk2000_state::go_button) +{ + m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE); +} + + // LCD void gk2000_state::lcd_pwm_w(offs_t offset, u8 data) @@ -155,11 +175,6 @@ void gk2000_state::lcd_com_w(u8 data) // misc -INPUT_CHANGED_MEMBER(gk2000_state::go_button) -{ - m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE); -} - void gk2000_state::p2_w(u8 data) { // P20-P27: input mux (chessboard), led data @@ -219,7 +234,7 @@ void gk2000_state::main_map(address_map &map) static INPUT_PORTS_START( gk2000 ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Option") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Info") @@ -260,10 +275,12 @@ void gk2000_state::gk2000(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &gk2000_state::main_map); m_maincpu->nvram_enable_backup(true); m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery)); + m_maincpu->standby_cb().append(FUNC(gk2000_state::standby)); m_maincpu->write_port1().set(FUNC(gk2000_state::lcd_segs_w<0>)); m_maincpu->write_port2().set(FUNC(gk2000_state::p2_w)); m_maincpu->write_port3().set(FUNC(gk2000_state::lcd_segs_w<1>)); m_maincpu->read_port4().set(FUNC(gk2000_state::p4_r)); + m_maincpu->read_port5().set_constant(0xff); m_maincpu->write_port5().set(FUNC(gk2000_state::p5_w)); m_maincpu->read_port6().set_ioport("IN.3").invert(); m_maincpu->write_port6().set(FUNC(gk2000_state::lcd_com_w)); diff --git a/src/mame/saitek/intchess.cpp b/src/mame/saitek/intchess.cpp index 979111600d8a1..15c5be97055ab 100644 --- a/src/mame/saitek/intchess.cpp +++ b/src/mame/saitek/intchess.cpp @@ -253,7 +253,7 @@ static INPUT_PORTS_START( intchess ) // see comments for German version labels PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("D 4 / Rook") PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8 / Black") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Record") // Speichern - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Place") // Setzen + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Place") // Setzen PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Step") // Vor PORT_START("RESET") diff --git a/src/mame/saitek/mark5.cpp b/src/mame/saitek/mark5.cpp index 510a36b99c49f..9bd78ee7670ba 100644 --- a/src/mame/saitek/mark5.cpp +++ b/src/mame/saitek/mark5.cpp @@ -318,11 +318,11 @@ void mark5_state::mark6_map(address_map &map) static INPUT_PORTS_START( mark5 ) PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Enter Position") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Enter Position") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Draw") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Peripheral") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Next Simult") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Next Simult") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Swap") PORT_START("IN.1") diff --git a/src/mame/saitek/minichess.cpp b/src/mame/saitek/minichess.cpp index 3018503cecff5..404ac6ce35a16 100644 --- a/src/mame/saitek/minichess.cpp +++ b/src/mame/saitek/minichess.cpp @@ -161,7 +161,7 @@ static INPUT_PORTS_START( smchess ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G 7 / White") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8 / Black") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("FP") // find position + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("FP") // find position PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") diff --git a/src/mame/saitek/prisma.cpp b/src/mame/saitek/prisma.cpp index 0a4867903c242..8e2fc65206ac0 100644 --- a/src/mame/saitek/prisma.cpp +++ b/src/mame/saitek/prisma.cpp @@ -16,7 +16,7 @@ Hardware notes: - PCB label: ST9A-PE-001 - Hitachi H8/325 MCU, 20MHz XTAL - Epson SED1502F, LCD screen (same as simultano) -- piezo, 16+3 leds, button sensors chessboard +- piezo, 16+3 LEDs, button sensors chessboard In 1992, it was also sold by Tandy as Chess Champion 2150L, still manufactured by Saitek. Overall, the hardware is the same, but with a slower CPU (16MHz XTAL). @@ -76,7 +76,7 @@ class prisma_state : public driver_device u8 m_lcd_data = 0; u8 m_lcd_address = 0; - u8 m_lcd_write = 0; + u8 m_lcd_control = 0; u8 m_inp_mux = 0; u8 m_led_select = 0; u8 m_led_direct = 0; @@ -92,6 +92,7 @@ class prisma_state : public driver_device void p1_w(u8 data); void p2_w(u8 data); + u8 p3_r(); void p3_w(u8 data); void p4_w(u8 data); u8 p5_r(); @@ -107,7 +108,7 @@ void prisma_state::machine_start() // register for savestates save_item(NAME(m_lcd_data)); save_item(NAME(m_lcd_address)); - save_item(NAME(m_lcd_write)); + save_item(NAME(m_lcd_control)); save_item(NAME(m_inp_mux)); save_item(NAME(m_led_select)); save_item(NAME(m_led_direct)); @@ -117,7 +118,7 @@ INPUT_CHANGED_MEMBER(prisma_state::change_cpu_freq) { // 12MHz and 24MHz versions don't exist, but the software supports it static const XTAL freq[4] = { 16_MHz_XTAL, 20_MHz_XTAL, 24_MHz_XTAL, 12_MHz_XTAL }; - m_maincpu->set_unscaled_clock(freq[bitswap<2>(newval,7,0)] / 2); + m_maincpu->set_unscaled_clock(freq[bitswap<2>(newval,7,0)]); } @@ -179,8 +180,7 @@ void prisma_state::p1_w(u8 data) // P14: speaker out m_dac->level_w(BIT(data, 4)); - // P16: ext power - // (no need to emulate it) + // P16: ext power (no need to emulate it) } void prisma_state::p2_w(u8 data) @@ -190,6 +190,13 @@ void prisma_state::p2_w(u8 data) update_leds(); } +u8 prisma_state::p3_r() +{ + // P30-P37: LCD data (never reads here) + logerror("read from LCD\n"); + return 0xff; +} + void prisma_state::p3_w(u8 data) { // P30-P37: LCD data @@ -201,16 +208,16 @@ void prisma_state::p4_w(u8 data) // P40: LCD CS // P41: LCD RD // P42: LCD WR - if (~data & m_lcd_write && ~data & 1) + if (~data & m_lcd_control & 4 && ~data & 1) m_lcd->write(m_lcd_address, m_lcd_data); - m_lcd_write = data & 4; + m_lcd_control = data; } u8 prisma_state::p5_r() { u8 data = 0; - // P50,P52: read buttons + // P50-P52: read buttons for (int i = 0; i < 3; i++) if (m_inp_mux & m_inputs[i]->read()) data |= 1 << i; @@ -321,7 +328,9 @@ void prisma_state::prisma(machine_config &config) m_maincpu->standby_cb().append(FUNC(prisma_state::standby)); m_maincpu->write_port1().set(FUNC(prisma_state::p1_w)); m_maincpu->write_port2().set(FUNC(prisma_state::p2_w)); + m_maincpu->read_port3().set(FUNC(prisma_state::p3_r)); m_maincpu->write_port3().set(FUNC(prisma_state::p3_w)); + m_maincpu->read_port4().set_constant(0xff); m_maincpu->write_port4().set(FUNC(prisma_state::p4_w)); m_maincpu->read_port5().set(FUNC(prisma_state::p5_r)); m_maincpu->write_port5().set(FUNC(prisma_state::p5_w)); diff --git a/src/mame/saitek/risc2500.cpp b/src/mame/saitek/risc2500.cpp index 441c8115dcf9d..13bbe52792f7d 100644 --- a/src/mame/saitek/risc2500.cpp +++ b/src/mame/saitek/risc2500.cpp @@ -386,10 +386,10 @@ static INPUT_PORTS_START( risc2500 ) PORT_START("IN.5") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Play") PORT_CODE(KEYCODE_L) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Play") PORT_CODE(KEYCODE_P) PORT_START("IN.6") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("New Game") PORT_CODE(KEYCODE_N) PORT_START("IN.7") diff --git a/src/mame/saitek/turbo16k.cpp b/src/mame/saitek/turbo16k.cpp index 3e3d0e9a90838..d2fd77444cdf0 100644 --- a/src/mame/saitek/turbo16k.cpp +++ b/src/mame/saitek/turbo16k.cpp @@ -328,7 +328,7 @@ static INPUT_PORTS_START( turbo16k ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Set Up") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Multi Move") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") @@ -366,7 +366,7 @@ static INPUT_PORTS_START( conquist ) PORT_MODIFY("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Non Auto") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") diff --git a/src/mame/sega/lindbergh.cpp b/src/mame/sega/lindbergh.cpp index 0850b1cdd274b..c5215de11e6d9 100644 --- a/src/mame/sega/lindbergh.cpp +++ b/src/mame/sega/lindbergh.cpp @@ -591,7 +591,7 @@ ROM_START(hotdex) ROM_LOAD("317-0550-jpn.bin", 0, 0x2000, CRC(7e247f13) SHA1(d416b0e7742b32eb31443967e84ef93fc9e56dfb)) DISK_REGION("dvd") - DISK_IMAGE_READONLY("hotdex", 0, NO_DUMP) + DISK_IMAGE_READONLY("dvp-0063", 0, NO_DUMP) ROM_END ROM_START(primevah) @@ -619,6 +619,9 @@ ROM_START(hummerxt) ROM_REGION(0x2000, ":pic", 0) // PIC security id unknown ROM_LOAD("hummerextreme.bin", 0, 0x2000, CRC(524bc69a) SHA1(c79b6bd384196c169e40e623f4c80c8b9eb11f81)) + + DISK_REGION("dvd") + DISK_IMAGE_READONLY("dvp-0079", 0, NO_DUMP) ROM_END ROM_START(lbvbiosu) @@ -631,7 +634,7 @@ ROM_END } // anonymous namespace -GAME(1999, lindbios, 0, lindbergh, 0, lindbergh_state, empty_init, ROT0, "Sega", "Sega Lindbergh BIOS", MACHINE_IS_BIOS_ROOT) +GAME(2005, lindbios, 0, lindbergh, 0, lindbergh_state, empty_init, ROT0, "Sega", "Sega Lindbergh BIOS", MACHINE_IS_BIOS_ROOT) GAME(2005, hotd4, lindbios, lindbergh, 0, lindbergh_state, empty_init, ROT0, "Sega", "The House of the Dead 4 (Export) (Rev B)", MACHINE_NOT_WORKING|MACHINE_UNEMULATED_PROTECTION|MACHINE_NO_SOUND) GAME(2005, hotd4a, hotd4, lindbergh, 0, lindbergh_state, empty_init, ROT0, "Sega", "The House of the Dead 4 (Export) (Rev A)", MACHINE_NOT_WORKING|MACHINE_UNEMULATED_PROTECTION|MACHINE_NO_SOUND) GAME(2005, vf5, lindbios, lindbergh, 0, lindbergh_state, empty_init, ROT0, "Sega", "Virtua Fighter 5 (Export)", MACHINE_NOT_WORKING|MACHINE_UNEMULATED_PROTECTION|MACHINE_NO_SOUND) diff --git a/src/mame/sega/megatech.cpp b/src/mame/sega/megatech.cpp index eeb2d959a9a01..72572e6a6e591 100644 --- a/src/mame/sega/megatech.cpp +++ b/src/mame/sega/megatech.cpp @@ -48,8 +48,8 @@ Great Golf 610-0239-04 Great Soccer 610-0239-05 Out Run 171-5783 837-6963-06 610-0239-06 MPR-11078 (Mask) EPR-12368-06 (27256) n/a Alien Syndrome 171-5783 837-6963-07 610-0239-07 MPR-11194 (232011) EPR-12368-07 (27256) n/a -Shinobi 610-0239-08 -Fantasy Zone 610-0239-09 +Shinobi 171-5783 837-6963-08 610-0239-08 MPR-11706F (832011) EPR-12368-08 (27C256) n/a +Fantasy Zone 171-5783 837-6963-09 610-0239-09 MPR-10118 (831001) EPR-12368-09 (27C256) n/a After Burner 171-5784 837-6963-10 610-0239-10 315-5235 (custom) MPR-11271-T (834000) EPR-12368-10 (27256) Great Football 171-5783 837-6963-19 610-0239-19 MPR-10576F (831000) EPR-12368-19 (27256) n/a World Championship Soccer 171-5782 837-6963-21 610-0239-21 MPR-12607B (uPD23C4000) EPR-12368-21 (27256) n/a @@ -58,6 +58,7 @@ Ghouls'n Ghosts 171-5869A - 610-0239-23 MPR Super Hang On 171-5782 837-6963-24 610-0239-24 MPR-12640 (234000) EPR-12368-24 (27256) n/a Forgotten Worlds 171-5782 837-6963-26 610-0239-26 MPR-12672-H (Mask) EPR-12368-26 (27256) n/a The Revenge Of Shinobi 171-5782 837-6963-28 610-0239-28 MPR-12675 S44 (uPD23C4000) EPR-12368-28 (27C256) n/a +Parlour Games 171-5783 837-6963-29 610-0239-29 MPR-11404F (831001) EPR-12368-29 (27256) n/a Arnold Palmer Tour Golf 171-5782 837-6963-31 610-0239-31 MPR-12645F (834200A) EPR-12368-31 (27256) n/a Super Real Basketball 171-5782 837-6963-32 610-0239-32 MPR-12904F (838200A) EPR-12368-32 (27256) n/a Tommy Lasorda Baseball 171-5782 837-6963-35 610-0239-35 MPR-12706F (834200A) EPR-12368-35 (27256) n/a diff --git a/src/mame/sega/segaybd.cpp b/src/mame/sega/segaybd.cpp index cbd8c7285c07e..404e738aebe1a 100644 --- a/src/mame/sega/segaybd.cpp +++ b/src/mame/sega/segaybd.cpp @@ -2744,6 +2744,62 @@ ROM_START( rchasej ) ROM_LOAD( "mpr-13994.105", 0x100000, 0x80000, CRC(76095538) SHA1(aab830e3675116c475fe69e0e991118c045b131b) ) ROM_END +ROM_START( rchasejb ) // only the "suby" CPU ROMs were updated (?) + ROM_REGION( 0x080000, "maincpu", 0 ) // M + ROM_LOAD16_BYTE( "epr-13986.25", 0x000000, 0x20000, CRC(388b2365) SHA1(0f006f9120b96b8d8be968878ce1d6dd853cd977) ) + ROM_LOAD16_BYTE( "epr-13985.24", 0x000001, 0x20000, CRC(14dba5d4) SHA1(ad09c55273ab1105630f2f76019aedc234fb9292) ) + ROM_LOAD16_BYTE( "epr-13988.27", 0x040000, 0x20000, CRC(dc1cd5a4) SHA1(3b2b6afbeb7daa7c0cc75279bc495221c2508e25) ) + ROM_LOAD16_BYTE( "epr-13987.26", 0x040001, 0x20000, CRC(43be9e60) SHA1(107a9c126c2bff9030fe621f6b4ab8f29c994ef2) ) + + ROM_REGION( 0x040000, "subx", 0 ) // X + ROM_LOAD16_BYTE( "epr-13992a.81", 0x000000, 0x20000, CRC(c5d525b6) SHA1(1fab7f761be67b67ee346a1af1f1fe12aef87dc5) ) + ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) ) + + ROM_REGION( 0x040000, "suby", 0 ) // Y + ROM_LOAD16_BYTE( "epr-13990b.54", 0x000000, 0x20000, CRC(eeffbeeb) SHA1(5f2f808cd37158d14dd2e4a0a68a41514d3954fb) ) + ROM_LOAD16_BYTE( "epr-13989b.53", 0x000001, 0x20000, CRC(fea9f1e9) SHA1(54daad8bf25b17c494615fd4ec619d9693d85ba0) ) + + ROM_REGION16_BE( 0x080000, "bsprites", 0 ) + ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) ) + ROM_LOAD16_BYTE( "mpr-13997.14", 0x000001, 0x40000, CRC(1fdf1b87) SHA1(ed46af0f72081d545015b73a8d12240664f29506) ) + + ROM_REGION64_BE( 0xc00000, "ysprites", 0) + ROM_LOAD64_BYTE( "mpr-14021.67", 0x000000, 0x80000, CRC(9fa88781) SHA1(a035fd0fe1d37a589adf3a5029c20d237d5cc827) ) + ROM_LOAD64_BYTE( "mpr-14022.75", 0x000001, 0x80000, CRC(49e824bb) SHA1(c1330719b5718aa664b5788244d8cb7b7103a57c) ) + ROM_LOAD64_BYTE( "mpr-14009.63", 0x000002, 0x80000, CRC(35b5187e) SHA1(6f0f6471c4135d07a2c852cdc50322b99176712e) ) + ROM_LOAD64_BYTE( "mpr-14010.71", 0x000003, 0x80000, CRC(9a538b9b) SHA1(cd84a39bd3858fa6c1d8eb4a349d939261cea6b6) ) + ROM_LOAD64_BYTE( "mpr-14023.86", 0x000004, 0x80000, CRC(e11c6c67) SHA1(839e71690e75e47d11b758f5b525452bcc75b823) ) + ROM_LOAD64_BYTE( "mpr-14024.114", 0x000005, 0x80000, CRC(16344535) SHA1(a9bd101ae93c24a2e8002ad6a111cf0d0d3b1a64) ) + ROM_LOAD64_BYTE( "mpr-14011.82", 0x000006, 0x80000, CRC(78e9983b) SHA1(c0f6577b55acda2cc8cdf0884d5c0517f79de4e9) ) + ROM_LOAD64_BYTE( "mpr-14012.110", 0x000007, 0x80000, CRC(e9daa1a4) SHA1(24ad782e88a586fbb31f7ad86be4cdeb38823102) ) + + ROM_LOAD64_BYTE( "mpr-14017.66", 0x400000, 0x80000, CRC(b83df159) SHA1(f0cf99e6ddae1d26fd68240a731f3e28e9c6073b) ) + ROM_LOAD64_BYTE( "mpr-14018.74", 0x400001, 0x80000, CRC(76dbe9ce) SHA1(2f5af8d015cf8fb90a0862bc37235bc20d4dac0d) ) + ROM_LOAD64_BYTE( "mpr-14005.62", 0x400002, 0x80000, CRC(9e998209) SHA1(c0d39d11d554fd6a43db77ccf96ac04dd634edff) ) + ROM_LOAD64_BYTE( "mpr-14006.70", 0x400003, 0x80000, CRC(2caddf1a) SHA1(a2e891e65c7cd156a3131a084ff51ae9b1663bc0) ) + ROM_LOAD64_BYTE( "mpr-14019.85", 0x400004, 0x80000, CRC(b15e19ff) SHA1(947c35301875b4842835f2ba6aca216f087a3fc7) ) + ROM_LOAD64_BYTE( "mpr-14020.113", 0x400005, 0x80000, CRC(84c7008f) SHA1(b92f3c636c5d91c5b1c6090a48be7bb1be6b927e) ) + ROM_LOAD64_BYTE( "mpr-14007.81", 0x400006, 0x80000, CRC(c3cf5faa) SHA1(02bca1b248fcb6313cd529ca2aa0f7516177166b) ) + ROM_LOAD64_BYTE( "mpr-14008.109", 0x400007, 0x80000, CRC(7e91beb2) SHA1(bc1a7ce68d6b825daf93ca437dda803857cee0a2) ) + + ROM_LOAD64_BYTE( "mpr-14013.65", 0x800000, 0x80000, CRC(31dbb2c3) SHA1(3efeff785d78056e2615dc2267f7bb80a6d4c663) ) + ROM_LOAD64_BYTE( "mpr-14014.73", 0x800001, 0x80000, CRC(7e68257d) SHA1(600d1066cfa83f5df46e240a473a8f04179e70f8) ) + ROM_LOAD64_BYTE( "mpr-14001.61", 0x800002, 0x80000, CRC(71031ad0) SHA1(02b6240461d66907199f846310e72d37faa5fb50) ) + ROM_LOAD64_BYTE( "mpr-14002.69", 0x800003, 0x80000, CRC(27e70a5e) SHA1(fa767f6cc8e46c0e804c37666a8499376c09b025) ) + ROM_LOAD64_BYTE( "mpr-14015.84", 0x800004, 0x80000, CRC(7540bf85) SHA1(e8f9208aea6ecedb6ae810a362476cdf1d424319) ) + ROM_LOAD64_BYTE( "mpr-14016.112", 0x800005, 0x80000, CRC(7d87b94d) SHA1(4ef5b7b114c25b9e274e3f3dd7e3d7bd29d2d8b9) ) + ROM_LOAD64_BYTE( "mpr-14003.80", 0x800006, 0x80000, CRC(87725d74) SHA1(d284512ad15362a886072aaa1a3af98f7a0bddf9) ) + ROM_LOAD64_BYTE( "mpr-14004.108", 0x800007, 0x80000, CRC(73477291) SHA1(1fe9d7666d89ee55a0178dceb7cfea7ce94b9e18) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 sound CPU + ROM_LOAD( "epr-13993.102", 0x000000, 0x10000, CRC(7cc3b543) SHA1(c5e6a2dca891d0b6528e6d66ccd18b24ed4a9464) ) + + ROM_REGION( 0x200000, "pcm", ROMREGION_ERASEFF ) // SegaPCM samples + ROM_LOAD( "mpr-13996.107", 0x000000, 0x80000, CRC(345f5a41) SHA1(d414c3485ba31863c2b36282756709e06a41d262) ) + ROM_LOAD( "mpr-13995.106", 0x080000, 0x80000, CRC(f604c270) SHA1(02023786fec2f2702c2f19f51aff5b7e4928ae91) ) + ROM_LOAD( "mpr-13994.105", 0x100000, 0x80000, CRC(76095538) SHA1(aab830e3675116c475fe69e0e991118c045b131b) ) +ROM_END + //************************************************************************************************************************* //************************************************************************************************************************* @@ -2983,6 +3039,7 @@ GAMEL(1988, pdriftl, 0, yboard_link, pdriftl, segaybd_state, init_pd GAME( 1991, rchase, 0, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, rchasej, rchase, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, rchasejb, rchase, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (Japan, Rev B)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, strkfgtr, 0, yboard, strkfgtr, segaybd_state, init_gloc, ROT0, "Sega", "Strike Fighter (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, strkfgtrj, strkfgtr, yboard, strkfgtr, segaybd_state, init_gloc, ROT0, "Sega", "Strike Fighter (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/deadang.cpp b/src/mame/seibu/deadang.cpp index 899e178c20a91..67b53d66f0ed8 100644 --- a/src/mame/seibu/deadang.cpp +++ b/src/mame/seibu/deadang.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood +// copyright-holders: Bryan McPhail, David Haywood + /*************************************************************************** Pop'N Run (c) 1987 Seibu Kaihatsu & Yukai Tsukai @@ -36,7 +37,7 @@ Seibu SEI0100 YM3931 - 3.579545MHz [14.31818/4] VSync 60Hz HSync 15.37kHz -Gang Hunter as an additional daughter card attached to the top board call SEI-8712 GUN +Gang Hunter has an additional daughter card attached to the top board called SEI-8712 GUN 2008-08 Dip locations and factory settings verified with US manual @@ -44,63 +45,489 @@ Dip locations and factory settings verified with US manual */ #include "emu.h" -#include "deadang.h" + +#include "seibusound.h" #include "cpu/nec/nec.h" +#include "machine/timer.h" #include "machine/watchdog.h" #include "sound/msm5205.h" +#include "sound/ymopm.h" #include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class deadang_state : public driver_device +{ +public: + deadang_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_scroll_ram(*this, "scroll_ram"), + m_videoram(*this, "videoram"), + m_video_data(*this, "video_data"), + m_spriteram(*this, "spriteram"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_seibu_sound(*this, "seibu_sound"), + m_maincpu(*this, "maincpu"), + m_subcpu(*this, "sub"), + m_audiocpu(*this, "audiocpu"), + m_adpcm(*this, "adpcm%u", 1U), + m_track(*this, "TRACK%c", 'X') + { } + + void deadang(machine_config &config); + void ghunter(machine_config &config); + + void init_adpcm(); + void init_ghunter(); + +protected: + virtual void video_start() override; + + required_shared_ptr m_scroll_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_video_data; + required_shared_ptr m_spriteram; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_seibu_sound; + required_device m_maincpu; + required_device m_subcpu; + required_device m_audiocpu; + optional_device_array m_adpcm; + + optional_ioport_array<2> m_track; + + uint8_t m_tilebank = 0; + uint8_t m_oldtilebank = 0; + + tilemap_t *m_pf_layer[3]{}; + tilemap_t *m_text_layer = nullptr; + + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + uint16_t ghunter_trackball_low_r(); + uint16_t ghunter_trackball_high_r(); + + void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + TILEMAP_MAPPER_MEMBER(bg_scan); + TILE_GET_INFO_MEMBER(get_pf1_tile_info); + TILE_GET_INFO_MEMBER(get_pf3_tile_info); + TILE_GET_INFO_MEMBER(get_pf2_tile_info); + TILE_GET_INFO_MEMBER(get_text_tile_info); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(main_scanline); + TIMER_DEVICE_CALLBACK_MEMBER(sub_scanline); + + void main_map(address_map &map); + void ghunter_main_map(address_map &map); + void sound_decrypted_opcodes_map(address_map &map); + void sound_map(address_map &map); + void sub_map(address_map &map); +}; + +class popnrun_state : public deadang_state +{ +public: + popnrun_state(const machine_config &mconfig, device_type type, const char *tag) : + deadang_state(mconfig, type, tag) + { } + + void popnrun(machine_config &config); + +protected: + virtual void video_start() override; + +private: + TILE_GET_INFO_MEMBER(get_text_tile_info); + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void main_map(address_map &map); + void sub_map(address_map &map); + void sound_map(address_map &map); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +// video + +/******************************************************************************/ + +void deadang_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_video_data[offset]); + m_pf_layer[0]->mark_tile_dirty(offset ); +} + +void deadang_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_text_layer->mark_tile_dirty(offset ); +} + +void popnrun_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_text_layer->mark_tile_dirty(offset / 2); +} + +void deadang_state::bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if (ACCESSING_BITS_0_7) + { + m_tilebank = data & 1; + if (m_tilebank != m_oldtilebank) + { + m_oldtilebank = m_tilebank; + m_pf_layer[0]->mark_all_dirty(); + } + } +} + +/******************************************************************************/ + +TILEMAP_MAPPER_MEMBER(deadang_state::bg_scan) +{ + return (col & 0xf) | ((row & 0xf) << 4) | ((col & 0x70) << 4) | ((row & 0xf0) << 7); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf3_tile_info) +{ + const uint16_t *bgMap = (const uint16_t *)memregion("bgmap1")->base(); + int const code = bgMap[tile_index]; + tileinfo.set(4, code & 0x7ff, code >> 12, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf2_tile_info) +{ + const uint16_t *bgMap = (const uint16_t *)memregion("bgmap2")->base(); + int const code = bgMap[tile_index]; + tileinfo.set(3, code & 0x7ff, code >> 12, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf1_tile_info) +{ + int tile = m_video_data[tile_index]; + int const color = tile >> 12; + tile &= 0xfff; + + tileinfo.set(2, tile + m_tilebank * 0x1000, color, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_text_tile_info) +{ + int const tile = (m_videoram[tile_index] & 0xff) | ((m_videoram[tile_index] >> 6) & 0x300); + int const color = (m_videoram[tile_index] >> 8) & 0xf; + + tileinfo.set(0, tile, color, 0); +} + +void deadang_state::video_start() +{ + m_pf_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_pf_layer[1]->set_transparent_pen(15); + m_pf_layer[0]->set_transparent_pen(15); + m_text_layer->set_transparent_pen(15); + + save_item(NAME(m_tilebank)); + save_item(NAME(m_oldtilebank)); +} + + +TILE_GET_INFO_MEMBER(popnrun_state::get_text_tile_info) +{ + int tile = (m_videoram[tile_index * 2 + 0] & 0xff) << 1; // | ((m_videoram[tile_index] >> 6) & 0x300); + int const attr = (m_videoram[tile_index * 2 + 1]); + // TODO: not entirely correct (title screen/ranking colors) + // might be down to bitplanes too + int const color = (attr & 3) ^ 1; + if (attr & 0x40) + tile |= 1; -/* Read/Write Handlers */ + tileinfo.set(0, tile, color, 0); +} + +void popnrun_state::video_start() +{ + m_pf_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(popnrun_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(popnrun_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_pf_layer[1]->set_transparent_pen(0); + m_pf_layer[0]->set_transparent_pen(0); + m_text_layer->set_transparent_pen(0); + + save_item(NAME(m_tilebank)); + save_item(NAME(m_oldtilebank)); +} + + +void deadang_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < 0x800 / 2; offs += 4) + { + // Don't draw empty sprite table entries + if ((m_spriteram[offs + 3] & 0xff00) != 0xf00) continue; + + int pri = 0; + + switch (m_spriteram[offs + 2] & 0xc000) + { + default: + case 0xc000: pri = 0; break; // Unknown + case 0x8000: pri = 0; break; // Over all playfields + case 0x4000: pri = 0xf0; break; // Under top playfield + case 0x0000: pri = 0xf0 | 0xcc; break; // Under middle playfield + } + + int fx = m_spriteram[offs + 0] & 0x2000; + int fy = m_spriteram[offs + 0] & 0x4000; + int y = m_spriteram[offs + 0] & 0xff; + int x = m_spriteram[offs + 2] & 0xff; + if (fy) fy = 0; else fy = 1; + if (m_spriteram[offs + 2] & 0x100) x = 0 - (0xff - x); + + int const color = (m_spriteram[offs + 1] >> 12) & 0xf; + int const sprite = m_spriteram[offs + 1] & 0xfff; + + if (flip_screen()) + { + x = 240 - x; + y = 240 - y; + if (fx) fx = 0; else fx = 1; + if (fy) fy = 0; else fy = 1; + } + + m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, + sprite, + color, fx, fy, x, y, + screen.priority(), pri, 15); + } +} + +uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // Setup the tilemaps + m_pf_layer[2]->set_scrolly(0, ((m_scroll_ram[0x01] & 0xf0) << 4) + ((m_scroll_ram[0x02] & 0x7f) << 1) + ((m_scroll_ram[0x02] & 0x80) >> 7)); + m_pf_layer[2]->set_scrollx(0, ((m_scroll_ram[0x09] & 0xf0) << 4) + ((m_scroll_ram[0x0a] & 0x7f) << 1) + ((m_scroll_ram[0x0a] & 0x80) >> 7)); + m_pf_layer[0]->set_scrolly(0, ((m_scroll_ram[0x11] & 0x10) << 4) + ((m_scroll_ram[0x12] & 0x7f) << 1) + ((m_scroll_ram[0x12] & 0x80) >> 7)); + m_pf_layer[0]->set_scrollx(0, ((m_scroll_ram[0x19] & 0x10) << 4) + ((m_scroll_ram[0x1a] & 0x7f) << 1) + ((m_scroll_ram[0x1a] & 0x80) >> 7)); + m_pf_layer[1]->set_scrolly(0, ((m_scroll_ram[0x21] & 0xf0) << 4) + ((m_scroll_ram[0x22] & 0x7f) << 1) + ((m_scroll_ram[0x22] & 0x80) >> 7)); + m_pf_layer[1]->set_scrollx(0, ((m_scroll_ram[0x29] & 0xf0) << 4) + ((m_scroll_ram[0x2a] & 0x7f) << 1) + ((m_scroll_ram[0x2a] & 0x80) >> 7)); + + /* Control byte: + 0x01: Background playfield disable + 0x02: Middle playfield disable + 0x04: Top playfield disable + 0x08: ? Toggles at start of game + 0x10: Sprite disable + 0x20: Unused? + 0x40: Flipscreen + 0x80: Always set? + */ + m_pf_layer[2]->enable(!(m_scroll_ram[0x34] & 1)); + m_pf_layer[0]->enable(!(m_scroll_ram[0x34] & 2)); + m_pf_layer[1]->enable(!(m_scroll_ram[0x34] & 4)); + flip_screen_set(m_scroll_ram[0x34] & 0x40); + + bitmap.fill(m_palette->black_pen(), cliprect); + screen.priority().fill(0, cliprect); + m_pf_layer[2]->draw(screen, bitmap, cliprect, 0, 1); + m_pf_layer[0]->draw(screen, bitmap, cliprect, 0, 2); + m_pf_layer[1]->draw(screen, bitmap, cliprect, 0, 4); + if (!(m_scroll_ram[0x34] & 0x10)) draw_sprites(screen, bitmap, cliprect); + m_text_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + +void popnrun_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // TODO: might have more bits in either 0x3800-0x3bff or 0x3e00-0x3fff + for (int offs = 0; offs < 0x200 / 2; offs += 2) + { + // Don't draw empty sprite table entries + //if ((m_spriteram[offs + 3] & 0xff00) != 0xf00) continue; + + int pri = 0; +#if 0 + switch (m_spriteram[offs + 2] & 0xc000) + { + default: + case 0xc000: pri = 0; break; // Unknown + case 0x8000: pri = 0; break; // Over all playfields + case 0x4000: pri = 0xf0; break; // Under top playfield + case 0x0000: pri = 0xf0 | 0xcc; break; // Under middle playfield + } +#endif + + int fx = m_spriteram[offs + 0] & 0x4000; + int fy = m_spriteram[offs + 0] & 0x8000; + int y = m_spriteram[offs + 1] & 0xff; + int x = (m_spriteram[offs + 1] >> 8) & 0xff; +#if 0 + if (fy) fy = 0; else fy = 1; + if (m_spriteram[offs + 2] & 0x100) x = 0 - (0xff - x); +#endif + + int const color = (m_spriteram[offs + 0] >> 12) & 0x7; + int const sprite = m_spriteram[offs + 0] & 0xfff; + +#if 0 + if (flip_screen()) + { + x = 240 - x; + y = 240 - y; + if (fx) fx = 0; else fx = 1; + if (fy) fy = 0; else fy = 1; + } +#endif + + m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, + sprite, + color, fx, fy, x, y, + screen.priority(), pri, 0); + } +} + +uint32_t popnrun_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // TODO: different scroll RAM hookup + // 0x18 seems to enable the various layers + // Setup the tilemaps +// m_pf_layer[2]->set_scrolly(0, ((m_scroll_ram[0x01] & 0xf0) << 4) + ((m_scroll_ram[0x02] & 0x7f) << 1) + ((m_scroll_ram[0x02] & 0x80) >> 7)); +// m_pf_layer[2]->set_scrollx(0, ((m_scroll_ram[0x09] & 0xf0) << 4) + ((m_scroll_ram[0x0a] & 0x7f) << 1) + ((m_scroll_ram[0x0a] & 0x80) >> 7)); +// m_pf_layer[0]->set_scrolly(0, ((m_scroll_ram[0x11] & 0x10) << 4) + ((m_scroll_ram[0x12] & 0x7f) << 1) + ((m_scroll_ram[0x12] & 0x80) >> 7)); +// m_pf_layer[0]->set_scrollx(0, ((m_scroll_ram[0x19] & 0x10) << 4) + ((m_scroll_ram[0x1a] & 0x7f) << 1) + ((m_scroll_ram[0x1a] & 0x80) >> 7)); +// m_pf_layer[1]->set_scrolly(0, ((m_scroll_ram[0x21] & 0xf0) << 4) + ((m_scroll_ram[0x22] & 0x7f) << 1) + ((m_scroll_ram[0x22] & 0x80) >> 7)); +// m_pf_layer[1]->set_scrollx(0, ((m_scroll_ram[0x29] & 0xf0) << 4) + ((m_scroll_ram[0x2a] & 0x7f) << 1) + ((m_scroll_ram[0x2a] & 0x80) >> 7)); + + m_pf_layer[2]->enable(!(m_scroll_ram[0x34] & 1)); + m_pf_layer[0]->enable(!(m_scroll_ram[0x34] & 2)); + m_pf_layer[1]->enable(!(m_scroll_ram[0x34] & 4)); +// flip_screen_set(m_scroll_ram[0x34]&0x40 ); + + bitmap.fill(1, cliprect); + screen.priority().fill(0, cliprect); + // 32 pixels? +// int scrollx = (m_scroll_ram[0x4 / 2] & 0x0f); + + // debug tilemap code + // this is likely to be collision data + for (int x = 0; x < 16; x++) + { + for (int y = 0; y < 8; y++) + { + int tile = m_video_data[y + x * 8 + 0xc0] & 0xff; + int res_x, res_y; + + if (tile != 0) + { + res_x = (x * 16) & 0xff; + res_y = y * 32; + //if (cliprect.contains(res_x, res_y)) + bitmap.plot_box(res_x, res_y, 16, 16, tile + 0x10); + } + + tile = m_video_data[y + x * 8 + 0xc0] >> 8; + + if (tile != 0) + { + res_x = (x * 16) & 0xff; + res_y = y * 32 + 16; + //if (cliprect.contains(res_x, res_y)) + bitmap.plot_box(res_x, res_y, 16, 16, tile + 0x10); + } + } + } + + //m_pf_layer[2]->draw(screen, bitmap, cliprect, 0, 1); + //m_pf_layer[0]->draw(screen, bitmap, cliprect, 0, 2); + //m_pf_layer[1]->draw(screen, bitmap, cliprect, 0, 4); + if (m_scroll_ram[0x18 / 2] & 0x1) + draw_sprites(screen, bitmap, cliprect); + m_text_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +// machine + +// Read/Write Handlers uint16_t deadang_state::ghunter_trackball_low_r() { - return (ioport("TRACKX")->read() & 0xff) | ((ioport("TRACKY")->read() & 0xff) << 8); + return (m_track[0]->read() & 0xff) | ((m_track[1]->read() & 0xff) << 8); } uint16_t deadang_state::ghunter_trackball_high_r() { - return ((ioport("TRACKX")->read() & 0x0f00) >> 4) | (ioport("TRACKY")->read() & 0x0f00); + return ((m_track[0]->read() & 0x0f00) >> 4) | (m_track[1]->read() & 0x0f00); } -/* Memory Maps */ +// Memory Maps void deadang_state::main_map(address_map &map) { map(0x00000, 0x037ff).ram(); - map(0x03800, 0x03fff).ram().share("spriteram"); + map(0x03800, 0x03fff).ram().share(m_spriteram); map(0x04000, 0x04fff).ram().share("share1"); map(0x05000, 0x05fff).nopw(); map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff); map(0x06010, 0x07fff).nopw(); - map(0x08000, 0x087ff).w(FUNC(deadang_state::text_w)).share("videoram"); + map(0x08000, 0x087ff).w(FUNC(deadang_state::text_w)).share(m_videoram); map(0x08800, 0x0bfff).nopw(); map(0x0a000, 0x0a001).portr("P1_P2"); map(0x0a002, 0x0a003).portr("DSW"); map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0d000, 0x0dfff).nopw(); - map(0x0e000, 0x0e0ff).ram().share("scroll_ram"); + map(0x0e000, 0x0e0ff).ram().share(m_scroll_ram); map(0x0e100, 0x0ffff).nopw(); map(0xc0000, 0xfffff).rom(); } -void popnrun_state::popnrun_main_map(address_map &map) +void deadang_state::ghunter_main_map(address_map &map) +{ + main_map(map); + + map(0x80000, 0x80001).r(FUNC(deadang_state::ghunter_trackball_low_r)); + map(0xb0000, 0xb0001).r(FUNC(deadang_state::ghunter_trackball_high_r)); +} + +void popnrun_state::main_map(address_map &map) { map(0x00000, 0x03bff).ram(); - map(0x03c00, 0x03dff).ram().share("spriteram"); + map(0x03c00, 0x03dff).ram().share(m_spriteram); map(0x03e00, 0x03fff).ram(); map(0x04000, 0x04fff).ram().share("share1"); map(0x05000, 0x05fff).nopw(); map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff); map(0x06010, 0x07fff).nopw(); - map(0x08000, 0x08fff).ram().w(FUNC(popnrun_state::popnrun_text_w)).share("videoram"); + map(0x08000, 0x08fff).ram().w(FUNC(popnrun_state::text_w)).share(m_videoram); map(0x0a000, 0x0a001).portr("P1_P2"); map(0x0a002, 0x0a003).portr("DSW"); map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0d000, 0x0dfff).nopw(); - map(0x0e000, 0x0e0ff).ram().share("scroll_ram"); + map(0x0e000, 0x0e0ff).ram().share(m_scroll_ram); map(0x0e100, 0x0ffff).nopw(); map(0xc0000, 0xfffff).rom(); } @@ -108,16 +535,16 @@ void popnrun_state::popnrun_main_map(address_map &map) void deadang_state::sub_map(address_map &map) { map(0x00000, 0x037ff).ram(); - map(0x03800, 0x03fff).ram().w(FUNC(deadang_state::foreground_w)).share("video_data"); + map(0x03800, 0x03fff).ram().w(FUNC(deadang_state::foreground_w)).share(m_video_data); map(0x04000, 0x04fff).ram().share("share1"); map(0x08000, 0x08001).w(FUNC(deadang_state::bank_w)); map(0x0c000, 0x0c001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0xe0000, 0xfffff).rom(); } -void popnrun_state::popnrun_sub_map(address_map &map) +void popnrun_state::sub_map(address_map &map) { - map(0x00000, 0x003ff).ram().w(FUNC(deadang_state::foreground_w)).share("video_data"); + map(0x00000, 0x003ff).ram().w(FUNC(popnrun_state::foreground_w)).share(m_video_data); map(0x00400, 0x03fff).ram(); map(0x04000, 0x04fff).ram().share("share1"); map(0xe0000, 0xfffff).rom(); @@ -131,23 +558,23 @@ void deadang_state::sound_map(address_map &map) map(0x4001, 0x4001).w(m_seibu_sound, FUNC(seibu_sound_device::irq_clear_w)); map(0x4002, 0x4002).w(m_seibu_sound, FUNC(seibu_sound_device::rst10_ack_w)); map(0x4003, 0x4003).w(m_seibu_sound, FUNC(seibu_sound_device::rst18_ack_w)); - map(0x4005, 0x4006).w(m_adpcm1, FUNC(seibu_adpcm_device::adr_w)); + map(0x4005, 0x4006).w(m_adpcm[0], FUNC(seibu_adpcm_device::adr_w)); map(0x4007, 0x4007).w(m_seibu_sound, FUNC(seibu_sound_device::bank_w)); map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); map(0x4013, 0x4013).portr("COIN"); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); - map(0x401a, 0x401a).w(m_adpcm1, FUNC(seibu_adpcm_device::ctl_w)); + map(0x401a, 0x401a).w(m_adpcm[0], FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); - map(0x6005, 0x6006).w(m_adpcm2, FUNC(seibu_adpcm_device::adr_w)); + map(0x6005, 0x6006).w(m_adpcm[1], FUNC(seibu_adpcm_device::adr_w)); map(0x6008, 0x6009).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); - map(0x601a, 0x601a).w(m_adpcm2, FUNC(seibu_adpcm_device::ctl_w)); + map(0x601a, 0x601a).w(m_adpcm[1], FUNC(seibu_adpcm_device::ctl_w)); map(0x8000, 0xffff).bankr("seibu_bank1"); } // Air Raid sound config with extra ROM bank -void popnrun_state::popnrun_sound_map(address_map &map) +void popnrun_state::sound_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::data_r)); map(0x2000, 0x27ff).ram(); @@ -172,10 +599,10 @@ void deadang_state::sound_decrypted_opcodes_map(address_map &map) } -/* Input Ports */ +// Input Ports static INPUT_PORTS_START( deadang ) - SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ + SEIBU_COIN_INPUTS // coin inputs read through sound CPU PORT_START("P1_P2") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) @@ -259,13 +686,13 @@ static INPUT_PORTS_START( ghunter ) PORT_BIT( 0x0fff, 0x0000, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_PLAYER(1) INPUT_PORTS_END -/* Graphics Layouts */ +// Graphics Layouts static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters RGN_FRAC(1,2), - 4, /* 4 bits per pixel */ + 4, // 4 bits per pixel { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 }, { STEP4(3,-1), STEP4(11,-1) }, { STEP8(0,16) }, @@ -274,9 +701,9 @@ static const gfx_layout charlayout = static const gfx_layout spritelayout = { - 16,16, /* 16*16 tiles */ + 16,16, // 16*16 tiles RGN_FRAC(1,1), - 4, /* 4 bits per pixel */ + 4, // 4 bits per pixel { 8,12,0,4}, { STEP4(3,-1), STEP4(19,-1), STEP4(512+3,-1), STEP4(512+19,-1) }, { STEP16(0,32) }, @@ -285,9 +712,9 @@ static const gfx_layout spritelayout = static const gfx_layout popnrun_charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters RGN_FRAC(1,1), - 2, /* 2 bits per pixel */ + 2, // 2 bits per pixel { 4, 0 }, { STEP4(8,1), STEP4(0,1) }, { STEP8(0,16) }, @@ -298,9 +725,9 @@ static const gfx_layout popnrun_charlayout = // TODO: this is wrong static const gfx_layout popnrun_spritelayout = { - 16,16, /* 16*16 tiles */ + 16,16, // 16*16 tiles RGN_FRAC(1,1), - 2, /* 4 bits per pixel */ + 2, // 4 bits per pixel { 0,4 }, { STEP4(0,1), STEP4(16,1), STEP4(512,1), STEP4(512+16,1) }, { STEP16(0,32) }, @@ -311,60 +738,60 @@ static const gfx_layout popnrun_spritelayout = /* Graphics Decode Information */ static GFXDECODE_START( gfx_deadang ) - GFXDECODE_ENTRY( "gfx1", 0x000000, charlayout, 512, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x000000, spritelayout, 768, 16 ) - GFXDECODE_ENTRY( "gfx3", 0x000000, spritelayout, 1024, 16 ) - GFXDECODE_ENTRY( "gfx4", 0x000000, spritelayout, 256, 16 ) - GFXDECODE_ENTRY( "gfx5", 0x000000, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "chars", 0x000000, charlayout, 512, 16 ) + GFXDECODE_ENTRY( "sprites", 0x000000, spritelayout, 768, 16 ) + GFXDECODE_ENTRY( "tiles1", 0x000000, spritelayout, 1024, 16 ) + GFXDECODE_ENTRY( "tiles2", 0x000000, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "tiles3", 0x000000, spritelayout, 0, 16 ) GFXDECODE_END static GFXDECODE_START( gfx_popnrun ) - GFXDECODE_ENTRY( "gfx1", 0x000000, popnrun_charlayout, 0x20, 4 ) + GFXDECODE_ENTRY( "chars", 0x000000, popnrun_charlayout, 0x20, 4 ) // TODO: probably runs on ROM based palette or just uses the first three entries? - GFXDECODE_ENTRY( "gfx2", 0x000000, spritelayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx3", 0x000000, spritelayout, 1024, 16 ) - GFXDECODE_ENTRY( "gfx4", 0x000000, spritelayout, 256, 16 ) - GFXDECODE_ENTRY( "gfx5", 0x000000, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "sprites", 0x000000, spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "tiles1", 0x000000, spritelayout, 1024, 16 ) + GFXDECODE_ENTRY( "tiles2", 0x000000, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "tiles3", 0x000000, spritelayout, 0, 16 ) GFXDECODE_END -/* Interrupt Generators */ +// Interrupt Generators TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::main_scanline) { - int scanline = param; + int const scanline = param; - if(scanline == 240) // vblank-out irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xc4/4); // V30 + if (scanline == 240) // vblank-out irq + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xc4 / 4); // V30 - if(scanline == 0) // vblank-in irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xc8/4); // V30 + if (scanline == 0) // vblank-in irq + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xc8 / 4); // V30 } TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::sub_scanline) { - int scanline = param; + int const scanline = param; - if(scanline == 240) // vblank-out irq - m_subcpu->set_input_line_and_vector(0, HOLD_LINE,0xc4/4); // V30 + if (scanline == 240) // vblank-out irq + m_subcpu->set_input_line_and_vector(0, HOLD_LINE, 0xc4 / 4); // V30 - if(scanline == 0) // vblank-in irq - m_subcpu->set_input_line_and_vector(0, HOLD_LINE,0xc8/4); // V30 + if (scanline == 0) // vblank-in irq + m_subcpu->set_input_line_and_vector(0, HOLD_LINE, 0xc8 / 4); // V30 } -/* Machine Drivers */ +// Machine Drivers void deadang_state::deadang(machine_config &config) { - /* basic machine hardware */ - V30(config, m_maincpu, XTAL(16'000'000)/2); /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ + // basic machine hardware + V30(config, m_maincpu, XTAL(16'000'000) / 2); // Sony 8623h9 CXQ70116D-8 (V30 compatible) m_maincpu->set_addrmap(AS_PROGRAM, &deadang_state::main_map); TIMER(config, "scantimer1").configure_scanline(FUNC(deadang_state::main_scanline), "screen", 0, 1); - V30(config, m_subcpu, XTAL(16'000'000)/2); /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ + V30(config, m_subcpu, XTAL(16'000'000) / 2); // Sony 8623h9 CXQ70116D-8 (V30 compatible) m_subcpu->set_addrmap(AS_PROGRAM, &deadang_state::sub_map); TIMER(config, "scantimer2").configure_scanline(FUNC(deadang_state::sub_scanline), "screen", 0, 1); - Z80(config, m_audiocpu, XTAL(14'318'181)/4); + Z80(config, m_audiocpu, XTAL(14'318'181) / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &deadang_state::sound_map); m_audiocpu->set_addrmap(AS_OPCODES, &deadang_state::sound_decrypted_opcodes_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); @@ -375,10 +802,10 @@ void deadang_state::deadang(machine_config &config) WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // 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_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate 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_screen_update(FUNC(deadang_state::screen_update)); @@ -387,7 +814,7 @@ void deadang_state::deadang(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_deadang); PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 2048); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SEIBU_SOUND(config, m_seibu_sound, 0); @@ -397,39 +824,46 @@ void deadang_state::deadang(machine_config &config) m_seibu_sound->ym_read_callback().set("ym1", FUNC(ym2203_device::read)); m_seibu_sound->ym_write_callback().set("ym1", FUNC(ym2203_device::write)); - ym2203_device &ym1(YM2203(config, "ym1", XTAL(14'318'181)/4)); + ym2203_device &ym1(YM2203(config, "ym1", XTAL(14'318'181) / 4)); ym1.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler)); ym1.add_route(ALL_OUTPUTS, "mono", 0.15); - ym2203_device &ym2(YM2203(config, "ym2", XTAL(14'318'181)/4)); + ym2203_device &ym2(YM2203(config, "ym2", XTAL(14'318'181) / 4)); ym2.add_route(ALL_OUTPUTS, "mono", 0.15); - SEIBU_ADPCM(config, m_adpcm1, XTAL(12'000'000)/32/48, "msm1"); - SEIBU_ADPCM(config, m_adpcm2, XTAL(12'000'000)/32/48, "msm2"); + SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000) / 32 / 48, "msm1"); + SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000) / 32 / 48, "msm2"); - msm5205_device &msm1(MSM5205(config, "msm1", XTAL(12'000'000)/32)); - msm1.vck_callback().set(m_adpcm1, FUNC(seibu_adpcm_device::msm_int)); - msm1.set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */ + msm5205_device &msm1(MSM5205(config, "msm1", XTAL(12'000'000) / 32)); + msm1.vck_callback().set(m_adpcm[0], FUNC(seibu_adpcm_device::msm_int)); + msm1.set_prescaler_selector(msm5205_device::S48_4B); // 7.8125 kHz msm1.add_route(ALL_OUTPUTS, "mono", 0.40); - msm5205_device &msm2(MSM5205(config, "msm2", XTAL(12'000'000)/32)); - msm2.vck_callback().set(m_adpcm2, FUNC(seibu_adpcm_device::msm_int)); - msm2.set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */ + msm5205_device &msm2(MSM5205(config, "msm2", XTAL(12'000'000) / 32)); + msm2.vck_callback().set(m_adpcm[1], FUNC(seibu_adpcm_device::msm_int)); + msm2.set_prescaler_selector(msm5205_device::S48_4B); // 7.8125 kHz msm2.add_route(ALL_OUTPUTS, "mono", 0.40); } +void deadang_state::ghunter(machine_config &config) +{ + deadang(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &deadang_state::ghunter_main_map); +} + void popnrun_state::popnrun(machine_config &config) { deadang(config); - m_maincpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &popnrun_state::main_map); - m_subcpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_sub_map); + m_subcpu->set_addrmap(AS_PROGRAM, &popnrun_state::sub_map); - m_audiocpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &popnrun_state::sound_map); m_audiocpu->set_addrmap(AS_OPCODES, &popnrun_state::sound_decrypted_opcodes_map); - m_screen->set_screen_update(FUNC(popnrun_state::popnrun_screen_update)); + m_screen->set_screen_update(FUNC(popnrun_state::screen_update)); config.device_remove("watchdog"); @@ -445,14 +879,14 @@ void popnrun_state::popnrun(machine_config &config) m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181)/4)); + ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4)); ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); } -/* ROMs */ +// ROMs ROM_START( popnrun ) ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "popnrun-27512-1-6e.bin", 0xe0001, 0x010000, CRC(cf800494) SHA1(eaed51212c91ebb16e326f8133b60a0ecf0055e5) ) @@ -466,27 +900,27 @@ ROM_START( popnrun ) ROM_LOAD( "popnrun-2764-5-22c.bin", 0x000000, 0x002000, CRC(768a2ec7) SHA1(abc02ec6c6a495e612e8708377d9e7ca98981de4) ) ROM_LOAD( "popnrun-27512-6-20c.bin", 0x010000, 0x010000, CRC(47d168ce) SHA1(36c16a400408834fcf0561c3f097e84a287560bd) ) - ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASE00 ) + ROM_REGION( 0x2000, "chars", ROMREGION_ERASE00 ) ROM_LOAD( "popnrun-2764-7-1a.bin", 0x000000, 0x002000, CRC(5e508b8e) SHA1(3e49e8d25a3db83178965382295e7c437441b5fe) ) - ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", ROMREGION_ERASEFF ) ROM_LOAD( "gfx2.bin", 0x0000, 0x80000, NO_DUMP ) // debugging fill, remove me ROM_FILL( 0x0000, 0x80000, 0x33 ) - ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", ROMREGION_ERASE00 ) // pf1 layer ROM_LOAD( "gfx3.bin", 0x0000, 0x100000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx4", ROMREGION_ERASE00 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", ROMREGION_ERASE00 ) // pf2 layer ROM_LOAD( "gfx4.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx5", ROMREGION_ERASE00) // pf3 layer + ROM_REGION( 0x40000, "tiles3", ROMREGION_ERASE00) // pf3 layer ROM_LOAD( "gfx5.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx6", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", ROMREGION_ERASE00 ) ROM_LOAD( "gfx6.bin", 0x0000, 0x10000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx7", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", ROMREGION_ERASE00 ) ROM_LOAD( "gfx7.bin", 0x0000, 0x10000, NO_DUMP ) ROM_REGION( 0x10000, "adpcm1", ROMREGION_ERASE00 ) @@ -510,27 +944,27 @@ ROM_START( popnruna ) ROM_LOAD( "popnrun-2764-5-22c.bin", 0x000000, 0x002000, CRC(768a2ec7) SHA1(abc02ec6c6a495e612e8708377d9e7ca98981de4) ) ROM_LOAD( "popnrun-27512-6-20c.bin", 0x010000, 0x010000, CRC(47d168ce) SHA1(36c16a400408834fcf0561c3f097e84a287560bd) ) - ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASE00 ) + ROM_REGION( 0x2000, "chars", ROMREGION_ERASE00 ) ROM_LOAD( "popnrun-2764-7-1a.bin", 0x000000, 0x002000, CRC(5e508b8e) SHA1(3e49e8d25a3db83178965382295e7c437441b5fe) ) - ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", ROMREGION_ERASEFF ) ROM_LOAD( "gfx2.bin", 0x0000, 0x80000, NO_DUMP ) // debugging fill, remove me ROM_FILL( 0x0000, 0x80000, 0x33 ) - ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", ROMREGION_ERASE00 ) // pf1 layer ROM_LOAD( "gfx3.bin", 0x0000, 0x100000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx4", ROMREGION_ERASE00 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", ROMREGION_ERASE00 ) // pf2 layer ROM_LOAD( "gfx4.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx5", ROMREGION_ERASE00) // pf3 layer + ROM_REGION( 0x40000, "tiles3", ROMREGION_ERASE00) // pf3 layer ROM_LOAD( "gfx5.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx6", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", ROMREGION_ERASE00 ) ROM_LOAD( "gfx6.bin", 0x0000, 0x10000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx7", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", ROMREGION_ERASE00 ) ROM_LOAD( "gfx7.bin", 0x0000, 0x10000, NO_DUMP ) ROM_REGION( 0x0100, "prom", ROMREGION_ERASE00 ) @@ -538,42 +972,42 @@ ROM_START( popnruna ) ROM_END ROM_START( deadang ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.18h", 0x0c0000, 0x10000, CRC(1bc05b7e) SHA1(21833150a1f5ab543999a67f5b3bfbaf703e5508) ) ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(5751d4e7) SHA1(2e1a30c20199461fd876849f7563fef1d9a80c2d) ) ROM_LOAD16_BYTE("1.18f", 0x0e0000, 0x10000, CRC(8e7b15cc) SHA1(7e4766953c1adf04be18207a2aa6f5e861ea5f6c) ) ROM_LOAD16_BYTE("3.21f", 0x0e0001, 0x10000, CRC(e784b1fa) SHA1(3f41d31e0b36b9a2fab5e9998bb4146dfa0a97eb) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(9c69eb35) SHA1(d5a9714f279b71c419b4bae0f142c4cb1cc8d30e) ) ROM_LOAD16_BYTE("6.9b", 0x0e0001, 0x10000, CRC(34a44ce5) SHA1(621c69d8778d4c96ac3be06b033a5931a6a23da2) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.21j", 0x000000, 0x4000, CRC(fe615fcd) SHA1(d67ee5e877b937173f4c188829d5bcbd354ceb29) ) ROM_LOAD( "8.21l", 0x004000, 0x4000, CRC(905d6b27) SHA1(952f1879e6c27dc87234a4dc572e0453dc2d59fa) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -585,42 +1019,42 @@ ROM_START( deadang ) ROM_END ROM_START( leadang ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.18h", 0x0c0000, 0x10000, CRC(611247e0) SHA1(1b9ad50f67ba3a3a9e5a0d6e33f4d4be2fc20446) ) // sldh ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(348c1201) SHA1(277dd77dcbc950299de0fd56a4f66db8f90752ad) ) // sldh ROM_LOAD16_BYTE("1.18f", 0x0e0000, 0x10000, CRC(fb952d71) SHA1(c6578cddf019872e6005c3a9e8e3e024d17d8c6e) ) // sldh ROM_LOAD16_BYTE("3.22f", 0x0e0001, 0x10000, CRC(2271c6df) SHA1(774a92bb698606e58d0c74ea07d7eaecf766dddf) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(9c69eb35) SHA1(d5a9714f279b71c419b4bae0f142c4cb1cc8d30e) ) ROM_LOAD16_BYTE("6.9b", 0x0e0001, 0x10000, CRC(34a44ce5) SHA1(621c69d8778d4c96ac3be06b033a5931a6a23da2) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.22k", 0x000000, 0x4000, CRC(490701e7) SHA1(2f5cbc0407d7fe41b9e7683c7531656fda7bf9f7) ) ROM_LOAD( "8.22l", 0x004000, 0x4000, CRC(18024c5e) SHA1(b02bcaa1ba6e7c188f3d2a6b20b52b2dcb8215e0) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -632,42 +1066,42 @@ ROM_START( leadang ) ROM_END ROM_START( ghunter ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.19h", 0x0c0000, 0x10000, CRC(5a511500) SHA1(69185a9efee0c3ee4d65643651eb9c613bc5f759) ) ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(df5704f4) SHA1(a40848f1222253921982320155e6f7a01d2bb17f) ) // sldh ROM_LOAD16_BYTE("1.19f", 0x0e0000, 0x10000, CRC(30deb018) SHA1(099ab1f227d7e28f3e56a61d015813905a2dbc29) ) ROM_LOAD16_BYTE("3.22f", 0x0e0001, 0x10000, CRC(95f587c5) SHA1(b1431dd56200a5f849314b34daed5d3570633a77) ) // sldh - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(c40bb5e5) SHA1(2a618f7db6fe6cd8d1a0e7eed91a831b721fec62) ) // sldh ROM_LOAD16_BYTE("6.10b", 0x0e0001, 0x10000, CRC(373f86a7) SHA1(6f7d219a3bc34d74fdadd812319a5387d217dffb) ) // sldh - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.22k", 0x000000, 0x4000, CRC(490701e7) SHA1(2f5cbc0407d7fe41b9e7683c7531656fda7bf9f7) ) ROM_LOAD( "8.22l", 0x004000, 0x4000, CRC(18024c5e) SHA1(b02bcaa1ba6e7c188f3d2a6b20b52b2dcb8215e0) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -679,42 +1113,42 @@ ROM_START( ghunter ) ROM_END ROM_START( ghunters ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("ggh-2.h18", 0x0c0000, 0x10000, CRC(7ccc6fee) SHA1(bccc283d82f080157f0521457b04fdd1d63caafe) ) ROM_LOAD16_BYTE("ggh-4.h22", 0x0c0001, 0x10000, CRC(d1f23ad7) SHA1(2668729af797ccab52ac2bf519d43ab2fa9e54ce) ) ROM_LOAD16_BYTE("ggh-1.f18", 0x0e0000, 0x10000, CRC(0d6ff111) SHA1(209d26170446b43d1d463737b447e30aaca614a7) ) ROM_LOAD16_BYTE("ggh-3.f22", 0x0e0001, 0x10000, CRC(66dec38d) SHA1(78dd3143265c3da90d1a0ab2c4f42b4e32716af8) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("ggh-5.b6", 0x0e0000, 0x10000, CRC(1f612f3b) SHA1(71840fa0e988828a819d371f082ce31d5a5e3a30) ) ROM_LOAD16_BYTE("ggh-6.b10", 0x0e0001, 0x10000, CRC(63e18e56) SHA1(5183d0909a7c795e76540723fb710a5a75730298) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.21j", 0x000000, 0x4000, CRC(fe615fcd) SHA1(d67ee5e877b937173f4c188829d5bcbd354ceb29) ) ROM_LOAD( "8.21l", 0x004000, 0x4000, CRC(905d6b27) SHA1(952f1879e6c27dc87234a4dc572e0453dc2d59fa) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -725,34 +1159,22 @@ ROM_START( ghunters ) ROM_LOAD( "16.11a", 0x000000, 0x10000, CRC(a8d46fc9) SHA1(3ba51bdec4057413396a152b35015f9d95253e3f) ) ROM_END -/* Driver Initialization */ - -void deadang_state::init_deadang() -{ - m_adpcm1->decrypt(); - m_adpcm2->decrypt(); -} +// Driver Initialization -void popnrun_state::init_popnrun() +void deadang_state::init_adpcm() { -// m_adpcm1->decrypt(); -// m_adpcm2->decrypt(); + m_adpcm[0]->decrypt(); + m_adpcm[1]->decrypt(); } -void deadang_state::init_ghunter() -{ - m_adpcm1->decrypt(); - m_adpcm2->decrypt(); +} // anonymous namespace - m_maincpu->space(AS_PROGRAM).install_read_handler(0x80000, 0x80001, read16smo_delegate(*this, FUNC(deadang_state::ghunter_trackball_low_r))); - m_maincpu->space(AS_PROGRAM).install_read_handler(0xb0000, 0xb0001, read16smo_delegate(*this, FUNC(deadang_state::ghunter_trackball_high_r))); -} /* Game Drivers */ -GAME( 1987, popnrun, 0, popnrun, deadang, popnrun_state, init_popnrun, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1987, popnruna, popnrun, popnrun, deadang, popnrun_state, init_popnrun, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, popnrun, 0, popnrun, deadang, popnrun_state, empty_init, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, popnruna, popnrun, popnrun, deadang, popnrun_state, empty_init, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1988, deadang, 0, deadang, deadang, deadang_state, init_deadang, ROT0, "Seibu Kaihatsu", "Dead Angle", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, leadang, deadang, deadang, deadang, deadang_state, init_deadang, ROT0, "Seibu Kaihatsu", "Lead Angle (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, ghunter, deadang, deadang, ghunter, deadang_state, init_ghunter, ROT0, "Seibu Kaihatsu", "Gang Hunter / Dead Angle", MACHINE_SUPPORTS_SAVE ) // Title is 'Gang Hunter' or 'Dead Angle' depending on control method dipswitch -GAME( 1988, ghunters, deadang, deadang, ghunter, deadang_state, init_ghunter, ROT0, "Seibu Kaihatsu (SegaSA / Sonic license)", "Gang Hunter / Dead Angle (Spain)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, deadang, 0, deadang, deadang, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Dead Angle", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, leadang, deadang, deadang, deadang, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Lead Angle (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, ghunter, deadang, ghunter, ghunter, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Gang Hunter / Dead Angle", MACHINE_SUPPORTS_SAVE ) // Title is 'Gang Hunter' or 'Dead Angle' depending on control method dipswitch +GAME( 1988, ghunters, deadang, ghunter, ghunter, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu (SegaSA / Sonic license)", "Gang Hunter / Dead Angle (Spain)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/deadang.h b/src/mame/seibu/deadang.h deleted file mode 100644 index 791417d1ec1cc..0000000000000 --- a/src/mame/seibu/deadang.h +++ /dev/null @@ -1,121 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -#ifndef MAME_SEIBU_DEADANG_H -#define MAME_SEIBU_DEADANG_H - -#pragma once - -#include "seibusound.h" - -#include "machine/timer.h" -#include "sound/ymopm.h" - -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class deadang_state : public driver_device -{ -public: - deadang_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_scroll_ram(*this, "scroll_ram"), - m_videoram(*this, "videoram"), - m_video_data(*this, "video_data"), - m_spriteram(*this, "spriteram"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_seibu_sound(*this, "seibu_sound"), - m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub"), - m_audiocpu(*this, "audiocpu"), - m_adpcm1(*this, "adpcm1"), - m_adpcm2(*this, "adpcm2") - { } - - void deadang(machine_config &config); - - void init_deadang(); - void init_ghunter(); - - void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - TILEMAP_MAPPER_MEMBER(bg_scan); - TILE_GET_INFO_MEMBER(get_pf1_tile_info); - TILE_GET_INFO_MEMBER(get_pf3_tile_info); - TILE_GET_INFO_MEMBER(get_pf2_tile_info); - TILE_GET_INFO_MEMBER(get_text_tile_info); - -protected: - virtual void video_start() override; - - void main_map(address_map &map); - - required_shared_ptr m_scroll_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_video_data; - required_shared_ptr m_spriteram; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_seibu_sound; - - int m_tilebank = 0; - int m_oldtilebank = 0; - - tilemap_t *m_pf3_layer = nullptr; - tilemap_t *m_pf2_layer = nullptr; - tilemap_t *m_pf1_layer = nullptr; - tilemap_t *m_text_layer = nullptr; - - void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - void sound_decrypted_opcodes_map(address_map &map); - void sound_map(address_map &map); - - required_device m_maincpu; - required_device m_subcpu; - required_device m_audiocpu; - optional_device m_adpcm1; - optional_device m_adpcm2; - - uint16_t ghunter_trackball_low_r(); - uint16_t ghunter_trackball_high_r(); - - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - TIMER_DEVICE_CALLBACK_MEMBER(main_scanline); - TIMER_DEVICE_CALLBACK_MEMBER(sub_scanline); - void sub_map(address_map &map); -}; - -class popnrun_state : public deadang_state -{ -public: - popnrun_state(const machine_config &mconfig, device_type type, const char *tag) : - deadang_state(mconfig, type, tag) - { } - - void popnrun(machine_config &config); - - void init_popnrun(); - -protected: - virtual void video_start() override; - -private: - TILE_GET_INFO_MEMBER(get_popnrun_text_tile_info); - void popnrun_text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void popnrun_main_map(address_map &map); - void popnrun_sub_map(address_map &map); - void popnrun_sound_map(address_map &map); - - uint32_t popnrun_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void popnrun_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -}; - -#endif // MAME_SEIBU_DEADANG_H diff --git a/src/mame/seibu/deadang_v.cpp b/src/mame/seibu/deadang_v.cpp deleted file mode 100644 index e94def9c471a2..0000000000000 --- a/src/mame/seibu/deadang_v.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -#include "emu.h" -#include "deadang.h" -#include "screen.h" - - -/******************************************************************************/ - -void deadang_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_video_data[offset]); - m_pf1_layer->mark_tile_dirty(offset ); -} - -void deadang_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_text_layer->mark_tile_dirty(offset ); -} - -void popnrun_state::popnrun_text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_text_layer->mark_tile_dirty(offset / 2); -} - -void deadang_state::bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_tilebank = data&1; - if (m_tilebank!=m_oldtilebank) - { - m_oldtilebank = m_tilebank; - m_pf1_layer->mark_all_dirty(); - } - } -} - -/******************************************************************************/ - -TILEMAP_MAPPER_MEMBER(deadang_state::bg_scan) -{ - return (col&0xf) | ((row&0xf)<<4) | ((col&0x70)<<4) | ((row&0xf0)<<7); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf3_tile_info) -{ - const uint16_t *bgMap = (const uint16_t *)memregion("gfx6")->base(); - int code= bgMap[tile_index]; - tileinfo.set(4,code&0x7ff,code>>12,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf2_tile_info) -{ - const uint16_t *bgMap = (const uint16_t *)memregion("gfx7")->base(); - int code= bgMap[tile_index]; - tileinfo.set(3,code&0x7ff,code>>12,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf1_tile_info) -{ - int tile=m_video_data[tile_index]; - int color=tile >> 12; - tile=tile&0xfff; - - tileinfo.set(2,tile+m_tilebank*0x1000,color,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_text_tile_info) -{ - int tile=(m_videoram[tile_index] & 0xff) | ((m_videoram[tile_index] >> 6) & 0x300); - int color=(m_videoram[tile_index] >> 8)&0xf; - - tileinfo.set(0,tile,color,0); -} - -void deadang_state::video_start() -{ - m_pf3_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf2_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf1_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); - m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_pf2_layer->set_transparent_pen(15); - m_pf1_layer->set_transparent_pen(15); - m_text_layer->set_transparent_pen(15); - - save_item(NAME(m_tilebank)); - save_item(NAME(m_oldtilebank)); -} - - -TILE_GET_INFO_MEMBER(popnrun_state::get_popnrun_text_tile_info) -{ - int tile = (m_videoram[tile_index*2+0] & 0xff) << 1; // | ((m_videoram[tile_index] >> 6) & 0x300); - int attr = (m_videoram[tile_index*2+1]); - // TODO: not entirely correct (title screen/ranking colors) - // might be down to bitplanes too - int color = (attr & 3) ^ 1; - - if(attr & 0x40) - tile |= 1; - - tileinfo.set(0,tile,color,0); -} - -void popnrun_state::video_start() -{ - m_pf3_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf2_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf1_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); - m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_popnrun_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_pf2_layer->set_transparent_pen(0); - m_pf1_layer->set_transparent_pen(0); - m_text_layer->set_transparent_pen(0); - - save_item(NAME(m_tilebank)); - save_item(NAME(m_oldtilebank)); -} - - -void deadang_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs,fx,fy,x,y,color,sprite,pri; - - for (offs = 0; offs<0x800/2; offs+=4) - { - /* Don't draw empty sprite table entries */ - if ((m_spriteram[offs+3] & 0xff00)!=0xf00) continue; - - switch (m_spriteram[offs+2]&0xc000) { - default: - case 0xc000: pri=0; break; /* Unknown */ - case 0x8000: pri=0; break; /* Over all playfields */ - case 0x4000: pri=0xf0; break; /* Under top playfield */ - case 0x0000: pri=0xf0|0xcc; break; /* Under middle playfield */ - } - - fx= m_spriteram[offs+0]&0x2000; - fy= m_spriteram[offs+0]&0x4000; - y = m_spriteram[offs+0] & 0xff; - x = m_spriteram[offs+2] & 0xff; - if (fy) fy=0; else fy=1; - if (m_spriteram[offs+2]&0x100) x=0-(0xff-x); - - color = (m_spriteram[offs+1]>>12)&0xf; - sprite = m_spriteram[offs+1]&0xfff; - - if (flip_screen()) { - x=240-x; - y=240-y; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } - - m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect, - sprite, - color,fx,fy,x,y, - screen.priority(),pri,15); - } -} - -uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - /* Setup the tilemaps */ - m_pf3_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0xf0)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7) ); - m_pf3_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0xf0)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7) ); - m_pf1_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x10)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7) ); - m_pf1_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x10)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7) ); - m_pf2_layer->set_scrolly(0, ((m_scroll_ram[0x21]&0xf0)<<4)+((m_scroll_ram[0x22]&0x7f)<<1)+((m_scroll_ram[0x22]&0x80)>>7) ); - m_pf2_layer->set_scrollx(0, ((m_scroll_ram[0x29]&0xf0)<<4)+((m_scroll_ram[0x2a]&0x7f)<<1)+((m_scroll_ram[0x2a]&0x80)>>7) ); - - /* Control byte: - 0x01: Background playfield disable - 0x02: Middle playfield disable - 0x04: Top playfield disable - 0x08: ? Toggles at start of game - 0x10: Sprite disable - 0x20: Unused? - 0x40: Flipscreen - 0x80: Always set? - */ - m_pf3_layer->enable(!(m_scroll_ram[0x34]&1)); - m_pf1_layer->enable(!(m_scroll_ram[0x34]&2)); - m_pf2_layer->enable(!(m_scroll_ram[0x34]&4)); - flip_screen_set(m_scroll_ram[0x34]&0x40 ); - - bitmap.fill(m_palette->black_pen(), cliprect); - screen.priority().fill(0, cliprect); - m_pf3_layer->draw(screen, bitmap, cliprect, 0,1); - m_pf1_layer->draw(screen, bitmap, cliprect, 0,2); - m_pf2_layer->draw(screen, bitmap, cliprect, 0,4); - if (!(m_scroll_ram[0x34]&0x10)) draw_sprites(screen, bitmap,cliprect); - m_text_layer->draw(screen, bitmap, cliprect, 0,0); - return 0; -} - -void popnrun_state::popnrun_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs,fx,fy,x,y,color,sprite,pri; - - // TODO: might have more bits in either 0x3800-0x3bff or 0x3e00-0x3fff - for (offs = 0; offs<0x200/2; offs+=2) - { - /* Don't draw empty sprite table entries */ - //if ((m_spriteram[offs+3] & 0xff00)!=0xf00) continue; - - pri = 0; -#if 0 - switch (m_spriteram[offs+2]&0xc000) { - default: - case 0xc000: pri=0; break; /* Unknown */ - case 0x8000: pri=0; break; /* Over all playfields */ - case 0x4000: pri=0xf0; break; /* Under top playfield */ - case 0x0000: pri=0xf0|0xcc; break; /* Under middle playfield */ - } -#endif - - fx = m_spriteram[offs+0]&0x4000; - fy = m_spriteram[offs+0]&0x8000; - y = m_spriteram[offs+1] & 0xff; - x = (m_spriteram[offs+1] >> 8) & 0xff; -#if 0 - if (fy) fy=0; else fy=1; - if (m_spriteram[offs+2]&0x100) x=0-(0xff-x); -#endif - - color = (m_spriteram[offs+0]>>12)&0x7; - sprite = m_spriteram[offs+0]&0xfff; - -#if 0 - if (flip_screen()) { - x=240-x; - y=240-y; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } -#endif - - m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect, - sprite, - color,fx,fy,x,y, - screen.priority(),pri,0); - } -} - -uint32_t popnrun_state::popnrun_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // TODO: different scroll RAM hookup - // 0x18 seems to enable the various layers - /* Setup the tilemaps */ -// m_pf3_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0xf0)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7) ); -// m_pf3_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0xf0)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7) ); -// m_pf1_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x10)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7) ); -// m_pf1_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x10)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7) ); -// m_pf2_layer->set_scrolly(0, ((m_scroll_ram[0x21]&0xf0)<<4)+((m_scroll_ram[0x22]&0x7f)<<1)+((m_scroll_ram[0x22]&0x80)>>7) ); -// m_pf2_layer->set_scrollx(0, ((m_scroll_ram[0x29]&0xf0)<<4)+((m_scroll_ram[0x2a]&0x7f)<<1)+((m_scroll_ram[0x2a]&0x80)>>7) ); - - m_pf3_layer->enable(!(m_scroll_ram[0x34]&1)); - m_pf1_layer->enable(!(m_scroll_ram[0x34]&2)); - m_pf2_layer->enable(!(m_scroll_ram[0x34]&4)); -// flip_screen_set(m_scroll_ram[0x34]&0x40 ); - - bitmap.fill(1, cliprect); - screen.priority().fill(0, cliprect); - // 32 pixels? -// int scrollx = (m_scroll_ram[0x4/2] & 0x0f); - - // debug tilemap code - // this is likely to be collision data - for(int x=0;x<16;x++) - { - for(int y=0;y<8;y++) - { - int tile = m_video_data[y+x*8+0xc0] & 0xff; - int res_x, res_y; - - if(tile != 0) - { - res_x = (x*16) & 0xff; - res_y = y*32; - //if(cliprect.contains(res_x,res_y)) - bitmap.plot_box(res_x,res_y,16,16,tile+0x10); - } - - tile = m_video_data[y+x*8+0xc0] >> 8; - - if(tile != 0) - { - res_x = (x*16) & 0xff; - res_y = y*32+16; - //if(cliprect.contains(res_x,res_y)) - bitmap.plot_box(res_x,res_y,16,16,tile+0x10); - } - } - } - - //m_pf3_layer->draw(screen, bitmap, cliprect, 0,1); - //m_pf1_layer->draw(screen, bitmap, cliprect, 0,2); - //m_pf2_layer->draw(screen, bitmap, cliprect, 0,4); - if (m_scroll_ram[0x18/2]&0x1) - popnrun_draw_sprites(screen, bitmap,cliprect); - m_text_layer->draw(screen, bitmap, cliprect, 0,0); - return 0; -} diff --git a/src/mame/seibu/kncljoe.cpp b/src/mame/seibu/kncljoe.cpp index b9d9d1ad6d960..336f867b0ebcf 100644 --- a/src/mame/seibu/kncljoe.cpp +++ b/src/mame/seibu/kncljoe.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Ernesto Corvi +// copyright-holders: Ernesto Corvi + /*************************************************************************** Knuckle Joe - (c) 1985 Seibu Kaihatsu (Taito license) @@ -7,9 +8,10 @@ Knuckle Joe - (c) 1985 Seibu Kaihatsu (Taito license) driver by Ernesto Corvi This board seems to be an Irem design. -The sound hardware is modified the 6803-based one used by the classic Irem -games. There's only one AY 3-8910 chip and no MSM5205. There are also two -SN76489 controlled directly by main(!) cpu, and used only for in-game music. +The sound hardware is a modified version of the 6803-based one used by the +classic Irem games. There's only one AY 3-8910 chip and no MSM5205. There +are also two SN76489 controlled directly by main(!) CPU, and used only for +in-game music. The video hardware is pretty much like Irem games too. The only strange thing is that the screen is flipped vertically. @@ -27,12 +29,295 @@ strange thing is that the screen is flipped vertically. ***************************************************************************/ #include "emu.h" -#include "kncljoe.h" +#include "cpu/m6800/m6801.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/ay8910.h" #include "sound/sn76496.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class kncljoe_state : public driver_device +{ +public: + kncljoe_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_scrollregs(*this, "scrollregs"), + m_spriteram(*this, "spriteram"), + m_maincpu(*this, "maincpu"), + m_soundcpu(*this, "soundcpu"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_ay8910(*this, "aysnd"), + m_soundlatch(*this, "soundlatch") + { } + + void kncljoe(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_shared_ptr m_videoram; + required_shared_ptr m_scrollregs; + required_shared_ptr m_spriteram; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_tile_bank = 0U; + uint8_t m_sprite_bank = 0U; + uint8_t m_flipscreen = 0U; + + // misc + uint8_t m_port1 = 0U; + uint8_t m_port2 = 0U; + + required_device m_maincpu; + required_device m_soundcpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_ay8910; + required_device m_soundlatch; + + void sound_cmd_w(uint8_t data); + void sound_irq_ack_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void control_w(uint8_t data); + void scroll_w(offs_t offset, uint8_t data); + void m6803_port1_w(uint8_t data); + void m6803_port2_w(uint8_t data); + uint8_t m6803_port1_r(); + uint8_t m6803_port2_r(); + void unused_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(sound_nmi); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + +***************************************************************************/ + +void kncljoe_state::palette(palette_device &palette) const +{ + uint8_t const *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x80; i++) + { + int const r = pal4bit(color_prom[i + 0x000]); + int const g = pal4bit(color_prom[i + 0x100]); + int const b = pal4bit(color_prom[i + 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + for (int i = 0; i < 0x10; i++) + { + int bit0, bit1, bit2; + + // red component + bit0 = 0; + bit1 = BIT(color_prom[i + 0x300], 6); + bit2 = BIT(color_prom[i + 0x300], 7); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(color_prom[i + 0x300], 3); + bit1 = BIT(color_prom[i + 0x300], 4); + bit2 = BIT(color_prom[i + 0x300], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = BIT(color_prom[i + 0x300], 0); + bit1 = BIT(color_prom[i + 0x300], 1); + bit2 = BIT(color_prom[i + 0x300], 2); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_indirect_color(i + 0x80, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x320; + + // chars + for (int i = 0; i < 0x80; i++) + palette.set_pen_indirect(i, i); + + // sprite lookup table + for (int i = 0; i < 0x80; i++) + { + uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x80; + palette.set_pen_indirect(i + 0x80, ctabentry); + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(kncljoe_state::get_bg_tile_info) +{ + int const attr = m_videoram[2 * tile_index + 1]; + int const code = m_videoram[2 * tile_index] + ((attr & 0xc0) << 2) + (m_tile_bank << 10); + + tileinfo.set(0, + code, + attr & 0xf, + TILE_FLIPXY((attr & 0x30) >> 4)); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void kncljoe_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(kncljoe_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_bg_tilemap->set_scroll_rows(4); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void kncljoe_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void kncljoe_state::control_w(uint8_t data) +{ + /* + 0x01 screen flip + 0x02 coin counter#1 + 0x04 sprite bank + 0x10 character bank + 0x20 coin counter#2 + + reset when IN0 - Coin 1 goes low (active) + set after IN0 - Coin 1 goes high AND the credit has been added + */ + m_flipscreen = data & 0x01; + machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY); + + machine().bookkeeping().coin_counter_w(0, data & 0x02); + machine().bookkeeping().coin_counter_w(1, data & 0x20); + + if (m_tile_bank != BIT(data, 4)) + { + m_tile_bank = BIT(data, 4); + m_bg_tilemap->mark_all_dirty(); + } + + m_sprite_bank = BIT(data, 2); +} + +void kncljoe_state::scroll_w(offs_t offset, uint8_t data) +{ + m_scrollregs[offset] = data; + int const scrollx = m_scrollregs[0] | m_scrollregs[1] << 8; + m_bg_tilemap->set_scrollx(0, scrollx); + m_bg_tilemap->set_scrollx(1, scrollx); + m_bg_tilemap->set_scrollx(2, scrollx); + m_bg_tilemap->set_scrollx(3, 0); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +void kncljoe_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + gfx_element *gfx = m_gfxdecode->gfx(1 + m_sprite_bank); + + for (int i = 0; i < 4; i++) + { + // clip vertical strip for each layer + rectangle clip = cliprect; + clip.min_y = m_flipscreen ? (191 - i * 64) : (i * 64 + 1); + clip.max_y = clip.min_y + 63; + clip &= cliprect; + + for (int j = 0x7c; j >= 0; j -= 4) + { + int const offs = bitswap<2>(~i, 0, 1) << 7 | j; + int sy = m_spriteram[offs] + 1; + int sx = m_spriteram[offs + 3]; + int const attr = m_spriteram[offs + 1]; + int const code = m_spriteram[offs + 2] | ((attr & 0x10) << 5) | ((attr & 0x20) << 3); + int flipx = attr & 0x40; + int flipy = !(attr & 0x80); + int const color = attr & 0x0f; + + if (m_flipscreen) + { + flipx = !flipx; + flipy = !flipy; + sx = 240 - sx; + sy = 240 - sy; + } + + if (sx >= 256 - 8) + sx -= 256; + + gfx->transpen(bitmap, clip, + code, + color, + flipx, flipy, + sx, sy, 0); + } + } +} + +uint32_t kncljoe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + +// machine void kncljoe_state::sound_cmd_w(uint8_t data) { @@ -46,20 +331,20 @@ void kncljoe_state::sound_cmd_w(uint8_t data) void kncljoe_state::main_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram().w(FUNC(kncljoe_state::kncljoe_videoram_w)).share("videoram"); - map(0xd000, 0xd001).w(FUNC(kncljoe_state::kncljoe_scroll_w)).share("scrollregs"); + map(0xc000, 0xcfff).ram().w(FUNC(kncljoe_state::videoram_w)).share(m_videoram); + map(0xd000, 0xd001).w(FUNC(kncljoe_state::scroll_w)).share(m_scrollregs); map(0xd800, 0xd800).portr("SYSTEM"); map(0xd801, 0xd801).portr("P1"); map(0xd802, 0xd802).portr("P2"); map(0xd803, 0xd803).portr("DSWA"); map(0xd804, 0xd804).portr("DSWB"); map(0xd800, 0xd800).w(FUNC(kncljoe_state::sound_cmd_w)); - map(0xd801, 0xd801).w(FUNC(kncljoe_state::kncljoe_control_w)); + map(0xd801, 0xd801).w(FUNC(kncljoe_state::control_w)); map(0xd802, 0xd802).w("sn1", FUNC(sn76489_device::write)); map(0xd803, 0xd803).w("sn2", FUNC(sn76489_device::write)); - map(0xd807, 0xd807).nopr(); /* unknown read */ - map(0xd817, 0xd817).nopr(); /* unknown read */ - map(0xe800, 0xefff).ram().share("spriteram"); + map(0xd807, 0xd807).nopr(); // unknown read + map(0xd817, 0xd817).nopr(); // unknown read + map(0xe800, 0xefff).ram().share(m_spriteram); map(0xf000, 0xffff).ram(); } @@ -99,7 +384,7 @@ void kncljoe_state::sound_irq_ack_w(uint8_t data) void kncljoe_state::unused_w(uint8_t data) { - // unused - no MSM on the pcb + // unused - no MSM on the PCB } void kncljoe_state::sound_map(address_map &map) @@ -207,9 +492,9 @@ static const gfx_layout spritelayout = }; static GFXDECODE_START( gfx_kncljoe ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0x00, 16 ) /* colors 0x00-0x7f direct mapped */ - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 16 ) /* colors 0x80-0x8f with lookup table */ - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x3_planar, 0x00, 16 ) // colors 0x00-0x7f direct mapped + GFXDECODE_ENTRY( "sprites1", 0, spritelayout, 0x80, 16 ) // colors 0x80-0x8f with lookup table + GFXDECODE_ENTRY( "sprites2", 0, spritelayout, 0x80, 16 ) GFXDECODE_END @@ -238,12 +523,12 @@ void kncljoe_state::machine_reset() void kncljoe_state::kncljoe(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(6'000'000)); /* verified on pcb */ + // basic machine hardware + Z80(config, m_maincpu, XTAL(6'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &kncljoe_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(kncljoe_state::irq0_line_hold)); - M6803(config, m_soundcpu, XTAL(3'579'545)); /* verified on pcb */ + M6803(config, m_soundcpu, XTAL(3'579'545)); // verified on PCB m_soundcpu->set_addrmap(AS_PROGRAM, &kncljoe_state::sound_map); m_soundcpu->in_p1_cb().set(FUNC(kncljoe_state::m6803_port1_r)); m_soundcpu->out_p1_cb().set(FUNC(kncljoe_state::m6803_port1_w)); @@ -251,32 +536,32 @@ void kncljoe_state::kncljoe(machine_config &config) m_soundcpu->out_p2_cb().set(FUNC(kncljoe_state::m6803_port2_w)); m_soundcpu->set_periodic_int(FUNC(kncljoe_state::sound_nmi), attotime::from_hz(3970)); // measured 3.970 kHz - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); m_screen->set_size(32*8, 32*8); m_screen->set_visarea(1*8, 31*8-1, 0*8, 32*8-1); - m_screen->set_screen_update(FUNC(kncljoe_state::screen_update_kncljoe)); + m_screen->set_screen_update(FUNC(kncljoe_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_kncljoe); - PALETTE(config, m_palette, FUNC(kncljoe_state::kncljoe_palette), 16*8+16*8, 128+16); + PALETTE(config, m_palette, FUNC(kncljoe_state::palette), 16*8+16*8, 128+16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - AY8910(config, m_ay8910, XTAL(3'579'545)/4); /* verified on pcb */ + AY8910(config, m_ay8910, XTAL(3'579'545) / 4); // verified on PCB m_ay8910->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); m_ay8910->port_b_write_callback().set(FUNC(kncljoe_state::unused_w)); m_ay8910->add_route(ALL_OUTPUTS, "mono", 0.30); - SN76489(config, "sn1", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on pcb */ + SN76489(config, "sn1", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on PCB - SN76489(config, "sn2", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on pcb */ + SN76489(config, "sn2", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on PCB } @@ -287,30 +572,30 @@ ROM_START( kncljoe ) ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) ) ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "kj-10.bin", 0x0000, 0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) ) ROM_LOAD( "kj-11.bin", 0x4000, 0x4000, CRC(8ea01455) SHA1(b4b42fe373a1019b4f2a4b763a8a7219a5c9987e) ) ROM_LOAD( "kj-12.bin", 0x8000, 0x4000, CRC(33367c41) SHA1(e6c56bcad008f3af4bc0f7d7afe8e23c8eb9d943) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END ROM_START( kncljoea ) @@ -319,30 +604,30 @@ ROM_START( kncljoea ) ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) ) ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "kj-10.bin", 0x0000, 0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) ) ROM_LOAD( "kj-11.bin", 0x4000, 0x4000, CRC(8ea01455) SHA1(b4b42fe373a1019b4f2a4b763a8a7219a5c9987e) ) ROM_LOAD( "kj-12.bin", 0x8000, 0x4000, CRC(33367c41) SHA1(e6c56bcad008f3af4bc0f7d7afe8e23c8eb9d943) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END ROM_START( bcrusher ) @@ -351,34 +636,35 @@ ROM_START( bcrusher ) ROM_LOAD( "bcrush2.bin", 0x4000, 0x4000, CRC(1be4c731) SHA1(11f3a33263d66172902dfb6f3fe2d0ab5cad38d7) ) ROM_LOAD( "bcrush3.bin", 0x8000, 0x4000, CRC(0772d993) SHA1(430f0319bd4765add2f1ee197e7217fdf9ae79c8) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "bcrush10.bin", 0x0000, 0x4000, CRC(a62f4572) SHA1(4e38e175e25a955e5f83cac8c935163e2e861e94) ) ROM_LOAD( "bcrush11.bin", 0x4000, 0x4000, CRC(79cc5644) SHA1(bc356065a2475d0e0921fc5c84fa46f6629caae7) ) ROM_LOAD( "bcrush12.bin", 0x8000, 0x4000, CRC(8f09641d) SHA1(5ccc423b15148d96c0a348d41a3f4fff7bbae7b9) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END +} // anonymous namespace GAME( 1985, kncljoe, 0, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "Seibu Kaihatsu (Taito license)", "Knuckle Joe (set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, kncljoea, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "Seibu Kaihatsu (Taito license)", "Knuckle Joe (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, bcrusher, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "bootleg", "Bone Crusher", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, bcrusher, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "bootleg", "Bone Crusher", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/kncljoe.h b/src/mame/seibu/kncljoe.h deleted file mode 100644 index 7b8a0ffbc1816..0000000000000 --- a/src/mame/seibu/kncljoe.h +++ /dev/null @@ -1,88 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -/************************************************************************* - - Knuckle Joe - -*************************************************************************/ - -#ifndef MAME_SEIBU_KNCLJOE_H -#define MAME_SEIBU_KNCLJOE_H - -#pragma once - -#include "cpu/m6800/m6801.h" -#include "machine/gen_latch.h" -#include "sound/ay8910.h" - -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class kncljoe_state : public driver_device -{ -public: - kncljoe_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_scrollregs(*this, "scrollregs"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_ay8910(*this, "aysnd"), - m_soundlatch(*this, "soundlatch") - { } - - void kncljoe(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrollregs; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - int m_tile_bank = 0; - int m_sprite_bank = 0; - int m_flipscreen = 0; - - /* misc */ - uint8_t m_port1 = 0U; - uint8_t m_port2 = 0U; - - /* devices */ - required_device m_maincpu; - required_device m_soundcpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_ay8910; - required_device m_soundlatch; - - void sound_cmd_w(uint8_t data); - void sound_irq_ack_w(uint8_t data); - void kncljoe_videoram_w(offs_t offset, uint8_t data); - void kncljoe_control_w(uint8_t data); - void kncljoe_scroll_w(offs_t offset, uint8_t data); - void m6803_port1_w(uint8_t data); - void m6803_port2_w(uint8_t data); - uint8_t m6803_port1_r(); - uint8_t m6803_port2_r(); - void unused_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void kncljoe_palette(palette_device &palette) const; - uint32_t screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(sound_nmi); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void main_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_SEIBU_KNCLJOE_H diff --git a/src/mame/seibu/kncljoe_v.cpp b/src/mame/seibu/kncljoe_v.cpp deleted file mode 100644 index f7e9bf8386fb2..0000000000000 --- a/src/mame/seibu/kncljoe_v.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -/*************************************************************************** - - Knuckle Joe - -***************************************************************************/ - -#include "emu.h" -#include "kncljoe.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - -***************************************************************************/ - -void kncljoe_state::kncljoe_palette(palette_device &palette) const -{ - uint8_t const *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x80; i++) - { - int const r = pal4bit(color_prom[i + 0x000]); - int const g = pal4bit(color_prom[i + 0x100]); - int const b = pal4bit(color_prom[i + 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - for (int i = 0; i < 0x10; i++) - { - int bit0, bit1, bit2; - - // red component - bit0 = 0; - bit1 = BIT(color_prom[i + 0x300], 6); - bit2 = BIT(color_prom[i + 0x300], 7); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // green component - bit0 = BIT(color_prom[i + 0x300], 3); - bit1 = BIT(color_prom[i + 0x300], 4); - bit2 = BIT(color_prom[i + 0x300], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // blue component - bit0 = BIT(color_prom[i + 0x300], 0); - bit1 = BIT(color_prom[i + 0x300], 1); - bit2 = BIT(color_prom[i + 0x300], 2); - int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_indirect_color(i + 0x80, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x320; - - // chars - for (int i = 0; i < 0x80; i++) - palette.set_pen_indirect(i, i); - - // sprite lookup table - for (int i = 0; i < 0x80; i++) - { - uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x80; - palette.set_pen_indirect(i + 0x80, ctabentry); - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(kncljoe_state::get_bg_tile_info) -{ - int attr = m_videoram[2 * tile_index + 1]; - int code = m_videoram[2 * tile_index] + ((attr & 0xc0) << 2) + (m_tile_bank << 10); - - tileinfo.set(0, - code, - attr & 0xf, - TILE_FLIPXY((attr & 0x30) >> 4)); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void kncljoe_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(kncljoe_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_bg_tilemap->set_scroll_rows(4); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void kncljoe_state::kncljoe_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void kncljoe_state::kncljoe_control_w(uint8_t data) -{ - /* - 0x01 screen flip - 0x02 coin counter#1 - 0x04 sprite bank - 0x10 character bank - 0x20 coin counter#2 - - reset when IN0 - Coin 1 goes low (active) - set after IN0 - Coin 1 goes high AND the credit has been added - */ - m_flipscreen = data & 0x01; - machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY); - - machine().bookkeeping().coin_counter_w(0, data & 0x02); - machine().bookkeeping().coin_counter_w(1, data & 0x20); - - if (m_tile_bank != BIT(data, 4)) - { - m_tile_bank = BIT(data, 4); - m_bg_tilemap->mark_all_dirty(); - } - - m_sprite_bank = BIT(data, 2); -} - -void kncljoe_state::kncljoe_scroll_w(offs_t offset, uint8_t data) -{ - m_scrollregs[offset] = data; - int scrollx = m_scrollregs[0] | m_scrollregs[1] << 8; - m_bg_tilemap->set_scrollx(0, scrollx); - m_bg_tilemap->set_scrollx(1, scrollx); - m_bg_tilemap->set_scrollx(2, scrollx); - m_bg_tilemap->set_scrollx(3, 0); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -void kncljoe_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - gfx_element *gfx = m_gfxdecode->gfx(1 + m_sprite_bank); - - for (int i = 0; i < 4; i++) - { - // clip vertical strip for each layer - rectangle clip = cliprect; - clip.min_y = m_flipscreen ? (191 - i * 64) : (i * 64 + 1); - clip.max_y = clip.min_y + 63; - clip &= cliprect; - - for (int j = 0x7c; j >= 0; j -= 4) - { - int offs = bitswap<2>(~i, 0, 1) << 7 | j; - int sy = m_spriteram[offs] + 1; - int sx = m_spriteram[offs + 3]; - int attr = m_spriteram[offs + 1]; - int code = m_spriteram[offs + 2] | ((attr & 0x10) << 5) | ((attr & 0x20) << 3); - int flipx = attr & 0x40; - int flipy = !(attr & 0x80); - int color = attr & 0x0f; - - if (m_flipscreen) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - if (sx >= 256-8) - sx -= 256; - - gfx->transpen(bitmap,clip, - code, - color, - flipx,flipy, - sx,sy,0); - } - } -} - -uint32_t kncljoe_state::screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -} diff --git a/src/mame/seibu/stfight.cpp b/src/mame/seibu/stfight.cpp index b50d9fb96cae1..0697caf216c7e 100644 --- a/src/mame/seibu/stfight.cpp +++ b/src/mame/seibu/stfight.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Mark McDougall +// copyright-holders: Mark McDougall + /***************************** (by Mark McDougall) *** STREET FIGHT hardware *** This has been adapted from the excellent ***************************** Psychic 5 description (by Roberto Ventura) @@ -31,7 +32,7 @@ Screen resolution is 256x224 (horizontal CRT). 1) ROM CONTENTS. SF01 Main program code (encrypted) -SF02 Main program code bank-switched? into main cpu space +SF02 Main program code bank-switched? into main CPU space SF03 Sound program code SF04 ADPCM voice data SF05-07 Foreground tile pixel data @@ -43,10 +44,10 @@ SF16 Background map/tile data SF17 Character pixel data SF18-21 Sprite pixel data -All ROMS are 32K except SF17 which is 8K. +All ROMs are 32K except SF17 which is 8K. Graphics format is a little messy, the 4 planes come from a bit in -the high and low nibble of each byte of a consecutive pair of roms. +the high and low nibble of each byte of a consecutive pair of ROMs. All graphics are made of 16x16 (composite) tiles, each of which is composed of 4 consecutive 8x8 tiles. In all there are 1024 composite (16x16) tiles @@ -226,13 +227,13 @@ The top and bottom rows of the screen are not visible - resulting in a 256x224 viewport rather than 256 square. The layers can be individually enabled/disabled. Inactive sprites are 'parked' at row 0. -The rom layout for the foreground and sprite tiles are as you would expect, +The ROM layout for the foreground and sprite tiles are as you would expect, with the four 8x8 tiles that make a single composite tile consecutive in address. The background tiles are interleaved for presumably some good reason, the first two 8x8 tiles from composite tile n are followed by two 8x8 tiles from the (n+512)'th composite tile. -The map roms are similarly interleaved for the background layer only. +The map ROMs are similarly interleaved for the background layer only. 7) SPRITES @@ -244,11 +245,11 @@ conventional RAM. See the memory map for sprite data format. TODO: - handle transparency in text layer properly (how?) -- second bank of sf02 is this used? (probably NOT) +- is the second bank of sf02 used? (probably NOT) - empcity/stfight never writes the YM2203s' divider registers but it expects 0x2f, there's a workaround for it in the driver init - if empcity turns out to really be a bootleg, maybe it doesn't have an MCU, - and instead does the ADPCM with the audiocpu? (see the driver notes above + and instead does the ADPCM with the audio CPU? (see the driver notes above mentioning an unused NMI handler) - Each version of empcity/stfight has a different protection code stored in the MCU (at $1D2) so each 68705 will need to be dumped. @@ -264,18 +265,297 @@ conventional RAM. See the memory map for sprite data format. *****************************************************************************/ #include "emu.h" -#include "stfight.h" +#include "airraid_dev.h" +#include "stfight_dev.h" + +#include "cpu/m6805/m68705.h" #include "cpu/z80/z80.h" +#include "sound/msm5205.h" #include "sound/ymopn.h" #include "speaker.h" +namespace { + +class stfight_state : public driver_device +{ +public: + stfight_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_mcu(*this, "mcu") + , m_msm(*this, "msm") + , m_ym(*this, "ym%u", 0) + , m_main_bank(*this, "mainbank") + , m_samples(*this, "adpcm") + , m_decrypted_opcodes(*this, "decrypted_opcodes") + , m_coin_mech(*this, "COIN") + , m_coin_state(0) + , m_fm_data(0) + , m_cpu_to_mcu_empty(true) + , m_cpu_to_mcu_data(0x0f) + , m_port_a_out(0xff) + , m_port_c_out(0xff) + , m_vck2(false) + , m_adpcm_reset(true) + , m_adpcm_data_offs(0x0000) + { + } + + void stfight_base(machine_config &config); + void stfight(machine_config &config); + void cshooter(machine_config &config); + + void init_stfight(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_mcu; + required_device m_msm; + required_device_array m_ym; + + required_memory_bank m_main_bank; + + required_region_ptr m_samples; + optional_shared_ptr m_decrypted_opcodes; + + required_ioport m_coin_mech; + + uint8_t m_coin_state = 0; + + uint8_t m_fm_data = 0; + + bool m_cpu_to_mcu_empty = false; + uint8_t m_cpu_to_mcu_data = 0; + uint8_t m_port_a_out = 0; + uint8_t m_port_c_out = 0; + + bool m_vck2 = false; + bool m_adpcm_reset = false; + uint16_t m_adpcm_data_offs = 0; + + emu_timer *m_int1_timer = nullptr; + + void adpcm_int(int state); + + void io_w(uint8_t data); + uint8_t coin_r(); + void coin_w(uint8_t data); + void fm_w(uint8_t data); + void mcu_w(uint8_t data); + + void cshooter_bank_w(uint8_t data); + + uint8_t fm_r(); + + INTERRUPT_GEN_MEMBER(vb_interrupt); + TIMER_CALLBACK_MEMBER(rst08_tick); + + // MCU specifics + uint8_t _68705_port_b_r(); + void _68705_port_a_w(uint8_t data); + void _68705_port_b_w(uint8_t data); + void _68705_port_c_w(uint8_t data); + + void cpu1_map(address_map &map); + void cpu2_map(address_map &map); + void cshooter_cpu1_map(address_map &map); + void decrypted_opcodes_map(address_map &map); + void stfight_cpu1_map(address_map &map); +}; + + +void stfight_state::machine_start() +{ + m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); + m_main_bank->set_entry(0); + + m_int1_timer = timer_alloc(FUNC(stfight_state::rst08_tick), this); + + save_item(NAME(m_coin_state)); + save_item(NAME(m_fm_data)); + + save_item(NAME(m_cpu_to_mcu_empty)); + save_item(NAME(m_cpu_to_mcu_data)); + save_item(NAME(m_port_a_out)); + save_item(NAME(m_port_c_out)); + + save_item(NAME(m_vck2)); + save_item(NAME(m_adpcm_reset)); + save_item(NAME(m_adpcm_data_offs)); +} + + +void stfight_state::machine_reset() +{ + m_fm_data = 0; + m_cpu_to_mcu_empty = true; + m_adpcm_reset = true; + + // Coin signals are active low + m_coin_state = 3; +} + +// It's entirely possible that this bank is never switched out +// - in fact I don't even know how/where it's switched in! +void stfight_state::cshooter_bank_w(uint8_t data) +{ + m_main_bank->set_entry(bitswap(data, 7, 2)); +} + +/* + * CPU 1 timed interrupt - 60Hz??? + */ + +TIMER_CALLBACK_MEMBER(stfight_state::rst08_tick) +{ + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 +} + +INTERRUPT_GEN_MEMBER(stfight_state::vb_interrupt) +{ + // Do a RST10 + device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 + m_int1_timer->adjust(attotime::from_hz(120)); +} + +/* + * Hardware handlers + */ + +void stfight_state::io_w(uint8_t data) +{ + // TODO: What is bit 4? + machine().bookkeeping().coin_counter_w(0, data & 1); + machine().bookkeeping().coin_counter_w(1, data & 2); +} + +uint8_t stfight_state::coin_r() +{ + return m_coin_state; +} + +void stfight_state::coin_w(uint8_t data) +{ + // Acknowledge coin signals (active low) + if (!BIT(data, 0)) + m_coin_state |= 1; + + if (!BIT(data, 1)) + m_coin_state |= 2; +} + +/* + * Machine hardware for MSM5205 ADPCM sound control + */ + +void stfight_state::adpcm_int(int state) +{ + if (!state) + return; + + // Falling edge triggered interrupt at half the rate of /VCK? + m_mcu->set_input_line(M68705_IRQ_LINE, m_vck2 ? ASSERT_LINE : CLEAR_LINE); + m_vck2 = !m_vck2; + + if (!m_adpcm_reset) + { + uint8_t adpcm_data = m_samples[(m_adpcm_data_offs >> 1) & 0x7fff]; + + if (!BIT(m_adpcm_data_offs, 0)) + adpcm_data >>= 4; + ++m_adpcm_data_offs; + + m_msm->data_w(adpcm_data & 0x0f); + } +} + + +/* + * Machine hardware for YM2303 FM sound control + */ + +void stfight_state::fm_w(uint8_t data) +{ + // The sound CPU ignores any FM data without bit 7 set + m_fm_data = 0x80 | data; +} + +uint8_t stfight_state::fm_r() +{ + uint8_t const data = m_fm_data; + + // Acknowledge the command + if (!machine().side_effects_disabled()) + m_fm_data &= ~0x80; + + return data; +} + + +/* + * MCU communications + */ + +void stfight_state::mcu_w(uint8_t data) +{ + m_cpu_to_mcu_data = data & 0x0f; + m_cpu_to_mcu_empty = false; +} + +void stfight_state::_68705_port_a_w(uint8_t data) +{ + m_port_a_out = data; +} + +uint8_t stfight_state::_68705_port_b_r() +{ + return + (m_coin_mech->read() << 6) | + (m_cpu_to_mcu_empty ? 0x10 : 0x00) | + (m_cpu_to_mcu_data & 0x0f); +} + +void stfight_state::_68705_port_b_w(uint8_t data) +{ + // Acknowledge Z80 command + if (!BIT(data, 5)) + m_cpu_to_mcu_empty = true; +} + +void stfight_state::_68705_port_c_w(uint8_t data) +{ + // Signal a valid coin on the falling edge + if (BIT(m_port_c_out, 0) && !BIT(data, 0)) + m_coin_state &= ~1; + if (BIT(m_port_c_out, 1) && !BIT(data, 1)) + m_coin_state &= ~2; + + // Latch ADPCM data address when dropping the reset line + m_adpcm_reset = BIT(data, 2); + if (!m_adpcm_reset && BIT(m_port_c_out, 2)) + m_adpcm_data_offs = m_port_a_out << 9; + m_msm->reset_w(m_adpcm_reset ? ASSERT_LINE : CLEAR_LINE); + + // Generate NMI on host CPU (used on handshake error or stuck coin) + m_maincpu->set_input_line(INPUT_LINE_NMI, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); + + m_port_c_out = data; +} + + void stfight_state::cpu1_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("mainbank"); /* sf02.bin */ + map(0x8000, 0xbfff).bankr(m_main_bank); // sf02.bin map(0xc000, 0xc0ff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); map(0xc100, 0xc1ff).ram().w("palette", FUNC(palette_device::write8_ext)).share("palette_ext"); map(0xc200, 0xc200).portr("P1"); @@ -283,12 +563,12 @@ void stfight_state::cpu1_map(address_map &map) map(0xc202, 0xc202).portr("START"); map(0xc203, 0xc203).portr("DSW0"); map(0xc204, 0xc204).portr("DSW1"); - map(0xc205, 0xc205).r(FUNC(stfight_state::stfight_coin_r)); - map(0xc500, 0xc500).w(FUNC(stfight_state::stfight_fm_w)); - map(0xc600, 0xc600).w(FUNC(stfight_state::stfight_mcu_w)); - map(0xc700, 0xc700).w(FUNC(stfight_state::stfight_coin_w)); - map(0xc804, 0xc804).w(FUNC(stfight_state::stfight_io_w)); - map(0xc806, 0xc806).nopw(); /* TBD */ + map(0xc205, 0xc205).r(FUNC(stfight_state::coin_r)); + map(0xc500, 0xc500).w(FUNC(stfight_state::fm_w)); + map(0xc600, 0xc600).w(FUNC(stfight_state::mcu_w)); + map(0xc700, 0xc700).w(FUNC(stfight_state::coin_w)); + map(0xc804, 0xc804).w(FUNC(stfight_state::io_w)); + map(0xc806, 0xc806).nopw(); // TBD map(0xe000, 0xefff).ram(); } @@ -304,14 +584,14 @@ void stfight_state::stfight_cpu1_map(address_map &map) void stfight_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); + map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes); } void stfight_state::cshooter_cpu1_map(address_map &map) { cpu1_map(map); - map(0xc801, 0xc801).w(FUNC(stfight_state::stfight_bank_w)); + map(0xc801, 0xc801).w(FUNC(stfight_state::cshooter_bank_w)); map(0xd000, 0xd7ff).ram().w("airraid_vid", FUNC(airraid_video_device::txram_w)).share("txram"); map(0xd800, 0xd80f).ram().w("airraid_vid", FUNC(airraid_video_device::vregs_w)).share("vregs"); // wrong? map(0xf000, 0xfdff).ram(); @@ -328,13 +608,13 @@ void stfight_state::cpu2_map(address_map &map) map(0xd000, 0xd000).nopr(); map(0xd800, 0xd800).nopw(); map(0xe800, 0xe800).nopw(); - map(0xf000, 0xf000).r(FUNC(stfight_state::stfight_fm_r)); + map(0xf000, 0xf000).r(FUNC(stfight_state::fm_r)); map(0xf800, 0xffff).ram(); } static INPUT_PORTS_START( stfight ) - PORT_START("P1") /* PLAYER 1 */ + PORT_START("P1") // PLAYER 1 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY @@ -344,7 +624,7 @@ static INPUT_PORTS_START( stfight ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") /* PLAYER 2 */ + PORT_START("P2") // PLAYER 2 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL @@ -354,13 +634,13 @@ static INPUT_PORTS_START( stfight ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("START") /* START BUTTONS */ + PORT_START("START") // START BUTTONS PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* DSW1 */ - /* Manual refers to these as Dip-Switch Bank B, but TEST mode shows them as DIP-SW 1 */ + PORT_START("DSW0") // DSW1 + // Manual refers to these as Dip-Switch Bank B, but TEST mode shows them as DIP-SW 1 PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) @@ -383,8 +663,8 @@ static INPUT_PORTS_START( stfight ) PORT_DIPSETTING( 0x00, "Red" ) PORT_DIPSETTING( 0x80, "Blue" ) - PORT_START("DSW1") /* DSWA */ - /* Manual refers to these as Dip-Switch Bank A, but TEST mode shows them as DIP-SW 2 */ + PORT_START("DSW1") // DSWA + // Manual refers to these as Dip-Switch Bank A, but TEST mode shows them as DIP-SW 2 PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) @@ -407,7 +687,7 @@ static INPUT_PORTS_START( stfight ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("COIN") /* COIN MECH */ + PORT_START("COIN") // COIN MECH PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) INPUT_PORTS_END @@ -415,7 +695,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( cshooter ) PORT_INCLUDE(stfight) - PORT_MODIFY("DSW0") /* DSW2 (0xc203) */ + PORT_MODIFY("DSW0") // DSW2 (0xc203) PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) @@ -434,7 +714,7 @@ static INPUT_PORTS_START( cshooter ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - PORT_MODIFY("DSW1") /* DSW1 (0xc204) */ + PORT_MODIFY("DSW1") // DSW1 (0xc204) PORT_DIPNAME( 0x01, 0x01, "Coin Slots" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, "1" ) PORT_DIPSETTING( 0x00, "2" ) @@ -459,26 +739,25 @@ INPUT_PORTS_END void stfight_state::stfight_base(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware Z80(config, m_maincpu, 12_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::cpu1_map); - m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); Z80(config, m_audiocpu, 12_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &stfight_state::cpu2_map); m_audiocpu->set_periodic_int(FUNC(stfight_state::irq0_line_hold), attotime::from_hz(120)); M68705P5(config, m_mcu, 12_MHz_XTAL / 4); - m_mcu->portb_r().set(FUNC(stfight_state::stfight_68705_port_b_r)); - m_mcu->porta_w().set(FUNC(stfight_state::stfight_68705_port_a_w)); - m_mcu->portb_w().set(FUNC(stfight_state::stfight_68705_port_b_w)); - m_mcu->portc_w().set(FUNC(stfight_state::stfight_68705_port_c_w)); + m_mcu->portb_r().set(FUNC(stfight_state::_68705_port_b_r)); + m_mcu->porta_w().set(FUNC(stfight_state::_68705_port_a_w)); + m_mcu->portb_w().set(FUNC(stfight_state::_68705_port_b_w)); + m_mcu->portc_w().set(FUNC(stfight_state::_68705_port_c_w)); config.set_maximum_quantum(attotime::from_hz(600)); PALETTE(config, "palette").set_format(palette_device::xBRG_444, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); YM2203(config, m_ym[0], 12_MHz_XTAL / 8); @@ -494,7 +773,7 @@ void stfight_state::stfight_base(machine_config &config) m_ym[1]->add_route(3, "mono", 0.10); MSM5205(config, m_msm, 384_kHz_XTAL); - m_msm->vck_callback().set(FUNC(stfight_state::stfight_adpcm_int)); // Interrupt function + m_msm->vck_callback().set(FUNC(stfight_state::adpcm_int)); // Interrupt function m_msm->set_prescaler_selector(msm5205_device::S48_4B); // 8KHz, 4-bit m_msm->add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -504,7 +783,7 @@ void stfight_state::stfight(machine_config &config) stfight_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::stfight_cpu1_map); m_maincpu->set_addrmap(AS_OPCODES, &stfight_state::decrypted_opcodes_map); - m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); + m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::vb_interrupt)); STFIGHT_VIDEO(config, "stfight_vid", 0); } @@ -513,7 +792,7 @@ void stfight_state::cshooter(machine_config &config) { stfight_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::cshooter_cpu1_map); - m_maincpu->set_vblank_int("airraid_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); + m_maincpu->set_vblank_int("airraid_vid:screen", FUNC(stfight_state::vb_interrupt)); AIRRAID_VIDEO(config, "airraid_vid", 0); } @@ -527,503 +806,504 @@ void stfight_state::cshooter(machine_config &config) // Is this a bootleg? The MCU protection check at $00A7 has been disabled ROM_START( empcity ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "ec_01.rom", 0x00000, 0x8000, CRC(fe01d9b1) SHA1(c4b62d1b7e3a062f6a7a75f49cce5712f9016f98) ) - ROM_LOAD( "ec_02.rom", 0x10000, 0x8000, CRC(b3cf1ef7) SHA1(91bc92293cbb47c38a2552c5beea53894b87d446) ) /* bank switched */ + ROM_LOAD( "ec_02.rom", 0x10000, 0x8000, CRC(b3cf1ef7) SHA1(91bc92293cbb47c38a2552c5beea53894b87d446) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityu_68705.3j", 0x0000, 0x0800, CRC(182f7616) SHA1(38b4f23a559ae13f8ca1b974407a2a40fc52879f) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) + + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END -/* set just contained the 3 roms cpu.4u, cpu.2u and vid.2p and the prom 82s123.a7 */ +// set just contained the 3 ROMs cpu.4u, cpu.2u and vid.2p and the PROM 82s123.a7 ROM_START( empcityu ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "cpu.4u", 0x00000, 0x8000, CRC(e2c40ea3) SHA1(fd3c21fe3b5faf323a16be54ad2eed23b12c977e) ) - ROM_LOAD( "cpu.2u", 0x10000, 0x8000, CRC(96ee8b81) SHA1(95b516c023766fae79241d4422814e39e268ae7d) ) /* bank switched */ + ROM_LOAD( "cpu.2u", 0x10000, 0x8000, CRC(96ee8b81) SHA1(95b516c023766fae79241d4422814e39e268ae7d) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityu_68705.3j", 0x0000, 0x0800, CRC(182f7616) SHA1(38b4f23a559ae13f8ca1b974407a2a40fc52879f) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "vid.2p", 0x0000, 0x2000, CRC(15593793) SHA1(ac9ca8a0aa0ce3810f45aa41e74d4946ecced245) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_REGION( 0x020, "user1", 0 ) - ROM_LOAD( "82s123.a7", 0x0000, 0x0020, CRC(93e2d292) SHA1(af8edd0cfe85f28ede9604cfaf4516d54e5277c9) ) /* ?*/ + ROM_LOAD( "82s123.a7", 0x0000, 0x0020, CRC(93e2d292) SHA1(af8edd0cfe85f28ede9604cfaf4516d54e5277c9) ) // ? ROM_END ROM_START( empcityj ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x8000, CRC(8162331c) SHA1(f2fdf5fbc52d4ea692fb87fa049c48935a73d67b) ) // sldh - ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) ) /* bank switched */ // sldh + ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) ) // bank switched // sldh - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityj_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(19bdb0a9) SHA1(6baba9a46d64ae8349c7e9713419141f76a7af96) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( stfight ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "a-1.4q", 0x00000, 0x8000, CRC(ff83f316) SHA1(84553ebd96ddbf59a1bcb221d53781980a006925) ) - ROM_LOAD( "sf02.bin", 0x10000, 0x8000, CRC(e626ce9e) SHA1(2c6c5a5cf15cc50217c9864a4d861af8a1b1b5ad) ) /* bank switched */ + ROM_LOAD( "sf02.bin", 0x10000, 0x8000, CRC(e626ce9e) SHA1(2c6c5a5cf15cc50217c9864a4d861af8a1b1b5ad) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) - ROM_LOAD( "stfight_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) + ROM_LOAD( "_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END -/* not sure if this is a bootleg or not, it still displays the seibu copyright on a screen during the attract mode +/* not sure if this is a bootleg or not, it still displays the Seibu copyright on a screen during the attract mode but not during the initial startup, must investigate this set more later */ ROM_START( stfighta ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ - ROM_LOAD( "sfight2.bin", 0x00000, 0x8000, CRC(8fb4dfc9) SHA1(0350f4a8749883a4e2e9c4aed2447a64a078f9ce) )// 2.bin 58.532715% - ROM_LOAD( "sfight1.bin", 0x10000, 0x8000, CRC(983ce746) SHA1(3c7b9498f1adf253ba651558ee40641ec3dbc5eb) )/* bank switched */ // a-1.4q 99.737549% + ROM_REGION( 2*0x18000, "maincpu", 0 ) + ROM_LOAD( "sfight2.bin", 0x00000, 0x8000, CRC(8fb4dfc9) SHA1(0350f4a8749883a4e2e9c4aed2447a64a078f9ce) ) // 2.bin 58.532715% + ROM_LOAD( "sfight1.bin", 0x10000, 0x8000, CRC(983ce746) SHA1(3c7b9498f1adf253ba651558ee40641ec3dbc5eb) ) // bank switched // a-1.4q 99.737549% - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) - ROM_LOAD( "stfight_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) + ROM_LOAD( "_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( empcityi ) // very similar to above set - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x8000, CRC(32378e47) SHA1(1194e5a6b77ee754450ce532e048a55cf48d416c) ) ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(d20010c6) SHA1(8f30b385cbe733a4256461ab6f4aa82bc6694a6e) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityi_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(b1817d44) SHA1(395aad763eb054514f658a14c12b92c1b90c02ce) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( empcityfr ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "pr.4t", 0x00000, 0x8000, CRC(aa1f84ac) SHA1(b484b85270091511860f5b4041099c5335ff1204) ) ROM_LOAD( "pr.2t", 0x10000, 0x8000, CRC(af381247) SHA1(93812d6b6a2dead07670b789597d23f29b8f0c5d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "092-5c", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityfr_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(d66ac61f) SHA1(5f44d69886d4db46f2e4c07ebdf01e337ee4fd35) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "115.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "116.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "113.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "114.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "109.4j", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "110.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "097.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "108.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "095.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "096.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "093.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "094.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "117.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "118.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "111.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "112.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "091.5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( stfightgb ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.4t", 0x00000, 0x8000, CRC(0ce5ca11) SHA1(f753107a0c4ce52fe761ea2edce4c5e96169dfbd) ) - ROM_LOAD( "2.2t", 0x10000, 0x8000, CRC(936ba873) SHA1(bab519c587692a44a9cd1e9af2aeb7e3347c3f1b) ) /* bank switched */ + ROM_LOAD( "2.2t", 0x10000, 0x8000, CRC(936ba873) SHA1(bab519c587692a44a9cd1e9af2aeb7e3347c3f1b) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "c5", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "stfightgb_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(3b1b2660) SHA1(8d5d853a0861ff9cdea27eb3588586b441cc77b1) ) //hand-crafted, to be dumped - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END @@ -1073,16 +1353,16 @@ See airraid.cpp for notes about custom modules */ ROM_START( cshootert ) - ROM_REGION( 0x20000, "maincpu", 0 ) // Main CPU + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "r1.4u", 0x00000, 0x08000, CRC(fbe8c518) SHA1(bff8319f4892e6d06f1c7a679f67dc8407279cfa) ) ROM_LOAD( "r2.2u", 0x10000, 0x10000, CRC(5ddf9f4e) SHA1(69e4d422ca272bf2e9f00edbe7d23760485fdfe6) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) // Sub/Sound CPU + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "r4.5c", 0x00000, 0x08000, CRC(84fed017) SHA1(9a564c9379eb48569cfba48562889277991864d8) ) - ROM_REGION( 0x08000, "adpcm", ROMREGION_ERASEFF ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", ROMREGION_ERASEFF ) - ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */ + ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "crshooter.3j", 0x0000, 0x0800, CRC(aae61ce7) SHA1(bb2b9887ec73a5b82604b9b64c533c2242d20d0f) ) ROM_REGION( 0x820, "proms", 0 ) @@ -1092,13 +1372,13 @@ ROM_START( cshootert ) // below are from the video board - ROM_REGION( 0x02000, "airraid_vid:tx_gfx", 0 ) // TX Layer + ROM_REGION( 0x02000, "airraid_vid:tx_gfx", 0 ) ROM_LOAD( "r3.11a", 0x00000, 0x02000, CRC(67b50a47) SHA1(b1f4aefc9437edbeefba5371149cc08c0b55c741) ) ROM_REGION( 0x100, "airraid_vid:tx_clut", 0 ) - ROM_LOAD( "63s281.16a", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) // clut + ROM_LOAD( "63s281.16a", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) - /* ### MODULE 1 ### Background generation / graphics */ + // ### MODULE 1 ### Background generation / graphics ROM_REGION( 0x40000, "airraid_vid:bg_map", 0 ) ROM_LOAD16_BYTE( "bg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "bg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1108,7 +1388,7 @@ ROM_START( cshootert ) ROM_REGION( 0x100, "airraid_vid:bg_clut", 0 ) ROM_LOAD( "bg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 2 ### Foreground generation / graphics */ + // ### MODULE 2 ### Foreground generation / graphics ROM_REGION( 0x40000, "airraid_vid:fg_map", 0 ) ROM_LOAD16_BYTE( "fg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "fg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1118,7 +1398,7 @@ ROM_START( cshootert ) ROM_REGION( 0x100, "airraid_vid:fg_clut", 0 ) ROM_LOAD( "fg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 3 ### Sprite graphics */ + // ### MODULE 3 ### Sprite graphics ROM_REGION( 0x40000, "airraid_vid:spr_gfx", 0 ) ROM_LOAD16_BYTE( "sprite_tiles_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "sprite_tiles_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1127,6 +1407,59 @@ ROM_START( cshootert ) ROM_END +/* + +Encryption PAL 16R4 on CPU board + + +---U---+ + CP --| |-- VCC + ROM D1 --| |-- ROM D0 M1 = 0 M1 = 1 + ROM D3 --| |-- (NC) + ROM D4 --| |-- D6 D6 = D1 ^^ D3 D6 = / ( D1 ^^ D0 ) + ROM D6 --| |-- D4 D4 = / ( D6 ^^ A7 ) D4 = D3 ^^ A0 + A0 --| |-- D3 D3 = / ( D0 ^^ A1 ) D3 = D4 ^^ A4 + A1 --| |-- D0 D0 = D1 ^^ D4 D0 = / ( D6 ^^ A0 ) + A4 --| |-- (NC) + A7 --| |-- /M1 + GND --| |-- /OE + +-------+ + +*/ + + +void stfight_state::init_stfight() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (uint32_t A = 0; A < 0x8000; ++A) + { + uint8_t src = rom[A]; + + // decode opcode + m_decrypted_opcodes[A] = + ( src & 0xa6 ) | + ( ( ( ( src << 2 ) ^ src ) << 3 ) & 0x40 ) | + ( ~( ( src ^ ( A >> 1 ) ) >> 2 ) & 0x10 ) | + ( ~( ( ( src << 1 ) ^ A ) << 2 ) & 0x08 ) | + ( ( ( src ^ ( src >> 3 ) ) >> 1 ) & 0x01 ); + + // decode operand + rom[A] = + ( src & 0xa6 ) | + ( ~( ( src ^ ( src << 1 ) ) << 5 ) & 0x40 ) | + ( ( ( src ^ ( A << 3 ) ) << 1 ) & 0x10 ) | + ( ( ( src ^ A ) >> 1 ) & 0x08 ) | + ( ~( ( src >> 6 ) ^ A ) & 0x01 ); + } + + // Set clock prescaler FM:1/2 PSG:1/1 + m_ym[0]->write(0, 0x2f); + m_ym[1]->write(0, 0x2f); +} + +} // anonymous namespace + + // Note: Marked MACHINE_IMPERFECT_SOUND due to YM2203 clock issue GAME( 1986, empcity, 0, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu", "Empire City: 1931 (bootleg?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // different title logo @@ -1138,4 +1471,4 @@ GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, init_stfight, GAME( 1986, stfightgb, empcity, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu (Tuning license)", "Street Fight (Germany - Benelux)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Cross Shooter uses the same base board, but different video board -GAME( 1987, cshootert, airraid, cshooter, cshooter, stfight_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Cross Shooter (2 PCB Stack)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, cshootert, airraid, cshooter, cshooter, stfight_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Cross Shooter (2 PCB Stack)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/stfight.h b/src/mame/seibu/stfight.h deleted file mode 100644 index 08d28e4d728d3..0000000000000 --- a/src/mame/seibu/stfight.h +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark McDougall -#ifndef MAME_SEIBU_STFIGHT_H -#define MAME_SEIBU_STFIGHT_H - -#pragma once - -#include "cpu/m6805/m68705.h" -#include "sound/ymopn.h" -#include "sound/msm5205.h" -#include "stfight_dev.h" -#include "airraid_dev.h" - -class stfight_state : public driver_device -{ -public: - stfight_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_coin_mech(*this, "COIN") - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_mcu(*this, "mcu") - , m_msm(*this, "msm") - , m_ym(*this, "ym%u", 0) - , m_main_bank(*this, "mainbank") - , m_samples(*this, "adpcm") - , m_decrypted_opcodes(*this, "decrypted_opcodes") - , m_coin_state(0) - , m_fm_data(0) - , m_cpu_to_mcu_empty(true) - , m_cpu_to_mcu_data(0x0f) - , m_port_a_out(0xff) - , m_port_c_out(0xff) - , m_vck2(false) - , m_adpcm_reset(true) - , m_adpcm_data_offs(0x0000) - { - } - - void stfight_base(machine_config &config); - void stfight(machine_config &config); - void cshooter(machine_config &config); - - void init_stfight(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - TIMER_CALLBACK_MEMBER(rst08_tick); - -private: - void stfight_adpcm_int(int state); - - void stfight_io_w(uint8_t data); - uint8_t stfight_coin_r(); - void stfight_coin_w(uint8_t data); - void stfight_fm_w(uint8_t data); - void stfight_mcu_w(uint8_t data); - - void stfight_bank_w(uint8_t data); - - uint8_t stfight_fm_r(); - - INTERRUPT_GEN_MEMBER(stfight_vb_interrupt); - - // MCU specifics - uint8_t stfight_68705_port_b_r(); - void stfight_68705_port_a_w(uint8_t data); - void stfight_68705_port_b_w(uint8_t data); - void stfight_68705_port_c_w(uint8_t data); - - void cpu1_map(address_map &map); - void cpu2_map(address_map &map); - void cshooter_cpu1_map(address_map &map); - void decrypted_opcodes_map(address_map &map); - void stfight_cpu1_map(address_map &map); - - required_ioport m_coin_mech; - - required_device m_maincpu; - required_device m_audiocpu; - required_device m_mcu; - required_device m_msm; - required_device_array m_ym; - - required_memory_bank m_main_bank; - - required_region_ptr m_samples; - optional_shared_ptr m_decrypted_opcodes; - - uint8_t m_coin_state = 0; - - uint8_t m_fm_data = 0; - - bool m_cpu_to_mcu_empty = false; - uint8_t m_cpu_to_mcu_data = 0; - uint8_t m_port_a_out = 0; - uint8_t m_port_c_out = 0; - - bool m_vck2 = false; - bool m_adpcm_reset = false; - uint16_t m_adpcm_data_offs = 0; - - emu_timer *m_int1_timer = nullptr; -}; - -#endif // MAME_SEIBU_STFIGHT_H diff --git a/src/mame/seibu/stfight_m.cpp b/src/mame/seibu/stfight_m.cpp deleted file mode 100644 index ab701c738ff4e..0000000000000 --- a/src/mame/seibu/stfight_m.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark McDougall -/*************************************************************************** - - stfight.c - - Functions to emulate general aspects of the machine (RAM, ROM, interrupts, - I/O ports) - -***************************************************************************/ - -#include "emu.h" -#include "stfight.h" - -#include "cpu/m6805/m68705.h" -#include "cpu/z80/z80.h" -#include "sound/msm5205.h" - - -/* - -Encryption PAL 16R4 on CPU board - - +---U---+ - CP --| |-- VCC - ROM D1 --| |-- ROM D0 M1 = 0 M1 = 1 - ROM D3 --| |-- (NC) - ROM D4 --| |-- D6 D6 = D1 ^^ D3 D6 = / ( D1 ^^ D0 ) - ROM D6 --| |-- D4 D4 = / ( D6 ^^ A7 ) D4 = D3 ^^ A0 - A0 --| |-- D3 D3 = / ( D0 ^^ A1 ) D3 = D4 ^^ A4 - A1 --| |-- D0 D0 = D1 ^^ D4 D0 = / ( D6 ^^ A0 ) - A4 --| |-- (NC) - A7 --| |-- /M1 - GND --| |-- /OE - +-------+ - -*/ - - -void stfight_state::init_stfight() -{ - uint8_t *rom = memregion("maincpu")->base(); - - for (uint32_t A = 0; A < 0x8000; ++A) - { - uint8_t src = rom[A]; - - // decode opcode - m_decrypted_opcodes[A] = - ( src & 0xA6 ) | - ( ( ( ( src << 2 ) ^ src ) << 3 ) & 0x40 ) | - ( ~( ( src ^ ( A >> 1 ) ) >> 2 ) & 0x10 ) | - ( ~( ( ( src << 1 ) ^ A ) << 2 ) & 0x08 ) | - ( ( ( src ^ ( src >> 3 ) ) >> 1 ) & 0x01 ); - - // decode operand - rom[A] = - ( src & 0xA6 ) | - ( ~( ( src ^ ( src << 1 ) ) << 5 ) & 0x40 ) | - ( ( ( src ^ ( A << 3 ) ) << 1 ) & 0x10 ) | - ( ( ( src ^ A ) >> 1 ) & 0x08 ) | - ( ~( ( src >> 6 ) ^ A ) & 0x01 ); - } - - // Set clock prescaler FM:1/2 PSG:1/1 - m_ym[0]->write(0, 0x2f); - m_ym[1]->write(0, 0x2f); -} - -void stfight_state::machine_start() -{ - m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); - m_main_bank->set_entry(0); - - m_int1_timer = timer_alloc(FUNC(stfight_state::rst08_tick), this); - - save_item(NAME(m_coin_state)); - save_item(NAME(m_fm_data)); - - save_item(NAME(m_cpu_to_mcu_empty)); - save_item(NAME(m_cpu_to_mcu_data)); - save_item(NAME(m_port_a_out)); - save_item(NAME(m_port_c_out)); - - save_item(NAME(m_vck2)); - save_item(NAME(m_adpcm_reset)); - save_item(NAME(m_adpcm_data_offs)); -} - - -void stfight_state::machine_reset() -{ - m_fm_data = 0; - m_cpu_to_mcu_empty = true; - m_adpcm_reset = true; - - // Coin signals are active low - m_coin_state = 3; -} - -// It's entirely possible that this bank is never switched out -// - in fact I don't even know how/where it's switched in! -void stfight_state::stfight_bank_w(uint8_t data) -{ - m_main_bank->set_entry(bitswap(data, 7, 2)); -} - -/* - * CPU 1 timed interrupt - 60Hz??? - */ - -TIMER_CALLBACK_MEMBER(stfight_state::rst08_tick) -{ - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 -} - -INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt) -{ - // Do a RST10 - device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - m_int1_timer->adjust(attotime::from_hz(120)); -} - -/* - * Hardware handlers - */ - -void stfight_state::stfight_io_w(uint8_t data) -{ - // TODO: What is bit 4? - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); -} - -uint8_t stfight_state::stfight_coin_r() -{ - return m_coin_state; -} - -void stfight_state::stfight_coin_w(uint8_t data) -{ - // Acknowledge coin signals (active low) - if (!BIT(data, 0)) - m_coin_state |= 1; - - if (!BIT(data, 1)) - m_coin_state |= 2; -} - -/* - * Machine hardware for MSM5205 ADPCM sound control - */ - -void stfight_state::stfight_adpcm_int(int state) -{ - if (!state) - return; - - // Falling edge triggered interrupt at half the rate of /VCK? - m_mcu->set_input_line(M68705_IRQ_LINE, m_vck2 ? ASSERT_LINE : CLEAR_LINE); - m_vck2 = !m_vck2; - - if (!m_adpcm_reset) - { - uint8_t adpcm_data = m_samples[(m_adpcm_data_offs >> 1) & 0x7fff]; - - if (!BIT(m_adpcm_data_offs, 0)) - adpcm_data >>= 4; - ++m_adpcm_data_offs; - - m_msm->data_w(adpcm_data & 0x0f); - } -} - - -/* - * Machine hardware for YM2303 FM sound control - */ - -void stfight_state::stfight_fm_w(uint8_t data) -{ - // The sound cpu ignores any FM data without bit 7 set - m_fm_data = 0x80 | data; -} - -uint8_t stfight_state::stfight_fm_r() -{ - uint8_t const data = m_fm_data; - - // Acknowledge the command - if (!machine().side_effects_disabled()) - m_fm_data &= ~0x80; - - return data; -} - - -/* - * MCU communications - */ - -void stfight_state::stfight_mcu_w(uint8_t data) -{ - m_cpu_to_mcu_data = data & 0x0f; - m_cpu_to_mcu_empty = false; -} - -void stfight_state::stfight_68705_port_a_w(uint8_t data) -{ - m_port_a_out = data; -} - -uint8_t stfight_state::stfight_68705_port_b_r() -{ - return - (m_coin_mech->read() << 6) | - (m_cpu_to_mcu_empty ? 0x10 : 0x00) | - (m_cpu_to_mcu_data & 0x0f); -} - -void stfight_state::stfight_68705_port_b_w(uint8_t data) -{ - // Acknowledge Z80 command - if (!BIT(data, 5)) - m_cpu_to_mcu_empty = true; -} - -void stfight_state::stfight_68705_port_c_w(uint8_t data) -{ - // Signal a valid coin on the falling edge - if (BIT(m_port_c_out, 0) && !BIT(data, 0)) - m_coin_state &= ~1; - if (BIT(m_port_c_out, 1) && !BIT(data, 1)) - m_coin_state &= ~2; - - // Latch ADPCM data address when dropping the reset line - m_adpcm_reset = BIT(data, 2); - if (!m_adpcm_reset && BIT(m_port_c_out, 2)) - m_adpcm_data_offs = m_port_a_out << 9; - m_msm->reset_w(m_adpcm_reset ? ASSERT_LINE : CLEAR_LINE); - - // Generate NMI on host CPU (used on handshake error or stuck coin) - m_maincpu->set_input_line(INPUT_LINE_NMI, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); - - m_port_c_out = data; -} diff --git a/src/mame/seibu/wiz.cpp b/src/mame/seibu/wiz.cpp index 59abd0dfaf74d..0134f32892ef6 100644 --- a/src/mame/seibu/wiz.cpp +++ b/src/mame/seibu/wiz.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari +// copyright-holders: Zsolt Vasvari + /*************************************************************************** Seibu Stinger/Wiz hardware @@ -78,7 +79,7 @@ I/O write: TODO: - Verify sprite colors in stinger/scion -- Global palette is wrong in stinger/scion compared to pcb, or could it be +- Global palette is wrong in stinger/scion compared to PCB, or could it be due to gamma/hue? - cpu/video/interrupt frequency measurements - sprite-sprite priorities are not correct yet, eg: @@ -86,7 +87,7 @@ I/O write: than that 'vacuum cleaner' enemy sphere, * the cloud in kungfut should have higher prio than player char - Improve stinger/scion discrete sound, shot sound should include noise -- stinger/scion audiocpu jumps to lalaland after receiving a soundlatch of 0x90, +- stinger/scion audio CPU jumps to lalaland after receiving a soundlatch of 0x90, basically resetting itself. I assume this is a game bug - scion insert-coin sound sometimes repeats or is silent due to soundlatch timing, this could be a game bug as well @@ -106,7 +107,7 @@ I/O write: 2xZ80 , 3x AY8910 (DSW 1 , bit 2 ) "THE MICROPHONE IS OUT OF CONTROL, SO THIS GAME DEPENDS ON THE BUTTONS" - There's no additional hw or connectors on the pcb + There's no additional hw or connectors on the PCB (except for small (bit 0 - ON, bit 1 - ON) DSW near AY chips ) Tomasz Slanina @@ -177,16 +178,332 @@ Stephh's notes (based on the games Z80 code and some tests) : ***************************************************************************/ #include "emu.h" -#include "wiz.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ay8910.h" +#include "sound/discrete.h" +#include "video/resnet.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class wiz_state : public driver_device +{ +public: + wiz_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_videoram(*this, "videoram%u", 1U), + m_colorram(*this, "colorram%u", 1U), + m_attrram(*this, "attrram%u", 1U), + m_spriteram(*this, "spriteram%u", 1U) + { } + + void wiz(machine_config &config); + void kungfut(machine_config &config); + void kungfuta(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr_array m_videoram; + required_shared_ptr_array m_colorram; + required_shared_ptr_array m_attrram; + required_shared_ptr_array m_spriteram; + + uint8_t m_flipx = 0; + uint8_t m_flipy = 0; + uint8_t m_bgcolor = 0; + uint8_t m_charbank[2]{}; + uint8_t m_palbank[2]{}; + uint8_t m_main_nmi_mask = 0; + uint8_t m_sound_nmi_mask = 0; + uint8_t m_sprite_bank = 0; + + uint8_t wiz_protection_r(); + uint8_t kungfuta_protection_r(); + void wiz_coin_counter_w(offs_t offset, uint8_t data); + void main_nmi_mask_w(uint8_t data); + void sound_nmi_mask_w(uint8_t data); + void palette_bank_w(offs_t offset, uint8_t data); + void wiz_sprite_bank_w(uint8_t data); + void bgcolor_w(uint8_t data); + void char_bank_w(offs_t offset, uint8_t data); + void flipx_w(uint8_t data); + void flipy_w(uint8_t data); + + void palette(palette_device &palette) const; + uint32_t screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(vblank_interrupt); + INTERRUPT_GEN_MEMBER(sound_interrupt); + void draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank); + + void kungfut_main_map(address_map &map); + void kungfuta_main_map(address_map &map); + void sound_map(address_map &map); + void wiz_main_map(address_map &map); +}; + +class stinger_state : public wiz_state +{ +public: + stinger_state(const machine_config &mconfig, device_type type, const char *tag) : + wiz_state(mconfig, type, tag), + m_discrete(*this, "discrete"), + m_decrypted_opcodes(*this, "decrypted_opcodes") + { } + + void scion(machine_config &config); + void stinger(machine_config &config); + + void init_stinger(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_discrete; + + optional_shared_ptr m_decrypted_opcodes; + + uint8_t m_dsc0 = 0; + uint8_t m_dsc1 = 0; + + void explosion_w(uint8_t data); + void shot_w(uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void decrypted_opcodes_map(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Stinger has three 256x4 palette PROMs (one per gun). + The palette PROMs are connected to the RGB output this way: + + bit 3 -- 100 ohm resistor -- RED/GREEN/BLUE + -- 220 ohm resistor -- RED/GREEN/BLUE + -- 470 ohm resistor -- RED/GREEN/BLUE + bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE + +***************************************************************************/ + +void wiz_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + static constexpr int resistances[4] = { 1000, 470, 220, 100 }; + + // compute the color output resistor weights + double rweights[4], gweights[4], bweights[4]; + compute_resistor_weights(0, 255, -1.0, + 4, resistances, rweights, 470, 0, + 4, resistances, gweights, 470, 0, + 4, resistances, bweights, 470, 0); + + // initialize the palette with these colors + for (int i = 0; i < 0x100; i++) + { + int bit0, bit1, bit2, bit3; + + // red component + bit0 = BIT(color_prom[i + 0x000], 0); + bit1 = BIT(color_prom[i + 0x000], 1); + bit2 = BIT(color_prom[i + 0x000], 2); + bit3 = BIT(color_prom[i + 0x000], 3); + int const r = combine_weights(rweights, bit0, bit1, bit2, bit3); + + // green component + bit0 = BIT(color_prom[i + 0x100], 0); + bit1 = BIT(color_prom[i + 0x100], 1); + bit2 = BIT(color_prom[i + 0x100], 2); + bit3 = BIT(color_prom[i + 0x100], 3); + int const g = combine_weights(gweights, bit0, bit1, bit2, bit3); + + // blue component + bit0 = BIT(color_prom[i + 0x200], 0); + bit1 = BIT(color_prom[i + 0x200], 1); + bit2 = BIT(color_prom[i + 0x200], 2); + bit3 = BIT(color_prom[i + 0x200], 3); + int const b = combine_weights(bweights, bit0, bit1, bit2, bit3); + + m_palette->set_pen_color(i, rgb_t(r, g, b)); + } +} + + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +void wiz_state::palette_bank_w(offs_t offset, uint8_t data) +{ + m_palbank[offset] = data & 1; +} + +void wiz_state::char_bank_w(offs_t offset, uint8_t data) +{ + m_charbank[offset] = data & 1; +} + +void wiz_state::wiz_sprite_bank_w(uint8_t data) +{ + m_sprite_bank = data & 1; +} + +void wiz_state::bgcolor_w(uint8_t data) +{ + m_bgcolor = data; +} + +void wiz_state::flipx_w(uint8_t data) +{ + m_flipx = data & 1; +} + +void wiz_state::flipy_w(uint8_t data) +{ + m_flipy = data & 1; +} + + + +/*************************************************************************** + + Screen Update + +***************************************************************************/ + +void wiz_state::draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype) +{ + gfx_element *gfx = m_gfxdecode->gfx(charbank); + int const palbank = m_palbank[1] << 4 | m_palbank[0] << 3; + + // draw the tiles. They are characters, but draw them as sprites. + for (int offs = 0x400 - 1; offs >= 0; offs--) + { + int const code = m_videoram[layer][offs]; + int sx = offs & 0x1f; + int const sy = offs >> 5; + int color = m_attrram[layer][sx << 1 | 1] & 7; + + // wiz/kungfut hw allows more color variety on screen + if (colortype) + color = layer ? (m_colorram[layer][offs] & 7) : ((color & 4) | (code & 3)); + + int scroll = (8 * sy + 256 - m_attrram[layer][sx << 1]) & 0xff; + if (m_flipy) + scroll = (248 - scroll) & 0xff; + if (m_flipx) + sx = 31 - sx; + + gfx->transpen(bitmap, cliprect, + code, + palbank | color, + m_flipx, m_flipy, + 8 * sx, scroll, 0); + } +} + + +void wiz_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank) +{ + gfx_element *gfx = m_gfxdecode->gfx(charbank); + int const palbank = m_palbank[1] << 4 | m_palbank[0] << 3; + + for (int offs = 0x20 - 4; offs >= 0; offs -= 4) + { + int const code = m_spriteram[set][offs + 1]; + int sx = m_spriteram[set][offs + 3]; + int sy = m_spriteram[set][offs]; + int const color = m_spriteram[set][offs + 2] & 7; // high bits unused + + if (!sx || !sy) continue; + + // like on galaxian hw, the first three sprites match against y-1 (not on m_spriteram[1]) + if (set == 0 && offs <= 8) + sy += (m_flipy) ? 1 : -1; + + if (m_flipx) sx = 240 - sx; + if (!m_flipy) sy = 240 - sy; + + gfx->transpen(bitmap, cliprect, + code, + palbank | color, + m_flipx, m_flipy, + sx, sy, 0); + } +} + + +/**************************************************************************/ + +uint32_t wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 1); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); + draw_sprites(bitmap, cliprect, 1, 4); + draw_sprites(bitmap, cliprect, 0, 5); + return 0; +} + +uint32_t wiz_state::screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + ((m_charbank[0] << 1) | m_charbank[1]), 1); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); + + const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); + const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); + const rectangle &visible_area = m_flipx ? spritevisibleareaflipx : spritevisiblearea; + + draw_sprites(bitmap, visible_area, 1, 6); + draw_sprites(bitmap, visible_area, 0, 7 + m_sprite_bank); + return 0; +} + + +uint32_t stinger_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 0); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 0); + draw_sprites(bitmap, cliprect, 1, 4); + draw_sprites(bitmap, cliprect, 0, 5); + return 0; +} + + +// machine + /*************************************************************************** Stinger/Scion discrete sound @@ -202,16 +519,16 @@ Stephh's notes (based on the games Z80 code and some tests) : static const discrete_lfsr_desc stinger_lfsr = { DISC_CLK_IS_FREQ, - 16, /* Bit Length */ - 0, /* Reset Value */ - 6, /* Use Bit 6 as XOR input 0 */ - 14, /* Use Bit 14 as XOR input 1 */ - DISC_LFSR_XNOR, /* Feedback stage1 is XNOR */ - DISC_LFSR_OR, /* Feedback stage2 is just stage 1 output OR with external feed */ - DISC_LFSR_REPLACE, /* Feedback stage3 replaces the shifted register contents */ - 0x000001, /* Everything is shifted into the first bit only */ - 0, /* Output is already inverted by XNOR */ - 16 /* Output bit is feedback bit */ + 16, // Bit Length + 0, // Reset Value + 6, // Use Bit 6 as XOR input 0 + 14, // Use Bit 14 as XOR input 1 + DISC_LFSR_XNOR, // Feedback stage1 is XNOR + DISC_LFSR_OR, // Feedback stage2 is just stage 1 output OR with external feed + DISC_LFSR_REPLACE, // Feedback stage3 replaces the shifted register contents + 0x000001, // Everything is shifted into the first bit only + 0, // Output is already inverted by XNOR + 16 // Output bit is feedback bit }; static DISCRETE_SOUND_START(stinger_discrete) @@ -221,10 +538,10 @@ static DISCRETE_SOUND_START(stinger_discrete) #define STINGER_FINAL_MIX NODE_99 // triggers are interleaved to give each circuit sufficient time to reset - DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN1) // even-inteval shots - DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN2) // odd-inteval shots - DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN1) // even-inteval explosions - DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN2) // odd-inteval explosions + DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN1) // even-interval shots + DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN2) // odd-interval shots + DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN1) // even-interval explosions + DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN2) // odd-interval explosions //--------------------------------------- // Sample Shot Sound Circuit @@ -264,18 +581,18 @@ static DISCRETE_SOUND_START(stinger_discrete) DISCRETE_SOUND_END -void wiz_state::stinger_explosion_w(uint8_t data) +void stinger_state::explosion_w(uint8_t data) { // explosion sound trigger(analog?) m_discrete->write(STINGER_BOOM_EN1, m_dsc1); - m_discrete->write(STINGER_BOOM_EN2, m_dsc1^=1); + m_discrete->write(STINGER_BOOM_EN2, m_dsc1 ^= 1); } -void wiz_state::stinger_shot_w(uint8_t data) +void stinger_state::shot_w(uint8_t data) { // player shot sound trigger(analog?) m_discrete->write(STINGER_SHOT_EN1, m_dsc0); - m_discrete->write(STINGER_SHOT_EN2, m_dsc0^=1); + m_discrete->write(STINGER_SHOT_EN2, m_dsc0 ^= 1); } @@ -288,24 +605,24 @@ void wiz_state::stinger_shot_w(uint8_t data) uint8_t wiz_state::wiz_protection_r() { - switch (m_colorram2[0]) + switch (m_colorram[1][0]) { - case 0x35: return 0x25; /* FIX: sudden player death + free play afterwards */ - case 0x8f: return 0x1f; /* FIX: early boss appearance with corrupt graphics */ - case 0xa0: return 0x00; /* FIX: executing junk code after defeating the boss */ + case 0x35: return 0x25; // FIX: sudden player death + free play afterwards + case 0x8f: return 0x1f; // FIX: early boss appearance with corrupt graphics + case 0xa0: return 0x00; // FIX: executing junk code after defeating the boss } - return m_colorram2[0]; + return m_colorram[1][0]; } uint8_t wiz_state::kungfuta_protection_r() { - // this cases are based on looking at the code, the kungfut set has no such checks + // these cases are based on looking at the code, the kungfut set has no such checks // and is a very different version of the game // much like wiz, kungfuta writes a value to the first byte of 'colorram2' reads it // back, then checks against a fixed value - switch (m_colorram2[0]) + switch (m_colorram[1][0]) { case 0x3a: return 0x0a; case 0x5a: return 0xda; // after bonus round, prevents infinite loop @@ -316,7 +633,7 @@ uint8_t wiz_state::kungfuta_protection_r() case 0xff: return 0xff; // done before other checks, although code at 0xacc8 will skip 2nd check like this } - return m_colorram2[0]; + return m_colorram[1][0]; } void wiz_state::wiz_coin_counter_w(offs_t offset, uint8_t data) @@ -324,7 +641,7 @@ void wiz_state::wiz_coin_counter_w(offs_t offset, uint8_t data) machine().bookkeeping().coin_counter_w(offset, data & 1); } -void wiz_state::wiz_main_nmi_mask_w(uint8_t data) +void wiz_state::main_nmi_mask_w(uint8_t data) { m_main_nmi_mask = data & 1; } @@ -334,30 +651,30 @@ void wiz_state::kungfut_main_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xc7ff).ram(); - map(0xd000, 0xd3ff).ram().share("videoram2"); - map(0xd400, 0xd7ff).ram().share("colorram2"); - map(0xd800, 0xd83f).ram().share("attrram2"); - map(0xd840, 0xd85f).ram().share("spriteram2"); - map(0xe000, 0xe3ff).ram().share("videoram"); - map(0xe400, 0xe7ff).ram().share("colorram"); - map(0xe800, 0xe83f).ram().share("attrram"); - map(0xe840, 0xe85f).ram().share("spriteram"); + map(0xd000, 0xd3ff).ram().share(m_videoram[1]); + map(0xd400, 0xd7ff).ram().share(m_colorram[1]); + map(0xd800, 0xd83f).ram().share(m_attrram[1]); + map(0xd840, 0xd85f).ram().share(m_spriteram[1]); + map(0xe000, 0xe3ff).ram().share(m_videoram[0]); + map(0xe400, 0xe7ff).ram().share(m_colorram[0]); + map(0xe800, 0xe83f).ram().share(m_attrram[0]); + map(0xe840, 0xe85f).ram().share(m_spriteram[0]); map(0xf000, 0xf000).portr("DSW0"); - map(0xf001, 0xf001).w(FUNC(wiz_state::wiz_main_nmi_mask_w)); - map(0xf002, 0xf003).w(FUNC(wiz_state::wiz_palette_bank_w)); - map(0xf004, 0xf005).w(FUNC(wiz_state::wiz_char_bank_w)); - map(0xf006, 0xf006).w(FUNC(wiz_state::wiz_flipx_w)); - map(0xf007, 0xf007).w(FUNC(wiz_state::wiz_flipy_w)); + map(0xf001, 0xf001).w(FUNC(wiz_state::main_nmi_mask_w)); + map(0xf002, 0xf003).w(FUNC(wiz_state::palette_bank_w)); + map(0xf004, 0xf005).w(FUNC(wiz_state::char_bank_w)); + map(0xf006, 0xf006).w(FUNC(wiz_state::flipx_w)); + map(0xf007, 0xf007).w(FUNC(wiz_state::flipy_w)); map(0xf008, 0xf008).portr("DSW1"); map(0xf010, 0xf010).portr("IN0"); map(0xf018, 0xf018).portr("IN1"); map(0xf800, 0xf800).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0xf818, 0xf818).w(FUNC(wiz_state::wiz_bgcolor_w)); + map(0xf818, 0xf818).w(FUNC(wiz_state::bgcolor_w)); } -void wiz_state::decrypted_opcodes_map(address_map &map) +void stinger_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0xbfff).rom().share("decrypted_opcodes"); + map(0x0000, 0xbfff).rom().share(m_decrypted_opcodes); } void wiz_state::kungfuta_main_map(address_map &map) @@ -375,25 +692,25 @@ void wiz_state::wiz_main_map(address_map &map) } -void wiz_state::stinger_main_map(address_map &map) +void stinger_state::main_map(address_map &map) { kungfut_main_map(map); // map(0xf008, 0xf00f).nopw(); // ? map(0xf800, 0xf800).r("watchdog", FUNC(watchdog_timer_device::reset_r)); - map(0xf808, 0xf808).w(FUNC(wiz_state::stinger_explosion_w)); - map(0xf80a, 0xf80a).w(FUNC(wiz_state::stinger_shot_w)); + map(0xf808, 0xf808).w(FUNC(stinger_state::explosion_w)); + map(0xf80a, 0xf80a).w(FUNC(stinger_state::shot_w)); } /**************************************************************************/ -void wiz_state::wiz_sound_nmi_mask_w(uint8_t data) +void wiz_state::sound_nmi_mask_w(uint8_t data) { m_sound_nmi_mask = data & 1; } -void wiz_state::kungfut_sound_map(address_map &map) +void wiz_state::sound_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x1fff).rom(); @@ -401,19 +718,19 @@ void wiz_state::kungfut_sound_map(address_map &map) map(0x4000, 0x4001).w("8910.3", FUNC(ay8910_device::address_data_w)); map(0x5000, 0x5001).w("8910.1", FUNC(ay8910_device::address_data_w)); map(0x6000, 0x6001).w("8910.2", FUNC(ay8910_device::address_data_w)); - map(0x7000, 0x7000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::wiz_sound_nmi_mask_w)); + map(0x7000, 0x7000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::sound_nmi_mask_w)); } -void wiz_state::stinger_sound_map(address_map &map) +void stinger_state::sound_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x1fff).rom(); map(0x2000, 0x23ff).ram(); - map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::wiz_sound_nmi_mask_w)); + map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(stinger_state::sound_nmi_mask_w)); map(0x4000, 0x4000).nopw(); // ? map(0x5000, 0x5001).w("8910.1", FUNC(ay8910_device::address_data_w)); map(0x6000, 0x6001).w("8910.2", FUNC(ay8910_device::address_data_w)); - map(0x5000, 0x7fff).nopr(); // prevent error.log spam, cpu jumps here by accident + map(0x5000, 0x7fff).nopr(); // prevent error.log spam, CPU jumps here by accident } @@ -471,7 +788,7 @@ static INPUT_PORTS_START( stinger ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "Debug Mode" ) /* See notes */ + PORT_DIPNAME( 0x01, 0x00, "Debug Mode" ) // See notes PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_B ) ) @@ -509,7 +826,7 @@ static INPUT_PORTS_START( stinger2 ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coin_B ) ) /* See notes */ + PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coin_B ) ) // See notes PORT_DIPSETTING( 0x70, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_3C ) ) @@ -570,13 +887,13 @@ static INPUT_PORTS_START( scion ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x20, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x20, DEF_STR( On ) ) // See notes PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x40, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x40, DEF_STR( On ) ) // See notes PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x80, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // See notes INPUT_PORTS_END static INPUT_PORTS_START( kungfut ) @@ -632,7 +949,7 @@ static INPUT_PORTS_START( kungfut ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Microphone" ) /* See notes */ + PORT_DIPNAME( 0x04, 0x04, "Microphone" ) // See notes PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) ) @@ -642,7 +959,7 @@ static INPUT_PORTS_START( kungfut ) PORT_DIPSETTING( 0x18, "5" ) PORT_DIPNAME( 0x60, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x00, "20000 40000" ) -// PORT_DIPSETTING( 0x20, "20000 40000" ) // duplicated setting + PORT_DIPSETTING( 0x20, "20000 40000" ) // duplicated setting PORT_DIPSETTING( 0x10, "20000 80000" ) PORT_DIPSETTING( 0x30, "30000 90000" ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) @@ -728,26 +1045,26 @@ INPUT_PORTS_END static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ - 256, /* 256 characters */ - 3, /* 3 bits per pixel */ - { 0x4000*8, 0x2000*8, 0 }, /* the three bitplanes are separated */ + 8,8, // 8*8 characters + 256, // 256 characters + 3, // 3 bits per pixel + { 0x4000*8, 0x2000*8, 0 }, // the three bitplanes are separated { 0, 1, 2, 3, 4, 5, 6, 7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 /* every char takes 8 consecutive bytes */ + 8*8 // every char takes 8 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 256, /* 256 sprites */ - 3, /* 3 bits per pixel */ - { 0x4000*8, 0x2000*8, 0 }, /* the three bitplanes are separated */ + 16,16, // 16*16 sprites + 256, // 256 sprites + 3, // 3 bits per pixel + { 0x4000*8, 0x2000*8, 0 }, // the three bitplanes are separated { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 32*8 /* every sprite takes 32 consecutive bytes */ + 32*8 // every sprite takes 32 consecutive bytes }; @@ -778,7 +1095,6 @@ void wiz_state::machine_reset() { m_main_nmi_mask = 0; m_sound_nmi_mask = 0; - m_dsc0 = m_dsc1 = 1; m_sprite_bank = 0; m_charbank[0] = m_charbank[1] = 0; @@ -788,13 +1104,18 @@ void wiz_state::machine_reset() m_bgcolor = 0; } +void stinger_state::machine_reset() +{ + wiz_state::machine_reset(); + + m_dsc0 = m_dsc1 = 1; +} + void wiz_state::machine_start() { // register for savestates save_item(NAME(m_main_nmi_mask)); save_item(NAME(m_sound_nmi_mask)); - save_item(NAME(m_dsc0)); - save_item(NAME(m_dsc1)); save_item(NAME(m_sprite_bank)); save_item(NAME(m_charbank)); @@ -804,15 +1125,24 @@ void wiz_state::machine_start() save_item(NAME(m_bgcolor)); } +void stinger_state::machine_start() +{ + wiz_state::machine_start(); + + // register for savestates + save_item(NAME(m_dsc0)); + save_item(NAME(m_dsc1)); +} + /**************************************************************************/ -INTERRUPT_GEN_MEMBER(wiz_state::wiz_vblank_interrupt) +INTERRUPT_GEN_MEMBER(wiz_state::vblank_interrupt) { if (m_main_nmi_mask & 1) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -INTERRUPT_GEN_MEMBER(wiz_state::wiz_sound_interrupt) +INTERRUPT_GEN_MEMBER(wiz_state::sound_interrupt) { if (m_sound_nmi_mask & 1) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); @@ -820,37 +1150,37 @@ INTERRUPT_GEN_MEMBER(wiz_state::wiz_sound_interrupt) void wiz_state::kungfut(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/6); /* 3.072 MHz ??? */ + // basic machine hardware + Z80(config, m_maincpu, 18'432'000 / 6); // 3.072 MHz ??? m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::kungfut_main_map); - m_maincpu->set_vblank_int("screen", FUNC(wiz_state::wiz_vblank_interrupt)); + m_maincpu->set_vblank_int("screen", FUNC(wiz_state::vblank_interrupt)); - Z80(config, m_audiocpu, 18432000/6); /* 3.072 MHz ??? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::kungfut_sound_map); - m_audiocpu->set_periodic_int(FUNC(wiz_state::wiz_sound_interrupt), attotime::from_hz(4*60)); /* ??? */ + Z80(config, m_audiocpu, 18'432'000 / 6); // 3.072 MHz ??? + m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::sound_map); + m_audiocpu->set_periodic_int(FUNC(wiz_state::sound_interrupt), attotime::from_hz(4*60)); // ??? - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */ ); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); screen.set_screen_update(FUNC(wiz_state::screen_update_kungfut)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_stinger); - PALETTE(config, m_palette, FUNC(wiz_state::wiz_palette), 256); + PALETTE(config, m_palette, FUNC(wiz_state::palette), 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - AY8910(config, "8910.1", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.1", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); - AY8910(config, "8910.2", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.2", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); - AY8910(config, "8910.3", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.3", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); } void wiz_state::kungfuta(machine_config &config) @@ -864,46 +1194,43 @@ void wiz_state::wiz(machine_config &config) { kungfut(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::wiz_main_map); - /* video hardware */ + // video hardware m_gfxdecode->set_info(gfx_wiz); subdevice("screen")->set_screen_update(FUNC(wiz_state::screen_update_wiz)); } -void wiz_state::stinger(machine_config &config) +void stinger_state::stinger(machine_config &config) { kungfut(config); - /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_main_map); - m_maincpu->set_addrmap(AS_OPCODES, &wiz_state::decrypted_opcodes_map); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &stinger_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &stinger_state::decrypted_opcodes_map); - /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &stinger_state::sound_map); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ - subdevice("screen")->set_screen_update(FUNC(wiz_state::screen_update_stinger)); + // video hardware + subdevice("screen")->set_screen_update(FUNC(stinger_state::screen_update)); - /* sound hardware */ + // sound hardware config.device_remove("8910.3"); DISCRETE(config, m_discrete, stinger_discrete).add_route(ALL_OUTPUTS, "mono", 0.5); } -void wiz_state::scion(machine_config &config) +void stinger_state::scion(machine_config &config) { stinger(config); - Z80(config.replace(), m_maincpu, 18432000/6); /* 3.072 MHz ??? */ - m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_main_map); - m_maincpu->set_vblank_int("screen", FUNC(wiz_state::wiz_vblank_interrupt)); + m_maincpu->set_addrmap(AS_OPCODES, address_map_constructor()); - /* video hardware */ + // video hardware subdevice("screen")->set_visarea(2*8, 32*8-1, 2*8, 30*8-1); } @@ -974,12 +1301,12 @@ ROM_START( wiz ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "ic12_04.bin", 0x0000, 0x2000, CRC(8969acdd) SHA1(f37c4697232b4fb4171d6290c9407f740e7d1448) ) ROM_LOAD( "ic13_05.bin", 0x2000, 0x2000, CRC(2868e6a5) SHA1(1b8ac71a6b901df845bab945bfcf11df47932990) ) ROM_LOAD( "ic14_06.bin", 0x4000, 0x2000, CRC(b398e142) SHA1(1cafaf5cbfa96b410ae236a298473ff51122d9fc) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "ic03_07.bin", 0x0000, 0x2000, CRC(297c02fc) SHA1(8eee765a660e3ff1b6cdcdac0d068177098cc339) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "ic02_08.bin", 0x2000, 0x2000, CRC(ede77d37) SHA1(01fe35fc3373b7513ea90e8262d66200629b89fe) ) @@ -988,9 +1315,9 @@ ROM_START( wiz ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END ROM_START( wizt ) @@ -1002,12 +1329,12 @@ ROM_START( wizt ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "wiz4.bin", 0x0000, 0x2000, CRC(e6c636b3) SHA1(0d5b98d404d2d87f375cde5d5a90c7d6318ea197) ) ROM_LOAD( "wiz5.bin", 0x2000, 0x2000, CRC(77986058) SHA1(8002affdd9ac246a0b9c887654d0db8d3a6913b2) ) ROM_LOAD( "wiz6.bin", 0x4000, 0x2000, CRC(f6970b23) SHA1(82d1fe0fee6bf9c6c2f472ed3479c02da85d5f69) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "wiz7.bin", 0x0000, 0x2000, CRC(601f2f3f) SHA1(6c0cc7de5fd94628eaecca409c4faa155f684bdc) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "wiz8.bin", 0x2000, 0x2000, CRC(f5ab982d) SHA1(5e0e72ec702dd5f48814a15f1a92bcdd29c944d8) ) @@ -1016,12 +1343,12 @@ ROM_START( wizt ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END -/* was marked as Wiz Alt Sound */ +// was marked as Wiz Alt Sound ROM_START( wizta ) ROM_REGION( 0xc000, "maincpu", 0 ) ROM_LOAD( "ic7", 0x0000, 0x4000, CRC(b2ec49ad) SHA1(f1624995e9d426dd69d6567a91713aa023e716ad) ) @@ -1031,12 +1358,12 @@ ROM_START( wizta ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "ic12", 0x0000, 0x2000, CRC(e6c636b3) SHA1(0d5b98d404d2d87f375cde5d5a90c7d6318ea197) ) ROM_LOAD( "ic13", 0x2000, 0x2000, CRC(77986058) SHA1(8002affdd9ac246a0b9c887654d0db8d3a6913b2) ) ROM_LOAD( "ic14", 0x4000, 0x2000, CRC(f6970b23) SHA1(82d1fe0fee6bf9c6c2f472ed3479c02da85d5f69) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "ic3", 0x0000, 0x2000, CRC(601f2f3f) SHA1(6c0cc7de5fd94628eaecca409c4faa155f684bdc) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "ic2", 0x2000, 0x2000, CRC(f5ab982d) SHA1(5e0e72ec702dd5f48814a15f1a92bcdd29c944d8) ) @@ -1045,63 +1372,63 @@ ROM_START( wizta ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END ROM_START( stinger ) ROM_REGION( 0xc000, "maincpu", 0 ) - ROM_LOAD( "1-5j.bin", 0x0000, 0x2000, CRC(1a2ca600) SHA1(473e89f2c49f6e6f38df5d6fc2267ffecf84c6c8) ) /* encrypted */ - ROM_LOAD( "2-6j.bin", 0x2000, 0x2000, CRC(957cd39c) SHA1(38bb589b3bfd962415b31d1151adf4bdb661122f) ) /* encrypted */ - ROM_LOAD( "3-8j.bin", 0x4000, 0x2000, CRC(404c932e) SHA1(c23eac49e06ff38564062c0e8c8cdadf877f1d6a) ) /* encrypted */ - ROM_LOAD( "4-9j.bin", 0x6000, 0x2000, CRC(2d570f91) SHA1(31d54d9fd5254c33f07c605bd6112c7eb53c42a1) ) /* encrypted */ - ROM_LOAD( "5-10j.bin", 0x8000, 0x2000, CRC(c841795c) SHA1(e03860813c03ca1c737935accc2b5fe87c6b624a) ) /* encrypted */ + ROM_LOAD( "1-5j.bin", 0x0000, 0x2000, CRC(1a2ca600) SHA1(473e89f2c49f6e6f38df5d6fc2267ffecf84c6c8) ) // encrypted + ROM_LOAD( "2-6j.bin", 0x2000, 0x2000, CRC(957cd39c) SHA1(38bb589b3bfd962415b31d1151adf4bdb661122f) ) // encrypted + ROM_LOAD( "3-8j.bin", 0x4000, 0x2000, CRC(404c932e) SHA1(c23eac49e06ff38564062c0e8c8cdadf877f1d6a) ) // encrypted + ROM_LOAD( "4-9j.bin", 0x6000, 0x2000, CRC(2d570f91) SHA1(31d54d9fd5254c33f07c605bd6112c7eb53c42a1) ) // encrypted + ROM_LOAD( "5-10j.bin", 0x8000, 0x2000, CRC(c841795c) SHA1(e03860813c03ca1c737935accc2b5fe87c6b624a) ) // encrypted ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7-9e.bin", 0x0000, 0x2000, CRC(775489be) SHA1(5fccede323895626cf2eabd606ed21282aa36356) ) ROM_LOAD( "8-11e.bin", 0x2000, 0x2000, CRC(43c61b3f) SHA1(5cdb6a5096b42406c2f2784d37e4e39207c35d40) ) ROM_LOAD( "9-14e.bin", 0x4000, 0x2000, CRC(c9ed8fc7) SHA1(259d7681b663adb1c5fe057e2ef08469ddcbd3c3) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10-9h.bin", 0x0000, 0x2000, CRC(6fc3a22d) SHA1(6875b86d60a06aa329d8ff18d0eb48d158074c5d) ) ROM_LOAD( "11-11h.bin", 0x2000, 0x2000, CRC(3df1f57e) SHA1(e365ee4cc8c055cc39abb4598ad80597d3ae19c7) ) ROM_LOAD( "12-14h.bin", 0x4000, 0x2000, CRC(2fbe1391) SHA1(669edc154164944d82dfccda328774ea4a2318ba) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) /* red component */ - ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) /* green component */ - ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) /* blue component */ + ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) // palette red component + ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) // palette green component + ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) // palette blue component ROM_END ROM_START( stinger2 ) ROM_REGION( 0xc000, "maincpu", 0 ) - ROM_LOAD( "n1.bin", 0x0000, 0x2000, CRC(f2d2790c) SHA1(0e5e92ef45b5bc27b0818f83c89b3bda0e701403) ) /* encrypted */ - ROM_LOAD( "n2.bin", 0x2000, 0x2000, CRC(8fd2d8d8) SHA1(d3318a81fddeb3fa50d01569c1e1145e26ce7277) ) /* encrypted */ - ROM_LOAD( "n3.bin", 0x4000, 0x2000, CRC(f1794d36) SHA1(7954500f489c0bc58cda8e7ffc2e4474759fdc33) ) /* encrypted */ - ROM_LOAD( "n4.bin", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) /* encrypted */ - ROM_LOAD( "n5.bin", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) /* encrypted */ + ROM_LOAD( "n1.bin", 0x0000, 0x2000, CRC(f2d2790c) SHA1(0e5e92ef45b5bc27b0818f83c89b3bda0e701403) ) // encrypted + ROM_LOAD( "n2.bin", 0x2000, 0x2000, CRC(8fd2d8d8) SHA1(d3318a81fddeb3fa50d01569c1e1145e26ce7277) ) // encrypted + ROM_LOAD( "n3.bin", 0x4000, 0x2000, CRC(f1794d36) SHA1(7954500f489c0bc58cda8e7ffc2e4474759fdc33) ) // encrypted + ROM_LOAD( "n4.bin", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) // encrypted + ROM_LOAD( "n5.bin", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) // encrypted ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7-9e.bin", 0x0000, 0x2000, CRC(775489be) SHA1(5fccede323895626cf2eabd606ed21282aa36356) ) ROM_LOAD( "8-11e.bin", 0x2000, 0x2000, CRC(43c61b3f) SHA1(5cdb6a5096b42406c2f2784d37e4e39207c35d40) ) ROM_LOAD( "9-14e.bin", 0x4000, 0x2000, CRC(c9ed8fc7) SHA1(259d7681b663adb1c5fe057e2ef08469ddcbd3c3) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.bin", 0x0000, 0x2000, CRC(f6721930) SHA1(fb903f1deb5f093ff5fe129e213966af58a68339) ) ROM_LOAD( "11.bin", 0x2000, 0x2000, CRC(a4404e63) SHA1(50ae99748547af20e04f6c6c8c7eba85f967b9dc) ) ROM_LOAD( "12.bin", 0x4000, 0x2000, CRC(b60fa88c) SHA1(2d3bca35076625251933989f5e566d5d3290542b) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) /* red component */ - ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) /* green component */ - ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) /* blue component */ + ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) // palette red component + ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) // palette green component + ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) // palette blue component ROM_END ROM_START( finger ) // AFC 02300 Rev.0 + AFC 03300 Rev.0 PCBs. Only the first three main CPU ROMs differ. Basically just a GFX hack of the stinger2 set. @@ -1142,20 +1469,20 @@ ROM_START( scion ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "sc6", 0x0000, 0x2000, CRC(09f5f9c1) SHA1(83e489f32597880fb1a13f0bafedd275facb21f7) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7.10e", 0x0000, 0x2000, CRC(223e0d2a) SHA1(073638172ce0762d103cc07705fc493432e5aa63) ) ROM_LOAD( "8.12e", 0x2000, 0x2000, CRC(d3e39b48) SHA1(c686ef35bf866d044637df295bb70c9c005fc98c) ) ROM_LOAD( "9.15e", 0x4000, 0x2000, CRC(630861b5) SHA1(a6ccfa10e43e92407c452f9744aa1735b257c28e) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.10h", 0x0000, 0x2000, CRC(0d2a0d1e) SHA1(518689f91019e64138ed3560e161d3ef93d0671d) ) ROM_LOAD( "11.12h", 0x2000, 0x2000, CRC(dc6ef8ab) SHA1(ba93392a494a66336197d28e45832b9f8f3e4376) ) ROM_LOAD( "12.15h", 0x4000, 0x2000, CRC(c82c28bf) SHA1(8952b515f01027a94bee0186221a1989ea2cd919) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) /* red component */ - ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) /* green component */ - ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) /* blue component */ + ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) // palette red component + ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) // palette green component + ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) // palette blue component ROM_END ROM_START( scionc ) @@ -1169,24 +1496,24 @@ ROM_START( scionc ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6.9f", 0x0000, 0x2000, CRC(a66a0ce6) SHA1(b2d6a8ded007c362c58496ead33d1561a982440a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7.10e", 0x0000, 0x2000, CRC(223e0d2a) SHA1(073638172ce0762d103cc07705fc493432e5aa63) ) ROM_LOAD( "8.12e", 0x2000, 0x2000, CRC(d3e39b48) SHA1(c686ef35bf866d044637df295bb70c9c005fc98c) ) ROM_LOAD( "9.15e", 0x4000, 0x2000, CRC(630861b5) SHA1(a6ccfa10e43e92407c452f9744aa1735b257c28e) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.10h", 0x0000, 0x2000, CRC(0d2a0d1e) SHA1(518689f91019e64138ed3560e161d3ef93d0671d) ) ROM_LOAD( "11.12h", 0x2000, 0x2000, CRC(dc6ef8ab) SHA1(ba93392a494a66336197d28e45832b9f8f3e4376) ) ROM_LOAD( "12.15h", 0x4000, 0x2000, CRC(c82c28bf) SHA1(8952b515f01027a94bee0186221a1989ea2cd919) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) /* red component */ - ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) /* green component */ - ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) /* blue component */ + ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) // palette red component + ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) // palette green component + ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) // palette blue component ROM_END -void wiz_state::init_stinger() +void stinger_state::init_stinger() { static const uint8_t swap_xor_table[4][4] = { @@ -1203,31 +1530,33 @@ void wiz_state::init_stinger() { if (a & 0x2040) { - /* not encrypted */ + // not encrypted m_decrypted_opcodes[a] = rom[a]; } else { const uint8_t src = rom[a]; - /* pick the translation table from bits 3 and 5 of the address */ + // pick the translation table from bits 3 and 5 of the address int row = ((a >> 3) & 1) + (((a >> 5) & 1) << 1); - /* decode the opcodes */ + // decode the opcodes tbl = swap_xor_table[row]; m_decrypted_opcodes[a] = bitswap<8>(src, tbl[0], 6, tbl[1], 4, tbl[2], 2, 1, 0) ^ tbl[3]; } } } +} // anonymous namespace + -GAME( 1983, stinger, 0, stinger, stinger, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, stinger2, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, finger, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "bootleg", "Finger (bootleg of Stinger)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, scion, 0, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi", "Scion", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, scionc, scion, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi (Cinematronics license)", "Scion (Cinematronics)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, kungfut, 0, kungfut, kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) -GAME( 1984, kungfuta, kungfut, kungfuta,kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) /* board was a bootleg but set might still be original */ -GAME( 1985, wiz, 0, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu", "Wiz", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, wizt, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, wizta, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, stinger, 0, stinger, stinger, stinger_state, init_stinger, ROT90, "Seibu Denshi", "Stinger", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, stinger2, stinger, stinger, stinger2, stinger_state, init_stinger, ROT90, "Seibu Denshi", "Stinger (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, finger, stinger, stinger, stinger2, stinger_state, init_stinger, ROT90, "bootleg", "Finger (bootleg of Stinger)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, scion, 0, scion, scion, stinger_state, empty_init, ROT0, "Seibu Denshi", "Scion", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, scionc, scion, scion, scion, stinger_state, empty_init, ROT0, "Seibu Denshi (Cinematronics license)", "Scion (Cinematronics)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, kungfut, 0, kungfut, kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) +GAME( 1984, kungfuta, kungfut, kungfuta,kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) /* board was a bootleg but set might still be original */ +GAME( 1985, wiz, 0, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu", "Wiz", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, wizt, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, wizta, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/wiz.h b/src/mame/seibu/wiz.h deleted file mode 100644 index 440f2520e8b70..0000000000000 --- a/src/mame/seibu/wiz.h +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - Seibu Stinger/Wiz hardware - -***************************************************************************/ -#ifndef MAME_SEIBU_WIZ_H -#define MAME_SEIBU_WIZ_H - -#pragma once - -#include "sound/discrete.h" -#include "emupal.h" - -class wiz_state : public driver_device -{ -public: - wiz_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_discrete(*this, "discrete"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_videoram(*this, "videoram"), - m_videoram2(*this, "videoram2"), - m_colorram(*this, "colorram"), - m_colorram2(*this, "colorram2"), - m_attrram(*this, "attrram"), - m_attrram2(*this, "attrram2"), - m_spriteram(*this, "spriteram"), - m_spriteram2(*this, "spriteram2"), - m_decrypted_opcodes(*this, "decrypted_opcodes") - { } - - void wiz(machine_config &config); - void kungfut(machine_config &config); - void kungfuta(machine_config &config); - void scion(machine_config &config); - void stinger(machine_config &config); - - void init_stinger(); - -private: - required_device m_maincpu; - required_device m_audiocpu; - optional_device m_discrete; - required_device m_gfxdecode; - required_device m_palette; - - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_attrram; - required_shared_ptr m_attrram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - optional_shared_ptr m_decrypted_opcodes; - - int32_t m_flipx = 0; - int32_t m_flipy = 0; - int32_t m_bgcolor = 0; - uint8_t m_charbank[2]{}; - uint8_t m_palbank[2]{}; - uint8_t m_main_nmi_mask = 0; - uint8_t m_sound_nmi_mask = 0; - uint8_t m_sprite_bank = 0; - - int m_dsc0 = 0; - int m_dsc1 = 0; - - uint8_t wiz_protection_r(); - uint8_t kungfuta_protection_r(); - void wiz_coin_counter_w(offs_t offset, uint8_t data); - void wiz_main_nmi_mask_w(uint8_t data); - void wiz_sound_nmi_mask_w(uint8_t data); - void wiz_palette_bank_w(offs_t offset, uint8_t data); - void wiz_sprite_bank_w(uint8_t data); - void wiz_bgcolor_w(uint8_t data); - void wiz_char_bank_w(offs_t offset, uint8_t data); - void wiz_flipx_w(uint8_t data); - void wiz_flipy_w(uint8_t data); - void stinger_explosion_w(uint8_t data); - void stinger_shot_w(uint8_t data); - - virtual void machine_reset() override; - virtual void machine_start() override; - void wiz_palette(palette_device &palette) const; - uint32_t screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(wiz_vblank_interrupt); - INTERRUPT_GEN_MEMBER(wiz_sound_interrupt); - void draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank); - - void decrypted_opcodes_map(address_map &map); - void kungfut_main_map(address_map &map); - void kungfuta_main_map(address_map &map); - void kungfut_sound_map(address_map &map); - void stinger_main_map(address_map &map); - void stinger_sound_map(address_map &map); - void wiz_main_map(address_map &map); -}; - -#endif // MAME_SEIBU_WIZ_H diff --git a/src/mame/seibu/wiz_v.cpp b/src/mame/seibu/wiz_v.cpp deleted file mode 100644 index 7a2c2322d6711..0000000000000 --- a/src/mame/seibu/wiz_v.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - Seibu Stinger/Wiz hardware - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "wiz.h" - -#include "video/resnet.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Stinger has three 256x4 palette PROMs (one per gun). - The palette PROMs are connected to the RGB output this way: - - bit 3 -- 100 ohm resistor -- RED/GREEN/BLUE - -- 220 ohm resistor -- RED/GREEN/BLUE - -- 470 ohm resistor -- RED/GREEN/BLUE - bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE - -***************************************************************************/ - -void wiz_state::wiz_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - static constexpr int resistances[4] = { 1000, 470, 220, 100 }; - - // compute the color output resistor weights - double rweights[4], gweights[4], bweights[4]; - compute_resistor_weights(0, 255, -1.0, - 4, resistances, rweights, 470, 0, - 4, resistances, gweights, 470, 0, - 4, resistances, bweights, 470, 0); - - // initialize the palette with these colors - for (int i = 0; i < 0x100; i++) - { - int bit0, bit1, bit2, bit3; - - // red component - bit0 = BIT(color_prom[i + 0x000], 0); - bit1 = BIT(color_prom[i + 0x000], 1); - bit2 = BIT(color_prom[i + 0x000], 2); - bit3 = BIT(color_prom[i + 0x000], 3); - int const r = combine_weights(rweights, bit0, bit1, bit2, bit3); - - // green component - bit0 = BIT(color_prom[i + 0x100], 0); - bit1 = BIT(color_prom[i + 0x100], 1); - bit2 = BIT(color_prom[i + 0x100], 2); - bit3 = BIT(color_prom[i + 0x100], 3); - int const g = combine_weights(gweights, bit0, bit1, bit2, bit3); - - // blue component - bit0 = BIT(color_prom[i + 0x200], 0); - bit1 = BIT(color_prom[i + 0x200], 1); - bit2 = BIT(color_prom[i + 0x200], 2); - bit3 = BIT(color_prom[i + 0x200], 3); - int const b = combine_weights(bweights, bit0, bit1, bit2, bit3); - - m_palette->set_pen_color(i, rgb_t(r, g, b)); - } -} - - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -void wiz_state::wiz_palette_bank_w(offs_t offset, uint8_t data) -{ - m_palbank[offset] = data & 1; -} - -void wiz_state::wiz_char_bank_w(offs_t offset, uint8_t data) -{ - m_charbank[offset] = data & 1; -} - -void wiz_state::wiz_sprite_bank_w(uint8_t data) -{ - m_sprite_bank = data & 1; -} - -void wiz_state::wiz_bgcolor_w(uint8_t data) -{ - m_bgcolor = data; -} - -void wiz_state::wiz_flipx_w(uint8_t data) -{ - m_flipx = data & 1; -} - -void wiz_state::wiz_flipy_w(uint8_t data) -{ - m_flipy = data & 1; -} - - - -/*************************************************************************** - - Screen Update - -***************************************************************************/ - -void wiz_state::draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype) -{ - uint8_t *vram = layer ? m_videoram2 : m_videoram; - uint8_t *aram = layer ? m_attrram2 : m_attrram; - uint8_t *cram = layer ? m_colorram2 : m_colorram; - gfx_element *gfx = m_gfxdecode->gfx(charbank); - int palbank = m_palbank[1] << 4 | m_palbank[0] << 3; - - /* draw the tiles. They are characters, but draw them as sprites. */ - for (int offs = 0x400-1; offs >= 0; offs--) - { - int code = vram[offs]; - int sx = offs & 0x1f; - int sy = offs >> 5; - int color = aram[sx << 1 | 1] & 7; - - // wiz/kungfut hw allows more color variety on screen - if (colortype) - color = layer ? (cram[offs] & 7) : ((color & 4) | (code & 3)); - - int scroll = (8*sy + 256 - aram[sx << 1]) & 0xff; - if (m_flipy) - scroll = (248 - scroll) & 0xff; - if (m_flipx) - sx = 31 - sx; - - gfx->transpen(bitmap,cliprect, - code, - palbank | color, - m_flipx,m_flipy, - 8*sx,scroll,0); - } -} - - -void wiz_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank) -{ - uint8_t *sram = set ? m_spriteram2 : m_spriteram; - gfx_element *gfx = m_gfxdecode->gfx(charbank); - int palbank = m_palbank[1] << 4 | m_palbank[0] << 3; - - for (int offs = 0x20-4; offs >= 0; offs -= 4) - { - int code = sram[offs + 1]; - int sx = sram[offs + 3]; - int sy = sram[offs]; - int color = sram[offs + 2] & 7; // high bits unused - - if (!sx || !sy) continue; - - // like on galaxian hw, the first three sprites match against y-1 (not on m_spriteram2) - if (set == 0 && offs <= 8) - sy += (m_flipy) ? 1 : -1; - - if ( m_flipx) sx = 240 - sx; - if (!m_flipy) sy = 240 - sy; - - gfx->transpen(bitmap,cliprect, - code, - palbank | color, - m_flipx,m_flipy, - sx,sy,0); - } -} - - -/**************************************************************************/ - -uint32_t wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 1); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); - draw_sprites(bitmap, cliprect, 1, 4); - draw_sprites(bitmap, cliprect, 0, 5); - return 0; -} - -uint32_t wiz_state::screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + ((m_charbank[0] << 1) | m_charbank[1]), 1); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); - - const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); - const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); - const rectangle &visible_area = m_flipx ? spritevisibleareaflipx : spritevisiblearea; - - draw_sprites(bitmap, visible_area, 1, 6); - draw_sprites(bitmap, visible_area, 0, 7 + m_sprite_bank); - return 0; -} - - -uint32_t wiz_state::screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 0); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 0); - draw_sprites(bitmap, cliprect, 1, 4); - draw_sprites(bitmap, cliprect, 0, 5); - return 0; -} diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index eb6037e2dcde4..3df4e7d447899 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -112,9 +112,9 @@ funcube series: void seta2_state::machine_start() { - if (memregion( "x1snd" ) != nullptr) + if (memregion("x1snd") != nullptr) { - uint32_t const max = memregion( "x1snd" )->bytes() / 0x20000; + uint32_t const max = memregion("x1snd")->bytes() / 0x20000; for (int i = 0; i < 8; i++) { if (m_x1_bank[i] != nullptr) @@ -122,7 +122,7 @@ void seta2_state::machine_start() uint32_t ind = 0; while (ind < 256) { - m_x1_bank[i]->configure_entries(ind, max, memregion( "x1snd" )->base(), 0x20000); // TODO : Mirrored? + m_x1_bank[i]->configure_entries(ind, max, memregion("x1snd")->base(), 0x20000); // TODO : Mirrored? ind += max; } } @@ -160,7 +160,7 @@ void seta2_state::grdians_lockout_w(uint8_t data) // initially 0, then either $25 (coin 1) or $2a (coin 2) machine().bookkeeping().coin_counter_w(0,data & 0x01); // or 0x04 machine().bookkeeping().coin_counter_w(1,data & 0x02); // or 0x08 -// popmessage("%04X", data & 0xff); + //popmessage("%04X", data & 0xff); } void seta2_state::grdians_map(address_map &map) @@ -429,7 +429,7 @@ void seta2_state::reelquak_leds_w(offs_t offset, uint16_t data, uint16_t mem_mas m_dispenser->motor_w(BIT(data, 8)); // ticket dispenser } -// popmessage("LED %04X", data); + //popmessage("LED %04X", data); } void seta2_state::reelquak_coin_w(uint8_t data) @@ -438,9 +438,9 @@ void seta2_state::reelquak_coin_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, data & 0x02); // coin in machine().bookkeeping().coin_counter_w(2, data & 0x04); // pay out machine().bookkeeping().coin_counter_w(3, data & 0x08); // key in - // data & 0x10); // Sound IRQ Ack.? 1->0 - // data & 0x20); // Vblank IRQ.? 1 -// popmessage("COIN %04X", data & 0xff); + // data & 0x10); // Sound IRQ Ack.? 1->0 + // data & 0x20); // Vblank IRQ.? 1 + //popmessage("COIN %04X", data & 0xff); } void seta2_state::reelquak_map(address_map &map) @@ -485,10 +485,11 @@ void seta2_state::samshoot_coin_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, data & 0x10); machine().bookkeeping().coin_counter_w(1, data & 0x20); + // Are these connected? They are set in I/O test machine().bookkeeping().coin_lockout_w(0,~data & 0x40); machine().bookkeeping().coin_lockout_w(1,~data & 0x80); -// popmessage("%04x",data); + //popmessage("%04x",data); } void seta2_state::samshoot_map(address_map &map) @@ -527,35 +528,35 @@ void seta2_state::samshoot_map(address_map &map) void staraudi_state::staraudi_debug_outputs() { -// popmessage("L1: %04X L2: %04X CAM: %04X", m_lamps1, m_lamps2, m_cam); + //popmessage("L1: %04X L2: %04X CAM: %04X", m_lamps1, m_lamps2, m_cam); } void staraudi_state::lamps1_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_lamps1); - m_leds[0] = BIT(data, 0); // Lamp 1 | - m_leds[1] = BIT(data, 1); // Lamp 2 |- Camera Lamps - m_leds[2] = BIT(data, 2); // Lamp 3 | - // data & 0x08 ); // Degauss + m_leds[0] = BIT(data, 0); // Lamp 1 | + m_leds[1] = BIT(data, 1); // Lamp 2 |- Camera Lamps + m_leds[2] = BIT(data, 2); // Lamp 3 | + // data & 0x08 ); // Degauss staraudi_debug_outputs(); } void staraudi_state::lamps2_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_lamps2); - // data & 0x20 ); // ? Always On - m_leds[3] = BIT(data, 6); // 2P Switch Lamp - m_leds[4] = BIT(data, 7); // 1P Switch Lamp + // data & 0x20 ); // ? Always On + m_leds[3] = BIT(data, 6); // 2P Switch Lamp + m_leds[4] = BIT(data, 7); // 1P Switch Lamp staraudi_debug_outputs(); } void staraudi_state::camera_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_cam); - // data & 0x01 ); // ? Always On - // data & 0x02 ); // ? Print Test - // data & 0x08 ); // Camera On (Test Mode) - // data & 0x20 ); // ? + // data & 0x01 ); // ? Always On + // data & 0x02 ); // ? Print Test + // data & 0x08 ); // Camera On (Test Mode) + // data & 0x20 ); // ? staraudi_debug_outputs(); } @@ -621,7 +622,7 @@ void seta2_state::telpacfl_lamp1_w(uint8_t data) for (int i = 0; i <= 7; i++) m_lamps[i] = BIT(data, i); -// popmessage("LAMP1 %04X", data); + //popmessage("LAMP1 %04X", data); } void seta2_state::telpacfl_lamp2_w(uint8_t data) @@ -629,11 +630,11 @@ void seta2_state::telpacfl_lamp2_w(uint8_t data) m_lamps[8] = BIT(data, 0); // on/off lamp (throughout) m_lamps[9] = BIT(data, 1); // bet lamp m_lamps[10] = BIT(data, 2); // payout lamp - m_dispenser->motor_w( data & 0x08 ); // coin out motor - machine().bookkeeping().coin_counter_w(0, data & 0x10); // coin out counter - // data & 0x20 ); // on credit increase + m_dispenser->motor_w(data & 0x08); // coin out motor + machine().bookkeeping().coin_counter_w(0, data & 0x10); // coin out counter + // data & 0x20 ); // on credit increase -// popmessage("LAMP2 %04X", data); + //popmessage("LAMP2 %04X", data); } void seta2_state::telpacfl_lockout_w(uint8_t data) @@ -643,7 +644,7 @@ void seta2_state::telpacfl_lockout_w(uint8_t data) machine().bookkeeping().coin_lockout_w(1, ~data & 0x08); // 100yen blocker // bits 0x30 ? -// popmessage("LOCK %04X", data); + //popmessage("LOCK %04X", data); } void seta2_state::telpacfl_map(address_map &map) @@ -756,7 +757,8 @@ void funcube_touchscreen_device::device_reset() TIMER_CALLBACK_MEMBER(funcube_touchscreen_device::read_buttons) { uint8_t button_state = m_btn->read(); - if(m_button_state != button_state) { + if (m_button_state != button_state) + { m_button_state = button_state; m_serial[0] = button_state ? 0xfe : 0xfd; m_serial[1] = m_x->read(); @@ -769,7 +771,7 @@ TIMER_CALLBACK_MEMBER(funcube_touchscreen_device::read_buttons) void funcube_touchscreen_device::tra_complete() { - if(m_serial_pos != 4) + if (m_serial_pos != 4) transmit_register_setup(m_serial[m_serial_pos++]); } @@ -779,30 +781,8 @@ void funcube_touchscreen_device::tra_callback() } -// Bus conversion functions: - -// RAM shared with the sub CPU -uint32_t funcube_state::nvram_r(offs_t offset) -{ - uint16_t val = m_nvram[offset]; - return ((val & 0xff00) << 8) | (val & 0x00ff); -} - -void funcube_state::nvram_w(offs_t offset, uint32_t data, uint32_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_nvram[offset] = (m_nvram[offset] & 0xff00) | (data & 0x000000ff); - } - if (ACCESSING_BITS_16_23) - { - m_nvram[offset] = (m_nvram[offset] & 0x00ff) | ((data & 0x00ff0000) >> 8); - } -} - // Main CPU - uint32_t funcube_state::debug_r() { uint32_t ret = ioport("DEBUG")->read(); @@ -829,7 +809,7 @@ void funcube_state::funcube_map(address_map &map) map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette map(0x00860000, 0x0086003f).rw(FUNC(funcube_state::vregs_r), FUNC(funcube_state::vregs_w)); - map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)); + map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask32(0x00ff00ff); map(0xf0000000, 0xf00001ff).rw("maincpu_onboard", FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR map(0xffffe000, 0xffffffff).ram(); // SRAM @@ -850,7 +830,7 @@ void funcube_state::funcube2_map(address_map &map) map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); map(0x00860000, 0x0086003f).rw(FUNC(funcube_state::vregs_r), FUNC(funcube_state::vregs_w)); - map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)); + map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask32(0x00ff00ff); map(0xf0000000, 0xf00001ff).rw("maincpu_onboard", FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR map(0xffffe000, 0xffffffff).ram(); // SRAM @@ -861,7 +841,7 @@ void funcube_state::funcube2_map(address_map &map) void funcube_state::funcube_sub_map(address_map &map) { map(0x000000, 0x01ffff).rom(); - map(0x200000, 0x20017f).ram().share("nvram"); + map(0x200000, 0x20017f).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask16(0xffff); } @@ -874,20 +854,20 @@ void funcube_state::funcube_sub_map(address_map &map) uint16_t funcube_state::coins_r() { uint8_t ret = ioport("SWITCH")->read(); - uint8_t coin_bit0 = 1; // active low + uint8_t coin_bit0 = 1; // active low uint8_t coin_bit1 = 1; - uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number()%20)) ? 1 : 0; + uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number() % 20)) ? 1 : 0; const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK.value() / (1000/10); - if ( m_coin_start_cycles ) + if (m_coin_start_cycles) { uint64_t elapsed = m_sub->total_cycles() - m_coin_start_cycles; - if ( elapsed < coin_total_cycles/2 ) + if (elapsed < coin_total_cycles/2) coin_bit0 = 0; - else if ( elapsed < coin_total_cycles ) + else if (elapsed < coin_total_cycles) coin_bit1 = 0; else m_coin_start_cycles = 0; @@ -903,9 +883,7 @@ uint16_t funcube_state::coins_r() void funcube_state::funcube_debug_outputs() { -#ifdef MAME_DEBUG -// popmessage("LED: %02x OUT: %02x", m_funcube_leds, m_outputs); -#endif + //popmessage("LED: %02x OUT: %02x", m_funcube_leds, m_outputs); } void funcube_state::leds_w(uint16_t data) diff --git a/src/mame/seta/seta2.h b/src/mame/seta/seta2.h index b3d5f9850bcb3..9ac8fe56bffa2 100644 --- a/src/mame/seta/seta2.h +++ b/src/mame/seta/seta2.h @@ -35,7 +35,6 @@ class seta2_state : public driver_device m_dispenser(*this, "dispenser"), m_x1_bank(*this, "x1_bank_%u", 1U), - m_nvram(*this, "nvram"), m_spriteram(*this, "spriteram", 0x40000, ENDIANNESS_BIG), m_tileram(*this, "tileram"), m_vregs(*this, "vregs", 0x40, ENDIANNESS_BIG), @@ -127,7 +126,6 @@ class seta2_state : public driver_device optional_device m_dispenser; optional_memory_bank_array<8> m_x1_bank; - optional_shared_ptr m_nvram; memory_share_creator m_spriteram; optional_shared_ptr m_tileram; memory_share_creator m_vregs; @@ -168,6 +166,7 @@ class funcube_state : public seta2_state public: funcube_state(const machine_config &mconfig, device_type type, const char *tag) : seta2_state(mconfig, type, tag) + , m_nvram(*this, "nvram", 0x180, ENDIANNESS_BIG) { } void funcube(machine_config &config); @@ -179,11 +178,14 @@ class funcube_state : public seta2_state void init_funcube2(); private: + memory_share_creator m_nvram; + virtual void machine_start() override; virtual void machine_reset() override; - uint32_t nvram_r(offs_t offset); - void nvram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + uint8_t nvram_r(offs_t offset) { return m_nvram[offset]; } + void nvram_w(offs_t offset, uint8_t data) { m_nvram[offset] = data; } + uint32_t debug_r(); uint16_t coins_r(); void leds_w(uint16_t data); diff --git a/src/mame/seta/seta2_v.cpp b/src/mame/seta/seta2_v.cpp index ba167becb3f6e..7e6ae1e6509d0 100644 --- a/src/mame/seta/seta2_v.cpp +++ b/src/mame/seta/seta2_v.cpp @@ -565,7 +565,7 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr if (nozoom_fixedpalette_fixedposition) { use_shadow = 0; - // which_gfx = 4 << 8; + //which_gfx = 4 << 8; usedscanline = realscanline; // no zooming? usedxzoom = 0x10000; usedxoffset = 0; @@ -854,7 +854,7 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) yy &= 0x07ffffff; yy >>= 16; - // printf("line %04x yline requested %04x\n", y, yy); + //printf("line %04x yline requested %04x\n", y, yy); if (yy & 0x400) yy -= 0x800; @@ -899,7 +899,7 @@ uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, // Black or pen 0? bitmap.fill(m_palette->pen(0), cliprect); - if ( (m_vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN + if ((m_vregs[0x30/2] & 1) == 0) // 1 = BLANK SCREEN draw_sprites(bitmap, cliprect); return 0; diff --git a/src/mame/seta/srmp2.cpp b/src/mame/seta/srmp2.cpp index b9a4c4f204801..98a517e002901 100644 --- a/src/mame/seta/srmp2.cpp +++ b/src/mame/seta/srmp2.cpp @@ -58,17 +58,166 @@ Known issues : ****************************************************************************/ - #include "emu.h" -#include "srmp2.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "sound/ay8910.h" +#include "sound/msm5205.h" +#include "video/x1_001.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class srmp2_state : public driver_device +{ +public: + srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_spritegen(*this, "spritegen"), + m_msm(*this, "msm"), + m_adpcm_rom(*this, "adpcm"), + m_mainbank(*this, "mainbank"), + m_keys(*this, "KEY%u", 0U), + m_service(*this, "SERVICE") + { } + + void mjyuugi(machine_config &config); + void srmp2(machine_config &config); + void rmgoldyh(machine_config &config); + void srmp3(machine_config &config); + +private: + struct iox_t + { + int reset = 0, ff_event,ff_1 = 0, protcheck[4]{}, protlatch[4]{}; + uint8_t data = 0; + uint8_t mux = 0; + uint8_t ff = 0; + }; + + required_device m_maincpu; + required_device m_spritegen; + required_device m_msm; + required_region_ptr m_adpcm_rom; + optional_memory_bank m_mainbank; + required_ioport_array<8> m_keys; + required_ioport m_service; + + uint8_t m_color_bank = 0; + uint8_t m_gfx_bank = 0; + uint8_t m_adpcm_bank = 0; + int16_t m_adpcm_data = 0; + uint32_t m_adpcm_sptr = 0; + uint32_t m_adpcm_eptr = 0; + iox_t m_iox; + + // common + uint8_t vox_status_r(); + uint8_t iox_mux_r(); + uint8_t iox_status_r(); + void iox_command_w(uint8_t data); + void iox_data_w(uint8_t data); + void adpcm_int(int state); + + // mjuugi + void mjyuugi_flags_w(uint16_t data); + void mjyuugi_adpcm_bank_w(uint16_t data); + uint8_t mjyuugi_irq2_ack_r(address_space &space); + uint8_t mjyuugi_irq4_ack_r(address_space &space); + + // rmgoldyh + void rmgoldyh_rombank_w(uint8_t data); + + // srmp2 + void srmp2_irq2_ack_w(uint8_t data); + void srmp2_irq4_ack_w(uint8_t data); + void srmp2_flags_w(uint16_t data); + void adpcm_code_w(uint8_t data); + + // srmp3 + void srmp3_rombank_w(uint8_t data); + void srmp3_flags_w(uint8_t data); + void srmp3_irq_ack_w(uint8_t data); + + virtual void machine_start() override; + DECLARE_MACHINE_START(srmp2); + void srmp2_palette(palette_device &palette) const; + DECLARE_MACHINE_START(srmp3); + void srmp3_palette(palette_device &palette) const; + DECLARE_MACHINE_START(rmgoldyh); + DECLARE_MACHINE_START(mjyuugi); + + uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); + + uint8_t iox_key_matrix_calc(uint8_t p_side); + + void mjyuugi_map(address_map &map); + void rmgoldyh_io_map(address_map &map); + void rmgoldyh_map(address_map &map); + void srmp2_map(address_map &map); + void srmp3_io_map(address_map &map); + void srmp3_map(address_map &map); +}; + + +/*************************************************************************** + + Video hardware + +***************************************************************************/ + +void srmp2_state::srmp2_palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < palette.entries(); i++) + { + int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; + palette.set_pen_color(i ^ 0x0f, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); + } +} + + +void srmp2_state::srmp3_palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < palette.entries(); i++) + { + int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; + palette.set_pen_color(i,pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); + } +} + +X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) +{ + return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0); +} + + +uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0x1ff, cliprect); + + m_spritegen->set_colorbase(m_color_bank<<5); + + m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); + return 0; +} + +uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0x1f0, cliprect); + + m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); + return 0; +} + /*************************************************************************** @@ -1586,6 +1735,7 @@ ROM_START( ponchina ) ROM_LOAD( "um2_1_10.u63", 0x080000, 0x080000, CRC(53e643e9) SHA1(3b221217e8f846ae96a9a47149037cea19d97549) ) ROM_END +} // anonymous namespace GAME( 1987, srmp1, 0, srmp2, srmp2, srmp2_state, empty_init, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seta/srmp2.h b/src/mame/seta/srmp2.h deleted file mode 100644 index 0a551b916a58e..0000000000000 --- a/src/mame/seta/srmp2.h +++ /dev/null @@ -1,106 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo, Takahiro Nogi -#ifndef MAME_SETA_SRMP2_H -#define MAME_SETA_SRMP2_H - -#pragma once - -#include "sound/msm5205.h" -#include "video/x1_001.h" -#include "emupal.h" - -class srmp2_state : public driver_device -{ -public: - srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_spritegen(*this, "spritegen"), - m_msm(*this, "msm"), - m_adpcm_rom(*this, "adpcm"), - m_mainbank(*this, "mainbank"), - m_keys(*this, "KEY%u", 0U), - m_service(*this, "SERVICE") - { } - - void mjyuugi(machine_config &config); - void srmp2(machine_config &config); - void rmgoldyh(machine_config &config); - void srmp3(machine_config &config); - -private: - struct iox_t - { - int reset = 0, ff_event,ff_1 = 0, protcheck[4]{}, protlatch[4]{}; - uint8_t data = 0; - uint8_t mux = 0; - uint8_t ff = 0; - }; - - required_device m_maincpu; - required_device m_spritegen; - required_device m_msm; - required_region_ptr m_adpcm_rom; - optional_memory_bank m_mainbank; - required_ioport_array<8> m_keys; - required_ioport m_service; - - uint8_t m_color_bank = 0; - uint8_t m_gfx_bank = 0; - uint8_t m_adpcm_bank = 0; - int16_t m_adpcm_data = 0; - uint32_t m_adpcm_sptr = 0; - uint32_t m_adpcm_eptr = 0; - iox_t m_iox; - - // common - uint8_t vox_status_r(); - uint8_t iox_mux_r(); - uint8_t iox_status_r(); - void iox_command_w(uint8_t data); - void iox_data_w(uint8_t data); - void adpcm_int(int state); - - // mjuugi - void mjyuugi_flags_w(uint16_t data); - void mjyuugi_adpcm_bank_w(uint16_t data); - uint8_t mjyuugi_irq2_ack_r(address_space &space); - uint8_t mjyuugi_irq4_ack_r(address_space &space); - - // rmgoldyh - void rmgoldyh_rombank_w(uint8_t data); - - // srmp2 - void srmp2_irq2_ack_w(uint8_t data); - void srmp2_irq4_ack_w(uint8_t data); - void srmp2_flags_w(uint16_t data); - void adpcm_code_w(uint8_t data); - - // srmp3 - void srmp3_rombank_w(uint8_t data); - void srmp3_flags_w(uint8_t data); - void srmp3_irq_ack_w(uint8_t data); - - virtual void machine_start() override; - DECLARE_MACHINE_START(srmp2); - void srmp2_palette(palette_device &palette) const; - DECLARE_MACHINE_START(srmp3); - void srmp3_palette(palette_device &palette) const; - DECLARE_MACHINE_START(rmgoldyh); - DECLARE_MACHINE_START(mjyuugi); - - uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); - - uint8_t iox_key_matrix_calc(uint8_t p_side); - - void mjyuugi_map(address_map &map); - void rmgoldyh_io_map(address_map &map); - void rmgoldyh_map(address_map &map); - void srmp2_map(address_map &map); - void srmp3_io_map(address_map &map); - void srmp3_map(address_map &map); -}; - -#endif // MAME_SETA_SRMP2_H diff --git a/src/mame/seta/srmp2_v.cpp b/src/mame/seta/srmp2_v.cpp deleted file mode 100644 index 6f9046654f299..0000000000000 --- a/src/mame/seta/srmp2_v.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo, Takahiro Nogi -/*************************************************************************** - -Functions to emulate the video hardware of the machine. - -***************************************************************************/ - - -#include "emu.h" -#include "srmp2.h" - -void srmp2_state::srmp2_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - for (int i = 0; i < palette.entries(); i++) - { - int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; - palette.set_pen_color(i ^ 0x0f, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); - } -} - - -void srmp2_state::srmp3_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - for (int i = 0; i < palette.entries(); i++) - { - int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; - palette.set_pen_color(i,pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); - } -} - -X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) -{ - return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0); -} - - -uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0x1ff, cliprect); - - m_spritegen->set_colorbase(m_color_bank<<5); - - m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); - return 0; -} - -uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0x1f0, cliprect); - - m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); - return 0; -} diff --git a/src/mame/skeleton/hudson_poems.cpp b/src/mame/skeleton/hudson_poems.cpp index aa435441fa393..31f28927b6557 100644 --- a/src/mame/skeleton/hudson_poems.cpp +++ b/src/mame/skeleton/hudson_poems.cpp @@ -71,8 +71,8 @@ class hudson_poems_state : public driver_device private: u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_tile(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal); - void draw_tile8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal); + void draw_tile(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal, bool use_flips); + void draw_tile8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal, bool use_flips); void draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_tilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int which, int priority); @@ -228,6 +228,11 @@ static INPUT_PORTS_START( poemzet ) PORT_START( "IN1" ) INPUT_PORTS_END +static INPUT_PORTS_START( poemspoo ) + PORT_START( "IN1" ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + void hudson_poems_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int spritebase = (m_spritelistbase & 0x0003ffff) / 4; @@ -314,6 +319,8 @@ void hudson_poems_state::draw_tilemap(screen_device &screen, bitmap_rgb32 &bitma { int width, base, bpp, gfxbase, extrapal; + bool use_flips; + // guess, could be more/less bits, or somewhere else entirely, works for the 2 scenes that need it const int thispriority = (m_tilemapcfg[which] & 0x01f00000) >> 20; @@ -336,6 +343,14 @@ void hudson_poems_state::draw_tilemap(screen_device &screen, bitmap_rgb32 &bitma else bpp = 4; + // this might not be the correct enable flag + // marimba needs 2 of the tile bits to act as flip, while poemspoo, poembase, poemgolf use them as tile number bits + if (m_tilemapcfg[which] & 0x10000000) + use_flips = false; + else + use_flips = true; + + if (m_tilemapcfg[which] & 0x00080000) extrapal = 1; else @@ -388,13 +403,13 @@ void hudson_poems_state::draw_tilemap(screen_device &screen, bitmap_rgb32 &bitma if (bpp == 4) { - draw_tile(screen, bitmap, cliprect, (tiles & 0xffff), xpos, ypos, gfxbase, extrapal); - draw_tile(screen, bitmap, cliprect, ((tiles >> 16) & 0xffff), xpos + 8, ypos, gfxbase, extrapal); + draw_tile(screen, bitmap, cliprect, (tiles & 0xffff), xpos, ypos, gfxbase, extrapal, use_flips); + draw_tile(screen, bitmap, cliprect, ((tiles >> 16) & 0xffff), xpos + 8, ypos, gfxbase, extrapal, use_flips); } else if (bpp == 8) { - draw_tile8(screen, bitmap, cliprect, (tiles & 0xffff), xpos, ypos, gfxbase, extrapal); - draw_tile8(screen, bitmap, cliprect, ((tiles >> 16) & 0xffff), xpos + 8, ypos, gfxbase, extrapal); + draw_tile8(screen, bitmap, cliprect, (tiles & 0xffff), xpos, ypos, gfxbase, extrapal, use_flips); + draw_tile8(screen, bitmap, cliprect, ((tiles >> 16) & 0xffff), xpos + 8, ypos, gfxbase, extrapal, use_flips); } } } @@ -426,26 +441,48 @@ template u32 hudson_poems_state::tilemap_cfg_r(offs_t offset, u32 mem template u32 hudson_poems_state::tilemap_scr_r(offs_t offset, u32 mem_mask) { return m_tilemapscr[Layer]; } -void hudson_poems_state::draw_tile(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal) +void hudson_poems_state::draw_tile(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal, bool use_flips) { gfx_element *gfx = m_gfxdecode->gfx(2); - const int flipx = tile & 0x0800; - const int flipy = tile & 0x0400; + int flipx = 0; + int flipy = 0; int pal = (tile & 0xf000)>>12; + + if (use_flips) + { + flipx = tile & 0x0800; + flipy = tile & 0x0400; + tile &= 0x3ff; + } + else + { + tile &= 0xfff; + } + pal += extrapal * 0x10; - tile &= 0x3ff; tile += gfxbase / 32; gfx->transpen(bitmap,cliprect,tile,pal,flipx,flipy,xx,yy, 0); } -void hudson_poems_state::draw_tile8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal) +void hudson_poems_state::draw_tile8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 tile, int xx, int yy, int gfxbase, int extrapal, bool use_flips) { gfx_element *gfx = m_gfxdecode->gfx(3); - const int flipx = tile & 0x0800; - const int flipy = tile & 0x0400; + int flipx = 0; + int flipy = 0; int pal = 0;//(tile & 0xf000)>>8; + + if (use_flips) + { + flipx = tile & 0x0800; + flipy = tile & 0x0400; + tile &= 0x3ff; + } + else + { + tile &= 0xfff; + } + pal += extrapal; - tile &= 0x3ff; tile += gfxbase / 64; gfx->transpen(bitmap,cliprect,tile,pal,flipx,flipy,xx,yy, 0); } @@ -893,6 +930,14 @@ ROM_START( poemzet2 ) ROM_LOAD( "at24c08a.u3", 0x000000, 0x400, CRC(5f3d5352) SHA1(94386f5703751e66d6a62e23c344ab7711aad769) ) ROM_END +ROM_START(poemspoo) + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD( "poems_spoo.u2", 0x000000, 0x400000, CRC(1ebc473a) SHA1(6ebc33f274f71183bcd4a93d06e565eff71e2f47) ) // glob with TSOP pads + + // seeprom position not populated +ROM_END + + } // anonymous namespace @@ -906,3 +951,5 @@ CONS( 2004, poembase, 0, 0, hudson_poems, poemgolf, hudson_po CONS( 2004, poemzet, 0, 0, hudson_poems, poemzet, hudson_poems_state, init_marimba, "Konami", "Zettai Zetsumei Dangerous Jiisan - Mini Game de Taiketsu ja!", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND ) CONS( 2005, poemzet2, 0, 0, hudson_poems, poemzet, hudson_poems_state, init_marimba, "Konami", "Zettai Zetsumei Dangerous Jiisan Party ja! Zen-in Shuugou!!", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND ) + +CONS( 2005, poemspoo, 0, 0, hudson_poems, poemspoo, hudson_poems_state, init_marimba, "Konami", "Goo Choco Lantan Spoo Daisuki! Playmat", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) diff --git a/src/mame/snk/hng64.cpp b/src/mame/snk/hng64.cpp index 678e047187086..ef01605613e7b 100644 --- a/src/mame/snk/hng64.cpp +++ b/src/mame/snk/hng64.cpp @@ -462,7 +462,7 @@ for the exact number of ROMs used per game and ROM placements. Games that use the LVS-DG1 cart: Road's Edge / Round Trip RV Xtreme Rally / Off Beat Racer! Beast Busters: Second Nightmare - Samurai Shodown 64 / Samurai Spirits / Pae Wang Jeon Seol 64 + Samurai Shodown 64 / Samurai Spirits / Paewang Jeonseol 64 Games that use the LVS-DG2 cart: Fatal Fury: Wild Ambition / Garou Densetsu: Wild Ambition Buriki One: World Grapple Tournament '99 in Tokyo diff --git a/src/mame/taito/haplucky.cpp b/src/mame/taito/haplucky.cpp new file mode 100644 index 0000000000000..9097059e0f7f9 --- /dev/null +++ b/src/mame/taito/haplucky.cpp @@ -0,0 +1,186 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Happy Lucky! (c) 1985 Taito + Video lottery machine (as the titles screen says) + + J1100059A K1100139A CPU BOARD + JII00060A K1100140A VIDEO BOARD + + Main components (CPU BOARD): + + 2 x Z8400APS + 1 x DQ52B13H-250 (2 KB parallel EEPROM, blank on this PCB) + 1 x PC010SA + 1 x M5L8255AP-5 + 1 x YM2149F + 1 x 8 MHz XTAL + 1 x 8-DIP switch bank + + Main components (VIDEO BOARD): + 1 x 24 MHz XTAL + lots of TTLs and RAMs + + Possibly missing a ROM board. +*/ + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "sound/ay8910.h" +#include "sound/dac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + + +namespace { + +class haplucky_state : public driver_device +{ +public: + haplucky_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void haplucky(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_maincpu; + + uint8_t m_sound_data = 0; + uint8_t m_sound_status = 0x0f; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map); + void sound_map(address_map &map); + void sound_io_map(address_map &map); +}; + + +uint32_t haplucky_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + + +void haplucky_state::machine_start() +{ + save_item(NAME(m_sound_data)); + save_item(NAME(m_sound_status)); +} + +void haplucky_state::main_map(address_map &map) // TODO: verify everything +{ + map(0x0000, 0x7fff).rom().region("maincpu", 0); // TODO: There's only a 0x4000 ROM, but calls past it. Missing ROM board? + map(0xe000, 0xe7ff).ram(); + map(0xf800, 0xffff).ram(); +} + +void haplucky_state::sound_map(address_map &map) // TODO: verify everything, but program is almost identical to the Super Dead Heat sub CPU one +{ + map(0x0000, 0xdfff).rom().region("audiocpu", 0); + map(0x8000, 0x8000).w("dac", FUNC(dac_byte_interface::write)); + map(0xf800, 0xffff).ram(); +} + +void haplucky_state::sound_io_map(address_map &map) // TODO: verify everything, but program is almost identical to the Super Dead Heat sub CPU one +{ + map.global_mask(0xff); + map(0xff, 0xff).lr8(NAME([this] () -> uint8_t { return m_sound_data; })).lw8(NAME([this] (uint8_t data) { m_sound_status = 0; })); +} + +static INPUT_PORTS_START( haplucky ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + 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_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") +INPUT_PORTS_END + + +void haplucky_state::haplucky(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, 8_MHz_XTAL / 2); // divider not verified + m_maincpu->set_addrmap(AS_PROGRAM, &haplucky_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(haplucky_state::irq0_line_hold)); + + z80_device &audiocpu(Z80(config, "audiocpu", 8_MHz_XTAL / 2)); // divider not verified + audiocpu.set_addrmap(AS_PROGRAM, &haplucky_state::sound_map); + audiocpu.set_addrmap(AS_IO, &haplucky_state::sound_io_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: everything to be verified + screen.set_refresh_hz(60); + 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); + screen.set_screen_update(FUNC(haplucky_state::screen_update)); + screen.set_palette("palette"); + + PALETTE(config, "palette").set_entries(0x800); // TODO: entries to be verified + + // sound hardware + SPEAKER(config, "mono").front_center(); + + ym2149_device &ymsnd(YM2149(config, "ymsnd", 8_MHz_XTAL / 8)); // divider not verified + ymsnd.port_a_read_callback().set([this] () { logerror("%s: PA read\n", machine().describe_context()); return u8(0xff); }); + ymsnd.port_a_write_callback().set([this] (u8 data) { logerror("%s: PA write %02X\n", machine().describe_context(), data); }); + ymsnd.port_b_read_callback().set([this] () { logerror("%s: PB read\n", machine().describe_context()); return u8(0xff); }); + ymsnd.port_b_write_callback().set([this] (u8 data) { logerror("%s: PB write %02X\n", machine().describe_context(), data); }); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.5); // divider not verified + + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.5); // DAC type not verified +} + + +ROM_START( haplucky ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "a58-01-1.ic24", 0x0000, 0x4000, CRC(6bddc224) SHA1(fb3783b4b97c1f9b454e5b8301897d8cfcc0b7b7) ) // MBM27128-25 on CPU board + ROM_FILL( 0x400f, 0x01, 0xc9 ) // code jumps here early, return for now + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "a58-02.ic5", 0x0000, 0x8000, CRC(cfffcffb) SHA1(4808930f6b8cc105d39ffef1525defbc25bd43f4) ) // MBM27256-25 on CPU board + ROM_LOAD( "a58-03.ic6", 0x8000, 0x8000, CRC(470887e4) SHA1(69d9f907816c8c1b39b7c432b4196d04fcd7e365) ) // MBM27256-25 on CPU board + + ROM_REGION( 0x400, "plds", 0 ) + ROM_LOAD( "a40-09.ic26", 0x000, 0x104, CRC(733d1242) SHA1(3f99940f0c49023cbbd308eacfb5b102a52a68d2) ) // PAL16L8ACN, on video board + ROM_LOAD( "a58-04.ic13", 0x200, 0x104, CRC(cbbe4e50) SHA1(a7b8e23f7d34b0f4b462cffc47a0c0a3d5611d31) ) // PAL16L8ACN, on CPU board +ROM_END + +} // anonymous namespace + + +GAME( 1985, haplucky, 0, haplucky, haplucky, haplucky_state, empty_init, ROT0, "Taito Corporation", "Happy Lucky!", MACHINE_IS_SKELETON ) diff --git a/src/mame/taito/rbisland.cpp b/src/mame/taito/rbisland.cpp index bb5a8dd6d253d..f97b57765c0e2 100644 --- a/src/mame/taito/rbisland.cpp +++ b/src/mame/taito/rbisland.cpp @@ -499,7 +499,7 @@ uint32_t jumping_state::screen_update(screen_device &screen, bitmap_ind16 &bitma for (int offs = m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8) { int const tile = m_spriteram[offs]; - if (tile < m_gfxdecode->gfx(1)->elements()) + if (tile < m_gfxdecode->gfx(0)->elements()) { int sy = ((m_spriteram[offs + 1] - 0xfff1) ^ 0xffff) & 0x1ff; if (sy > 400) sy = sy - 512; diff --git a/src/mame/ti/snspellc.cpp b/src/mame/ti/snspellc.cpp index 371b68a1203a4..93d9636a5544e 100644 --- a/src/mame/ti/snspellc.cpp +++ b/src/mame/ti/snspellc.cpp @@ -601,56 +601,56 @@ static INPUT_PORTS_START( tntell ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("Grid 1-3") PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Grid 2-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Grid 2-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Grid 2-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Grid 2-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("Grid 2-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("Grid 2-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Grid 2-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Grid 2-3") PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Grid 3-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Grid 3-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Grid 3-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Grid 3-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Grid 3-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Grid 3-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Grid 3-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Grid 3-3") PORT_START("IN.3") // R3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Grid 4-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Grid 4-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Grid 4-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Grid 4-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Grid 4-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Grid 4-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Grid 4-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Grid 4-3") PORT_START("IN.4") // R4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("Grid 5-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("Grid 5-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Grid 5-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Grid 5-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Grid 5-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Grid 5-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Grid 5-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Grid 5-3") PORT_START("IN.5") // R5 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Grid 5-6") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Grid 6-5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Grid 5-5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Grid 5-6") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Grid 6-5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Grid 5-5") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) // overlay code PORT_START("IN.6") // R6 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Grid 3-5") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Grid 2-5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Grid 4-5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Grid 3-5") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Grid 2-5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Grid 4-5") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("Grid 1-5") PORT_START("IN.7") // R7 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Grid 3-6") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Grid 2-6") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Grid 4-6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Grid 3-6") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Grid 2-6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Grid 4-6") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("Grid 1-6") PORT_START("IN.8") // R8 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_CODE(KEYCODE_F2) PORT_NAME("Grid 6-1 (Off)") // -> auto_power_off - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_K) PORT_NAME("Grid 6-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Grid 6-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("Grid 6-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_F2) PORT_NAME("Grid 6-1 (Off)") // -> auto_power_off + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Grid 6-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Grid 6-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Grid 6-3") PORT_START("IN.9") // Vss PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_F1) PORT_NAME("Grid 6-6 (On)") PORT_CHANGED_MEMBER(DEVICE_SELF, tntell_state, power_on, 0) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_F1) PORT_NAME("Grid 6-6 (On)") PORT_CHANGED_MEMBER(DEVICE_SELF, tntell_state, power_on, 0) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) // speech chip data PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END diff --git a/src/mame/toaplan/toaplan2.cpp b/src/mame/toaplan/toaplan2.cpp index b81a6d374f489..37481ca647d4e 100644 --- a/src/mame/toaplan/toaplan2.cpp +++ b/src/mame/toaplan/toaplan2.cpp @@ -6469,20 +6469,20 @@ GAME( 1991, pipibibsbl3, pipibibs, pipibibsbl, pipibibsbl, toaplan2_state, emp GAME( 1993, enmadaio, 0, enmadaio, enmadaio, toaplan2_state, init_enmadaio, ROT0, "Toaplan / Taito", "Enma Daio (Japan)", 0 ) // TP-031 // region is in eeprom (and also requires correct return value from a v25 mapped address??) -GAME( 1992, fixeight, 0, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Europe)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightk, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Korea)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighth, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Hong Kong)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighttw, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Taiwan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighta, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Southeast Asia)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightu, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (USA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightj, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight - Jigoku no Eiyuu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Europe, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightkt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Korea, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightht, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Hong Kong, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighttwt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Taiwan, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightat, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Southeast Asia, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightut, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (USA, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightjt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight - Jigoku no Eiyuu Densetsu (Japan, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeight, 0, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Europe)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightk, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Korea)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighth, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Hong Kong)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighttw, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Taiwan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighta, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Southeast Asia)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightu, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (USA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightj, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight - Jigoku no Eiyuu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Europe, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightkt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Korea, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightht, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Hong Kong, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighttwt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Taiwan, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightat, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Southeast Asia, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightut, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (USA, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightjt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight - Jigoku no Eiyuu Densetsu (Japan, Taito license)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, fixeightbl, fixeight, fixeightbl, fixeightbl, truxton2_state, init_fixeightbl, ROT270, "bootleg", "FixEight (Korea, bootleg)", MACHINE_SUPPORTS_SAVE ) @@ -6508,7 +6508,7 @@ GAME( 1994, snowbro2b2, snowbro2, snowbro2, snowbro2, toaplan2_state, empty GAME( 1994, snowbro2b3, snowbro2, snowbro2b3, snowbro2b3, toaplan2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // GFX offsets not 100% correct GAME( 1993, sstriker, 0, mahoudai, sstriker, truxton2_state, empty_init, ROT270, "Raizing", "Sorcer Striker", MACHINE_SUPPORTS_SAVE ) // verified on two different PCBs -GAME( 1993, sstrikerk, sstriker, mahoudai, sstrikerk, truxton2_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 +GAME( 1993, sstrikerk, sstriker, mahoudai, sstrikerk, truxton2_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 GAME( 1993, mahoudai, sstriker, mahoudai, mahoudai, truxton2_state, empty_init, ROT270, "Raizing (Able license)", "Mahou Daisakusen (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, kingdmgp, 0, shippumd, kingdmgp, truxton2_state, empty_init, ROT270, "Raizing / Eighting", "Kingdom Grandprix", MACHINE_SUPPORTS_SAVE ) // from Korean board, missing letters on credits screen but this is correct @@ -6519,8 +6519,8 @@ GAME( 1996, bgareggat, bgaregga, bgaregga, bgaregga, truxton2_state, init_ GAME( 1996, bgareggahk, bgaregga, bgaregga, bgareggahk, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Austria / Hong Kong) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, bgareggatw, bgaregga, bgaregga, bgareggatw, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Taiwan / Germany) (Thu Feb 1 1996)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, bgareggak, bgaregga, bgaregga, bgareggak, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Korea / Greece) (Wed Feb 7 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - New Version (Austria / Hong Kong) (Sat Mar 2 1996)" , MACHINE_SUPPORTS_SAVE ) // displays New Version only when set to HK -GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)" , MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe +GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - New Version (Austria / Hong Kong) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays New Version only when set to HK +GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe GAME( 1996, bgareggacn, bgaregga, bgaregga, bgareggacn, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Denmark GAME( 1998, bgareggabl, bgaregga, bgareggabl, bgareggabl, truxton2_state, init_bgaregga, ROT270, "bootleg (Melody)", "1945 Er Dai / 1945 Part-2 (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to China GAME( 1997, bgareggabla, bgaregga, bgareggabl, bgareggabl, truxton2_state, init_bgaregga, ROT270, "bootleg (Melody)", "Leishen Chuan / Thunder Deity Biography (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to Asia diff --git a/src/mame/trs/gime.cpp b/src/mame/trs/gime.cpp index 22ff4b3e6d322..8abaef7878e60 100644 --- a/src/mame/trs/gime.cpp +++ b/src/mame/trs/gime.cpp @@ -587,14 +587,11 @@ void gime_device::update_memory(int bank) is_read_only = false; } - // compensate for offset - memory += offset; - // set the banks if (memory) { - read_bank->set_base(memory); - write_bank->set_base(is_read_only ? m_dummy_bank : memory); + read_bank->set_base(memory + offset); + write_bank->set_base(is_read_only ? m_dummy_bank : memory + offset); } else { diff --git a/src/mame/tvgames/spg2xx.cpp b/src/mame/tvgames/spg2xx.cpp index b2ca87205b9ba..aa6471cdfec15 100644 --- a/src/mame/tvgames/spg2xx.cpp +++ b/src/mame/tvgames/spg2xx.cpp @@ -325,6 +325,14 @@ void spg2xx_game_wfcentro_state::mem_map_wfcentro(address_map &map) } +void spg2xx_game_lexiart_state::mem_map_lexiart(address_map &map) +{ + map(0x000000, 0x3fffff).bankr("cartbank"); + map(0x3f0000, 0x3f7fff).ram(); // 2 * 32Kb RAMs on PCB +} + + + static INPUT_PORTS_START( spg2xx ) // base structure for easy debugging / figuring out of inputs PORT_START("P1") PORT_DIPNAME( 0x0001, 0x0001, "P1:0001" ) @@ -477,6 +485,15 @@ static INPUT_PORTS_START( spg2xx ) // base structure for easy debugging / figuri PORT_DIPSETTING( 0x8000, "8000" ) INPUT_PORTS_END +static INPUT_PORTS_START( lexiart ) + PORT_INCLUDE( spg2xx ) + + PORT_MODIFY("P1") + PORT_DIPNAME( 0x0100, 0x0000, "Battery State" ) + PORT_DIPSETTING( 0x0000, "Ok" ) + PORT_DIPSETTING( 0x0100, "Low" ) +INPUT_PORTS_END + static INPUT_PORTS_START( itvphone ) // hold 8 and ENTER for Diagnostics mode PORT_START("P1") // note, the physical inputs are in 'phone' order, so 1 is top left, not bottom left like a PC Keypad PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Phone Pad 1") PORT_CODE(KEYCODE_1_PAD) @@ -1745,6 +1762,17 @@ void spg2xx_game_wfcentro_state::wfcentro(machine_config &config) m_maincpu->portc_in().set(FUNC(spg2xx_game_wfcentro_state::base_portc_r)); } +void spg2xx_game_lexiart_state::lexiart(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_lexiart_state::mem_map_lexiart); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(spg2xx_game_lexiart_state::base_porta_r)); + m_maincpu->portb_in().set(FUNC(spg2xx_game_lexiart_state::base_portb_r)); + m_maincpu->portc_in().set(FUNC(spg2xx_game_lexiart_state::base_portc_r)); +} void spg2xx_game_senwfit_state::portc_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -2120,6 +2148,11 @@ ROM_START( doraglob ) ROM_LOAD16_WORD_SWAP( "doraglobe.bin", 0x000000, 0x800000, CRC(6f454c50) SHA1(201e2de3d90abe017a8dc141613cbf6383423d13) ) ROM_END +ROM_START( doraglobf ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "doraglobefrance.bin", 0x000000, 0x800000, CRC(7124edc1) SHA1(b144fc1f13a28299ef14f1d01f7acd2677e4ebb9) ) +ROM_END + ROM_START( doraglobg ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "doraglobegerman.bin", 0x000000, 0x800000, CRC(538aa197) SHA1(e97e0641df04074a0e45d02cecb43fbec91a4ce6) ) @@ -2140,6 +2173,11 @@ ROM_START( wfcentro ) ROM_LOAD16_WORD_SWAP( "winfuncentro.bin", 0x000000, 0x800000, CRC(fd6ad052) SHA1(78af844729bf4843dc70531349e38a8c25caf748) ) ROM_END +ROM_START( lexiart ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "lexibookartstudio.u3", 0x000000, 0x800000, CRC(fc417abb) SHA1(c0a18a2cf11c47086722f0ec88410614fed7c6f7) ) +ROM_END + ROM_START( tiktokmm ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "webcamthingy.bin", 0x000000, 0x800000, CRC(54c0d4a9) SHA1(709ee607ca447baa6f7e686268df1998372fe617) ) @@ -2278,8 +2316,9 @@ CONS( 2006, doraphon, 0, 0, doraphone, doraphone, spg2xx_game_doraphone CONS( 2006, doraphonf, doraphon, 0, doraphonep,doraphonep,spg2xx_game_doraphone_state,empty_init, "VTech", "Dora the Explorer - Dora TV Explorer Phone / L'anniversaire de Babouche (France)", MACHINE_IMPERFECT_SOUND ) // This was from a 'cost reduced' unit with the 'non-TV' mode switch and internal speaker removed, however it looks like the code was not disabled or removed as the mode is fully functional. // The ZC-Infinity video for this on YouTube shows the map scrolling to center the continent, there doesn't appear to be an input for this, different revision? -// Dutch and French localized versions also exists, which again must be different code +// a Dutch localized version also exists, which again must be different code CONS( 2007, doraglob, 0, 0, doraphone, doraglobe, spg2xx_game_doraphone_state,empty_init, "VTech", "Dora the Explorer - Dora TV Adventure Globe", MACHINE_IMPERFECT_SOUND ) +CONS( 2007, doraglobf, doraglob, 0, doraphone, doraglobe, spg2xx_game_doraphone_state,empty_init, "VTech", "Dora the Explorer - Dora TV Globe-Trotter (France)", MACHINE_IMPERFECT_SOUND ) CONS( 2007, doraglobg, doraglob, 0, doraphone, doraglobe, spg2xx_game_doraphone_state,empty_init, "VTech", "Dora the Explorer - Doras Abenteuer-Globus (Germany)", MACHINE_IMPERFECT_SOUND ) @@ -2317,5 +2356,7 @@ CONS( 2007, jeuint, ordentv, 0, ordentv, ordentv, spg2xx_game_ordentv_s CONS( 200?, wfcentro, 0, 0, wfcentro, spg2xx, spg2xx_game_wfcentro_state, empty_init, "WinFun", "Centro TV de Diseno Artistico (Spain)", MACHINE_NOT_WORKING ) +CONS( 200?, lexiart, 0, 0, lexiart, lexiart, spg2xx_game_lexiart_state, empty_init, "Lexibook", "Lexibook Junior My 1st Drawing Studio", MACHINE_NOT_WORKING ) + // set 2862 to 0003 (irq enable) when it stalls on boot to show something (doesn't turn on IRQs again otherwise?) needs camera emulating CONS( 200?, tiktokmm, 0, 0, spg2xx, spg2xx, spg2xx_game_wfcentro_state, empty_init, "TikTokTech Ltd. / 3T Games / Senario", "Moving Music (MM-TV110)", MACHINE_NOT_WORKING ) diff --git a/src/mame/tvgames/spg2xx.h b/src/mame/tvgames/spg2xx.h index 2aad7984a9c56..f34f753271453 100644 --- a/src/mame/tvgames/spg2xx.h +++ b/src/mame/tvgames/spg2xx.h @@ -297,6 +297,24 @@ class spg2xx_game_wfcentro_state : public spg2xx_game_state void mem_map_wfcentro(address_map& map); }; + +class spg2xx_game_lexiart_state : public spg2xx_game_state +{ +public: + spg2xx_game_lexiart_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag) + { } + + void lexiart(machine_config &config); + +protected: + +private: + + void mem_map_lexiart(address_map& map); +}; + + class spg2xx_game_ordentv_state : public spg2xx_game_state { public: diff --git a/src/mame/tvgames/xavix.cpp b/src/mame/tvgames/xavix.cpp index 0084a8f59e068..6788ebdf05d62 100644 --- a/src/mame/tvgames/xavix.cpp +++ b/src/mame/tvgames/xavix.cpp @@ -1178,6 +1178,18 @@ static INPUT_PORTS_START( epo_efdx ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) INPUT_PORTS_END +static INPUT_PORTS_START( epo_tfp2 ) + PORT_INCLUDE(xavix_i2c) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Player 1 Left / Red") PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Player 1 Right / Blue") PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Player 1 Start / Orange") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Player 2 Left / Green") PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Player 2 Right / Pink") PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Player 2 Start / Blue") +INPUT_PORTS_END + static INPUT_PORTS_START( has_wamg ) PORT_INCLUDE(xavix) @@ -1993,6 +2005,12 @@ ROM_START( gcslottv ) ROM_LOAD( "sammyslotunit.bin", 0x000000, 0x200000, CRC(2ba6f3ab) SHA1(1c7fc0c85d817db1550d40c0258f424770e0bd81) ) ROM_END +ROM_START( epo_tfp2 ) + ROM_REGION( 0x400000, "bios", ROMREGION_ERASE00 ) + ROM_LOAD( "funpark2.u1", 0x000000, 0x400000, CRC(97ad5183) SHA1(77310b42d0a015838a1cef4eb5e74cc8335284d1) ) +ROM_END + + @@ -2131,3 +2149,5 @@ CONS( 2002, gcslottv, 0, 0, xavix_cart_gcslottv, gcslottv, xavix CONS( 2006, ltv_tam, 0, 0, xavix_i2c_24lc04_tam, ltv_tam,xavix_i2c_ltv_tam_state, init_xavix, "Bandai / SSD Company LTD", "Let's! TV Play Chou Ninki Spot! Korogashi-Houdai Tamagotchi Resort (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) CONS( 2008, hikara, 0, 0, xavix_cart_hikara, hikara, xavix_hikara_state, init_xavix, "Takara Tomy / SSD Company LTD", "Hi-kara (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) + +CONS( 2003, epo_tfp2, 0, 0, xavix_i2c_24c08, epo_tfp2, xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Tokyo Friend Park 2 (Japan)", MACHINE_IMPERFECT_SOUND) // uses in24lc08b diff --git a/src/mame/tvgames/xavix_a.cpp b/src/mame/tvgames/xavix_a.cpp index 9470f8536de7e..ebddb57744439 100644 --- a/src/mame/tvgames/xavix_a.cpp +++ b/src/mame/tvgames/xavix_a.cpp @@ -116,7 +116,6 @@ bool xavix_sound_device::is_voice_enabled(int voice) void xavix_sound_device::enable_voice(int voice, bool update_only) { m_stream->update(); - int voicemembase = voice * 0x10; uint16_t freq_mode = (m_readregs_cb(voicemembase + 0x1) << 8) | (m_readregs_cb(voicemembase + 0x0)); // sample rate maybe? diff --git a/src/mame/unico/unico.cpp b/src/mame/unico/unico.cpp index e831e85fcf60d..3186102115d83 100644 --- a/src/mame/unico/unico.cpp +++ b/src/mame/unico/unico.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia +// copyright-holders: Luca Elia + /*************************************************************************** -= Unico Games =- @@ -25,17 +26,390 @@ Year + Game PCB Notes ***************************************************************************/ #include "emu.h" -#include "unico.h" #include "cpu/m68000/m68000.h" #include "cpu/m68000/m68020.h" #include "machine/eepromser.h" #include "sound/okim6295.h" -#include "sound/ymopm.h" #include "sound/ymopl.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class burglarx_state : public driver_device +{ +public: + burglarx_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_gfxdecode(*this, "gfxdecode"), + m_oki(*this, "oki"), + m_leds(*this, "led%u", 0U), + m_vram(*this, "vram", 0xc000, ENDIANNESS_BIG), + m_scroll(*this, "scroll", 22, ENDIANNESS_BIG), + m_spriteram(*this, "spriteram", 0x800, ENDIANNESS_BIG) + { } + + void burglarx(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + + static rgb_t unico_R6G6B6X(uint32_t raw); + uint16_t vram_r(offs_t offset); + void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t scroll_r(offs_t offset); + void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t spriteram_r(offs_t offset); + void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + void okibank_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map); + + required_device m_maincpu; + required_device m_palette; + required_device m_gfxdecode; + optional_device m_oki; + output_finder<2> m_leds; + +private: + memory_share_creator m_vram; + memory_share_creator m_scroll; + tilemap_t *m_tilemap[3]{}; + int m_sprites_scrolldx = 0; + int m_sprites_scrolldy = 0; + memory_share_creator m_spriteram; +}; + +class zeropnt_state : public burglarx_state +{ +public: + zeropnt_state(const machine_config &mconfig, device_type type, const char *tag) : + burglarx_state(mconfig, type, tag), + m_okibank(*this, "okibank"), + m_screen(*this, "screen"), + m_gun_axes(*this, { "Y0", "X0", "Y1", "X1" }) + { } + + void zeropnt(machine_config &config); + +protected: + virtual void machine_start() override; + + required_memory_bank m_okibank; + + required_device m_screen; + + enum { Y0, X0, Y1, X1 }; // gun axis indices + + template uint16_t gunx_msb_r(); + template uint16_t guny_msb_r(); + + void oki_map(address_map &map); + +private: + required_ioport_array<4> m_gun_axes; + + void okibank_leds_w(uint8_t data); + + void program_map(address_map &map); +}; + +class zeropnt2_state : public zeropnt_state +{ +public: + zeropnt2_state(const machine_config &mconfig, device_type type, const char *tag) : + zeropnt_state(mconfig, type, tag), + m_eeprom(*this, "eeprom") + { } + + void zeropnt2(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_eeprom; + + template uint32_t gunx_msb_r(); + template uint32_t guny_msb_r(); + void okibank(uint8_t data); + void leds_w(uint8_t data); + + void eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + + void program_map(address_map &map); +}; + + +// video + +/*************************************************************************** + +Note: if MAME_DEBUG is defined, pressing Z with: + + Q / W / E Shows Layer 0 / 1 / 2 + A Shows Sprites + + Keys can be used together! + + + [ 3 Scrolling Layers ] + + Tile Size: 16 x 16 x 8 + Layer Size (tiles): 64 x 64 + + [ 512 Sprites ] + + Sprites are made of 16 x 16 x 8 tiles. Size can vary from 1 to + 16 tiles horizontally, while their height is always 1 tile. + There seems to be 4 levels of priority (wrt layers) for each + sprite, following this simple scheme: + + [if we denote the three layers with 0-3 (0 being the backmost) + and the sprite with S] + + Sprite Priority Order (back -> front) + 0 S 0 1 2 + 1 0 S 1 2 + 2 0 1 S 2 + 3 0 1 2 S + +***************************************************************************/ + +/*************************************************************************** + + Palette + + Byte: 0 1 2 3 + Gun: R G B 0 + + 6 Bits x Gun + +***************************************************************************/ + +rgb_t burglarx_state::unico_R6G6B6X(uint32_t raw) +{ + int const red = (raw >> 24) & 0xfc; + int const green = (raw >> 16) & 0xfc; + int const blue = (raw >> 8) & 0xfc; + + return rgb_t(red | (red >> 6), green | (green >> 6), blue | (blue >> 6)); +} + +/*************************************************************************** + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + 2.w fedc ba98 7--- ---- + ---- ---- -6-- ---- Flip Y + ---- ---- --5- ---- Flip X + ---- ---- ---4 3210 Color + +***************************************************************************/ + + +TILE_GET_INFO_MEMBER(burglarx_state::get_tile_info) +{ + uint16_t const *vram = (uint16_t *)tilemap.user_data(); + uint16_t const code = vram[2 * tile_index + 0]; + uint16_t const attr = vram[2 * tile_index + 1]; + tileinfo.set(1, code, attr & 0x1f, TILE_FLIPYX(attr >> 5)); +} + +uint16_t burglarx_state::vram_r(offs_t offset) { return m_vram[offset]; } + +void burglarx_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + int const tile = ((offset / 0x2000) + 1) % 3; + COMBINE_DATA(&m_vram[offset]); + m_tilemap[tile]->mark_tile_dirty((offset & 0x1fff) / 2); +} + + +uint16_t burglarx_state::scroll_r(offs_t offset) { return m_scroll[offset]; } +void burglarx_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_scroll[offset]); } +uint16_t burglarx_state::spriteram_r(offs_t offset) { return m_spriteram[offset]; } +void burglarx_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_spriteram[offset]); } +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + + +void burglarx_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[0]->set_user_data(&m_vram[0x8000 / 2]); + m_tilemap[1]->set_user_data(&m_vram[0x0000 / 2]); + m_tilemap[2]->set_user_data(&m_vram[0x4000 / 2]); + + m_sprites_scrolldx = -0x3f; + m_sprites_scrolldy = -0x0e; + + m_tilemap[0]->set_scrolldx(-0x32, 0); + m_tilemap[1]->set_scrolldx(-0x30, 0); + m_tilemap[2]->set_scrolldx(-0x2e, 0); + + m_tilemap[0]->set_scrolldy(-0x0f, 0); + m_tilemap[1]->set_scrolldy(-0x0f, 0); + m_tilemap[2]->set_scrolldy(-0x0f, 0); + + m_tilemap[0]->set_transparent_pen(0x00); + m_tilemap[1]->set_transparent_pen(0x00); + m_tilemap[2]->set_transparent_pen(0x00); +} + + +/*************************************************************************** + + Sprites Drawing + + + 0.w X + + 2.w Y + + 4.w Code + + 6.w fe-- ---- ---- ---- + --dc ---- ---- ---- Priority + ---- ba98 ---- ---- Number of tiles along X, minus 1 + ---- ---- 7--- ---- + ---- ---- -6-- ---- Flip Y? + ---- ---- --5- ---- Flip X + ---- ---- ---4 3210 Color + + +***************************************************************************/ + +void burglarx_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // Draw them backwards, for pdrawgfx + for (int offs = (0x800 - 8) / 2; offs >= 0 ; offs -= 8 / 2) + { + int sx = m_spriteram[offs + 0]; + int sy = m_spriteram[offs + 1]; + int code = m_spriteram[offs + 2]; + int const attr = m_spriteram[offs + 3]; + + int const flipx = attr & 0x020; + int const flipy = attr & 0x040; // not sure + + int const dimx = ((attr >> 8) & 0xf) + 1; + + int const priority = ((attr >> 12) & 0x3); + int pri_mask; + + switch (priority) + { + case 0: pri_mask = 0xfe; break; // below all + case 1: pri_mask = 0xf0; break; // above layer 0 + case 2: pri_mask = 0xfc; break; // above layer 1 + default: + case 3: pri_mask = 0x00; // above all + } + + sx += m_sprites_scrolldx; + sy += m_sprites_scrolldy; + + sx = (sx & 0x1ff) - (sx & 0x200); + sy = (sy & 0x1ff) - (sy & 0x200); + + int startx, endx, incx; + + if (flipx) { startx = sx + (dimx - 1) * 16; endx = sx - 16; incx = -16; } + else { startx = sx; endx = sx + dimx * 16; incx = +16; } + + for (int x = startx ; x != endx ; x += incx) + { + m_gfxdecode->gfx(0)->prio_transpen(bitmap, cliprect, + code++, + attr & 0x1f, + flipx, flipy, + x, sy, + screen.priority(), + pri_mask, 0x00); + } + } +} + + +/*************************************************************************** + + + Screen Drawing + + +***************************************************************************/ + +uint32_t burglarx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = -1; + + m_tilemap[0]->set_scrollx(0, m_scroll[0x00]); + m_tilemap[0]->set_scrolly(0, m_scroll[0x01]); + + m_tilemap[1]->set_scrollx(0, m_scroll[0x05]); + m_tilemap[1]->set_scrolly(0, m_scroll[0x0a]); + + m_tilemap[2]->set_scrollx(0, m_scroll[0x04]); + m_tilemap[2]->set_scrolly(0, m_scroll[0x02]); + +#ifdef MAME_DEBUG +if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) ) +{ + int msk = 0; + if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (msk != 0) layers_ctrl &= msk; +} +#endif + + // The background color is the first of the last palette + bitmap.fill(0x1f00, cliprect); + screen.priority().fill(0, cliprect); + + if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 1); + if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 2); + if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0, 4); + + // Sprites are drawn last, using pdrawgfx + if (layers_ctrl & 8) draw_sprites(screen, bitmap, cliprect); + + return 0; +} + + +// machine + /*************************************************************************** @@ -48,30 +422,30 @@ Year + Game PCB Notes Burglar X ***************************************************************************/ -void unico_state::burglarx_okibank_w(uint8_t data) +void burglarx_state::okibank_w(uint8_t data) { m_oki->set_rom_bank(data & 1); } -void unico_state::burglarx_map(address_map &map) +void burglarx_state::program_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0xff0000, 0xffffff).ram(); // RAM + map(0x000000, 0x0fffff).rom(); + map(0xff0000, 0xffffff).ram(); map(0x800000, 0x800001).portr("INPUTS"); map(0x800018, 0x800019).portr("SYSTEM"); map(0x80001a, 0x80001b).portr("DSW1"); map(0x80001c, 0x80001d).portr("DSW2"); - map(0x800030, 0x800031).nopw(); // ? 0 - map(0x80010c, 0x800121).rw(FUNC(unico_state::scroll_r), FUNC(unico_state::scroll_w)); // Scroll - map(0x800189, 0x800189).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound + map(0x800030, 0x800031).nopw(); // ? 0 + map(0x80010c, 0x800121).rw(FUNC(burglarx_state::scroll_r), FUNC(burglarx_state::scroll_w)); + map(0x800189, 0x800189).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x80018a, 0x80018a).w("ymsnd", FUNC(ym3812_device::data_w)); map(0x80018c, 0x80018c).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); - map(0x80018e, 0x80018e).w(FUNC(unico_state::burglarx_okibank_w)); // - map(0x8001e0, 0x8001e1).nopw(); // IRQ Ack - map(0x904000, 0x90ffff).rw(FUNC(unico_state::vram_r), FUNC(unico_state::vram_w)); // Layers 1, 2, 0 - map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(unico_state::spriteram_r), FUNC(unico_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x80018e, 0x80018e).w(FUNC(burglarx_state::okibank_w)); + map(0x8001e0, 0x8001e1).nopw(); // IRQ Ack + map(0x904000, 0x90ffff).rw(FUNC(burglarx_state::vram_r), FUNC(burglarx_state::vram_w)); // Layers 1, 2, 0 + map(0x920000, 0x923fff).ram(); // ? 0 + map(0x930000, 0x9307ff).rw(FUNC(burglarx_state::spriteram_r), FUNC(burglarx_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); } @@ -80,87 +454,69 @@ void unico_state::burglarx_map(address_map &map) Zero Point ***************************************************************************/ -void zeropnt_state::zeropnt_okibank_leds_w(uint8_t data) +void zeropnt_state::okibank_leds_w(uint8_t data) { /* Banked sound samples. The 3rd quarter of the ROM contains garbage. Indeed, only banks 0&1 are used */ m_okibank->set_entry(data & 1); - machine().bookkeeping().coin_counter_w(0,data & 0x10); + machine().bookkeeping().coin_counter_w(0, data & 0x10); m_leds[0] = BIT(data, 3); // Start 1 m_leds[1] = BIT(data, 2); // Start 2 } -/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */ -uint16_t zeropnt_state::gunx_0_msb_r() -{ - int x=m_gun_axes[X0]->read(); - - x=x*384/256; /* On screen pixel X */ - if (x<0x160) x=0x30 + (x*0xd0/0x15f); - else x=((x-0x160) * 0x20)/0x1f; - - return ((x&0xff) ^ (m_screen->frame_number()&1))<<8; -} - -uint16_t zeropnt_state::guny_0_msb_r() +// Light Gun - need to wiggle the input slightly otherwise fire doesn't work +template +uint16_t zeropnt_state::gunx_msb_r() { - int y=m_gun_axes[Y0]->read(); + int x = m_gun_axes[Which]->read(); - y=0x18+((y*0xe0)/0xff); + x = x * 384 / 256; // On screen pixel X + if (x < 0x160) x = 0x30 + (x * 0xd0 / 0x15f); + else x = ((x - 0x160) * 0x20) / 0x1f; - return ((y&0xff) ^ (m_screen->frame_number()&1))<<8; + return ((x & 0xff) ^ (m_screen->frame_number() & 1)) << 8; } -uint16_t zeropnt_state::gunx_1_msb_r() +template +uint16_t zeropnt_state::guny_msb_r() { - int x=m_gun_axes[X1]->read(); + int y = m_gun_axes[Which]->read(); - x=x*384/256; /* On screen pixel X */ - if (x<0x160) x=0x30 + (x*0xd0/0x15f); - else x=((x-0x160) * 0x20)/0x1f; + y = 0x18 + ((y * 0xe0) / 0xff); - return ((x&0xff) ^ (m_screen->frame_number()&1))<<8; + return ((y & 0xff) ^ (m_screen->frame_number() & 1)) << 8; } -uint16_t zeropnt_state::guny_1_msb_r() +void zeropnt_state::program_map(address_map &map) { - int y=m_gun_axes[Y1]->read(); - - y=0x18+((y*0xe0)/0xff); - - return ((y&0xff) ^ (m_screen->frame_number()&1))<<8; -} - -void zeropnt_state::zeropnt_map(address_map &map) -{ - map(0x000000, 0x0fffff).rom(); // ROM - map(0xef0000, 0xefffff).ram(); // RAM - map(0x800030, 0x800031).nopw(); // ? 0 + map(0x000000, 0x0fffff).rom(); + map(0xef0000, 0xefffff).ram(); + map(0x800030, 0x800031).nopw(); // ? 0 map(0x800018, 0x800019).portr("INPUTS"); map(0x80001a, 0x80001b).portr("DSW1"); map(0x80001c, 0x80001d).portr("DSW2"); - map(0x80010c, 0x800121).rw(FUNC(zeropnt_state::scroll_r), FUNC(zeropnt_state::scroll_w)); // Scroll - map(0x800170, 0x800171).r(FUNC(zeropnt_state::guny_0_msb_r)); // Light Guns - map(0x800174, 0x800175).r(FUNC(zeropnt_state::gunx_0_msb_r)); // - map(0x800178, 0x800179).r(FUNC(zeropnt_state::guny_1_msb_r)); // - map(0x80017c, 0x80017d).r(FUNC(zeropnt_state::gunx_1_msb_r)); // - map(0x800189, 0x800189).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound + map(0x80010c, 0x800121).rw(FUNC(zeropnt_state::scroll_r), FUNC(zeropnt_state::scroll_w)); + map(0x800170, 0x800171).r(FUNC(zeropnt_state::guny_msb_r)); + map(0x800174, 0x800175).r(FUNC(zeropnt_state::gunx_msb_r)); + map(0x800178, 0x800179).r(FUNC(zeropnt_state::guny_msb_r)); + map(0x80017c, 0x80017d).r(FUNC(zeropnt_state::gunx_msb_r)); + map(0x800189, 0x800189).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x80018a, 0x80018a).w("ymsnd", FUNC(ym3812_device::data_w)); map(0x80018c, 0x80018c).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); - map(0x80018e, 0x80018e).w(FUNC(zeropnt_state::zeropnt_okibank_leds_w)); // - map(0x8001e0, 0x8001e1).nopw(); // ? IRQ Ack - map(0x904000, 0x90ffff).rw(FUNC(zeropnt_state::vram_r), FUNC(zeropnt_state::vram_w)); // Layers 1, 2, 0 + map(0x80018e, 0x80018e).w(FUNC(zeropnt_state::okibank_leds_w)); + map(0x8001e0, 0x8001e1).nopw(); // ? IRQ Ack + map(0x904000, 0x90ffff).rw(FUNC(zeropnt_state::vram_r), FUNC(zeropnt_state::vram_w)); // Layers 1, 2, 0 map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(zeropnt_state::spriteram_r), FUNC(zeropnt_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x930000, 0x9307ff).rw(FUNC(zeropnt_state::spriteram_r), FUNC(zeropnt_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); } -void zeropnt_state::zeropnt_oki_map(address_map &map) +void zeropnt_state::oki_map(address_map &map) { map(0x00000, 0x1ffff).rom(); - map(0x20000, 0x3ffff).bankr("okibank"); + map(0x20000, 0x3ffff).bankr(m_okibank); } @@ -168,19 +524,17 @@ void zeropnt_state::zeropnt_oki_map(address_map &map) Zero Point 2 ***************************************************************************/ -uint32_t zeropnt2_state::zeropnt2_gunx_0_msb_r() { return (gunx_0_msb_r()-0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_guny_0_msb_r() { return (guny_0_msb_r()+0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_gunx_1_msb_r() { return (gunx_1_msb_r()-0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_guny_1_msb_r() { return (guny_1_msb_r()+0x0800) << 16; } +template uint32_t zeropnt2_state::gunx_msb_r() { return (zeropnt_state::gunx_msb_r() - 0x0800) << 16; } +template uint32_t zeropnt2_state::guny_msb_r() { return (zeropnt_state::guny_msb_r() + 0x0800) << 16; } -void zeropnt2_state::zeropnt2_okibank(uint8_t data) +void zeropnt2_state::okibank(uint8_t data) { m_okibank->set_entry((data & 3) % 4); } void zeropnt2_state::leds_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0,data & 0x01); + machine().bookkeeping().coin_counter_w(0, data & 0x01); m_leds[0] = BIT(data, 7); // Start 1 m_leds[1] = BIT(data, 6); // Start 2 } @@ -190,7 +544,7 @@ void zeropnt2_state::eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask) if (data & ~0xfe00000) logerror("%s - Unknown EEPROM bit written %04X\n",machine().describe_context(),data); - if ( ACCESSING_BITS_24_31 ) + if (ACCESSING_BITS_24_31) { // latch the bit m_eeprom->di_write((data & 0x04000000) >> 26); @@ -203,30 +557,30 @@ void zeropnt2_state::eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask) } } -void zeropnt2_state::zeropnt2_map(address_map &map) +void zeropnt2_state::program_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM + map(0x000000, 0x1fffff).rom(); map(0x800018, 0x80001b).portr("SYSTEM"); - map(0x800025, 0x800025).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound - map(0x800028, 0x80002f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x00ff0000); // - map(0x800031, 0x800031).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // - map(0x800034, 0x800034).w(FUNC(zeropnt2_state::zeropnt2_okibank)); // - map(0x800039, 0x800039).w(FUNC(zeropnt2_state::leds_w)); // ? - map(0x80010c, 0x800123).rw(FUNC(zeropnt2_state::scroll_r), FUNC(zeropnt2_state::scroll_w)); // Scroll - map(0x800140, 0x800143).r(FUNC(zeropnt2_state::zeropnt2_guny_0_msb_r)); // Light Guns - map(0x800144, 0x800147).r(FUNC(zeropnt2_state::zeropnt2_gunx_0_msb_r)); // - map(0x800148, 0x80014b).r(FUNC(zeropnt2_state::zeropnt2_guny_1_msb_r)); // - map(0x80014c, 0x80014f).r(FUNC(zeropnt2_state::zeropnt2_gunx_1_msb_r)); // + map(0x800025, 0x800025).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x800028, 0x80002f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x00ff0000); + map(0x800031, 0x800031).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x800034, 0x800034).w(FUNC(zeropnt2_state::okibank)); + map(0x800039, 0x800039).w(FUNC(zeropnt2_state::leds_w)); + map(0x80010c, 0x800123).rw(FUNC(zeropnt2_state::scroll_r), FUNC(zeropnt2_state::scroll_w)); + map(0x800140, 0x800143).r(FUNC(zeropnt2_state::guny_msb_r)); + map(0x800144, 0x800147).r(FUNC(zeropnt2_state::gunx_msb_r)); + map(0x800148, 0x80014b).r(FUNC(zeropnt2_state::guny_msb_r)); + map(0x80014c, 0x80014f).r(FUNC(zeropnt2_state::gunx_msb_r)); map(0x800150, 0x800153).portr("DSW1"); map(0x800154, 0x800157).portr("DSW2"); map(0x80015c, 0x80015f).portr("BUTTONS"); - map(0x8001e0, 0x8001e3).nopw(); // ? IRQ Ack - map(0x8001f0, 0x8001f3).w(FUNC(zeropnt2_state::eeprom_w)); // EEPROM - map(0x904000, 0x90ffff).rw(FUNC(zeropnt2_state::vram_r), FUNC(zeropnt2_state::vram_w)); // Layers 1, 2, 0 - map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(zeropnt2_state::spriteram_r), FUNC(zeropnt2_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette - map(0xfe0000, 0xffffff).ram(); // RAM + map(0x8001e0, 0x8001e3).nopw(); // ? IRQ Ack + map(0x8001f0, 0x8001f3).w(FUNC(zeropnt2_state::eeprom_w)); + map(0x904000, 0x90ffff).rw(FUNC(zeropnt2_state::vram_r), FUNC(zeropnt2_state::vram_w)); // Layers 1, 2, 0 + map(0x920000, 0x923fff).ram(); // ? 0 + map(0x930000, 0x9307ff).rw(FUNC(zeropnt2_state::spriteram_r), FUNC(zeropnt2_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0xfe0000, 0xffffff).ram(); } @@ -243,7 +597,7 @@ void zeropnt2_state::zeropnt2_map(address_map &map) ***************************************************************************/ static INPUT_PORTS_START( burglarx ) - PORT_START("INPUTS") /* $800000.w */ + PORT_START("INPUTS") // $800000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) @@ -262,7 +616,7 @@ static INPUT_PORTS_START( burglarx ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("SYSTEM") /* $800019.b */ + PORT_START("SYSTEM") // $800019.b PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -273,22 +627,22 @@ static INPUT_PORTS_START( burglarx ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_SERVICE( 0x0100, IP_ACTIVE_LOW ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) ) + PORT_SERVICE( 0x0100, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DIP-A:1") + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("DIP-A:2") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "Unknown 1-2" ) + PORT_DIPNAME( 0x0400, 0x0400, "Unknown A-3" ) PORT_DIPLOCATION("DIP-A:3") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP-A:4") PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "Unknown 1-4" ) + PORT_DIPNAME( 0x1000, 0x1000, "Unknown A-5" ) PORT_DIPLOCATION("DIP-A:5") PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIP-A:6,7,8") PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) @@ -298,25 +652,25 @@ static INPUT_PORTS_START( burglarx ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) + PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DIP-B:1,2") PORT_DIPSETTING( 0x0200, DEF_STR( None ) ) PORT_DIPSETTING( 0x0300, "A" ) PORT_DIPSETTING( 0x0100, "B" ) PORT_DIPSETTING( 0x0000, "C" ) - PORT_DIPNAME( 0x0400, 0x0400, "Unknown 2-2" ) + PORT_DIPNAME( 0x0400, 0x0400, "Unknown B-3" ) PORT_DIPLOCATION("DIP-B:3") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "Energy" ) + PORT_DIPNAME( 0x0800, 0x0800, "Energy" ) PORT_DIPLOCATION("DIP-B:4") PORT_DIPSETTING( 0x0000, "2" ) PORT_DIPSETTING( 0x0800, "3" ) - PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) ) + PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DIP-B:5,6") PORT_DIPSETTING( 0x2000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x3000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) + PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP-B:7,8") PORT_DIPSETTING( 0x8000, "2" ) PORT_DIPSETTING( 0xc000, "3" ) PORT_DIPSETTING( 0x4000, "4" ) @@ -330,7 +684,7 @@ INPUT_PORTS_END ***************************************************************************/ static INPUT_PORTS_START( zeropnt ) - PORT_START("INPUTS") /* $800018.w */ + PORT_START("INPUTS") // $800018.w PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_HIGH ) @@ -350,24 +704,24 @@ static INPUT_PORTS_START( zeropnt ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-A:!1") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("DIP-A:!2") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-A:!3") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP-A:!4") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-A:!5") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) - PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIP-A:!6,!7,!8") PORT_DIPSETTING( 0xe000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 3C_1C ) ) @@ -377,40 +731,40 @@ static INPUT_PORTS_START( zeropnt ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-B:!1") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-B:!2") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-B:!3") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unused ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-B:!4") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) - PORT_DIPNAME( 0x3000, 0x0000, DEF_STR( Difficulty ) ) + PORT_DIPNAME( 0x3000, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DIP-B:!5,!6") PORT_DIPSETTING( 0x1000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x2000, DEF_STR( Hard ) ) - PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Lives ) ) + PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP-B:!7,!8") PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0x0000, "3" ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0xc000, "5" ) - PORT_START("Y0") /* $800170.b */ + PORT_START("Y0") // $800170.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("X0") /* $800174.b */ + PORT_START("X0") // $800174.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("Y1") /* $800178.b */ + PORT_START("Y1") // $800178.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) - PORT_START("X1") /* $80017c.b */ + PORT_START("X1") // $80017c.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) INPUT_PORTS_END @@ -421,7 +775,7 @@ INPUT_PORTS_END ***************************************************************************/ static INPUT_PORTS_START( zeropnt2 ) - PORT_START("SYSTEM") /* $800019.b */ + PORT_START("SYSTEM") // $800019.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_COIN2 ) @@ -433,24 +787,24 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("DIP-A:1") PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_DIPNAME( 0x02000000, 0x02000000, "? Coins To Continue ?" ) - PORT_DIPSETTING( 0x00000000, "1" ) - PORT_DIPSETTING( 0x02000000, "2" ) - PORT_DIPNAME( 0x0c000000, 0x0c000000, "Gun Reloading" ) + PORT_DIPNAME( 0x02000000, 0x02000000, "1 Coin to Continue" ) PORT_DIPLOCATION("DIP-A:2") // Used when coinage is NOT 1 Coin 1 Credit + PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) // Must insert number of coins as per coinage setting to continue + PORT_DIPSETTING( 0x02000000, DEF_STR( On ) ) // Only 1 coin is required to continue regardless of the coinage setting + PORT_DIPNAME( 0x0c000000, 0x0c000000, "Gun Reloading" ) PORT_DIPLOCATION("DIP-A:3,4") PORT_DIPSETTING( 0x08000000, DEF_STR(No) ) PORT_DIPSETTING( 0x04000000, DEF_STR(Yes) ) PORT_DIPSETTING( 0x0c000000, "Factory Setting" ) -// PORT_DIPSETTING( 0x00000000, "unused?" ) - PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Language ) ) + PORT_DIPSETTING( 0x00000000, "unused?" ) + PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Language ) ) PORT_DIPLOCATION("DIP-A:5") PORT_DIPSETTING( 0x10000000, DEF_STR( English ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( Japanese ) ) - PORT_DIPNAME( 0xe0000000, 0xe0000000, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0xe0000000, 0xe0000000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIP-A:6,7,8") PORT_DIPSETTING( 0x00000000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x20000000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40000000, DEF_STR( 3C_1C ) ) @@ -460,16 +814,16 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_DIPSETTING( 0xa0000000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x80000000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_DIPNAME( 0x01000000, 0x01000000, "Korean Language" ) + PORT_DIPNAME( 0x01000000, 0x01000000, "Korean Language" ) PORT_DIPLOCATION("DIP-B:1") PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_DIPNAME( 0x02000000, 0x00000000, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x02000000, 0x00000000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP-B:2") PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1c000000, 0x1c000000, DEF_STR( Lives ) ) + PORT_DIPNAME( 0x1c000000, 0x1c000000, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP-B:3,4,5") PORT_DIPSETTING( 0x10000000, "2" ) PORT_DIPSETTING( 0x0c000000, "3" ) PORT_DIPSETTING( 0x1c000000, "4" ) @@ -478,16 +832,16 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_DIPSETTING( 0x08000000, "4 (duplicate)" ) PORT_DIPSETTING( 0x04000000, "4 (duplicate)" ) PORT_DIPSETTING( 0x00000000, "4 (duplicate)" ) - PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DIP-B:6") PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0000000, 0xc0000000, DEF_STR( Difficulty ) ) + PORT_DIPNAME( 0xc0000000, 0xc0000000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DIP-B:7,8") PORT_DIPSETTING( 0x80000000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0xc0000000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x40000000, DEF_STR( Harder ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( Hardest ) ) - PORT_START("BUTTONS") /* $80015c.b */ + PORT_START("BUTTONS") // $80015c.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) @@ -497,18 +851,18 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) // EEPROM + PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) - PORT_START("Y0") /* $800140.b */ + PORT_START("Y0") // $800140.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("X0") /* $800144.b */ + PORT_START("X0") // $800144.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("Y1") /* $800148.b */ + PORT_START("Y1") // $800148.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) - PORT_START("X1") /* $80014c.b */ + PORT_START("X1") // $80014c.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) INPUT_PORTS_END @@ -522,7 +876,7 @@ INPUT_PORTS_END ***************************************************************************/ -/* 16x16x8 */ +// 16x16x8 static const gfx_layout layout_16x16x8 = { 16,16, @@ -538,8 +892,8 @@ static const gfx_layout layout_16x16x8 = }; static GFXDECODE_START( gfx_unico ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x20 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x0, 0x20 ) // [1] Layers + GFXDECODE_ENTRY( "sprites", 0, layout_16x16x8, 0x0, 0x20 ) + GFXDECODE_ENTRY( "tiles", 0, layout_16x16x8, 0x0, 0x20 ) GFXDECODE_END @@ -553,7 +907,7 @@ GFXDECODE_END ***************************************************************************/ -void unico_state::machine_start() +void burglarx_state::machine_start() { m_leds.resolve(); } @@ -563,34 +917,34 @@ void unico_state::machine_start() Burglar X ***************************************************************************/ -void unico_state::burglarx(machine_config &config) +void burglarx_state::burglarx(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &unico_state::burglarx_map); - m_maincpu->set_vblank_int("screen", FUNC(unico_state::irq2_line_hold)); + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &burglarx_state::program_map); + m_maincpu->set_vblank_int("screen", FUNC(burglarx_state::irq2_line_hold)); - /* video hardware */ + // 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(384, 224); screen.set_visarea(0, 384-1, 0, 224-1); - screen.set_screen_update(FUNC(unico_state::screen_update)); + screen.set_screen_update(FUNC(burglarx_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); - PALETTE(config, m_palette).set_format(4, &unico_state::unico_R6G6B6X, 8192); + PALETTE(config, m_palette).set_format(4, &burglarx_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181)/4)); /* 3.579545 MHz */ + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181) / 4)); // 3.579545 MHz ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.40); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.40); - OKIM6295(config, m_oki, 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + OKIM6295(config, m_oki, 32_MHz_XTAL / 32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.80); m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.80); } @@ -603,18 +957,18 @@ void unico_state::burglarx(machine_config &config) void zeropnt_state::machine_start() { - unico_state::machine_start(); + burglarx_state::machine_start(); m_okibank->configure_entries(0, 4, memregion("oki")->base() + 0x20000, 0x20000); } void zeropnt_state::zeropnt(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt_state::zeropnt_map); + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt_state::program_map); m_maincpu->set_vblank_int("screen", FUNC(zeropnt_state::irq2_line_hold)); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -626,16 +980,16 @@ void zeropnt_state::zeropnt(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); PALETTE(config, m_palette).set_format(4, &zeropnt_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181)/4)); /* 3.579545 MHz */ + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181) / 4)); // 3.579545 MHz ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.40); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.40); - OKIM6295(config, m_oki, 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified - m_oki->set_addrmap(0, &zeropnt_state::zeropnt_oki_map); + OKIM6295(config, m_oki, 32_MHz_XTAL / 32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 verified + m_oki->set_addrmap(0, &zeropnt_state::oki_map); m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.80); m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.80); } @@ -648,20 +1002,20 @@ void zeropnt_state::zeropnt(machine_config &config) void zeropnt2_state::machine_start() { - unico_state::machine_start(); + burglarx_state::machine_start(); m_okibank->configure_entries(0, 4, memregion("oki1")->base() + 0x20000, 0x20000); } void zeropnt2_state::zeropnt2(machine_config &config) { - /* basic machine hardware */ - M68EC020(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt2_state::zeropnt2_map); + // basic machine hardware + M68EC020(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt2_state::program_map); m_maincpu->set_vblank_int("screen", FUNC(zeropnt2_state::irq2_line_hold)); EEPROM_93C46_8BIT(config, "eeprom"); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -673,14 +1027,14 @@ void zeropnt2_state::zeropnt2(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); PALETTE(config, m_palette).set_format(4, &zeropnt2_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YM2151(config, "ymsnd", XTAL(14'318'181)/4).add_route(0, "lspeaker", 0.70).add_route(1, "rspeaker", 0.70); /* 3.579545 MHz */ + YM2151(config, "ymsnd", XTAL(14'318'181) / 4).add_route(0, "lspeaker", 0.70).add_route(1, "rspeaker", 0.70); // 3.579545 MHz okim6295_device &oki1(OKIM6295(config, "oki1", 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified - oki1.set_addrmap(0, &zeropnt2_state::zeropnt_oki_map); + oki1.set_addrmap(0, &zeropnt2_state::oki_map); oki1.add_route(ALL_OUTPUTS, "lspeaker", 0.40); oki1.add_route(ALL_OUTPUTS, "rspeaker", 0.40); @@ -712,12 +1066,12 @@ by Unico ***************************************************************************/ ROM_START( burglarx ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "bx-rom2.pgm", 0x000000, 0x080000, CRC(f81120c8) SHA1(f0240cf9aceb755e3c920bc3bcae0a9de29fd8c1) ) ROM_LOAD16_BYTE( "bx-rom3.pgm", 0x000001, 0x080000, CRC(080b4e82) SHA1(7eb08a7ea7684297e879123ae7ddc88d7fc1b87b) ) - /* Notice the weird ROMs order? Pretty much bit scrambling */ - ROM_REGION( 0x400000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + // Notice the weird ROMs order? Pretty much bit scrambling + ROM_REGION( 0x400000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD16_BYTE( "bx-rom4", 0x000000, 0x080000, CRC(f74ce31f) SHA1(bafe247a2fdc918318ccf7b11f0406c78909dcaa) ) ROM_LOAD16_BYTE( "bx-rom10", 0x000001, 0x080000, CRC(6f56ca23) SHA1(5cfedda8d9fe4b575932a6a136d7b525d96e5454) ) ROM_LOAD16_BYTE( "bx-rom9", 0x100000, 0x080000, CRC(33f29d79) SHA1(287d8412842887af5a5c7a0f5e5736a741c3c7db) ) @@ -727,7 +1081,7 @@ ROM_START( burglarx ) ROM_LOAD16_BYTE( "bx-rom11", 0x300000, 0x080000, CRC(898d176a) SHA1(4c85948b7e639743d0f1676fdc463267f550f97c) ) ROM_LOAD16_BYTE( "bx-rom5", 0x300001, 0x080000, CRC(fdee1423) SHA1(319610435b3dea61276d412e2bf6a3f32809ae19) ) - ROM_REGION( 0x400000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x400000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD16_BYTE( "bx-rom14", 0x000000, 0x080000, CRC(30413373) SHA1(37bbc4d2943a32ee9f6bb268c823ffe162fe92a2) ) ROM_LOAD16_BYTE( "bx-rom18", 0x000001, 0x080000, CRC(8e7fc99f) SHA1(81141e3c9111944aae97d27e5631b11eaf6f8734) ) ROM_LOAD16_BYTE( "bx-rom19", 0x100000, 0x080000, CRC(d40eabcd) SHA1(e41d5e921a1648d6d4907f18e0256dbe3a01e9d3) ) @@ -737,7 +1091,7 @@ ROM_START( burglarx ) ROM_LOAD16_BYTE( "bx-rom13", 0x300000, 0x080000, CRC(da34bbb5) SHA1(455c2412135b89670c2ecda9fd02f4da9b891ee4) ) ROM_LOAD16_BYTE( "bx-rom16", 0x300001, 0x080000, CRC(55b28ef9) SHA1(48615d53ac955ba6aca86ad4f8b61f4d2675d840) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "bx-rom1.snd", 0x000000, 0x080000, CRC(8ae67138) SHA1(3ea44f805a1f978e0a1c1bb7f45507379b147bc0) ) // 2 x 40000 ROM_END @@ -777,67 +1131,67 @@ zpscrz08.BIN -/ ***************************************************************************/ ROM_START( zeropnt ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico_2.rom2", 0x000000, 0x080000, CRC(1e599509) SHA1(5a562a3c85700126b95fbdf21ef8c0ddd35d9037) ) ROM_LOAD16_BYTE( "unico_3.rom3", 0x000001, 0x080000, CRC(588aeef7) SHA1(0dfa22c9e7b1fe493c16160b1ac76fa4d3bb2e68) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) ROM_LOAD( "unico_zpobj_z02.bin", 0x200000, 0x200000, CRC(de34f33a) SHA1(b77c7d508942176585afaeeaea2f34f60326eeb1) ) ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END ROM_START( zeropnta ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico2.rom2", 0x000000, 0x080000, CRC(285fbca3) SHA1(61f8d48388a666ed9300c0688fbf844e316b8892) ) ROM_LOAD16_BYTE( "unico3.rom3", 0x000001, 0x080000, CRC(ad7b3129) SHA1(d814b5d9336d011386aa0b316b11225e5ea799fc) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) ROM_LOAD( "unico_zpobj_z02.bin", 0x200000, 0x200000, CRC(de34f33a) SHA1(b77c7d508942176585afaeeaea2f34f60326eeb1) ) ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END ROM_START( zeropntj ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico_2.bin", 0x000000, 0x080000, CRC(098d9756) SHA1(c98ae2774d2eff7d0ea66887c57d4b55d6939ad8) ) ROM_LOAD16_BYTE( "unico_3.bin", 0x000001, 0x080000, CRC(58e105f3) SHA1(6069ec030d6ce11ec4b9514f366197068f1220ee) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) - ROM_LOAD( "unico_4.bin", 0x200000, 0x200000, CRC(529c36ee) SHA1(3c1d1b94b9cf84fd07689cd5fbfe86820bb878e6) ) /* EPROM Containing graphics data for Japanese text */ + ROM_LOAD( "unico_4.bin", 0x200000, 0x200000, CRC(529c36ee) SHA1(3c1d1b94b9cf84fd07689cd5fbfe86820bb878e6) ) // EPROM Containing graphics data for Japanese text ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END @@ -1004,29 +1358,31 @@ BrianT ***************************************************************************/ ROM_START( zeropnt2 ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* 68020 Code */ + ROM_REGION( 0x200000, "maincpu", 0 ) // 68020 code ROM_LOAD32_WORD_SWAP( "d16-d31.4", 0x000000, 0x100000, CRC(48314fdb) SHA1(a5bdb6a3f520587ff5e73438dc414cfdff34167b) ) ROM_LOAD32_WORD_SWAP( "d0-d15.3", 0x000002, 0x100000, CRC(5ec4151e) SHA1(f7c857bdb6a92f76f09a089b37def7e6cf24b65a) ) - ROM_REGION( 0x1000000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x1000000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "db0db1zp.209", 0x000000, 0x400000, CRC(474b460c) SHA1(72104b7a00cb6d62b3cee2cfadc928669ca948c4) ) ROM_LOAD( "db2db3zp.210", 0x400000, 0x400000, CRC(0a1d0a88) SHA1(b0a6ba9eba539fff417557c9af60d408c2912491) ) ROM_LOAD( "db4db5zp.211", 0x800000, 0x400000, CRC(227169dc) SHA1(b03d8d46714e5aa3631fde7d65466334dafdc341) ) ROM_LOAD( "db6db7zp.212", 0xc00000, 0x400000, CRC(a6306cdb) SHA1(da48c5981b72b87df40602e03e56a40a24728262) ) - ROM_REGION( 0x1000000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x1000000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "a0-a1zp.205", 0x000000, 0x400000, CRC(f7ca9c0e) SHA1(541139b617ff34c378a506cf88fe97234c93ee20) ) ROM_LOAD( "a2-a3zp.206", 0x400000, 0x400000, CRC(0581c8fe) SHA1(9bbffc9c758bbaba2b43a63811b725e51996268a) ) ROM_LOAD( "a4-a5zp.208", 0x800000, 0x400000, CRC(ddd091ef) SHA1(c1751aef2546a35f2fdbfeca9647a88fd3e65cdd) ) ROM_LOAD( "a6-a7zp.207", 0xc00000, 0x400000, CRC(3fd46113) SHA1(326684b92c258bde318693cd9b3a7660aed3cd6f) ) - ROM_REGION( 0x80000 * 2, "oki1", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki1", 0 ) ROM_LOAD( "uzp2-1.bin", 0x000000, 0x080000, CRC(ed0966ed) SHA1(a43b9c493f94d1fb11e1b189caaf37d3d792c730) ) - ROM_REGION( 0x40000, "oki2", 0 ) /* Samples */ + ROM_REGION( 0x40000, "oki2", 0 ) ROM_LOAD( "uzp2-2.bin", 0x000000, 0x040000, CRC(db8cb455) SHA1(6723b4018208d554bd1bf1e0640b72d2f4f47302) ) ROM_END +} // anonymous namespace + /*************************************************************************** @@ -1036,8 +1392,8 @@ ROM_END ***************************************************************************/ -GAME( 1997, burglarx, 0, burglarx, burglarx, unico_state, empty_init, ROT0, "Unico", "Burglar X" , 0 ) -GAME( 1998, zeropnt, 0, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 1)", 0 ) -GAME( 1998, zeropnta, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 2)", 0 ) -GAME( 1998, zeropntj, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (Japan)", 0 ) -GAME( 1999, zeropnt2, 0, zeropnt2, zeropnt2, zeropnt2_state, empty_init, ROT0, "Unico", "Zero Point 2", 0 ) +GAME( 1997, burglarx, 0, burglarx, burglarx, burglarx_state, empty_init, ROT0, "Unico", "Burglar X" , MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropnt, 0, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropnta, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropntj, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, zeropnt2, 0, zeropnt2, zeropnt2, zeropnt2_state, empty_init, ROT0, "Unico", "Zero Point 2", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/unico/unico.h b/src/mame/unico/unico.h deleted file mode 100644 index 29cc10c3c9b96..0000000000000 --- a/src/mame/unico/unico.h +++ /dev/null @@ -1,126 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia -#ifndef MAME_UNICO_UNICO_H -#define MAME_UNICO_UNICO_H - -#pragma once - -#include "sound/okim6295.h" -#include "machine/eepromser.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class unico_state : public driver_device -{ -public: - unico_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_gfxdecode(*this, "gfxdecode"), - m_oki(*this, "oki"), - m_leds(*this, "led%u", 0U), - m_vram(*this, "vram", 0xc000, ENDIANNESS_BIG), - m_scroll(*this, "scroll", 22, ENDIANNESS_BIG), - m_spriteram(*this, "spriteram", 0x800, ENDIANNESS_BIG) - { } - - void burglarx(machine_config &config); - -protected: - static rgb_t unico_R6G6B6X(uint32_t raw); - uint16_t vram_r(offs_t offset); - void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t scroll_r(offs_t offset); - void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t spriteram_r(offs_t offset); - void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - void burglarx_okibank_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void video_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); - - void burglarx_map(address_map &map); - - required_device m_maincpu; - required_device m_palette; - required_device m_gfxdecode; - optional_device m_oki; - output_finder<2> m_leds; - -private: - memory_share_creator m_vram; - memory_share_creator m_scroll; - tilemap_t *m_tilemap[3]{}; - int m_sprites_scrolldx = 0; - int m_sprites_scrolldy = 0; - memory_share_creator m_spriteram; -}; - -class zeropnt_state : public unico_state -{ -public: - zeropnt_state(const machine_config &mconfig, device_type type, const char *tag) : - unico_state(mconfig, type, tag), - m_okibank(*this, "okibank"), - m_screen(*this, "screen"), - m_gun_axes(*this, { "Y0", "X0", "Y1", "X1" }) - { } - - void zeropnt(machine_config &config); - -protected: - virtual void machine_start() override; - - void zeropnt_okibank_leds_w(uint8_t data); - uint16_t gunx_0_msb_r(); - uint16_t guny_0_msb_r(); - uint16_t gunx_1_msb_r(); - uint16_t guny_1_msb_r(); - - required_memory_bank m_okibank; - - required_device m_screen; - - void zeropnt_map(address_map &map); - void zeropnt_oki_map(address_map &map); - -private: - enum { Y0, X0, Y1, X1 }; // gun axis indices - - required_ioport_array<4> m_gun_axes; -}; - -class zeropnt2_state : public zeropnt_state -{ -public: - zeropnt2_state(const machine_config &mconfig, device_type type, const char *tag) : - zeropnt_state(mconfig, type, tag), - m_eeprom(*this, "eeprom") - { } - - void zeropnt2(machine_config &config); - -protected: - virtual void machine_start() override; - - uint32_t zeropnt2_gunx_0_msb_r(); - uint32_t zeropnt2_guny_0_msb_r(); - uint32_t zeropnt2_gunx_1_msb_r(); - uint32_t zeropnt2_guny_1_msb_r(); - void zeropnt2_okibank(uint8_t data); - void leds_w(uint8_t data); - - void eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - - void zeropnt2_map(address_map &map); - -private: - required_device m_eeprom; -}; - -#endif // MAME_UNICO_UNICO_H diff --git a/src/mame/unico/unico_v.cpp b/src/mame/unico/unico_v.cpp deleted file mode 100644 index 9a9edadae98dc..0000000000000 --- a/src/mame/unico/unico_v.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia -/*************************************************************************** - - -= Unico Games =- - - driver by Luca Elia (l.elia@tin.it) - - -Note: if MAME_DEBUG is defined, pressing Z with: - - Q / W / E Shows Layer 0 / 1 / 2 - A Shows Sprites - - Keys can be used together! - - - [ 3 Scrolling Layers ] - - Tile Size: 16 x 16 x 8 - Layer Size (tiles): 64 x 64 - - [ 512 Sprites ] - - Sprites are made of 16 x 16 x 8 tiles. Size can vary from 1 to - 16 tiles horizontally, while their height is always 1 tile. - There seems to be 4 levels of priority (wrt layers) for each - sprite, following this simple scheme: - - [if we denote the three layers with 0-3 (0 being the backmost) - and the sprite with S] - - Sprite Priority Order (back -> front) - 0 S 0 1 2 - 1 0 S 1 2 - 2 0 1 S 2 - 3 0 1 2 S - -***************************************************************************/ - -#include "emu.h" -#include "unico.h" - - -/*************************************************************************** - - Palette - - Byte: 0 1 2 3 - Gun: R G B 0 - - 6 Bits x Gun - -***************************************************************************/ - -rgb_t unico_state::unico_R6G6B6X(uint32_t raw) -{ - int const red = (raw >> 24) & 0xfc; - int const green = (raw >> 16) & 0xfc; - int const blue = (raw >> 8) & 0xfc; - - return rgb_t(red | (red >> 6), green | (green >> 6), blue | (blue >> 6)); -} - -/*************************************************************************** - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - 2.w fedc ba98 7--- ---- - ---- ---- -6-- ---- Flip Y - ---- ---- --5- ---- Flip X - ---- ---- ---4 3210 Color - -***************************************************************************/ - - -TILE_GET_INFO_MEMBER(unico_state::get_tile_info) -{ - uint16_t *vram = (uint16_t *)tilemap.user_data(); - uint16_t code = vram[2 * tile_index + 0 ]; - uint16_t attr = vram[2 * tile_index + 1 ]; - tileinfo.set(1, code, attr & 0x1f, TILE_FLIPYX( attr >> 5 )); -} - -uint16_t unico_state::vram_r(offs_t offset) { return m_vram[offset]; } - -void unico_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - int tile = ((offset / 0x2000) + 1) % 3; - COMBINE_DATA(&m_vram[offset]); - m_tilemap[tile]->mark_tile_dirty((offset & 0x1fff)/2); -} - - -uint16_t unico_state::scroll_r(offs_t offset) { return m_scroll[offset]; } -void unico_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_scroll[offset]); } -uint16_t unico_state::spriteram_r(offs_t offset) { return m_spriteram[offset]; } -void unico_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_spriteram[offset]); } - - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - - -void unico_state::video_start() -{ - m_tilemap[0] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[1] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[2] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[0]->set_user_data(&m_vram[0x8000/2]); - m_tilemap[1]->set_user_data(&m_vram[0x0000/2]); - m_tilemap[2]->set_user_data(&m_vram[0x4000/2]); - - m_sprites_scrolldx = -0x3f; - m_sprites_scrolldy = -0x0e; - - m_tilemap[0]->set_scrolldx(-0x32,0); - m_tilemap[1]->set_scrolldx(-0x30,0); - m_tilemap[2]->set_scrolldx(-0x2e,0); - - m_tilemap[0]->set_scrolldy(-0x0f,0); - m_tilemap[1]->set_scrolldy(-0x0f,0); - m_tilemap[2]->set_scrolldy(-0x0f,0); - - m_tilemap[0]->set_transparent_pen(0x00); - m_tilemap[1]->set_transparent_pen(0x00); - m_tilemap[2]->set_transparent_pen(0x00); -} - - -/*************************************************************************** - - Sprites Drawing - - - 0.w X - - 2.w Y - - 4.w Code - - 6.w fe-- ---- ---- ---- - --dc ---- ---- ---- Priority - ---- ba98 ---- ---- Number of tiles along X, minus 1 - ---- ---- 7--- ---- - ---- ---- -6-- ---- Flip Y? - ---- ---- --5- ---- Flip X - ---- ---- ---4 3210 Color - - -***************************************************************************/ - -void unico_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect) -{ - int offs; - - /* Draw them backwards, for pdrawgfx */ - for ( offs = (0x800-8)/2; offs >= 0 ; offs -= 8/2 ) - { - int x, startx, endx, incx; - - int sx = m_spriteram[ offs + 0 ]; - int sy = m_spriteram[ offs + 1 ]; - int code = m_spriteram[ offs + 2 ]; - int attr = m_spriteram[ offs + 3 ]; - - int flipx = attr & 0x020; - int flipy = attr & 0x040; // not sure - - int dimx = ((attr >> 8) & 0xf) + 1; - - int priority = ((attr >> 12) & 0x3); - int pri_mask; - - switch( priority ) - { - case 0: pri_mask = 0xfe; break; // below all - case 1: pri_mask = 0xf0; break; // above layer 0 - case 2: pri_mask = 0xfc; break; // above layer 1 - default: - case 3: pri_mask = 0x00; // above all - } - - sx += m_sprites_scrolldx; - sy += m_sprites_scrolldy; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (flipx) { startx = sx+(dimx-1)*16; endx = sx-16; incx = -16; } - else { startx = sx; endx = sx+dimx*16; incx = +16; } - - for (x = startx ; x != endx ; x += incx) - { - m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect, - code++, - attr & 0x1f, - flipx, flipy, - x, sy, - screen.priority(), - pri_mask,0x00 ); - } - } -} - - -/*************************************************************************** - - - Screen Drawing - - -***************************************************************************/ - -uint32_t unico_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layers_ctrl = -1; - - m_tilemap[0]->set_scrollx(0, m_scroll[0x00]); - m_tilemap[0]->set_scrolly(0, m_scroll[0x01]); - - m_tilemap[1]->set_scrollx(0, m_scroll[0x05]); - m_tilemap[1]->set_scrolly(0, m_scroll[0x0a]); - - m_tilemap[2]->set_scrollx(0, m_scroll[0x04]); - m_tilemap[2]->set_scrolly(0, m_scroll[0x02]); - -#ifdef MAME_DEBUG -if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) ) -{ - int msk = 0; - if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (machine().input().code_pressed(KEYCODE_A)) msk |= 8; - if (msk != 0) layers_ctrl &= msk; -} -#endif - - /* The background color is the first of the last palette */ - bitmap.fill(0x1f00, cliprect); - screen.priority().fill(0, cliprect); - - if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0,1); - if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0,2); - if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0,4); - - /* Sprites are drawn last, using pdrawgfx */ - if (layers_ctrl & 8) draw_sprites(screen,bitmap,cliprect); - - return 0; -} diff --git a/src/mame/universal/docastle.cpp b/src/mame/universal/docastle.cpp index 6e0618f922e0c..cbfae56c6111e 100644 --- a/src/mame/universal/docastle.cpp +++ b/src/mame/universal/docastle.cpp @@ -420,6 +420,15 @@ static INPUT_PORTS_START( dorunrun ) PORT_DIPSETTING( 0x00, "5" ) INPUT_PORTS_END +static INPUT_PORTS_START( runrun ) + PORT_INCLUDE( dorunrun ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:1") + PORT_DIPSETTING( 0x80, "1" ) + PORT_DIPSETTING( 0x00, "2" ) +INPUT_PORTS_END + static INPUT_PORTS_START( dowild ) PORT_INCLUDE( docastle ) @@ -819,6 +828,33 @@ ROM_START( dorunrunca ) ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, CRC(d5bab5d5) SHA1(7a465fe30b6008793d33f6e07086c89111e1e407) ) ROM_END + // Italian bootleg of dorunrunc. Main PCB + 040285C riser board. Differences are just revised number of lives and the 'Do!' and copyright drawing routines NOPed out. +ROM_START( runrun ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "electric_1.bin", 0x0000, 0x2000, CRC(9f23896b) SHA1(609103729b0d9721166ee5e50e4adab09d343f0a) ) // only different ROM + ROM_LOAD( "electric_2.bin", 0x2000, 0x2000, CRC(dbe3e7db) SHA1(168026aacce73941329a72e78423f83f7c4f0f04) ) + ROM_LOAD( "electric_3.bin", 0x4000, 0x2000, CRC(e9b8181a) SHA1(6b960c3503589e62b61f9a2af372b98c48412bc0) ) + ROM_LOAD( "electric_4.bin", 0x6000, 0x2000, CRC(a63d0b89) SHA1(d2ab3b76149e6620f1eb93a051c802b208b8d6dc) ) + + ROM_REGION( 0x10000, "slave", 0 ) + ROM_LOAD( "electric_10.bin", 0x0000, 0x4000, CRC(6dac2fa3) SHA1(cd583f379f01788ce20f611f17689105d32ef97a) ) + + ROM_REGION( 0x10000, "cpu3", 0 ) + ROM_LOAD( "bprom2.bin", 0x0000, 0x0200, BAD_DUMP CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) ) // not dumped for this set + + ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_LOAD( "electric_5.bin", 0x0000, 0x4000, CRC(e20795b7) SHA1(ae4366d2c45580f3e60ae36f81a5fc912d1eb899) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "electric_6.bin", 0x0000, 0x2000, CRC(4bb231a0) SHA1(350423a1e602e23b229095021942d4b14a4736a7) ) + ROM_LOAD( "electric_7.bin", 0x2000, 0x2000, CRC(0c08508a) SHA1(1e235a0f44207c53af2c8da631e5a8e08b231258) ) + ROM_LOAD( "electric_8.bin", 0x4000, 0x2000, CRC(79287039) SHA1(e2e3c056f35a22e48115557e10fcd172ad2f91f1) ) + ROM_LOAD( "electric_9.bin", 0x6000, 0x2000, CRC(523aa999) SHA1(1d4aa0af79a2ed7b935d4ce92d978bf738f08eb3) ) + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, BAD_DUMP CRC(d5bab5d5) SHA1(7a465fe30b6008793d33f6e07086c89111e1e407) ) // not dumped for this set +ROM_END + ROM_START( dorunrun ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "2764.p1", 0x0000, 0x2000, CRC(95c86f8e) SHA1(9fe44911e0aa8d4c7299472a31c401e064d63d17) ) @@ -1118,6 +1154,7 @@ GAME( 1984, dorunrun, 0, dorunrun, dorunrun, docastle_state, empty_init GAME( 1984, dorunrun2, dorunrun, dorunrun, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dorunrunc, dorunrun, docastle, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (Do's Castle hardware, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dorunrunca, dorunrun, docastle, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (Do's Castle hardware, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, runrun, dorunrun, docastle, runrun, docastle_state, empty_init, ROT0, "bootleg", "Run Run (Do! Run Run bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, spiero, dorunrun, dorunrun, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Super Pierrot (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dowild, 0, dorunrun, dowild, docastle_state, empty_init, ROT0, "Universal", "Mr. Do's Wild Ride", MACHINE_SUPPORTS_SAVE ) GAME( 1984, jjack, 0, dorunrun, jjack, docastle_state, empty_init, ROT270, "Universal", "Jumping Jack", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/ussr/debut.cpp b/src/mame/ussr/debut.cpp index d85dac7c100b1..0902b2573513e 100644 --- a/src/mame/ussr/debut.cpp +++ b/src/mame/ussr/debut.cpp @@ -209,7 +209,7 @@ static INPUT_PORTS_START( debutm ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME(u8"АН (Analysis)") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME(u8"ХОД (Force Move)") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME(u8"ИНТ (Switch 1P/2P)") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME(u8"ПОЗ (Position Mode)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME(u8"ПОЗ (Position Mode)") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME(u8"ВФ (Select Piece)") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME(u8"ВП (Take Back)") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME(u8"УР (Level)") diff --git a/src/mame/ussr/im01.cpp b/src/mame/ussr/im01.cpp index f5152f397926f..d0942d2cec068 100644 --- a/src/mame/ussr/im01.cpp +++ b/src/mame/ussr/im01.cpp @@ -326,7 +326,7 @@ static INPUT_PORTS_START( im05 ) PORT_MODIFY("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Forward") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME(u8"ПХ (Hint)") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME(u8"Р (Promotion)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME(u8"Р (Promotion)") PORT_MODIFY("IN.2") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Confirm") diff --git a/src/mame/xerox/xerox820.cpp b/src/mame/xerox/xerox820.cpp index 23e79f68a8848..b984140ce8ae2 100644 --- a/src/mame/xerox/xerox820.cpp +++ b/src/mame/xerox/xerox820.cpp @@ -918,6 +918,13 @@ ROM_START( mk83 ) ROM_LOAD( "2716mk83.bin", 0x0000, 0x0800, CRC(10bf0d81) SHA1(7ec73670a4d9d6421a5d6a4c4edc8b7c87923f6c) ) ROM_END +ROM_START( mojmikro ) + ROM_REGION( 0x2000, Z80_TAG, 0 ) + ROM_LOAD( "mikro-s.u67", 0x0000, 0x0800, CRC(56a329a8) SHA1(22a5d6bef121d14eddc0c25e85b8a73f6ca6a65f)) + ROM_REGION( 0x0800, "chargen", ROMREGION_ERASEFF ) // MMSCHAR YU 8.1.1987 + ROM_LOAD( "mmschar-yu.u73", 0x0000, 0x0800, CRC(ebcc72d3) SHA1(1c3f90b1d2e57586dcd32385d0aaa09e56662e32)) +ROM_END + /* System Drivers */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS @@ -927,3 +934,4 @@ COMP( 1982, mk82, bigboard, 0, bigboard, xerox820, bigboard_state, COMP( 1983, x820ii, 0, 0, xerox820ii, xerox820, xerox820ii_state, empty_init, "Xerox", "Xerox 820-II", MACHINE_NOT_WORKING ) COMP( 1983, x168, x820ii, 0, xerox168, xerox820, xerox820ii_state, empty_init, "Xerox", "Xerox 16/8", MACHINE_NOT_WORKING ) COMP( 1983, mk83, bigboard, 0, mk83, xerox820, xerox820_state, empty_init, "Scomar", "MK-83", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +COMP( 1985, mojmikro, bigboard, 0, bigboard, xerox820, bigboard_state, empty_init, "", "Moj mikro Slovenija", MACHINE_NOT_WORKING ) diff --git a/src/mame/yamaha/ymmu100.cpp b/src/mame/yamaha/ymmu100.cpp index 641beef4794fa..d82d134770e5c 100644 --- a/src/mame/yamaha/ymmu100.cpp +++ b/src/mame/yamaha/ymmu100.cpp @@ -127,7 +127,7 @@ #include "cpu/h8/h8s2655.h" #include "mulcd.h" #include "sound/swp30.h" -#include "bus/plg100/plg100.h" +#include "bus/plg1x0/plg1x0.h" #include "debugger.h" #include "speaker.h" @@ -185,8 +185,8 @@ class mu100_state : public driver_device required_device m_maincpu; required_device m_swp30; required_device m_lcd; - required_device m_ext1; - optional_device m_ext2; + required_device m_ext1; + optional_device m_ext2; required_ioport m_ioport_p7; required_ioport m_ioport_p8; @@ -473,7 +473,7 @@ void mu100_state::mu100(machine_config &config) MULCD(config, m_lcd); - PLG100_CONNECTOR(config, m_ext1, plg100_intf, "vl"); + PLG1X0_CONNECTOR(config, m_ext1, plg1x0_intf, nullptr); m_ext1->midi_tx().set(FUNC(mu100_state::e1_tx)); SPEAKER(config, "lspeaker").front_left(); @@ -501,7 +501,7 @@ void mu100r_state::mu100r(machine_config &config) { mu100(config); - PLG100_CONNECTOR(config, m_ext2, plg100_intf, nullptr); + PLG1X0_CONNECTOR(config, m_ext2, plg1x0_intf, nullptr); m_ext2->midi_tx().set(FUNC(mu100r_state::e2_tx)); } diff --git a/src/mame/yamaha/ymmu128.cpp b/src/mame/yamaha/ymmu128.cpp index b0a15fcfc9244..8743612aadc6b 100644 --- a/src/mame/yamaha/ymmu128.cpp +++ b/src/mame/yamaha/ymmu128.cpp @@ -53,25 +53,76 @@ class mu128_state : public driver_device required_device m_sci; required_shared_ptr m_ram; + u16 m_pe; + void map(address_map &map); void swp30_map(address_map &map); virtual void machine_start() override; virtual void machine_reset() override; + + u16 pe_r(); + void pe_w(u16 data); }; - + void mu128_state::machine_start() { + save_item(NAME(m_pe)); + m_pe = 0; } - + void mu128_state::machine_reset() { } +// Port E: +// 0: lcd-r/w +// 1: nc +// 2: lcd-rs +// 3: lcread (secondary functions on lcread edge) +// 4: lcd-e +// 5: 1mclk +// 6: siclk +// 7: sws +// 8-a: db 0-2, lcdc a-c +// b-c: db 3-4, mic/line +// d: db 5, swp reset +// e: db 6, sireset +// f: db 7, breset + +u16 mu128_state::pe_r() +{ + if(BIT(m_pe, 4)) { + if(BIT(m_pe, 0)) { + if(BIT(m_pe, 2)) + return m_lcd->data_read() << 8; + else + return m_lcd->control_read() << 8; + } else + return 0x0000; + } + + return 0; +} + +void mu128_state::pe_w(u16 data) +{ + u16 prev = m_pe; + m_pe = data; + if(BIT(m_pe, 4) && !BIT(prev, 4)) { + if(!BIT(m_pe, 0)) { + if(BIT(m_pe, 2)) + m_lcd->data_write(m_pe >> 8); + else + m_lcd->control_write(m_pe >> 8); + } + } +} + void mu128_state::map(address_map &map) { map(0x000000, 0x1fffff).rom().region("maincpu", 0); - map(0x200000, 0x21ffff).ram().share(m_ram); + map(0x400000, 0x43ffff).ram().share(m_ram); map(0x800000, 0x801fff).m(m_swp30m, FUNC(swp30_device::map)); map(0x802000, 0x803fff).m(m_swp30s, FUNC(swp30_device::map)); map(0xc00000, 0xc00000).rw(m_sci, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)).mirror(0x3ffffe); @@ -87,6 +138,8 @@ void mu128_state::mu128(machine_config &config) { SH7043(config, m_maincpu, 7_MHz_XTAL * 4); m_maincpu->set_addrmap(AS_PROGRAM, &mu128_state::map); + m_maincpu->read_porte().set(FUNC(mu128_state::pe_r)); + m_maincpu->write_porte().set(FUNC(mu128_state::pe_w)); NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE); diff --git a/src/mame/yamaha/ymmu15.cpp b/src/mame/yamaha/ymmu15.cpp index 8b3deb8389e6e..03e7a91293130 100644 --- a/src/mame/yamaha/ymmu15.cpp +++ b/src/mame/yamaha/ymmu15.cpp @@ -36,7 +36,8 @@ class mu15_state : public driver_device , m_maincpu(*this, "maincpu") // , m_nvram(*this, "ram") , m_lcd(*this, "lcd") - , m_ram(*this, "ram") + , m_ram1(*this, "ram1") + , m_ram2(*this, "ram2") { } void mu15(machine_config &config); @@ -46,7 +47,8 @@ class mu15_state : public driver_device // required_device m_nvram; // required_device m_swp00; required_device m_lcd; - required_shared_ptr m_ram; + required_shared_ptr m_ram1; + required_shared_ptr m_ram2; void c_map(address_map &map); void s_map(address_map &map); @@ -66,7 +68,8 @@ void mu15_state::machine_reset() void mu15_state::s_map(address_map &map) { map(0x000000, 0x3fffff).rom().region("swx00", 0); - map(0x400000, 0x40ffff).ram().share(m_ram); + map(0x400000, 0x40ffff).ram().share(m_ram1); + map(0xc00000, 0xc03fff).ram().share(m_ram2); // map(0x400000, 0x4007ff).m(m_swp00, FUNC(swp00_device::map)); } @@ -230,4 +233,4 @@ ROM_END } // anonymous namespace -CONS( 1998, mu15, 0, 0, mu15, mu15, mu15_state, empty_init, "Yamaha", "MU15", 0 ) +CONS( 1998, mu15, 0, 0, mu15, mu15, mu15_state, empty_init, "Yamaha", "MU15", MACHINE_NOT_WORKING ) diff --git a/src/mame/yamaha/ympsr340.cpp b/src/mame/yamaha/ympsr340.cpp index a4bf719284563..76767517380be 100644 --- a/src/mame/yamaha/ympsr340.cpp +++ b/src/mame/yamaha/ympsr340.cpp @@ -275,6 +275,7 @@ void psr340_state::psr340(machine_config &config) SWX00(config, m_maincpu, 8.4672_MHz_XTAL*2, 1); m_maincpu->set_addrmap(m_maincpu->c_bus_id(), &psr340_state::c_map); m_maincpu->set_addrmap(m_maincpu->s_bus_id(), &psr340_state::s_map); + m_maincpu->read_adc<0>().set_constant(0x3ff); // Battery level // SCI0 is externally clocked at the 31250 Hz MIDI rate by the mks3 m_maincpu->sci_set_external_clock_period(0, attotime::from_hz(31250 * 16)); @@ -303,10 +304,6 @@ ROM_START( psr340 ) ROM_REGION(0x200000, "maincpu", 0) ROM_LOAD16_WORD_SWAP("xv89710.bin", 0x000000, 0x200000, CRC(271ccb8a) SHA1(ec6abbdb82a5e851b77338c79ecabfd8040f023d)) - // patch out battery check for now (SWX00B customized H8S reads ADC *value* at FFFF90) - ROM_FILL(0x20e6, 1, 0x54) - ROM_FILL(0x20e7, 1, 0x70) - ROM_REGION16_BE(0x200000, "wave", 0) ROM_LOAD("xv89810.bin", 0x000000, 0x200000, CRC(10e68363) SHA1(5edee814bf07c49088da44474fdd5c817e7c5af0)) diff --git a/src/osd/interface/midiport.h b/src/osd/interface/midiport.h new file mode 100644 index 0000000000000..f4ce04835a1f9 --- /dev/null +++ b/src/osd/interface/midiport.h @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +/*************************************************************************** + + midiport.h + + OSD interface to midi ports + +***************************************************************************/ +#ifndef MAME_OSD_INTERFACE_MIDIPORT_H +#define MAME_OSD_INTERFACE_MIDIPORT_H + +#pragma once + +#include + + +namespace osd { + +class midi_input_port +{ +public: + virtual ~midi_input_port() = default; + + virtual bool poll() = 0; + virtual int read(uint8_t *pOut) = 0; +}; + + +class midi_output_port +{ +public: + virtual ~midi_output_port() = default; + + virtual void write(uint8_t data) = 0; +}; + +} // namespace osd + +#endif // MAME_OSD_INTERFACE_MIDIPORT_H diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp index 5ac83131abba0..261ceb9beb50d 100644 --- a/src/osd/modules/debugger/debuggdbstub.cpp +++ b/src/osd/modules/debugger/debuggdbstub.cpp @@ -253,9 +253,9 @@ static const gdb_register_map gdb_register_map_m68020pmmu = { "A4", "a4", false, TYPE_INT }, { "A5", "a5", false, TYPE_INT }, { "A6", "fp", true, TYPE_INT }, - { "A7", "sp", true, TYPE_INT }, + { "SP", "sp", true, TYPE_INT }, { "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr - { "PC", "pc", true, TYPE_CODE_POINTER }, + { "CURPC","pc", true, TYPE_CODE_POINTER }, } }; @@ -280,9 +280,9 @@ static const gdb_register_map gdb_register_map_m68000 = { "A4", "a4", false, TYPE_INT }, { "A5", "a5", false, TYPE_INT }, { "A6", "fp", true, TYPE_INT }, - { "A7", "sp", true, TYPE_INT }, + { "SP", "sp", true, TYPE_INT }, { "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr - { "PC", "pc", true, TYPE_CODE_POINTER }, + { "CURPC","pc", true, TYPE_CODE_POINTER }, //NOTE m68-elf-gdb complains about fpcontrol register not present but 68000 doesn't have floating point so... } }; @@ -682,6 +682,9 @@ static std::string escape_packet(const std::string src) result.reserve(src.length()); for ( char ch: src ) { + if ( ch == '\n' ) // don't let socket convert line endings and messing up the checksum + continue; + if ( ch == '#' || ch == '$' || ch == '}' ) { result += '}'; diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp index ec9521ab4b82e..f3de3ca186ea3 100644 --- a/src/osd/modules/input/input_common.cpp +++ b/src/osd/modules/input/input_common.cpp @@ -20,7 +20,9 @@ #if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) #include -#define KEY_TRANS_WIN32(disc, virtual) KEY_##disc, virtual, +#include +#define DIK_UNKNOWN 0xffff // intentionally impossible +#define KEY_TRANS_WIN32(disc, virtual) DIK_##disc, virtual, #else #define KEY_TRANS_WIN32(disc, virtual) #endif @@ -41,147 +43,147 @@ #endif #if defined(OSD_WINDOWS) || defined(OSD_SDL) + key_trans_entry keyboard_trans_table::s_default_table[] = { - // MAME key sdl scancode di scancode virtual key ascii ui - KEY_TRANS_ENTRY0(ESC, ESCAPE, ESCAPE, VK_ESCAPE, 27, "ESCAPE"), - KEY_TRANS_ENTRY1(1, 1, 1, '1', '1'), - KEY_TRANS_ENTRY1(2, 2, 2, '2', '2'), - KEY_TRANS_ENTRY1(3, 3, 3, '3', '3'), - KEY_TRANS_ENTRY1(4, 4, 4, '4', '4'), - KEY_TRANS_ENTRY1(5, 5, 5, '5', '5'), - KEY_TRANS_ENTRY1(6, 6, 6, '6', '6'), - KEY_TRANS_ENTRY1(7, 7, 7, '7', '7'), - KEY_TRANS_ENTRY1(8, 8, 8, '8', '8'), - KEY_TRANS_ENTRY1(9, 9, 9, '9', '9'), - KEY_TRANS_ENTRY1(0, 0, 0, '0', '0'), - KEY_TRANS_ENTRY1(MINUS, MINUS, MINUS, VK_OEM_MINUS, '-'), - KEY_TRANS_ENTRY1(EQUALS, EQUALS, EQUALS, VK_OEM_PLUS, '='), - KEY_TRANS_ENTRY1(BACKSPACE, BACKSPACE, BACK, VK_BACK, 8), - KEY_TRANS_ENTRY1(TAB, TAB, TAB, VK_TAB, 9), - KEY_TRANS_ENTRY1(Q, Q, Q, 'Q', 'Q'), - KEY_TRANS_ENTRY1(W, W, W, 'W', 'W'), - KEY_TRANS_ENTRY1(E, E, E, 'E', 'E'), - KEY_TRANS_ENTRY1(R, R, R, 'R', 'R'), - KEY_TRANS_ENTRY1(T, T, T, 'T', 'T'), - KEY_TRANS_ENTRY1(Y, Y, Y, 'Y', 'Y'), - KEY_TRANS_ENTRY1(U, U, U, 'U', 'U'), - KEY_TRANS_ENTRY1(I, I, I, 'I', 'I'), - KEY_TRANS_ENTRY1(O, O, O, 'O', 'O'), - KEY_TRANS_ENTRY1(P, P, P, 'P', 'P'), - KEY_TRANS_ENTRY1(OPENBRACE, LEFTBRACKET, LBRACKET, VK_OEM_4, '['), - KEY_TRANS_ENTRY1(CLOSEBRACE, RIGHTBRACKET, RBRACKET, VK_OEM_6, ']'), - KEY_TRANS_ENTRY0(ENTER, RETURN, RETURN, VK_RETURN, 13, "RETURN"), - KEY_TRANS_ENTRY1(LCONTROL, LCTRL, LCONTROL, VK_LCONTROL, 0), - KEY_TRANS_ENTRY1(A, A, A, 'A', 'A'), - KEY_TRANS_ENTRY1(S, S, S, 'S', 'S'), - KEY_TRANS_ENTRY1(D, D, D, 'D', 'D'), - KEY_TRANS_ENTRY1(F, F, F, 'F', 'F'), - KEY_TRANS_ENTRY1(G, G, G, 'G', 'G'), - KEY_TRANS_ENTRY1(H, H, H, 'H', 'H'), - KEY_TRANS_ENTRY1(J, J, J, 'J', 'J'), - KEY_TRANS_ENTRY1(K, K, K, 'K', 'K'), - KEY_TRANS_ENTRY1(L, L, L, 'L', 'L'), - KEY_TRANS_ENTRY1(COLON, SEMICOLON, SEMICOLON, VK_OEM_1, ';'), - KEY_TRANS_ENTRY1(QUOTE, APOSTROPHE, APOSTROPHE, VK_OEM_7, '\''), - KEY_TRANS_ENTRY1(TILDE, GRAVE, GRAVE, VK_OEM_3, '`'), - KEY_TRANS_ENTRY1(LSHIFT, LSHIFT, LSHIFT, VK_LSHIFT, 0), - KEY_TRANS_ENTRY1(BACKSLASH, BACKSLASH, BACKSLASH, VK_OEM_5, '\\'), + // MAME key SDL scancode DI scancode virtual key ASCII UI + KEY_TRANS_ENTRY0(ESC, ESCAPE, ESCAPE, VK_ESCAPE, 27, "ESCAPE"), + KEY_TRANS_ENTRY1(1, 1, 1, '1', '1'), + KEY_TRANS_ENTRY1(2, 2, 2, '2', '2'), + KEY_TRANS_ENTRY1(3, 3, 3, '3', '3'), + KEY_TRANS_ENTRY1(4, 4, 4, '4', '4'), + KEY_TRANS_ENTRY1(5, 5, 5, '5', '5'), + KEY_TRANS_ENTRY1(6, 6, 6, '6', '6'), + KEY_TRANS_ENTRY1(7, 7, 7, '7', '7'), + KEY_TRANS_ENTRY1(8, 8, 8, '8', '8'), + KEY_TRANS_ENTRY1(9, 9, 9, '9', '9'), + KEY_TRANS_ENTRY1(0, 0, 0, '0', '0'), + KEY_TRANS_ENTRY1(MINUS, MINUS, MINUS, VK_OEM_MINUS, '-'), + KEY_TRANS_ENTRY1(EQUALS, EQUALS, EQUALS, VK_OEM_PLUS, '='), + KEY_TRANS_ENTRY1(BACKSPACE, BACKSPACE, BACK, VK_BACK, 8), + KEY_TRANS_ENTRY1(TAB, TAB, TAB, VK_TAB, 9), + KEY_TRANS_ENTRY1(Q, Q, Q, 'Q', 'Q'), + KEY_TRANS_ENTRY1(W, W, W, 'W', 'W'), + KEY_TRANS_ENTRY1(E, E, E, 'E', 'E'), + KEY_TRANS_ENTRY1(R, R, R, 'R', 'R'), + KEY_TRANS_ENTRY1(T, T, T, 'T', 'T'), + KEY_TRANS_ENTRY1(Y, Y, Y, 'Y', 'Y'), + KEY_TRANS_ENTRY1(U, U, U, 'U', 'U'), + KEY_TRANS_ENTRY1(I, I, I, 'I', 'I'), + KEY_TRANS_ENTRY1(O, O, O, 'O', 'O'), + KEY_TRANS_ENTRY1(P, P, P, 'P', 'P'), + KEY_TRANS_ENTRY1(OPENBRACE, LEFTBRACKET, LBRACKET, VK_OEM_4, '['), + KEY_TRANS_ENTRY1(CLOSEBRACE, RIGHTBRACKET, RBRACKET, VK_OEM_6, ']'), + KEY_TRANS_ENTRY0(ENTER, RETURN, RETURN, VK_RETURN, 13, "RETURN"), + KEY_TRANS_ENTRY1(LCONTROL, LCTRL, LCONTROL, VK_LCONTROL, 0), + KEY_TRANS_ENTRY1(A, A, A, 'A', 'A'), + KEY_TRANS_ENTRY1(S, S, S, 'S', 'S'), + KEY_TRANS_ENTRY1(D, D, D, 'D', 'D'), + KEY_TRANS_ENTRY1(F, F, F, 'F', 'F'), + KEY_TRANS_ENTRY1(G, G, G, 'G', 'G'), + KEY_TRANS_ENTRY1(H, H, H, 'H', 'H'), + KEY_TRANS_ENTRY1(J, J, J, 'J', 'J'), + KEY_TRANS_ENTRY1(K, K, K, 'K', 'K'), + KEY_TRANS_ENTRY1(L, L, L, 'L', 'L'), + KEY_TRANS_ENTRY1(COLON, SEMICOLON, SEMICOLON, VK_OEM_1, ';'), + KEY_TRANS_ENTRY1(QUOTE, APOSTROPHE, APOSTROPHE, VK_OEM_7, '\''), + KEY_TRANS_ENTRY1(TILDE, GRAVE, GRAVE, VK_OEM_3, '`'), + KEY_TRANS_ENTRY1(LSHIFT, LSHIFT, LSHIFT, VK_LSHIFT, 0), + KEY_TRANS_ENTRY1(BACKSLASH, BACKSLASH, BACKSLASH, VK_OEM_5, '\\'), // KEY_TRANS_ENTRY1(BACKSLASH2, NONUSHASH, UNKNOWN, OEM_102, VK_OEM_102, '<'), // This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. - KEY_TRANS_ENTRY1(BACKSLASH2, NONUSBACKSLASH, OEM_102, VK_OEM_102, '<'), - KEY_TRANS_ENTRY1(Z, Z, Z, 'Z', 'Z'), - KEY_TRANS_ENTRY1(X, X, X, 'X', 'X'), - KEY_TRANS_ENTRY1(C, C, C, 'C', 'C'), - KEY_TRANS_ENTRY1(V, V, V, 'V', 'V'), - KEY_TRANS_ENTRY1(B, B, B, 'B', 'B'), - KEY_TRANS_ENTRY1(N, N, N, 'N', 'N'), - KEY_TRANS_ENTRY1(M, M, M, 'M', 'M'), - KEY_TRANS_ENTRY1(COMMA, COMMA, COMMA, VK_OEM_COMMA, ','), - KEY_TRANS_ENTRY1(STOP, PERIOD, PERIOD, VK_OEM_PERIOD, '.'), - KEY_TRANS_ENTRY1(SLASH, SLASH, SLASH, VK_OEM_2, '/'), - KEY_TRANS_ENTRY1(RSHIFT, RSHIFT, RSHIFT, VK_RSHIFT, 0), - KEY_TRANS_ENTRY1(ASTERISK, KP_MULTIPLY, MULTIPLY, VK_MULTIPLY, '*'), - KEY_TRANS_ENTRY1(LALT, LALT, LMENU, VK_LMENU, 0), - KEY_TRANS_ENTRY1(SPACE, SPACE, SPACE, VK_SPACE, ' '), - KEY_TRANS_ENTRY1(CAPSLOCK, CAPSLOCK, CAPITAL, VK_CAPITAL, 0), - KEY_TRANS_ENTRY1(F1, F1, F1, VK_F1, 0), - KEY_TRANS_ENTRY1(F2, F2, F2, VK_F2, 0), - KEY_TRANS_ENTRY1(F3, F3, F3, VK_F3, 0), - KEY_TRANS_ENTRY1(F4, F4, F4, VK_F4, 0), - KEY_TRANS_ENTRY1(F5, F5, F5, VK_F5, 0), - KEY_TRANS_ENTRY1(F6, F6, F6, VK_F6, 0), - KEY_TRANS_ENTRY1(F7, F7, F7, VK_F7, 0), - KEY_TRANS_ENTRY1(F8, F8, F8, VK_F8, 0), - KEY_TRANS_ENTRY1(F9, F9, F9, VK_F9, 0), - KEY_TRANS_ENTRY1(F10, F10, F10, VK_F10, 0), - KEY_TRANS_ENTRY1(NUMLOCK, NUMLOCKCLEAR, NUMLOCK, VK_NUMLOCK, 0), - KEY_TRANS_ENTRY1(SCRLOCK, SCROLLLOCK, SCROLL, VK_SCROLL, 0), - KEY_TRANS_ENTRY1(7_PAD, KP_7, NUMPAD7, VK_NUMPAD7, 0), - KEY_TRANS_ENTRY1(8_PAD, KP_8, NUMPAD8, VK_NUMPAD8, 0), - KEY_TRANS_ENTRY1(9_PAD, KP_9, NUMPAD9, VK_NUMPAD9, 0), - KEY_TRANS_ENTRY1(MINUS_PAD, KP_MINUS, SUBTRACT, VK_SUBTRACT, 0), - KEY_TRANS_ENTRY1(4_PAD, KP_4, NUMPAD4, VK_NUMPAD4, 0), - KEY_TRANS_ENTRY1(5_PAD, KP_5, NUMPAD5, VK_NUMPAD5, 0), - KEY_TRANS_ENTRY1(6_PAD, KP_6, NUMPAD6, VK_NUMPAD6, 0), - KEY_TRANS_ENTRY1(PLUS_PAD, KP_PLUS, ADD, VK_ADD, 0), - KEY_TRANS_ENTRY1(1_PAD, KP_1, NUMPAD1, VK_NUMPAD1, 0), - KEY_TRANS_ENTRY1(2_PAD, KP_2, NUMPAD2, VK_NUMPAD2, 0), - KEY_TRANS_ENTRY1(3_PAD, KP_3, NUMPAD3, VK_NUMPAD3, 0), - KEY_TRANS_ENTRY1(0_PAD, KP_0, NUMPAD0, VK_NUMPAD0, 0), - KEY_TRANS_ENTRY1(DEL_PAD, KP_PERIOD, DECIMAL, VK_DECIMAL, 0), - KEY_TRANS_ENTRY1(F11, F11, F11, VK_F11, 0), - KEY_TRANS_ENTRY1(F12, F12, F12, VK_F12, 0), - KEY_TRANS_ENTRY1(F13, F13, F13, VK_F13, 0), - KEY_TRANS_ENTRY1(F14, F14, F14, VK_F14, 0), - KEY_TRANS_ENTRY1(F15, F15, F15, VK_F15, 0), - KEY_TRANS_ENTRY1(ENTER_PAD, KP_ENTER, NUMPADENTER, VK_RETURN, 0), - KEY_TRANS_ENTRY1(RCONTROL, RCTRL, RCONTROL, VK_RCONTROL, 0), - KEY_TRANS_ENTRY1(SLASH_PAD, KP_DIVIDE, DIVIDE, VK_DIVIDE, 0), - KEY_TRANS_ENTRY1(PRTSCR, PRINTSCREEN, SYSRQ, 0, 0), - KEY_TRANS_ENTRY1(RALT, RALT, RMENU, VK_RMENU, 0), - KEY_TRANS_ENTRY1(HOME, HOME, HOME, VK_HOME, 0), - KEY_TRANS_ENTRY1(UP, UP, UP, VK_UP, 0), - KEY_TRANS_ENTRY1(PGUP, PAGEUP, PRIOR, VK_PRIOR, 0), - KEY_TRANS_ENTRY1(LEFT, LEFT, LEFT, VK_LEFT, 0), - KEY_TRANS_ENTRY1(RIGHT, RIGHT, RIGHT, VK_RIGHT, 0), - KEY_TRANS_ENTRY1(END, END, END, VK_END, 0), - KEY_TRANS_ENTRY1(DOWN, DOWN, DOWN, VK_DOWN, 0), - KEY_TRANS_ENTRY1(PGDN, PAGEDOWN, NEXT, VK_NEXT, 0), - KEY_TRANS_ENTRY1(INSERT, INSERT, INSERT, VK_INSERT, 0), - KEY_TRANS_ENTRY0(DEL, DELETE, DELETE, VK_DELETE, 0, "DELETE"), - KEY_TRANS_ENTRY1(LWIN, LGUI, LWIN, VK_LWIN, 0), - KEY_TRANS_ENTRY1(RWIN, RGUI, RWIN, VK_RWIN, 0), - KEY_TRANS_ENTRY1(MENU, MENU, APPS, VK_APPS, 0), - KEY_TRANS_ENTRY1(PAUSE, PAUSE, PAUSE, VK_PAUSE, 0), - KEY_TRANS_ENTRY0(CANCEL, CANCEL, UNKNOWN, 0, 0, "CANCEL"), - KEY_TRANS_ENTRY1(BS_PAD, KP_BACKSPACE, UNKNOWN, 0, 0), - KEY_TRANS_ENTRY1(TAB_PAD, KP_TAB, UNKNOWN, 0, 0), - KEY_TRANS_ENTRY1(00_PAD, KP_00, UNKNOWN, 0, 0), - KEY_TRANS_ENTRY1(000_PAD, KP_000, UNKNOWN, 0, 0), - KEY_TRANS_ENTRY1(COMMA_PAD, KP_COMMA, NUMPADCOMMA, 0, 0), - KEY_TRANS_ENTRY1(EQUALS_PAD, KP_EQUALS, NUMPADEQUALS, 0, 0), - - // New keys introduced in Windows 2000. These have no MAME codes to - // preserve compatibility with old config files that may refer to them - // as e.g. FORWARD instead of e.g. KEYCODE_WEBFORWARD. They need table - // entries anyway because otherwise they aren't recognized when - // GetAsyncKeyState polling is used (as happens currently when MAME is - // paused). Some codes are missing because the mapping to vkey codes - // isn't clear, and MapVirtualKey is no help. - KEY_TRANS_ENTRY1(OTHER_SWITCH, MUTE, MUTE, VK_VOLUME_MUTE, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEDOWN, VOLUMEDOWN, VK_VOLUME_DOWN, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEUP, VOLUMEUP, VK_VOLUME_UP, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_HOME, WEBHOME, VK_BROWSER_HOME, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_SEARCH, WEBSEARCH, VK_BROWSER_SEARCH, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BOOKMARKS, WEBFAVORITES, VK_BROWSER_FAVORITES, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_REFRESH, WEBREFRESH, VK_BROWSER_REFRESH, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_STOP, WEBSTOP, VK_BROWSER_STOP, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_FORWARD, WEBFORWARD, VK_BROWSER_FORWARD, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BACK, WEBBACK, VK_BROWSER_BACK, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, MAIL, MAIL, VK_LAUNCH_MAIL, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, MEDIASELECT, MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0), - KEY_TRANS_ENTRY0(INVALID, UNKNOWN, ESCAPE, 0, 0, "INVALID") + KEY_TRANS_ENTRY1(BACKSLASH2, NONUSBACKSLASH, OEM_102, VK_OEM_102, '<'), + KEY_TRANS_ENTRY1(Z, Z, Z, 'Z', 'Z'), + KEY_TRANS_ENTRY1(X, X, X, 'X', 'X'), + KEY_TRANS_ENTRY1(C, C, C, 'C', 'C'), + KEY_TRANS_ENTRY1(V, V, V, 'V', 'V'), + KEY_TRANS_ENTRY1(B, B, B, 'B', 'B'), + KEY_TRANS_ENTRY1(N, N, N, 'N', 'N'), + KEY_TRANS_ENTRY1(M, M, M, 'M', 'M'), + KEY_TRANS_ENTRY1(COMMA, COMMA, COMMA, VK_OEM_COMMA, ','), + KEY_TRANS_ENTRY1(STOP, PERIOD, PERIOD, VK_OEM_PERIOD, '.'), + KEY_TRANS_ENTRY1(SLASH, SLASH, SLASH, VK_OEM_2, '/'), + KEY_TRANS_ENTRY1(RSHIFT, RSHIFT, RSHIFT, VK_RSHIFT, 0), + KEY_TRANS_ENTRY1(ASTERISK, KP_MULTIPLY, MULTIPLY, VK_MULTIPLY, '*'), + KEY_TRANS_ENTRY1(LALT, LALT, LMENU, VK_LMENU, 0), + KEY_TRANS_ENTRY1(SPACE, SPACE, SPACE, VK_SPACE, ' '), + KEY_TRANS_ENTRY1(CAPSLOCK, CAPSLOCK, CAPITAL, VK_CAPITAL, 0), + KEY_TRANS_ENTRY1(F1, F1, F1, VK_F1, 0), + KEY_TRANS_ENTRY1(F2, F2, F2, VK_F2, 0), + KEY_TRANS_ENTRY1(F3, F3, F3, VK_F3, 0), + KEY_TRANS_ENTRY1(F4, F4, F4, VK_F4, 0), + KEY_TRANS_ENTRY1(F5, F5, F5, VK_F5, 0), + KEY_TRANS_ENTRY1(F6, F6, F6, VK_F6, 0), + KEY_TRANS_ENTRY1(F7, F7, F7, VK_F7, 0), + KEY_TRANS_ENTRY1(F8, F8, F8, VK_F8, 0), + KEY_TRANS_ENTRY1(F9, F9, F9, VK_F9, 0), + KEY_TRANS_ENTRY1(F10, F10, F10, VK_F10, 0), + KEY_TRANS_ENTRY1(NUMLOCK, NUMLOCKCLEAR, NUMLOCK, VK_NUMLOCK, 0), + KEY_TRANS_ENTRY1(SCRLOCK, SCROLLLOCK, SCROLL, VK_SCROLL, 0), + KEY_TRANS_ENTRY1(7_PAD, KP_7, NUMPAD7, VK_NUMPAD7, 0), + KEY_TRANS_ENTRY1(8_PAD, KP_8, NUMPAD8, VK_NUMPAD8, 0), + KEY_TRANS_ENTRY1(9_PAD, KP_9, NUMPAD9, VK_NUMPAD9, 0), + KEY_TRANS_ENTRY1(MINUS_PAD, KP_MINUS, SUBTRACT, VK_SUBTRACT, 0), + KEY_TRANS_ENTRY1(4_PAD, KP_4, NUMPAD4, VK_NUMPAD4, 0), + KEY_TRANS_ENTRY1(5_PAD, KP_5, NUMPAD5, VK_NUMPAD5, 0), + KEY_TRANS_ENTRY1(6_PAD, KP_6, NUMPAD6, VK_NUMPAD6, 0), + KEY_TRANS_ENTRY1(PLUS_PAD, KP_PLUS, ADD, VK_ADD, 0), + KEY_TRANS_ENTRY1(1_PAD, KP_1, NUMPAD1, VK_NUMPAD1, 0), + KEY_TRANS_ENTRY1(2_PAD, KP_2, NUMPAD2, VK_NUMPAD2, 0), + KEY_TRANS_ENTRY1(3_PAD, KP_3, NUMPAD3, VK_NUMPAD3, 0), + KEY_TRANS_ENTRY1(0_PAD, KP_0, NUMPAD0, VK_NUMPAD0, 0), + KEY_TRANS_ENTRY1(DEL_PAD, KP_PERIOD, DECIMAL, VK_DECIMAL, 0), + KEY_TRANS_ENTRY1(F11, F11, F11, VK_F11, 0), + KEY_TRANS_ENTRY1(F12, F12, F12, VK_F12, 0), + KEY_TRANS_ENTRY1(F13, F13, F13, VK_F13, 0), + KEY_TRANS_ENTRY1(F14, F14, F14, VK_F14, 0), + KEY_TRANS_ENTRY1(F15, F15, F15, VK_F15, 0), + KEY_TRANS_ENTRY1(ENTER_PAD, KP_ENTER, NUMPADENTER, VK_RETURN, 0), + KEY_TRANS_ENTRY1(RCONTROL, RCTRL, RCONTROL, VK_RCONTROL, 0), + KEY_TRANS_ENTRY1(SLASH_PAD, KP_DIVIDE, DIVIDE, VK_DIVIDE, 0), + KEY_TRANS_ENTRY1(PRTSCR, PRINTSCREEN, SYSRQ, 0, 0), + KEY_TRANS_ENTRY1(RALT, RALT, RMENU, VK_RMENU, 0), + KEY_TRANS_ENTRY1(HOME, HOME, HOME, VK_HOME, 0), + KEY_TRANS_ENTRY1(UP, UP, UP, VK_UP, 0), + KEY_TRANS_ENTRY1(PGUP, PAGEUP, PRIOR, VK_PRIOR, 0), + KEY_TRANS_ENTRY1(LEFT, LEFT, LEFT, VK_LEFT, 0), + KEY_TRANS_ENTRY1(RIGHT, RIGHT, RIGHT, VK_RIGHT, 0), + KEY_TRANS_ENTRY1(END, END, END, VK_END, 0), + KEY_TRANS_ENTRY1(DOWN, DOWN, DOWN, VK_DOWN, 0), + KEY_TRANS_ENTRY1(PGDN, PAGEDOWN, NEXT, VK_NEXT, 0), + KEY_TRANS_ENTRY1(INSERT, INSERT, INSERT, VK_INSERT, 0), + KEY_TRANS_ENTRY0(DEL, DELETE, DELETE, VK_DELETE, 0, "DELETE"), + KEY_TRANS_ENTRY1(LWIN, LGUI, LWIN, VK_LWIN, 0), + KEY_TRANS_ENTRY1(RWIN, RGUI, RWIN, VK_RWIN, 0), + KEY_TRANS_ENTRY1(MENU, MENU, APPS, VK_APPS, 0), + KEY_TRANS_ENTRY1(PAUSE, PAUSE, PAUSE, VK_PAUSE, 0), + KEY_TRANS_ENTRY1(CANCEL, CANCEL, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(BS_PAD, KP_BACKSPACE, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(TAB_PAD, KP_TAB, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(00_PAD, KP_00, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(000_PAD, KP_000, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(COMMA_PAD, KP_COMMA, NUMPADCOMMA, VK_SEPARATOR, 0), + KEY_TRANS_ENTRY1(EQUALS_PAD, KP_EQUALS, NUMPADEQUALS, VK_OEM_NEC_EQUAL, 0), + + // keys that have no specific MAME input item IDs + KEY_TRANS_ENTRY0(OTHER_SWITCH, AUDIONEXT, NEXTTRACK, VK_MEDIA_NEXT_TRACK, 0, "AUDIONEXT"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AUDIOMUTE, MUTE, VK_VOLUME_MUTE, 0, "VOLUMEMUTE"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AUDIOPLAY, PLAYPAUSE, VK_MEDIA_PLAY_PAUSE, 0, "AUDIOPLAY"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AUDIOSTOP, MEDIASTOP, VK_MEDIA_STOP, 0, "AUDIOSTOP"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, VOLUMEDOWN, VOLUMEDOWN, VK_VOLUME_DOWN, 0, "VOLUMEDOWN"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, VOLUMEUP, VOLUMEUP, VK_VOLUME_UP, 0, "VOLUMEUP"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_HOME, WEBHOME, VK_BROWSER_HOME, 0, "NAVHOME"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_SEARCH, WEBSEARCH, VK_BROWSER_SEARCH, 0, "NAVSEARCH"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_BOOKMARKS, WEBFAVORITES, VK_BROWSER_FAVORITES, 0, "NAVFAVORITES"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_REFRESH, WEBREFRESH, VK_BROWSER_REFRESH, 0, "NAVREFRESH"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_STOP, WEBSTOP, VK_BROWSER_STOP, 0, "NAVSTOP"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_FORWARD, WEBFORWARD, VK_BROWSER_FORWARD, 0, "NAVFORWARD"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, AC_BACK, WEBBACK, VK_BROWSER_BACK, 0, "NAVBACK"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, MAIL, MAIL, VK_LAUNCH_MAIL, 0, "MAIL"), + KEY_TRANS_ENTRY0(OTHER_SWITCH, MEDIASELECT, MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0, "MEDIASEL"), + + // sentinel + KEY_TRANS_ENTRY0(INVALID, UNKNOWN, UNKNOWN, 0, 0, "INVALID") }; // The private constructor to create the default instance @@ -190,14 +192,18 @@ keyboard_trans_table::keyboard_trans_table() m_table = s_default_table; m_table_size = std::size(s_default_table); } -#else + +#else // defined(OSD_WINDOWS) || defined(OSD_SDL) + keyboard_trans_table::keyboard_trans_table() { m_table = nullptr; m_table_size = 0; } -#endif +#endif // defined(OSD_WINDOWS) || defined(OSD_SDL) + + // public constructor to allow creation of non-default instances keyboard_trans_table::keyboard_trans_table(std::unique_ptr entries, unsigned int size) { @@ -248,11 +254,10 @@ int keyboard_trans_table::vkey_for_mame_code(input_code code) const // only works for keyboard switches if (code.device_class() == DEVICE_CLASS_KEYBOARD && code.item_class() == ITEM_CLASS_SWITCH) { - input_item_id id = code.item_id(); - int tablenum; + const input_item_id id = code.item_id(); // scan the table for a match - for (tablenum = 0; tablenum < m_table_size; tablenum++) + for (int tablenum = 0; tablenum < m_table_size; tablenum++) if (m_table[tablenum].mame_key == id) return m_table[tablenum].virtual_key; } diff --git a/src/osd/modules/input/input_common.h b/src/osd/modules/input/input_common.h index e767d2b07f2b7..28e53fb0ccbe8 100644 --- a/src/osd/modules/input/input_common.h +++ b/src/osd/modules/input/input_common.h @@ -47,155 +47,6 @@ enum #define MAX_HATS 8 #define MAX_POV 4 -/**************************************************************************** -* DirectInput compatible keyboard scan codes -****************************************************************************/ -#define KEY_UNKNOWN 0x00 -#define KEY_ESCAPE 0x01 -#define KEY_1 0x02 -#define KEY_2 0x03 -#define KEY_3 0x04 -#define KEY_4 0x05 -#define KEY_5 0x06 -#define KEY_6 0x07 -#define KEY_7 0x08 -#define KEY_8 0x09 -#define KEY_9 0x0A -#define KEY_0 0x0B -#define KEY_MINUS 0x0C /* - on main keyboard */ -#define KEY_EQUALS 0x0D -#define KEY_BACK 0x0E /* backspace */ -#define KEY_TAB 0x0F -#define KEY_Q 0x10 -#define KEY_W 0x11 -#define KEY_E 0x12 -#define KEY_R 0x13 -#define KEY_T 0x14 -#define KEY_Y 0x15 -#define KEY_U 0x16 -#define KEY_I 0x17 -#define KEY_O 0x18 -#define KEY_P 0x19 -#define KEY_LBRACKET 0x1A -#define KEY_RBRACKET 0x1B -#define KEY_RETURN 0x1C /* Enter on main keyboard */ -#define KEY_LCONTROL 0x1D -#define KEY_A 0x1E -#define KEY_S 0x1F -#define KEY_D 0x20 -#define KEY_F 0x21 -#define KEY_G 0x22 -#define KEY_H 0x23 -#define KEY_J 0x24 -#define KEY_K 0x25 -#define KEY_L 0x26 -#define KEY_SEMICOLON 0x27 -#define KEY_APOSTROPHE 0x28 -#define KEY_GRAVE 0x29 /* accent grave */ -#define KEY_LSHIFT 0x2A -#define KEY_BACKSLASH 0x2B -#define KEY_Z 0x2C -#define KEY_X 0x2D -#define KEY_C 0x2E -#define KEY_V 0x2F -#define KEY_B 0x30 -#define KEY_N 0x31 -#define KEY_M 0x32 -#define KEY_COMMA 0x33 -#define KEY_PERIOD 0x34 /* . on main keyboard */ -#define KEY_SLASH 0x35 /* / on main keyboard */ -#define KEY_RSHIFT 0x36 -#define KEY_MULTIPLY 0x37 /* * on numeric keypad */ -#define KEY_LMENU 0x38 /* left Alt */ -#define KEY_SPACE 0x39 -#define KEY_CAPITAL 0x3A -#define KEY_F1 0x3B -#define KEY_F2 0x3C -#define KEY_F3 0x3D -#define KEY_F4 0x3E -#define KEY_F5 0x3F -#define KEY_F6 0x40 -#define KEY_F7 0x41 -#define KEY_F8 0x42 -#define KEY_F9 0x43 -#define KEY_F10 0x44 -#define KEY_NUMLOCK 0x45 -#define KEY_SCROLL 0x46 /* Scroll Lock */ -#define KEY_NUMPAD7 0x47 -#define KEY_NUMPAD8 0x48 -#define KEY_NUMPAD9 0x49 -#define KEY_SUBTRACT 0x4A /* - on numeric keypad */ -#define KEY_NUMPAD4 0x4B -#define KEY_NUMPAD5 0x4C -#define KEY_NUMPAD6 0x4D -#define KEY_ADD 0x4E /* + on numeric keypad */ -#define KEY_NUMPAD1 0x4F -#define KEY_NUMPAD2 0x50 -#define KEY_NUMPAD3 0x51 -#define KEY_NUMPAD0 0x52 -#define KEY_DECIMAL 0x53 /* . on numeric keypad */ -#define KEY_OEM_102 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ -#define KEY_F11 0x57 -#define KEY_F12 0x58 -#define KEY_F13 0x64 /* (NEC PC98) */ -#define KEY_F14 0x65 /* (NEC PC98) */ -#define KEY_F15 0x66 /* (NEC PC98) */ -#define KEY_KANA 0x70 /* (Japanese keyboard) */ -#define KEY_ABNT_C1 0x73 /* /? on Brazilian keyboard */ -#define KEY_CONVERT 0x79 /* (Japanese keyboard) */ -#define KEY_NOCONVERT 0x7B /* (Japanese keyboard) */ -#define KEY_YEN 0x7D /* (Japanese keyboard) */ -#define KEY_ABNT_C2 0x7E /* Numpad . on Brazilian keyboard */ -#define KEY_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ -#define KEY_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ -#define KEY_AT 0x91 /* (NEC PC98) */ -#define KEY_COLON 0x92 /* (NEC PC98) */ -#define KEY_UNDERLINE 0x93 /* (NEC PC98) */ -#define KEY_KANJI 0x94 /* (Japanese keyboard) */ -#define KEY_STOP 0x95 /* (NEC PC98) */ -#define KEY_AX 0x96 /* (Japan AX) */ -#define KEY_UNLABELED 0x97 /* (J3100) */ -#define KEY_NEXTTRACK 0x99 /* Next Track */ -#define KEY_NUMPADENTER 0x9C /* Enter on numeric keypad */ -#define KEY_RCONTROL 0x9D -#define KEY_MUTE 0xA0 /* Mute */ -#define KEY_CALCULATOR 0xA1 /* Calculator */ -#define KEY_PLAYPAUSE 0xA2 /* Play / Pause */ -#define KEY_MEDIASTOP 0xA4 /* Media Stop */ -#define KEY_VOLUMEDOWN 0xAE /* Volume - */ -#define KEY_VOLUMEUP 0xB0 /* Volume + */ -#define KEY_WEBHOME 0xB2 /* Web home */ -#define KEY_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ -#define KEY_DIVIDE 0xB5 /* / on numeric keypad */ -#define KEY_SYSRQ 0xB7 -#define KEY_RMENU 0xB8 /* right Alt */ -#define KEY_PAUSE 0xC5 /* Pause */ -#define KEY_HOME 0xC7 /* Home on arrow keypad */ -#define KEY_UP 0xC8 /* UpArrow on arrow keypad */ -#define KEY_PRIOR 0xC9 /* PgUp on arrow keypad */ -#define KEY_LEFT 0xCB /* LeftArrow on arrow keypad */ -#define KEY_RIGHT 0xCD /* RightArrow on arrow keypad */ -#define KEY_END 0xCF /* End on arrow keypad */ -#define KEY_DOWN 0xD0 /* DownArrow on arrow keypad */ -#define KEY_NEXT 0xD1 /* PgDn on arrow keypad */ -#define KEY_INSERT 0xD2 /* Insert on arrow keypad */ -#define KEY_DELETE 0xD3 /* Delete on arrow keypad */ -#define KEY_LWIN 0xDB /* Left Windows key */ -#define KEY_RWIN 0xDC /* Right Windows key */ -#define KEY_APPS 0xDD /* AppMenu key */ -#define KEY_POWER 0xDE /* System Power */ -#define KEY_SLEEP 0xDF /* System Sleep */ -#define KEY_WAKE 0xE3 /* System Wake */ -#define KEY_WEBSEARCH 0xE5 /* Web Search */ -#define KEY_WEBFAVORITES 0xE6 /* Web Favorites */ -#define KEY_WEBREFRESH 0xE7 /* Web Refresh */ -#define KEY_WEBSTOP 0xE8 /* Web Stop */ -#define KEY_WEBFORWARD 0xE9 /* Web Forward */ -#define KEY_WEBBACK 0xEA /* Web Back */ -#define KEY_MYCOMPUTER 0xEB /* My Computer */ -#define KEY_MAIL 0xEC /* Mail */ -#define KEY_MEDIASELECT 0xED /* Media Select */ - //============================================================ // device_info @@ -342,7 +193,7 @@ struct key_trans_entry int sdl_scancode; #endif #if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) - int scan_code; + uint16_t scan_code; unsigned char virtual_key; #endif diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index eec5904b3ac72..7732d610bbae6 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -194,7 +194,7 @@ void dinput_keyboard_device::configure(input_device &device) { // populate it char defname[20]; - for (int keynum = 0; keynum < MAX_KEYS; keynum++) + for (unsigned keynum = 0; keynum < MAX_KEYS; keynum++) { input_item_id itemid = keyboard_trans_table::instance().map_di_scancode_to_itemid(keynum); diff --git a/src/osd/modules/input/input_rawinput.cpp b/src/osd/modules/input/input_rawinput.cpp index 3ee8e2d8f7eed..3b5491fd09d0f 100644 --- a/src/osd/modules/input/input_rawinput.cpp +++ b/src/osd/modules/input/input_rawinput.cpp @@ -25,9 +25,11 @@ #include #include +#include #include #include #include +#include // standard windows headers #include @@ -307,23 +309,75 @@ class rawinput_keyboard_device : public rawinput_device public: rawinput_keyboard_device(std::string &&name, std::string &&id, input_module &module, HANDLE handle) : rawinput_device(std::move(name), std::move(id), module, handle), + m_pause_pressed(std::chrono::steady_clock::time_point::min()), + m_e1(0xffff), m_keyboard({ { 0 } }) { } virtual void reset() override { + m_pause_pressed = std::chrono::steady_clock::time_point::min(); memset(&m_keyboard, 0, sizeof(m_keyboard)); + m_e1 = 0xffff; + } + + virtual void poll(bool relative_reset) override + { + rawinput_device::poll(relative_reset); + + if (m_keyboard.state[0x80 | 0x45] && (std::chrono::steady_clock::now() > (m_pause_pressed + std::chrono::milliseconds(30)))) + m_keyboard.state[0x80 | 0x45] = 0x00; } virtual void process_event(RAWINPUT const &rawinput) override { // determine the full DIK-compatible scancode - uint8_t scancode = (rawinput.data.keyboard.MakeCode & 0x7f) | ((rawinput.data.keyboard.Flags & RI_KEY_E0) ? 0x80 : 0x00); + uint8_t scancode; - // scancode 0xaa is a special shift code we need to ignore - if (scancode == 0xaa) + // the only thing that uses this is Pause + if (rawinput.data.keyboard.Flags & RI_KEY_E1) + { + m_e1 = rawinput.data.keyboard.MakeCode; return; + } + else if (0xffff != m_e1) + { + auto const e1 = std::exchange(m_e1, 0xffff); + if (!(rawinput.data.keyboard.Flags & RI_KEY_E0)) + { + if (((e1 & ~USHORT(0x80)) == 0x1d) && ((rawinput.data.keyboard.MakeCode & ~USHORT(0x80)) == 0x45)) + { + if (rawinput.data.keyboard.Flags & RI_KEY_BREAK) + return; // RawInput generates a fake break immediately after the make - ignore it + + m_pause_pressed = std::chrono::steady_clock::now(); + scancode = 0x80 | 0x45; + } + else + { + return; // no idea + } + } + else + { + return; // shouldn't happen, ignore it + } + } + else + { + // strip bit 7 of the make code to work around dodgy drivers that set it for key up events + if (rawinput.data.keyboard.MakeCode & ~USHORT(0xff)) + { + // won't fit in a byte along with the E0 flag + return; + } + scancode = (rawinput.data.keyboard.MakeCode & 0x7f) | ((rawinput.data.keyboard.Flags & RI_KEY_E0) ? 0x80 : 0x00); + + // fake shift generated with cursor control and Ins/Del for compatibility with very old DOS software + if (scancode == 0xaa) + return; + } // set or clear the key m_keyboard.state[scancode] = (rawinput.data.keyboard.Flags & RI_KEY_BREAK) ? 0x00 : 0x80; @@ -333,13 +387,20 @@ class rawinput_keyboard_device : public rawinput_device { keyboard_trans_table const &table = keyboard_trans_table::instance(); - for (int keynum = 0; keynum < MAX_KEYS; keynum++) + // FIXME: GetKeyNameTextW is for scan codes from WM_KEYDOWN, which aren't quite the same as DIK_* keycodes + // in particular, NumLock and Pause are reversed for US-style keyboard systems + for (unsigned keynum = 0; keynum < MAX_KEYS; keynum++) { input_item_id itemid = table.map_di_scancode_to_itemid(keynum); WCHAR keyname[100]; // generate the name - if (GetKeyNameTextW(((keynum & 0x7f) << 16) | ((keynum & 0x80) << 17), keyname, std::size(keyname)) == 0) + // FIXME: GetKeyNameText gives bogus names for media keys and various other things + // in many cases it ignores the "extended" bit and returns the key name corresponding to the scan code alone + LONG lparam = ((keynum & 0x7f) << 16) | ((keynum & 0x80) << 17); + if ((keynum & 0x7f) == 0x45) + lparam ^= 0x0100'0000; // horrid hack + if (GetKeyNameTextW(lparam, keyname, std::size(keyname)) == 0) _snwprintf(keyname, std::size(keyname), L"Scan%03d", keynum); std::string name = text::from_wstring(keyname); @@ -354,6 +415,8 @@ class rawinput_keyboard_device : public rawinput_device } private: + std::chrono::steady_clock::time_point m_pause_pressed; + uint16_t m_e1; keyboard_state m_keyboard; }; diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 1eaed99f16b8a..fb478511a99eb 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -617,13 +617,8 @@ class sdl_keyboard_device : public sdl_device for (int keynum = 0; m_trans_table[keynum].mame_key != ITEM_ID_INVALID; keynum++) { input_item_id itemid = m_trans_table[keynum].mame_key; - - // generate the default / modified name - char defname[20]; - snprintf(defname, sizeof(defname) - 1, "%s", m_trans_table[keynum].ui_name); - device.add_item( - defname, + m_trans_table[keynum].ui_name, std::string_view(), itemid, generic_button_get_state, @@ -1977,8 +1972,7 @@ class sdl_keyboard_module : public sdl_input_module { public: sdl_keyboard_module() : - sdl_input_module(OSD_KEYBOARDINPUT_PROVIDER, "sdl"), - m_key_trans_table(nullptr) + sdl_input_module(OSD_KEYBOARDINPUT_PROVIDER, "sdl") { } @@ -1993,7 +1987,7 @@ class sdl_keyboard_module : public sdl_input_module subscribe(osd(), event_types); // Read our keymap and store a pointer to our table - m_key_trans_table = sdlinput_read_keymap(); + sdlinput_read_keymap(); osd_printf_verbose("Keyboard: Start initialization\n"); @@ -2009,12 +2003,27 @@ class sdl_keyboard_module : public sdl_input_module } private: - keyboard_trans_table *sdlinput_read_keymap() + void sdlinput_read_keymap() { keyboard_trans_table &default_table = keyboard_trans_table::instance(); + // Allocate a block of translation entries big enough to hold what's in the default table + auto key_trans_entries = std::make_unique(default_table.size()); + + // copy the elements from the default table and ask SDL for key names + for (int i = 0; i < default_table.size(); i++) + { + key_trans_entries[i] = default_table[i]; + char const *const name = SDL_GetScancodeName(SDL_Scancode(default_table[i].sdl_scancode)); + if (name && *name) + key_trans_entries[i].ui_name = name; + } + + // Allocate the trans table to be associated with the machine so we don't have to free it + m_key_trans_table = std::make_unique(std::move(key_trans_entries), default_table.size()); + if (!options()->bool_value(SDLOPTION_KEYMAP)) - return &default_table; + return; const char *const keymap_filename = dynamic_cast(*options()).keymap_file(); osd_printf_verbose("Keymap: Start reading keymap_file %s\n", keymap_filename); @@ -2023,19 +2032,9 @@ class sdl_keyboard_module : public sdl_input_module if (!keymap_file) { osd_printf_warning("Keymap: Unable to open keymap %s, using default\n", keymap_filename); - return &default_table; + return; } - // Allocate a block of translation entries big enough to hold what's in the default table - auto key_trans_entries = std::make_unique(default_table.size()); - - // copy the elements from the default table - for (int i = 0; i < default_table.size(); i++) - key_trans_entries[i] = default_table[i]; - - // Allocate the trans table to be associated with the machine so we don't have to free it - m_custom_table = std::make_unique(std::move(key_trans_entries), default_table.size()); - int line = 1; int sdl2section = 0; while (!feof(keymap_file)) @@ -2068,7 +2067,7 @@ class sdl_keyboard_module : public sdl_input_module if (sk >= 0 && index >= 0) { - key_trans_entry &entry = (*m_custom_table)[index]; + key_trans_entry &entry = (*m_key_trans_table)[index]; entry.sdl_scancode = sk; entry.ui_name = const_cast(m_ui_names.emplace_back(kns).c_str()); osd_printf_verbose("Keymap: Mapped <%s> to <%s> with ui-text <%s>\n", sks, mks, kns); @@ -2083,12 +2082,9 @@ class sdl_keyboard_module : public sdl_input_module } fclose(keymap_file); osd_printf_verbose("Keymap: Processed %d lines\n", line); - - return m_custom_table.get(); } - keyboard_trans_table *m_key_trans_table; - std::unique_ptr m_custom_table; + std::unique_ptr m_key_trans_table; std::list m_ui_names; }; diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index 6919c8d5c426b..3803bc2a180dd 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -59,6 +59,8 @@ class win32_keyboard_device : public event_based_device TCHAR keyname[100]; // generate the name + // FIXME: GetKeyNameText gives bogus names for media keys and various other things + // in many cases it ignores the "extended" bit and returns the key name corresponding to the scan code alone if (GetKeyNameText(((keynum & 0x7f) << 16) | ((keynum & 0x80) << 17), keyname, std::size(keyname)) == 0) _sntprintf(keyname, std::size(keyname), TEXT("Scan%03d"), keynum); std::string name = text::from_tstring(keyname); diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 90bb63bf7f528..430f6ceeac922 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -592,7 +592,19 @@ bool osd_common_t::execute_command(const char *command) if (strcmp(command, OSDCOMMAND_LIST_NETWORK_ADAPTERS) == 0) { osd_module &om = select_module_options(OSD_NETDEV_PROVIDER); - osd_list_network_adapters(); + auto const &interfaces = get_netdev_list(); + if (interfaces.empty()) + { + printf("No supported network interfaces were found\n"); + } + else + { + printf("Available network interfaces:\n"); + for (auto &entry : interfaces) + { + printf(" %s\n", entry->description); + } + } om.exit(); return true; @@ -600,7 +612,27 @@ bool osd_common_t::execute_command(const char *command) else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0) { osd_module &om = select_module_options(OSD_MIDI_PROVIDER); - dynamic_cast(om).list_midi_devices(); + auto const ports = dynamic_cast(om).list_midi_ports(); + if (ports.empty()) + { + printf("No MIDI ports were found\n"); + } + else + { + printf("MIDI input ports:\n"); + for (auto const &port : ports) + { + if (port.input) + printf(port.default_input ? "%s (default)\n" : "%s\n", port.name.c_str()); + } + + printf("\nMIDI output ports:\n"); + for (auto const &port : ports) + { + if (port.output) + printf(port.default_output ? "%s (default)\n" : "%s\n", port.name.c_str()); + } + } om.exit(); return true; @@ -717,7 +749,12 @@ bool osd_common_t::get_font_families(std::string const &font_path, std::vectorget_font_families(font_path, result); } -std::unique_ptr osd_common_t::create_midi_device() +std::unique_ptr osd_common_t::create_midi_input(std::string_view name) +{ + return m_midi->create_input(name); +} + +std::unique_ptr osd_common_t::create_midi_output(std::string_view name) { - return m_midi->create_midi_device(); + return m_midi->create_output(name); } diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index c5cd9b4fc49cb..919bbc4f717de 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -238,7 +238,8 @@ class osd_common_t : public osd_interface, osd_output virtual osd_font::ptr font_alloc() override; virtual bool get_font_families(std::string const &font_path, std::vector > &result) override; - virtual std::unique_ptr create_midi_device() override; + virtual std::unique_ptr create_midi_input(std::string_view name) override; + virtual std::unique_ptr create_midi_output(std::string_view name) override; // FIXME: everything below seems to be osd specific and not part of // this INTERFACE but part of the osd IMPLEMENTATION diff --git a/src/osd/modules/midi/midi_module.h b/src/osd/modules/midi/midi_module.h index 649d8f58b123f..6ea7290805b43 100644 --- a/src/osd/modules/midi/midi_module.h +++ b/src/osd/modules/midi/midi_module.h @@ -9,9 +9,12 @@ #pragma once -#include "osdepend.h" +#include "interface/midiport.h" #include +#include +#include +#include //============================================================ @@ -23,13 +26,23 @@ class midi_module { public: + struct port_info + { + std::string name; + bool input; + bool output; + bool default_input; + bool default_output; + }; + using port_info_vector = std::vector; + virtual ~midi_module() = default; // specific routines - virtual std::unique_ptr create_midi_device() = 0; - // FIXME: should return a list of strings ... - virtual void list_midi_devices() = 0; + virtual std::unique_ptr create_input(std::string_view name) = 0; + virtual std::unique_ptr create_output(std::string_view name) = 0; + virtual port_info_vector list_midi_ports() = 0; }; #endif // MAME_OSD_MODULES_MIDI_MIDI_MODULE_H diff --git a/src/osd/modules/midi/none.cpp b/src/osd/modules/midi/none.cpp index 232a5f1e2a31f..c3dd0aaadc583 100644 --- a/src/osd/modules/midi/none.cpp +++ b/src/osd/modules/midi/none.cpp @@ -20,18 +20,6 @@ namespace osd { namespace { -class osd_midi_device_none : public osd_midi_device -{ -public: - virtual bool open_input(const char *devname) override { return false; } - virtual bool open_output(const char *devname) override { return false; } - virtual void close() override { } - virtual bool poll() override { return false; } - virtual int read(uint8_t *pOut) override { return 0; } - virtual void write(uint8_t data) override { } -}; - - class none_module : public osd_module, public midi_module { public: @@ -40,20 +28,11 @@ class none_module : public osd_module, public midi_module virtual int init(osd_interface &osd, const osd_options &options) override { return 0; } virtual void exit() override { } - virtual std::unique_ptr create_midi_device() override; - virtual void list_midi_devices() override; + virtual std::unique_ptr create_input(std::string_view name) override { return nullptr; } + virtual std::unique_ptr create_output(std::string_view name) override { return nullptr; } + virtual port_info_vector list_midi_ports() override { return port_info_vector(); } }; -std::unique_ptr none_module::create_midi_device() -{ - return std::make_unique(); -} - -void none_module::list_midi_devices() -{ - osd_printf_warning("\nMIDI is not supported in this configuration\n"); -} - } // anonymous namespace } // namespace osd diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp index dba61b47c77f2..3a1dbf6739da7 100644 --- a/src/osd/modules/midi/portmidi.cpp +++ b/src/osd/modules/midi/portmidi.cpp @@ -14,6 +14,9 @@ #ifndef NO_USE_MIDI +#include "interface/midiport.h" +#include "osdcore.h" // osd_printf_* + #include #include @@ -36,45 +39,51 @@ class pm_module : public osd_module, public midi_module virtual int init(osd_interface &osd, const osd_options &options) override; virtual void exit() override; - virtual std::unique_ptr create_midi_device() override; - virtual void list_midi_devices() override; + virtual std::unique_ptr create_input(std::string_view name) override; + virtual std::unique_ptr create_output(std::string_view name) override; + virtual port_info_vector list_midi_ports() override; }; -static const int RX_EVENT_BUF_SIZE = 512; +static constexpr unsigned RX_EVENT_BUF_SIZE = 512; -#define MIDI_SYSEX 0xf0 -#define MIDI_EOX 0xf7 +static constexpr uint8_t MIDI_SYSEX = 0xf0; +static constexpr uint8_t MIDI_EOX = 0xf7; -class osd_midi_device_pm : public osd_midi_device +class midi_input_pm : public midi_input_port { public: - osd_midi_device_pm(): pmStream(nullptr), xmit_cnt(0), last_status(0), rx_sysex(false) { } - virtual ~osd_midi_device_pm() { } - virtual bool open_input(const char *devname) override; - virtual bool open_output(const char *devname) override; - virtual void close() override; + midi_input_pm(PortMidiStream *stream) : m_stream(stream), m_rx_sysex(false) { } + virtual ~midi_input_pm(); + virtual bool poll() override; virtual int read(uint8_t *pOut) override; - virtual void write(uint8_t data) override; private: - PortMidiStream *pmStream; - PmEvent rx_evBuf[RX_EVENT_BUF_SIZE]; - uint8_t xmit_in[4]; // Pm_Messages mean we can at most have 3 residue bytes - int xmit_cnt; - uint8_t last_status; - bool rx_sysex; + PortMidiStream *const m_stream; + PmEvent m_evbuf[RX_EVENT_BUF_SIZE]; + bool m_rx_sysex; }; -std::unique_ptr pm_module::create_midi_device() +class midi_output_pm : public midi_output_port { - return std::make_unique(); -} +public: + midi_output_pm(PortMidiStream *stream) : m_stream(stream), m_xmit_cnt(0), m_last_status(0) { } + virtual ~midi_output_pm(); + + virtual void write(uint8_t data) override; + +private: + PortMidiStream *const m_stream; + uint8_t m_xmit_in[4]; // Pm_Messages mean we can at most have 3 residue bytes + int m_xmit_cnt; + uint8_t m_last_status; +}; int pm_module::init(osd_interface &osd, const osd_options &options) { + // FIXME: check error return code Pm_Initialize(); return 0; } @@ -84,151 +93,126 @@ void pm_module::exit() Pm_Terminate(); } -void pm_module::list_midi_devices() +std::unique_ptr pm_module::create_input(std::string_view name) { - int num_devs = Pm_CountDevices(); - const PmDeviceInfo *pmInfo; - - printf("\n"); - - if (num_devs == 0) + int found_dev = -1; + if (name == "default") { - printf("No MIDI ports were found\n"); - return; + found_dev = Pm_GetDefaultInputDeviceID(); } - - printf("MIDI input ports:\n"); - for (int i = 0; i < num_devs; i++) + else { - pmInfo = Pm_GetDeviceInfo(i); - - if (pmInfo->input) + int const num_devs = Pm_CountDevices(); + for (found_dev = 0; num_devs > found_dev; ++found_dev) { - printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultInputDeviceID()) ? "(default)" : ""); + auto const info = Pm_GetDeviceInfo(found_dev); + if (info->input && (name == info->name)) + break; } + if (num_devs <= found_dev) + found_dev = -1; } - printf("\nMIDI output ports:\n"); - for (int i = 0; i < num_devs; i++) + if (0 > found_dev) { - pmInfo = Pm_GetDeviceInfo(i); - - if (pmInfo->output) - { - printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultOutputDeviceID()) ? "(default)" : ""); - } + osd_printf_warning("No MIDI input device named '%s' was found.\n", name); + return nullptr; } -} -bool osd_midi_device_pm::open_input(const char *devname) -{ - int num_devs = Pm_CountDevices(); - int found_dev = -1; - const PmDeviceInfo *pmInfo; - PortMidiStream *stm; - - if (!strcmp("default", devname)) + PortMidiStream *stream = nullptr; + PmError const err = Pm_OpenInput(&stream, found_dev, nullptr, RX_EVENT_BUF_SIZE, nullptr, nullptr); + if (pmNoError != err) { - found_dev = Pm_GetDefaultInputDeviceID(); - } - else - { - for (int i = 0; i < num_devs; i++) - { - pmInfo = Pm_GetDeviceInfo(i); - - if (pmInfo->input) - { - if (!strcmp(devname, pmInfo->name)) - { - found_dev = i; - break; - } - } - } + osd_printf_error("Error opening PortMidi device '%s' for input.\n", name); + return nullptr; } - if (found_dev >= 0) + try { - if (Pm_OpenInput(&stm, found_dev, nullptr, RX_EVENT_BUF_SIZE, nullptr, nullptr) == pmNoError) - { - pmStream = stm; - return true; - } - else - { - printf("Couldn't open PM device\n"); - return false; - } + return std::make_unique(stream); } - else + catch (...) { - return false; + Pm_Close(stream); + return nullptr; } } -bool osd_midi_device_pm::open_output(const char *devname) +std::unique_ptr pm_module::create_output(std::string_view name) { - int num_devs = Pm_CountDevices(); int found_dev = -1; - const PmDeviceInfo *pmInfo; - PortMidiStream *stm; - - if (!strcmp("default", devname)) + if (name == "default") { found_dev = Pm_GetDefaultOutputDeviceID(); } else { - for (int i = 0; i < num_devs; i++) + int const num_devs = Pm_CountDevices(); + for (found_dev = 0; num_devs > found_dev; ++found_dev) { - pmInfo = Pm_GetDeviceInfo(i); - - if (pmInfo->output) - { - if (!strcmp(devname, pmInfo->name)) - { - found_dev = i; - break; - } - } + auto const info = Pm_GetDeviceInfo(found_dev); + if (info->output && (name == info->name)) + break; } + if (num_devs <= found_dev) + found_dev = -1; } - if (found_dev >= 0) + PortMidiStream *stream = nullptr; + PmError const err = Pm_OpenOutput(&stream, found_dev, nullptr, 100, nullptr, nullptr, 0); + if (pmNoError != err) { - if (Pm_OpenOutput(&stm, found_dev, nullptr, 100, nullptr, nullptr, 0) == pmNoError) - { - pmStream = stm; - return true; - } - else - { - printf("Couldn't open PM device\n"); - return false; - } + osd_printf_error("Error opening PortMidi device '%s' for output.\n", name); + return nullptr; } - else + + try + { + return std::make_unique(stream); + } + catch (...) { - return false; + Pm_Close(stream); + return nullptr; } } -void osd_midi_device_pm::close() +midi_module::port_info_vector pm_module::list_midi_ports() { - Pm_Close(pmStream); + int const num_devs = Pm_CountDevices(); + int const def_input = Pm_GetDefaultInputDeviceID(); + int const def_output = Pm_GetDefaultOutputDeviceID(); + port_info_vector result; + result.reserve(num_devs); + for (int i = 0; num_devs > i; ++i) + { + auto const pm_info = Pm_GetDeviceInfo(i); + result.emplace_back(port_info{ + pm_info->name, + 0 != pm_info->input, + 0 != pm_info->output, + def_input == i, + def_output == i }); + } + return result; } -bool osd_midi_device_pm::poll() + +midi_input_pm::~midi_input_pm() { - PmError chk = Pm_Poll(pmStream); + if (m_stream) + Pm_Close(m_stream); +} +bool midi_input_pm::poll() +{ + PmError const chk = Pm_Poll(m_stream); return (chk == pmGotData) ? true : false; } -int osd_midi_device_pm::read(uint8_t *pOut) +int midi_input_pm::read(uint8_t *pOut) { - int msgsRead = Pm_Read(pmStream, rx_evBuf, RX_EVENT_BUF_SIZE); + int msgsRead = Pm_Read(m_stream, m_evbuf, RX_EVENT_BUF_SIZE); int bytesOut = 0; if (msgsRead <= 0) @@ -238,23 +222,23 @@ int osd_midi_device_pm::read(uint8_t *pOut) for (int msg = 0; msg < msgsRead; msg++) { - uint8_t status = Pm_MessageStatus(rx_evBuf[msg].message); + uint8_t status = Pm_MessageStatus(m_evbuf[msg].message); - if (rx_sysex) + if (m_rx_sysex) { if (status & 0x80) // sys real-time imposing on us? { if (status == 0xf2) { *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); - *pOut++ = Pm_MessageData2(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); + *pOut++ = Pm_MessageData2(m_evbuf[msg].message); bytesOut += 3; } else if (status == 0xf3) { *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); bytesOut += 2; } else @@ -263,7 +247,7 @@ int osd_midi_device_pm::read(uint8_t *pOut) bytesOut++; if (status == MIDI_EOX) { - rx_sysex = false; + m_rx_sysex = false; } } } @@ -271,15 +255,15 @@ int osd_midi_device_pm::read(uint8_t *pOut) { for (int i = 0; i < 4; i++) { - uint8_t byte = rx_evBuf[msg].message & 0xff; + uint8_t byte = m_evbuf[msg].message & 0xff; *pOut++ = byte; bytesOut++; if (byte == MIDI_EOX) { - rx_sysex = false; + m_rx_sysex = false; break; } - rx_evBuf[msg].message >>= 8; + m_evbuf[msg].message >>= 8; } } } @@ -290,7 +274,7 @@ int osd_midi_device_pm::read(uint8_t *pOut) case 0xc: // 2-byte messages case 0xd: *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); bytesOut += 2; break; @@ -300,30 +284,30 @@ int osd_midi_device_pm::read(uint8_t *pOut) case 0: // System Exclusive { *pOut++ = status; // this should be OK: the shortest legal sysex is F0 tt dd F7, I believe - *pOut++ = (rx_evBuf[msg].message>>8) & 0xff; - *pOut++ = (rx_evBuf[msg].message>>16) & 0xff; - uint8_t last = *pOut++ = (rx_evBuf[msg].message>>24) & 0xff; + *pOut++ = (m_evbuf[msg].message>>8) & 0xff; + *pOut++ = (m_evbuf[msg].message>>16) & 0xff; + uint8_t last = *pOut++ = (m_evbuf[msg].message>>24) & 0xff; bytesOut += 4; - rx_sysex = (last != MIDI_EOX); + m_rx_sysex = (last != MIDI_EOX); break; } case 7: // End of System Exclusive *pOut++ = status; bytesOut += 1; - rx_sysex = false; + m_rx_sysex = false; break; case 2: // song pos *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); - *pOut++ = Pm_MessageData2(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); + *pOut++ = Pm_MessageData2(m_evbuf[msg].message); bytesOut += 3; break; case 3: // song select *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); bytesOut += 2; break; @@ -336,8 +320,8 @@ int osd_midi_device_pm::read(uint8_t *pOut) default: *pOut++ = status; - *pOut++ = Pm_MessageData1(rx_evBuf[msg].message); - *pOut++ = Pm_MessageData2(rx_evBuf[msg].message); + *pOut++ = Pm_MessageData1(m_evbuf[msg].message); + *pOut++ = Pm_MessageData2(m_evbuf[msg].message); bytesOut += 3; break; } @@ -347,57 +331,64 @@ int osd_midi_device_pm::read(uint8_t *pOut) return bytesOut; } -void osd_midi_device_pm::write(uint8_t data) + +midi_output_pm::~midi_output_pm() +{ + if (m_stream) + Pm_Close(m_stream); +} + +void midi_output_pm::write(uint8_t data) { int bytes_needed = 0; PmEvent ev; ev.timestamp = 0; // use the current time -// printf("write: %02x (%d)\n", data, xmit_cnt); +// printf("write: %02x (%d)\n", data, m_xmit_cnt); // reject data bytes when no valid status exists - if ((last_status == 0) && !(data & 0x80)) + if ((m_last_status == 0) && !(data & 0x80)) { - xmit_cnt = 0; + m_xmit_cnt = 0; return; } - if (xmit_cnt >= 4) + if (m_xmit_cnt >= 4) { printf("MIDI out: packet assembly overflow, contact MAMEdev!\n"); return; } // handle sysex - if (last_status == MIDI_SYSEX) + if (m_last_status == MIDI_SYSEX) { -// printf("sysex: %02x (%d)\n", data, xmit_cnt); +// printf("sysex: %02x (%d)\n", data, m_xmit_cnt); // if we get a status that isn't sysex, assume it's system common if ((data & 0x80) && (data != MIDI_EOX)) { // printf("common during sysex!\n"); ev.message = Pm_Message(data, 0, 0); - Pm_Write(pmStream, &ev, 1); + Pm_Write(m_stream, &ev, 1); return; } - xmit_in[xmit_cnt++] = data; + m_xmit_in[m_xmit_cnt++] = data; // if EOX or 4 bytes filled, transmit 4 bytes - if ((xmit_cnt == 4) || (data == MIDI_EOX)) + if ((m_xmit_cnt == 4) || (data == MIDI_EOX)) { - ev.message = xmit_in[0] | (xmit_in[1]<<8) | (xmit_in[2]<<16) | (xmit_in[3]<<24); - Pm_Write(pmStream, &ev, 1); - xmit_in[0] = xmit_in[1] = xmit_in[2] = xmit_in[3] = 0; - xmit_cnt = 0; + ev.message = m_xmit_in[0] | (m_xmit_in[1]<<8) | (m_xmit_in[2]<<16) | (m_xmit_in[3]<<24); + Pm_Write(m_stream, &ev, 1); + m_xmit_in[0] = m_xmit_in[1] = m_xmit_in[2] = m_xmit_in[3] = 0; + m_xmit_cnt = 0; // printf("SysEx packet: %08x\n", ev.message); // if this is EOX, kill the running status if (data == MIDI_EOX) { - last_status = 0; + m_last_status = 0; } } @@ -405,33 +396,33 @@ void osd_midi_device_pm::write(uint8_t data) } // handle running status. don't allow system real-time messages to be considered as running status. - if ((xmit_cnt == 0) && (data & 0x80) && (data < 0xf8)) + if ((m_xmit_cnt == 0) && (data & 0x80) && (data < 0xf8)) { - last_status = data; + m_last_status = data; } - if ((xmit_cnt == 0) && !(data & 0x80)) + if ((m_xmit_cnt == 0) && !(data & 0x80)) { - xmit_in[xmit_cnt++] = last_status; - xmit_in[xmit_cnt++] = data; -// printf("\trunning status: [%d] = %02x, [%d] = %02x, last_status = %02x\n", xmit_cnt-2, last_status, xmit_cnt-1, data, last_status); + m_xmit_in[m_xmit_cnt++] = m_last_status; + m_xmit_in[m_xmit_cnt++] = data; +// printf("\trunning status: [%d] = %02x, [%d] = %02x, m_last_status = %02x\n", m_xmit_cnt-2, m_last_status, m_xmit_cnt-1, data, m_last_status); } else { - xmit_in[xmit_cnt++] = data; -// printf("\tNRS: [%d] = %02x\n", xmit_cnt-1, data); + m_xmit_in[m_xmit_cnt++] = data; +// printf("\tNRS: [%d] = %02x\n", m_xmit_cnt-1, data); } - if ((xmit_cnt == 1) && (xmit_in[0] == MIDI_SYSEX)) + if ((m_xmit_cnt == 1) && (m_xmit_in[0] == MIDI_SYSEX)) { // printf("Start SysEx!\n"); - last_status = MIDI_SYSEX; + m_last_status = MIDI_SYSEX; return; } // are we there yet? -// printf("status check: %02x\n", xmit_in[0]); - switch ((xmit_in[0]>>4) & 0xf) +// printf("status check: %02x\n", m_xmit_in[0]); + switch ((m_xmit_in[0]>>4) & 0xf) { case 0xc: // 2-byte messages case 0xd: @@ -439,7 +430,7 @@ void osd_midi_device_pm::write(uint8_t data) break; case 0xf: // system common - switch (xmit_in[0] & 0xf) + switch (m_xmit_in[0] & 0xf) { case 0: // System Exclusive is handled above break; @@ -464,11 +455,11 @@ void osd_midi_device_pm::write(uint8_t data) break; } - if (xmit_cnt == bytes_needed) + if (m_xmit_cnt == bytes_needed) { - ev.message = Pm_Message(xmit_in[0], xmit_in[1], xmit_in[2]); - Pm_Write(pmStream, &ev, 1); - xmit_cnt = 0; + ev.message = Pm_Message(m_xmit_in[0], m_xmit_in[1], m_xmit_in[2]); + Pm_Write(m_stream, &ev, 1); + m_xmit_cnt = 0; } } diff --git a/src/osd/modules/netdev/pcap.cpp b/src/osd/modules/netdev/pcap.cpp index d4d62bf68cfa9..77ca557f1de74 100644 --- a/src/osd/modules/netdev/pcap.cpp +++ b/src/osd/modules/netdev/pcap.cpp @@ -117,7 +117,7 @@ struct netdev_pcap_context class netdev_pcap : public osd_network_device { public: - netdev_pcap(const char *name, class network_handler &ifdev); + netdev_pcap(const char *name, network_handler &ifdev); ~netdev_pcap(); virtual int send(uint8_t *buf, int len) override; @@ -161,7 +161,7 @@ static void *netdev_pcap_blocker(void *arg) { } #endif -netdev_pcap::netdev_pcap(const char *name, class network_handler &ifdev) +netdev_pcap::netdev_pcap(const char *name, network_handler &ifdev) : osd_network_device(ifdev) { char errbuf[PCAP_ERRBUF_SIZE]; diff --git a/src/osd/modules/netdev/taptun.cpp b/src/osd/modules/netdev/taptun.cpp index eb6214231e4a9..a2953f33efc08 100644 --- a/src/osd/modules/netdev/taptun.cpp +++ b/src/osd/modules/netdev/taptun.cpp @@ -63,7 +63,7 @@ class taptun_module : public osd_module, public netdev_module class netdev_tap : public osd_network_device { public: - netdev_tap(const char *name, class network_handler &ifdev); + netdev_tap(const char *name, network_handler &ifdev); ~netdev_tap(); int send(uint8_t *buf, int len) override; @@ -85,7 +85,7 @@ class netdev_tap : public osd_network_device uint8_t m_buf[2048]; }; -netdev_tap::netdev_tap(const char *name, class network_handler &ifdev) +netdev_tap::netdev_tap(const char *name, network_handler &ifdev) : osd_network_device(ifdev) { #ifdef __linux__ diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index 8f1d86bc8163e..9824f16ebfe1c 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -20,12 +20,13 @@ #include #include #include +#include #include // forward references class input_type_entry; -class osd_midi_device; +namespace osd { class midi_input_port; class midi_output_port; } namespace ui { class menu_item; } @@ -93,28 +94,12 @@ class osd_interface // command option overrides virtual bool execute_command(const char *command) = 0; - // midi interface - virtual std::unique_ptr create_midi_device() = 0; + // MIDI interface + virtual std::unique_ptr create_midi_input(std::string_view name) = 0; + virtual std::unique_ptr create_midi_output(std::string_view name) = 0; protected: virtual ~osd_interface() { } }; - -/*************************************************************************** - MIDI I/O INTERFACES -***************************************************************************/ - -class osd_midi_device -{ -public: - virtual ~osd_midi_device() { } - virtual bool open_input(const char *devname) = 0; - virtual bool open_output(const char *devname) = 0; - virtual void close() = 0; - virtual bool poll() = 0; - virtual int read(uint8_t *pOut) = 0; - virtual void write(uint8_t data) = 0; -}; - #endif // MAME_OSD_OSDEPEND_H diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp index 20ac1cb059d6d..7fe2f7b2eb72f 100644 --- a/src/osd/osdnet.cpp +++ b/src/osd/osdnet.cpp @@ -108,30 +108,3 @@ const std::array &osd_network_device::get_mac() { return m_dev.get_mac(); } - -int netdev_count() -{ - return netdev_list.size(); -} - -void osd_list_network_adapters() -{ - #ifdef USE_NETWORK - int num_devs = netdev_list.size(); - - if (num_devs == 0) - { - printf("No network adapters were found\n"); - return; - } - - printf("Available network adapters:\n"); - for (auto &entry : netdev_list) - { - printf(" %s\n", entry->description); - } - - #else - printf("Network is not supported in this build\n"); - #endif -} diff --git a/src/osd/osdnet.h b/src/osd/osdnet.h index 21110e5372d5c..8b21c38d3957c 100644 --- a/src/osd/osdnet.h +++ b/src/osd/osdnet.h @@ -62,7 +62,5 @@ osd_network_device *open_netdev(int id, osd::network_handler &ifdev); void add_netdev(const char *name, const char *description, create_netdev func); void clear_netdev(); const std::vector>& get_netdev_list(); -int netdev_count(); -void osd_list_network_adapters(); #endif // MAME_OSD_OSDNET_H diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 387a7f6daba89..87467a7e06f28 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -31,10 +31,10 @@ #include "modules/monitor/monitor_common.h" -#define NOT_ALREADY_DOWN(x) (x & 0x40000000) == 0 +#define NOT_ALREADY_DOWN(x) ((x & 0x40000000) == 0) #define SCAN_CODE(x) ((x >> 16) & 0xff) -#define IS_EXTENDED(x) (0x01000000 & x) -#define MAKE_DI_SCAN(scan, isextended) (scan & 0x7f) | (isextended ? 0x80 : 0x00) +#define IS_EXTENDED(x) ((x >> 24) & 0x01) +#define MAKE_DI_SCAN(scan, isextended) ((scan & 0x7f) | (isextended ? 0x80 : 0x00)) #define WINOSD(machine) downcast(&machine.osd()) //============================================================ diff --git a/web/LICENSE b/web/LICENSE index be44e0d7eeae2..15cdcc869cf8c 100644 --- a/web/LICENSE +++ b/web/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 1997-2023, MAMEdev and contributors +Copyright (c) 1997-2024, MAMEdev and contributors All rights reserved. Redistribution and use in source and binary forms, with or without