diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index f6f924df6247f..4a6cecdfe0538 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -58,7 +58,7 @@ jobs: ARCHOPTS: ${{ matrix.archopts }} SUBTARGET: ${{ matrix.subtarget }} TOOLS: 1 - run: make -j2 + run: make -j3 - name: Validate run: ./${{ matrix.executable }} -validate - name: Reconcile driver list diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index c7d394838f1f9..fb9e44f0466ad 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -56,7 +56,7 @@ jobs: ARCHOPTS: "-fuse-ld=lld" SUBTARGET: ${{ matrix.subtarget }} TOOLS: 1 - run: make -j2 + run: make -j3 - name: Validate run: ./${{ matrix.executable }}.exe -validate - uses: actions/upload-artifact@master diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 37320df98a98c..fda98bb687e32 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/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst index fe093cc0d86f0..d83b401cc32cb 100644 --- a/docs/source/commandline/commandline-all.rst +++ b/docs/source/commandline/commandline-all.rst @@ -3677,8 +3677,9 @@ Debugging Options Acts as a remote debugging server for the GNU debugger (GDB). Only a small subset of the CPUs emulated by MAME are supported. Use the :ref:`debugger_port ` option to set the - listening port on the loopback interface. Supported on all platforms - with TCP socket support. + listening port and the + :ref:`debugger_host ` option to set the + address to bind to. Supported on all platforms with TCP socket support. Example: .. code-block:: bash @@ -3732,11 +3733,26 @@ Debugging Options mame ibm_5150 -watchdog 30 +.. _mame-commandline-debuggerhost: + +**-debugger_host** *
* + + Set the IP address to listen on to accept GDB connections when using the + GDB stub debugger module (see the + :ref:`debugger ` option). + + The default is ``localhost``. + + Example: + .. code-block:: bash + + mame rfjet -debug -debugger gdbstub -debugger_host 0.0.0.0 + .. _mame-commandline-debuggerport: **-debugger_port** ** - Set the TCP port number to listen on for GDB connections when using the GDB + Set the TCP port number to accept GDB connections on when using the GDB stub debugger module (see the :ref:`debugger ` option). diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst index c62dfef518bc2..cb6b9a7dfb4b8 100644 --- a/docs/source/commandline/commandline-index.rst +++ b/docs/source/commandline/commandline-index.rst @@ -298,6 +298,7 @@ Core Debugging Options | :ref:`debugscript ` | :ref:`[no]update_in_pause ` | :ref:`watchdog ` +| :ref:`debugger_host ` | :ref:`debugger_port ` | :ref:`debugger_font ` | :ref:`debugger_font_size ` diff --git a/docs/source/conf.py b/docs/source/conf.py index 63dd0bfed6a07..fbdcc2a092634 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = '0.268' +version = '0.269' # The full version, including alpha/beta/rc tags. -release = '0.268' +release = '0.269' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/hash/attache.xml b/hash/attache.xml index f5a8e92adca84..54353ae0bc8c0 100644 --- a/hash/attache.xml +++ b/hash/attache.xml @@ -3,7 +3,7 @@ - + CP/M 2.2.5 diff --git a/hash/bmjr_cass.xml b/hash/bmjr_cass.xml new file mode 100644 index 0000000000000..503050556b441 --- /dev/null +++ b/hash/bmjr_cass.xml @@ -0,0 +1,22 @@ + + + + + + + + + Wilwesp + 1984 + Micom BASIC + + + + + + + + + diff --git a/hash/bml3_cass.xml b/hash/bml3_cass.xml new file mode 100644 index 0000000000000..91ba77e878178 --- /dev/null +++ b/hash/bml3_cass.xml @@ -0,0 +1,20 @@ + + + + + + + BM Tetris + 1990 + Sakn Soft + + + + + + + + + diff --git a/hash/bml3_flop.xml b/hash/bml3_flop.xml index 79351487fbfdb..59c3e8f540580 100644 --- a/hash/bml3_flop.xml +++ b/hash/bml3_flop.xml @@ -3,7 +3,7 @@ - MA5370 + + MA-5370 Disk BASIC (Version 1.1) 19?? <unknown> + - + - Disk Basic and Utilities + Disk BASIC and Utilities 19?? <unknown> @@ -64,10 +67,14 @@ Compaibility flags: - - FCG6890 + + + FCG6890 19?? <unknown> + @@ -107,7 +114,7 @@ Compaibility flags: - + diff --git a/hash/c64_flop_orig.xml b/hash/c64_flop_orig.xml index a49278e1264b0..18cbf26720ce4 100644 --- a/hash/c64_flop_orig.xml +++ b/hash/c64_flop_orig.xml @@ -19,10 +19,13 @@ license:CC0-1.0 - + Barbarian: The Ultimate Warrior 1988 Melbourne House + @@ -34,6 +37,10 @@ license:CC0-1.0 Basil: The Great Mouse Detective 1987 Gremlin Graphics + @@ -42,10 +49,14 @@ license:CC0-1.0 - + Bionic Commando 1988 Capcom + @@ -58,6 +69,7 @@ license:CC0-1.0 Boulder Dash 1984 First Star + @@ -66,10 +78,15 @@ license:CC0-1.0 - + Bounty Bob Strikes Back! (v1.2) 1985 Big Five + @@ -82,22 +99,13 @@ license:CC0-1.0 - - Buddy System 64 v10 - 1992 - Chris Miller - - - - - - - - Commando 1985 Elite + @@ -110,6 +118,10 @@ license:CC0-1.0 Defender of the Crown 1987 Cinemaware + @@ -128,10 +140,28 @@ license:CC0-1.0 - + + + Elektra Glide + 1986 + Mastertronic + + + + + + + + + + Green Beret 1986 Ocean + @@ -152,6 +182,279 @@ license:CC0-1.0 + + Jack the Nipper + 1986 + Gremlin Graphics + + + + + + + + + + + + Miami Vice + 1986 + Ocean + + + + + + + + + + + + M.U.L.E. + 1983 + Electronic Arts + + + + + + + + + + Rambo: First Blood Part II + 1985 + Ocean + + + + + + + + + + + + Rambo: First Blood Part II (NTSC) + 1985 + Thunder Mountain + + + + + + + + + + + + Rambo III (PAL) + 1988 + Ocean + + + + + + + + + + + + + + + + + + + Rambo III (NTSC) + 1989 + Taito + + + + + + + + + + + Street Hassle + 1987 + Melbourne House + + + + + + + + + + + Strip Poker + 1984 + Artworx + + + + + + + + + + + Terramex + 1988 + Grand Slam + + + + + + + + + + + + + + + + + + + Turbo Out Run + 1989 + U.S. Gold + + + + + + + + + + + + + + + + + + + + + Game Set and Match + 1987 + Ocean + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BASIC-kääntäjä (Finland) + 1984 + Amersoft + + + + + + + + + + Buddy System 64 (v10) + 1992 + Chris Miller + + + + + + + + + + SuperBase 64 (Finland) + 1983 + Precision + + + + + + + + + + INPUT 64 10/86 1986 @@ -486,241 +789,8 @@ license:CC0-1.0 - - Jack the Nipper - 1986 - Gremlin Graphics - - - - - - - - - - - Miami Vice - 1986 - Ocean - - - - - - - - - - - M.U.L.E. - 1983 - Electronic Arts - - - - - - - - - - Rambo: First Blood Part II - 1985 - Ocean - - - - - - - - - - - Rambo: First Blood Part II (NTSC) - 1985 - Thunder Mountain - - - - - - - - - - - Rambo III - 1988 - Ocean - - - - - - - - - - - - - - - - - - Rambo III (NTSC) - 1989 - Taito - - - - - - - - - - - Street Hassle - 1987 - Melbourne House - - - - - - - - - - Strip Poker - 1984 - Artworx - - - - - - - - - - Terramex - 1988 - Grand Slam - - - - - - - - - - - - - - - - - - Turbo Out Run - 1989 - U.S. Gold - - - - - - - - - - - - - - - - - - - - Game Set and Match - 1987 - Ocean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BASIC-kääntäjä (Finland) - 1984 - Amersoft - - - - - - - - - - SuperBase 64 (Finland) - 1983 - Precision - - - - - - - - - - - Elektra Glide - 1986 - Mastertronic - - - - - - - - - KoalaPainter (Light Pen) diff --git a/hash/coleco.xml b/hash/coleco.xml index fcca8b4739894..0f7ff4c0f219c 100644 --- a/hash/coleco.xml +++ b/hash/coleco.xml @@ -1244,7 +1244,7 @@ license:CC0-1.0 - Pitstop (Euro, USA, Canada) + Pitstop (Europe, USA, Canada) 1983 Epyx @@ -2344,7 +2344,7 @@ license:CC0-1.0 - Victory (Euro) + Victory (Europe) 1983 CBS @@ -2567,7 +2567,7 @@ license:CC0-1.0 - Super Action Football (Euro) + Super Action Football (Europe) 1984 Coleco / CBS diff --git a/hash/coleco_homebrew.xml b/hash/coleco_homebrew.xml index 8429a4c0734ee..27d1cd54bbfae 100644 --- a/hash/coleco_homebrew.xml +++ b/hash/coleco_homebrew.xml @@ -1475,7 +1475,7 @@ Unoffical software releases for the Coleco Colecovision - Space Shuttle: A Journey Into Space (64k) + Space Shuttle: A Journey Into Space (64K) 2022 Team Pixelboy diff --git a/hash/ekara_cart.xml b/hash/ekara_cart.xml index 86f9698d508a8..b8febe8236bbc 100644 --- a/hash/ekara_cart.xml +++ b/hash/ekara_cart.xml @@ -9,6 +9,55 @@ license:CC0-1.0 + + + + + + + + + + + + Dream Cartridge: Best Artist Vol.7 (Japan) (DC0008-BAT) 2004 @@ -2493,6 +2570,18 @@ license:CC0-1.0 + + Kids' Song Mini Volume 6 (Japan) (MC0017-KSM) + 2003 + Takara + + + + + + + + @@ -3099,6 +3188,26 @@ license:CC0-1.0 + + + e-kara Web cartridge 8M (used, with 8 songs) (Japan) + 2003 + Takara + + + + + + + diff --git a/hash/evio.xml b/hash/evio.xml index 61c644b1222fb..5e82d65533daa 100644 --- a/hash/evio.xml +++ b/hash/evio.xml @@ -32,7 +32,62 @@ license:CC0-1.0 *eM17 - Minna no evio (orange) *eM18 - Evio Challenge! (red/pink) - (more?) + + + Cartridge Pinout + + A01|NC + A02|GND + A03|GND + A04|A16 + A05|A17 + A06|A18 + A07|A19 + A08|A20 + A09|A21 + A10|A22 + A11|A23 + A12|GND + A13|TO A18 + A14|/CE + A15|NC (SEEPROM 6) + A16|NC (SEEPROM 5) + A17|NC + A18|TO A13 (internal ROM /CE) + A19|/OE + A20|NC (/WE) + A21|VCC (/RP) + A22|D00 + A23|D01 + A24|D02 + A25|D03 + A26|VCC + B01|NC + B02|VCC + B03|VCC + B04|A15 + B05|A14 + B06|A13 + B07|A12 + B08|A11 + B09|A10 + B10|A09 + B11|A08 + B12|A07 + B13|A06 + B14|A05 + B15|A04 + B16|A03 + B17|A02 + B18|A01 + B19|A00 + B20|VCC + B21|GND + B22|D07 + B23|D06 + B24|D05 + B25|D04 + B26|GND --> diff --git a/hash/ibm5170_cdrom.xml b/hash/ibm5170_cdrom.xml index a138b03bc4dbd..3ebc05856a2f6 100644 --- a/hash/ibm5170_cdrom.xml +++ b/hash/ibm5170_cdrom.xml @@ -2151,6 +2151,19 @@ Has [SB16] lip-sync issues with ct486, may go down in requiring 75 MHz instead + + + Chex Quest + 1996 + General Mills + + + + + + + + @@ -2775,6 +2788,35 @@ Crash at the begining + + Demon Gate: 666 New Levels for Doom & Doom II + 1995 + Laser Magic + + + + + + + + + Depths of Doom Trilogy + 1997 + GT Interactive + + + + + + + + + + + + + + @@ -2937,12 +2979,40 @@ Crash after the copy protection screen (tried with "at486" machine) + + Doom II + 1994 + GT Interactive + + + + + + + + + + + + Doom II (French) + 1995 + GT Interactive + + + + + + + + + + - + Doom II for Windows 95 (Japan) 1996 - Id Software / Imagineer + id Software / Imagineer @@ -2951,6 +3021,43 @@ Crash after the copy protection screen (tried with "at486" machine) + + + Doom Collector's Edition + 2003 + Activision + + + + + + + + + + + + + + + + + + + Doom Collector's Edition (2001) + 2001 + Activision + + + + + + + + + @@ -3925,6 +4045,60 @@ Playable demos: "Gobliins 2", "Goblins 3", "Inca", "Lost", "Ween" + + Hell to Pay (Doom II add-on) + 1996 + WizardWorks + + + + + + + + + + + Heretic: Shadow of the Serpent Riders + 1996 + GT Interactive + + + + + + + + + + + + Hexen: Beyond Heretic + 1995 + GT Interactive + + + + + + + + + + + + Hexen: Deathkings of the Dark Citadel + 1996 + GT Interactive + + + + + + + + + @@ -4818,6 +4992,18 @@ https://www.pcgamingwiki.com/wiki/The_Adventures_of_Lomax + + Master Levels for Doom II + 1995 + GT Interactive + + + + + + + + The Curse of Monkey Island @@ -6035,6 +6221,34 @@ Includes DOS and Windows installation setup. + + Strife: Quest for the Sigil + 1996 + Velocity Incorporated + + + + + + + + + + + + Strife: Quest for the Sigil (v1.1) + 1996 + Velocity Incorporated + + + + + + + + + + @@ -6247,6 +6461,46 @@ Unemulated optional [Gravis Gamepad], [Gravis Gamepad Pro], [Gravis Grip 4-playe + + The Ultimate Doom (DOS + Windows) + 1995 + GT Interactive + + + + + + + + + + + The Ultimate Doom (DOS) + 1995 + GT Interactive + + + + + + + + + + + Doom Shareware + 1995 + GT Interactive + + + + + + + + + + diff --git a/hash/leapfrog_leappad_cart.xml b/hash/leapfrog_leappad_cart.xml index 81e3f2676e4de..a093848c7f60c 100644 --- a/hash/leapfrog_leappad_cart.xml +++ b/hash/leapfrog_leappad_cart.xml @@ -199,9 +199,9 @@ license:CC0-1.0 - + - FUN-damentals Series - Smart Guide to 4rd Grade (UK) + FUN-damentals Series - Smart Guide to 4th Grade (UK) 2002 LeapFrog @@ -212,7 +212,7 @@ license:CC0-1.0 - + FUN-damentals Series - Smart Guide to 5th Grade (UK) @@ -1149,7 +1149,7 @@ license:CC0-1.0 - + Okaasan to Issho: Goo Choco Lantan: Spoo no Fushigi na Oto no Daibouken! (Japan) 2002 @@ -1161,7 +1161,7 @@ license:CC0-1.0 - + Kuma no Pooh-san Hachimitsu no tsubo ga ippai Pooh-san to kazu·katachi (Japan) @@ -1179,7 +1179,7 @@ license:CC0-1.0 Disney's World of English 1: Birthday Fun (Japan) 200? - LeapFrog / Disney + LeapFrog / Disney diff --git a/hash/lk3000.xml b/hash/lk3000.xml index 9c3381ce08503..2a77cba46024d 100644 --- a/hash/lk3000.xml +++ b/hash/lk3000.xml @@ -25,6 +25,7 @@ LK-3100: English-Polish LK-3110: English-Portuguese LK-3120: English-Russian LK-3130: English-Greek +LK-3160: English-Japanese LK-3200: English-Spanish-French-German-Italian-Greek LK-3500: Electronic Notebook LK-3900: Calculator @@ -33,12 +34,11 @@ unreleased?: LK-3140: English-Arabic LK-3150: English-Hebrew -LK-3160: English-Japanese LK-3170: English-Chinese --> - + Calculator diff --git a/hash/mac_cdrom.xml b/hash/mac_cdrom.xml index 47b7239eae321..83a0dd4b76534 100644 --- a/hash/mac_cdrom.xml +++ b/hash/mac_cdrom.xml @@ -29,6 +29,29 @@ PPC750 - PowerPC 750 (G3) CPU + + + Chex Quest + 1996 + General Mills + + + + + + + + + Hexen: Beyond Heretic + 1995 + GT Interactive + + + + + + + System Software 7.0a9 ("Big Bang" pre-release) 1991 @@ -156,4 +179,15 @@ PPC750 - PowerPC 750 (G3) CPU + + The Ultimate Doom + 1995 + GT Interactive + + + + + + + diff --git a/hash/megadriv.xml b/hash/megadriv.xml index 92c4a24cc9988..d4916a0af231d 100644 --- a/hash/megadriv.xml +++ b/hash/megadriv.xml @@ -2381,6 +2381,7 @@ No [VDP] sprites Dune II - Kampf um den Wüstenplaneten (Germany) 1993 Virgin Interactive + @@ -3159,6 +3160,7 @@ Crashes after EA logo, requires better [VDP] irq handling Flashback (Europe, rev. A) 1993 U.S. Gold + @@ -3174,6 +3176,7 @@ Crashes after EA logo, requires better [VDP] irq handling Flashback - The Quest for Identity (USA) 1993 U.S. Gold + @@ -4504,6 +4507,7 @@ Moans about [Sega Mega Modem] not hooked up, punts to a red screen Kick Off 3 - European Challenge (Europe) 1994 Vic Tokai + @@ -4626,6 +4630,7 @@ Moans about [Sega Mega Modem] not hooked up, punts to a red screen 1993 Sega + @@ -4647,6 +4652,8 @@ Moans about [Sega Mega Modem] not hooked up, punts to a red screen Landstalker - Die Schätze von König Nolo (Germany) 1993 Sega + + @@ -4832,6 +4839,7 @@ Moans about [Sega Mega Modem] not hooked up, punts to a red screen The Lost Vikings (Europe) 1994 Interplay + @@ -5119,6 +5127,8 @@ Moans about [Sega Mega Modem] not hooked up, punts to a red screen Mega Lo Mania (France) 1992 Virgin Games + + @@ -6039,6 +6049,7 @@ Unsupported [Menacer] peripheral Olympic Gold (Europe) 1992 U.S. Gold + @@ -6056,6 +6067,7 @@ Unsupported [Menacer] peripheral + @@ -6584,6 +6596,7 @@ Unsupported [Menacer] peripheral Power Drive (Europe) 1994 U.S. Gold + @@ -6722,6 +6735,7 @@ Unsupported [Menacer] peripheral Psycho Pinball (Europe, 199409) 1994 Codemasters + @@ -7267,6 +7281,7 @@ Unsupported [Menacer] peripheral Sensible Soccer (Europe) 1993 Renegade + @@ -7290,6 +7305,7 @@ Unsupported [Menacer] peripheral 1994 Sony Imagesoft + @@ -7591,6 +7607,7 @@ Unsupported [Menacer] peripheral Soleil (Spain) 1994 Sega + @@ -7945,6 +7962,7 @@ Unsupported [Menacer] peripheral 1995 Sega + @@ -9097,6 +9115,8 @@ Unsupported [Menacer] peripheral Ultimate Soccer (Europe) 1993 Sega + + @@ -9324,6 +9344,7 @@ Unsupported [Menacer] peripheral Where in the World Is Carmen Sandiego? (Europe, USA) 1992 Electronic Arts + @@ -9394,6 +9415,7 @@ Unsupported [Menacer] peripheral Winter Olympics (Europe) 1994 U.S. Gold + @@ -9520,6 +9542,7 @@ Real player names based off Mexico '86 World Championship Soccer II (Europe) 1994 Sega + @@ -9569,6 +9592,7 @@ https://tcrf.net/World_Championship_Soccer_(Genesis) World Cup USA 94 (Europe, USA, Korea) 1994 U.S. Gold + @@ -9892,6 +9916,7 @@ https://tcrf.net/World_Championship_Soccer_(Genesis) Rugby World Cup 1995 (Europe, USA) 1994 Electronic Arts + @@ -10002,6 +10027,7 @@ Doesn't accept any input Soleil (France) 1994 Sega + @@ -10018,6 +10044,7 @@ Doesn't accept any input Soleil (Germany) 1994 Sega + @@ -10066,6 +10093,7 @@ Doesn't accept any input Psycho Pinball (Europe, 199410) 1994 Codemasters + @@ -12591,7 +12619,7 @@ https://bootleggames.fandom.com/wiki/Barver_Battle_Saga:_Tai_Kong_Zhan_Shi - Blaster Master 2 (USA, prototype) + Blaster Master 2 (USA, prototype 19930415) 1993 Sunsoft @@ -12903,6 +12931,17 @@ No [VDP] sprites + + Breach (prototype) + 1992? + <unknown> + + + + + + + Brett Hull Hockey '95 (USA) 1994 @@ -13371,7 +13410,7 @@ No [VDP] sprites Cave Story - Doukutsu Monogatari (v0.8.0, Portuguese-Brazil) 2022 Studio Pixel - + @@ -13464,7 +13503,7 @@ No [VDP] sprites - Centurion - Defender of Rome (Europe, prototype, 19910528) + Centurion - Defender of Rome (Europe, prototype 19910528) 1991 Electronic Arts @@ -13486,7 +13525,7 @@ No [VDP] sprites - Champions World Class Soccer (prototype) + Champions World Class Soccer (prototype 19940318) 1994 Flying Edge @@ -14276,7 +14315,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (Europe, prototype, 19950628) + Comix Zone (Europe, prototype 19950628) 1995 Sega @@ -14314,7 +14353,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (Europe, prototype, 19950712) + Comix Zone (Europe, prototype 19950712) 1995 Sega @@ -14325,7 +14364,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950601-B) + Comix Zone (USA, prototype 19950601-B) 1995 Sega @@ -14336,7 +14375,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950601-C) + Comix Zone (USA, prototype 19950601-C) 1995 Sega @@ -14347,7 +14386,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950601-D) + Comix Zone (USA, prototype 19950601-D) 1995 Sega @@ -14358,7 +14397,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950601) + Comix Zone (USA, prototype 19950601) 1995 Sega @@ -14369,7 +14408,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950602-B) + Comix Zone (USA, prototype 19950602-B) 1995 Sega @@ -14381,7 +14420,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950602) + Comix Zone (USA, prototype 19950602) 1995 Sega @@ -14393,7 +14432,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (USA, prototype, 19950603) + Comix Zone (USA, prototype 19950603) 1995 Sega @@ -14405,7 +14444,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (prototype, 19950526) + Comix Zone (prototype 19950526) 1995 Sega @@ -14417,7 +14456,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (prototype, 19950530) + Comix Zone (prototype 19950530) 1995 Sega @@ -14429,7 +14468,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (Korea, prototype, 19950609) + Comix Zone (Korea, prototype 19950609) 1995 Sega @@ -14441,7 +14480,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Comix Zone (Sega Channel, prototype, 19950612) + Comix Zone (Sega Channel, prototype 19950612) 1995 Sega @@ -14637,7 +14676,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940701) + Crystal's Pony Tale (USA, prototype 19940701) 1994 Sega @@ -14649,7 +14688,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940702) + Crystal's Pony Tale (USA, prototype 19940702) 1994 Sega @@ -14661,7 +14700,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940703) + Crystal's Pony Tale (USA, prototype 19940703) 1994 Sega @@ -14673,7 +14712,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940712-B) + Crystal's Pony Tale (USA, prototype 19940712-B) 1994 Sega @@ -14685,7 +14724,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940712) + Crystal's Pony Tale (USA, prototype 19940712) 1994 Sega @@ -14697,7 +14736,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940713) + Crystal's Pony Tale (USA, prototype 19940713) 1994 Sega @@ -14709,7 +14748,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940601) + Crystal's Pony Tale (USA, prototype 19940601) 1994 Sega @@ -14721,7 +14760,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940606) + Crystal's Pony Tale (USA, prototype 19940606) 1994 Sega @@ -14733,7 +14772,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940610) + Crystal's Pony Tale (USA, prototype 19940610) 1994 Sega @@ -14745,7 +14784,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940623) + Crystal's Pony Tale (USA, prototype 19940623) 1994 Sega @@ -14757,7 +14796,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940628) + Crystal's Pony Tale (USA, prototype 19940628) 1994 Sega @@ -14769,7 +14808,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940630) + Crystal's Pony Tale (USA, prototype 19940630) 1994 Sega @@ -14781,7 +14820,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940511) + Crystal's Pony Tale (USA, prototype 19940511) 1994 Sega @@ -14793,7 +14832,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940519) + Crystal's Pony Tale (USA, prototype 19940519) 1994 Sega @@ -14805,7 +14844,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Crystal's Pony Tale (USA, prototype, 19940526) + Crystal's Pony Tale (USA, prototype 19940526) 1994 Sega @@ -15382,7 +15421,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941206) + Desert Demolition (prototype 19941206) 1994 Sega @@ -15393,7 +15432,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941208) + Desert Demolition (prototype 19941208) 1994 Sega @@ -15404,7 +15443,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941212-B) + Desert Demolition (prototype 19941212-B) 1994 Sega @@ -15415,7 +15454,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941212) + Desert Demolition (prototype 19941212) 1994 Sega @@ -15426,7 +15465,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941213) + Desert Demolition (prototype 19941213) 1994 Sega @@ -15437,7 +15476,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941214) + Desert Demolition (prototype 19941214) 1994 Sega @@ -15448,7 +15487,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941215) + Desert Demolition (prototype 19941215) 1994 Sega @@ -15459,7 +15498,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941216) + Desert Demolition (prototype 19941216) 1994 Sega @@ -15470,7 +15509,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Desert Demolition (prototype, 19941219) + Desert Demolition (prototype 19941219) 1994 Sega @@ -15592,7 +15631,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Tom Mason's Dinosaurs for Hire (prototype, 19930426) + Tom Mason's Dinosaurs for Hire (prototype 19930426) 1993 Sega @@ -15603,7 +15642,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Tom Mason's Dinosaurs for Hire (prototype, 19930427) + Tom Mason's Dinosaurs for Hire (prototype 19930427) 1993 Sega @@ -15614,7 +15653,7 @@ https://bootleggames.fandom.com/wiki/Chaoji_Dafuweng - Tom Mason's Dinosaurs for Hire (prototype, 19930502) + Tom Mason's Dinosaurs for Hire (prototype 19930502) 1993 Sega @@ -15875,6 +15914,7 @@ Choppy timings during gameplay (btanb?) Dragon's Lair (USA, prototype) 199? Taito + @@ -16068,7 +16108,7 @@ Choppy timings during gameplay (btanb?) - Dynamite Headdy (prototype, 19940614-CABEZA) + Dynamite Headdy (prototype 19940614-CABEZA) 1994 Sega @@ -16091,7 +16131,7 @@ Choppy timings during gameplay (btanb?) - Dynamite Headdy (prototype, 19940616) + Dynamite Headdy (prototype 19940616) 1994 Sega @@ -16102,7 +16142,7 @@ Choppy timings during gameplay (btanb?) - Dynamite Headdy (prototype, 19940622) + Dynamite Headdy (prototype 19940622) 1994 Sega @@ -16172,6 +16212,18 @@ Choppy timings during gameplay (btanb?) + + Earthworm Jim (USA, prototype 19940728) + 1994 + Playmates Interactive + + + + + + + + Earthworm Jim 2 (USA) 1996 @@ -16184,6 +16236,18 @@ Choppy timings during gameplay (btanb?) + + Earthworm Jim 2 (Europe, prototype 19950824) + 1995 + Playmates Interactive + + + + + + + + Ecco the Dolphin (Japan) 1993 @@ -16411,6 +16475,7 @@ https://segaretro.org/Elitserien_95 https://segaretro.org/Elitserien_96 ]]> + @@ -16459,7 +16524,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940418) + Escape from Mars Starring Taz (prototype 19940418) 1994 Sega @@ -16471,7 +16536,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940602) + Escape from Mars Starring Taz (prototype 19940602) 1994 Sega @@ -16483,7 +16548,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940607) + Escape from Mars Starring Taz (prototype 19940607) 1994 Sega @@ -16495,7 +16560,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940610) + Escape from Mars Starring Taz (prototype 19940610) 1994 Sega @@ -16507,7 +16572,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940614) + Escape from Mars Starring Taz (prototype 19940614) 1994 Sega @@ -16519,7 +16584,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940618-A) + Escape from Mars Starring Taz (prototype 19940618-A) 1994 Sega @@ -16531,7 +16596,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940620) + Escape from Mars Starring Taz (prototype 19940620) 1994 Sega @@ -16543,7 +16608,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940309) + Escape from Mars Starring Taz (prototype 19940309) 1994 Sega @@ -16555,7 +16620,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940509) + Escape from Mars Starring Taz (prototype 19940509) 1994 Sega @@ -16567,7 +16632,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940518) + Escape from Mars Starring Taz (prototype 19940518) 1994 Sega @@ -16579,7 +16644,7 @@ https://segaretro.org/Elitserien_96 - Escape from Mars Starring Taz (prototype, 19940523) + Escape from Mars Starring Taz (prototype 19940523) 1994 Sega @@ -16703,7 +16768,7 @@ https://segaretro.org/Elitserien_96 - Eternal Champions (Japan, prototype, 19931117) + Eternal Champions (Japan, prototype 19931117) 1994 Sega @@ -17432,6 +17497,7 @@ https://segaretro.org/Feng_Shen_Ying_Jie_Chuan + @@ -17443,6 +17509,7 @@ https://segaretro.org/Feng_Shen_Ying_Jie_Chuan Flashback (prototype 19920918) 1992 U.S. Gold + @@ -17454,6 +17521,7 @@ https://segaretro.org/Feng_Shen_Ying_Jie_Chuan Flashback - The Quest for Identity (USA, alt) 1993 U.S. Gold + @@ -18924,6 +18992,7 @@ Unemulated [Sega Mega Modem] features + @@ -20191,6 +20260,7 @@ Unsupported [Justifier] peripheral (joypad works) The Lost Vikings (Europe, prototype) 1993 Interplay + @@ -20202,6 +20272,7 @@ Unsupported [Justifier] peripheral (joypad works) The Lost Vikings (USA) 1994 Interplay + @@ -22401,7 +22472,7 @@ No [EEPROM] save - NBA Jam (Apr 1993 prototype) + NBA Jam (prototype 199304xx) 1993 Arena @@ -23427,6 +23498,7 @@ Unemulated [Sega Mega Modem] features Olympic Gold (USA) 1992 U.S. Gold + @@ -23633,8 +23705,19 @@ Black screen at intro - Out of the Vortex (prototype) - 199? + Out of the Vortex (prototype 19950913) + 1995 + <unknown> + + + + + + + + + Out of the Vortex (prototype 19950710) + 1995 <unknown> @@ -24144,6 +24227,7 @@ Black screen at intro Phantasy Star II (Brazil) 199? Tec Toy + @@ -24277,6 +24361,7 @@ Black screen at intro Phantasy Star III - Generations of Doom (Brazil) 1998 Tec Toy + @@ -25033,6 +25118,7 @@ Black screen Psycho Pinball (prototype) 1994 Codemasters + @@ -26022,7 +26108,7 @@ Red screen - Road Riot 4WD (prototype, 19930719) + Road Riot 4WD (prototype 19930719) 1993 Tengen @@ -27067,6 +27153,7 @@ https://segaretro.org/Shi_Jie_Zhi_Bang_Zheng_Ba_Zhan:_World_Pro_Baseball_94 Show do Milhão (Brazil) 2001 Tec Toy + @@ -27079,6 +27166,7 @@ https://segaretro.org/Shi_Jie_Zhi_Bang_Zheng_Ba_Zhan:_World_Pro_Baseball_94 Show do Milhão Volume 2 (Brazil) 2002 Tec Toy + @@ -27091,6 +27179,7 @@ https://segaretro.org/Shi_Jie_Zhi_Bang_Zheng_Ba_Zhan:_World_Pro_Baseball_94 Show do Milhão Volume 2 (Brazil, alt) 2002 Tec Toy + @@ -27352,6 +27441,7 @@ https://bootleggames.fandom.com/wiki/Shui_Hu_Feng_Yun_Zhuan Soleil (Europe) 1994 Sega + @@ -27367,6 +27457,7 @@ https://bootleggames.fandom.com/wiki/Shui_Hu_Feng_Yun_Zhuan Crusader of Centy (USA) 1994 Atlus + @@ -27385,6 +27476,7 @@ https://bootleggames.fandom.com/wiki/Shui_Hu_Feng_Yun_Zhuan + @@ -27401,6 +27493,7 @@ https://bootleggames.fandom.com/wiki/Shui_Hu_Feng_Yun_Zhuan 1994 Sega + @@ -27412,6 +27505,7 @@ https://bootleggames.fandom.com/wiki/Shui_Hu_Feng_Yun_Zhuan Ragnacenty (Korea) 1994 Sega + @@ -27694,7 +27788,7 @@ Black screen, writes in ROM area then jumps to PC=1a2000 (encryption?) - Sonic Spinball (Aug 1993 prototype) + Sonic Spinball (prototype 199308xx) 1993 Sega @@ -28722,7 +28816,7 @@ Freezes at the start of any in-game mode - Steel Talons (USA, prototype, 199206xx) + Steel Talons (USA, prototype 199206xx) 1992 Tengen The Story of Thor (Germany) 1995 Sega + @@ -28841,6 +28936,7 @@ Freezes at the start of any in-game mode The Story of Thor (Korea) 1995 Sega + @@ -28901,6 +28997,7 @@ Freezes at the start of any in-game mode The Story of Thor (Spain) 1995 Sega + @@ -29027,7 +29124,7 @@ Freezes at the start of any in-game mode - Street Smart (prototype, 19900629) + Street Smart (prototype 19900629) 1991 Treco @@ -30794,6 +30891,7 @@ No BGMs Tintin au Tibet (Europe) 1995 Infogrames + @@ -30806,6 +30904,7 @@ No BGMs Tintin au Tibet (Europe, prototype) 1995 Infogrames + @@ -32276,6 +32375,7 @@ No BGMs Where in the World Is Carmen Sandiego? (Brazil) 199? Tec Toy + @@ -32287,6 +32387,7 @@ No BGMs Where in Time Is Carmen Sandiego? (Europe, USA) 1992 Electronic Arts + @@ -32298,6 +32399,7 @@ No BGMs Where in Time Is Carmen Sandiego? (Brazil) 199? Tec Toy + @@ -32410,6 +32512,7 @@ No BGMs + @@ -32421,6 +32524,7 @@ No BGMs Winter Olympic Games (USA) 1993 U.S. Gold + @@ -32496,8 +32600,9 @@ No BGMs Turma da Mônica na Terra dos Monstros (Brazil) - 1996 + 1994 Tec Toy + @@ -32526,6 +32631,7 @@ Unsupported Mega-CD/Wondermega cart allowing EBXA format to be played back World Championship Soccer II (USA) 1994 Sega + @@ -34165,6 +34271,7 @@ Black screen Yu Yu Hakusho - Sunset Fighters (Brazil) 199? Tec Toy + @@ -34839,7 +34946,7 @@ https://bootleggames.fandom.com/wiki/Super_Bubble_Bobble_MD - Super Donkey Kong 99 (Protected) + Super Donkey Kong 99 (protected) 199? <unlicensed> @@ -35171,6 +35278,7 @@ https://bootleggames.fandom.com/wiki/Super_Bubble_Bobble_MD Ultimate Soccer (Europe, prototype) 199? <unknown> + @@ -35731,6 +35839,7 @@ Unsupported lightgun or mouse? 199? <unknown> + @@ -36113,9 +36222,10 @@ BGM sometimes goes silent (does several [YM2612] 68k writes without bus) - Rick Dangerous (Russia) - 199? - <unknown> + Rick Dangerous + 2011 + Pascal-O-Rama + @@ -36206,6 +36316,7 @@ https://segaretro.org/Shin_Samurai_Spirits_Haohmaru_Jigokuhen https://bootleggames.fandom.com/wiki/SpongeBob_SquarePants ]]> + @@ -36461,6 +36572,18 @@ Jumps to invalid address, needs own slot type with mountable carts + + Pro Version Action Replay (Europe) + 1992 + Datel + + + + + + + + Pro Action Replay 2 (Europe) 1994 diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index 5ded8f9d40285..bbc3f370f58d1 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -17798,18 +17798,17 @@ legacy FM implementations cannot find it. - - + X & Y (Arab) 1987 Al Alamiah - - + + - - - + + + @@ -19247,6 +19246,18 @@ legacy FM implementations cannot find it. + + The 4 Masters of Melody + 2019 + Clube MSX + + + + + + + + Ace Gun 2020 @@ -19566,6 +19577,18 @@ legacy FM implementations cannot find it. + + The Battle on Gojo Ohashi + 2020 + Matra + + + + + + + + Battlot 2021 @@ -21835,6 +21858,18 @@ legacy FM implementations cannot find it. + + Ghost + 2017 + Matra + + + + + + + + Gniffel 2004 @@ -24516,6 +24551,18 @@ legacy FM implementations cannot find it. + + Prisoner of War + 2018 + Matra + + + + + + + + PSGed (v0.82b) 2010 diff --git a/hash/msx2_cart.xml b/hash/msx2_cart.xml index 7d4c787d4b757..bf9a2574e2b69 100644 --- a/hash/msx2_cart.xml +++ b/hash/msx2_cart.xml @@ -3969,6 +3969,19 @@ LZ93A13 (32 pin) - 8KB banks + + Ark-A-Noah + 2014 + Matra + + + + + + + + + Barbarian the Duel 2019 diff --git a/hash/nes.xml b/hash/nes.xml index b63eff1aa383e..b44e458364600 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -24626,6 +24626,25 @@ license:CC0-1.0 + + Micro Mages + 2019 + Morphcat Games + + + + + + + + + + + + + + + Might and Magic - Book One - Secret of the Inner Sanctum (Japan) 1990 @@ -45963,6 +45982,57 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + D-Pad Hero (version 1.0) + 2009 + D-Pad Hero Team + + + + + + + + + + + + + + + D-Pad Hero (version 1.1) + 2009 + D-Pad Hero Team + + + + + + + + + + + + + + + D-Pad Hero II + 2010 + D-Pad Hero Team + + + + + + + + + + + + + Dr. Mario (prototype, alt 2) 1990 @@ -79584,6 +79654,22 @@ be better to redump them properly. --> + + 8-bit Xmas 2023 + 2023 + retroUSB + + + + + + + + + + + + 8Bit Music Power 2016 diff --git a/hash/nes_kstudio.xml b/hash/nes_kstudio.xml index 3929fc0c251cf..741181c3b5b0d 100644 --- a/hash/nes_kstudio.xml +++ b/hash/nes_kstudio.xml @@ -7,7 +7,7 @@ license:CC0-1.0 - Karaoke Studio - Senyou Cassette - Top Hit 20 Vol. 1 (Jpn) + Karaoke Studio - Senyou Cassette - Top Hit 20 Vol. 1 (Japan) 1987 Bandai @@ -22,7 +22,7 @@ license:CC0-1.0 - Karaoke Studio - Senyou Cassette - Top Hit 20 Vol. 2 (Jpn) + Karaoke Studio - Senyou Cassette - Top Hit 20 Vol. 2 (Japan) 1988 Bandai diff --git a/hash/nes_ntbrom.xml b/hash/nes_ntbrom.xml index 51519b0363688..309bf34c90604 100644 --- a/hash/nes_ntbrom.xml +++ b/hash/nes_ntbrom.xml @@ -6,7 +6,7 @@ license:CC0-1.0 - Nantettatte!! Baseball '91 Kaimaku Hen (Jpn) + Nantettatte!! Baseball '91 Kaimaku Hen (Japan) 1991 Sunsoft @@ -20,7 +20,7 @@ license:CC0-1.0 - Nantettatte!! Baseball OB Allstar Hen (Jpn) + Nantettatte!! Baseball OB Allstar Hen (Japan) 1991 Sunsoft diff --git a/hash/pv1000.xml b/hash/pv1000.xml index 22885a5bf5f65..ff9de22bce1ef 100644 --- a/hash/pv1000.xml +++ b/hash/pv1000.xml @@ -19,8 +19,8 @@ Undumped carts: - - + + @@ -32,8 +32,8 @@ Undumped carts: - - + + @@ -45,8 +45,8 @@ Undumped carts: - - + + @@ -58,8 +58,8 @@ Undumped carts: - - + + @@ -71,8 +71,8 @@ Undumped carts: - - + + @@ -84,8 +84,8 @@ Undumped carts: - - + + @@ -97,8 +97,8 @@ Undumped carts: - - + + @@ -110,8 +110,8 @@ Undumped carts: - - + + @@ -123,8 +123,8 @@ Undumped carts: - - + + @@ -136,8 +136,8 @@ Undumped carts: - - + + @@ -149,8 +149,8 @@ Undumped carts: - - + + @@ -162,8 +162,8 @@ Undumped carts: - - + + @@ -175,8 +175,8 @@ Undumped carts: - - + + diff --git a/hash/pv2000.xml b/hash/pv2000.xml index c2c1ae949c5ff..27597313d8c0a 100644 --- a/hash/pv2000.xml +++ b/hash/pv2000.xml @@ -18,9 +18,9 @@ No known undumped carts - - - + + + @@ -30,8 +30,8 @@ No known undumped carts 1983 Casio / Taito - - + + @@ -41,8 +41,8 @@ No known undumped carts 1981 Casio / Namco - - + + @@ -52,8 +52,8 @@ No known undumped carts 1983 Casio - - + + @@ -63,8 +63,8 @@ No known undumped carts 1982 Casio - - + + @@ -74,8 +74,8 @@ No known undumped carts 1982 Casio / Namco - - + + @@ -87,9 +87,9 @@ No known undumped carts - - - + + + @@ -99,8 +99,8 @@ No known undumped carts 1983 Casio / Konami - - + + @@ -110,8 +110,8 @@ No known undumped carts 198? Casio - - + + @@ -121,8 +121,8 @@ No known undumped carts 1981 Casio - - + + @@ -135,8 +135,8 @@ No known undumped carts - - + + @@ -148,9 +148,9 @@ No known undumped carts - - - + + + diff --git a/hash/samcoupe_flop.xml b/hash/samcoupe_flop.xml index f1287313701d2..90011ccaa73b2 100644 --- a/hash/samcoupe_flop.xml +++ b/hash/samcoupe_flop.xml @@ -26,7 +26,7 @@ license:CC0-1.0 - Manic Miner (2 Level Demo) + Manic Miner (2 level demo) 1991 Revelation Software / Software Projects @@ -80,6 +80,17 @@ license:CC0-1.0 + + Boggle Bubble + 1992 + Silver Sword Software + + + + + + + Castle 1991 @@ -92,7 +103,7 @@ license:CC0-1.0 - Defenders Of The Earth + Defenders of the Earth 1990 Enigma Variations @@ -151,6 +162,17 @@ license:CC0-1.0 + + Hexagonia + 1991 + Revelation Software + + + + + + + Lemmings 1993 @@ -184,18 +206,6 @@ license:CC0-1.0 - - Rick Dangerous - 2021 - D.T.A. Software Studio - - - - - - - - Sam Strikes Out! 1990 @@ -252,6 +262,87 @@ license:CC0-1.0 + + WaterWorks + 1993 + FRED Publishing + + + + + + + + + Wop Gamma (pre-release version) + 1993 + Revelation Software + + + + + + + + + + + + Dave Infuriators + 2012 + Black Jet + + + + + + + + + Dave Invaders + 2012 + Black Jet + + + + + + + + + Lost Disks of Sam + 2012 + Black Jet + + + + + + + + + Moby DX + 2012 + Black Jet + + + + + + + + + Rick Dangerous + 2021 + D.T.A. Software Studio + + + + + + + + Street Fighter 1 2017 diff --git a/hash/smc777.xml b/hash/smc777.xml index 2783db77fcd03..bcc5d1d7969d8 100644 --- a/hash/smc777.xml +++ b/hash/smc777.xml @@ -132,7 +132,7 @@ Known to be dumped, but no longer available: (If you do have any of these please A・E --> - + diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index 6778d86690d92..b2122f5006358 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -335,7 +335,8 @@ license:CC0-1.0 Aqua Plane 1983 - Quicksilva / J.Hollis + Quicksilva + @@ -346,7 +347,8 @@ license:CC0-1.0 Aquaplane (ZX Data) 1983 - ZX Data / J.Hollis + ZX Data + @@ -380,6 +382,19 @@ license:CC0-1.0 + + Astor Musica + 1985 + Astor Software + + + + + + + + + Astor Roleta 1986 @@ -967,7 +982,7 @@ license:CC0-1.0 Alien 8 (Ricochet) 1985 - Ultimate / Ricochet + Ricochet @@ -1101,7 +1116,7 @@ license:CC0-1.0 Alien Syndrome (RAD) 1988 - ACE Software / RAD + RAD @@ -1117,7 +1132,7 @@ license:CC0-1.0 Alien Syndrome (Dro Soft) 1988 - ACE Software / Dro Soft + Dro Soft @@ -1557,7 +1572,7 @@ license:CC0-1.0 - + Arkanoid (set 2, Erbe) 1987 Erbe Software @@ -1569,7 +1584,7 @@ license:CC0-1.0 - + Arkanoid (set 3, Erbe) 1988 Erbe Software @@ -1581,7 +1596,7 @@ license:CC0-1.0 - + Arkanoid (set 4, The Hit Squad) 1990 The Hit Squad @@ -1605,7 +1620,7 @@ license:CC0-1.0 - + (The Last) Arkanoid (mod) 1987 Luís Esteves / Paulo Sousa @@ -1618,13 +1633,11 @@ license:CC0-1.0 - + (The Last) Arkanoid (dual, mod) 1987 Luís Esteves / Paulo Sousa - + Run on TC 2048 or ZX Spectrum @@ -5907,8 +5920,6 @@ no loading screen, no custom loader - - Cauldron (with The Evil Dead) 1985 @@ -5920,7 +5931,7 @@ no loading screen, no custom loader - + @@ -5930,7 +5941,7 @@ no loading screen, no custom loader Cauldron (Silverbird) 1985 - Palace Software / Silverbird + Silverbird Software @@ -5939,9 +5950,10 @@ no loading screen, no custom loader - Cauldron II + Cauldron II: The Pumpkin Strikes Back 1986 Palace Software + @@ -5956,10 +5968,11 @@ no loading screen, no custom loader - - Cauldron II (Silverbird) - 19?? - Palace Software / Silverbird + + Cauldron II: The Pumpkin Strikes Back (Silverbird) + 1986 + Silverbird Software + @@ -5967,10 +5980,11 @@ no loading screen, no custom loader - - Cauldron 2 (Erbe) + + Cauldron II: La Calabaza Contra Ataca (Erbe) 1986 - Palace Software / Erbe + Erbe Software + @@ -5978,7 +5992,7 @@ no loading screen, no custom loader - + Cauldron II (French) 1986 Palace Software @@ -6783,6 +6797,7 @@ no loading screen, no custom loader Chaos 1985 Games Workshop + @@ -6790,10 +6805,11 @@ no loading screen, no custom loader - + Chaos (Firebird) 1985 - Games Workshop / Firebird + Firebird Software + @@ -6801,6 +6817,18 @@ no loading screen, no custom loader + + Chaos (Aackosoft) + 1985 + Aackosoft + + + + + + + + Captain Slog 1986 @@ -7666,7 +7694,7 @@ no loading screen, no custom loader David el Gnomo 1985 Ariola Eurodisc S.A. - + @@ -11422,7 +11450,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Flight Joystick (pirate) + Flight Joystick (Nuova Newel, pirate) 1983 Nuova Newel Software @@ -11432,6 +11460,18 @@ Expects you to press a key after the title screen appears, or it will miss the n + + Simulador de Voo (Groupi, pirate) + 198? + Groupi + + + + + + + + Flight Simulator 1983 @@ -11668,7 +11708,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Gulpman (Aackosoft) 1982 Aackosoft @@ -11679,7 +11719,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Gulpman (Profisoft) 1982 Profisoft @@ -11690,7 +11730,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Gulpman (Micromega) 1983 Micromega @@ -11701,7 +11741,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Comilão (Timex) 1983 Timex Portugal @@ -12071,7 +12111,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Ghostbusters (Spectrum Vision) 1984 - Activision Inc / Spectrum Vision + Spectrum Vision @@ -12330,7 +12370,7 @@ Expects you to press a key after the title screen appears, or it will miss the n GBA Championship Basketball (Winner) 1987 - Gamestar (Activision) / Winner + Winner @@ -12358,7 +12398,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Gee Bee Air Rally (Proein) 1988 - Activision / Proein + Proein Soft Line @@ -12374,7 +12414,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Gee-Bee Air Rally (Winner) 1988 - Activision / Winner + Winner @@ -12707,7 +12747,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Galletron (Dro Soft) 1987 - Bulldog Software / Dro Soft + Dro Soft @@ -12889,8 +12929,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Gilligan's Gold (set 2) - 19?? - <unknown> + 1984 + Ocean @@ -12899,7 +12939,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Gift From The Gods (set 1) + Gift from the Gods (set 1) 1984 Ocean @@ -12915,9 +12955,9 @@ Expects you to press a key after the title screen appears, or it will miss the n - Gift From The Gods (set 2) - 19?? - <unknown> + Gift from the Gods (set 2) + 1984 + Ocean @@ -12926,7 +12966,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Gift From The Gods (loading screen hack) + Gift from the Gods (loading screen hack) 19?? hack @@ -12937,7 +12977,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Gift From The Gods (loading screen hack, MAC) + Gift from the Gods (loading screen hack, MAC) 19?? hack @@ -12958,7 +12998,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Green Beret (Erbe, small case) 1986 Erbe Software @@ -12969,7 +13009,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Green Beret (Erbe, medium case) 1986 Erbe Software @@ -12980,7 +13020,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - + Green Beret (The Hit Squad) 1989 The Hit Squad @@ -12993,8 +13033,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Green Beret (set 4) - 19?? - <unknown> + 1986 + Imagine Software @@ -13220,8 +13260,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Hyper Sports (set 6) - 19?? - <unknown> + 1985 + Imagine @@ -13441,9 +13481,9 @@ Expects you to press a key after the title screen appears, or it will miss the n - Howard The Duck (Alternative) + Howard the Duck (Alternative) 1987 - Activision Inc / Alternative + Alternative @@ -13452,9 +13492,9 @@ Expects you to press a key after the title screen appears, or it will miss the n - Howard The Duck (Hello! Games) + Howard the Duck (Hello! Games) 1987 - Activision Inc / Hello! Games + Hello! Games @@ -13510,7 +13550,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Horacio Gloton (Investronica) 1982 - Sinclair Research Ltd / Investronica + Investronica + @@ -13544,6 +13585,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Horacio Esquiador 1983 Investronica + @@ -13552,7 +13594,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Horace And The Spiders + Horace and the Spiders 1983 Sinclair Research @@ -13563,9 +13605,10 @@ Expects you to press a key after the title screen appears, or it will miss the n - Horacio Y Las Aranas (Investronica) + Horacio y las Aranas (Investronica) 1983 - Sinclair Research Ltd / Investronica + Investronica + @@ -13745,7 +13788,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Hacker 2 + Hacker II: The Doomsday Papers 1987 Activision @@ -13756,7 +13799,7 @@ Expects you to press a key after the title screen appears, or it will miss the n - Hacker 2 (Mastertronic) + Hacker II: The Doomsday Papers (Mastertronic) 1987 Mastertronic @@ -14089,7 +14132,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Helter Skelter (System 4) 1991 - Audiogenic Software Ltd / System 4 + System 4 @@ -14099,8 +14142,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Highway Encounter (set 1) - 19?? - <unknown> + 1985 + Vortex Software @@ -14115,8 +14158,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Highway Encounter (set 2) - 19?? - <unknown> + 1985 + Vortex Software @@ -14131,8 +14174,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Highway Encounter (set 3) - 19?? - <unknown> + 1985 + Vortex Software @@ -14142,8 +14185,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Heartland (set 1) - 19?? - <unknown> + 1986 + Odin Computer Graphics @@ -14153,8 +14196,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Heartland (set 2) - 19?? - <unknown> + 1986 + Odin Computer Graphics @@ -14175,8 +14218,8 @@ Expects you to press a key after the title screen appears, or it will miss the n Highlander (set 2) - 19?? - <unknown> + 1986 + Ocean @@ -14568,7 +14611,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Impact (Audiogenic) 1988 - Audiogenic Software Ltd + Audiogenic Software @@ -14579,7 +14622,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Impact (EDOS) 1988 - Audiogenic Software Ltd / EDOS + EDOS @@ -14634,7 +14677,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Ikari Warriors (Encore) 1988 - Elite Systems / Encore + Encore @@ -14645,7 +14688,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Ikari Warriors (MCM) 1988 - Elite Systems Ltd / MCM + MCM Software @@ -16390,7 +16433,7 @@ Side B: Laser Shoot (original release) Kokotoni Wilf (MCM) 1984 - Elite Systems Ltd / MCM + MCM Software @@ -16423,7 +16466,7 @@ Side B: Laser Shoot (original release) Kung-Fu Master (set 3, Dro Soft - Seleccion Mastertronic) 1986 - U.S. Gold Ltd / Dro Soft / Mastertronic + Dro Soft / Mastertronic @@ -16433,8 +16476,8 @@ Side B: Laser Shoot (original release) Kung-Fu Master (set 4) - 19?? - <unknown> + 1986 + U.S. Gold @@ -19087,8 +19130,8 @@ Side B: Laser Shoot (original release) Match Day (The Hit Squad, alternate) - 19?? - <unknown> + 1990 + The Hit Squad @@ -19292,7 +19335,7 @@ Side B: Laser Shoot (original release) - Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (English, set 1) + Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (English, TZX tape image) 2012 The Mojon Twins @@ -19304,9 +19347,9 @@ Side B: Laser Shoot (original release) - Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (English, set 2) - 19?? - <unknown> + Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (English, TAP tape image) + 2012 + The Mojon Twins @@ -19316,7 +19359,7 @@ Side B: Laser Shoot (original release) - Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (Spanish, set 1) + Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (Spanish, TZX tape image) 2012 The Mojon Twins @@ -19328,7 +19371,7 @@ Side B: Laser Shoot (original release) - Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (Spanish, set 2) + Maritrini, Freelance Monster Slayer en: Las Increibles Vicisitudes de Despertarse Resacosa con Fred en la Cama y Tener que Llegar Mas o Menos Puntual a la Prueba de "Monstruos Vigorosos de Pechos Lustrosos" featuring Los Fratelli (Spanish, TAP tape image) 2012 The Mojon Twins @@ -20109,10 +20152,10 @@ Side B: Laser Shoot (original release) - + N.O.M.A.D. (set 2) - 19?? - <unknown> + 1985 + Ocean @@ -20120,6 +20163,17 @@ Side B: Laser Shoot (original release) + + N.O.M.A.D. (Erbe) + 1985 + Erbe Software + + + + + + + Nemesis (set 1) 1987 @@ -24124,11 +24178,10 @@ Side B: Laser Shoot (original release) - R-Type (MCM) 1988 - Electric Dreams Software / MCM + MCM Software @@ -25616,7 +25669,6 @@ Side B: Laser Shoot (original release) - Supertrux 1988 @@ -27363,11 +27415,10 @@ Side B: Laser Shoot (original release) - Star Wars Droids (Dro Soft) 1988 - Mastertronic Added Dimension / Dro Soft + Dro Soft @@ -41287,7 +41338,7 @@ Side B - 9 - Confusion (original release) - + 10th Frame (Kixx) 1988 Kixx @@ -41298,7 +41349,7 @@ Side B - 9 - Confusion (original release) - + 10th Frame (Erbe) 1987 Erbe Software @@ -42494,8 +42545,8 @@ Side B - 9 - Confusion (original release) 4 Games For Children - 19?? - <unknown> + 1984 + Kindersoft @@ -42798,7 +42849,7 @@ Side B - 9 - Confusion (original release) 8 Multi-Track Composer Program 19?? - <unknown> + Jellinghouse Musik Systeme @@ -43211,20 +43262,20 @@ Side B: Once Upon a Lily Pad - A Picture of Innocence (Central Solutions) + A Picture of Innocence 1986 - Central Solutions + G. Turner - - + + A Picture of Innocence (set 2) - 19?? - <unknown> + 1986 + G. Turner @@ -43232,19 +43283,19 @@ Side B: Once Upon a Lily Pad - - A Picture of Innocence - 19?? - <unknown> + + A Picture of Innocence (Central Solutions) + 1986 + Central Solutions - - + + - A Question of Scruples (set 1, 128k) + A Question of Scruples (128K) 1987 Leisure Genius @@ -43255,7 +43306,7 @@ Side B: Once Upon a Lily Pad - A Question of Scruples (set 2, 48k) + A Question of Scruples (48K) 1987 Leisure Genius @@ -43337,8 +43388,8 @@ Side B: Once Upon a Lily Pad A Simple Guide To Using Computers - 19?? - <unknown> + 1984 + Benn Computer Consultants @@ -43387,7 +43438,7 @@ Side B: Once Upon a Lily Pad A Tall Tale 19?? - <unknown> + Tavis Reddick @@ -43616,8 +43667,9 @@ Side B: Once Upon a Lily Pad Aackotax 83 - 19?? - <unknown> + 198? + Aackosoft + @@ -43855,23 +43907,23 @@ Side B: Once Upon a Lily Pad - Accelerator (Mind Games España) - 1985 - Mind Games España + Accelerator + 1984 + Century City Software - - + + - - Accelerator - 19?? - <unknown> + + Accelerator (Mind Games España) + 1985 + Mind Games España - - + + @@ -44577,7 +44629,7 @@ Side B: Once Upon a Lily Pad Adultia - 19?? + 1987 <unknown> @@ -44880,8 +44932,8 @@ Side B: Once Upon a Lily Pad Africa Gardens - 19?? - <unknown> + 1984 + Gilsoft International @@ -44892,7 +44944,7 @@ Side B: Once Upon a Lily Pad After Shock (set 2) 1986 - Interceptor + Interceptor Software @@ -44902,8 +44954,8 @@ Side B: Once Upon a Lily Pad After Shock - 19?? - <unknown> + 1986 + Interceptor Software @@ -44972,8 +45024,8 @@ Side B: Once Upon a Lily Pad Aftermath (Alternative) - 19?? - <unknown> + 1988 + Alternative Software @@ -44981,10 +45033,10 @@ Side B: Once Upon a Lily Pad - - Aftermath - 19?? - <unknown> + + Aftermath (within "Spectrum Computing 18") + 1985 + Spectrum Computing @@ -45115,8 +45167,8 @@ Side B: Once Upon a Lily Pad Ah Diddums (set 2) - 19?? - <unknown> + 1983 + Imagine Software @@ -45126,8 +45178,8 @@ Side B: Once Upon a Lily Pad Ah Diddums - 19?? - <unknown> + 1983 + Imagine Software @@ -45181,8 +45233,8 @@ Side B: Once Upon a Lily Pad Air Traffic Control (set 2) - 19?? - <unknown> + 1984 + Mikro-Gen @@ -45192,8 +45244,8 @@ Side B: Once Upon a Lily Pad Air Traffic Control - 19?? - <unknown> + 1984 + Mikro-Gen @@ -45430,8 +45482,9 @@ Side B: Once Upon a Lily Pad Albert The Wolf - 19?? - <unknown> + 2014 + Gabriele Amore + @@ -45507,9 +45560,9 @@ Side B: Once Upon a Lily Pad - Alien Attack (R D Foord Software) + Alien Attack (R.D. Foord) 1984 - R.D. Foord + R.D. Foord Software @@ -45517,10 +45570,10 @@ Side B: Once Upon a Lily Pad - - Alien Attack - 19?? - <unknown> + + Alien Attack (A.C.E.) + 1983 + A.C.E. @@ -45529,7 +45582,7 @@ Side B: Once Upon a Lily Pad - Alien City (set 2) + Alien City Adventure (type-in, Big K № 2 - May 1984, set 2) 1987 Pirate Computing @@ -45540,9 +45593,9 @@ Side B: Once Upon a Lily Pad - Alien City - 19?? - <unknown> + Alien City Adventure (type-in, Big K № 2 - May 1984, set 1) + 1987 + Pirate Computing @@ -45563,8 +45616,10 @@ Side B: Once Upon a Lily Pad Alien Curse - 19?? - <unknown> + 1984 + Profisoft + + @@ -45663,20 +45718,9 @@ Side B: Once Upon a Lily Pad - Alien Swarm (K-Tel) - 1983 - K-Tel Productions - - - - - - - - Alien Swarm - 19?? - <unknown> + 1982 + Titan programs @@ -45707,23 +45751,23 @@ Side B: Once Upon a Lily Pad - All in a Day's Work (set 2) - 19?? - <unknown> + All in a Day's Work + 1996 + Zenobi Software - - + + - All in a Day's Work + All in a Day's Work (without loading screen) 1996 Zenobi Software - - + + @@ -45777,10 +45821,10 @@ Side B: Once Upon a Lily Pad - + All Time Great Tour (2) - 19?? - <unknown> + 1992 + Lambourne Games @@ -46009,8 +46053,8 @@ Side B: Once Upon a Lily Pad Amateur Radio Log Book (set 2) - 19?? - <unknown> + 1984 + Technical Software @@ -46020,8 +46064,8 @@ Side B: Once Upon a Lily Pad Amateur Radio Log Book - 19?? - <unknown> + 1984 + Technical Software @@ -46198,10 +46242,11 @@ Side B: Once Upon a Lily Pad - - Amnesia v1.02 - English + + Amnesia (v1.02, English) 2015 Huelvy + @@ -46209,10 +46254,24 @@ Side B: Once Upon a Lily Pad - - Amnesia - 19?? - <unknown> + + Amnesia (v1.02, Spanish) + 2015 + Huelvy + + + + + + + + + + Amnesia (v1.0, Spanish) + 2015 + Huelvy + + @@ -46668,8 +46727,8 @@ Side B: Once Upon a Lily Pad Animal Anagrams - 19?? - <unknown> + 1983 + Image Systems @@ -46802,7 +46861,7 @@ Side B: Once Upon a Lily Pad Answer Back Factfile 500 - Natural History 1985 - Kosmos + Kosmos Software @@ -46815,10 +46874,10 @@ Side B: Once Upon a Lily Pad - + Answer Back Factfile 500 - Spelling - 19?? - <unknown> + 1985 + Kosmos Software @@ -46831,10 +46890,10 @@ Side B: Once Upon a Lily Pad - + Answer Back Junior - 19?? - <unknown> + 1985 + Kosmos Software @@ -46886,34 +46945,34 @@ Side B: Once Upon a Lily Pad - Anttilis Mission (set 1) + The Anttilis Mission (master tape) 1992 - Compass + Compass Software - - + + - Anttilis Mission (set 2) - 19?? - <unknown> + The Anttilis Mission (set 1) + 1992 + Compass Software - - + + - - Anttilis Mission (Mastering Tape) - 19?? - <unknown> + + The Anttilis Mission (set 2) + 1992 + Compass Software - - + + @@ -47136,8 +47195,8 @@ Side B: Once Upon a Lily Pad Apple Jam - 19?? - <unknown> + 1984 + DK'Tronics @@ -47420,25 +47479,9 @@ Side B: Once Upon a Lily Pad - Arcade Trivia Quiz + Arcade Trivia Quiz (master tape) 1989 Zeppelin Games - - - - - - - - - - - - - - Arcade Trivia Quiz (Mastering Tape) - 19?? - <unknown> @@ -47456,6 +47499,22 @@ Side B: Once Upon a Lily Pad + + Arcade Trivia Quiz + 1989 + Zeppelin Games + + + + + + + + + + + + Arcadia 1982 @@ -47551,10 +47610,31 @@ Side B: Once Upon a Lily Pad - Alien Swarm & Arena! + Alien Swarm & Arena! (set 1) 1983 K-Tel Productions - + + + + + + + + + + + + + + Alien Swarm & Arena! (set 2) + 1983 + K-Tel Productions + + + + + + @@ -47586,7 +47666,7 @@ Side B: Once Upon a Lily Pad Arena (set 2, Bug-Byte) 1985 - MC Lothlorien Ltd / Bug-Byte + Bug-Byte @@ -47598,6 +47678,7 @@ Side B: Once Upon a Lily Pad Ari (German) 19?? <unknown> + @@ -47696,24 +47777,24 @@ Side B: Once Upon a Lily Pad - - Arnhem (Juegos Y Estrategia) + + Arnhem: The 'Market Garden' Operation 1985 - Juegos & Estrategia + CCS - - + + - - Arnhem + + Arnhem: Operación «Market Garden» 1985 - CCS + Juegos & Estrategia - - + + @@ -47785,10 +47866,10 @@ Side B: Once Upon a Lily Pad - - Arrow of Death Part I (set 3, Channel 8) + + Arrow of Death Part I (Channel 8) 1983 - Digital Fantasia / Channel 8 + Channel 8 Software @@ -47822,7 +47903,7 @@ Side B: Once Upon a Lily Pad Arrow of Death Part II (Channel 8) 1983 - Digital Fantasia / Channel 8 + Channel 8 Software @@ -50092,17 +50173,6 @@ Side B: Once Upon a Lily Pad - - Balle de Match - 1984 - Psion - - - - - - - Ballistik 19?? @@ -56562,14 +56632,16 @@ Side B: Once Upon a Lily Pad Car Race - 19?? - <unknown> + 1983 + Winters + + @@ -68140,29 +68212,29 @@ Side A doesn't work. - - Dingo - 2015 Edition - 19?? - <unknown> + + Dingo (2015 Edition, v1.3) + 2016 + Tardis Remakes - - + + - - Dingo v1.3 + + Dingo (2015 Edition, v1.3, alt) 2016 Tardis Remakes - - + + - + Dingo 2011 Tardis Remakes @@ -76113,11 +76185,13 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Ficheiro Astor - 19?? + 198? Astor Software + + @@ -76125,6 +76199,20 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) + + Ficheiro Astor (cracked) + 198? + Astor Software + + + + + + + + + + Fichesprit 19?? @@ -78604,7 +78692,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Frog Hopper (Dixons) 1984 Dixons @@ -78671,7 +78759,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Froggy (set 1, release 2) + Froggy (release 2) 1983 DJL Software Ltd @@ -78687,7 +78775,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Froggy (set 2, release 1) + Froggy (release 1) 1983 DJL Software Ltd @@ -78698,20 +78786,20 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - From Out of a Dark Night Sky (set 3) - 19?? - <unknown> + From Out of a Dark Night Sky + 1989 + Zenobi Software - - + + From Out of a Dark Night Sky (set 2) - 19?? - <unknown> + 1989 + Zenobi Software @@ -78720,34 +78808,36 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - From Out of a Dark Night Sky - 19?? - <unknown> + From Out of a Dark Night Sky (set 3) + 1989 + Zenobi Software - - + + - Front-Line + Frontline (master tape) 1988 Zeppelin Games + - - + + - - Front-Line (Mastering Tape) - 19?? - <unknown> + + Frontline + 1988 + Zeppelin Games + - - + + @@ -78796,7 +78886,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Frost Byte (Micro Value) 1986 Micro Value @@ -78807,7 +78897,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Frost Byte (PIM Software) 19?? PIM Software @@ -78818,7 +78908,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Frost Byte (Erbe) 1986 Erbe Software @@ -78829,7 +78919,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Frost Byte (Erbe - Serie Leyenda) 1986 IBSA @@ -78989,7 +79079,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fuddo and Slam - Release 1 + Fuddo and Slam (release 1) 1988 Zenobi Software @@ -79088,7 +79178,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fun School 2 For The Under-6s (set 1) + Fun School 2 For The Under-6s 1989 Database Educational @@ -79104,9 +79194,9 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fun School 2 For The Under-6s (set 2, The Hit Squad) - 19?? - <unknown> + Fun School 2 For The Under-6s (The Hit Squad) + 1989 + The Hit Squad @@ -79120,7 +79210,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fun School 2 For 6-8 Year Olds (set 1) + Fun School 2 For 6-8 Year Olds 1989 Database Educational @@ -79136,9 +79226,9 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fun School 2 For 6-8 Year Olds (set 2, The Hit Squad) + Fun School 2 For 6-8 Year Olds (The Hit Squad) 19?? - <unknown> + The Hit Squad @@ -79270,23 +79360,23 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Fun To Learn (Currys) - 1986 - Currys + Fun to Learn + 1984 + Shards Software - + - - Fun To Learn - 19?? - <unknown> + + Fun to Learn (Currys) + 1986 + Currys - + @@ -79331,7 +79421,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus (German) 2013 Alessandro Grussu @@ -79344,7 +79434,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus (Spanish) 2013 Alessandro Grussu @@ -79357,7 +79447,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus (Italian) 2013 Alessandro Grussu @@ -79370,7 +79460,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus (Portuguese) 2013 Alessandro Grussu @@ -79383,7 +79473,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (German) 2013 Alessandro Grussu @@ -79396,7 +79486,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (English) 2013 Alessandro Grussu @@ -79409,7 +79499,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (Spanish) 2013 Alessandro Grussu @@ -79422,7 +79512,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (French) 2013 Alessandro Grussu @@ -79435,7 +79525,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (Italian) 2013 Alessandro Grussu @@ -79448,7 +79538,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Funky Fungus v1.1 (Portuguese) 2013 Alessandro Grussu @@ -79563,8 +79653,9 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) Futarposta - 19?? - <unknown> + 1986 + Novotrade Rt. + @@ -79649,7 +79740,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Future Knight (Erbe - Serie Leyenda) 1986 IBSA @@ -79660,7 +79751,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Future Knight (Erbe, medium case) 1986 Erbe Software @@ -79671,7 +79762,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Future Knight (Erbe, small case) 1986 Erbe Software @@ -79683,33 +79774,33 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Future Tense (set 2) + Future Tense 1987 - Mystic + Mystic Software - - + + - - + + - Future Tense - 19?? - <unknown> + Future Tense (set 2) + 1987 + Mystic Software - - + + - - + + @@ -80311,23 +80402,23 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Galactians (Prism) + Galactians 1983 - PRISM Micro-informatique + DK'Tronics - - + + - - Galactians - 19?? - <unknown> + + Galactians (Prism) + 1983 + PRISM Micro-informatique - - + + @@ -80335,7 +80426,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) Galactic Abductors 1983 - Anirog + Anirog Software @@ -80343,10 +80434,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Galactic Abductors (Aackosoft) - 19?? - <unknown> + 1983 + Aackosoft @@ -80355,9 +80446,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Raptores De La Galaxia (Investronica) - 19?? - <unknown> + Raptores de la Galaxia (Investronica) + 1983 + Investronica + @@ -80365,6 +80457,18 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) + + Raptores de la Galaxia (Microbyte) + 1987 + Microbyte + + + + + + + + Galactic Gambler 1985 @@ -80388,15 +80492,17 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Galactic Jailbreak & Snake - 19?? - <unknown> + Galactic Jailbreak + Snake + 1983 + Apocalypse Software + + @@ -80425,10 +80531,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Galactic Patrol (Omega) - 19?? - <unknown> + 1984 + Omega Software @@ -80617,10 +80723,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Galivan (set 2) - 19?? - <unknown> + 1986 + Imagine Software @@ -80628,6 +80734,17 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) + + Galivan (Erbe) + 1986 + Erbe Software + + + + + + + Gallilee 1984 @@ -80738,7 +80855,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gangsters! (CCS) 1983 CCS @@ -80820,7 +80937,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gary Lineker's Hot Shot! (Kixx) 1988 Kixx @@ -80842,7 +80959,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gary Lineker's Super Star Soccer (Kixx) 1987 Gremlin Graphics Software Ltd / Kixx @@ -80898,23 +81015,23 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Gates of Garralon (set 2) + Gates of Garralon 1984 Steven Cox - - + + - Gates of Garralon - 19?? - <unknown> + Gates of Garralon (set 2) + 1984 + Steven Cox - - + + @@ -81043,7 +81160,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gauntlet III: The Final Quest (Erbe) 1991 Erbe Software @@ -81147,7 +81264,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gem Chaser 2 2013 Bob's Stuff @@ -81158,10 +81275,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gem Chaser - 19?? - <unknown> + 2013 + Bob's Stuff @@ -81185,7 +81302,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gemini Wing (Tronix) 1989 Tronix @@ -81201,7 +81318,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gemini Wing (Dro Soft) 1989 Dro Soft @@ -81217,7 +81334,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gemini Wing (Mastertronic Plus) 1989 Mastertronic Plus @@ -81326,23 +81443,23 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Geoff Capes Strong Man (Ricochet) + Geoff Capes Strong Man 1985 - Ricochet + Martech Games - - + + - - Geoff Capes Strong Man - 19?? - <unknown> + + Geoff Capes Strong Man (Ricochet) + 1985 + Ricochet - - + + @@ -81396,7 +81513,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Geografia de Portugal (Avlisoft, prototype 1) 1985 Avlisoft @@ -81409,7 +81526,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Geografia de Portugal (Avlisoft, prototype 2) 1985 Avlisoft @@ -81466,7 +81583,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gerry the Germ (PIM Software) 1985 PIM Software @@ -81596,23 +81713,23 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Ghoul Manor (Gilsoft) + Ghoul Manor 1984 - Gilsoft International + Britannia Software - - + + - - Ghoul Manor - 19?? - <unknown> + + Ghoul Manor (Gilsoft) + 1984 + Gilsoft International - - + + @@ -81639,7 +81756,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + G.I. Hero (MCM) 1988 MCM Software @@ -81976,10 +82093,10 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - - Go Kart Simulator - Pre Production Sample - 19?? - <unknown> + + Pro Go Kart Simulator (pre production sample) + 1990 + Zeppelin Games @@ -82036,7 +82153,7 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - + Gehen Sie in das Gefängnis 1983 Wicosoft @@ -82170,8 +82287,8 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) Gold (release 1) - 19?? - <unknown> + 1983 + Hilderbay @@ -82181,8 +82298,8 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) Gold (release 2) - 19?? - <unknown> + 1983 + Hilderbay @@ -82294,20 +82411,20 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - Golden Baton (Channel 8) + Golden Baton 1983 - Channel 8 + Digital Fantasia - - + + Golden Baton (set 3) - 19?? - <unknown> + 1983 + Digital Fantasia @@ -82317,8 +82434,8 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) Golden Baton (set 2) - 19?? - <unknown> + 1983 + Digital Fantasia @@ -82326,13 +82443,13 @@ Side B - Game 1: The Dragonstar Trilogy Part III (Delta 4 Software) - - Golden Baton - 19?? - <unknown> + + Golden Baton (Channel 8) + 1983 + Channel 8 - - + + @@ -82471,7 +82588,7 @@ Tape 1 - Side B: Goldwood 19?? - <unknown> + Xcellent Software @@ -82678,7 +82795,7 @@ Tape 1 - Side B: Good Questions - Lawbreaking 1987 - MNL + MNL Software @@ -82686,10 +82803,10 @@ Tape 1 - Side B: - + Good Questions - Lifeskills - 19?? - <unknown> + 1987 + MNL Software @@ -82697,10 +82814,10 @@ Tape 1 - Side B: - + Good Questions - Relationships - 19?? - <unknown> + 1987 + MNL Software @@ -82856,20 +82973,20 @@ Tape 1 - Side B: - Graham Gooch's Test Cricket (Alternative) + Graham Gooch's Test Cricket 1986 - Alternative Software + Audiogenic Software - - + + - Graham Gooch's Test Cricket - 1986 Version - 19?? - <unknown> + Graham Gooch's Test Cricket (1986 Version) + 1986 + Audiogenic Software @@ -82877,21 +82994,21 @@ Tape 1 - Side B: - - Graham Gooch's Test Cricket - 19?? - <unknown> + + Graham Gooch's Test Cricket (Alternative) + 1986 + Alternative Software - - + + Graham Mason's Hack Pack - 19?? - <unknown> + 1989 + Graham Mason @@ -82932,10 +83049,32 @@ Tape 1 - Side B: - + + Grand National (Elite) + 1985 + Elite Systems + + + + + + + + + Grand National (ABC) + 1985 + ABC Soft + + + + + + + + Grand National (Encore) - 19?? - <unknown> + 1985 + Encore @@ -82943,7 +83082,7 @@ Tape 1 - Side B: - + Grand National (Zafiro) 19?? <unknown> @@ -82954,32 +83093,33 @@ Tape 1 - Side B: - - Grand National (set 2) - 19?? - <unknown> + + Grand National (Zafi Chip) + 1985 + Zafi Chip - - + + - - Grand National - 19?? - <unknown> + + Grand National (alt) + 1985 + Elite Systems - - + + - Grand Prix (ITD BBB) - 19?? + Grand Prix ITD BBB + 1988 <unknown> + @@ -82998,7 +83138,7 @@ Tape 1 - Side B: - + Grand Prix Circuit (Dro Soft) 1990 Dro Soft @@ -83250,7 +83390,7 @@ Tape 1 - Side B: Gravely Manor 19?? - <unknown> + R.D. Foord Software @@ -83441,7 +83581,7 @@ Tape 1 - Side B: - + Gremlins - The Adventure (Erbe) 1985 Erbe Software @@ -83458,7 +83598,7 @@ Tape 1 - Side B: - + Gremlins - The Adventure (German) 1985 Adventure International @@ -83482,7 +83622,7 @@ Tape 1 - Side B: - + Gremlins 2: La Nueva Generacion 1990 Topo Soft @@ -83617,21 +83757,15 @@ Tape 1 - Side B: - Gridmaster - Part 1 + Gridmaster 1983 Procom - + - - - - Gridmaster - Part 2 - 19?? - <unknown> - + @@ -83639,9 +83773,22 @@ Tape 1 - Side B: + Gridrunner + 1983 + Quicksilva + + + + + + + + + Gridrunner (ZX Data) 1983 ZX Data + @@ -83649,13 +83796,14 @@ Tape 1 - Side B: - - Gridrunner - 19?? - <unknown> + + Gridrunner (Century) + 1983 + Century Software + - - + + @@ -83683,9 +83831,10 @@ Tape 1 - Side B: - Groucho (Side A only) + My Name is Uncle Groucho... You Win a Fat Cigar (Side A only) 1983 Automata UK + @@ -85106,10 +85255,10 @@ Tape 1 - Side B: - - Hack Pack - 19?? - <unknown> + + Hack Pack (Nightshift) + 1987 + Nightshift @@ -85122,11 +85271,10 @@ Tape 1 - Side B: - Hacking Software - 19?? - <unknown> + 1990 + Jon North @@ -85139,10 +85287,10 @@ Tape 1 - Side B: - + Hacking Software Backup - 19?? - <unknown> + 1990 + Jon North @@ -85157,8 +85305,8 @@ Tape 1 - Side B: Hacking Utilities - 19?? - <unknown> + 1990 + Jon North @@ -85182,7 +85330,7 @@ Tape 1 - Side B: - + Hades Nebula (set 2, Game Busters) 1987 Game Busters @@ -85193,7 +85341,7 @@ Tape 1 - Side B: - + Hades Nebula (set 3, MCM) 1987 MCM Software @@ -85460,31 +85608,31 @@ Tape 1 - Side B: - Handy Andy (Omega) - 1985 - Omega + Handy Andy + 1984 + CRL Group - - + + - - Handy Andy - 19?? - <unknown> + + Handy Andy (Omega) + 1985 + Omega - - + + - Hangman - v1 (R D Foord Software) + Hangman (v1, R.D. Foord) 1988 - R.D. Foord + R.D. Foord Software @@ -85493,9 +85641,9 @@ Tape 1 - Side B: - Hangman - v2 (R D Foord Software) - 19?? - <unknown> + Hangman (v2, R.D. Foord) + 1988 + R.D. Foord Software @@ -85526,7 +85674,7 @@ Tape 1 - Side B: - Hansel And Gretel + Hansel and Gretel 1984 Arrow @@ -85642,31 +85790,30 @@ Tape 1 - Side B: - - Hardball (Kixx) + Hardball! 1986 - Kixx + Advance Software Promotions - + - - Hardball - 19?? - <unknown> + + Hardball! (Kixx) + 1986 + Kixx - + - Hareraiser - Finale + Hareraiser: Finale 1984 Haresoft @@ -85677,9 +85824,9 @@ Tape 1 - Side B: - Hareraiser - Prelude - 19?? - <unknown> + Hareraiser: Prelude + 1984 + Haresoft @@ -85698,7 +85845,6 @@ Tape 1 - Side B: - Harry Goes Home 1984 @@ -85766,9 +85912,9 @@ Tape 1 - Side B: - Haunted Hedges (set 3, Dixons) + Haunted Hedges (Dixons) 1983 - Micromega / Dixons + Dixons @@ -85872,8 +86018,8 @@ Tape 1 - Side B: Head Coach (set 2, Paxman) - 19?? - <unknown> + 1986 + Paxman Promotions @@ -85927,8 +86073,8 @@ Tape 1 - Side B: Header Reader (Medsoft) - 19?? - <unknown> + 1984 + Medsoft @@ -86022,6 +86168,7 @@ Tape 1 - Side B: Heathrow International Air Traffic Control 1984 Hewson Consultants + @@ -86037,7 +86184,8 @@ Tape 1 - Side B: Schiphol Luchtverkeersleider 1984 - Hewson Consultants Ltd / MCN Software + MCN Software + @@ -86046,9 +86194,9 @@ Tape 1 - Side B: - Heatloss + Domestic Heatloss Calculator 19?? - <unknown> + Warmastyle @@ -86078,20 +86226,9 @@ Tape 1 - Side B: - Heavy On The Magick (Rebound) + Heavy on the Magick 1986 - Rebound - - - - - - - - - Heavy On The Magick - 19?? - <unknown> + Gargoyle Games @@ -86104,6 +86241,17 @@ Tape 1 - Side B: + + Heavy on the Magick (Rebound) + 1986 + Rebound + + + + + + + Hectic Electric 1984 @@ -86139,8 +86287,9 @@ Tape 1 - Side B: Helespont - 19?? - <unknown> + 1984 + Amisin + @@ -86173,7 +86322,7 @@ Tape 1 - Side B: Hellfire (ABC Soft) 1985 - Melbourne House / ABC Soft + ABC Soft @@ -86240,23 +86389,23 @@ Tape 1 - Side B: - Helvera - Mistress of the Park (Adventure Probe) + Helvera: Mistress of the Park 1993 - Adventure Probe Software + FSF Adventures - - + + - - Helvera - Mistress of the Park - 19?? - <unknown> + + Helvera: Mistress of the Park (Adventure Probe) + 1993 + Adventure Probe Software - - + + @@ -86484,29 +86633,29 @@ Tape 1 - Side B: - Here Comes The Sun (Dixons) + Here Comes the Sun 1983 - Dixons + Alligata Software - + - - Here Comes The Sun - 19?? - <unknown> + + Here Comes the Sun (Dixons) + 1983 + Dixons - + - Here & There With The Mr Men + Here & There with the Mr. Men 1985 Mirrorsoft @@ -86820,20 +86969,20 @@ Tape 2: Hero Quest: Return of the Witch Lord - High Noon (Abbex) + High Noon (Work Force) 1983 - Abbex Electronics + Work Force - - + + - + High Noon (Profisoft) - 19?? - <unknown> + 1983 + Profisoft @@ -86841,13 +86990,13 @@ Tape 2: Hero Quest: Return of the Witch Lord - - High Noon (Work Force) - 19?? - <unknown> + + High Noon (Abbex) + 1983 + Abbex Electronics - - + + @@ -86978,8 +87127,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft BASIC Compiler v1.1 - 19?? - <unknown> + 1987 + HiSoft @@ -87188,8 +87337,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4 v1.3 - 19?? - <unknown> + 1984 + HiSoft @@ -87199,8 +87348,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4S - 19?? - <unknown> + 1984 + HiSoft @@ -87210,8 +87359,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4T v1.3 - 19?? - <unknown> + 1984 + HiSoft @@ -87221,8 +87370,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4T v1.5M - 19?? - <unknown> + 1984 + HiSoft @@ -87232,8 +87381,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4T v1.6M - 19?? - <unknown> + 1984 + HiSoft @@ -87243,8 +87392,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4T v1.7M Turtle Graphics - 19?? - <unknown> + 1984 + HiSoft @@ -87254,8 +87403,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal 4T v1.7M - 19?? - <unknown> + 1984 + HiSoft @@ -87265,8 +87414,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal Turtle (set 2) - 19?? - <unknown> + 1984 + HiSoft @@ -87276,8 +87425,8 @@ Tape 2: Hero Quest: Return of the Witch Lord HiSoft Pascal Turtle - 19?? - <unknown> + 1984 + HiSoft @@ -87394,9 +87543,9 @@ Tape 2: Hero Quest: Return of the Witch Lord - HL ZX Forth - 2nd Version - 19?? - <unknown> + HL ZX Forth (2nd version) + 1983 + Mike Hampson @@ -87454,23 +87603,23 @@ Tape 2: Hero Quest: Return of the Witch Lord - Hocus Focus (Bug-Byte) + Hocus Focus 1986 - Bug-Byte Software + Quicksilva - - + + - - Hocus Focus - 19?? - <unknown> + + Hocus Focus (Bug-Byte) + 1986 + Bug-Byte Software - - + + @@ -87623,8 +87772,8 @@ Tape 2: Hero Quest: Return of the Witch Lord Homicide Hotel (+D bugfix) (The Guild) - 19?? - <unknown> + 1987 + The Guild @@ -87644,9 +87793,10 @@ Tape 2: Hero Quest: Return of the Witch Lord - Honey Assembler v2.1 (set 2) + Spectrum Assembly Language Course v2.1 (set 2) 1985 Glentop Publishers + @@ -87660,9 +87810,10 @@ Tape 2: Hero Quest: Return of the Witch Lord - Honey Assembler - 19?? - <unknown> + Spectrum Assembly Language Course + 1985 + Glentop Publishers + @@ -87845,7 +87996,7 @@ Tape 2: Hero Quest: Return of the Witch Lord - + Horizontes (Investronica) 1983 Investronica @@ -87905,8 +88056,8 @@ Tape 2: Hero Quest: Return of the Witch Lord - - Horse Racing Analyser - 1984 + + Horse Racing Analyser (1984) 1984 Mayday Software @@ -87917,7 +88068,7 @@ Tape 2: Hero Quest: Return of the Witch Lord - Horse Race Analyser - 1986 + Horse Race Analyser (1986) 1986 Mayday Software @@ -88090,10 +88241,10 @@ Tape 2: Hero Quest: Return of the Witch Lord - - House Out of Town - 19?? - <unknown> + + House out of Town + 1991 + Simon Avery @@ -88101,10 +88252,10 @@ Tape 2: Hero Quest: Return of the Witch Lord - - House Out of Town (Adventure Workshop) + + House out of Town (Adventure Workshop) 19?? - <unknown> + The Adventure Workshop @@ -88113,7 +88264,7 @@ Tape 2: Hero Quest: Return of the Witch Lord - How To Be a Complete Bastard (set 1) + How to be a Complete Bastard (set 1) 1987 Virgin Games @@ -88124,9 +88275,9 @@ Tape 2: Hero Quest: Return of the Witch Lord - How To Be a Complete Bastard (set 2, Ricochet) + How to be a Complete Bastard (set 2, Ricochet) 1987 - Virgin Games Ltd / Ricochet + Ricochet @@ -88135,7 +88286,7 @@ Tape 2: Hero Quest: Return of the Witch Lord - How To Be a Hero + How to be a Hero 1987 Mastertronic Added Dimension @@ -88195,6 +88346,17 @@ Tape 2: Hero Quest: Return of the Witch Lord + HS-Compiler v1.1 + 1984 + M.C.G.V. + + + + + + + + HS-Compiler v1.1 (Aackosoft) 19?? <unknown> @@ -88210,17 +88372,6 @@ Tape 2: Hero Quest: Return of the Witch Lord - - HS-Compiler v1.1 - 19?? - <unknown> - - - - - - - Hub-Schrauber Pilot 1984 @@ -88433,7 +88584,7 @@ Tape 2: Hero Quest: Return of the Witch Lord Hybrid (set 2, Dro Soft) 1987 - Starlight Software / Dro Soft + Dro Soft @@ -88458,6 +88609,17 @@ Tape 2: Hero Quest: Return of the Witch Lord + Hydrofool + 1987 + Faster Than Light + + + + + + + + Hydrofool (Rack-It) 1988 Rack-It @@ -88468,13 +88630,13 @@ Tape 2: Hero Quest: Return of the Witch Lord - - Hydrofool - 19?? - <unknown> + + Hydrofool (Zafi Chip) + 1987 + Zafi Chip - - + + @@ -89228,23 +89390,23 @@ Game 7: What's Your Name? Simulator (S.H. Eye-Tea Productions, 1994) - Ice Attack (K'Soft) - 1986 - K'Soft + Ice Attack + 1984 + QBIT - - + + - Ice Attack - 19?? - <unknown> + Ice Attack (K'Soft) + 1986 + K'Soft - - + + @@ -89470,7 +89632,7 @@ Game 7: What's Your Name? Simulator (S.H. Eye-Tea Productions, 1994) Implosion (set 2, Alternative) 1987 - Alternative + Alternative Software @@ -89890,6 +90052,17 @@ Game 7: What's Your Name? Simulator (S.H. Eye-Tea Productions, 1994) + Indoor Soccer + 1986 + Magnificent 7 Software + + + + + + + + Indoor Soccer (Alternative) 1986 Alternative Software @@ -89900,13 +90073,13 @@ Game 7: What's Your Name? Simulator (S.H. Eye-Tea Productions, 1994) - - Indoor Soccer - 19?? - <unknown> + + Indoor Soccer (System 4) + 1986 + System 4 - - + + @@ -100570,8 +100743,9 @@ Lacks game introduction, bad dump or alternate version? Lunar Mission - 19?? - <unknown> + 198? + Sprites + @@ -100595,10 +100769,10 @@ Lacks game introduction, bad dump or alternate version? - - Lunar Rescue - 19?? - <unknown> + + Lunar Rescue (Lyversoft) + 1983 + Lyversoft @@ -101573,9 +101747,9 @@ Lacks game introduction, bad dump or alternate version? - Macro For Construction And Animation - 19?? - <unknown> + Macro for Construction and Animation + 1983 + Pinehurst Data Studio @@ -101586,7 +101760,8 @@ Lacks game introduction, bad dump or alternate version? Mad Arrows 19?? - <unknown> + Wompa Software + @@ -101811,7 +101986,7 @@ Lacks game introduction, bad dump or alternate version? - + Mad Mix Game (IBSA) 1988 IBSA @@ -101822,8 +101997,8 @@ Lacks game introduction, bad dump or alternate version? - - Mad Mix Game (Spectrum + Amstrad dual format) + + Mad Mix Game (Spectrum + Amstrad, dual format) 1988 Topo Soft @@ -101851,7 +102026,7 @@ Lacks game introduction, bad dump or alternate version? - + Mad Mix Game & The Pepsi Challenge (Portuguese) 2020 Topo Siglo XXI @@ -102152,20 +102327,20 @@ Lacks game introduction, bad dump or alternate version? - Magnetic Moon (Adventure Probe) + Magnetic Moon (128K, version 3.0) 1989 - Adventure Probe Software + FSF Adventures - + - Magnetic Moon - 128k (set 3) - 19?? - <unknown> + Magnetic Moon (128K, set 3) + 1989 + FSF Adventures @@ -102174,9 +102349,9 @@ Lacks game introduction, bad dump or alternate version? - Magnetic Moon - 128k (set 2) - 19?? - <unknown> + Magnetic Moon (128K, set 2) + 1989 + FSF Adventures @@ -102184,46 +102359,46 @@ Lacks game introduction, bad dump or alternate version? - - Magnetic Moon - 128k - Version 3.0 - 19?? - <unknown> + + Magnetic Moon (128K) + 1989 + FSF Adventures - - + + - - Magnetic Moon - 128k - 19?? - <unknown> + + Magnetic Moon (Adventure Probe) + 1989 + Adventure Probe Software - - + + - Magnetron (MCM) + Magnetron 1988 - MCM Software + Firebird Software - - + + - Magnetron - 19?? - <unknown> + Magnetron (MCM) + 1988 + MCM Software - - + + @@ -102356,7 +102531,7 @@ Lacks game introduction, bad dump or alternate version? - Malice In Blunderland + Malice in Blunderland 1986 Spectrum Computing @@ -102366,46 +102541,46 @@ Lacks game introduction, bad dump or alternate version? - - Malice In Wonderland (Sentient) (set 2) - 19?? - <unknown> + + Malice in Wonderland + 1985 + Lumpsoft - - + + - - Malice In Wonderland (Sentient) - 19?? - <unknown> + + Malice in Wonderland (set 2) + 1985 + Lumpsoft - - + + - - Malice In Wonderland (set 2) - 19?? - <unknown> + + Malice in Wonderland (Sentient, set 1) + 1985 + Sentient Software - - + + - - Malice In Wonderland - 19?? - <unknown> + + Malice in Wonderland (Sentient, set 2) + 1985 + Sentient Software - - + + @@ -102444,7 +102619,7 @@ Lacks game introduction, bad dump or alternate version? - Man About The House (set 2) + Man about the House (set 2) 1994 Zenobi Software @@ -102455,9 +102630,9 @@ Lacks game introduction, bad dump or alternate version? - Man About The House - 19?? - <unknown> + Man about the House + 1994 + Zenobi Software @@ -102714,7 +102889,7 @@ Lacks game introduction, bad dump or alternate version? Mandroid 19?? - <unknown> + Robert Sibthorp @@ -102735,8 +102910,8 @@ Lacks game introduction, bad dump or alternate version? Manic Badger - 19?? - <unknown> + 1991 + Psychaedelic Hedgehog @@ -103042,9 +103217,10 @@ Lacks game introduction, bad dump or alternate version? - Manollo El Cavernicola (set 1) - 19?? - <unknown> + Manollo: El Cavernicola (set 1) + 1988 + Iber Software + @@ -103053,9 +103229,10 @@ Lacks game introduction, bad dump or alternate version? - Manollo El Cavernicola (set 2) - 19?? - <unknown> + Manollo: El Cavernicola (set 2) + 1988 + Iber Software + @@ -103064,20 +103241,20 @@ Lacks game introduction, bad dump or alternate version? - Manor of Doom (Krypton Force) + Manor of Doom 1984 - Krypton Force + King Software - + Manor of Doom (set 3) - 19?? - <unknown> + 1984 + King Software @@ -103087,8 +103264,8 @@ Lacks game introduction, bad dump or alternate version? Manor of Doom (set 4) - 19?? - <unknown> + 1984 + King Software @@ -103098,8 +103275,8 @@ Lacks game introduction, bad dump or alternate version? Manor of Doom (set 2) - 19?? - <unknown> + 1984 + King Software @@ -103107,13 +103284,13 @@ Lacks game introduction, bad dump or alternate version? - - Manor of Doom - 19?? - <unknown> + + Manor of Doom (Krypton Force) + 1984 + Krypton Force - + @@ -103121,7 +103298,7 @@ Lacks game introduction, bad dump or alternate version? Manor of Madness (set 2) 1984 - Celtic + Celtic Software @@ -103131,8 +103308,8 @@ Lacks game introduction, bad dump or alternate version? Manor of Madness - 19?? - <unknown> + 1984 + Celtic Software @@ -103175,9 +103352,11 @@ Lacks game introduction, bad dump or alternate version? - Manuale Di Geometria Solida + Manuale di Geometria Solida 19?? - <unknown> + Edizioni JCE + + @@ -103375,9 +103554,9 @@ Lacks game introduction, bad dump or alternate version? - Marooned! + Marooned! (within e-magazine Outlet 10) 1988 - Outlet + Chezron Software @@ -103385,10 +103564,10 @@ Lacks game introduction, bad dump or alternate version? - - Marooned! (alt) - 19?? - <unknown> + + Marooned (Zenobi) + 1992 + Zenobi Software @@ -103568,7 +103747,7 @@ Lacks game introduction, bad dump or alternate version? - Master And Servant - Loading Screen Fix + Master and Servant (loading screen fix) 1985 Atlantis Software @@ -103579,9 +103758,9 @@ Lacks game introduction, bad dump or alternate version? - Master And Servant - 19?? - <unknown> + Master and Servant + 1985 + Atlantis Software @@ -103589,8 +103768,6 @@ Lacks game introduction, bad dump or alternate version? - - Master Chess (1983, Mikro-Gen) (set 1, release 3, Master Chess II) 1983 @@ -103604,8 +103781,8 @@ Lacks game introduction, bad dump or alternate version? Master Chess (1983, Mikro-Gen) (set 2, release 3, Master Chess II) - 19?? - <unknown> + 1983 + Mikro-Gen @@ -103615,8 +103792,8 @@ Lacks game introduction, bad dump or alternate version? Master Chess (1983, Mikro-Gen) (set 3, release 2) - 19?? - <unknown> + 1983 + Mikro-Gen @@ -103626,8 +103803,8 @@ Lacks game introduction, bad dump or alternate version? Master Chess (1983, Mikro-Gen) (set 4, release 1) - 19?? - <unknown> + 1983 + Mikro-Gen @@ -103642,7 +103819,6 @@ Lacks game introduction, bad dump or alternate version? - Master Chess (1987, Mastertronic) (set 1) 1987 @@ -103656,8 +103832,8 @@ Lacks game introduction, bad dump or alternate version? Master Chess (1987, Mastertronic) (set 2, Dro Soft) - 19?? - <unknown> + 1987 + Dro Soft @@ -103665,7 +103841,6 @@ Lacks game introduction, bad dump or alternate version? - Master Code 1983 @@ -103694,23 +103869,23 @@ Lacks game introduction, bad dump or alternate version? - Master Cutler (set 2) - 19?? - <unknown> + Master Cutler + 1984 + Dee-Kay Systems - - + + - Master Cutler - 19?? - <unknown> + Master Cutler (set 2) + 1984 + Dee-Kay Systems - - + + @@ -103739,14 +103914,16 @@ Lacks game introduction, bad dump or alternate version? Master Music - 19?? - <unknown> + 1983 + Fuller Micro Systems + + @@ -103781,7 +103958,7 @@ Lacks game introduction, bad dump or alternate version? - Master Word + Master Word (Hill MacGibbon) 1984 Hill MacGibbon @@ -103791,6 +103968,17 @@ Lacks game introduction, bad dump or alternate version? + + Master Word (Hopkinson / Tribe) + 1989 + Neil Hopkinson / Peter Tribe + + + + + + + Masterfile v0.4 1982 @@ -103958,7 +104146,7 @@ Lacks game introduction, bad dump or alternate version? Masterspy 19?? - <unknown> + Albert Ball @@ -104045,8 +104233,10 @@ Lacks game introduction, bad dump or alternate version? Match Point - 19?? - <unknown> + 1984 + Sinclair Research + + @@ -104059,6 +104249,50 @@ Lacks game introduction, bad dump or alternate version? + + Match Point (alt) + 1984 + Sinclair Research + + + + + + + + + + + + + + + + Balle de Match + 1984 + Psion Software + + + + + + + + + + + Match Point (IBSA) + 1984 + IBSA + + + + + + + + + Matching Pairs 1984 @@ -107249,7 +107483,7 @@ Nothing happens after loading the cassette - Mix And Match With Maggie + Mix and Match with Maggie 1991 Scetlander @@ -114586,7 +114820,7 @@ Nothing happens after loading the cassette Overlander (set 2, MCM) 1988 - Elite Systems Ltd / MCM + MCM Software @@ -114602,7 +114836,7 @@ Nothing happens after loading the cassette Overlander (set 3, Encore) 1988 - Elite Systems / Encore + Encore @@ -125973,7 +126207,7 @@ Game 4 - Char-Wallah - Roly Poly In Hospital + Roly Poly in Hospital 19?? <unknown> @@ -125987,6 +126221,7 @@ Game 4 - Char-Wallah Roman Empire 1982 MC Lothlorien + @@ -125994,6 +126229,18 @@ Game 4 - Char-Wallah + + Impero Romano + 198? + Micro Data + + + + + + + + Romantic Robot Videoface 1987 @@ -132894,10 +133141,51 @@ Game 4 - Char-Wallah - - Sokoban - English + + Soko Ban + 1997 + Zack + + + + + + + + + + + Soko Ban (hack) + 1997 + Zack + Derived version of a .z80 file + + + + + + + + + + + Soko-Ban Perfect + 1991 + New Frontier + + + + + + + + + + Sokoban (English) 2006 - Compiler + Compiler Software + + @@ -132905,6 +133193,19 @@ Game 4 - Char-Wallah + + Sokoban (Spanish) + 2006 + Compiler Software + + + + + + + + + Sol Negro 1989 @@ -135112,10 +135413,10 @@ Game 4 - Char-Wallah - - Spectrum Assembly Language Course - 19?? - <unknown> + + Spectrum Assembly Language Course (alt) + 1985 + Glentop Publishers @@ -136797,6 +137098,41 @@ Game 4 - Char-Wallah SSTV 1987 Pearsons Computing + + + + + + + + + + + + + + + SSTV (sample pictures) + 1987 + Pearsons Computing + + + + + + + + + + + + + + + SSTV (alt) + 1987 + Pearsons Computing + @@ -138578,6 +138914,7 @@ Game 4 - Char-Wallah Strike Attack 1984 Micro-Mart Software + @@ -138585,6 +138922,18 @@ Game 4 - Char-Wallah + + Strike Attack (alt) + 1984 + Micro-Mart Software + + + + + + + + Strike Attack 2 1984 @@ -142209,6 +142558,41 @@ Game 4 - Char-Wallah + + Tabuada Infantil (master tape) + 198? + Astor Software + + + + + + + + + + + + Tabuada Infantil + 198? + Astor Software + + + + + + + + + + + + + + + + + Tachyon Command 1985 @@ -159076,8 +159460,8 @@ Tape 2 - Side B - Game 2: Ninja Hamster (CRL Group PLC) 10 Mega Games Volume One - 19?? - <unknown> + 1988 + Gremlin Graphics Software @@ -160324,7 +160708,7 @@ Side B - Game 2: Superkid in Space (Atlantis Software) A Double Balrog 19?? - <unknown> + Zenobi Software @@ -160798,8 +161182,8 @@ Tape 1 - Side B - Game 3: Bullseye Addicta Pack - 19?? - <unknown> + 1990 + Prism Leisure Corporation @@ -160910,7 +161294,7 @@ Tape 1 - Side B - Game 3: Bullseye Adventure Probe Offer Tape 19?? - <unknown> + The Guild @@ -160937,7 +161321,7 @@ Tape 1 - Side B - Game 3: Bullseye Adventure-Link - Issue 2 19?? - <unknown> + Venturesoft @@ -160946,53 +161330,53 @@ Tape 1 - Side B - Game 3: Bullseye - Air-Sea Supremacy (set 1) + Air-Sea Supremacy 1991 - Dro Soft + Ubi Soft - - + + - - + + - - + + - - + + - - Air-Sea Supremacy (set 2) - 19?? - <unknown> + + Air-Sea Supremacy (Dro Soft) + 1991 + Dro Soft - - + + - - + + - - + + - - + + @@ -161029,22 +161413,6 @@ Tape 1 - Side B - Game 3: Bullseye - - Alien Swarm & Arena - 1983 - K-Tel Productions - - - - - - - - - - - - All Stars 1988 @@ -161074,7 +161442,8 @@ Tape 1 - Side B - Game 3: Bullseye Alles Wat U Moet Weten Over De ZX Spectrum 1985 - MCN + MCN Software + @@ -161160,9 +161529,10 @@ Tape 1 - Side B - Game 3: Bullseye - Amunt La Informatica (Issue 02) + Amunt La Informàtica - Cassette № 2 19?? - <unknown> + Centre Divulgador de la Informàtica + @@ -161187,23 +161557,23 @@ Tape 1 - Side B - Game 3: Bullseye - Arcade Classics (MCM) + Arcade Classics (Silverbird) 1988 - MCM Software + Silverbird Software - - + + - - Arcade Classics (Silverbird) - 19?? - <unknown> + + Arcade Classics (MCM) + 1988 + MCM Software - - + + @@ -161298,24 +161668,28 @@ Tape 1 - Side B - Game 3: Bullseye Arcade Muscle - 19?? - <unknown> + 1989 + U.S. Gold + + + + @@ -161343,7 +161717,7 @@ Tape 1 - Side B - Game 3: Bullseye - + Arco Iris - TK95 1985 Microdigital @@ -162347,33 +162721,33 @@ Tape 1 - Side B - Game 3: Bullseye - Cauldron I & II (EDOS) - 19?? - <unknown> + Cauldron I & II (Hi-Tec) + 1990 + Hi-Tec Software - - + + - - + + - - Cauldron I & II (Hi-Tec) + + Cauldron I & II (EDOS) 19?? - <unknown> + EDOS - - + + - - + + @@ -165016,10 +165390,10 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - + Games Pack 3 - 19?? - <unknown> + 1984 + Custom Cables International @@ -165032,10 +165406,10 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - + Games Pack 4 - 19?? - <unknown> + 1984 + Custom Cables International @@ -165048,10 +165422,10 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - + Games Pack One - 19?? - <unknown> + 1984 + Space Age Software @@ -165059,10 +165433,10 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - + Games Pack - 19?? - <unknown> + 1983 + Impact Software @@ -165093,7 +165467,7 @@ Side B: Bear Island - + Games Tape 1 (Riko Data) 198? Riko Data @@ -165135,7 +165509,7 @@ Side A - Game 4: 3 Dimensional Noughts & Crosses - + Games Tape I (Riko Data) 1983 Riko Data @@ -165194,7 +165568,7 @@ Side A - Game 3: Fighter - + Games Tape II (Riko Data) 1983 Riko Data @@ -165729,15 +166103,17 @@ Tape 3 - Side B - Game 1: Street Fighter (Go!) - Grue-Knapped & Helvera - Mistress of the Park (set 2) - 19?? - <unknown> + Grue-Knapped + Helvera: Mistress of the Park (set 2) + 1991 + FSF Adventures + + @@ -165745,15 +166121,17 @@ Tape 3 - Side B - Game 1: Street Fighter (Go!) - Grue-Knapped & Helvera - Mistress of the Park (set 1) + Grue-Knapped + Helvera - Mistress of the Park (set 1) 1991 FSF Adventures + + @@ -165809,9 +166187,9 @@ Tape 3 - Side B - Game 1: Street Fighter (Go!) - Hanoi King & Little Boxes - 19?? - <unknown> + Hanoi King + Little Boxes + 1983 + Contrast Software @@ -166121,25 +166499,25 @@ Tape 2 - Side B: Star Wars - Horizons (Microdigital) - 19?? - <unknown> + Horizons + 1982 + Sinclair Research - - + + - - + + - + Horizons (Micropress) - 19?? - <unknown> + 1982 + Micropress @@ -166152,10 +166530,10 @@ Tape 2 - Side B: Star Wars - + Horizons (Octocon Data) - 19?? - <unknown> + 1982 + Octocon Data @@ -166168,10 +166546,10 @@ Tape 2 - Side B: Star Wars - + Horizons (Rebit Computer) - 19?? - <unknown> + 1982 + Rebit Computer @@ -166201,17 +166579,17 @@ Tape 2 - Side B: Star Wars - Horizons + Horizons (Microdigital) 19?? <unknown> - - + + - - + + @@ -167325,10 +167703,10 @@ Side B - Game 3: Capricornio 1 [Galaxians] (Artic Computing Ltd) - + Magic Missile 2 - 19?? - <unknown> + 1989 + Matthew Wilson @@ -167341,10 +167719,10 @@ Side B - Game 3: Capricornio 1 [Galaxians] (Artic Computing Ltd) - + Magic Missile 3 - 19?? - <unknown> + 1990 + Matthew Wilson @@ -167357,10 +167735,10 @@ Side B - Game 3: Capricornio 1 [Galaxians] (Artic Computing Ltd) - + Magic Missile 4 - 19?? - <unknown> + 1990 + Matthew Wilson @@ -167373,10 +167751,10 @@ Side B - Game 3: Capricornio 1 [Galaxians] (Artic Computing Ltd) - + Magic Missile 5 - 19?? - <unknown> + 1990 + Leslie Floyd diff --git a/hash/supracan.xml b/hash/supracan.xml index 23a06bc9164fd..93672bda29f0a 100644 --- a/hash/supracan.xml +++ b/hash/supracan.xml @@ -4,43 +4,63 @@ license:CC0-1.0 --> - - - - - Formosa Duel + + Formosa Duel ~ Formosa Da Dui Jue 1995 AV Artisan Corp. + - + + - + Sango Fighter ~ Wu Jiang Zheng Ba - San Guo Zhi 1995 Panda Entertainment Technology + - + + - + The Son of Evil ~ Xie E Zhi Zi 1995 Funtech + - + + + + @@ -48,108 +68,162 @@ license:CC0-1.0 Speedy Dragon ~ Yin Su Fei Long 1995 AV Artisan Corp. + - + + Super Taiwanese Baseball League ~ Chao Ji Zhong Hua Zhi Bang Lian Meng 1995 C&E Soft + - + + + + - + Journey to the Laugh ~ Xi You Ji 1995 Funtech + - + - + Super Light Saga - Dragon Force ~ Chao Ji Guang Ming Zhan Shi 1996 Kingformation + - + + + + + - + Monopoly: Adventure in Africa ~ Fei Zhou Tan Xian Da Fu Weng 1995 Panda Entertainment Technology - + + + + + - - Gambling Lord + + Gambling Lord ~ Du Ba 1996 Funtech + - - + + + + + + + - - Magical Pool - 199? + + Magical Pool ~ Mo Bang Zhuang Qiu + 1996 Funtech + - - + + - + Boom Zoo ~ Bao Bao Dong Wu Yuan 1996 Funtech + - + - + + diff --git a/hash/takara_daigunder_dx_cart.xml b/hash/takara_daigunder_dx_cart.xml new file mode 100644 index 0000000000000..56dd0c68edc1f --- /dev/null +++ b/hash/takara_daigunder_dx_cart.xml @@ -0,0 +1,90 @@ + + + + + + + + + + R-01 ROM Robo Aoki Inazuma Bulion + 2002 + Takara + + + + + + + + + + R-02 ROM Robo Jurassic Soldier Bonerex + 2002 + Takara + + + + + + + + + diff --git a/hash/thinkpad8xx.xml b/hash/thinkpad8xx.xml new file mode 100644 index 0000000000000..385509cdd48cb --- /dev/null +++ b/hash/thinkpad8xx.xml @@ -0,0 +1,94 @@ + + + + + + + + + AIX 4.1.5 + 1997 + IBM + + + + + + + + + + + + + + + + OS/2 Warp PowerPC Edition + 1995 + IBM + + + + + + + + + + + + + + + + + + Solaris 2.5.1 Limited Availability PowerPC Platform Edition + 1996 + Sun Microsystem + + + + + + + + + + + + + + + + + + + + + + + + + Windows NT Workstation 3.5 PowerPC Edition + 1994 + IBM + + + + + + + + + + + + + + + + diff --git a/hash/zx81_cass.xml b/hash/zx81_cass.xml index 21f71e6c2bec2..aa8e1f0472108 100644 --- a/hash/zx81_cass.xml +++ b/hash/zx81_cass.xml @@ -17,16 +17,6 @@ Due to the way the ZX81 saves to tape, different recordings of identical data (s might be stored along with a few different bytes in them. Additional dumps of the same releases should match those differences. TZX files for ZX81 are just the .P dumps with an additional header on top, so they may not be the cleanest format for archival. -Known dumps not yet added (as of 2023-06-14): -- Accounts [zx81stuff.org.uk] -- Adventure (G Barker) [zx81stuff.org.uk] -- Nowotnik Puzzle [Mr. Strudwick, zx81stuff.org.uk] -- Purchases [zx81stuff.org.uk] -- RacehorseTrainer [zx81stuff.org.uk] -- Star Trek and 3D Os and Xs [zx81stuff.org.uk] -- Tutor (French) [zx81stuff.org.uk] -- Zor [zx81stuff.org.uk] - --> @@ -43,7 +33,7 @@ Known dumps not yet added (as of 2023-06-14): - 1K Games Pack + 1K Games Pack (Artic) 198? Artic @@ -65,6 +55,32 @@ Known dumps not yet added (as of 2023-06-14): + + 1K Games Pack (Crystal) + 1982 + Crystal Computing + + + + + + + + + 1k Wonders 198? @@ -138,6 +154,27 @@ Known dumps not yet added (as of 2023-06-14): + + 3D Formule 1 + 1984 + ERE Informatique + + + + + + + + + + + + + + + + + 3D Grand Prix 1983 @@ -266,6 +303,18 @@ Known dumps not yet added (as of 2023-06-14): + + Accounts + 1982 + Hestacrest + + + + + + + + Admiral Graf Spee 198? @@ -300,7 +349,7 @@ Known dumps not yet added (as of 2023-06-14): - Adventure + Adventure (Bug Byte) 1982 Bug Byte @@ -310,6 +359,18 @@ Known dumps not yet added (as of 2023-06-14): + + Adventure (Gavin Baker) + 1984 + Gavin Baker + + + + + + + + Adventure C 1982 @@ -354,6 +415,19 @@ Known dumps not yet added (as of 2023-06-14): + + Air Traffic Control + 1984 + Hama Systems + + + + + + + + + Airline 1982 @@ -398,6 +472,23 @@ Known dumps not yet added (as of 2023-06-14): + + Alien Invaders + 1983 + Real Time Software + + + + + + + + + + + + + Alien-Dropout 1982 @@ -457,6 +548,31 @@ Known dumps not yet added (as of 2023-06-14): + + AERI - Análise de Estruturas Recticuladas Isostácticas + 1982 + Landry + + + + + + + + + + + + + + + + + + + + + Arcade Action 198? @@ -804,7 +920,7 @@ Known dumps not yet added (as of 2023-06-14): - Black Crystal (Single Sided) + Black Crystal (single sided) 1982 Carnell @@ -851,7 +967,7 @@ Known dumps not yet added (as of 2023-06-14): - Bomber (MikroGen) + Bomber (Mikro-Gen) 198? Mikro-Gen @@ -945,6 +1061,18 @@ Known dumps not yet added (as of 2023-06-14): + + Bridgehead + 1984 + Gavin Barker + + + + + + + + Bubble Bugs 1983 @@ -1191,7 +1319,7 @@ Known dumps not yet added (as of 2023-06-14): Catacombs 1981 - J.K.Greye Software + J.K. Greye Software @@ -1222,7 +1350,7 @@ Known dumps not yet added (as of 2023-06-14): - Centipede (dk) + Centipede (dK'tronics) 1982 dK'tronics @@ -1233,7 +1361,7 @@ Known dumps not yet added (as of 2023-06-14): - Centipede (Green Cover) + Centipede (dK'tronics, green cover) 198? dK'tronics @@ -1276,6 +1404,19 @@ Known dumps not yet added (as of 2023-06-14): + + Le Chateau Hanté + 1984 + Sprites + + + + + + + + + The Checkbook Manager 1982 @@ -1291,6 +1432,7 @@ Known dumps not yet added (as of 2023-06-14): Chess also Chess-Clock 1981 Sinclair Research + @@ -1306,9 +1448,10 @@ Known dumps not yet added (as of 2023-06-14): - Chess (MikroGen) + Chess (Mikro-Gen) 1982 Mikro-Gen + @@ -1323,10 +1466,11 @@ Known dumps not yet added (as of 2023-06-14): - - Chess (Psion) + + Chess (Mikro-Gen, orange cover) 1981 - Psion + Mikro-Gen + @@ -1341,7 +1485,7 @@ Known dumps not yet added (as of 2023-06-14): - + Chess (Timex) 1982 Timex @@ -1352,8 +1496,28 @@ Known dumps not yet added (as of 2023-06-14): - - Chess (Typed) + + Xadrez (Timex Portugal) + 1983 + Timex Portugal + + + + + + + + + + + + + + + + + + Chess (typed) 1981 Mikro-Gen @@ -1718,6 +1882,8 @@ Known dumps not yet added (as of 2023-06-14): Dallas (French) 1983 Cases Computer Simulations + + @@ -1765,6 +1931,17 @@ Known dumps not yet added (as of 2023-06-14): + + Deflexx + 1981 + dK'tronics + + + + + + + Dictator 1982 @@ -1776,6 +1953,42 @@ Known dumps not yet added (as of 2023-06-14): + + Colunas - Dimensionamento de Colunas Montantes de Edifícios + 1982 + Landry + + + + + + + + + + + + + + + + + + + + + + + Dis-ACSem + 1981 + ACS Software + + + + + + + Dodgems and Connect 4 198? @@ -1795,7 +2008,7 @@ Known dumps not yet added (as of 2023-06-14): - Dodgems and Connect 4 (Brown Inlay) + Dodgems and Connect 4 (brown inlay) 1982 CDS Micro Systems @@ -1904,6 +2117,20 @@ Known dumps not yet added (as of 2023-06-14): + + Em Busca dos Tesouros + 1986 + Micro Sistemas + + + + + + + + + + Encounter 1982 @@ -2231,6 +2458,7 @@ Known dumps not yet added (as of 2023-06-14): Flight Simulation 1982 Sinclair Research + @@ -2238,10 +2466,11 @@ Known dumps not yet added (as of 2023-06-14): - - The Flight Simulator + + The Flight Simulator (Timex) 1982 Timex + @@ -2253,6 +2482,7 @@ Known dumps not yet added (as of 2023-06-14): Flug-Simulation 1982 Sinclair Research + @@ -2260,6 +2490,19 @@ Known dumps not yet added (as of 2023-06-14): + + Simulador de Voo (Timex Portugal) + 1982 + Timex Portugal + + + + + + + + + Football 198? @@ -2875,6 +3118,19 @@ Known dumps not yet added (as of 2023-06-14): + + Gamespack + 1982 + Mikro-Gen + + + + + + + + + Gamestape #3 1984 @@ -2977,6 +3233,7 @@ Known dumps not yet added (as of 2023-06-14): Geometry 1 1982 Timex + @@ -2984,6 +3241,26 @@ Known dumps not yet added (as of 2023-06-14): + + Geometria I + 1982 + Timex Portugal + + + + + + + + + + + + + + + + Ghost Hunt 1982 @@ -3044,6 +3321,19 @@ Known dumps not yet added (as of 2023-06-14): + + Grand Prix + 198? + Indescomp + + + + + + + + + Graphics Kit 1981 @@ -3588,7 +3878,7 @@ Known dumps not yet added (as of 2023-06-14): - Invaders (Re-release) + Invaders (re-release) 1982 Bug Byte @@ -3621,7 +3911,7 @@ Known dumps not yet added (as of 2023-06-14): - Invaders (Typed Inlay) + Invaders (typed inlay) 1981 Bug Byte @@ -4215,6 +4505,29 @@ Known dumps not yet added (as of 2023-06-14): + + Lemonade + 1983 + <unknown> + + + + + + + + + Letter Hunt + 198? + EdZX Educational Software + + + + + + + + The List Manager 1982 @@ -4295,6 +4608,18 @@ Known dumps not yet added (as of 2023-06-14): + + Inheritance + 198? + Simon W. Hessel Software + + + + + + + + Machine Code Test Tool 1982 @@ -4890,6 +5215,19 @@ Known dumps not yet added (as of 2023-06-14): + + The Nowotnik Puzzle & Other Diversions + 1982 + Phipps Associates + + + + + + + + + Ocean Trader 1983 @@ -5458,6 +5796,18 @@ Known dumps not yet added (as of 2023-06-14): + + Purchases + 1982 + Hestacrest + + + + + + + + The Puzzler 1982 @@ -5495,7 +5845,7 @@ Known dumps not yet added (as of 2023-06-14): - QS Asteroids (Alt) + QS Asteroids (alt) 1982 Quicksilva @@ -5634,6 +5984,18 @@ Known dumps not yet added (as of 2023-06-14): + + Racehorse Trainer + 1984 + Gavin Barker + + + + + + + + Radio Programs 1 198? @@ -5833,6 +6195,8 @@ Known dumps not yet added (as of 2023-06-14): Sabotage 1982 Sinclair Research + + @@ -5840,6 +6204,19 @@ Known dumps not yet added (as of 2023-06-14): + + Sabotagem (Timex Portugal) + 1983 + Timex Portugal + + + + + + + + + Salvo 198? @@ -5922,6 +6299,19 @@ Known dumps not yet added (as of 2023-06-14): + + Serpents Tomb + 1983 + Vortex Software + + + + + + + + + Sea Wolf (Newer) 1983 @@ -6305,7 +6695,7 @@ Known dumps not yet added (as of 2023-06-14): - Star Trek (Typed Inlay) + Star Trek (typed inlay) 1981 Bug Byte @@ -6351,8 +6741,27 @@ Known dumps not yet added (as of 2023-06-14): + + Star Trek + 3D O's and X's + 1981 + Macronics + + + + + + + + + + + + + + + - States And Capitals + States and Capitals 1982 Timex @@ -7373,10 +7782,23 @@ Known dumps not yet added (as of 2023-06-14): + + Tutor (French) + 1983 + Artic + + + + + + + + - Tutor German + Tutor (German) 1983 Artic + @@ -7385,9 +7807,10 @@ Known dumps not yet added (as of 2023-06-14): - Tutor Spanish + Tutor (Spanish) 1983 Artic + @@ -7627,8 +8050,9 @@ Known dumps not yet added (as of 2023-06-14): Warlord - 1982 - Lothlorien + 1983 + M.C. Lothlorien + @@ -7875,6 +8299,18 @@ Known dumps not yet added (as of 2023-06-14): + + Zedman + Spacers + 1982 + Babtech + + + + + + + + Zombies/Sword of Peace 198? @@ -7886,6 +8322,18 @@ Known dumps not yet added (as of 2023-06-14): + + Zor + 1982 + International Publishing & Software + + + + + + + + Zuckman 1982 @@ -8430,4 +8878,20 @@ Known dumps not yet added (as of 2023-06-14): + + + + + Tut-Tut + 2019 + ZX81 Keyboard Adventure + + + + + + + + + diff --git a/makefile b/makefile index e1aca38c037b2..926ff68989bd9 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.268"' > $@ + @echo '#define BARE_BUILD_VERSION "0.269"' > $@ @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 "W (" BARE_VCS_REVISION ")";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.268" > $@ + @echo #define BARE_BUILD_VERSION "0.269" > $@ @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/minimaws/lib/__init__.py b/scripts/minimaws/lib/__init__.py index d89cb7f81ba3f..a8a22f4dbfe12 100644 --- a/scripts/minimaws/lib/__init__.py +++ b/scripts/minimaws/lib/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb diff --git a/scripts/minimaws/lib/auxverbs.py b/scripts/minimaws/lib/auxverbs.py index 50e4dacddd3be..f4a4ebbe70c45 100644 --- a/scripts/minimaws/lib/auxverbs.py +++ b/scripts/minimaws/lib/auxverbs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb @@ -17,7 +17,7 @@ class _Identifier(object): def __init__(self, dbcurs, **kwargs): - super(_Identifier, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbcurs = dbcurs self.shortnamewidth = 0 self.pathwidth = 0 diff --git a/scripts/minimaws/lib/dbaccess.py b/scripts/minimaws/lib/dbaccess.py index 3cfbec0c50878..74c1cdb6d1e0b 100644 --- a/scripts/minimaws/lib/dbaccess.py +++ b/scripts/minimaws/lib/dbaccess.py @@ -1,13 +1,10 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb import sqlite3 -import sys - -if sys.version_info >= (3, 4): - import urllib.request +import urllib.request class SchemaQueries(object): @@ -574,7 +571,7 @@ class UpdateQueries(object): class QueryCursor(object): def __init__(self, dbconn, **kwargs): - super(QueryCursor, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbcurs = dbconn.cursor() def close(self): @@ -916,7 +913,7 @@ def get_software_disk_dumps(self, sha1): class UpdateCursor(object): def __init__(self, dbconn, **kwargs): - super(UpdateCursor, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbcurs = dbconn.cursor() def close(self): @@ -1066,11 +1063,8 @@ def add_softwarediskdump(self, part, name, sha1, bad): class QueryConnection(object): def __init__(self, database, **kwargs): - super(QueryConnection, self).__init__(**kwargs) - if sys.version_info >= (3, 4): - self.dbconn = sqlite3.connect('file:' + urllib.request.pathname2url(database) + '?mode=ro', uri=True, check_same_thread=False) - else: - self.dbconn = sqlite3.connect(database, check_same_thread=False) + super().__init__(**kwargs) + self.dbconn = sqlite3.connect('file:' + urllib.request.pathname2url(database) + '?mode=ro', uri=True, check_same_thread=False) self.dbconn.row_factory = sqlite3.Row self.dbconn.execute('PRAGMA foreign_keys = ON') @@ -1083,7 +1077,7 @@ def cursor(self): class UpdateConnection(object): def __init__(self, database, **kwargs): - super(UpdateConnection, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbconn = sqlite3.connect(database) self.dbconn.execute('PRAGMA page_size = 4096') self.dbconn.execute('PRAGMA foreign_keys = ON') diff --git a/scripts/minimaws/lib/htmltmpl.py b/scripts/minimaws/lib/htmltmpl.py index 62e1bbcf1ea37..c6489e27349a3 100644 --- a/scripts/minimaws/lib/htmltmpl.py +++ b/scripts/minimaws/lib/htmltmpl.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb diff --git a/scripts/minimaws/lib/lxparse.py b/scripts/minimaws/lib/lxparse.py index e773669080dd1..11c9a15f45179 100644 --- a/scripts/minimaws/lib/lxparse.py +++ b/scripts/minimaws/lib/lxparse.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb @@ -14,7 +14,7 @@ class ElementHandlerBase(object): def __init__(self, parent, **kwargs): - super(ElementHandlerBase, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbconn = parent.dbconn if parent is not None else None self.locator = parent.locator if parent is not None else None self.depth = 0 @@ -105,7 +105,7 @@ class ElementHandler(ElementHandlerBase): class TextAccumulator(ElementHandler): def __init__(self, parent, **kwargs): - super(TextAccumulator, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.text = '' def mainCharacters(self, content): @@ -114,7 +114,7 @@ def mainCharacters(self, content): class DipSwitchHandler(ElementHandler): def __init__(self, parent, **kwargs): - super(DipSwitchHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.machine = parent.id @@ -138,7 +138,7 @@ def startChildElement(self, name, attrs): class SlotHandler(ElementHandler): def __init__(self, parent, **kwargs): - super(SlotHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.machine = parent.id @@ -155,7 +155,7 @@ def startChildElement(self, name, attrs): class RamOptionHandler(TextAccumulator): def __init__(self, parent, **kwargs): - super(RamOptionHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.machine = parent.id @@ -181,7 +181,7 @@ class MachineHandler(ElementHandler): 'ramoption': RamOptionHandler } def __init__(self, parent, **kwargs): - super(MachineHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = self.dbconn.cursor() def startMainElement(self, name, attrs): @@ -248,7 +248,7 @@ def endChildHandler(self, name, handler): class ListXmlHandler(ElementHandler): def __init__(self, dbconn, **kwargs): - super(ListXmlHandler, self).__init__(parent=None, **kwargs) + super().__init__(parent=None, **kwargs) self.dbconn = dbconn def startDocument(self): @@ -290,7 +290,7 @@ def processingInstruction(self, target, data): class DataAreaHandler(ElementHandler): def __init__(self, parent, **kwargs): - super(DataAreaHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.part = parent.id @@ -309,7 +309,7 @@ def startChildElement(self, name, attrs): class DiskAreaHandler(ElementHandler): def __init__(self, parent, **kwargs): - super(DiskAreaHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.part = parent.id @@ -330,7 +330,7 @@ class SoftwarePartHandler(ElementHandler): 'diskarea': DiskAreaHandler } def __init__(self, parent, **kwargs): - super(SoftwarePartHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = parent.dbcurs self.software = parent.id @@ -356,7 +356,7 @@ class SoftwareHandler(ElementHandler): 'part': SoftwarePartHandler } def __init__(self, parent, **kwargs): - super(SoftwareHandler, self).__init__(parent=parent, **kwargs) + super().__init__(parent=parent, **kwargs) self.dbcurs = self.dbconn.cursor() self.softwarelist = parent.id @@ -400,7 +400,7 @@ class SoftwareListHandler(ElementHandler): 'software': SoftwareHandler } def __init__(self, dbconn, **kwargs): - super(SoftwareListHandler, self).__init__(parent=None, **kwargs) + super().__init__(parent=None, **kwargs) self.dbconn = dbconn def startDocument(self): diff --git a/scripts/minimaws/lib/wsgiserve.py b/scripts/minimaws/lib/wsgiserve.py index 28afa75d1f2fe..561974075163d 100644 --- a/scripts/minimaws/lib/wsgiserve.py +++ b/scripts/minimaws/lib/wsgiserve.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb @@ -6,6 +6,7 @@ from . import dbaccess from . import htmltmpl +import html import inspect import json import mimetypes @@ -13,21 +14,14 @@ import re import sys import urllib +import urllib.parse import wsgiref.util -try: - import html - htmlescape = html.escape -except ImportError: - import cgi - htmlescape = cgi.escape - -try: - import urllib.parse as urlparse - urlquote = urlparse.quote -except ImportError: - import urlparse - urlquote = urllib.quote +htmlescape = html.escape +shiftpath = wsgiref.util.shift_path_info +urljoin = urllib.parse.urljoin +urlparsequery = urllib.parse.parse_qs +urlquote = urllib.parse.quote class HandlerBase(object): @@ -45,7 +39,7 @@ class HandlerBase(object): 505: 'HTTP Version Not Supported' } def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(HandlerBase, self).__init__(**kwargs) + super().__init__(**kwargs) self.app = app self.js_escape = app.js_escape self.application_uri = application_uri @@ -58,7 +52,7 @@ def error_page(self, code): class ErrorPageHandler(HandlerBase): def __init__(self, code, app, application_uri, environ, start_response, **kwargs): - super(ErrorPageHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) self.code = code self.start_response('%d %s' % (self.code, self.STATUS_MESSAGE[code]), [('Content-type', 'text/html; charset=utf-8'), ('Cache-Control', 'public, max-age=3600')]) @@ -70,9 +64,9 @@ class AssetHandler(HandlerBase): EXTENSIONMAP = { '.js': 'application/javascript', '.svg': 'image/svg+xml' } def __init__(self, directory, app, application_uri, environ, start_response, **kwargs): - super(AssetHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) self.directory = directory - self.asset = wsgiref.util.shift_path_info(environ) + self.asset = shiftpath(environ) def __iter__(self): if not self.asset: @@ -105,20 +99,20 @@ def __iter__(self): class QueryPageHandler(HandlerBase): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(QueryPageHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) self.dbcurs = app.dbconn.cursor() def machine_href(self, shortname): - return htmlescape(urlparse.urljoin(self.application_uri, 'machine/%s' % (urlquote(shortname), )), True) + return htmlescape(urljoin(self.application_uri, 'machine/%s' % (urlquote(shortname), )), True) def sourcefile_href(self, sourcefile): - return htmlescape(urlparse.urljoin(self.application_uri, 'sourcefile/%s' % (urlquote(sourcefile), )), True) + return htmlescape(urljoin(self.application_uri, 'sourcefile/%s' % (urlquote(sourcefile), )), True) def softwarelist_href(self, softwarelist): - return htmlescape(urlparse.urljoin(self.application_uri, 'softwarelist/%s' % (urlquote(softwarelist), )), True) + return htmlescape(urljoin(self.application_uri, 'softwarelist/%s' % (urlquote(softwarelist), )), True) def software_href(self, softwarelist, software): - return htmlescape(urlparse.urljoin(self.application_uri, 'softwarelist/%s/%s' % (urlquote(softwarelist), urlquote(software))), True) + return htmlescape(urljoin(self.application_uri, 'softwarelist/%s/%s' % (urlquote(softwarelist), urlquote(software))), True) def bios_data(self, machine): result = { } @@ -197,8 +191,8 @@ def softwarelist_data(self, machine): class MachineRpcHandlerBase(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(MachineRpcHandlerBase, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) - self.shortname = wsgiref.util.shift_path_info(environ) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + self.shortname = shiftpath(environ) def __iter__(self): if not self.shortname: @@ -222,8 +216,8 @@ def __iter__(self): class MachineHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(MachineHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) - self.shortname = wsgiref.util.shift_path_info(environ) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + self.shortname = shiftpath(environ) def __iter__(self): if not self.shortname: @@ -250,7 +244,7 @@ def machine_page(self, machine_info): description = machine_info['description'] yield htmltmpl.MACHINE_PROLOGUE.substitute( app=self.js_escape(htmlescape(self.application_uri, True)), - assets=self.js_escape(htmlescape(urlparse.urljoin(self.application_uri, 'static'), True)), + assets=self.js_escape(htmlescape(urljoin(self.application_uri, 'static'), True)), sourcehref=self.sourcefile_href(machine_info['sourcefile']), description=htmlescape(description), shortname=htmlescape(self.shortname), @@ -470,7 +464,7 @@ def sanitised_json(data): class SourceFileHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(SourceFileHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) def __iter__(self): self.filename = self.environ['PATH_INFO'] @@ -514,7 +508,7 @@ def sourcefile_listing_page(self, pattern): heading = self.linked_title(pattern) title = 'Source Files: ' + htmlescape(pattern) yield htmltmpl.SOURCEFILE_LIST_PROLOGUE.substitute( - assets=htmlescape(urlparse.urljoin(self.application_uri, 'static'), True), + assets=htmlescape(urljoin(self.application_uri, 'static'), True), title=title, heading=heading).encode('utf-8') for filename, machines in self.dbcurs.get_sourcefiles(pattern): @@ -525,7 +519,7 @@ def sourcefile_listing_page(self, pattern): def sourcefile_page(self, id): yield htmltmpl.SOURCEFILE_PROLOGUE.substitute( - assets=htmlescape(urlparse.urljoin(self.application_uri, 'static'), True), + assets=htmlescape(urljoin(self.application_uri, 'static'), True), filename=htmlescape(self.filename), title=self.linked_title(self.filename)).encode('utf-8') @@ -558,13 +552,13 @@ def linked_title(self, filename, linkfinal=False): parts = filename.split('/') final = parts[-1] del parts[-1] - uri = urlparse.urljoin(self.application_uri, 'sourcefile') + uri = urljoin(self.application_uri, 'sourcefile') title = '' for part in parts: - uri = urlparse.urljoin(uri + '/', urlquote(part)) + uri = urljoin(uri + '/', urlquote(part)) title += '{1}/'.format(htmlescape(uri, True), htmlescape(part)) if linkfinal: - uri = urlparse.urljoin(uri + '/', urlquote(final)) + uri = urljoin(uri + '/', urlquote(final)) return title + '{1}'.format(htmlescape(uri, True), htmlescape(final)) else: return title + final @@ -583,9 +577,9 @@ def machine_row(self, machine_info): class SoftwareListHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(SoftwareListHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) - self.shortname = wsgiref.util.shift_path_info(environ) - self.software = wsgiref.util.shift_path_info(environ) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + self.shortname = shiftpath(environ) + self.software = shiftpath(environ) def __iter__(self): if self.environ['PATH_INFO']: @@ -627,7 +621,7 @@ def softwarelist_listing_page(self, pattern): else: title = heading = 'Software Lists: ' + htmlescape(pattern) yield htmltmpl.SOFTWARELIST_LIST_PROLOGUE.substitute( - assets=htmlescape(urlparse.urljoin(self.application_uri, 'static'), True), + assets=htmlescape(urljoin(self.application_uri, 'static'), True), title=title, heading=heading).encode('utf-8') for shortname, description, total, supported, partiallysupported, unsupported in self.dbcurs.get_softwarelists(pattern): @@ -649,7 +643,7 @@ def softwarelist_page(self, softwarelist_info, pattern): title = 'Software List: %s (%s): %s' % (htmlescape(softwarelist_info['description']), htmlescape(softwarelist_info['shortname']), htmlescape(pattern)) heading = '%s: %s' % (self.softwarelist_href(softwarelist_info['shortname']), htmlescape(softwarelist_info['description']), htmlescape(pattern)) yield htmltmpl.SOFTWARELIST_PROLOGUE.substitute( - assets=htmlescape(urlparse.urljoin(self.application_uri, 'static'), True), + assets=htmlescape(urljoin(self.application_uri, 'static'), True), title=title, heading=heading, shortname=htmlescape(softwarelist_info['shortname']), @@ -707,7 +701,7 @@ def softwarelist_page(self, softwarelist_info, pattern): def software_page(self, software_info): yield htmltmpl.SOFTWARE_PROLOGUE.substitute( - assets=htmlescape(urlparse.urljoin(self.application_uri, 'static'), True), + assets=htmlescape(urljoin(self.application_uri, 'static'), True), title=htmlescape(software_info['description']), heading=htmlescape(software_info['description']), softwarelisthref=self.softwarelist_href(self.shortname), @@ -794,7 +788,7 @@ def format_supported(supported): class RomIdentHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(QueryPageHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) self.dbcurs = app.dbconn.cursor() def __iter__(self): @@ -811,7 +805,7 @@ def __iter__(self): def form_page(self): yield htmltmpl.ROMIDENT_PAGE.substitute( app=self.js_escape(htmlescape(self.application_uri, True)), - assets=self.js_escape(htmlescape(urlparse.urljoin(self.application_uri, 'static'), True))).encode('utf-8') + assets=self.js_escape(htmlescape(urljoin(self.application_uri, 'static'), True))).encode('utf-8') class BiosRpcHandler(MachineRpcHandlerBase): @@ -839,7 +833,7 @@ def data_page(self, machine): class RomDumpsRpcHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(RomDumpsRpcHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) def __iter__(self): if self.environ['PATH_INFO']: @@ -850,7 +844,7 @@ def __iter__(self): return self.error_page(405) else: try: - args = urlparse.parse_qs(self.environ['QUERY_STRING'], keep_blank_values=True, strict_parsing=True) + args = urlparsequery(self.environ['QUERY_STRING'], keep_blank_values=True, strict_parsing=True) crc = args.get('crc') sha1 = args.get('sha1') if (len(args) == 2) and (crc is not None) and (len(crc) == 1) and (sha1 is not None) and (len(sha1) == 1): @@ -896,7 +890,7 @@ def data_page(self, crc, sha1): class DiskDumpsRpcHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): - super(DiskDumpsRpcHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) + super().__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs) def __iter__(self): if self.environ['PATH_INFO']: @@ -907,7 +901,7 @@ def __iter__(self): return self.error_page(405) else: try: - args = urlparse.parse_qs(self.environ['QUERY_STRING'], keep_blank_values=True, strict_parsing=True) + args = urlparsequery(self.environ['QUERY_STRING'], keep_blank_values=True, strict_parsing=True) sha1 = args.get('sha1') if (len(args) == 1) and (sha1 is not None) and (len(sha1) == 1): sha1 = sha1[0] @@ -960,7 +954,7 @@ class MiniMawsApp(object): 'diskdumps': DiskDumpsRpcHandler } def __init__(self, dbfile, **kwargs): - super(MiniMawsApp, self).__init__(**kwargs) + super().__init__(**kwargs) self.dbconn = dbaccess.QueryConnection(dbfile) self.assetsdir = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), 'assets') if not mimetypes.inited: @@ -970,7 +964,7 @@ def __call__(self, environ, start_response): application_uri = wsgiref.util.application_uri(environ) if application_uri[-1] != '/': application_uri += '/' - module = wsgiref.util.shift_path_info(environ) + module = shiftpath(environ) if module == 'machine': return MachineHandler(self, application_uri, environ, start_response) elif module == 'sourcefile': @@ -982,7 +976,7 @@ def __call__(self, environ, start_response): elif module == 'static': return AssetHandler(self.assetsdir, self, application_uri, environ, start_response) elif module == 'rpc': - service = wsgiref.util.shift_path_info(environ) + service = shiftpath(environ) if not service: return ErrorPageHandler(403, self, application_uri, environ, start_response) elif service in self.RPC_SERVICES: diff --git a/scripts/minimaws/minimaws.py b/scripts/minimaws/minimaws.py index 2d91cdcf1a878..72e1803ed8e22 100755 --- a/scripts/minimaws/minimaws.py +++ b/scripts/minimaws/minimaws.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 37db2a904a887..8096a16118982 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2010,6 +2010,8 @@ if (BUSES["MSX_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/msx/slot/music.h", MAME_DIR .. "src/devices/bus/msx/slot/panasonic08.cpp", MAME_DIR .. "src/devices/bus/msx/slot/panasonic08.h", + MAME_DIR .. "src/devices/bus/msx/slot/panasonic08r.cpp", + MAME_DIR .. "src/devices/bus/msx/slot/panasonic08r.h", MAME_DIR .. "src/devices/bus/msx/slot/rom.cpp", MAME_DIR .. "src/devices/bus/msx/slot/rom.h", MAME_DIR .. "src/devices/bus/msx/slot/ram.cpp", @@ -2576,6 +2578,20 @@ if (BUSES["SS50"]~=null) then } end +--------------------------------------------------- +-- +--@src/devices/bus/supracan/slot.h,BUSES["SUPRACAN"] = true +--------------------------------------------------- + +if (BUSES["SUPRACAN"]~=null) then + files { + MAME_DIR .. "src/devices/bus/supracan/slot.cpp", + MAME_DIR .. "src/devices/bus/supracan/slot.h", + MAME_DIR .. "src/devices/bus/supracan/rom.cpp", + MAME_DIR .. "src/devices/bus/supracan/rom.h", + } +end + --------------------------------------------------- -- @@ -2849,6 +2865,8 @@ if (BUSES["VME"]~=null) then MAME_DIR .. "src/devices/bus/vme/mvme187.h", MAME_DIR .. "src/devices/bus/vme/mvme327a.cpp", MAME_DIR .. "src/devices/bus/vme/mvme327a.h", + MAME_DIR .. "src/devices/bus/vme/mvme328.cpp", + MAME_DIR .. "src/devices/bus/vme/mvme328.h", MAME_DIR .. "src/devices/bus/vme/mvme350.cpp", MAME_DIR .. "src/devices/bus/vme/mvme350.h", MAME_DIR .. "src/devices/bus/vme/mzr8105.cpp", @@ -3027,6 +3045,8 @@ if (BUSES["A2BUS"]~=null) then MAME_DIR .. "src/devices/bus/a2bus/a2videoterm.h", MAME_DIR .. "src/devices/bus/a2bus/a2vulcan.cpp", MAME_DIR .. "src/devices/bus/a2bus/a2vulcan.h", + MAME_DIR .. "src/devices/bus/a2bus/a2wico_trackball.cpp", + MAME_DIR .. "src/devices/bus/a2bus/a2wico_trackball.h", MAME_DIR .. "src/devices/bus/a2bus/a2zipdrive.cpp", MAME_DIR .. "src/devices/bus/a2bus/a2zipdrive.h", MAME_DIR .. "src/devices/bus/a2bus/ace2x00.cpp", @@ -3121,6 +3141,8 @@ end if (BUSES["A2GAMEIO"]~=null) then files { + MAME_DIR .. "src/devices/bus/a2gameio/brightpen.cpp", + MAME_DIR .. "src/devices/bus/a2gameio/brightpen.h", MAME_DIR .. "src/devices/bus/a2gameio/computereyes.cpp", MAME_DIR .. "src/devices/bus/a2gameio/computereyes.h", MAME_DIR .. "src/devices/bus/a2gameio/gameio.cpp", @@ -3129,10 +3151,14 @@ if (BUSES["A2GAMEIO"]~=null) then MAME_DIR .. "src/devices/bus/a2gameio/joystick.h", MAME_DIR .. "src/devices/bus/a2gameio/joyport.cpp", MAME_DIR .. "src/devices/bus/a2gameio/joyport.h", + MAME_DIR .. "src/devices/bus/a2gameio/joyport_paddles.cpp", + MAME_DIR .. "src/devices/bus/a2gameio/joyport_paddles.h", MAME_DIR .. "src/devices/bus/a2gameio/paddles.cpp", MAME_DIR .. "src/devices/bus/a2gameio/paddles.h", MAME_DIR .. "src/devices/bus/a2gameio/gizmo.cpp", MAME_DIR .. "src/devices/bus/a2gameio/gizmo.h", + MAME_DIR .. "src/devices/bus/a2gameio/wico_joystick.cpp", + MAME_DIR .. "src/devices/bus/a2gameio/wico_joystick.h", } end @@ -4211,14 +4237,14 @@ if (BUSES["BML3"]~=null) then files { MAME_DIR .. "src/devices/bus/bml3/bml3bus.cpp", MAME_DIR .. "src/devices/bus/bml3/bml3bus.h", - MAME_DIR .. "src/devices/bus/bml3/bml3mp1802.cpp", - MAME_DIR .. "src/devices/bus/bml3/bml3mp1802.h", - MAME_DIR .. "src/devices/bus/bml3/bml3mp1805.cpp", - MAME_DIR .. "src/devices/bus/bml3/bml3mp1805.h", - MAME_DIR .. "src/devices/bus/bml3/bml3kanji.cpp", - MAME_DIR .. "src/devices/bus/bml3/bml3kanji.h", - MAME_DIR .. "src/devices/bus/bml3/bml3rtc.cpp", - MAME_DIR .. "src/devices/bus/bml3/bml3rtc.h", + MAME_DIR .. "src/devices/bus/bml3/mp1802.cpp", + MAME_DIR .. "src/devices/bus/bml3/mp1802.h", + MAME_DIR .. "src/devices/bus/bml3/mp1805.cpp", + MAME_DIR .. "src/devices/bus/bml3/mp1805.h", + MAME_DIR .. "src/devices/bus/bml3/kanji.cpp", + MAME_DIR .. "src/devices/bus/bml3/kanji.h", + MAME_DIR .. "src/devices/bus/bml3/rtc.cpp", + MAME_DIR .. "src/devices/bus/bml3/rtc.h", } end @@ -5619,6 +5645,8 @@ if (BUSES["PCI"]~=null) then MAME_DIR .. "src/devices/bus/pci/mga2064w.h", MAME_DIR .. "src/devices/bus/pci/ncr53c825.cpp", MAME_DIR .. "src/devices/bus/pci/ncr53c825.h", + MAME_DIR .. "src/devices/bus/pci/neon250.cpp", + MAME_DIR .. "src/devices/bus/pci/neon250.h", MAME_DIR .. "src/devices/bus/pci/oti_spitfire.cpp", MAME_DIR .. "src/devices/bus/pci/oti_spitfire.h", MAME_DIR .. "src/devices/bus/pci/opti82c861.cpp", diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 85de8acd3c8aa..8fee66cc946c0 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -855,6 +855,24 @@ if opt_tool(CPUS, "HMCS40") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/hmcs40/hmcs40d.h") end +-------------------------------------------------- +-- Hitachi HMCS400 series +--@src/devices/cpu/hmcs400/hmcs400.h,CPUS["HMCS400"] = true +-------------------------------------------------- + +if CPUS["HMCS400"] then + files { + MAME_DIR .. "src/devices/cpu/hmcs400/hmcs400.cpp", + MAME_DIR .. "src/devices/cpu/hmcs400/hmcs400.h", + MAME_DIR .. "src/devices/cpu/hmcs400/hmcs400op.cpp", + } +end + +if opt_tool(CPUS, "HMCS400") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/hmcs400/hmcs400d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/hmcs400/hmcs400d.h") +end + -------------------------------------------------- -- Hitachi SuperH series (SH1/SH2/SH3/SH4) --@src/devices/cpu/sh/sh2.h,CPUS["SH"] = true @@ -1395,6 +1413,23 @@ if opt_tool(CPUS, "DIABLO") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/diablo/diablo1300dasm.h") end +-------------------------------------------------- +-- KL1839VM1 +--@src/devices/cpu/mpk1839/kl1839vm1.h,CPUS["KL1839VM1"] = true +-------------------------------------------------- + +if CPUS["KL1839VM1"] then + files { + MAME_DIR .. "src/devices/cpu/mpk1839/kl1839vm1.cpp", + MAME_DIR .. "src/devices/cpu/mpk1839/kl1839vm1.h", + } +end + +if opt_tool(CPUS, "KL1839VM1") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/mpk1839/kl1839vm1dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/mpk1839/kl1839vm1dasm.h") +end + -------------------------------------------------- -- Fujitsu MB88xx --@src/devices/cpu/mb88xx/mb88xx.h,CPUS["MB88XX"] = true @@ -2972,6 +3007,14 @@ end -------------------------------------------------- -- Zilog Z80 --@src/devices/cpu/z80/z80.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/tmpz84c011.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/tmpz84c015.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/ez80.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/lz8420m.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/mc8123.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/nsc800.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/r800.h,CPUS["Z80"] = true +--@src/devices/cpu/z80/z84c015.h,CPUS["Z80"] = true --@src/devices/cpu/z80/z80n.h,CPUS["Z80N"] = true --@src/devices/cpu/z80/kc82.h,CPUS["KC80"] = true --@src/devices/cpu/z80/kl5c80a12.h,CPUS["KC80"] = true @@ -2993,6 +3036,8 @@ if CPUS["Z80"] or CPUS["KC80"] or CPUS["Z80N"] then MAME_DIR .. "src/devices/cpu/z80/lz8420m.h", MAME_DIR .. "src/devices/cpu/z80/mc8123.cpp", MAME_DIR .. "src/devices/cpu/z80/mc8123.h", + MAME_DIR .. "src/devices/cpu/z80/nsc800.cpp", + MAME_DIR .. "src/devices/cpu/z80/nsc800.h", MAME_DIR .. "src/devices/cpu/z80/r800.cpp", MAME_DIR .. "src/devices/cpu/z80/r800.h", MAME_DIR .. "src/devices/cpu/z80/z84c015.cpp", @@ -3001,7 +3046,7 @@ if CPUS["Z80"] or CPUS["KC80"] or CPUS["Z80N"] then dependency { { MAME_DIR .. "src/devices/cpu/z80/z80.cpp", GEN_DIR .. "emu/cpu/z80/z80.hxx" }, - { MAME_DIR .. "src/devices/cpu/z80/z80.cpp", GEN_DIR .. "emu/cpu/z80/ncs800.hxx" }, + { MAME_DIR .. "src/devices/cpu/z80/nsc800.cpp", GEN_DIR .. "emu/cpu/z80/ncs800.hxx" }, { MAME_DIR .. "src/devices/cpu/z80/r800.cpp", GEN_DIR .. "emu/cpu/z80/r800.hxx" }, } diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index 431783ccb7460..054d87a266f39 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -1765,3 +1765,15 @@ if (SOUNDS["CF61909"]~=null) then MAME_DIR .. "src/devices/sound/cf61909.h", } end + +--------------------------------------------------- +-- NEC uPD65043GF-U01 +--@src/devices/sound/upd65043gfu01.h,SOUNDS["UPD65043GFU01"] = true +--------------------------------------------------- + +if (SOUNDS["UPD65043GFU01"]~=null) then + files { + MAME_DIR .. "src/devices/sound/upd65043gfu01.cpp", + MAME_DIR .. "src/devices/sound/upd65043gfu01.h", + } +end diff --git a/src/devices/bus/a2bus/a2wico_trackball.cpp b/src/devices/bus/a2bus/a2wico_trackball.cpp new file mode 100644 index 0000000000000..b2c266149e7ee --- /dev/null +++ b/src/devices/bus/a2bus/a2wico_trackball.cpp @@ -0,0 +1,245 @@ +// license:BSD-3-Clause +/********************************************************************* + + a2wicotrackball.cpp + + Implemention of the Wico Trackball + + Wico Trackball Interface PCB + Wico 1983 + + This is a trackball interface for the Apple II + + For API information, see: + Track Balls, Bill Morgan, Apple Assembly Line, Vol. 3, Iss. 9, June 1983 + +*********************************************************************/ + +#include "emu.h" +#include "a2wico_trackball.h" + +namespace { + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class a2bus_wicotrackball_device: + public device_t, + public device_a2bus_card_interface +{ +public: + // construction/destruction + a2bus_wicotrackball_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + +protected: + a2bus_wicotrackball_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; + + // overrides of standard a2bus slot functions + virtual uint8_t read_c0nx(uint8_t offset) override; + virtual void write_c0nx(uint8_t offset, uint8_t data) override; + +private: + uint8_t read_position(int axis); + + required_ioport m_wicotrackballb; + required_ioport_array<2> m_wicotrackballxy; + + bool m_speed[2]; + uint8_t m_buttons; + bool m_wraparound; + uint8_t m_axis[2]; + uint32_t m_last_pos[2]; +}; + +/*************************************************************************** + CONSTANTS +***************************************************************************/ + +#define WICOTRACKBALL_BUTTONS_TAG "a2wicotrackball_buttons" +#define WICOTRACKBALL_XAXIS_TAG "a2wicotrackball_x" +#define WICOTRACKBALL_YAXIS_TAG "a2wicotrackball_y" + +#define WICOTRACKBALL_POS_UNINIT 0xffffffff /* default out-of-range position */ + +static INPUT_PORTS_START( wicotrackball ) + PORT_START(WICOTRACKBALL_BUTTONS_TAG) /* Trackball - buttons */ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Trackball Button 1") PORT_CODE(MOUSECODE_BUTTON1) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Trackball Button 2") PORT_CODE(MOUSECODE_BUTTON2) + + PORT_START(WICOTRACKBALL_XAXIS_TAG) /* Trackball - X AXIS */ + PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) + + PORT_START(WICOTRACKBALL_YAXIS_TAG) /* Trackball - Y AXIS */ + PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) +INPUT_PORTS_END + + +/*************************************************************************** + DEVICE CONFIGURATION +***************************************************************************/ + +/*------------------------------------------------- + input_ports - device-specific input ports +-------------------------------------------------*/ + +ioport_constructor a2bus_wicotrackball_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(wicotrackball); +} + +/*************************************************************************** + LIVE DEVICE +***************************************************************************/ + +a2bus_wicotrackball_device::a2bus_wicotrackball_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + device_a2bus_card_interface(mconfig, *this), + m_wicotrackballb(*this, WICOTRACKBALL_BUTTONS_TAG), m_wicotrackballxy(*this, { WICOTRACKBALL_XAXIS_TAG, WICOTRACKBALL_YAXIS_TAG }), + m_speed{ false, false }, m_buttons{ 0 }, m_wraparound{false}, m_axis{ 0, 0 }, + m_last_pos{ WICOTRACKBALL_POS_UNINIT, WICOTRACKBALL_POS_UNINIT } +{ +} + +a2bus_wicotrackball_device::a2bus_wicotrackball_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + a2bus_wicotrackball_device(mconfig, A2BUS_WICOTRACKBALL, tag, owner, clock) +{ +} + +/*------------------------------------------------- + device_start - device-specific startup +-------------------------------------------------*/ + +void a2bus_wicotrackball_device::device_start() +{ + // register save state variables + save_item(NAME(m_speed)); + save_item(NAME(m_wraparound)); + save_item(NAME(m_buttons)); + save_item(NAME(m_axis)); + save_item(NAME(m_last_pos)); +} + +void a2bus_wicotrackball_device::device_reset() +{ + m_speed[0] = m_speed[1] = false; + m_wraparound = false; + m_buttons = 0; + m_axis[0] = m_axis[1] = 0; +} + +uint8_t a2bus_wicotrackball_device::read_position(int axis) +{ + int const speed_scale = 1 << (m_speed[0] + m_speed[1] * 2); + int const cur_pos = m_wicotrackballxy[axis]->read(); + + uint8_t result = 0; + if (m_last_pos[axis] != WICOTRACKBALL_POS_UNINIT) { + int diff_pos = cur_pos - m_last_pos[axis]; + + // wrap-around the positoin + if (diff_pos > 0x7f) { + diff_pos -= 0x100; + } else if (diff_pos < -0x80) { + diff_pos += 0x100; + } + + int const updated_axis = int(unsigned(m_axis[axis])) + diff_pos / speed_scale;; + if (m_wraparound) { + result = unsigned(updated_axis); + } else { + result = unsigned(std::clamp(updated_axis, 0, 0xff)); + } + if (!machine().side_effects_disabled()) { + m_axis[axis] = result; + } + } + if (!machine().side_effects_disabled()) { + m_last_pos[axis] = cur_pos; + } + + return result; +} + +/*------------------------------------------------- + read_c0nx - called for reads from this card's c0nx space +-------------------------------------------------*/ + +uint8_t a2bus_wicotrackball_device::read_c0nx(uint8_t offset) +{ + uint8_t data = 0; + + switch (offset) { + case 0x0: /* read X-position */ + data = read_position(0); + break; + case 0x1: /* read Y-position */ + data = read_position(1); + break; + case 0x2: /* set Bounded/Wraparound Soft Switch to Bounded */ + if (!machine().side_effects_disabled()) { + m_wraparound = false; + } + break; + case 0x3: /* set Bounded/Wraparound Soft Switch to Wraparound */ + if (!machine().side_effects_disabled()) { + m_wraparound = true; + } + break; + case 0x6: /* read buttons */ + data = m_buttons = m_wicotrackballb->read(); + break; + } + return data; +} + +/*------------------------------------------------- + write_c0nx - called for writes to this card's c0nx space +-------------------------------------------------*/ + +void a2bus_wicotrackball_device::write_c0nx(uint8_t offset, uint8_t data) +{ + switch (offset) { + case 0x0: /* set X-position */ + m_last_pos[0] = m_wicotrackballxy[0]->read(); + m_axis[0] = data; + break; + case 0x1: /* set Y-position */ + m_last_pos[1] = m_wicotrackballxy[1]->read(); + m_axis[1] = data; + break; + case 0x2: /* set Bounded/Wraparound Soft Switch to Bounded */ + m_wraparound = false; + break; + case 0x3: /* set Bounded/Wraparound Soft Switch to Wraparound */ + m_wraparound = true; + break; + case 0x4: /* set Speed 1/2 Soft Switch to Speed 1 */ + m_speed[0] = false; + break; + case 0x5: /* set Speed 1/2 Soft Switch to Speed 2 */ + m_speed[0] = true; + break; + case 0x6: /* set Speed 3/4 Soft Switch to Speed 3 */ + m_speed[1] = false; + break; + case 0x7: /* set Speed 3/4 Soft Switch to Speed 4 */ + m_speed[1] = true; + break; + } +} + +} // anonymous namespace + + +/*************************************************************************** + GLOBAL VARIABLES +***************************************************************************/ + +DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_WICOTRACKBALL, device_a2bus_card_interface, a2bus_wicotrackball_device, "a2wicotrackball", "Apple II Wico Trackball Card") diff --git a/src/devices/bus/a2bus/a2wico_trackball.h b/src/devices/bus/a2bus/a2wico_trackball.h new file mode 100644 index 0000000000000..9fb689bfe8f29 --- /dev/null +++ b/src/devices/bus/a2bus/a2wico_trackball.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +/********************************************************************* + + a2wicotrackball.h + + Implemention of the Wico Apple II Trackball + +*********************************************************************/ + +#ifndef MAME_DEVICES_A2BUS_A2WICO_TRACKBALL_H +#define MAME_DEVICES_A2BUS_A2WICO_TRACKBALL_H + +#pragma once + +#include "a2bus.h" + +// device type definition +DECLARE_DEVICE_TYPE(A2BUS_WICOTRACKBALL, device_a2bus_card_interface) + +#endif // MAME_DEVICES_A2BUS_A2WICO_TRACKBALL_H diff --git a/src/devices/bus/a2bus/cards.cpp b/src/devices/bus/a2bus/cards.cpp index 5ab855ddf5e7f..cc2380fd45542 100644 --- a/src/devices/bus/a2bus/cards.cpp +++ b/src/devices/bus/a2bus/cards.cpp @@ -41,6 +41,7 @@ #include "a2ultraterm.h" #include "a2videoterm.h" #include "a2vulcan.h" +#include "a2wico_trackball.h" #include "a2zipdrive.h" #include "booti.h" #include "byte8251.h" @@ -153,6 +154,7 @@ void apple2_cards(device_slot_interface &device) device.option_add("grafex", A2BUS_GRAFEX); // Grafex card (uPD7220 graphics) device.option_add("excel9", A2BUS_EXCEL9); // Excel-9 (6809 coprocessor) device.option_add("vistaa800", A2BUS_VISTAA800); // Vista A800 8" Disk Controller Card + device.option_add("wicotrackball", A2BUS_WICOTRACKBALL); // Wico Trackball } void apple2e_cards(device_slot_interface &device) @@ -234,6 +236,7 @@ void apple2e_cards(device_slot_interface &device) device.option_add("pdromdrive", A2BUS_PRODOSROMDRIVE); // ProDOS ROM Drive device.option_add("superdrive", A2BUS_SUPERDRIVE); // Apple II 3.5" Disk Controller device.option_add("vistaa800", A2BUS_VISTAA800); // Vista A800 8" Disk Controller Card + device.option_add("wicotrackball", A2BUS_WICOTRACKBALL); // Wico Trackball } void apple2gs_cards(device_slot_interface &device) @@ -309,6 +312,7 @@ void apple2gs_cards(device_slot_interface &device) device.option_add("grafex", A2BUS_GRAFEX); // Grafex card (uPD7220 graphics) device.option_add("pdromdrive", A2BUS_PRODOSROMDRIVE); // ProDOS ROM Drive device.option_add("superdrive", A2BUS_SUPERDRIVE); // Apple II 3.5" Disk Controller + device.option_add("wicotrackball", A2BUS_WICOTRACKBALL); // Wico Trackball } void apple3_cards(device_slot_interface &device) diff --git a/src/devices/bus/a2gameio/brightpen.cpp b/src/devices/bus/a2gameio/brightpen.cpp new file mode 100644 index 0000000000000..6429b16b5f23f --- /dev/null +++ b/src/devices/bus/a2gameio/brightpen.cpp @@ -0,0 +1,140 @@ +// license:BSD-3-Clause +// copyright-holders:kmg +/********************************************************************* + + Apple II Softape Bright Pen interface for the Apple ][/][+ + +*********************************************************************/ + +#include "emu.h" +#include "bus/a2gameio/brightpen.h" +#include "screen.h" + + +namespace { + +#define BRIGHTPEN_POINT "BRIGHTPEN_POINT" +#define BRIGHTPEN_X "BRIGHTPEN_X" +#define BRIGHTPEN_Y "BRIGHTPEN_Y" + +// ======================> apple2_brightpen_device + +class apple2_brightpen_device : public device_t, public device_a2gameio_interface +{ +public: + // construction/destruction + apple2_brightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, APPLE2_BRIGHTPEN, tag, owner, clock) + , device_a2gameio_interface(mconfig, *this) + , m_brightpen_point(*this, BRIGHTPEN_POINT) + , m_brightpen_x(*this, BRIGHTPEN_X) + , m_brightpen_y(*this, BRIGHTPEN_Y) + { + } + +protected: + // device_t implementation + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + + // device_a2gameio_interface implementation + virtual int sw0_r() override; + +private: + // input ports + required_ioport m_brightpen_point; + required_ioport m_brightpen_x; + required_ioport m_brightpen_y; + + // radius of circle picked up by the bright pen + static constexpr int PEN_X_RADIUS = 2; + static constexpr int PEN_Y_RADIUS = 1; + // brightness threshold + static constexpr int BRIGHTNESS_THRESHOLD = 0x20; + // # of CRT scanlines that sustain brightness + static constexpr int SUSTAIN = 22; +}; + +//************************************************************************** +// INPUT PORTS +//************************************************************************** + +static INPUT_PORTS_START( apple2_brightpen ) + PORT_START(BRIGHTPEN_X) + PORT_BIT( 0x3ff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15) PORT_MINMAX(0, 559) PORT_NAME("Bright Pen X") + PORT_START(BRIGHTPEN_Y) + PORT_BIT( 0x3ff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15) PORT_MINMAX(0, 191) PORT_NAME("Bright Pen Y") + PORT_START(BRIGHTPEN_POINT) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Bright Pen pointed at screen") + PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + +ioport_constructor apple2_brightpen_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(apple2_brightpen); +} + +void apple2_brightpen_device::device_start() +{ +} + +// light detection logic based on zapper_sensor.cpp nes_zapper_sensor_device::detect_light + +int apple2_brightpen_device::sw0_r() +{ + if (!BIT(m_brightpen_point->read(), 0)) return 0; + + int pen_x_pos = m_brightpen_x->read(); + int pen_y_pos = m_brightpen_y->read(); + int beam_vpos = m_screen->vpos(); + int beam_hpos = m_screen->hpos(); + + // update the screen if the beam position is within the radius of the pen + if (!machine().side_effects_disabled()) + { + if (!m_screen->vblank()) + { + if (beam_vpos > pen_y_pos - PEN_Y_RADIUS || (beam_vpos == pen_y_pos - PEN_Y_RADIUS && beam_hpos >= pen_x_pos - PEN_X_RADIUS)) + { + m_screen->update_now(); + } + } + } + + int brightness_sum = 0; + int pixels_scanned = 0; + + // sum brightness of pixels nearby the pen position + for (int i = pen_x_pos - PEN_X_RADIUS; i <= pen_x_pos + PEN_X_RADIUS; i++) + { + for (int j = pen_y_pos - PEN_Y_RADIUS; j <= pen_y_pos + PEN_Y_RADIUS; j++) + { + // look at pixels within circular sensor + if ((pen_x_pos - i) * (pen_x_pos - i) + (pen_y_pos - j) * (pen_y_pos - j) <= PEN_X_RADIUS * PEN_Y_RADIUS) + { + rgb_t pix = m_screen->pixel(i, j); + + // only detect light if pen position is near, and behind, + // where the video generator is drawing on the CRT, + if (j <= beam_vpos && j > beam_vpos - SUSTAIN && (j != beam_vpos || i <= beam_hpos)) + { + brightness_sum += pix.r() + pix.g() + pix.b(); + } + pixels_scanned++; + } + } + } + + // light detected if average brightness is above threshold + return (brightness_sum >= BRIGHTNESS_THRESHOLD * pixels_scanned); +} + +} // anonymous namespace + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_BRIGHTPEN, device_a2gameio_interface, apple2_brightpen_device, "a2brightpen", "Softape Bright Pen") diff --git a/src/devices/bus/a2gameio/brightpen.h b/src/devices/bus/a2gameio/brightpen.h new file mode 100644 index 0000000000000..9c47c3d47d4e3 --- /dev/null +++ b/src/devices/bus/a2gameio/brightpen.h @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +/********************************************************************* + + Apple II Softape Bright Pen interface for a lightpen + +*********************************************************************/ + +#ifndef MAME_BUS_A2GAMEIO_BRIGHTPEN_H +#define MAME_BUS_A2GAMEIO_BRIGHTPEN_H + +#pragma once + +#include "bus/a2gameio/gameio.h" + +// device type declaration +DECLARE_DEVICE_TYPE(APPLE2_BRIGHTPEN, device_a2gameio_interface) + +#endif // MAME_BUS_A2GAMEIO_BRIGHTPEN_H diff --git a/src/devices/bus/a2gameio/gameio.cpp b/src/devices/bus/a2gameio/gameio.cpp index 6645458f52313..fa1f1accf71c1 100644 --- a/src/devices/bus/a2gameio/gameio.cpp +++ b/src/devices/bus/a2gameio/gameio.cpp @@ -50,11 +50,14 @@ #include "emu.h" #include "bus/a2gameio/gameio.h" +#include "bus/a2gameio/brightpen.h" #include "bus/a2gameio/joystick.h" #include "bus/a2gameio/joyport.h" +#include "bus/a2gameio/joyport_paddles.h" #include "bus/a2gameio/computereyes.h" #include "bus/a2gameio/paddles.h" #include "bus/a2gameio/gizmo.h" +#include "bus/a2gameio/wico_joystick.h" //************************************************************************** // CONNECTOR DEVICE IMPLEMENTATION @@ -66,6 +69,7 @@ DEFINE_DEVICE_TYPE(APPLE2_GAMEIO, apple2_gameio_device, "a2gameio", "Apple II Ga apple2_gameio_device::apple2_gameio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, APPLE2_GAMEIO, tag, owner, clock) , device_single_card_slot_interface(mconfig, *this) + , m_screen(*this, finder_base::DUMMY_TAG) , m_intf(nullptr) , m_sw_pullups(false) { @@ -76,8 +80,11 @@ void apple2_gameio_device::iiandplus_options(device_slot_interface &slot) slot.option_add("joy", APPLE2_JOYSTICK); slot.option_add("paddles", APPLE2_PADDLES); slot.option_add("joyport", APPLE2_JOYPORT); + slot.option_add("joyport_paddles", APPLE2_JOYPORT_PADDLES); slot.option_add("gizmo", APPLE2_GIZMO); slot.option_add("compeyes", APPLE2_COMPUTEREYES); + slot.option_add("wicojoy", APPLE2_WICO_JOYSTICK); + slot.option_add("brightpen", APPLE2_BRIGHTPEN); } void apple2_gameio_device::default_options(device_slot_interface &slot) @@ -101,8 +108,10 @@ void apple2_gameio_device::device_config_complete() void apple2_gameio_device::device_resolve_objects() { - if (m_intf) + if (m_intf) { m_intf->m_connector = this; + m_intf->set_screen(m_screen); + } } void apple2_gameio_device::device_start() diff --git a/src/devices/bus/a2gameio/gameio.h b/src/devices/bus/a2gameio/gameio.h index 1f8d53a8c204b..dfe2f3716bddc 100644 --- a/src/devices/bus/a2gameio/gameio.h +++ b/src/devices/bus/a2gameio/gameio.h @@ -11,6 +11,7 @@ #pragma once +#include "screen.h" //************************************************************************** // TYPE DEFINITIONS @@ -37,6 +38,13 @@ class apple2_gameio_device : public device_t, public device_single_card_slot_int set_fixed(false); } + template + apple2_gameio_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&screen_tag, U &&opts, const char *dflt) + : apple2_gameio_device(mconfig, tag, owner, opts, dflt) + { + m_screen.set_tag(std::forward(screen_tag)); + } + // configuration void set_sw_pullups(bool enabled) { m_sw_pullups = enabled; } bool has_sw_pullups() const { return m_sw_pullups; } @@ -77,6 +85,8 @@ class apple2_gameio_device : public device_t, public device_single_card_slot_int virtual void device_resolve_objects() override; virtual void device_start() override; + optional_device m_screen; + private: // selected device device_a2gameio_interface *m_intf; @@ -115,6 +125,8 @@ class device_a2gameio_interface : public device_interface virtual void an4_w(int state) { } virtual void strobe_w(int state) { } + void set_screen(screen_device *screen) { m_screen = screen; } + screen_device *m_screen; private: apple2_gameio_device *m_connector; }; diff --git a/src/devices/bus/a2gameio/joyport_paddles.cpp b/src/devices/bus/a2gameio/joyport_paddles.cpp new file mode 100644 index 0000000000000..92fbe9083cf60 --- /dev/null +++ b/src/devices/bus/a2gameio/joyport_paddles.cpp @@ -0,0 +1,133 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + Sirius JoyPort with 4 Apple II paddles connected + +*********************************************************************/ + +#include "emu.h" +#include "bus/a2gameio/joyport_paddles.h" + + +namespace { + +// ======================> apple2_joyport_paddles_device + +class apple2_joyport_paddles_device : public device_t, public device_a2gameio_interface +{ +public: + // construction/destruction + apple2_joyport_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_t implementation + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + + // device_a2gameio_interface implementation + virtual u8 pdl0_r() override; + virtual u8 pdl1_r() override; + virtual u8 pdl2_r() override; + virtual u8 pdl3_r() override; + virtual int sw0_r() override; + virtual int sw1_r() override; + virtual void an0_w(int state) override; + +private: + // input ports + required_ioport_array<4> m_pdl; + required_ioport m_buttons; + int m_an0; +}; + +//************************************************************************** +// INPUT PORTS +//************************************************************************** + +static INPUT_PORTS_START( apple2_joyport_paddles ) + PORT_START("paddle_1") + PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(1) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) + + PORT_START("paddle_2") + PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(2) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) + + PORT_START("paddle_3") + PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(3) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) + + PORT_START("paddle_4") + PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(4) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) + + PORT_START("paddle_buttons") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(3) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(4) +INPUT_PORTS_END + +//************************************************************************** +// DEVICE IMPLEMENTATION +//************************************************************************** + +apple2_joyport_paddles_device::apple2_joyport_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, APPLE2_JOYPORT_PADDLES, tag, owner, clock) + , device_a2gameio_interface(mconfig, *this) + , m_pdl(*this, "paddle_%u", 1U) + , m_buttons(*this, "paddle_buttons") +{ +} + +ioport_constructor apple2_joyport_paddles_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(apple2_joyport_paddles); +} + +void apple2_joyport_paddles_device::device_start() +{ + save_item(NAME(m_an0)); +} + +u8 apple2_joyport_paddles_device::pdl0_r() +{ + return m_pdl[0]->read(); +} + +u8 apple2_joyport_paddles_device::pdl1_r() +{ + return m_pdl[1]->read(); +} + +u8 apple2_joyport_paddles_device::pdl2_r() +{ + return m_pdl[2]->read(); +} + +u8 apple2_joyport_paddles_device::pdl3_r() +{ + return m_pdl[3]->read(); +} + +int apple2_joyport_paddles_device::sw0_r() +{ + return m_an0 ? BIT(m_buttons->read(), 6) : BIT(m_buttons->read(), 4); +} + +int apple2_joyport_paddles_device::sw1_r() +{ + return m_an0 ? BIT(m_buttons->read(), 7) : BIT(m_buttons->read(), 5); +} + +void apple2_joyport_paddles_device::an0_w(int state) +{ + m_an0 = state; +} + +} // anonymous namespace + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_JOYPORT_PADDLES, device_a2gameio_interface, apple2_joyport_paddles_device, "a2joyprtpdls", "Sirius JoyPort with Apple II paddles") diff --git a/src/devices/bus/a2gameio/joyport_paddles.h b/src/devices/bus/a2gameio/joyport_paddles.h new file mode 100644 index 0000000000000..01380a6198c7f --- /dev/null +++ b/src/devices/bus/a2gameio/joyport_paddles.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + Sirius JoyPort with 4 Apple II paddles connected + +*********************************************************************/ + +#ifndef MAME_BUS_A2GAMEIO_JOYPORT_PADDLES_H +#define MAME_BUS_A2GAMEIO_JOYPORT_PADDLES_H + +#pragma once + +#include "bus/a2gameio/gameio.h" + +// device type declaration +DECLARE_DEVICE_TYPE(APPLE2_JOYPORT_PADDLES, device_a2gameio_interface) + +#endif // MAME_BUS_A2GAMEIO_JOYPORT_PADDLES_H diff --git a/src/devices/bus/a2gameio/wico_joystick.cpp b/src/devices/bus/a2gameio/wico_joystick.cpp new file mode 100644 index 0000000000000..85612d2c7a74a --- /dev/null +++ b/src/devices/bus/a2gameio/wico_joystick.cpp @@ -0,0 +1,128 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + Apple II Wico Command Control Joystick Adapter for Atari-style + digital joysticks + +*********************************************************************/ + +#include "emu.h" +#include "bus/a2gameio/wico_joystick.h" + +namespace { + +// ======================> apple2_wico_joystick_device + +class apple2_wico_joystick_device : public device_t, public device_a2gameio_interface +{ +public: + // construction/destruction + apple2_wico_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_t implementation + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + + // device_a2gameio_interface implementation + virtual u8 pdl0_r() override; + virtual u8 pdl1_r() override; + virtual u8 pdl2_r() override; + virtual u8 pdl3_r() override; + virtual int sw0_r() override; + virtual int sw1_r() override; + +private: + // input ports + required_ioport m_player1, m_player2; +}; + +//************************************************************************** +// PARAMETERS +//************************************************************************** + +#define JOYSTICK_DELTA 80 +#define JOYSTICK_SENSITIVITY 50 +#define JOYSTICK_AUTOCENTER 80 + +//************************************************************************** +// INPUT PORTS +//************************************************************************** + +static INPUT_PORTS_START( apple2_wico_joystick ) + PORT_START("joystick_p1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) + + PORT_START("joystick_p2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) +INPUT_PORTS_END + +//************************************************************************** +// DEVICE IMPLEMENTATION +//************************************************************************** + +apple2_wico_joystick_device::apple2_wico_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, APPLE2_WICO_JOYSTICK, tag, owner, clock) + , device_a2gameio_interface(mconfig, *this) + , m_player1(*this, "joystick_p1") + , m_player2(*this, "joystick_p2") +{ +} + +ioport_constructor apple2_wico_joystick_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(apple2_wico_joystick); +} + +void apple2_wico_joystick_device::device_start() +{ +} + +u8 apple2_wico_joystick_device::pdl0_r() +{ + return !BIT(m_player1->read(), 3) ? 0x00 : !BIT(m_player1->read(), 1) ? 0xff : 0x80; +} + +u8 apple2_wico_joystick_device::pdl1_r() +{ + return !BIT(m_player1->read(), 0) ? 0x00 : !BIT(m_player1->read(), 2) ? 0xff : 0x80; +} + +u8 apple2_wico_joystick_device::pdl2_r() +{ + return !BIT(m_player2->read(), 3) ? 0x00 : !BIT(m_player2->read(), 1) ? 0xff : 0x80; +} + +u8 apple2_wico_joystick_device::pdl3_r() +{ + return !BIT(m_player2->read(), 0) ? 0x00 : !BIT(m_player2->read(), 2) ? 0xff : 0x80; +} + +int apple2_wico_joystick_device::sw0_r() +{ + return !BIT(m_player1->read(), 4); +} + +int apple2_wico_joystick_device::sw1_r() +{ + return !BIT(m_player2->read(), 4); +} + +} // anonymous namespace + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_WICO_JOYSTICK, device_a2gameio_interface, apple2_wico_joystick_device, "a2wicojoy", "Wico Command Control Joystick Adapter") diff --git a/src/devices/bus/a2gameio/wico_joystick.h b/src/devices/bus/a2gameio/wico_joystick.h new file mode 100644 index 0000000000000..4c7203a317523 --- /dev/null +++ b/src/devices/bus/a2gameio/wico_joystick.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + Apple II Wico Command Control Joystick Adapter for Atari-style + digital joysticks + +*********************************************************************/ + +#ifndef MAME_BUS_A2GAMEIO_WICO_JOYSTICK_H +#define MAME_BUS_A2GAMEIO_WICO_JOYSTICK_H + +#pragma once + +#include "bus/a2gameio/gameio.h" + +// device type declaration +DECLARE_DEVICE_TYPE(APPLE2_WICO_JOYSTICK, device_a2gameio_interface) + +#endif // MAME_BUS_A2GAMEIO_WICO_JOYSTICK_H diff --git a/src/devices/bus/abckb/abc99.cpp b/src/devices/bus/abckb/abc99.cpp index a515ce5c8b01f..68b5410e4bc07 100644 --- a/src/devices/bus/abckb/abc99.cpp +++ b/src/devices/bus/abckb/abc99.cpp @@ -184,7 +184,7 @@ INPUT_CHANGED_MEMBER( abc99_device::keyboard_reset ) // INPUT_PORTS( abc99 ) //------------------------------------------------- -CUSTOM_INPUT_MEMBER( abc99_device::cursor_x4_r ) +ioport_value abc99_device::cursor_x4_r() { u8 cursor = m_cursor->read(); u8 data = 0; @@ -205,7 +205,7 @@ CUSTOM_INPUT_MEMBER( abc99_device::cursor_x4_r ) return data; } -CUSTOM_INPUT_MEMBER( abc99_device::cursor_x6_r ) +ioport_value abc99_device::cursor_x6_r() { u8 cursor = m_cursor->read(); u8 data = 0; diff --git a/src/devices/bus/abckb/abc99.h b/src/devices/bus/abckb/abc99.h index 8f47aa1c6e754..501c2d9065e51 100644 --- a/src/devices/bus/abckb/abc99.h +++ b/src/devices/bus/abckb/abc99.h @@ -33,8 +33,8 @@ class abc99_device : public device_t, // construction/destruction abc99_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_CUSTOM_INPUT_MEMBER( cursor_x4_r ); - DECLARE_CUSTOM_INPUT_MEMBER( cursor_x6_r ); + ioport_value cursor_x4_r(); + ioport_value cursor_x6_r(); DECLARE_INPUT_CHANGED_MEMBER( keyboard_reset ); diff --git a/src/devices/bus/amiga/keyboard/mitsumi.cpp b/src/devices/bus/amiga/keyboard/mitsumi.cpp index 0e6f219192dda..53577c3a35d30 100644 --- a/src/devices/bus/amiga/keyboard/mitsumi.cpp +++ b/src/devices/bus/amiga/keyboard/mitsumi.cpp @@ -117,7 +117,7 @@ class mitsumi_keyboard_base : public device_t, public device_amiga_keyboard_inte return m_kdat_in ^ 0x01U; } - CUSTOM_INPUT_MEMBER(cols_r) + ioport_value cols_r() { ioport_value result(0xffU); for (unsigned i = 0U; m_rows.size() > i; ++i) diff --git a/src/devices/bus/bbc/fdc/ams.cpp b/src/devices/bus/bbc/fdc/ams.cpp index 41f4c5a771ce8..cd3499c418d12 100644 --- a/src/devices/bus/bbc/fdc/ams.cpp +++ b/src/devices/bus/bbc/fdc/ams.cpp @@ -56,8 +56,8 @@ void bbc_ams3_device::device_add_mconfig(machine_config &config) m_fdc->hdl_wr_callback().set(FUNC(bbc_ams3_device::motor_w)); m_fdc->opt_wr_callback().set(FUNC(bbc_ams3_device::side_w)); // Hitachi HFD 305S - FLOPPY_CONNECTOR(config, m_floppy[0], "3dsdd", FLOPPY_3_DSDD, true, bbc_ams3_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, m_floppy[1], "3dsdd", FLOPPY_3_DSDD, false, bbc_ams3_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[0], "3dssd", FLOPPY_3_DSSD, true, bbc_ams3_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[1], "3dssd", FLOPPY_3_DSSD, false, bbc_ams3_device::floppy_formats).enable_sound(true); } diff --git a/src/devices/bus/bbc/tube/tube_arm7.cpp b/src/devices/bus/bbc/tube/tube_arm7.cpp index f67c89e4c7782..b7ec32aa78df3 100644 --- a/src/devices/bus/bbc/tube/tube_arm7.cpp +++ b/src/devices/bus/bbc/tube/tube_arm7.cpp @@ -155,8 +155,8 @@ void bbc_tube_arm7_device::update_interrupts() int firq = BIT(m_registers[INTERRUPT][4], 0) && m_efiq_state; int irq = BIT(m_registers[EXP_INTERRUPT][6], 28, 4) && m_exint3_state; - m_maincpu->set_input_line(ARM7_FIRQ_LINE, firq ? ASSERT_LINE : CLEAR_LINE); - m_maincpu->set_input_line(ARM7_IRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, firq ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } void bbc_tube_arm7_device::efiq_w(int state) diff --git a/src/devices/bus/bbc/tube/tube_arm7.h b/src/devices/bus/bbc/tube/tube_arm7.h index ff290127395a8..e908ac16a6740 100644 --- a/src/devices/bus/bbc/tube/tube_arm7.h +++ b/src/devices/bus/bbc/tube/tube_arm7.h @@ -14,7 +14,6 @@ #include "tube.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/ram.h" #include "machine/tube.h" diff --git a/src/devices/bus/bml3/bml3kanji.cpp b/src/devices/bus/bml3/kanji.cpp similarity index 99% rename from src/devices/bus/bml3/bml3kanji.cpp rename to src/devices/bus/bml3/kanji.cpp index 0e2f9cf7d3952..ecc466b2bdae9 100644 --- a/src/devices/bus/bml3/bml3kanji.cpp +++ b/src/devices/bus/bml3/kanji.cpp @@ -9,7 +9,7 @@ *********************************************************************/ #include "emu.h" -#include "bml3kanji.h" +#include "kanji.h" /*************************************************************************** diff --git a/src/devices/bus/bml3/bml3kanji.h b/src/devices/bus/bml3/kanji.h similarity index 100% rename from src/devices/bus/bml3/bml3kanji.h rename to src/devices/bus/bml3/kanji.h diff --git a/src/devices/bus/bml3/bml3mp1802.cpp b/src/devices/bus/bml3/mp1802.cpp similarity index 98% rename from src/devices/bus/bml3/bml3mp1802.cpp rename to src/devices/bus/bml3/mp1802.cpp index 9ee4c8a324811..30c39ae61d49d 100644 --- a/src/devices/bus/bml3/bml3mp1802.cpp +++ b/src/devices/bus/bml3/mp1802.cpp @@ -10,7 +10,7 @@ *********************************************************************/ #include "emu.h" -#include "bml3mp1802.h" +#include "mp1802.h" #include "softlist_dev.h" @@ -23,7 +23,7 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(BML3BUS_MP1802, bml3bus_mp1802_device, "bml3mp1802", "Hitachi MP-1802 Floppy Controller Card") +DEFINE_DEVICE_TYPE(BML3BUS_MP1802, bml3bus_mp1802_device, "bml3mp1802", "Hitachi MP-1802 5.25\" Floppy Controller Card") static void mp1802_floppies(device_slot_interface &device) { diff --git a/src/devices/bus/bml3/bml3mp1802.h b/src/devices/bus/bml3/mp1802.h similarity index 100% rename from src/devices/bus/bml3/bml3mp1802.h rename to src/devices/bus/bml3/mp1802.h diff --git a/src/devices/bus/bml3/bml3mp1805.cpp b/src/devices/bus/bml3/mp1805.cpp similarity index 93% rename from src/devices/bus/bml3/bml3mp1805.cpp rename to src/devices/bus/bml3/mp1805.cpp index e16c924a62de5..a836243cb9857 100644 --- a/src/devices/bus/bml3/bml3mp1805.cpp +++ b/src/devices/bus/bml3/mp1805.cpp @@ -5,13 +5,12 @@ bml3mp1805.c Hitachi MP-1805 floppy disk controller card for the MB-6890 - Floppy drive is attached - TODO: make sure disk can be read + Floppy drive is attached (single-sided, single density) *********************************************************************/ #include "emu.h" -#include "bml3mp1805.h" +#include "mp1805.h" #include "softlist_dev.h" @@ -24,7 +23,7 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(BML3BUS_MP1805, bml3bus_mp1805_device, "bml3mp1805", "Hitachi MP-1805 Floppy Controller Card") +DEFINE_DEVICE_TYPE(BML3BUS_MP1805, bml3bus_mp1805_device, "bml3mp1805", "Hitachi MP-1805 3\" Floppy Controller Card") ROM_START( mp1805 ) ROM_REGION(0x800, "mp1805_rom", 0) @@ -32,11 +31,9 @@ ROM_START( mp1805 ) ROM_LOAD( "mp1805.rom", 0x000, 0x800, BAD_DUMP CRC(b532d8d9) SHA1(6f1160356d5bf64b5926b1fdb60db414edf65f22)) ROM_END -// Although the drive is single-sided, D88 images are double-sided, -// so we need to allocate enough space or MAME will crash. void bml3bus_mp1805_device::floppy_drives(device_slot_interface &device) { - device.option_add("mb_6890", FLOPPY_3_DSDD); + device.option_add("mb_6890", FLOPPY_3_SSSD); } diff --git a/src/devices/bus/bml3/bml3mp1805.h b/src/devices/bus/bml3/mp1805.h similarity index 100% rename from src/devices/bus/bml3/bml3mp1805.h rename to src/devices/bus/bml3/mp1805.h diff --git a/src/devices/bus/bml3/bml3rtc.cpp b/src/devices/bus/bml3/rtc.cpp similarity index 99% rename from src/devices/bus/bml3/bml3rtc.cpp rename to src/devices/bus/bml3/rtc.cpp index 28971440f497e..37bf57718786a 100644 --- a/src/devices/bus/bml3/bml3rtc.cpp +++ b/src/devices/bus/bml3/rtc.cpp @@ -15,7 +15,7 @@ *********************************************************************/ #include "emu.h" -#include "bml3rtc.h" +#include "rtc.h" //************************************************************************** diff --git a/src/devices/bus/bml3/bml3rtc.h b/src/devices/bus/bml3/rtc.h similarity index 100% rename from src/devices/bus/bml3/bml3rtc.h rename to src/devices/bus/bml3/rtc.h diff --git a/src/devices/bus/coleco/controller/hand.cpp b/src/devices/bus/coleco/controller/hand.cpp index d5e4d72b6bc43..4456cabf4fe62 100644 --- a/src/devices/bus/coleco/controller/hand.cpp +++ b/src/devices/bus/coleco/controller/hand.cpp @@ -18,7 +18,7 @@ DEFINE_DEVICE_TYPE(COLECO_HAND_CONTROLLER, coleco_hand_controller_device, "coleco_hand", "ColecoVision Hand Controller") -CUSTOM_INPUT_MEMBER( coleco_hand_controller_device::keypad_r ) +ioport_value coleco_hand_controller_device::keypad_r() { uint8_t data = 0xf; uint16_t keypad = m_io_keypad->read(); diff --git a/src/devices/bus/coleco/controller/hand.h b/src/devices/bus/coleco/controller/hand.h index f65ad709106f7..50a18c598e9f5 100644 --- a/src/devices/bus/coleco/controller/hand.h +++ b/src/devices/bus/coleco/controller/hand.h @@ -31,7 +31,7 @@ class coleco_hand_controller_device : public device_t, // optional information overrides virtual ioport_constructor device_input_ports() const override; - DECLARE_CUSTOM_INPUT_MEMBER( keypad_r ); + ioport_value keypad_r(); protected: // device-level overrides diff --git a/src/devices/bus/coleco/controller/sac.cpp b/src/devices/bus/coleco/controller/sac.cpp index 7621897c78d3a..5860cefcc8b4c 100644 --- a/src/devices/bus/coleco/controller/sac.cpp +++ b/src/devices/bus/coleco/controller/sac.cpp @@ -18,7 +18,7 @@ DEFINE_DEVICE_TYPE(COLECO_SUPER_ACTION_CONTROLLER, coleco_super_action_controller_device, "coleco_sac", "ColecoVision Super Action Controller") -CUSTOM_INPUT_MEMBER( coleco_super_action_controller_device::keypad_r ) +ioport_value coleco_super_action_controller_device::keypad_r() { uint8_t data = 0xf; uint16_t keypad = m_io_keypad->read(); diff --git a/src/devices/bus/coleco/controller/sac.h b/src/devices/bus/coleco/controller/sac.h index 20078e33ef75f..5e5be1193f574 100644 --- a/src/devices/bus/coleco/controller/sac.h +++ b/src/devices/bus/coleco/controller/sac.h @@ -31,7 +31,7 @@ class coleco_super_action_controller_device : public device_t, // optional information overrides virtual ioport_constructor device_input_ports() const override; - DECLARE_CUSTOM_INPUT_MEMBER( keypad_r ); + ioport_value keypad_r(); DECLARE_INPUT_CHANGED_MEMBER( slider_w ); protected: diff --git a/src/devices/bus/isa/svga_paradise.cpp b/src/devices/bus/isa/svga_paradise.cpp index 955096ea3aa5c..6be6e3349249a 100644 --- a/src/devices/bus/isa/svga_paradise.cpp +++ b/src/devices/bus/isa/svga_paradise.cpp @@ -10,7 +10,7 @@ ISA SVGA Paradise / Western Digital wrapper that aren't covered in current dumps; \- Specifically they do: 000C03AB: cmp word ptr [10h],0h ; wd90c00 == 0x3000 - 000C03B0: 75 09 jne 0C03BBh + 000C03B0: jne 0C03BBh 000C03B2: cmp byte ptr [12h],7Eh ; wd90c00 == 0x00 000C03B7: jne 0C03BBh 000C03B9: pop ds diff --git a/src/devices/bus/isa/svga_paradise.h b/src/devices/bus/isa/svga_paradise.h index 8b9eeea63679e..0dec71758fd13 100644 --- a/src/devices/bus/isa/svga_paradise.h +++ b/src/devices/bus/isa/svga_paradise.h @@ -89,6 +89,9 @@ class isa16_wd90c00_jk_device : // construction/destruction isa16_wd90c00_jk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // resets itself at card POST for accessing $c6xxx area, plays with input sense later + static constexpr feature_type unemulated_features() { return feature::PROTECTION; } + protected: // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/mackbd/keyboard.cpp b/src/devices/bus/mackbd/keyboard.cpp index 5b3cca18b210a..388bbc1f349c3 100644 --- a/src/devices/bus/mackbd/keyboard.cpp +++ b/src/devices/bus/mackbd/keyboard.cpp @@ -235,7 +235,7 @@ template class peripheral_base : public device_t, public device_mac_keyboard_interface { public: - CUSTOM_INPUT_MEMBER(columns_r) + ioport_value columns_r() { ioport_value result(make_bitmask(Rows)); for (unsigned i = 0U; Rows > i; ++i) @@ -247,7 +247,7 @@ class peripheral_base : public device_t, public device_mac_keyboard_interface return result ^ make_bitmask(Rows); } - CUSTOM_INPUT_MEMBER(host_data_r) + ioport_value host_data_r() { return m_host_data_in ^ 0x01; } @@ -402,12 +402,12 @@ class keyboard_base : public peripheral_base<9> class keypad_base : public peripheral_base<3> { public: - CUSTOM_INPUT_MEMBER(keyboard_clock_r) + ioport_value keyboard_clock_r() { return m_keyboard_clock_in ^ 0x01; } - CUSTOM_INPUT_MEMBER(keyboard_data_r) + ioport_value keyboard_data_r() { return m_keyboard_data_in ^ 0x01; } diff --git a/src/devices/bus/mackbd/pluskbd.cpp b/src/devices/bus/mackbd/pluskbd.cpp index 64ceb3fb93b4a..225906069fb50 100644 --- a/src/devices/bus/mackbd/pluskbd.cpp +++ b/src/devices/bus/mackbd/pluskbd.cpp @@ -107,7 +107,7 @@ ROM_END class keyboard_base : public device_t, public device_mac_keyboard_interface { public: - CUSTOM_INPUT_MEMBER(host_data_r) + ioport_value host_data_r() { return m_host_data_in ^ 0x01; } diff --git a/src/devices/bus/msx/slot/fs4600.cpp b/src/devices/bus/msx/slot/fs4600.cpp index 7f947b5b7fddd..abb599d4c4243 100644 --- a/src/devices/bus/msx/slot/fs4600.cpp +++ b/src/devices/bus/msx/slot/fs4600.cpp @@ -36,10 +36,11 @@ void msx_slot_fs4600_device::device_start() fatalerror("Memory region '%s' is too small for the FS4600 firmware\n", m_rom_region.finder_tag()); } - m_sram.resize(SRAM_SIZE); - m_nvram->set_base(m_sram.data(), SRAM_SIZE); + m_sram = std::make_unique(SRAM_SIZE); + m_nvram->set_base(&m_sram[0], SRAM_SIZE); save_item(NAME(m_sram_address)); + save_pointer(NAME(m_sram), SRAM_SIZE); for (int i = 0; i < 3; i++) m_rombank[i]->configure_entries(0, 0x40, m_rom_region->base() + m_region_offset, 0x4000); diff --git a/src/devices/bus/msx/slot/fs4600.h b/src/devices/bus/msx/slot/fs4600.h index 5061e9186bf45..dacf5be14c2ea 100644 --- a/src/devices/bus/msx/slot/fs4600.h +++ b/src/devices/bus/msx/slot/fs4600.h @@ -41,7 +41,7 @@ class msx_slot_fs4600_device : public device_t, public msx_internal_slot_interfa memory_view m_view[3]; u32 m_region_offset; u32 m_sram_address; - std::vector m_sram; + std::unique_ptr m_sram; }; diff --git a/src/devices/bus/msx/slot/fsa1fm.cpp b/src/devices/bus/msx/slot/fsa1fm.cpp index 93e55d5b78d6f..6b59c516bbe6e 100644 --- a/src/devices/bus/msx/slot/fsa1fm.cpp +++ b/src/devices/bus/msx/slot/fsa1fm.cpp @@ -32,15 +32,15 @@ void msx_slot_fsa1fm2_device::device_start() fatalerror("Memory region '%s' is not the correct size for the FS-A1FM firmware\n", m_rom_region.finder_tag()); } - m_ram.resize(RAM_SIZE); - m_empty_bank.resize(8 * 1024); + m_ram = std::make_unique(RAM_SIZE); + m_empty_bank = std::make_unique(8 * 1024); for (int i = 0; i < 8 * 1024; i++) m_empty_bank[i] = 0xff; save_item(NAME(m_selected_bank)); save_item(NAME(m_control)); save_item(NAME(m_ram_active)); - save_pointer(m_ram.data(), "ram", RAM_SIZE); + save_pointer(NAME(m_ram), m_size); for (int i = 0; i < 6; i++) { @@ -48,10 +48,10 @@ void msx_slot_fsa1fm2_device::device_start() m_bank[i]->configure_entries(0x80, 0x80, m_rom_region->base() + m_region_offset, 0x2000); for (int j = 0; j < 4; j++) { - m_bank[i]->configure_entry(0x80 + j, m_empty_bank.data()); // 0x80-0x83 empty - m_bank[i]->configure_entry(0x84 + j, m_ram.data()); // 0x84-0x87 ram - m_bank[i]->configure_entry(0x88 + j, m_empty_bank.data()); // 0x88-0x8b empty - m_bank[i]->configure_entry(0x8c + j, m_ram.data()); // 0x8c-0x8f ram + m_bank[i]->configure_entry(0x80 + j, &m_empty_bank[0]); // 0x80-0x83 empty + m_bank[i]->configure_entry(0x84 + j, &m_ram[0]); // 0x84-0x87 ram + m_bank[i]->configure_entry(0x88 + j, &m_empty_bank[0]); // 0x88-0x8b empty + m_bank[i]->configure_entry(0x8c + j, &m_ram[0]); // 0x8c-0x8f ram } } @@ -182,14 +182,16 @@ void msx_slot_fsa1fm_device::device_start() fatalerror("Memory region '%s' is not the correct size for the FS-A1FM firmware\n", m_rom_region.finder_tag()); } - m_sram.resize(SRAM_SIZE); - m_nvram->set_base(m_sram.data(), SRAM_SIZE); + m_sram = std::make_unique(SRAM_SIZE); + m_nvram->set_base(&m_sram[0], SRAM_SIZE); + + save_pointer(NAME(m_sram), SRAM_SIZE); m_rombank->configure_entries(0, 16, m_rom_region->base(), 0x2000); page(1)->install_read_bank(0x4000, 0x5fff, m_rombank); // SRAM is always visible? - page(1)->install_ram(0x6000, 0x7fff, m_sram.data()); + page(1)->install_ram(0x6000, 0x7fff, &m_sram[0]); page(1)->install_write_handler(0x7fc0, 0x7fc0, emu::rw_delegate(*m_i8251, FUNC(i8251_device::data_w))); page(1)->install_read_handler(0x7fc0, 0x7fc0, emu::rw_delegate(*m_i8251, FUNC(i8251_device::data_r))); page(1)->install_write_handler(0x7fc1, 0x7fc1, emu::rw_delegate(*m_i8251, FUNC(i8251_device::control_w))); diff --git a/src/devices/bus/msx/slot/fsa1fm.h b/src/devices/bus/msx/slot/fsa1fm.h index 660baa43e9903..e0d2bac0bcda0 100644 --- a/src/devices/bus/msx/slot/fsa1fm.h +++ b/src/devices/bus/msx/slot/fsa1fm.h @@ -42,8 +42,8 @@ class msx_slot_fsa1fm2_device : public device_t, public msx_internal_slot_interf uint8_t m_selected_bank[6]; bool m_ram_active[6]; uint8_t m_control; - std::vector m_ram; - std::vector m_empty_bank; + std::unique_ptr m_ram; + std::unique_ptr m_empty_bank; }; @@ -76,7 +76,7 @@ class msx_slot_fsa1fm_device : public device_t, public msx_internal_slot_interfa required_memory_region m_rom_region; memory_bank_creator m_rombank; u32 m_region_offset; - std::vector m_sram; + std::unique_ptr m_sram; }; diff --git a/src/devices/bus/msx/slot/msx_rs232.cpp b/src/devices/bus/msx/slot/msx_rs232.cpp index 0750abf7c9afc..3848b8e5ff4e1 100644 --- a/src/devices/bus/msx/slot/msx_rs232.cpp +++ b/src/devices/bus/msx/slot/msx_rs232.cpp @@ -255,21 +255,21 @@ void msx_slot_rs232_sony_device::device_start() { msx_slot_rs232_base_device::device_start(); - m_ram.resize(RAM_SIZE); - save_item(NAME(m_ram)); + m_ram = std::make_unique(RAM_SIZE); + save_pointer(NAME(m_ram), RAM_SIZE); // TODO unmap rom from page 0 - page(0)->install_ram(0x2000, 0x27ff, m_ram.data()); + page(0)->install_ram(0x2000, 0x27ff, &m_ram[0]); page(1)->install_rom(0x4000, 0x5fff, m_rom_region->base() + m_region_offset); - page(1)->install_ram(0x6000, 0x67ff, m_ram.data()); - page(2)->install_ram(0xa000, 0xa7ff, m_ram.data()); + page(1)->install_ram(0x6000, 0x67ff, &m_ram[0]); + page(2)->install_ram(0xa000, 0xa7ff, &m_ram[0]); page(2)->install_read_handler(0xbff8, 0xbff9, emu::rw_delegate(*m_i8251, FUNC(i8251_device::read))); page(2)->install_write_handler(0xbff8, 0xbff9, emu::rw_delegate(*m_i8251, FUNC(i8251_device::write))); page(2)->install_read_handler(0xbffa, 0xbffa, emu::rw_delegate(*this, FUNC(msx_slot_rs232_sony_device::status_r))); page(2)->install_write_handler(0xbffa, 0xbffa, emu::rw_delegate(*this, FUNC(msx_slot_rs232_sony_device::irq_mask_w))); page(2)->install_read_handler(0xbffc, 0xbfff, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::read))); page(2)->install_write_handler(0xbffc, 0xbfff, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::write))); - page(3)->install_ram(0xe000, 0xe7ff, m_ram.data()); + page(3)->install_ram(0xe000, 0xe7ff, &m_ram[0]); } u8 msx_slot_rs232_sony_device::status_r(offs_t offset) @@ -454,10 +454,11 @@ void msx_slot_rs232_toshiba_hx3x_device::device_start() io_space().install_readwrite_handler(0x82, 0x82, emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::status_r)), emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::irq_mask_w))); io_space().install_readwrite_handler(0x84, 0x87, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::read)), emu::rw_delegate(*m_i8253, FUNC(pit8253_device::write))); - m_sram.resize(SRAM_SIZE); - m_nvram->set_base(m_sram.data(), SRAM_SIZE); + m_sram = std::make_unique(SRAM_SIZE); + m_nvram->set_base(&m_sram[0], SRAM_SIZE); save_item(NAME(m_bank_reg)); + save_pointer(NAME(m_sram), SRAM_SIZE); m_rombank->configure_entries(0, 4, m_rom_region->base() + m_region_offset + 0x4000, 0x4000); @@ -465,7 +466,7 @@ void msx_slot_rs232_toshiba_hx3x_device::device_start() page(1)->install_read_handler(0x7fff, 0x7fff, emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::bank_r))); page(2)->install_view(0x8000, 0xbfff, m_view); m_view[0].install_read_bank(0x8000, 0xbfff, m_rombank); - m_view[1].install_ram(0x8000, 0x87ff, 0x3800, m_sram.data()); + m_view[1].install_ram(0x8000, 0x87ff, 0x3800, &m_sram[0]); } void msx_slot_rs232_toshiba_hx3x_device::device_reset() diff --git a/src/devices/bus/msx/slot/msx_rs232.h b/src/devices/bus/msx/slot/msx_rs232.h index 6aa6ba52ffa04..e22221bbe9b57 100644 --- a/src/devices/bus/msx/slot/msx_rs232.h +++ b/src/devices/bus/msx/slot/msx_rs232.h @@ -95,7 +95,7 @@ class msx_slot_rs232_sony_device : public msx_slot_rs232_base_device static constexpr size_t RAM_SIZE = 0x800; required_ioport m_switch_port; - std::vector m_ram; + std::unique_ptr m_ram; }; @@ -152,7 +152,7 @@ class msx_slot_rs232_toshiba_hx3x_device : public msx_slot_rs232_base_device required_device m_nvram; memory_bank_creator m_rombank; memory_view m_view; - std::vector m_sram; + std::unique_ptr m_sram; u8 m_bank_reg; }; diff --git a/src/devices/bus/msx/slot/panasonic08.cpp b/src/devices/bus/msx/slot/panasonic08.cpp index 5de4c1d191315..a0a644c46a9ae 100644 --- a/src/devices/bus/msx/slot/panasonic08.cpp +++ b/src/devices/bus/msx/slot/panasonic08.cpp @@ -41,20 +41,21 @@ void msx_slot_panasonic08_device::device_start() fatalerror("Memory region '%s' is too small for the panasonic08 firmware\n", m_rom_region.finder_tag()); } - m_sram.resize(SRAM_SIZE); + m_sram = std::make_unique(SRAM_SIZE); m_nvram->set_base(&m_sram[0], SRAM_SIZE); save_item(NAME(m_selected_bank)); save_item(NAME(m_control)); + save_pointer(NAME(m_sram), SRAM_SIZE); for (int i = 0; i < 6; i++) { m_bank[i]->configure_entries(0, 0x100, m_rom_region->base() + m_region_offset, 0x2000); - m_bank[i]->configure_entry(0x80, m_sram.data()); - m_bank[i]->configure_entry(0x81, m_sram.data() + 0x2000); - m_bank[i]->configure_entry(0x82, m_sram.data()); - m_bank[i]->configure_entry(0x83, m_sram.data() + 0x2000); + m_bank[i]->configure_entry(0x80, &m_sram[0]); + m_bank[i]->configure_entry(0x81, &m_sram[0x2000]); + m_bank[i]->configure_entry(0x82, &m_sram[0]); + m_bank[i]->configure_entry(0x83, &m_sram[0x2000]); } page(0)->install_view(0x0000, 0x1fff, m_view[0]); diff --git a/src/devices/bus/msx/slot/panasonic08.h b/src/devices/bus/msx/slot/panasonic08.h index 6fd7ace83f4c9..5602dfd20dd0b 100644 --- a/src/devices/bus/msx/slot/panasonic08.h +++ b/src/devices/bus/msx/slot/panasonic08.h @@ -41,7 +41,7 @@ class msx_slot_panasonic08_device : public device_t, public msx_internal_slot_in u32 m_region_offset; u8 m_selected_bank[6]; u8 m_control; - std::vector m_sram; + std::unique_ptr m_sram; }; diff --git a/src/devices/bus/msx/slot/panasonic08r.cpp b/src/devices/bus/msx/slot/panasonic08r.cpp new file mode 100644 index 0000000000000..c274cf951f40a --- /dev/null +++ b/src/devices/bus/msx/slot/panasonic08r.cpp @@ -0,0 +1,166 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/* + + Emulation of the firmware mapper as found in Panasonic FS-A1ST and FS-A1GT Turbo-R machines. + + +*/ + +#include "emu.h" +#include "panasonic08r.h" + + +DEFINE_DEVICE_TYPE(MSX_SLOT_PANASONIC08R, msx_slot_panasonic08r_device, "msx_slot_panasonic08r", "MSX Internal Panasonic08r") + + +msx_slot_panasonic08r_device::msx_slot_panasonic08r_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_SLOT_PANASONIC08R, tag, owner, clock) + , msx_internal_slot_interface(mconfig, *this) + , m_sram_size(0) + , m_nvram(*this, "nvram") + , m_rom_region(*this, finder_base::DUMMY_TAG) + , m_bank(*this, "bank%u", 0U) + , m_view{ + {*this, "view0"}, {*this, "view1"}, {*this, "view2"}, {*this, "view3"}, + {*this, "view4"}, {*this, "view5"}, {*this, "view6"}, {*this, "view7"} + } + , m_mm(*this, finder_base::DUMMY_TAG) + , m_region_offset(0) + , m_control(0) +{ +} + + +void msx_slot_panasonic08r_device::device_add_mconfig(machine_config &config) +{ + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); +} + + +void msx_slot_panasonic08r_device::device_start() +{ + // Sanity checks + if (m_rom_region->bytes() < m_region_offset + 0x400000) + fatalerror("Memory region '%s' is too small for the panasonic08r firmware\n", m_rom_region.finder_tag()); + if (m_sram_size != 0x4000 && m_sram_size != 0x8000) + fatalerror("Invalid SRAM size for the panasonic08r firmware\n"); + + m_sram = std::make_unique(m_sram_size); + m_nvram->set_base(&m_sram[0], m_sram_size); + + save_item(NAME(m_selected_bank)); + save_item(NAME(m_control)); + save_item(NAME(m_bank9)); + save_pointer(NAME(m_sram), m_sram_size); + + for (int i = 0; i < 8; i++) + { + m_bank[i]->configure_entries(0, 0x200, m_rom_region->base() + m_region_offset, 0x2000); + m_bank[i]->configure_entry(0x80, &m_sram[0]); + m_bank[i]->configure_entry(0x81, &m_sram[0x2000]); + if (m_sram_size >= 0x8000) + { + m_bank[i]->configure_entry(0x82, &m_sram[0x4000]); + m_bank[i]->configure_entry(0x83, &m_sram[0x6000]); + } + + // Assuming smaller internal RAM is mirrored. + int internal_ram_banks = m_mm->get_ram_size() / 0x2000; + int start_bank = 0x180; + do { + int nr_banks = internal_ram_banks; + if (start_bank + nr_banks > 0x200) + nr_banks = 0x200 - start_bank; + m_bank[i]->configure_entries(start_bank, nr_banks, m_mm->get_ram_base(), 0x2000); + start_bank += internal_ram_banks; + } + while (start_bank < 0x200); + } + + for (int i = 0; i < 8; i++) + { + const u16 start = 0x2000 * i; + const u16 end = start + 0x1fff; + + page(i/2)->install_view(start, end, m_view[i]); + m_view[i][0].install_read_bank(start, end, m_bank[i]); + m_view[i][1].install_readwrite_bank(start, end, m_bank[i]); + } + + m_view[3][2].install_read_bank(0x6000, 0x7fff, m_bank[3]); + m_view[3][2].install_read_handler(0x7ff0, 0x7ff7, read8sm_delegate(*this, [this] (offs_t offset) { return m_selected_bank[offset] & 0xff; }, "bank_r")); + m_view[3][3].install_readwrite_bank(0x6000, 0x7fff, m_bank[3]); + m_view[3][3].install_read_handler(0x7ff0, 0x7ff7, read8sm_delegate(*this, [this] (offs_t offset) { return m_selected_bank[offset] & 0xff; }, "bank_r")); + page(1)->install_write_handler(0x6000, 0x6000, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<0>))); + page(1)->install_write_handler(0x6400, 0x6400, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<1>))); + page(1)->install_write_handler(0x6800, 0x6800, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<2>))); + page(1)->install_write_handler(0x6c00, 0x6c00, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<3>))); + page(1)->install_write_handler(0x7000, 0x7000, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<4>))); + page(1)->install_write_handler(0x7400, 0x7400, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<6>))); + page(1)->install_write_handler(0x7800, 0x7800, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<5>))); + page(1)->install_write_handler(0x7c00, 0x7c00, emu::rw_delegate(*this, FUNC(msx_slot_panasonic08r_device::bank_w<7>))); + page(1)->install_readwrite_handler(0x7ff8, 0x7ff8, + read8smo_delegate(*this, [this] () { return m_bank9; }, "bank9_r"), + write8smo_delegate(*this, [this] (u8 data) + { + m_bank9 = data; + select_banks(); + }, "bank9_w")); + page(1)->install_write_handler(0x7ff9, 0x7ff9, write8smo_delegate(*this, [this] (u8 data) + { + m_control = data; + select_banks(); + }, "control_w" + )); +} + + +void msx_slot_panasonic08r_device::device_reset() +{ + m_control = 0; + m_bank9 = 0; + for (int i = 0 ; i < 8; i++) + { + m_selected_bank[i] = 0; + m_bank[i]->set_entry(0); + m_view[i].select(0); + } +} + + +template +void msx_slot_panasonic08r_device::set_view() +{ + const bool sram_active = (m_selected_bank[Bank] >= 0x80 && m_selected_bank[Bank] < 0x84); + const bool ram_active = (m_selected_bank[Bank] >= 0x180); + const int view = ((sram_active || ram_active) ? 1 : 0) | ((Bank == 3 && BIT(m_control, 2)) ? 2 : 0); + + m_view[Bank].select(view); +} + + +template +void msx_slot_panasonic08r_device::bank_w(u8 data) +{ + u16 bank = data; + + if (BIT(m_control, 4)) + bank |= (BIT(m_bank9, Bank) << 8); + m_selected_bank[Bank] = bank; + m_bank[Bank]->set_entry(bank); + set_view(); +} + + +void msx_slot_panasonic08r_device::select_banks() +{ + bank_w<0>(m_selected_bank[0]); + bank_w<1>(m_selected_bank[1]); + bank_w<2>(m_selected_bank[2]); + bank_w<3>(m_selected_bank[3]); + bank_w<4>(m_selected_bank[4]); + bank_w<5>(m_selected_bank[5]); + bank_w<6>(m_selected_bank[6]); + bank_w<7>(m_selected_bank[7]); +} diff --git a/src/devices/bus/msx/slot/panasonic08r.h b/src/devices/bus/msx/slot/panasonic08r.h new file mode 100644 index 0000000000000..c7efcf6e27aad --- /dev/null +++ b/src/devices/bus/msx/slot/panasonic08r.h @@ -0,0 +1,52 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_SLOT_PANASONIC08R_H +#define MAME_BUS_MSX_SLOT_PANASONIC08R_H + +#pragma once + +#include "ram_mm.h" +#include "slot.h" +#include "machine/nvram.h" + + +DECLARE_DEVICE_TYPE(MSX_SLOT_PANASONIC08R, msx_slot_panasonic08r_device) + + +class msx_slot_panasonic08r_device : public device_t, public msx_internal_slot_interface +{ +public: + msx_slot_panasonic08r_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // configuration helpers + template msx_slot_panasonic08r_device &set_mm_tag(T &&tag) { m_mm.set_tag(std::forward(tag)); return *this; } + void set_rom_start(const char *region, u32 offset) { m_rom_region.set_tag(region); m_region_offset = offset; } + msx_slot_panasonic08r_device &set_sram_size(u16 size) { m_sram_size = size; return *this; } + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + virtual void device_add_mconfig(machine_config &config) override; + +private: + template void set_view(); + template void bank_w(u8 data); + + void select_banks(); + + u16 m_sram_size; + required_device m_nvram; + required_memory_region m_rom_region; + memory_bank_array_creator<8> m_bank; + memory_view m_view[8]; + required_device m_mm; + u32 m_region_offset; + u16 m_selected_bank[8]; + u8 m_control; + u8 m_bank9; + std::unique_ptr m_sram; +}; + + +#endif // MAME_BUS_MSX_SLOT_PANASONIC08R_H diff --git a/src/devices/bus/msx/slot/ram.cpp b/src/devices/bus/msx/slot/ram.cpp index 92f9a57929da2..03219dbf82486 100644 --- a/src/devices/bus/msx/slot/ram.cpp +++ b/src/devices/bus/msx/slot/ram.cpp @@ -14,10 +14,13 @@ msx_slot_ram_device::msx_slot_ram_device(const machine_config &mconfig, const ch void msx_slot_ram_device::device_start() { - m_ram.resize(m_size); - save_item(NAME(m_ram)); + if (m_size < m_end_address - m_start_address) + fatalerror("Invalid size %04x for address range %004x - %04x\n", m_start_address, m_end_address); - u8 *ram = m_ram.data(); + m_ram = std::make_unique(m_size); + save_pointer(NAME(m_ram), m_size); + + u8 *ram = &m_ram[0]; u32 start_address = m_start_address; for (int i = m_start_address >> 14; i < 4 && i * 0x4000 < m_end_address; i++) { diff --git a/src/devices/bus/msx/slot/ram.h b/src/devices/bus/msx/slot/ram.h index 9e8f08bc37339..c1a5e78e9e803 100644 --- a/src/devices/bus/msx/slot/ram.h +++ b/src/devices/bus/msx/slot/ram.h @@ -20,7 +20,7 @@ class msx_slot_ram_device : public device_t, virtual void device_start() override; private: - std::vector m_ram; + std::unique_ptr m_ram; }; diff --git a/src/devices/bus/msx/slot/ram_mm.cpp b/src/devices/bus/msx/slot/ram_mm.cpp index b32264a02ebc7..bd0de812474bd 100644 --- a/src/devices/bus/msx/slot/ram_mm.cpp +++ b/src/devices/bus/msx/slot/ram_mm.cpp @@ -30,9 +30,8 @@ void msx_slot_ram_mm_device::device_start() default: fatalerror("Invalid memory mapper size specified\n"); } - m_ram.resize(m_total_size); - - save_item(NAME(m_ram)); + m_ram = std::make_unique(m_total_size); + save_pointer(NAME(m_ram), m_total_size); // Install IO read/write handlers using taps to prevent overwriting taps // installed by other (external) memory mapper devices. @@ -41,7 +40,7 @@ void msx_slot_ram_mm_device::device_start() for (int i = 0; i < 4; i++) { - m_rambank[i]->configure_entries(0, u32(m_bank_mask) + 1, m_ram.data(), 0x4000); + m_rambank[i]->configure_entries(0, u32(m_bank_mask) + 1, &m_ram[0], 0x4000); page(i)->install_readwrite_bank(0x4000 * i, (0x4000 * i) + 0x3fff, m_rambank[i]); } } diff --git a/src/devices/bus/msx/slot/ram_mm.h b/src/devices/bus/msx/slot/ram_mm.h index 69ce5f410532f..8c4c14262643f 100644 --- a/src/devices/bus/msx/slot/ram_mm.h +++ b/src/devices/bus/msx/slot/ram_mm.h @@ -15,6 +15,10 @@ class msx_slot_ram_mm_device : public device_t, public msx_internal_slot_interfa msx_slot_ram_mm_device &set_total_size(u32 total_size) { m_total_size = total_size; return *this; } msx_slot_ram_mm_device &set_unused_bits(u8 unused_bits) { m_unused_bits = unused_bits; return *this; } + // Backdoor for the Turbo-R firmware/internal mapper to access internal RAM. + u32 get_ram_size() { return m_total_size; } + u8 *get_ram_base() { return &m_ram[0]; } + protected: virtual void device_start() override; @@ -22,7 +26,7 @@ class msx_slot_ram_mm_device : public device_t, public msx_internal_slot_interfa u8 read_mapper_bank(offs_t offset); void write_mapper_bank(offs_t offset, u8 data); - std::vector m_ram; + std::unique_ptr m_ram; u32 m_total_size; u8 m_bank_mask; u8 m_unused_bits; diff --git a/src/devices/bus/msx/slot/sony08.cpp b/src/devices/bus/msx/slot/sony08.cpp index bf13f091ee1c0..29fd07cca934e 100644 --- a/src/devices/bus/msx/slot/sony08.cpp +++ b/src/devices/bus/msx/slot/sony08.cpp @@ -38,8 +38,10 @@ void msx_slot_sony08_device::device_start() fatalerror("Memory region '%s' is too small for the SONY08 firmware\n", m_rom_region.finder_tag()); } - m_sram.resize(SRAM_SIZE); - m_nvram->set_base(m_sram.data(), SRAM_SIZE); + m_sram= std::make_unique(SRAM_SIZE); + m_nvram->set_base(&m_sram[0], SRAM_SIZE); + + save_pointer(NAME(m_sram), SRAM_SIZE); for (int i = 0; i < 4; i++) m_rombank[i]->configure_entries(0, 0x80, m_rom_region->base() + m_region_offset, 0x2000); @@ -48,7 +50,7 @@ void msx_slot_sony08_device::device_start() page(0)->install_view(0x0000, 0x3fff, m_view[0]); m_view[0][0]; - m_view[0][1].install_ram(0x0000, 0x3fff, m_sram.data()); + m_view[0][1].install_ram(0x0000, 0x3fff, &m_sram[0]); page(1)->install_read_bank(0x4000, 0x5fff, m_rombank[0]); page(1)->install_write_handler(0x4fff, 0x4fff, emu::rw_delegate(*this, FUNC(msx_slot_sony08_device::bank_w<0>))); diff --git a/src/devices/bus/msx/slot/sony08.h b/src/devices/bus/msx/slot/sony08.h index 2fa9d9e89ca4e..c8e364612d09a 100644 --- a/src/devices/bus/msx/slot/sony08.h +++ b/src/devices/bus/msx/slot/sony08.h @@ -36,7 +36,7 @@ class msx_slot_sony08_device : public device_t, public msx_internal_slot_interfa memory_bank_array_creator<6> m_rombank; memory_view m_view[2]; u32 m_region_offset; - std::vector m_sram; + std::unique_ptr m_sram; }; diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index bdd4d0df38c75..6b06faa1b4b5a 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -327,11 +327,15 @@ void nubus_specpdq_device::update_crtc() // for some reason you temporarily get invalid screen parameters - ignore them if (m_crtc.valid(*this)) { - rectangle active( - m_crtc.h_start(16) + (m_hdelay * 4), - m_crtc.h_end(16) - (m_hadjust - (m_hdelay * 4)) - 1, - m_crtc.v_start(), - m_crtc.v_end() - 1); + // FIXME: there's still something missing in the active width calculation + // With the Apple RGB (640*480) monitor selected, the active width is 16 pixels + // too wide in black and white mode, and 16 pixels too narrow in greyscale or + // colour modes. + rectangle const active( + m_crtc.h_start(16) + (m_hdelay * 4), + m_crtc.h_end(16) + (m_hdelay * 4) - m_hadjust - 1, + m_crtc.v_start(), + m_crtc.v_end() - 1); screen().configure( m_crtc.h_total(16), diff --git a/src/devices/bus/odyssey2/chess.cpp b/src/devices/bus/odyssey2/chess.cpp index 80b807d769e7d..9122e5fe378f3 100644 --- a/src/devices/bus/odyssey2/chess.cpp +++ b/src/devices/bus/odyssey2/chess.cpp @@ -15,7 +15,7 @@ Hardware notes: #include "emu.h" #include "chess.h" -#include "cpu/z80/z80.h" +#include "cpu/z80/nsc800.h" #include "machine/gen_latch.h" namespace { diff --git a/src/devices/bus/oricext/microdisc.cpp b/src/devices/bus/oricext/microdisc.cpp index b85d56182f928..9abe2debd2712 100644 --- a/src/devices/bus/oricext/microdisc.cpp +++ b/src/devices/bus/oricext/microdisc.cpp @@ -20,6 +20,7 @@ void oric_microdisc_device::floppy_formats(format_registration &fr) static void microdisc_floppies(device_slot_interface &device) { device.option_add("3dsdd", FLOPPY_3_DSDD); + device.option_add("3dsqd", FLOPPY_3_DSQD); } void oric_microdisc_device::map_io(address_space_installer &space) @@ -79,7 +80,7 @@ void oric_microdisc_device::device_add_mconfig(machine_config &config) fdc->hld_wr_callback().set(FUNC(oric_microdisc_device::fdc_hld_w)); fdc->set_force_ready(true); - FLOPPY_CONNECTOR(config, "fdc:0", microdisc_floppies, "3dsdd", oric_microdisc_device::floppy_formats); + FLOPPY_CONNECTOR(config, "fdc:0", microdisc_floppies, "3dsqd", oric_microdisc_device::floppy_formats); FLOPPY_CONNECTOR(config, "fdc:1", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats); FLOPPY_CONNECTOR(config, "fdc:2", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats); FLOPPY_CONNECTOR(config, "fdc:3", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats); diff --git a/src/devices/bus/pci/geforce.h b/src/devices/bus/pci/geforce.h index 2cf2e98edeae1..890b2b6676f98 100644 --- a/src/devices/bus/pci/geforce.h +++ b/src/devices/bus/pci/geforce.h @@ -17,6 +17,9 @@ class geforce256_device : public rivatnt2_device public: geforce256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // ELSA protection + static constexpr feature_type unemulated_features() { return feature::PROTECTION; } + protected: geforce256_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -38,6 +41,9 @@ class quadro_device : public geforce256_device public: quadro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // ELSA protection + static constexpr feature_type unemulated_features() { return feature::PROTECTION; } + protected: virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/pci/neon250.cpp b/src/devices/bus/pci/neon250.cpp new file mode 100644 index 0000000000000..b0908182e9cae --- /dev/null +++ b/src/devices/bus/pci/neon250.cpp @@ -0,0 +1,188 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + +VideoLogic PowerVR Neon 250 + +TODO: +- stub device; +- detects 0Kb of RAM in SDD test, plays with pvr_io_map $54 (IIC Interface B); + +**************************************************************************************************/ + +#include "emu.h" +#include "neon250.h" + +#define LOG_WARN (1U << 1) +#define LOG_TODO (1U << 2) // log unimplemented registers + +#define VERBOSE (LOG_GENERAL | LOG_WARN | LOG_TODO) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) +#define LOGTODO(...) LOGMASKED(LOG_TODO, __VA_ARGS__) + + +DEFINE_DEVICE_TYPE(NEON250, neon250_device, "neon250", "VideoLogic PowerVR Neon 250 (PMX1)") + +neon250_device::neon250_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_svga(*this, "svga") + , m_vga_rom(*this, "vga_rom") +{ + // PowerVR Neon 250 AGP (NEC branded) + set_ids_agp(0x10330067, 0x02, 0x10100120); +} + +neon250_device::neon250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : neon250_device(mconfig, NEON250, tag, owner, clock) +{ +} + +ROM_START( neon250 ) + ROM_REGION32_LE( 0x20000, "vga_rom", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS( 0, "neon250", "NEC Neon 250" ) + ROMX_LOAD( "n0020331.bin", 0x000000, 0x20000, CRC(e76008f5) SHA1(1ddda1494d5b32148e2c9e7a6557f00ee9cffea6), ROM_BIOS(0) ) +// ROMX_LOAD( "ppvr201i.bin", 0x000000, 0x10000, CRC(b6e763c9) SHA1(1e1fecbb663dde5295a9db98dde70a4e1bd8338d), ROM_BIOS(0) ) +// ROMX_LOAD( "b1002816.bin", 0x000000, 0x10000, CRC(d3cf607a) SHA1(8fea7c3e678bc585ed5729d7f1a4b203bae8d15d), ROM_BIOS(0) ) + // from VGA Legacy MkIII, bad +// ROMX_LOAD( "neon250agp.vbi", 0x000000, 0x009200, CRC(41a46c28) SHA1(f99482b906436d9b1db25e68de5a2bc96a192128) BAD_DUMP, ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *neon250_device::device_rom_region() const +{ + return ROM_NAME(neon250); +} + +void neon250_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(m_svga, FUNC(vga_device::screen_update)); + + // TODO: PVR "VGA Emulator" + VGA(config, m_svga, 0); + m_svga->set_screen("screen"); + m_svga->set_vram_size(32*1024*1024); +} + + + +void neon250_device::device_start() +{ + pci_card_device::device_start(); + + add_map( 64*1024*1024, M_MEM | M_PREF, FUNC(neon250_device::pvr_fb_map)); + add_map( 16*1024, M_MEM | M_PREF, FUNC(neon250_device::pvr_mmio_map)); + add_map( 128*1024, M_MEM | M_PREF, FUNC(neon250_device::vga_fb_map)); + add_map( 2*1024, M_MEM, FUNC(neon250_device::vga_mmio_map)); + // not indicated, assume no-pref again + add_map( 256, M_IO, FUNC(neon250_device::pvr_io_map)); + + add_rom((u8 *)m_vga_rom->base(), 128*1024 ); + expansion_rom_base = 0xc0000; + + // INTA# + intr_pin = 1; +} + +void neon250_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + // can VGA palette snoop, can MWI (bit 4) + command_mask = 0x0037; + // medium DEVSELB + fast back to back + new cap support + // can set AGP bit 5 + status = 0x0290; + + remap_cb(); +} + +u8 neon250_device::capptr_r() +{ + return 0x60; +} + +void neon250_device::config_map(address_map &map) +{ + pci_device::config_map(map); + + // AGP + map(0x40, 0x43).lr32(NAME([] { return 0x0010'0002; })); + // AGP 1x & 2x + SBA + 31 RQ + map(0x44, 0x47).lr32(NAME([] { return 0x1f00'0203; })); + +// map(0x4c, 0x4d) Discard Timer +// map(0x50, 0x50) 16T Timer +// map(0x54, 0x54) 8T Timer +// map(0x58, 0x59) SSVIDW +// map(0x5a, 0x5b) Subsystem Control +// map(0x5c, 0x5d) SSDEVW + + // Power management + // PCI PM 1.0 compliant + Device Specific Init (DSI) + D1 & D2 support + // TODO: disables capptr if AGP is unset + map(0x60, 0x63).lr32(NAME([] { return 0x0621'4001; })); + +// map(0x70, 0x71) AGP PLL Control +// map(0x72, 0x73) Core PLL Control +} + + + +void neon250_device::pvr_fb_map(address_map &map) +{ + +} + +void neon250_device::pvr_mmio_map(address_map &map) +{ +} + +void neon250_device::pvr_io_map(address_map &map) +{ +} + +void neon250_device::vga_fb_map(address_map &map) +{ +} + +void neon250_device::vga_mmio_map(address_map &map) +{ +} + +// TODO: this should really be a subclass of VGA +void neon250_device::legacy_memory_map(address_map &map) +{ + map(0xa0000, 0xbffff).rw(FUNC(neon250_device::vram_r), FUNC(neon250_device::vram_w)); +} + +void neon250_device::legacy_io_map(address_map &map) +{ + map(0, 0x02f).m(m_svga, FUNC(vga_device::io_map)); +} + +uint8_t neon250_device::vram_r(offs_t offset) +{ + return downcast(m_svga.target())->mem_r(offset); +} + +void neon250_device::vram_w(offs_t offset, uint8_t data) +{ + downcast(m_svga.target())->mem_w(offset, data); +} + +void neon250_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 (command & 7) + { + memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(neon250_device::vram_r)), write8sm_delegate(*this, FUNC(neon250_device::vram_w))); + + io_space->install_device(0x03b0, 0x03df, *this, &neon250_device::legacy_io_map); + //memory_space->install_rom(0xc0000, 0xcffff, (void *)expansion_rom); + } +} diff --git a/src/devices/bus/pci/neon250.h b/src/devices/bus/pci/neon250.h new file mode 100644 index 0000000000000..c303189e67892 --- /dev/null +++ b/src/devices/bus/pci/neon250.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_VIDEO_NEON250_H +#define MAME_VIDEO_NEON250_H + +#pragma once + +#include "pci_slot.h" +#include "video/pc_vga.h" + +class neon250_device : public pci_card_device +{ +public: + neon250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + void legacy_memory_map(address_map &map); + void legacy_io_map(address_map &map); + +protected: + neon250_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; + + required_device m_svga; + required_memory_region m_vga_rom; + + virtual u8 capptr_r() override; + +// bool m_vga_legacy_enable = false; +private: + u8 vram_r(offs_t offset); + void vram_w(offs_t offset, uint8_t data); + + void pvr_fb_map(address_map &map); + void pvr_mmio_map(address_map &map); + void pvr_io_map(address_map &map); + + void vga_fb_map(address_map &map); + void vga_mmio_map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(NEON250, neon250_device) + +#endif // MAME_VIDEO_NEON250_H diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index ed297fbda38b3..238e61be49c9c 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -15,6 +15,7 @@ #include "geforce.h" #include "mga2064w.h" #include "ncr53c825.h" +#include "neon250.h" #include "opti82c861.h" #include "oti_spitfire.h" #include "pdc20262.h" @@ -164,6 +165,7 @@ void pci_cards(device_slot_interface &device) // assume all natively with class code 03 void agp_cards(device_slot_interface &device) { + // nVidia device.option_add("riva128", RIVA128); device.option_add("riva128zx", RIVA128ZX); device.option_add("rivatnt", RIVATNT); @@ -174,6 +176,10 @@ void agp_cards(device_slot_interface &device) device.option_add("geforce256", GEFORCE256); device.option_add("geforce256_ddr", GEFORCE256_DDR); device.option_add("quadro", QUADRO); + // Cirrus Logic device.option_add("laguna3d", GD5465_LAGUNA3D); + // PowerVR VideoLogic + device.option_add("neon250", NEON250); + // SiS device.option_add("sis6326_agp", SIS6326_AGP); } diff --git a/src/devices/bus/pci/pdc20262.cpp b/src/devices/bus/pci/pdc20262.cpp index f2655815a74f0..83e051684c31c 100644 --- a/src/devices/bus/pci/pdc20262.cpp +++ b/src/devices/bus/pci/pdc20262.cpp @@ -4,7 +4,7 @@ Promise PDC20262 FastTrak66/UDMA66 IDE controller -No documentation, ATA4 complaint +No documentation, ATA4 compliant TODO: - how it sets compatible/native modes? Subvendor ID list suggests it can switch at will; diff --git a/src/devices/bus/psion/sibo/3link.h b/src/devices/bus/psion/sibo/3link.h index fba517b98b8bb..c17acca8d1d76 100644 --- a/src/devices/bus/psion/sibo/3link.h +++ b/src/devices/bus/psion/sibo/3link.h @@ -27,8 +27,6 @@ class psion_3link_serial_device : public device_t, public device_psion_sibo_inte // construction/destruction psion_3link_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static constexpr feature_type imperfect_features() { return feature::COMMS; } - protected: // device_t overrides virtual void device_start() override; diff --git a/src/devices/bus/s100/vectordualmode.cpp b/src/devices/bus/s100/vectordualmode.cpp index c1aec1d746aec..fbf66d0d06ebe 100644 --- a/src/devices/bus/s100/vectordualmode.cpp +++ b/src/devices/bus/s100/vectordualmode.cpp @@ -65,10 +65,12 @@ s100_vector_dualmode_device::s100_vector_dualmode_device(const machine_config &m , m_cmar(0) , m_drive(0) , m_sector(0) + , m_fdd_sector_counter(0xf) , m_read(false) + , m_busy(false) + , m_last_sector_pulse(attotime::zero) , m_pll() , m_byte_timer(nullptr) - , m_sector_timer(nullptr) , m_pending_byte(0) , m_pending_size(0) { @@ -81,6 +83,8 @@ TIMER_CALLBACK_MEMBER(s100_vector_dualmode_device::motor_off) if (flop) flop->mon_w(1); } + m_byte_timer->enable(false); + m_busy = false; } bool s100_vector_dualmode_device::hdd_selected() @@ -91,6 +95,8 @@ bool s100_vector_dualmode_device::hdd_selected() uint8_t s100_vector_dualmode_device::s100_sinp_r(offs_t offset) { + if (m_busy) + return 0xff; // 7200-1200-02-1 page 16 (1-10) uint8_t data; if (offset == 0xc0) { // status (0) port @@ -124,7 +130,7 @@ uint8_t s100_vector_dualmode_device::s100_sinp_r(offs_t offset) | 0xc0; } else if (offset == 0xc1) { // status (1) port bool floppy_disk_selected; - bool controller_busy = m_sector_timer->enabled(); + bool controller_busy = m_busy; // returned early if true bool motor_on; // FDD bool type_of_hard_disk = true; if (hdd_selected()) { @@ -157,10 +163,8 @@ uint8_t s100_vector_dualmode_device::s100_sinp_r(offs_t offset) void s100_vector_dualmode_device::s100_sout_w(offs_t offset, uint8_t data) { - // TODO: check actual behavior when controller is busy - if (m_sector_timer->enabled()) { + if (m_busy) return; - } // 7200-1200-02-1 page 14 (1-8) if (offset == 0xc0) { // control (0) port m_drive = BIT(data, 0, 2); @@ -183,6 +187,7 @@ void s100_vector_dualmode_device::s100_sout_w(offs_t offset, uint8_t data) // Software should not change other bits when pulsing step flop->stp_w(!step); flop->dir_w(!step_in); + flop->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(&s100_vector_dualmode_device::floppy_index_cb, this)); } } else if (offset == 0xc1) { // control (1) port m_sector = BIT(data, 0, 5); @@ -191,14 +196,7 @@ void s100_vector_dualmode_device::s100_sout_w(offs_t offset, uint8_t data) m_ram[m_cmar++] = data; m_cmar &= 0x1ff; } else if (offset == 0xc3) { // start port - floppy_image_device* flop = m_floppy[m_drive]->get_device(); - if (!flop || flop->time_next_index().is_never()) - return; - const attotime rot_time = attotime::from_msec(200); - attotime sector_time = flop->time_next_index() - machine().time() + (rot_time / 16) * m_sector; - if (sector_time > rot_time) - sector_time -= rot_time; - m_sector_timer->adjust(sector_time, SECTOR_START); + m_busy = m_motor_on_timer->enabled(); } } @@ -213,10 +211,40 @@ bool s100_vector_dualmode_device::get_next_bit(attotime &tm, const attotime &lim return true; } -TIMER_CALLBACK_MEMBER(s100_vector_dualmode_device::sector_cb) +void s100_vector_dualmode_device::floppy_index_cb(floppy_image_device *floppy, int state) +{ + if (hdd_selected() || m_floppy[m_drive]->get_device() != floppy) + return; + if (!state) + return; + attotime now = machine().time(); + // U25 74LS221: 61.9 KOhm * .22 uF * .75 + if (now - m_last_sector_pulse < attotime::from_nsec(10213500)) { + m_fdd_sector_counter = 0xf; + } else { + m_last_sector_pulse = now; + m_fdd_sector_counter++; + m_fdd_sector_counter &= 0xf; + start_of_sector(); + } +} + +void s100_vector_dualmode_device::start_of_sector() { - switch (param) { - case SECTOR_START: + if (!m_busy) + return; + + if (m_byte_timer->enabled()) { + // op completed + m_byte_timer->enable(false); + m_busy = false; + if (m_read) + m_ram[274] = 0; // Ignore ECC + return; + } + + uint8_t cur_sector = m_fdd_sector_counter; + if (cur_sector == m_sector) { if (m_read) { m_pll.set_clock(half_bitcell_size); m_pll.read_reset(machine().time()); @@ -233,14 +261,6 @@ TIMER_CALLBACK_MEMBER(s100_vector_dualmode_device::sector_cb) m_pending_size = 0; m_byte_timer->adjust(attotime::zero); } - m_sector_timer->adjust(attotime::from_msec(200)/16, SECTOR_END); - break; - - case SECTOR_END: - m_byte_timer->enable(false); - if (m_read) - m_ram[274] = 0; // Ignore ECC - break; } } @@ -282,13 +302,20 @@ void s100_vector_dualmode_device::device_start() { m_motor_on_timer = timer_alloc(FUNC(s100_vector_dualmode_device::motor_off), this); m_byte_timer = timer_alloc(FUNC(s100_vector_dualmode_device::byte_cb), this); - m_sector_timer = timer_alloc(FUNC(s100_vector_dualmode_device::sector_cb), this); + + for (auto& f : m_floppy) { + if (f->get_device()) + f->get_device()->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(&s100_vector_dualmode_device::floppy_index_cb, this)); + } save_item(NAME(m_ram)); save_item(NAME(m_cmar)); save_item(NAME(m_drive)); save_item(NAME(m_sector)); + save_item(NAME(m_fdd_sector_counter)); save_item(NAME(m_read)); + save_item(NAME(m_busy)); + save_item(NAME(m_last_sector_pulse)); save_item(NAME(m_pending_byte)); save_item(NAME(m_pending_size)); } @@ -319,9 +346,13 @@ static void vector4_formats(format_registration &fr) void s100_vector_dualmode_device::device_add_mconfig(machine_config &config) { FLOPPY_CONNECTOR(config, m_floppy[0], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[0]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[1], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[1]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[2], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[2]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[3], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[3]->set_sectoring_type(floppy_image::H16); } DEFINE_DEVICE_TYPE(S100_VECTOR_DUALMODE, s100_vector_dualmode_device, "vectordualmode", "Vector Dual-Mode Disk Controller") diff --git a/src/devices/bus/s100/vectordualmode.h b/src/devices/bus/s100/vectordualmode.h index e3a924a94c3f9..2df40dd819352 100644 --- a/src/devices/bus/s100/vectordualmode.h +++ b/src/devices/bus/s100/vectordualmode.h @@ -26,26 +26,25 @@ class s100_vector_dualmode_device : private: TIMER_CALLBACK_MEMBER(motor_off); - TIMER_CALLBACK_MEMBER(sector_cb); TIMER_CALLBACK_MEMBER(byte_cb); bool hdd_selected(); bool get_next_bit(attotime &tm, const attotime &limit); + void floppy_index_cb(floppy_image_device *floppy, int state); + void start_of_sector(); required_device_array m_floppy; uint8_t m_ram[512]; uint16_t m_cmar; uint8_t m_drive; uint8_t m_sector; + uint8_t m_fdd_sector_counter; bool m_read; + bool m_busy; emu_timer *m_motor_on_timer; + attotime m_last_sector_pulse; // fdd - enum sector_timer_state { - SECTOR_START, - SECTOR_END, - }; fdc_pll_t m_pll; emu_timer *m_byte_timer; - emu_timer *m_sector_timer; uint16_t m_pending_byte; uint8_t m_pending_size; }; diff --git a/src/devices/bus/spectrum/beta.h b/src/devices/bus/spectrum/beta.h index 3dac22f95d358..22afe752ee955 100644 --- a/src/devices/bus/spectrum/beta.h +++ b/src/devices/bus/spectrum/beta.h @@ -144,7 +144,7 @@ class spectrum_gamma_device : spectrum_gamma_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); spectrum_gamma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_CUSTOM_INPUT_MEMBER(busy_r) { return !m_centronics_busy; } + ioport_value busy_r() { return !m_centronics_busy; } protected: virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/bus/supracan/rom.cpp b/src/devices/bus/supracan/rom.cpp new file mode 100644 index 0000000000000..ca3be333df60d --- /dev/null +++ b/src/devices/bus/supracan/rom.cpp @@ -0,0 +1,96 @@ +// license:BSD-3-Clause +// copyright-holders: + +#include "emu.h" +#include "rom.h" + + +//------------------------------------------------- +// superacan_rom_device - constructor +//------------------------------------------------- + +DEFINE_DEVICE_TYPE(SUPERACAN_ROM_STD, superacan_rom_device, "superacan_rom", "Super A'Can Standard Cart") + + +superacan_rom_device::superacan_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock), device_superacan_cart_interface(mconfig, *this) + , m_rom_base(nullptr) + , m_nvram_base(nullptr) + , m_rom_size(0) + , m_nvram_size(0) +{ +} + +superacan_rom_device::superacan_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : superacan_rom_device(mconfig, SUPERACAN_ROM_STD, tag, owner, clock) +{ +} + + +void superacan_rom_device::device_start() +{ +} + +void superacan_rom_device::device_add_mconfig(machine_config &config) +{ + // TODO: move UM6650 from funtech folder +} + +std::error_condition superacan_rom_device::load() +{ + memory_region *const romregion = memregion("^rom"); + m_rom_base = reinterpret_cast(romregion->base()); + m_rom_size = romregion->bytes() / 2; + +// if (m_rom_size > 0x40'0000) +// return std::make_pair(image_error::INVALIDLENGTH, "Unsupported cartridge size (must be no larger than 4M)"); + + memory_region *const nvramregion = memregion("^nvram"); + if (nvramregion) + { + m_nvram_base = reinterpret_cast(nvramregion->base()); + m_nvram_size = nvramregion->bytes(); + + if (m_nvram_size & (m_nvram_size - 1)) + return image_error::BADSOFTWARE; + + save_pointer(NAME(m_nvram_base), m_nvram_size); + battery_load(m_nvram_base, m_nvram_size, 0xff); + } + + return std::error_condition(); +} + + +void superacan_rom_device::unload() +{ + if (m_nvram_base) + battery_save(m_nvram_base, m_nvram_size); +} + + +/*------------------------------------------------- + read/write + -------------------------------------------------*/ + +u16 superacan_rom_device::rom_r(offs_t offset) +{ + if (offset < m_rom_size) + return m_rom_base[offset]; + else + return 0xffff; +} + +u8 superacan_rom_device::nvram_r(offs_t offset) +{ + if (m_nvram_base) + return m_nvram_base[offset & (m_nvram_size - 1)]; + else + return 0xff; +} + +void superacan_rom_device::nvram_w(offs_t offset, u8 data) +{ + if (m_nvram_base) + m_nvram_base[offset & (m_nvram_size - 1)] = data; +} diff --git a/src/devices/bus/supracan/rom.h b/src/devices/bus/supracan/rom.h new file mode 100644 index 0000000000000..a75cb26fa6654 --- /dev/null +++ b/src/devices/bus/supracan/rom.h @@ -0,0 +1,46 @@ +// license:BSD-3-Clause +// copyright-holders: +#ifndef MAME_BUS_SUPERACAN_ROM_H +#define MAME_BUS_SUPERACAN_ROM_H + +#pragma once + +#include "slot.h" + + +// ======================> superacan_rom_device + +class superacan_rom_device : public device_t, + public device_superacan_cart_interface +{ +public: + // construction/destruction + superacan_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // load/unload + virtual std::error_condition load() override; + virtual void unload() override; + + // read/write + virtual u16 rom_r(offs_t offset) override; + virtual u8 nvram_r(offs_t offset) override; + virtual void nvram_w(offs_t offset, u8 data) override; + +protected: + superacan_rom_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; + +private: + const u16 *m_rom_base; + u8 *m_nvram_base; + u32 m_rom_size; + u32 m_nvram_size; +}; + + +DECLARE_DEVICE_TYPE(SUPERACAN_ROM_STD, superacan_rom_device) + +#endif // MAME_BUS_SUPERACAN_ROM_H diff --git a/src/devices/bus/supracan/slot.cpp b/src/devices/bus/supracan/slot.cpp new file mode 100644 index 0000000000000..19f10c449f6b4 --- /dev/null +++ b/src/devices/bus/supracan/slot.cpp @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders: + +#include "emu.h" +#include "slot.h" + + +DEFINE_DEVICE_TYPE(SUPERACAN_CART_SLOT, superacan_cart_slot_device, "superacan_cart_slot", "Super A'Can Cartridge Slot") + + +device_superacan_cart_interface::device_superacan_cart_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "superacan_cart") + , m_slot(dynamic_cast(device.owner())) +{ +} + + +device_superacan_cart_interface::~device_superacan_cart_interface() +{ +} + + +void device_superacan_cart_interface::battery_load(void *buffer, int length, int fill) +{ + assert(m_slot); + m_slot->battery_load(buffer, length, fill); +} + +void device_superacan_cart_interface::battery_load(void *buffer, int length, void *def_buffer) +{ + assert(m_slot); + m_slot->battery_load(buffer, length, def_buffer); +} + +void device_superacan_cart_interface::battery_save(const void *buffer, int length) +{ + assert(m_slot); + m_slot->battery_save(buffer, length); +} + + +superacan_cart_slot_device::superacan_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SUPERACAN_CART_SLOT, tag, owner, clock), + device_cartrom_image_interface(mconfig, *this), + device_single_card_slot_interface(mconfig, *this), + m_cart(nullptr) +{ +} + + +//------------------------------------------------- +// superacan_cart_slot_device - destructor +//------------------------------------------------- + +superacan_cart_slot_device::~superacan_cart_slot_device() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void superacan_cart_slot_device::device_start() +{ + m_cart = get_card_device(); +} + + + +/*------------------------------------------------- + call load + -------------------------------------------------*/ + +std::pair superacan_cart_slot_device::call_load() +{ + if (!m_cart) + return std::make_pair(std::error_condition(), std::string()); + + memory_region *romregion = loaded_through_softlist() ? memregion("rom") : nullptr; + if (loaded_through_softlist() && !romregion) + return std::make_pair(image_error::INVALIDLENGTH, "Software list item has no 'rom' data area"); + + const u32 len = loaded_through_softlist() ? romregion->bytes() : length(); + + if (!loaded_through_softlist()) + { + romregion = machine().memory().region_alloc(subtag("rom"), len, 2, ENDIANNESS_BIG); + u16 *const rombase = reinterpret_cast(romregion->base()); + const u32 cnt = fread(rombase, len); + if (cnt != len) + return std::make_pair(std::errc::io_error, "Error reading cartridge file"); + } + + return std::make_pair(m_cart->load(), std::string()); +} + + +/*------------------------------------------------- + call unload + -------------------------------------------------*/ + +void superacan_cart_slot_device::call_unload() +{ + if (m_cart) + m_cart->unload(); +} + + +/*------------------------------------------------- + get default card software + -------------------------------------------------*/ + +std::string superacan_cart_slot_device::get_default_card_software(get_default_card_software_hook &hook) const +{ + return software_get_default_slot("std"); +} diff --git a/src/devices/bus/supracan/slot.h b/src/devices/bus/supracan/slot.h new file mode 100644 index 0000000000000..2c28537780705 --- /dev/null +++ b/src/devices/bus/supracan/slot.h @@ -0,0 +1,90 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_BUS_SUPERACAN_SLOT_H +#define MAME_BUS_SUPERACAN_SLOT_H + +#include "imagedev/cartrom.h" + +#include +#include + + +/*************************************************************************** + TYPE DEFINITIONS + ***************************************************************************/ + +class superacan_cart_slot_device; + + +class device_superacan_cart_interface : public device_interface +{ +public: + virtual ~device_superacan_cart_interface(); + + // load/unload + virtual std::error_condition load() = 0; + virtual void unload() = 0; + + // read/write + virtual u16 rom_r(offs_t offset) = 0; + virtual u8 nvram_r(offs_t offset) = 0; + virtual void nvram_w(offs_t offset, u8 data) = 0; + +protected: + // construction/destruction + device_superacan_cart_interface(const machine_config &mconfig, device_t &device); + + // helpers for slot stuff + void battery_load(void *buffer, int length, int fill); + void battery_load(void *buffer, int length, void *def_buffer); + void battery_save(const void *buffer, int length); + +private: + superacan_cart_slot_device *const m_slot; +}; + + +class superacan_cart_slot_device : public device_t, + public device_cartrom_image_interface, + public device_single_card_slot_interface +{ +public: + // construction/destruction + template + superacan_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, T &&opts, char const *dflt) + : superacan_cart_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + superacan_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual ~superacan_cart_slot_device(); + + // device_image_interface implementation + virtual std::pair call_load() override; + virtual void call_unload() override; + + virtual bool is_reset_on_load() const noexcept override { return true; } + virtual const char *image_interface() const noexcept override { return "superacan_cart"; } + virtual const char *file_extensions() const noexcept override { return "bin"; } + + virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; + + // reading and writing + u16 rom_r(offs_t offset) { return m_cart ? m_cart->rom_r(offset) : 0xffff; } + u8 nvram_r(offs_t offset) { return m_cart ? m_cart->nvram_r(offset) : 0xff; } + void nvram_w(offs_t offset, u8 data) { if (m_cart) m_cart->nvram_w(offset, data); } + +protected: + // device_t implementation + virtual void device_start() override; + + device_superacan_cart_interface *m_cart; +}; + +DECLARE_DEVICE_TYPE(SUPERACAN_CART_SLOT, superacan_cart_slot_device) + +#endif // MAME_BUS_SUPERACAN_SLOT_H diff --git a/src/devices/bus/vme/mvme328.cpp b/src/devices/bus/vme/mvme328.cpp new file mode 100644 index 0000000000000..837031804d4cd --- /dev/null +++ b/src/devices/bus/vme/mvme328.cpp @@ -0,0 +1,291 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +/* + * Interphase V/SCSI 4210 Jaguar High-Performance VMEbus Dual SCSI Host Adapter (aka Motorola MVME328 VMEbus Dual SCSI Host Adapter) + * + * Sources: + * - V/SCSI 4210 Jaguar High-Performance VMEbus Dual SCSI Host Adapter System Integration Guide, Interphase Corporation, March 13, 1991 (UG04210-000 REVD) + * - MVME328 VMEbus VMEbus Dual SCSI Host Adapter User's Manual (MVME328/D1) + * + * TODO: + * - scsi data transfer and dma + * - vme interrupts + * - leds + * - timer + * - smt variant + */ +/* + * WIP notes + * -- + * configuration block (+0x788 at 0x61ff88 = base 0x61f800) + * - product code = "077" + * - variation = "0" + * - firmware version = "01T" + * - firmware date "11 51992" + * + * LED1 - red/green, board OK (bit 1 in MSR, red indicates reset or failure) + * LED2.0 - VMEbus busy (system) + * LED2.1 - VMEbus busy (bus master) + * LED2.2 - SCSI busy (port 0) + * LED2.3 - not used + */ +#include "emu.h" +#include "mvme328.h" + +#include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" + +//#define VERBOSE (LOG_GENERAL) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(VME_MVME328, vme_mvme328_device, "mvme328", "Motorola MVME328") + +vme_mvme328_device::vme_mvme328_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : device_t(mconfig, VME_MVME328, tag, owner, clock) + , device_vme_card_interface(mconfig, *this) + , m_cpu(*this, "cpu") + , m_scsi(*this, "scsi%u:7:mb87030", 0U) + , m_bram(*this, "buffer_ram") + , m_sw1(*this, "SW1") + , m_led1(*this, "led1") + , m_led2(*this, "led2.%u", 0U) + , m_boot(*this, "boot") +{ +} + +ROM_START(mvme328) + ROM_REGION16_BE(0x10000, "eprom", 0) + ROM_SYSTEM_BIOS(0, "077001t", "Interphase Jaguar 0770 firmware version 01T, 11 51992") + ROMX_LOAD("0770k0801t.uk8", 0x0001, 0x8000, CRC(22f0440e) SHA1(37d8039778ec7ef0cb24940eabd45992920975a1), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("0770k1001t.uk10", 0x0000, 0x8000, CRC(d7d0d4c3) SHA1(5756719bf005e3e26be7bbc8cb1c2f771d260a02), ROM_SKIP(1) | ROM_BIOS(0)) + + ROM_SYSTEM_BIOS(1, "077401s", "Interphase Jaguar 0774 firmware version 01S, 07311992") + ROMX_LOAD("0774e1501s__9348.ue15", 0x0000, 0x8000, CRC(e614ef1f) SHA1(8bc56ad49989e78682a6d69351e8cf0f2557b311), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD("0774f1501s__9348.uf15", 0x0001, 0x8000, CRC(3c6e8016) SHA1(0a39873b5a17f71db86afcd361141e5b9f6786e9), ROM_SKIP(1) | ROM_BIOS(1)) +ROM_END + +static INPUT_PORTS_START(mvme328) + PORT_START("SW1") + PORT_DIPNAME(0x100, 0x000, "Permit User Access") PORT_DIPLOCATION("SW1:9") + PORT_DIPSETTING(0x000, DEF_STR(No)) + PORT_DIPSETTING(0x100, DEF_STR(Yes)) + PORT_DIPNAME(0x0f8, 0x000, "Base Address") PORT_DIPLOCATION("SW1:4,5,6,7,8") + PORT_DIPSETTING(0x000, "0x0000") + PORT_DIPSETTING(0x008, "0x0800") + PORT_DIPSETTING(0x010, "0x1000") + PORT_DIPSETTING(0x018, "0x1800") + PORT_DIPSETTING(0x020, "0x2000") + PORT_DIPSETTING(0x028, "0x2800") + PORT_DIPSETTING(0x030, "0x3000") + PORT_DIPSETTING(0x038, "0x3800") + PORT_DIPSETTING(0x040, "0x4000") + PORT_DIPSETTING(0x048, "0x4800") + PORT_DIPSETTING(0x050, "0x5000") + PORT_DIPSETTING(0x058, "0x5800") + PORT_DIPSETTING(0x060, "0x6000") + PORT_DIPSETTING(0x068, "0x6800") + PORT_DIPSETTING(0x070, "0x7000") + PORT_DIPSETTING(0x078, "0x7800") + PORT_DIPSETTING(0x080, "0x8000") + PORT_DIPSETTING(0x088, "0x8800") + PORT_DIPSETTING(0x090, "0x9000") + PORT_DIPSETTING(0x098, "0x9800") + PORT_DIPSETTING(0x0a0, "0xa000") + PORT_DIPSETTING(0x0a8, "0xa800") + PORT_DIPSETTING(0x0b0, "0xb000") + PORT_DIPSETTING(0x0b8, "0xb800") + PORT_DIPSETTING(0x0c0, "0xc000") + PORT_DIPSETTING(0x0c8, "0xc800") + PORT_DIPSETTING(0x0d0, "0xd000") + PORT_DIPSETTING(0x0d8, "0xd800") + PORT_DIPSETTING(0x0e0, "0xe000") + PORT_DIPSETTING(0x0e8, "0xe800") + PORT_DIPSETTING(0x0f0, "0xf000") + PORT_DIPSETTING(0x0f8, "0xf800") + PORT_DIPNAME(0x007, 0x007, "SCSI Port 0 ID") PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING(0x000, "0") + PORT_DIPSETTING(0x001, "1") + PORT_DIPSETTING(0x002, "2") + PORT_DIPSETTING(0x003, "3") + PORT_DIPSETTING(0x004, "4") + PORT_DIPSETTING(0x005, "5") + PORT_DIPSETTING(0x006, "6") + PORT_DIPSETTING(0x007, "7") + + PORT_START("Priority") + PORT_CONFNAME(0x03, 0x03, "VMEbus Request Priority") + PORT_CONFSETTING(0x00, "0") + PORT_CONFSETTING(0x01, "1") + PORT_CONFSETTING(0x02, "2") + PORT_CONFSETTING(0x03, "3") +INPUT_PORTS_END + +const tiny_rom_entry *vme_mvme328_device::device_rom_region() const +{ + return ROM_NAME(mvme328); +} + +ioport_constructor vme_mvme328_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(mvme328); +} + +void vme_mvme328_device::device_start() +{ + m_led1.resolve(); + m_led2.resolve(); + + m_timer = timer_alloc(FUNC(vme_mvme328_device::timer), this); + + save_item(NAME(m_ctl)); + save_item(NAME(m_sts)); + + m_ctl = 0; +} + +void vme_mvme328_device::device_reset() +{ + m_timer->adjust(attotime::never); + + m_boot.select(0); + + // HACK: 0x0700 indicates an original board type? + m_sts = (BIT(m_sw1->read(), 0, 3) << 12) | 0x0700; +} + +static void scsi_devices(device_slot_interface &device) +{ + device.option_add("harddisk", NSCSI_HARDDISK); + device.option_add("tape", NSCSI_TAPE); +} + +void vme_mvme328_device::device_add_mconfig(machine_config &config) +{ + M68000(config, m_cpu, 24_MHz_XTAL / 2); // HD68HC000P12 + m_cpu->set_addrmap(AS_PROGRAM, &vme_mvme328_device::cpu_mem); + + NSCSI_BUS(config, "scsi0"); + NSCSI_CONNECTOR(config, "scsi0:0", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:1", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:2", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:3", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:4", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:5", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:6", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi0:7").option_set("mb87030", MB87030).machine_config( + [this](device_t *device) + { + mb87030_device &mb87030(downcast(*device)); + + mb87030.set_clock(8'000'000); + mb87030.out_irq_callback().set( + [this](int state) + { + if (state) + m_sts |= 1U << 6; + else + m_sts &= ~(1U << 6); + + m_cpu->set_input_line(INPUT_LINE_IRQ6, state); + }); + }); + + NSCSI_BUS(config, "scsi1"); + NSCSI_CONNECTOR(config, "scsi1:0", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:1", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:2", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:3", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:4", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:5", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:6", scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi1:7").option_set("mb87030", MB87030).machine_config( + [this](device_t *device) + { + mb87030_device &mb87030(downcast(*device)); + + mb87030.set_clock(8'000'000); + mb87030.out_irq_callback().set( + [this](int state) + { + if (state) + m_sts |= 1U << 5; + else + m_sts &= ~(1U << 5); + + m_cpu->set_input_line(INPUT_LINE_IRQ5, state); + }); + }); + + // TODO: VLSI VGC7224-0420 II-DMA-50M +} + +void vme_mvme328_device::cpu_mem(address_map &map) +{ + map(0x00'0000, 0x00'ffff).view(m_boot); + m_boot[0](0x00'0000, 0x00'ffff).rom().region("eprom", 0); + m_boot[1](0x00'0000, 0x00'3fff).ram(); + + map(0x20'0000, 0x20'ffff).rom().region("eprom", 0); + map(0x60'0000, 0x61'ffff).ram().share("buffer_ram"); + map(0x68'0000, 0x69'ffff).noprw(); // event ram? + + map(0x80'0000, 0x80'0001).r(FUNC(vme_mvme328_device::sts_r)); + map(0xa0'0000, 0xa0'0001).rw(FUNC(vme_mvme328_device::ctl_r), FUNC(vme_mvme328_device::ctl_w)); + + map(0xc0'0000, 0xc0'001f).m(m_scsi[0], FUNC(mb87030_device::map)).umask16(0x00ff); + map(0xc0'8000, 0xc0'801f).m(m_scsi[1], FUNC(mb87030_device::map)).umask16(0x00ff); + + // 0xc0'c000 = smt version switches? + + map(0xc1'0000, 0xc1'0001).lw16([this](u16 data) { m_timer->adjust(attotime::from_msec(10)); }, "timer"); +} + +void vme_mvme328_device::timer(int param) +{ + m_cpu->set_input_line(INPUT_LINE_IRQ1, HOLD_LINE); +} + +u16 vme_mvme328_device::sts_r() +{ + LOG("sts_r 0x%04x (%s)\n", m_sts, machine().describe_context()); + + // .sss .??? iiii iiii + // sss scsi id + // ??? xor with same bits from 90'0000?, board type? + // iii irq state? + + return m_sts; +} + +u16 vme_mvme328_device::ctl_r() +{ + return m_ctl; +} + +void vme_mvme328_device::ctl_w(u16 data) +{ + LOG("ctl_w 0x%04x (%s)\n", data, machine().describe_context()); + + // bit 10: enable scratchpad ram? + if (BIT(data, 10)) + m_boot.select(1); + + // bit 14: enable VME access? + if (BIT(data, 14) && !BIT(m_ctl, 14)) + { + unsigned const sw1 = m_sw1->read(); + + // share last 2k of buffer RAM in VME supervisor short space (a16, privileged) + offs_t const base = BIT(sw1, 3, 5) * 0x800U; + vme_space(vme::AM_2d).install_ram(base, base + 0x7ffU, &m_bram[0xfc00]); + + // optionally share in user short space (a16, non-privileged) + if (BIT(sw1, 8)) + vme_space(vme::AM_29).install_ram(base, base + 0x7ffU, &m_bram[0xfc00]); + } + + // bit 15: led? + + m_ctl = data; +} diff --git a/src/devices/bus/vme/mvme328.h b/src/devices/bus/vme/mvme328.h new file mode 100644 index 0000000000000..235ebba591f52 --- /dev/null +++ b/src/devices/bus/vme/mvme328.h @@ -0,0 +1,56 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +#ifndef MAME_BUS_VME_MVME328_H +#define MAME_BUS_VME_MVME328_H + +#pragma once + +#include "cpu/m68000/m68000.h" +#include "machine/mb87030.h" + +#include "bus/vme/vme.h" + +class vme_mvme328_device + : public device_t + , public device_vme_card_interface +{ +public: + vme_mvme328_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + +protected: + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + void cpu_mem(address_map &map); + void cpu_int(address_map &map); + + void timer(int param); + + u16 sts_r(); + u16 ctl_r(); + void ctl_w(u16 data); + + required_device m_cpu; + required_device_array m_scsi; + + required_shared_ptr m_bram; + + required_ioport m_sw1; + output_finder<> m_led1; + output_finder<4> m_led2; + + emu_timer *m_timer; + memory_view m_boot; + + u16 m_sts; + u16 m_ctl; +}; + +DECLARE_DEVICE_TYPE(VME_MVME328, vme_mvme328_device) + +#endif // MAME_BUS_VME_MVME328_H diff --git a/src/devices/bus/vme/vme_cards.cpp b/src/devices/bus/vme/vme_cards.cpp index e66cf8d322a11..cc6d26b2bae78 100644 --- a/src/devices/bus/vme/vme_cards.cpp +++ b/src/devices/bus/vme/vme_cards.cpp @@ -14,6 +14,7 @@ #include "mvme181.h" #include "mvme187.h" #include "mvme327a.h" +#include "mvme328.h" #include "mvme350.h" #include "mzr8105.h" #include "mzr8300.h" @@ -40,6 +41,7 @@ void vme_cards(device_slot_interface &device) device.option_add("mvme181", VME_MVME181); device.option_add("mvme187", VME_MVME187); device.option_add("mvme327a", VME_MVME327A); + device.option_add("mvme328", VME_MVME328); device.option_add("mvme350", VME_MVME350); device.option_add("mzr8105", VME_MZR8105); device.option_add("mzr8300", VME_MZR8300); diff --git a/src/devices/bus/wysekbd/wysegakb.cpp b/src/devices/bus/wysekbd/wysegakb.cpp index 4ec409ce11846..22fd035f148d0 100644 --- a/src/devices/bus/wysekbd/wysegakb.cpp +++ b/src/devices/bus/wysekbd/wysegakb.cpp @@ -4,6 +4,11 @@ Wyse gate array-based terminal keyboards + The original WY-85 keyboard (#840105-01) did not have a gate array but + used LSTTL counters and decoders, an analog multiplexer, LM339 + comparators and various discrete components. The later WY-85 gate array + keyboard (#840336-01) is likely functionally identical to it. + ***************************************************************************/ #include "emu.h" @@ -15,6 +20,8 @@ //************************************************************************** // device type definitions +DEFINE_DEVICE_TYPE(WY85_KEYBOARD, wy85_keyboard_device, "wy85_kbd", "WY-85 Keyboard") +DEFINE_DEVICE_TYPE(WY30_KEYBOARD, wy30_keyboard_device, "wy30_kbd", "WY-30 Keyboard") DEFINE_DEVICE_TYPE(WY60_ASCII_KEYBOARD, wy60_ascii_keyboard_device, "wy60_ascii_kbd", "WY-60 ASCII Keyboard") DEFINE_DEVICE_TYPE(WYSE_AT_KEYBOARD, wyse_at_keyboard_device, "wyse_at_kbd", "Wyse AT-Style Keyboard") DEFINE_DEVICE_TYPE(WYSE_316X_KEYBOARD, wyse_316x_keyboard_device, "wyse_316x_kbd", "Wyse IBM 316X-Style Keyboard") @@ -93,6 +100,289 @@ void wyse_gate_array_keyboard_device::wysekbd_update_leds(u8 index) // KEYBOARD DEVICES //************************************************************************** +wy85_keyboard_device::wy85_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : wyse_gate_array_keyboard_device(mconfig, WY85_KEYBOARD, tag, owner, clock) +{ +} + +static INPUT_PORTS_START(wy85_keyboard) + PORT_START("R0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CODE(KEYCODE_4_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF1") PORT_CODE(KEYCODE_NUMLOCK) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('<') PORT_CHAR('>') PORT_CODE(KEYCODE_BACKSLASH2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('8') PORT_CHAR('*') PORT_CODE(KEYCODE_8) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) PORT_CODE(KEYCODE_TAB) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(0x0d) PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1 (Hold Screen)") PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CODE(KEYCODE_F1) + + PORT_START("R1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CODE(KEYCODE_DEL_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CODE(KEYCODE_5_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF2") PORT_CODE(KEYCODE_EQUALS_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CHAR('z') PORT_CHAR('Z') PORT_CODE(KEYCODE_Z) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('9') PORT_CHAR('(') PORT_CODE(KEYCODE_9) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CHAR('r') PORT_CHAR('R') PORT_CODE(KEYCODE_R) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2 (Print Screen)") PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CODE(KEYCODE_F2) + + PORT_START("R2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CODE(KEYCODE_UP) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CODE(KEYCODE_6_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF3") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CHAR('c') PORT_CHAR('C') PORT_CODE(KEYCODE_C) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('0') PORT_CHAR(')') PORT_CODE(KEYCODE_0) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CHAR('w') PORT_CHAR('W') PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('|') PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3 (Reset/Set Up)") PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CODE(KEYCODE_F3) + + PORT_START("R3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF4") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CHAR('x') PORT_CHAR('X') PORT_CODE(KEYCODE_X) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CHAR('e') PORT_CHAR('E') PORT_CODE(KEYCODE_E) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(';') PORT_CHAR(':') PORT_CODE(KEYCODE_COLON) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4 (Send Block)") PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CODE(KEYCODE_F4) + + PORT_START("R4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CODE(KEYCODE_7_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CHAR('v') PORT_CHAR('V') PORT_CODE(KEYCODE_V) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CODE(KEYCODE_EQUALS) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CHAR('q') PORT_CHAR('Q') PORT_CODE(KEYCODE_Q) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space Bar") PORT_CHAR(' ') PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5 (Break)") PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CODE(KEYCODE_F5) + + PORT_START("R5") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F19)) PORT_CODE(KEYCODE_F19) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F18)) PORT_CODE(KEYCODE_F18) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F17)) PORT_CODE(KEYCODE_F17) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Do") PORT_CHAR(UCHAR_MAMEKEY(F16)) PORT_CODE(KEYCODE_F16) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Help") PORT_CHAR(UCHAR_MAMEKEY(F15)) PORT_CODE(KEYCODE_F15) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F14 (Home)") PORT_CHAR(UCHAR_MAMEKEY(F14), UCHAR_MAMEKEY(HOME)) PORT_CODE(KEYCODE_F14) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F13 (LF)") PORT_CHAR(UCHAR_MAMEKEY(F13), 0x0a) PORT_CODE(KEYCODE_F13) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Compose Character") PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_CODE(KEYCODE_LALT) + + PORT_START("R6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CHAR('l') PORT_CHAR('L') PORT_CODE(KEYCODE_L) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CHAR('k') PORT_CHAR('K') PORT_CODE(KEYCODE_K) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CHAR('j') PORT_CHAR('J') PORT_CODE(KEYCODE_J) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CHAR('h') PORT_CHAR('H') PORT_CODE(KEYCODE_H) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CHAR('g') PORT_CHAR('G') PORT_CODE(KEYCODE_G) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F20)) PORT_CODE(KEYCODE_F20) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CODE(KEYCODE_F6) + + PORT_START("R7") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_CLOSEBRACE) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_OPENBRACE) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u232B (Delete)") PORT_CODE(KEYCODE_BACKSPACE) // ⌫ + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CHAR('p') PORT_CHAR('P') PORT_CODE(KEYCODE_P) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Insert Here") PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CODE(KEYCODE_HOME) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CODE(KEYCODE_LCONTROL) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CODE(KEYCODE_F7) + + PORT_START("R8") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('7') PORT_CHAR('&') PORT_CODE(KEYCODE_7) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('6') PORT_CHAR('^') PORT_CODE(KEYCODE_6) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('5') PORT_CHAR('%') PORT_CODE(KEYCODE_5) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('4') PORT_CHAR('$') PORT_CODE(KEYCODE_4) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Remove") PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CODE(KEYCODE_PGUP) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CHAR('t') PORT_CHAR('T') PORT_CODE(KEYCODE_T) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Lock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_CAPSLOCK) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CODE(KEYCODE_F8) + + PORT_START("R9") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('/') PORT_CHAR('?') PORT_CODE(KEYCODE_SLASH) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('.') PORT_CODE(KEYCODE_STOP) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(',') PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Select") PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('`') PORT_CHAR('~') PORT_CODE(KEYCODE_TILDE) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CHAR('y') PORT_CHAR('Y') PORT_CODE(KEYCODE_Y) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CHAR('a') PORT_CHAR('A') PORT_CODE(KEYCODE_A) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_CODE(KEYCODE_F9) + + PORT_START("R10") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(COMMA_PAD)) PORT_CODE(KEYCODE_PLUS_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_CODE(KEYCODE_MINUS_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Prev Screen") PORT_CHAR(UCHAR_MAMEKEY(PGUP)) PORT_CODE(KEYCODE_END) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CHAR('n') PORT_CHAR('N') PORT_CODE(KEYCODE_N) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('1') PORT_CHAR('!') PORT_CODE(KEYCODE_1) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CHAR('u') PORT_CHAR('U') PORT_CODE(KEYCODE_U) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CHAR('s') PORT_CHAR('S') PORT_CODE(KEYCODE_S) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_CODE(KEYCODE_F10) + + PORT_START("R11") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Next Screen") PORT_CHAR(UCHAR_MAMEKEY(PGDN)) PORT_CODE(KEYCODE_PGDN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CODE(KEYCODE_8_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CHAR('b') PORT_CHAR('B') PORT_CODE(KEYCODE_B) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('2') PORT_CHAR('@') PORT_CODE(KEYCODE_2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CHAR('i') PORT_CHAR('I') PORT_CODE(KEYCODE_I) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CHAR('f') PORT_CHAR('F') PORT_CODE(KEYCODE_F) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F11 (Esc)") PORT_CHAR(UCHAR_MAMEKEY(F11), 0x1b) PORT_CODE(KEYCODE_F11) + + PORT_START("R12") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Find") PORT_CODE(KEYCODE_INSERT) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CODE(KEYCODE_3_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CODE(KEYCODE_9_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CHAR('m') PORT_CHAR('M') PORT_CODE(KEYCODE_M) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('3') PORT_CHAR('#') PORT_CODE(KEYCODE_3) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CHAR('o') PORT_CHAR('O') PORT_CODE(KEYCODE_O) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CHAR('d') PORT_CHAR('D') PORT_CODE(KEYCODE_D) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F12 (BS)") PORT_CHAR(UCHAR_MAMEKEY(F12), 0x08) PORT_CODE(KEYCODE_F12) +INPUT_PORTS_END + +ioport_constructor wy85_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(wy85_keyboard); +} + +u8 wy85_keyboard_device::wysekbd_get_id() +{ + // Original LSTTL version definitely lacks an ID; gate array version has this ID according to https://geekhack.org/index.php?topic=51079.0 + return 0x60 ^ 0xff; +} + + +wy30_keyboard_device::wy30_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : wyse_gate_array_keyboard_device(mconfig, WY30_KEYBOARD, tag, owner, clock) +{ +} + +static INPUT_PORTS_START(wy30_keyboard) + PORT_START("R0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 1 Send") PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad - Replace") PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_CODE(KEYCODE_MINUS_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CODE(KEYCODE_NUMLOCK) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CapsLock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_LCONTROL) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CHAR('d') PORT_CHAR('D') PORT_CODE(KEYCODE_D) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CHAR('p') PORT_CHAR('P') PORT_CODE(KEYCODE_P) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Funct") PORT_CODE(KEYCODE_LALT) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) PORT_CODE(KEYCODE_TILDE) + + PORT_START("R1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 2 Copy Prt") PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 4 Ins Line") PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CODE(KEYCODE_4_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CODE(KEYCODE_EQUALS_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CHAR(' ') PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(0x0d) PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_OPENBRACE) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CHAR('c') PORT_CHAR('C') PORT_CODE(KEYCODE_C) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('1') PORT_CHAR('!') PORT_CODE(KEYCODE_1) + + PORT_START("R2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"Keypad 3 \u25B2 Page") PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CODE(KEYCODE_3_PAD) // ▲ Page + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 5 Del Line") PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CODE(KEYCODE_5_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('|') PORT_CODE(KEYCODE_RALT) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CHAR('s') PORT_CHAR('S') PORT_CODE(KEYCODE_S) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_CLOSEBRACE) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CHAR('z') PORT_CHAR('Z') PORT_CODE(KEYCODE_Z) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('2') PORT_CHAR('@') PORT_CODE(KEYCODE_2) + + PORT_START("R3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Setup") PORT_CODE(KEYCODE_INSERT) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BackSpace") PORT_CHAR(0x08) PORT_CODE(KEYCODE_BACKSPACE) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CODE(KEYCODE_EQUALS) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('0') PORT_CHAR(')') PORT_CODE(KEYCODE_0) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('`') PORT_CHAR('~') PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('9') PORT_CHAR('(') PORT_CODE(KEYCODE_9) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) + + PORT_START("R4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CODE(KEYCODE_HOME) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CODE(KEYCODE_UP) // (possibly DOWN instead) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('/') PORT_CHAR('?') PORT_CODE(KEYCODE_SLASH) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('.') PORT_CHAR('>') PORT_CODE(KEYCODE_STOP) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CODE(KEYCODE_CAPSLOCK) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(',') PORT_CHAR('<') PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('3') PORT_CHAR('#') PORT_CODE(KEYCODE_3) + + PORT_START("R5") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CHAR('o') PORT_CHAR('O') PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CHAR('i') PORT_CHAR('I') PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CHAR('u') PORT_CHAR('U') PORT_CODE(KEYCODE_U) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CHAR('t') PORT_CHAR('T') PORT_CODE(KEYCODE_T) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CHAR('y') PORT_CHAR('Y') PORT_CODE(KEYCODE_Y) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CHAR('x') PORT_CHAR('X') PORT_CODE(KEYCODE_X) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) PORT_CODE(KEYCODE_END) + + PORT_START("R6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(';') PORT_CHAR(':') PORT_CODE(KEYCODE_COLON) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CHAR('l') PORT_CHAR('L') PORT_CODE(KEYCODE_L) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CHAR('a') PORT_CHAR('A') PORT_CODE(KEYCODE_A) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CHAR('j') PORT_CHAR('J') PORT_CODE(KEYCODE_J) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) PORT_CODE(KEYCODE_TAB) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('4') PORT_CHAR('$') PORT_CODE(KEYCODE_4) + + PORT_START("R7") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"Keypad . \u25BC Page") PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CODE(KEYCODE_DEL_PAD) // ▼ Page + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 0 Print Page") PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CHAR('f') PORT_CHAR('F') PORT_CODE(KEYCODE_F) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CHAR('q') PORT_CHAR('Q') PORT_CODE(KEYCODE_Q) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CHAR('v') PORT_CHAR('V') PORT_CODE(KEYCODE_V) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('5') PORT_CHAR('%') PORT_CODE(KEYCODE_5) + + PORT_START("R8") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 9 Clr Line") PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CODE(KEYCODE_9_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad , Insert") PORT_CHAR(UCHAR_MAMEKEY(COMMA_PAD)) PORT_CODE(KEYCODE_PLUS_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CHAR('H') PORT_CHAR('H') PORT_CODE(KEYCODE_H) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CHAR('W') PORT_CHAR('W') PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CHAR('N') PORT_CHAR('N') PORT_CODE(KEYCODE_N) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('6') PORT_CHAR('^') PORT_CODE(KEYCODE_6) + + PORT_START("R9") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 8 Del Char") PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CODE(KEYCODE_8_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CODE(KEYCODE_DOWN) // (possibly UP instead) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CHAR('g') PORT_CHAR('G') PORT_CODE(KEYCODE_G) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CHAR('e') PORT_CHAR('E') PORT_CODE(KEYCODE_E) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CHAR('b') PORT_CHAR('B') PORT_CODE(KEYCODE_B) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('7') PORT_CHAR('&') PORT_CODE(KEYCODE_7) + + PORT_START("R10") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Del Break") PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 6 Clr Page") PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CODE(KEYCODE_6_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 7 Ins Char") PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CODE(KEYCODE_7_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CHAR('k') PORT_CHAR('K') PORT_CODE(KEYCODE_K) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CHAR('r') PORT_CHAR('R') PORT_CODE(KEYCODE_R) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CHAR('m') PORT_CHAR('M') PORT_CODE(KEYCODE_M) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('8') PORT_CHAR('*') PORT_CODE(KEYCODE_8) + + PORT_START("R11") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("R12") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED) +INPUT_PORTS_END + +ioport_constructor wy30_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(wy30_keyboard); +} + +u8 wy30_keyboard_device::wysekbd_get_id() +{ + return 0x01 ^ 0xff; +} + + wy60_ascii_keyboard_device::wy60_ascii_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : wyse_gate_array_keyboard_device(mconfig, WY60_ASCII_KEYBOARD, tag, owner, clock) { diff --git a/src/devices/bus/wysekbd/wysegakb.h b/src/devices/bus/wysekbd/wysegakb.h index bc91e6cf70539..1bef4102a5b7e 100644 --- a/src/devices/bus/wysekbd/wysegakb.h +++ b/src/devices/bus/wysekbd/wysegakb.h @@ -46,6 +46,32 @@ class wyse_gate_array_keyboard_device : public device_t, public wyse_keyboard_in attotime m_reset_time; }; +// ======================> wy85_keyboard_device + +class wy85_keyboard_device : public wyse_gate_array_keyboard_device +{ +public: + // device type constructor + wy85_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0U); + +protected: + virtual ioport_constructor device_input_ports() const override; + virtual u8 wysekbd_get_id() override; +}; + +// ======================> wy30_keyboard_device + +class wy30_keyboard_device : public wyse_gate_array_keyboard_device +{ +public: + // device type constructor + wy30_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0U); + +protected: + virtual ioport_constructor device_input_ports() const override; + virtual u8 wysekbd_get_id() override; +}; + // ======================> wy60_ascii_keyboard_device class wy60_ascii_keyboard_device : public wyse_gate_array_keyboard_device @@ -126,6 +152,8 @@ class wyse_pceint_keyboard_device : public wyse_at_keyboard_device }; // device type declarations +DECLARE_DEVICE_TYPE(WY85_KEYBOARD, wy85_keyboard_device) +DECLARE_DEVICE_TYPE(WY30_KEYBOARD, wy30_keyboard_device) DECLARE_DEVICE_TYPE(WY60_ASCII_KEYBOARD, wy60_ascii_keyboard_device) DECLARE_DEVICE_TYPE(WYSE_AT_KEYBOARD, wyse_at_keyboard_device) DECLARE_DEVICE_TYPE(WYSE_316X_KEYBOARD, wyse_316x_keyboard_device) diff --git a/src/devices/bus/wysekbd/wysekbd.cpp b/src/devices/bus/wysekbd/wysekbd.cpp index be6cdf536a4dd..6e7f6c66c6d0e 100644 --- a/src/devices/bus/wysekbd/wysekbd.cpp +++ b/src/devices/bus/wysekbd/wysekbd.cpp @@ -19,9 +19,9 @@ Each keyboard has a different matrix layout, so the same key may appear at different indices on different keyboards. The one consistent feature - is the reservation of one row for an ID code. Some keyboards also have - LEDs whose state can be set by sending a few additional pulses - following the ID row. + is the reservation of one row for an ID code (though this is absent on + the earliest keyboards). Some keyboards also have LEDs whose state can + be set by sending a few additional pulses following the ID row. ***************************************************************************/ @@ -69,6 +69,16 @@ wyse_keyboard_interface::~wyse_keyboard_interface() // KEYBOARD OPTIONS //************************************************************************** +void wy85_keyboards(device_slot_interface &slot) +{ + slot.option_add("wy85", WY85_KEYBOARD); +} + +void wy30_keyboards(device_slot_interface &slot) +{ + slot.option_add("wy30", WY30_KEYBOARD); +} + void wy60_keyboards(device_slot_interface &slot) { slot.option_add("ascii", WY60_ASCII_KEYBOARD); diff --git a/src/devices/bus/wysekbd/wysekbd.h b/src/devices/bus/wysekbd/wysekbd.h index 868271821011c..68e64fc95309e 100644 --- a/src/devices/bus/wysekbd/wysekbd.h +++ b/src/devices/bus/wysekbd/wysekbd.h @@ -69,6 +69,8 @@ class wyse_keyboard_interface : public device_interface DECLARE_DEVICE_TYPE(WYSE_KEYBOARD, wyse_keyboard_port_device) // standard options +extern void wy85_keyboards(device_slot_interface &slot); +extern void wy30_keyboards(device_slot_interface &slot); extern void wy60_keyboards(device_slot_interface &slot); //************************************************************************** diff --git a/src/devices/cpu/8x300/8x300.h b/src/devices/cpu/8x300/8x300.h index c4e36490b7f8d..d4bfd85a976bc 100644 --- a/src/devices/cpu/8x300/8x300.h +++ b/src/devices/cpu/8x300/8x300.h @@ -64,7 +64,6 @@ class n8x300_cpu_device : public cpu_device // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface implementation diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp index eb787a00a18cc..8f927831162bd 100644 --- a/src/devices/cpu/adsp2100/adsp2100.cpp +++ b/src/devices/cpu/adsp2100/adsp2100.cpp @@ -1161,27 +1161,6 @@ uint32_t adsp21xx_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t adsp2100_device::execute_input_lines() const noexcept -{ - return 4; -} - -uint32_t adsp2101_device::execute_input_lines() const noexcept -{ - return 5; -} - -uint32_t adsp2181_device::execute_input_lines() const noexcept -{ - return 9; -} - - void adsp21xx_device::execute_set_input(int inputnum, int state) { // update the latched state diff --git a/src/devices/cpu/adsp2100/adsp2100.h b/src/devices/cpu/adsp2100/adsp2100.h index ca45c8756c8bf..392ed7278b4ed 100644 --- a/src/devices/cpu/adsp2100/adsp2100.h +++ b/src/devices/cpu/adsp2100/adsp2100.h @@ -476,9 +476,6 @@ class adsp2100_device : public adsp21xx_device adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - // device_execute_interface overrides - virtual uint32_t execute_input_lines() const noexcept override; - // device_memory_interface overrides virtual space_config_vector memory_space_config() const override; @@ -499,9 +496,6 @@ class adsp2101_device : public adsp21xx_device protected: adsp2101_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype); - // device_execute_interface overrides - virtual uint32_t execute_input_lines() const noexcept override; - // device_memory_interface overrides virtual space_config_vector memory_space_config() const override; @@ -520,9 +514,6 @@ class adsp2181_device : public adsp21xx_device adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - // device_execute_interface overrides - virtual uint32_t execute_input_lines() const noexcept override; - // device_memory_interface overrides virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/alpha/alpha.h b/src/devices/cpu/alpha/alpha.h index c37960c31277b..2d9d4d9f910c7 100644 --- a/src/devices/cpu/alpha/alpha.h +++ b/src/devices/cpu/alpha/alpha.h @@ -83,9 +83,6 @@ class alpha_ev4_device : public alpha_device virtual void device_start() override; virtual void device_reset() override; - // device_execute_interface overrides - virtual u32 execute_input_lines() const noexcept override { return 6; } - virtual void cpu_execute(u32 const op) override; virtual bool cpu_translate(u64 &address, int intention) override; diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h index c269737d2e620..c56629ca16767 100644 --- a/src/devices/cpu/alto2/alto2cpu.h +++ b/src/devices/cpu/alto2/alto2cpu.h @@ -217,7 +217,6 @@ class alto2_cpu_device : public cpu_device //! device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/am29000/am29000.h b/src/devices/cpu/am29000/am29000.h index c19eeb8b9f29d..9eea0b09a41fe 100644 --- a/src/devices/cpu/am29000/am29000.h +++ b/src/devices/cpu/am29000/am29000.h @@ -446,7 +446,6 @@ class am29000_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 2; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/amis2000/amis2000.cpp b/src/devices/cpu/amis2000/amis2000.cpp index f8daa91eca6d3..5911cb2543bd4 100644 --- a/src/devices/cpu/amis2000/amis2000.cpp +++ b/src/devices/cpu/amis2000/amis2000.cpp @@ -337,6 +337,6 @@ void amis2000_base_device::execute_run() } break; // 0xff - } // big switch + } // 0xf0 } } diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h index e6f5a0f32365c..6b4bcf0ebd761 100644 --- a/src/devices/cpu/amis2000/amis2000.h +++ b/src/devices/cpu/amis2000/amis2000.h @@ -50,7 +50,6 @@ class amis2000_base_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/apexc/apexc.h b/src/devices/cpu/apexc/apexc.h index 84b44add940b9..b795292cf45a8 100644 --- a/src/devices/cpu/apexc/apexc.h +++ b/src/devices/cpu/apexc/apexc.h @@ -34,7 +34,6 @@ class apexc_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 75; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/arc/arc.h b/src/devices/cpu/arc/arc.h index fd4fa0582e146..f5a49fdf76cc1 100644 --- a/src/devices/cpu/arc/arc.h +++ b/src/devices/cpu/arc/arc.h @@ -31,7 +31,6 @@ class arc_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/arcompact/arcompact.h b/src/devices/cpu/arcompact/arcompact.h index 3069684449f23..11be86da76a17 100644 --- a/src/devices/cpu/arcompact/arcompact.h +++ b/src/devices/cpu/arcompact/arcompact.h @@ -28,7 +28,6 @@ class arcompact_device : public cpu_device, protected arcompact_common // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/arm/arm.h b/src/devices/cpu/arm/arm.h index aeafa3c0d7b95..9a99b16cf54ca 100644 --- a/src/devices/cpu/arm/arm.h +++ b/src/devices/cpu/arm/arm.h @@ -50,7 +50,6 @@ class arm_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 3; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/arm7/ap2010cpu.cpp b/src/devices/cpu/arm7/ap2010cpu.cpp index 19101e80f6b3f..0a2b1f9726498 100644 --- a/src/devices/cpu/arm7/ap2010cpu.cpp +++ b/src/devices/cpu/arm7/ap2010cpu.cpp @@ -7,9 +7,11 @@ ***************************************************************************/ #include "emu.h" - #include "ap2010cpu.h" +#include "arm7core.h" + + DEFINE_DEVICE_TYPE(AP2010CPU, ap2010cpu_device, "ap2010cpu", "AP2010 CPU") ap2010cpu_device::ap2010cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) diff --git a/src/devices/cpu/arm7/ap2010cpu.h b/src/devices/cpu/arm7/ap2010cpu.h index 82b908fbf02f6..3cf0a3c53dd12 100644 --- a/src/devices/cpu/arm7/ap2010cpu.h +++ b/src/devices/cpu/arm7/ap2010cpu.h @@ -12,7 +12,6 @@ #pragma once #include "arm7.h" -#include "arm7core.h" class ap2010cpu_device : public arm7_cpu_device { diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp index 7f479a668d4a2..847c3eb3e609a 100644 --- a/src/devices/cpu/arm7/arm7.cpp +++ b/src/devices/cpu/arm7/arm7.cpp @@ -31,12 +31,16 @@ *****************************************************************************/ #include "emu.h" -#include "debug/debugcon.h" -#include "debugger.h" #include "arm7.h" + #include "arm7core.h" //include arm7 core #include "arm7help.h" +#include "debug/debugcon.h" +#include "debugger.h" + +#include + #define LOG_MMU (1U << 1) #define LOG_DSP (1U << 2) #define LOG_COPRO_READS (1U << 3) @@ -83,9 +87,17 @@ arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, const char *tag, { } -arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint32_t archFlags, endianness_t endianness) +arm7_cpu_device::arm7_cpu_device( + const machine_config &mconfig, + device_type type, + const char *tag, device_t *owner, + uint32_t clock, + uint8_t archRev, + uint32_t archFlags, + endianness_t endianness, + address_map_constructor internal_map) : cpu_device(mconfig, type, tag, owner, clock) - , m_program_config("program", endianness, 32, 32, 0) + , m_program_config("program", endianness, 32, 32, 0, internal_map) , m_prefetch_word0_shift(endianness == ENDIANNESS_LITTLE ? 0 : 16) , m_prefetch_word1_shift(endianness == ENDIANNESS_LITTLE ? 16 : 0) , m_endian(endianness) @@ -113,6 +125,10 @@ arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, device_type type m_actual_log = 0; } +arm7_cpu_device::~arm7_cpu_device() +{ +} + arm7_be_cpu_device::arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM7_BE, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_BIG) @@ -1154,10 +1170,6 @@ void arm1176jzf_s_cpu_device::device_reset() m_control = 0x00050078; } -#define UNEXECUTED() \ - m_r[eR15] += 4; \ - m_icount +=2; /* Any unexecuted instruction only takes 1 cycle (page 193) */ - void arm7_cpu_device::update_insn_prefetch(uint32_t curr_pc) { curr_pc &= ~3; @@ -1237,6 +1249,8 @@ void arm7_cpu_device::add_ce_kernel_addr(offs_t addr, std::string value) void arm7_cpu_device::execute_run() { + auto const UNEXECUTED = [this] { m_r[eR15] += 4; m_icount += 2; }; // Any unexecuted instruction only takes 1 cycle (page 193) + m_tlb_log = m_actual_log; uint32_t insn; @@ -1573,24 +1587,25 @@ void arm7_cpu_device::execute_run() void arm7_cpu_device::execute_set_input(int irqline, int state) { - switch (irqline) { - case ARM7_IRQ_LINE: /* IRQ */ - m_pendingIrq = state ? true : false; + switch (irqline) + { + case ARM7_IRQ_LINE: // IRQ + m_pendingIrq = state != 0; break; - case ARM7_FIRQ_LINE: /* FIRQ */ - m_pendingFiq = state ? true : false; + case ARM7_FIRQ_LINE: // FIQ + m_pendingFiq = state != 0; break; case ARM7_ABORT_EXCEPTION: - m_pendingAbtD = state ? true : false; + m_pendingAbtD = state != 0; break; case ARM7_ABORT_PREFETCH_EXCEPTION: - m_pendingAbtP = state ? true : false; + m_pendingAbtP = state != 0; break; case ARM7_UNDEFINE_EXCEPTION: - m_pendingUnd = state ? true : false; + m_pendingUnd = state != 0; break; } @@ -1599,6 +1614,24 @@ void arm7_cpu_device::execute_set_input(int irqline, int state) } +void arm7_cpu_device::set_irq(int state) +{ + assert((machine().scheduler().currently_executing() == static_cast(this)) || !machine().scheduler().currently_executing()); + m_pendingIrq = state != 0; + update_irq_state(); + arm7_check_irq_state(); +} + + +void arm7_cpu_device::set_fiq(int state) +{ + assert((machine().scheduler().currently_executing() == static_cast(this)) || !machine().scheduler().currently_executing()); + m_pendingFiq = state != 0; + update_irq_state(); + arm7_check_irq_state(); +} + + std::unique_ptr arm7_cpu_device::create_disassembler() { return std::make_unique(this); diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h index 8b5b1bf94e5fd..44591e9dad1a9 100644 --- a/src/devices/cpu/arm7/arm7.h +++ b/src/devices/cpu/arm7/arm7.h @@ -50,102 +50,69 @@ class arm7_cpu_device : public cpu_device, public arm7_disassembler::config { public: - // construction/destruction - arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - void set_high_vectors() { m_vectorbase = 0xffff0000; } - -protected: enum { - ARCHFLAG_T = 1, // Thumb present - ARCHFLAG_E = 2, // extended DSP operations present (only for v5+) - ARCHFLAG_J = 4, // "Jazelle" (direct execution of Java bytecode) - ARCHFLAG_MMU = 8, // has on-board MMU (traditional ARM style like the SA1110) - ARCHFLAG_SA = 16, // StrongARM extensions (enhanced TLB) - ARCHFLAG_XSCALE = 32, // XScale extensions (CP14, enhanced TLB) - ARCHFLAG_MODE26 = 64, // supports 26-bit backwards compatibility mode - ARCHFLAG_K = 128, // enhanced MMU extensions present (only for v6) - ARCHFLAG_T2 = 256, //Thumb-2 present + ARM7_IRQ_LINE=0, ARM7_FIRQ_LINE, + ARM7_ABORT_EXCEPTION, ARM7_ABORT_PREFETCH_EXCEPTION, ARM7_UNDEFINE_EXCEPTION, + ARM7_NUM_LINES }; + // Really there's only 1 ABORT Line.. and cpu decides whether it's during data fetch or prefetch, but we let the user specify enum { - ARM9_COPRO_ID_STEP_SA1110_A0 = 0, - ARM9_COPRO_ID_STEP_SA1110_B0 = 4, - ARM9_COPRO_ID_STEP_SA1110_B1 = 5, - ARM9_COPRO_ID_STEP_SA1110_B2 = 8, - ARM9_COPRO_ID_STEP_SA1110_B4 = 8, - - ARM9_COPRO_ID_STEP_PXA255_A0 = 6, - - ARM9_COPRO_ID_STEP_ARM946_A0 = 1, - - ARM9_COPRO_ID_STEP_ARM1176JZF_S_R0P0 = 0, - ARM9_COPRO_ID_STEP_ARM1176JZF_S_R0P7 = 7, - - ARM9_COPRO_ID_PART_ARM1176JZF_S = 0xB76 << 4, - ARM9_COPRO_ID_PART_SA1110 = 0xB11 << 4, - ARM9_COPRO_ID_PART_ARM946 = 0x946 << 4, - ARM9_COPRO_ID_PART_ARM920 = 0x920 << 4, - ARM9_COPRO_ID_PART_ARM710 = 0x710 << 4, - ARM9_COPRO_ID_PART_PXA250 = 0x200 << 4, - ARM9_COPRO_ID_PART_PXA255 = 0x2d0 << 4, - ARM9_COPRO_ID_PART_PXA270 = 0x411 << 4, - ARM9_COPRO_ID_PART_GENERICARM7 = 0x700 << 4, - - ARM9_COPRO_ID_PXA255_CORE_REV_SHIFT = 10, - - ARM9_COPRO_ID_ARCH_V4 = 0x01 << 16, - ARM9_COPRO_ID_ARCH_V4T = 0x02 << 16, - ARM9_COPRO_ID_ARCH_V5 = 0x03 << 16, - ARM9_COPRO_ID_ARCH_V5T = 0x04 << 16, - ARM9_COPRO_ID_ARCH_V5TE = 0x05 << 16, - ARM9_COPRO_ID_ARCH_V5TEJ = 0x06 << 16, - ARM9_COPRO_ID_ARCH_V6 = 0x07 << 16, - ARM9_COPRO_ID_ARCH_CPUID = 0x0F << 16, - - ARM9_COPRO_ID_SPEC_REV0 = 0x00 << 20, - ARM9_COPRO_ID_SPEC_REV1 = 0x01 << 20, - - ARM9_COPRO_ID_MFR_ARM = 0x41 << 24, - ARM9_COPRO_ID_MFR_DEC = 0x44 << 24, - ARM9_COPRO_ID_MFR_INTEL = 0x69 << 24 + ARM7_PC = 0, + ARM7_R0, ARM7_R1, ARM7_R2, ARM7_R3, ARM7_R4, ARM7_R5, ARM7_R6, ARM7_R7, + ARM7_R8, ARM7_R9, ARM7_R10, ARM7_R11, ARM7_R12, ARM7_R13, ARM7_R14, ARM7_R15, + ARM7_FR8, ARM7_FR9, ARM7_FR10, ARM7_FR11, ARM7_FR12, ARM7_FR13, ARM7_FR14, + ARM7_IR13, ARM7_IR14, ARM7_SR13, ARM7_SR14, ARM7_FSPSR, ARM7_ISPSR, ARM7_SSPSR, + ARM7_CPSR, ARM7_AR13, ARM7_AR14, ARM7_ASPSR, ARM7_UR13, ARM7_UR14, ARM7_USPSR, ARM7_LOGTLB }; - arm7_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint32_t archFlags, endianness_t endianness); + // construction/destruction + arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~arm7_cpu_device(); + + void set_high_vectors() { m_vectorbase = 0xffff0000; } + +protected: + enum arm_arch_flag : uint32_t; + enum arm_copro_id : uint32_t; + + arm7_cpu_device( + const machine_config &mconfig, + device_type type, + const char *tag, + device_t *owner, + uint32_t clock, + uint8_t archRev, + uint32_t archFlags, + endianness_t endianness, + address_map_constructor internal_map = address_map_constructor()); void postload(); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // device_execute_interface overrides + // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 3; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 4; } /* There are actually only 2 input lines: we use 3 variants of the ABORT line while there is only 1 real one */ virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; virtual bool memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_export(const device_state_entry &entry) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr create_disassembler() override; virtual bool get_t_flag() const override; - address_space_config m_program_config; - memory_access<32, 2, 0, ENDIANNESS_LITTLE>::cache m_cachele; - memory_access<32, 2, 0, ENDIANNESS_BIG>::cache m_cachebe; - - uint32_t m_r[/*NUM_REGS*/37]; - void translate_insn_command(const std::vector ¶ms); void translate_data_command(const std::vector ¶ms); void translate_command(const std::vector ¶ms, int intention); @@ -158,6 +125,16 @@ class arm7_cpu_device : public cpu_device, public arm7_disassembler::config void init_ce_kernel_addrs(); void print_ce_kernel_address(const offs_t addr); + // for SoCs with onboard interrupt controllers - only call from scheduler or CPU's own context + void set_irq(int state); + void set_fiq(int state); + + address_space_config m_program_config; + memory_access<32, 2, 0, ENDIANNESS_LITTLE>::cache m_cachele; + memory_access<32, 2, 0, ENDIANNESS_BIG>::cache m_cachebe; + + uint32_t m_r[/*NUM_REGS*/37]; + std::string m_ce_kernel_addrs[0x10400]; bool m_ce_kernel_addr_present[0x10400]; diff --git a/src/devices/cpu/arm7/arm7core.h b/src/devices/cpu/arm7/arm7core.h index 937c42a550b23..55e36ebfb972d 100644 --- a/src/devices/cpu/arm7/arm7core.h +++ b/src/devices/cpu/arm7/arm7core.h @@ -18,10 +18,12 @@ ******************************************************************************/ +#ifndef MAME_CPU_ARM7_ARM7CORE_H +#define MAME_CPU_ARM7_ARM7CORE_H + #pragma once -#ifndef __ARM7CORE_H__ -#define __ARM7CORE_H__ +#include "arm7.h" #define ARM7_MMU_ENABLE_HACK 0 #define ARM7_DEBUG_CORE 0 @@ -30,26 +32,10 @@ /**************************************************************************************************** * INTERRUPT LINES/EXCEPTIONS ***************************************************************************************************/ -enum -{ - ARM7_IRQ_LINE=0, ARM7_FIRQ_LINE, - ARM7_ABORT_EXCEPTION, ARM7_ABORT_PREFETCH_EXCEPTION, ARM7_UNDEFINE_EXCEPTION, - ARM7_NUM_LINES -}; -// Really there's only 1 ABORT Line.. and cpu decides whether it's during data fetch or prefetch, but we let the user specify /**************************************************************************************************** * ARM7 CORE REGISTERS ***************************************************************************************************/ -enum -{ - ARM7_PC = 0, - ARM7_R0, ARM7_R1, ARM7_R2, ARM7_R3, ARM7_R4, ARM7_R5, ARM7_R6, ARM7_R7, - ARM7_R8, ARM7_R9, ARM7_R10, ARM7_R11, ARM7_R12, ARM7_R13, ARM7_R14, ARM7_R15, - ARM7_FR8, ARM7_FR9, ARM7_FR10, ARM7_FR11, ARM7_FR12, ARM7_FR13, ARM7_FR14, - ARM7_IR13, ARM7_IR14, ARM7_SR13, ARM7_SR14, ARM7_FSPSR, ARM7_ISPSR, ARM7_SSPSR, - ARM7_CPSR, ARM7_AR13, ARM7_AR14, ARM7_ASPSR, ARM7_UR13, ARM7_UR14, ARM7_USPSR, ARM7_LOGTLB -}; /* There are 36 Unique - 32 bit processor registers */ /* Each mode has 17 registers (except user & system, which have 16) */ @@ -516,19 +502,61 @@ enum #define ARM7_TLB_WRITE (1 << 3) /* ARM flavors */ -enum arm_flavor +enum arm7_cpu_device::arm_arch_flag : uint32_t +{ + ARCHFLAG_T = 1U << 0, // Thumb present + ARCHFLAG_E = 1U << 1, // extended DSP operations present (only for v5+) + ARCHFLAG_J = 1U << 2, // "Jazelle" (direct execution of Java bytecode) + ARCHFLAG_MMU = 1U << 3, // has on-board MMU (traditional ARM style like the SA1110) + ARCHFLAG_SA = 1U << 4, // StrongARM extensions (enhanced TLB) + ARCHFLAG_XSCALE = 1U << 5, // XScale extensions (CP14, enhanced TLB) + ARCHFLAG_MODE26 = 1U << 6, // supports 26-bit backwards compatibility mode + ARCHFLAG_K = 1U << 7, // enhanced MMU extensions present (only for v6) + ARCHFLAG_T2 = 1U << 8, // Thumb-2 present +}; + +enum arm7_cpu_device::arm_copro_id : uint32_t { - /* ARM7 variants */ - ARM_TYPE_ARM7, - ARM_TYPE_ARM7BE, - ARM_TYPE_ARM7500, - ARM_TYPE_PXA255, - ARM_TYPE_SA1110, - - /* ARM9 variants */ - ARM_TYPE_ARM9, - ARM_TYPE_ARM920T, - ARM_TYPE_ARM946ES + ARM9_COPRO_ID_STEP_SA1110_A0 = 0, + ARM9_COPRO_ID_STEP_SA1110_B0 = 4, + ARM9_COPRO_ID_STEP_SA1110_B1 = 5, + ARM9_COPRO_ID_STEP_SA1110_B2 = 8, + ARM9_COPRO_ID_STEP_SA1110_B4 = 8, + + ARM9_COPRO_ID_STEP_PXA255_A0 = 6, + + ARM9_COPRO_ID_STEP_ARM946_A0 = 1, + + ARM9_COPRO_ID_STEP_ARM1176JZF_S_R0P0 = 0, + ARM9_COPRO_ID_STEP_ARM1176JZF_S_R0P7 = 7, + + ARM9_COPRO_ID_PART_ARM1176JZF_S = 0xB76 << 4, + ARM9_COPRO_ID_PART_SA1110 = 0xB11 << 4, + ARM9_COPRO_ID_PART_ARM946 = 0x946 << 4, + ARM9_COPRO_ID_PART_ARM920 = 0x920 << 4, + ARM9_COPRO_ID_PART_ARM710 = 0x710 << 4, + ARM9_COPRO_ID_PART_PXA250 = 0x200 << 4, + ARM9_COPRO_ID_PART_PXA255 = 0x2d0 << 4, + ARM9_COPRO_ID_PART_PXA270 = 0x411 << 4, + ARM9_COPRO_ID_PART_GENERICARM7 = 0x700 << 4, + + ARM9_COPRO_ID_PXA255_CORE_REV_SHIFT = 10, + + ARM9_COPRO_ID_ARCH_V4 = 0x01 << 16, + ARM9_COPRO_ID_ARCH_V4T = 0x02 << 16, + ARM9_COPRO_ID_ARCH_V5 = 0x03 << 16, + ARM9_COPRO_ID_ARCH_V5T = 0x04 << 16, + ARM9_COPRO_ID_ARCH_V5TE = 0x05 << 16, + ARM9_COPRO_ID_ARCH_V5TEJ = 0x06 << 16, + ARM9_COPRO_ID_ARCH_V6 = 0x07 << 16, + ARM9_COPRO_ID_ARCH_CPUID = 0x0F << 16, + + ARM9_COPRO_ID_SPEC_REV0 = 0x00 << 20, + ARM9_COPRO_ID_SPEC_REV1 = 0x01 << 20, + + ARM9_COPRO_ID_MFR_ARM = 0x41 << 24, + ARM9_COPRO_ID_MFR_DEC = 0x44 << 24, + ARM9_COPRO_ID_MFR_INTEL = 0x69 << 24 }; -#endif /* __ARM7CORE_H__ */ +#endif // MAME_CPU_ARM7_ARM7CORE_H diff --git a/src/devices/cpu/arm7/arm7core.hxx b/src/devices/cpu/arm7/arm7core.hxx index 8fba8e61b159f..72abb28191894 100644 --- a/src/devices/cpu/arm7/arm7core.hxx +++ b/src/devices/cpu/arm7/arm7core.hxx @@ -113,7 +113,7 @@ void arm7_cpu_device::arm7_check_irq_state() // Data Abort if (m_pendingAbtD) { - if (MODE26) fatalerror( "ARM7: pendingAbtD (todo)\n"); + if (MODE26) fatalerror("ARM7: pendingAbtD (todo)\n"); SwitchMode(eARM7_MODE_ABT); /* Set ABT mode so PC is saved to correct R14 bank */ SetRegister(14, pc - 8 + 8); /* save PC to R14 */ SetRegister(SPSR, cpsr); /* Save current CPSR */ @@ -129,7 +129,8 @@ void arm7_cpu_device::arm7_check_irq_state() // FIQ if (m_pendingFiq && (cpsr & F_MASK) == 0) { - if (MODE26) fatalerror( "pendingFiq (todo)\n"); + standard_irq_callback(ARM7_FIRQ_LINE, pc); + if (MODE26) fatalerror("pendingFiq (todo)\n"); SwitchMode(eARM7_MODE_FIQ); /* Set FIQ mode so PC is saved to correct R14 bank */ SetRegister(14, pc - 4 + 4); /* save PC to R14 */ SetRegister(SPSR, cpsr); /* Save current CPSR */ @@ -144,6 +145,7 @@ void arm7_cpu_device::arm7_check_irq_state() // IRQ if (m_pendingIrq && (cpsr & I_MASK) == 0) { + standard_irq_callback(ARM7_IRQ_LINE, pc); SwitchMode(eARM7_MODE_IRQ); /* Set IRQ mode so PC is saved to correct R14 bank */ SetRegister(14, pc - 4 + 4); /* save PC to R14 */ if (MODE32) @@ -168,7 +170,7 @@ void arm7_cpu_device::arm7_check_irq_state() // Prefetch Abort if (m_pendingAbtP) { - if (MODE26) fatalerror( "pendingAbtP (todo)\n"); + if (MODE26) fatalerror("pendingAbtP (todo)\n"); SwitchMode(eARM7_MODE_ABT); /* Set ABT mode so PC is saved to correct R14 bank */ SetRegister(14, pc - 4 + 4); /* save PC to R14 */ SetRegister(SPSR, cpsr); /* Save current CPSR */ @@ -184,7 +186,7 @@ void arm7_cpu_device::arm7_check_irq_state() // Undefined instruction if (m_pendingUnd) { - if (MODE26) printf( "ARM7: pendingUnd (todo)\n"); + if (MODE26) printf("ARM7: pendingUnd (todo)\n"); SwitchMode(eARM7_MODE_UND); /* Set UND mode so PC is saved to correct R14 bank */ // compensate for prefetch (should this also be done for normal IRQ?) if (T_IS_SET(GET_CPSR)) diff --git a/src/devices/cpu/arm7/lpc210x.cpp b/src/devices/cpu/arm7/lpc210x.cpp index 75a322f01a207..9e9c51c620af2 100644 --- a/src/devices/cpu/arm7/lpc210x.cpp +++ b/src/devices/cpu/arm7/lpc210x.cpp @@ -15,6 +15,9 @@ #include "emu.h" #include "lpc210x.h" +#include "arm7core.h" + + DEFINE_DEVICE_TYPE(LPC2103, lpc210x_device, "lpc2103", "NXP LPC2103") void lpc210x_device::lpc2103_map(address_map &map) diff --git a/src/devices/cpu/arm7/lpc210x.h b/src/devices/cpu/arm7/lpc210x.h index 47a801a6058e4..e481d126f675c 100644 --- a/src/devices/cpu/arm7/lpc210x.h +++ b/src/devices/cpu/arm7/lpc210x.h @@ -7,9 +7,10 @@ #pragma once #include "arm7.h" -#include "arm7core.h" + #include "machine/vic_pl192.h" + /*************************************************************************** DEVICE CONFIGURATION MACROS ***************************************************************************/ diff --git a/src/devices/cpu/arm7/upd800468.cpp b/src/devices/cpu/arm7/upd800468.cpp index fef0fdc9fce48..87dea88ad5c0e 100644 --- a/src/devices/cpu/arm7/upd800468.cpp +++ b/src/devices/cpu/arm7/upd800468.cpp @@ -12,6 +12,9 @@ #include "emu.h" #include "upd800468.h" +#include "arm7core.h" + + DEFINE_DEVICE_TYPE(UPD800468_TIMER, upd800468_timer_device, "upd800468_timer", "NEC uPD800468 timer") upd800468_timer_device::upd800468_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) diff --git a/src/devices/cpu/arm7/upd800468.h b/src/devices/cpu/arm7/upd800468.h index 7f662581c7f01..1470f4ea1af45 100644 --- a/src/devices/cpu/arm7/upd800468.h +++ b/src/devices/cpu/arm7/upd800468.h @@ -7,10 +7,11 @@ #pragma once #include "arm7.h" -#include "arm7core.h" + #include "machine/gt913_kbd.h" #include "machine/vic_pl192.h" + /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ diff --git a/src/devices/cpu/asap/asap.cpp b/src/devices/cpu/asap/asap.cpp index 53f66aa1900ca..5ef08e161ad82 100644 --- a/src/devices/cpu/asap/asap.cpp +++ b/src/devices/cpu/asap/asap.cpp @@ -516,17 +516,6 @@ uint32_t asap_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t asap_device::execute_input_lines() const noexcept -{ - return 1; -} - - void asap_device::execute_set_input(int inputnum, int state) { m_irq_state = (state != CLEAR_LINE); diff --git a/src/devices/cpu/asap/asap.h b/src/devices/cpu/asap/asap.h index 3adb9ef37f4a5..62bbd15c1f188 100644 --- a/src/devices/cpu/asap/asap.h +++ b/src/devices/cpu/asap/asap.h @@ -76,7 +76,6 @@ class asap_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/avr8/avr8.h b/src/devices/cpu/avr8/avr8.h index 0254775273d37..1e93442b00c59 100644 --- a/src/devices/cpu/avr8/avr8.h +++ b/src/devices/cpu/avr8/avr8.h @@ -605,7 +605,6 @@ class avr8_base_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } // device_memory_interface overrides virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/axc51/axc51.h b/src/devices/cpu/axc51/axc51.h index 291c423141484..1f9a2f1f25b6f 100644 --- a/src/devices/cpu/axc51/axc51.h +++ b/src/devices/cpu/axc51/axc51.h @@ -46,7 +46,6 @@ class axc51base_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 20; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/bcp/dp8344.h b/src/devices/cpu/bcp/dp8344.h index aede18c32a09b..263462f975aee 100644 --- a/src/devices/cpu/bcp/dp8344.h +++ b/src/devices/cpu/bcp/dp8344.h @@ -71,7 +71,6 @@ class dp8344_device : public cpu_device // device_execute_interface implementation virtual u32 execute_min_cycles() const noexcept override { return 2; } virtual u32 execute_max_cycles() const noexcept override { return 4; } - virtual u32 execute_input_lines() const noexcept override { return 3; } virtual void execute_run() override; virtual void execute_set_input(int irqline, int state) override; diff --git a/src/devices/cpu/capricorn/capricorn.h b/src/devices/cpu/capricorn/capricorn.h index 40bbb2cc3ab74..3051c8b9bd7b2 100644 --- a/src/devices/cpu/capricorn/capricorn.h +++ b/src/devices/cpu/capricorn/capricorn.h @@ -37,12 +37,8 @@ class capricorn_cpu_device : public cpu_device virtual void device_reset() override; // device_execute_interface overrides - virtual u32 execute_min_cycles() const noexcept override - { return 2; } - virtual u32 execute_max_cycles() const noexcept override - { return 17; } - virtual u32 execute_input_lines() const noexcept override - { return 1; } + virtual u32 execute_min_cycles() const noexcept override { return 2; } + virtual u32 execute_max_cycles() const noexcept override { return 17; } virtual void execute_run() override; virtual void execute_set_input(int linenum, int state) override; diff --git a/src/devices/cpu/ccpu/ccpu.h b/src/devices/cpu/ccpu/ccpu.h index c4377f251e371..9a952276f6c41 100644 --- a/src/devices/cpu/ccpu/ccpu.h +++ b/src/devices/cpu/ccpu/ccpu.h @@ -60,7 +60,6 @@ class ccpu_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/clipper/clipper.h b/src/devices/cpu/clipper/clipper.h index 44741234df156..6a03ccac86a58 100644 --- a/src/devices/cpu/clipper/clipper.h +++ b/src/devices/cpu/clipper/clipper.h @@ -157,7 +157,6 @@ class clipper_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } // FIXME: don't know, especially macro instructions - virtual u32 execute_input_lines() const noexcept override { return 2; } // number of input/interrupt lines (irq/nmi) virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h index 4c51e36595be1..0155a832e0548 100644 --- a/src/devices/cpu/cop400/cop400.h +++ b/src/devices/cpu/cop400/cop400.h @@ -140,7 +140,6 @@ class cop400_cpu_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * m_cki); } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 2; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/cosmac/cosmac.cpp b/src/devices/cpu/cosmac/cosmac.cpp index 6b9c866c92eaa..7775e6f33db9a 100644 --- a/src/devices/cpu/cosmac/cosmac.cpp +++ b/src/devices/cpu/cosmac/cosmac.cpp @@ -739,17 +739,6 @@ uint32_t cosmac_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t cosmac_device::execute_input_lines() const noexcept -{ - return 7; -} - - //------------------------------------------------- // execute_set_input - //------------------------------------------------- diff --git a/src/devices/cpu/cosmac/cosmac.h b/src/devices/cpu/cosmac/cosmac.h index d89d262215607..7071b51e3eef7 100644 --- a/src/devices/cpu/cosmac/cosmac.h +++ b/src/devices/cpu/cosmac/cosmac.h @@ -192,7 +192,6 @@ class cosmac_device : public cpu_device, public cosmac_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/cp1610/cp1610.h b/src/devices/cpu/cp1610/cp1610.h index af2ed5a7fe290..1def7c2eeaf87 100644 --- a/src/devices/cpu/cp1610/cp1610.h +++ b/src/devices/cpu/cp1610/cp1610.h @@ -42,7 +42,6 @@ class cp1610_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == CP1610_INT_INTR; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.h b/src/devices/cpu/cubeqcpu/cubeqcpu.h index 543f90a8a82bd..52b8132739d51 100644 --- a/src/devices/cpu/cubeqcpu/cubeqcpu.h +++ b/src/devices/cpu/cubeqcpu/cubeqcpu.h @@ -63,7 +63,6 @@ class cquestsnd_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual u32 execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -162,7 +161,6 @@ class cquestrot_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual u32 execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -274,7 +272,6 @@ class cquestlin_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual u32 execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/diablo/diablo1300.h b/src/devices/cpu/diablo/diablo1300.h index f706938f2a01c..68e0fc5bf312b 100644 --- a/src/devices/cpu/diablo/diablo1300.h +++ b/src/devices/cpu/diablo/diablo1300.h @@ -31,7 +31,6 @@ class diablo1300_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - //virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; //virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/dsp16/dsp16.h b/src/devices/cpu/dsp16/dsp16.h index f23477ed10bd1..5c4304851f1af 100644 --- a/src/devices/cpu/dsp16/dsp16.h +++ b/src/devices/cpu/dsp16/dsp16.h @@ -82,7 +82,6 @@ class dsp16_device_base : public cpu_device, protected dsp16_disassembler::cpu // device_execute_interface implementation virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 2 - 1) >> 1; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return cycles << 1; } - virtual u32 execute_input_lines() const noexcept override { return 5U; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/dsp32/dsp32.cpp b/src/devices/cpu/dsp32/dsp32.cpp index 2341cdf4f0cdc..ac30ba9a34f3c 100644 --- a/src/devices/cpu/dsp32/dsp32.cpp +++ b/src/devices/cpu/dsp32/dsp32.cpp @@ -553,17 +553,6 @@ uint32_t dsp32c_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t dsp32c_device::execute_input_lines() const noexcept -{ - return 2; -} - - void dsp32c_device::execute_set_input(int inputnum, int state) { } diff --git a/src/devices/cpu/dsp32/dsp32.h b/src/devices/cpu/dsp32/dsp32.h index 90ede0181fa4d..79d2314c8f7a2 100644 --- a/src/devices/cpu/dsp32/dsp32.h +++ b/src/devices/cpu/dsp32/dsp32.h @@ -109,7 +109,6 @@ class dsp32c_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/dsp56000/dsp56000.h b/src/devices/cpu/dsp56000/dsp56000.h index 0a47b2fe0783a..d62f2fb1523dd 100644 --- a/src/devices/cpu/dsp56000/dsp56000.h +++ b/src/devices/cpu/dsp56000/dsp56000.h @@ -20,7 +20,6 @@ class dsp56000_device_base : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 2); } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 16; } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/dsp56156/dsp56156.h b/src/devices/cpu/dsp56156/dsp56156.h index 4317fa249f56b..67a8e5f4abbef 100644 --- a/src/devices/cpu/dsp56156/dsp56156.h +++ b/src/devices/cpu/dsp56156/dsp56156.h @@ -228,7 +228,6 @@ class dsp56156_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return cycles; } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 8; } - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == DSP56156_IRQ_RESET; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/e0c6200/e0c6200.h b/src/devices/cpu/e0c6200/e0c6200.h index 5222983e09ba8..6e7bf86aa066b 100644 --- a/src/devices/cpu/e0c6200/e0c6200.h +++ b/src/devices/cpu/e0c6200/e0c6200.h @@ -24,7 +24,6 @@ class e0c6200_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 5; } virtual u32 execute_max_cycles() const noexcept override { return 14; } // longest opcode is 12 cycles, but interrupt service takes up to 14 - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_one(); virtual bool check_interrupt() { return false; } // nothing to do by default diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h index 0fb7a67e44c24..cf48f14a562b8 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.h +++ b/src/devices/cpu/e0c6200/e0c6s46.h @@ -73,7 +73,6 @@ class e0c6s46_device : public e0c6200_cpu_device virtual void device_reset() override; // device_execute_interface overrides - virtual u32 execute_input_lines() const noexcept override { return 8; } virtual void execute_set_input(int line, int state) override; virtual void execute_one() override; virtual bool check_interrupt() override; diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp index 137a45404f238..4ee0f42937775 100644 --- a/src/devices/cpu/e132xs/e132xs.cpp +++ b/src/devices/cpu/e132xs/e132xs.cpp @@ -1591,17 +1591,6 @@ uint32_t hyperstone_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t hyperstone_device::execute_input_lines() const noexcept -{ - return 8; -} - - void hyperstone_device::execute_set_input(int inputnum, int state) { if (state) diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h index 51f9c5cc3c12f..3c555d83c7fd5 100644 --- a/src/devices/cpu/e132xs/e132xs.h +++ b/src/devices/cpu/e132xs/e132xs.h @@ -286,7 +286,6 @@ class hyperstone_device : public cpu_device, public hyperstone_disassembler::con // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index 7ba2d91bc395f..7449f1bc30760 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -670,10 +670,6 @@ uint32_t es5510_device::execute_max_cycles() const noexcept { return 1; } -uint32_t es5510_device::execute_input_lines() const noexcept { - return 1; -} - void es5510_device::execute_set_input(int linenum, int state) { if (linenum == ES5510_HALT) { halt_asserted = (state == ASSERT_LINE); diff --git a/src/devices/cpu/es5510/es5510.h b/src/devices/cpu/es5510/es5510.h index 9f8d10035ca52..6061d2e86bcae 100644 --- a/src/devices/cpu/es5510/es5510.h +++ b/src/devices/cpu/es5510/es5510.h @@ -133,7 +133,6 @@ class es5510_device : public cpu_device { virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override; virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int linenum, int state) override; virtual std::unique_ptr create_disassembler() override; diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp index ac99aec9290c2..b78928cb3c4d1 100644 --- a/src/devices/cpu/esrip/esrip.cpp +++ b/src/devices/cpu/esrip/esrip.cpp @@ -1738,17 +1738,6 @@ uint32_t esrip_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t esrip_device::execute_input_lines() const noexcept -{ - return 0; -} - - //------------------------------------------------- // execute_set_input - act on a changed input/ // interrupt line diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h index f58b2d41a977d..04a11b6756074 100644 --- a/src/devices/cpu/esrip/esrip.h +++ b/src/devices/cpu/esrip/esrip.h @@ -112,7 +112,6 @@ class esrip_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/evolution/evo.h b/src/devices/cpu/evolution/evo.h index 992e302e83553..8bbdaf60d3264 100644 --- a/src/devices/cpu/evolution/evo.h +++ b/src/devices/cpu/evolution/evo.h @@ -18,7 +18,6 @@ class evo_cpu_device : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/f8/f8.h b/src/devices/cpu/f8/f8.h index da621d3a306cb..e6f552f1717b7 100644 --- a/src/devices/cpu/f8/f8.h +++ b/src/devices/cpu/f8/f8.h @@ -39,7 +39,6 @@ class f8_cpu_device : public cpu_device // device_execute_interface implementation virtual u32 execute_min_cycles() const noexcept override { return 4; } virtual u32 execute_max_cycles() const noexcept override { return 26; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/g65816/g65816.h b/src/devices/cpu/g65816/g65816.h index 6dfe2b529754e..39b8d1e304ba4 100644 --- a/src/devices/cpu/g65816/g65816.h +++ b/src/devices/cpu/g65816/g65816.h @@ -76,7 +76,6 @@ class g65816_device : public cpu_device, public g65816_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 20; } - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/gigatron/gigatron.h b/src/devices/cpu/gigatron/gigatron.h index b224b4ab280c2..ddf87eb195a58 100644 --- a/src/devices/cpu/gigatron/gigatron.h +++ b/src/devices/cpu/gigatron/gigatron.h @@ -41,7 +41,6 @@ class gigatron_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/h6280/h6280.cpp b/src/devices/cpu/h6280/h6280.cpp index 7bb01c3f6d5df..f725e6065a53c 100644 --- a/src/devices/cpu/h6280/h6280.cpp +++ b/src/devices/cpu/h6280/h6280.cpp @@ -2269,17 +2269,6 @@ uint32_t h6280_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t h6280_device::execute_input_lines() const noexcept -{ - return 4; -} - - //------------------------------------------------- // execute_input_edge_triggered - return true if // the input line has an asynchronous edge trigger diff --git a/src/devices/cpu/h6280/h6280.h b/src/devices/cpu/h6280/h6280.h index fb46ec5e4c6ad..37b863dcf1f90 100644 --- a/src/devices/cpu/h6280/h6280.h +++ b/src/devices/cpu/h6280/h6280.h @@ -83,7 +83,6 @@ class h6280_device : public cpu_device, public device_mixer_interface // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/h8/h8.h b/src/devices/cpu/h8/h8.h index 37f2661f98464..a359855026ad1 100644 --- a/src/devices/cpu/h8/h8.h +++ b/src/devices/cpu/h8/h8.h @@ -24,6 +24,28 @@ class h8_device; class h8_device : public cpu_device, public device_nvram_interface { public: + enum { + H8_PC = 1, + H8_R0, + H8_R1, + H8_R2, + H8_R3, + H8_R4, + H8_R5, + H8_R6, + H8_R7, + H8_E0, + H8_E1, + H8_E2, + H8_E3, + H8_E4, + H8_E5, + H8_E6, + H8_E7, + H8_CCR, + H8_EXR + }; + enum { STATE_RESET = 0x10000, STATE_IRQ = 0x10001, @@ -121,7 +143,6 @@ class h8_device : public cpu_device, public device_nvram_interface { virtual bool cpu_is_interruptible() const override { return true; } virtual u32 execute_min_cycles() const noexcept override { return 2; } virtual u32 execute_max_cycles() const noexcept override { return 12; } - virtual u32 execute_input_lines() const noexcept override { return 0; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; @@ -438,26 +459,4 @@ class h8_device : public cpu_device, public device_nvram_interface { #undef O }; -enum { - H8_PC = 1, - H8_R0, - H8_R1, - H8_R2, - H8_R3, - H8_R4, - H8_R5, - H8_R6, - H8_R7, - H8_E0, - H8_E1, - H8_E2, - H8_E3, - H8_E4, - H8_E5, - H8_E6, - H8_E7, - H8_CCR, - H8_EXR -}; - #endif // MAME_CPU_H8_H8_H diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h index 89687d16aab36..44adef412a62b 100644 --- a/src/devices/cpu/hcd62121/hcd62121.h +++ b/src/devices/cpu/hcd62121/hcd62121.h @@ -42,7 +42,6 @@ class hcd62121_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 4; } virtual u32 execute_max_cycles() const noexcept override { return 48; } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/hd61700/hd61700.h b/src/devices/cpu/hd61700/hd61700.h index 6f7ef9462ff25..4ffb595f2f878 100644 --- a/src/devices/cpu/hd61700/hd61700.h +++ b/src/devices/cpu/hd61700/hd61700.h @@ -51,7 +51,6 @@ class hd61700_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 52; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp index 61b50e731236a..38e150b95756c 100644 --- a/src/devices/cpu/hmcs40/hmcs40.cpp +++ b/src/devices/cpu/hmcs40/hmcs40.cpp @@ -25,74 +25,47 @@ Hitachi HMCS40 MCU family cores #define IS_CMOS ~0 -// MCU types +//------------------------------------------------- +// device types +//------------------------------------------------- -// HMCS42/C/CL -//DEFINE_DEVICE_TYPE(HD38702, hd38702_device, "hd38702", "Hitachi HD38702") // PMOS, 28 pins, 22 I/O lines, (512+32)x10 ROM, 32x4 RAM, no B or SPY register -//DEFINE_DEVICE_TYPE(HD44700, hd44700_device, "hd44700", "Hitachi HD44700") // CMOS version -//DEFINE_DEVICE_TYPE(HD44708, hd44708_device, "hd44708", "Hitachi HD44708") // CMOS version, low-power +// HMCS42/C/CL, 28 pins, 22 I/O lines, (512+32)x10 ROM, 32x4 RAM, no B or SPY register +//DEFINE_DEVICE_TYPE(HD38702, hd38702_device, "hd38702", "Hitachi HD38702") // PMOS +//DEFINE_DEVICE_TYPE(HD44700, hd44700_device, "hd44700", "Hitachi HD44700") // CMOS +//DEFINE_DEVICE_TYPE(HD44708, hd44708_device, "hd44708", "Hitachi HD44708") // CMOS, low-power -// HMCS43/C/CL -DEFINE_DEVICE_TYPE(HD38750, hd38750_device, "hd38750", "Hitachi HD38750") // PMOS, 42 pins, 32 I/O lines, (1024+64)x10 ROM, 80x4 RAM +// HMCS43/C/CL, 42 pins, 32 I/O lines, (1024+64)x10 ROM, 80x4 RAM +DEFINE_DEVICE_TYPE(HD38750, hd38750_device, "hd38750", "Hitachi HD38750") // PMOS DEFINE_DEVICE_TYPE(HD38755, hd38755_device, "hd38755", "Hitachi HD38755") // ceramic filter oscillator type -DEFINE_DEVICE_TYPE(HD44750, hd44750_device, "hd44750", "Hitachi HD44750") // CMOS version -DEFINE_DEVICE_TYPE(HD44758, hd44758_device, "hd44758", "Hitachi HD44758") // CMOS version, low-power +DEFINE_DEVICE_TYPE(HD44750, hd44750_device, "hd44750", "Hitachi HD44750") // CMOS +DEFINE_DEVICE_TYPE(HD44758, hd44758_device, "hd44758", "Hitachi HD44758") // CMOS, low-power -// HMCS44A/C/CL -DEFINE_DEVICE_TYPE(HD38800, hd38800_device, "hd38800", "Hitachi HD38800") // PMOS, 42 pins, 32 I/O lines, (2048+128)x10 ROM, 160x4 RAM +// HMCS44A/C/CL, 42 pins, 32 I/O lines, (2048+128)x10 ROM, 160x4 RAM +DEFINE_DEVICE_TYPE(HD38800, hd38800_device, "hd38800", "Hitachi HD38800") // PMOS DEFINE_DEVICE_TYPE(HD38805, hd38805_device, "hd38805", "Hitachi HD38805") // ceramic filter oscillator type -DEFINE_DEVICE_TYPE(HD44801, hd44801_device, "hd44801", "Hitachi HD44801") // CMOS version -DEFINE_DEVICE_TYPE(HD44808, hd44808_device, "hd44808", "Hitachi HD44808") // CMOS version, low-power +DEFINE_DEVICE_TYPE(HD44801, hd44801_device, "hd44801", "Hitachi HD44801") // CMOS +DEFINE_DEVICE_TYPE(HD44808, hd44808_device, "hd44808", "Hitachi HD44808") // CMOS, low-power -// HMCS45A/C/CL -DEFINE_DEVICE_TYPE(HD38820, hd38820_device, "hd38820", "Hitachi HD38820") // PMOS, 54 pins(QFP) or 64 pins(DIP), 44 I/O lines, (2048+128)x10 ROM, 160x4 RAM +// HMCS45A/C/CL, 54 pins(QFP) or 64 pins(DIP), 44 I/O lines, (2048+128)x10 ROM, 160x4 RAM +DEFINE_DEVICE_TYPE(HD38820, hd38820_device, "hd38820", "Hitachi HD38820") // PMOS DEFINE_DEVICE_TYPE(HD38825, hd38825_device, "hd38825", "Hitachi HD38825") // ceramic filter oscillator type -DEFINE_DEVICE_TYPE(HD44820, hd44820_device, "hd44820", "Hitachi HD44820") // CMOS version -DEFINE_DEVICE_TYPE(HD44828, hd44828_device, "hd44828", "Hitachi HD44828") // CMOS version, low-power +DEFINE_DEVICE_TYPE(HD44820, hd44820_device, "hd44820", "Hitachi HD44820") // CMOS +DEFINE_DEVICE_TYPE(HD44828, hd44828_device, "hd44828", "Hitachi HD44828") // CMOS, low-power -// HMCS46C/CL (no PMOS version exists) -//DEFINE_DEVICE_TYPE(HD44840, hd44840_device, "hd44840", "Hitachi HD44840") // CMOS, 42 pins, 32 I/O lines, 4096x10 ROM, 256x4 RAM +// HMCS46C/CL, 42 pins, 32 I/O lines, 4096x10 ROM, 256x4 RAM (no PMOS version exists) +//DEFINE_DEVICE_TYPE(HD44840, hd44840_device, "hd44840", "Hitachi HD44840") // CMOS //DEFINE_DEVICE_TYPE(HD44848, hd44848_device, "hd44848", "Hitachi HD44848") // CMOS, low-power -// HMCS47A/C/CL -//DEFINE_DEVICE_TYPE(HD38870, hd38870_device, "hd38870", "Hitachi HD38870") // PMOS, 54 pins(QFP) or 64 pins(DIP), 44 I/O lines, 4096x10 ROM, 256x4 RAM -//DEFINE_DEVICE_TYPE(HD44860, hd44860_device, "hd44860", "Hitachi HD44860") // CMOS version -//DEFINE_DEVICE_TYPE(HD44868, hd44868_device, "hd44868", "Hitachi HD44868") // CMOS version, low-power - - -// internal memory maps - -// On HMCS42/3/4/5, only half of the ROM address range contains user-executable code, -// there is up to 128 bytes of pattern data in the 2nd half. The 2nd half also includes -// a couple of pages with factory test code by Hitachi, only executable when MCU test -// mode is enabled externally. This data can still be accessed with the P opcode. - -void hmcs40_cpu_device::program_1k(address_map &map) -{ - map(0x0000, 0x07ff).rom(); -} - -void hmcs40_cpu_device::program_2k(address_map &map) -{ - map(0x0000, 0x0fff).rom(); -} +// HMCS47A/C/CL, 54 pins(QFP) or 64 pins(DIP), 44 I/O lines, 4096x10 ROM, 256x4 RAM +//DEFINE_DEVICE_TYPE(HD38870, hd38870_device, "hd38870", "Hitachi HD38870") // PMOS +//DEFINE_DEVICE_TYPE(HD44860, hd44860_device, "hd44860", "Hitachi HD44860") // CMOS +//DEFINE_DEVICE_TYPE(HD44868, hd44868_device, "hd44868", "Hitachi HD44868") // CMOS, low-power -void hmcs40_cpu_device::data_80x4(address_map &map) -{ - map(0x00, 0x3f).ram(); - map(0x40, 0x4f).ram().mirror(0x30); -} - -void hmcs40_cpu_device::data_160x4(address_map &map) -{ - map(0x00, 0x7f).ram(); - map(0x80, 0x8f).ram().mirror(0x30); - map(0xc0, 0xcf).ram().mirror(0x30); -} - +//------------------------------------------------- +// constructor +//------------------------------------------------- -// device definitions hmcs40_cpu_device::hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int family, u16 polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : cpu_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program), @@ -109,8 +82,11 @@ hmcs40_cpu_device::hmcs40_cpu_device(const machine_config &mconfig, device_type m_write_d(*this) { } +hmcs40_cpu_device::~hmcs40_cpu_device() { } + + hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity) : - hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS40_FAMILY_HMCS43, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, address_map_constructor(FUNC(hmcs43_cpu_device::program_1k), this), 7 /* data width */, address_map_constructor(FUNC(hmcs43_cpu_device::data_80x4), this)) + hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS43_FAMILY, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, address_map_constructor(FUNC(hmcs43_cpu_device::program_1k), this), 7 /* data width */, address_map_constructor(FUNC(hmcs43_cpu_device::data_80x4), this)) { } hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : @@ -128,7 +104,7 @@ hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, d hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity) : - hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS40_FAMILY_HMCS44, polarity, 4, 11, 12, address_map_constructor(FUNC(hmcs44_cpu_device::program_2k), this), 8, address_map_constructor(FUNC(hmcs44_cpu_device::data_160x4), this)) + hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS44_FAMILY, polarity, 4, 11, 12, address_map_constructor(FUNC(hmcs44_cpu_device::program_2k), this), 8, address_map_constructor(FUNC(hmcs44_cpu_device::data_160x4), this)) { } hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : @@ -146,7 +122,7 @@ hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, d hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity) : - hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS40_FAMILY_HMCS45, polarity, 4, 11, 12, address_map_constructor(FUNC(hmcs45_cpu_device::program_2k), this), 8, address_map_constructor(FUNC(hmcs45_cpu_device::data_160x4), this)) + hmcs40_cpu_device(mconfig, type, tag, owner, clock, HMCS45_FAMILY, polarity, 4, 11, 12, address_map_constructor(FUNC(hmcs45_cpu_device::program_2k), this), 8, address_map_constructor(FUNC(hmcs45_cpu_device::data_160x4), this)) { } hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : @@ -162,38 +138,9 @@ hd44828_device::hd44828_device(const machine_config &mconfig, const char *tag, d hmcs45_cpu_device(mconfig, HD44828, tag, owner, clock, IS_CMOS) { } -device_memory_interface::space_config_vector hmcs40_cpu_device::memory_space_config() const -{ - return space_config_vector { - std::make_pair(AS_PROGRAM, &m_program_config), - std::make_pair(AS_DATA, &m_data_config) - }; -} - -// disasm -void hmcs40_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const -{ - switch (entry.index()) - { - case STATE_GENFLAGS: - str = string_format("%c%c", - m_c ? 'C':'c', - m_s ? 'S':'s' - ); - break; - - default: break; - } -} - -std::unique_ptr hmcs40_cpu_device::create_disassembler() -{ - return std::make_unique(); -} - //------------------------------------------------- -// device_start - device-specific startup +// initialization //------------------------------------------------- void hmcs40_cpu_device::device_start() @@ -212,6 +159,8 @@ void hmcs40_cpu_device::device_start() m_eint_line = 0; m_halt = 0; m_prescaler = 0; + m_block_int = false; + m_pc = 0; m_prev_pc = 0; m_page = 0; @@ -223,6 +172,7 @@ void hmcs40_cpu_device::device_start() m_spy = 0; m_s = 1; m_c = 0; + m_tc = 0; m_cf = 0; m_ie = 0; @@ -230,7 +180,6 @@ void hmcs40_cpu_device::device_start() memset(m_if, 0, sizeof(m_if)); m_tf = 0; memset(m_int, 0, sizeof(m_int)); - m_block_int = false; memset(m_r, 0, sizeof(m_r)); m_d = 0; @@ -241,6 +190,9 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_i)); save_item(NAME(m_eint_line)); save_item(NAME(m_halt)); + save_item(NAME(m_prescaler)); + save_item(NAME(m_block_int)); + save_item(NAME(m_pc)); save_item(NAME(m_prev_pc)); save_item(NAME(m_page)); @@ -252,8 +204,8 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_spy)); save_item(NAME(m_s)); save_item(NAME(m_c)); + save_item(NAME(m_tc)); - save_item(NAME(m_prescaler)); save_item(NAME(m_cf)); save_item(NAME(m_ie)); save_item(NAME(m_iri)); @@ -261,7 +213,6 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_if)); save_item(NAME(m_tf)); save_item(NAME(m_int)); - save_item(NAME(m_block_int)); save_item(NAME(m_r)); save_item(NAME(m_d)); @@ -279,15 +230,12 @@ void hmcs40_cpu_device::device_start() state_add(++m_state_count, "Y", m_y).formatstr("%01X"); // 6 state_add(++m_state_count, "SPY", m_spy).formatstr("%01X"); // 7 + state_add(++m_state_count, "S", m_s).formatstr("%01X").noshow(); // 8 + state_add(++m_state_count, "C", m_c).formatstr("%01X").noshow(); // 9 + set_icountptr(m_icount); } - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - void hmcs40_cpu_device::device_reset() { m_pc = m_pcmask; @@ -299,25 +247,95 @@ void hmcs40_cpu_device::device_reset() m_iri = m_irt = 0; m_if[0] = m_if[1] = m_tf = 1; - // clear i/o - m_d = m_polarity; - for (int i = 0; i < 16; i++) - hmcs40_cpu_device::write_d(i, m_polarity); + // all I/O ports set to input + reset_io(); +} - for (int i = 0; i < 8; i++) - hmcs40_cpu_device::write_r(i, m_polarity & 0xf); + +//------------------------------------------------- +// disasm +//------------------------------------------------- + +void hmcs40_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("%c%c", + m_c ? 'C':'c', + m_s ? 'S':'s' + ); + break; + + default: break; + } +} + +std::unique_ptr hmcs40_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +//------------------------------------------------- +// internal memory maps +//------------------------------------------------- + +// On HMCS42/3/4/5, only half of the ROM address range contains user-executable code, +// there is up to 128 bytes of pattern data in the 2nd half. The 2nd half also includes +// a couple of pages with factory test code by Hitachi, only executable when MCU test +// mode is enabled externally. This data can still be accessed with the P opcode. + +void hmcs40_cpu_device::program_1k(address_map &map) +{ + map(0x0000, 0x07ff).rom(); +} + +void hmcs40_cpu_device::program_2k(address_map &map) +{ + map(0x0000, 0x0fff).rom(); } +void hmcs40_cpu_device::data_80x4(address_map &map) +{ + map(0x00, 0x3f).ram(); + map(0x40, 0x4f).ram().mirror(0x30); +} + +void hmcs40_cpu_device::data_160x4(address_map &map) +{ + map(0x00, 0x7f).ram(); + map(0x80, 0x8f).ram().mirror(0x30); + map(0xc0, 0xcf).ram().mirror(0x30); +} + +device_memory_interface::space_config_vector hmcs40_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} + //------------------------------------------------- -// i/o handling +// i/o ports //------------------------------------------------- -u8 hmcs40_cpu_device::read_r(int index) +void hmcs40_cpu_device::reset_io() +{ + m_d = m_polarity; + m_write_d(m_polarity); + + for (int i = 0; i < 8; i++) + hmcs40_cpu_device::write_r(i, m_polarity); +} + +u8 hmcs40_cpu_device::read_r(u8 index) { index &= 7; - u8 inp = m_read_r[index](index, 0xff); + u8 inp = m_read_r[index](index); if (m_polarity) return (inp & m_r[index]) & 0xf; @@ -325,63 +343,64 @@ u8 hmcs40_cpu_device::read_r(int index) return (inp | m_r[index]) & 0xf; } -void hmcs40_cpu_device::write_r(int index, u8 data) +void hmcs40_cpu_device::write_r(u8 index, u8 data) { index &= 7; data &= 0xf; m_r[index] = data; - m_write_r[index](index, data, 0xff); + m_write_r[index](index, data); } -int hmcs40_cpu_device::read_d(int index) +int hmcs40_cpu_device::read_d(u8 index) { - index &= 15; + index &= 0xf; + u16 inp = m_read_d(0, 1 << index); if (m_polarity) - return (m_read_d(index, 0xffff) & m_d) >> index & 1; + return BIT(inp & m_d, index); else - return (m_read_d(index, 0xffff) | m_d) >> index & 1; + return BIT(inp | m_d, index); } -void hmcs40_cpu_device::write_d(int index, int state) +void hmcs40_cpu_device::write_d(u8 index, int state) { - index &= 15; - state = (state) ? 1 : 0; + index &= 0xf; + u16 mask = 1 << index; - m_d = (m_d & ~(1 << index)) | state << index; - m_write_d(index, m_d, 0xffff); + m_d = (m_d & ~mask) | (state ? mask : 0); + m_write_d(0, m_d, mask); } // HMCS43: // R0 is input-only, R1 is i/o, R2,R3 are output-only, no R4-R7 // D0-D3 are i/o, D4-D15 are output-only -u8 hmcs43_cpu_device::read_r(int index) +u8 hmcs43_cpu_device::read_r(u8 index) { index &= 7; if (index >= 2) - logerror("read from %s port R%d at $%04X\n", (index >= 4) ? "unknown" : "output", index, m_prev_pc); + logerror("read from %s port R%d @ $%04X\n", (index >= 4) ? "unknown" : "output", index, m_prev_pc); return hmcs40_cpu_device::read_r(index); } -void hmcs43_cpu_device::write_r(int index, u8 data) +void hmcs43_cpu_device::write_r(u8 index, u8 data) { index &= 7; if (index != 0 && index < 4) hmcs40_cpu_device::write_r(index, data); else - logerror("ineffective write to port R%d = $%X at $%04X\n", index, data & 0xf, m_prev_pc); + logerror("ineffective write to port R%d = $%X @ $%04X\n", index, data & 0xf, m_prev_pc); } -int hmcs43_cpu_device::read_d(int index) +int hmcs43_cpu_device::read_d(u8 index) { index &= 15; if (index >= 4) - logerror("read from output pin D%d at $%04X\n", index, m_prev_pc); + logerror("read from output pin D%d @ $%04X\n", index, m_prev_pc); return hmcs40_cpu_device::read_d(index); } @@ -390,57 +409,56 @@ int hmcs43_cpu_device::read_d(int index) // R0-R3 are i/o, R4,R5 are extra registers, no R6,R7 // D0-D15 are i/o -u8 hmcs44_cpu_device::read_r(int index) +u8 hmcs44_cpu_device::read_r(u8 index) { index &= 7; if (index >= 6) - logerror("read from unknown port R%d at $%04X\n", index, m_prev_pc); + logerror("read from unknown port R%d @ $%04X\n", index, m_prev_pc); return hmcs40_cpu_device::read_r(index); } -void hmcs44_cpu_device::write_r(int index, u8 data) +void hmcs44_cpu_device::write_r(u8 index, u8 data) { index &= 7; if (index < 6) hmcs40_cpu_device::write_r(index, data); else - logerror("ineffective write to port R%d = $%X at $%04X\n", index, data & 0xf, m_prev_pc); + logerror("ineffective write to port R%d = $%X @ $%04X\n", index, data & 0xf, m_prev_pc); } // HMCS45: // R0-R5 are i/o, R6 is output-only, no R7 // D0-D15 are i/o -u8 hmcs45_cpu_device::read_r(int index) +u8 hmcs45_cpu_device::read_r(u8 index) { index &= 7; if (index >= 6) - logerror("read from %s port R%d at $%04X\n", (index == 7) ? "unknown" : "output", index, m_prev_pc); + logerror("read from %s port R%d @ $%04X\n", (index == 7) ? "unknown" : "output", index, m_prev_pc); return hmcs40_cpu_device::read_r(index); } -void hmcs45_cpu_device::write_r(int index, u8 data) +void hmcs45_cpu_device::write_r(u8 index, u8 data) { index &= 7; if (index != 7) hmcs40_cpu_device::write_r(index, data); else - logerror("ineffective write to port R%d = $%X at $%04X\n", index, data & 0xf, m_prev_pc); + logerror("ineffective write to port R%d = $%X @ $%04X\n", index, data & 0xf, m_prev_pc); } - //------------------------------------------------- -// interrupt/timer handling +// interrupt/timer //------------------------------------------------- -void hmcs40_cpu_device::do_interrupt() +void hmcs40_cpu_device::take_interrupt() { push_stack(); m_ie = 0; @@ -464,7 +482,7 @@ void hmcs40_cpu_device::do_interrupt() void hmcs40_cpu_device::execute_set_input(int line, int state) { - state = (state) ? 1 : 0; + state = state ? 1 : 0; // halt/unhalt mcu if (line == HMCS40_INPUT_LINE_HLT && state != m_halt) @@ -518,7 +536,6 @@ void hmcs40_cpu_device::increment_tc() } - //------------------------------------------------- // execute //------------------------------------------------- @@ -559,7 +576,7 @@ void hmcs40_cpu_device::execute_run() // check/handle interrupt if (m_ie && (m_iri || m_irt) && !m_block_int) - do_interrupt(); + take_interrupt(); m_block_int = false; // fetch next opcode @@ -570,233 +587,113 @@ void hmcs40_cpu_device::execute_run() cycle(); // handle opcode - switch (m_op) + switch (m_op & 0x3f0) { - /* 0x000 */ - - case 0x000: case 0x001: case 0x002: case 0x003: - op_xsp(); break; - case 0x004: case 0x005: case 0x006: case 0x007: - op_sem(); break; - case 0x008: case 0x009: case 0x00a: case 0x00b: - op_lam(); break; - case 0x010: case 0x011: case 0x012: case 0x013: case 0x014: case 0x015: case 0x016: case 0x017: - case 0x018: case 0x019: case 0x01a: case 0x01b: case 0x01c: case 0x01d: case 0x01e: case 0x01f: - op_lmiiy(); break; - case 0x020: case 0x021: case 0x022: case 0x023: - op_lbm(); break; - case 0x024: - op_blem(); break; - case 0x030: - op_amc(); break; - case 0x034: - op_am(); break; - case 0x03c: - op_lta(); break; - - case 0x040: - op_lxa(); break; - case 0x045: - op_das(); break; - case 0x046: - op_daa(); break; - case 0x04c: - op_rec(); break; - case 0x04f: - op_sec(); break; - case 0x050: - op_lya(); break; - case 0x054: - op_iy(); break; - case 0x058: - op_ayy(); break; - case 0x060: - op_lba(); break; - case 0x064: - op_ib(); break; - case 0x070: case 0x071: case 0x072: case 0x073: case 0x074: case 0x075: case 0x076: case 0x077: - case 0x078: case 0x079: case 0x07a: case 0x07b: case 0x07c: case 0x07d: case 0x07e: case 0x07f: - op_lai(); break; - - case 0x080: case 0x081: case 0x082: case 0x083: case 0x084: case 0x085: case 0x086: case 0x087: - case 0x088: case 0x089: case 0x08a: case 0x08b: case 0x08c: case 0x08d: case 0x08e: case 0x08f: - op_ai(); break; - case 0x090: - op_sed(); break; - case 0x094: - op_td(); break; - case 0x0a0: - op_seif1(); break; - case 0x0a1: - op_secf(); break; - case 0x0a2: - op_seif0(); break; - case 0x0a4: - op_seie(); break; - case 0x0a5: - op_setf(); break; - - case 0x0c0: case 0x0c1: case 0x0c2: case 0x0c3: case 0x0c4: case 0x0c5: case 0x0c6: case 0x0c7: - op_lar(); break; - case 0x0d0: case 0x0d1: case 0x0d2: case 0x0d3: - op_sedd(); break; - case 0x0e0: case 0x0e1: case 0x0e2: case 0x0e3: case 0x0e4: case 0x0e5: case 0x0e6: case 0x0e7: - op_lbr(); break; - case 0x0f0: case 0x0f1: case 0x0f2: case 0x0f3: case 0x0f4: case 0x0f5: case 0x0f6: case 0x0f7: - case 0x0f8: case 0x0f9: case 0x0fa: case 0x0fb: case 0x0fc: case 0x0fd: case 0x0fe: case 0x0ff: - op_xamr(); break; - - - /* 0x100 */ - - case 0x110: case 0x111: - op_lmaiy(); break; - case 0x114: case 0x115: - op_lmady(); break; - case 0x118: - op_lay(); break; - case 0x120: - op_or(); break; - case 0x124: - op_anem(); break; - - case 0x140: case 0x141: case 0x142: case 0x143: case 0x144: case 0x145: case 0x146: case 0x147: - case 0x148: case 0x149: case 0x14a: case 0x14b: case 0x14c: case 0x14d: case 0x14e: case 0x14f: - op_lxi(); break; - case 0x150: case 0x151: case 0x152: case 0x153: case 0x154: case 0x155: case 0x156: case 0x157: - case 0x158: case 0x159: case 0x15a: case 0x15b: case 0x15c: case 0x15d: case 0x15e: case 0x15f: - op_lyi(); break; - case 0x160: case 0x161: case 0x162: case 0x163: case 0x164: case 0x165: case 0x166: case 0x167: - case 0x168: case 0x169: case 0x16a: case 0x16b: case 0x16c: case 0x16d: case 0x16e: case 0x16f: - op_lbi(); break; - case 0x170: case 0x171: case 0x172: case 0x173: case 0x174: case 0x175: case 0x176: case 0x177: - case 0x178: case 0x179: case 0x17a: case 0x17b: case 0x17c: case 0x17d: case 0x17e: case 0x17f: - op_lti(); break; - - case 0x1a0: - op_tif1(); break; - case 0x1a1: - op_ti1(); break; - case 0x1a2: - op_tif0(); break; - case 0x1a3: - op_ti0(); break; - case 0x1a5: - op_ttf(); break; - - case 0x1c0: case 0x1c1: case 0x1c2: case 0x1c3: case 0x1c4: case 0x1c5: case 0x1c6: case 0x1c7: - case 0x1c8: case 0x1c9: case 0x1ca: case 0x1cb: case 0x1cc: case 0x1cd: case 0x1ce: case 0x1cf: - case 0x1d0: case 0x1d1: case 0x1d2: case 0x1d3: case 0x1d4: case 0x1d5: case 0x1d6: case 0x1d7: - case 0x1d8: case 0x1d9: case 0x1da: case 0x1db: case 0x1dc: case 0x1dd: case 0x1de: case 0x1df: - case 0x1e0: case 0x1e1: case 0x1e2: case 0x1e3: case 0x1e4: case 0x1e5: case 0x1e6: case 0x1e7: - case 0x1e8: case 0x1e9: case 0x1ea: case 0x1eb: case 0x1ec: case 0x1ed: case 0x1ee: case 0x1ef: - case 0x1f0: case 0x1f1: case 0x1f2: case 0x1f3: case 0x1f4: case 0x1f5: case 0x1f6: case 0x1f7: - case 0x1f8: case 0x1f9: case 0x1fa: case 0x1fb: case 0x1fc: case 0x1fd: case 0x1fe: case 0x1ff: - op_br(); break; - - - /* 0x200 */ - - case 0x200: case 0x201: case 0x202: case 0x203: - op_tm(); break; - case 0x204: case 0x205: case 0x206: case 0x207: - op_rem(); break; - case 0x208: case 0x209: case 0x20a: case 0x20b: - op_xma(); break; - case 0x210: case 0x211: case 0x212: case 0x213: case 0x214: case 0x215: case 0x216: case 0x217: - case 0x218: case 0x219: case 0x21a: case 0x21b: case 0x21c: case 0x21d: case 0x21e: case 0x21f: - op_mnei(); break; - case 0x220: case 0x221: case 0x222: case 0x223: - op_xmb(); break; - case 0x224: - op_rotr(); break; - case 0x225: - op_rotl(); break; - case 0x230: - op_smc(); break; - case 0x234: - op_alem(); break; - case 0x23c: - op_lat(); break; - - case 0x240: - op_laspx(); break; - case 0x244: - op_nega(); break; - case 0x24f: - op_tc(); break; - case 0x250: - op_laspy(); break; - case 0x254: - op_dy(); break; - case 0x258: - op_syy(); break; - case 0x260: - op_lab(); break; - case 0x267: - op_db(); break; - case 0x270: case 0x271: case 0x272: case 0x273: case 0x274: case 0x275: case 0x276: case 0x277: - case 0x278: case 0x279: case 0x27a: case 0x27b: case 0x27c: case 0x27d: case 0x27e: case 0x27f: - op_alei(); break; - - case 0x280: case 0x281: case 0x282: case 0x283: case 0x284: case 0x285: case 0x286: case 0x287: - case 0x288: case 0x289: case 0x28a: case 0x28b: case 0x28c: case 0x28d: case 0x28e: case 0x28f: - op_ynei(); break; - case 0x290: - op_red(); break; - case 0x2a0: - op_reif1(); break; - case 0x2a1: - op_recf(); break; - case 0x2a2: - op_reif0(); break; - case 0x2a4: - op_reie(); break; - case 0x2a5: - op_retf(); break; - - case 0x2c0: case 0x2c1: case 0x2c2: case 0x2c3: case 0x2c4: case 0x2c5: case 0x2c6: case 0x2c7: - op_lra(); break; - case 0x2d0: case 0x2d1: case 0x2d2: case 0x2d3: - op_redd(); break; - case 0x2e0: case 0x2e1: case 0x2e2: case 0x2e3: case 0x2e4: case 0x2e5: case 0x2e6: case 0x2e7: - op_lrb(); break; - - - /* 0x300 */ - case 0x320: - op_comb(); break; - case 0x324: - op_bnem(); break; - - case 0x340: case 0x341: case 0x342: case 0x343: case 0x344: case 0x345: case 0x346: case 0x347: - case 0x348: case 0x349: case 0x34a: case 0x34b: case 0x34c: case 0x34d: case 0x34e: case 0x34f: - case 0x350: case 0x351: case 0x352: case 0x353: case 0x354: case 0x355: case 0x356: case 0x357: - case 0x358: case 0x359: case 0x35a: case 0x35b: case 0x35c: case 0x35d: case 0x35e: case 0x35f: - op_lpu(); break; - case 0x360: case 0x361: case 0x362: case 0x363: case 0x364: case 0x365: case 0x366: case 0x367: - op_tbr(); break; - case 0x368: case 0x369: case 0x36a: case 0x36b: case 0x36c: case 0x36d: case 0x36e: case 0x36f: - op_p(); break; - - case 0x3a4: - op_rtni(); break; - case 0x3a7: - op_rtn(); break; - - case 0x3c0: case 0x3c1: case 0x3c2: case 0x3c3: case 0x3c4: case 0x3c5: case 0x3c6: case 0x3c7: - case 0x3c8: case 0x3c9: case 0x3ca: case 0x3cb: case 0x3cc: case 0x3cd: case 0x3ce: case 0x3cf: - case 0x3d0: case 0x3d1: case 0x3d2: case 0x3d3: case 0x3d4: case 0x3d5: case 0x3d6: case 0x3d7: - case 0x3d8: case 0x3d9: case 0x3da: case 0x3db: case 0x3dc: case 0x3dd: case 0x3de: case 0x3df: - case 0x3e0: case 0x3e1: case 0x3e2: case 0x3e3: case 0x3e4: case 0x3e5: case 0x3e6: case 0x3e7: - case 0x3e8: case 0x3e9: case 0x3ea: case 0x3eb: case 0x3ec: case 0x3ed: case 0x3ee: case 0x3ef: - case 0x3f0: case 0x3f1: case 0x3f2: case 0x3f3: case 0x3f4: case 0x3f5: case 0x3f6: case 0x3f7: - case 0x3f8: case 0x3f9: case 0x3fa: case 0x3fb: case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff: - op_cal(); break; + case 0x1c0: case 0x1d0: case 0x1e0: case 0x1f0: op_br(); break; + case 0x3c0: case 0x3d0: case 0x3e0: case 0x3f0: op_cal(); break; + case 0x340: case 0x350: op_lpu(); break; + + case 0x010: op_lmiiy(); break; + case 0x070: op_lai(); break; + case 0x080: op_ai(); break; + case 0x0f0: op_xamr(); break; + case 0x140: op_lxi(); break; + case 0x150: op_lyi(); break; + case 0x160: op_lbi(); break; + case 0x170: op_lti(); break; + case 0x210: op_mnei(); break; + case 0x270: op_alei(); break; + case 0x280: op_ynei(); break; + default: + switch (m_op & 0x3fc) + { + case 0x0c0: case 0x0c4: op_lar(); break; + case 0x0e0: case 0x0e4: op_lbr(); break; + case 0x2c0: case 0x2c4: op_lra(); break; + case 0x2e0: case 0x2e4: op_lrb(); break; + case 0x360: case 0x364: op_tbr(); break; + case 0x368: case 0x36c: op_p(); break; + + case 0x000: op_xsp(); break; + case 0x004: op_sem(); break; + case 0x008: op_lam(); break; + case 0x020: op_lbm(); break; + case 0x0d0: op_sedd(); break; + case 0x200: op_tm(); break; + case 0x204: op_rem(); break; + case 0x208: op_xma(); break; + case 0x220: op_xmb(); break; + case 0x2d0: op_redd(); break; default: - op_illegal(); break; - } /* big switch */ + switch (m_op) + { + case 0x024: op_blem(); break; + case 0x030: op_amc(); break; + case 0x034: op_am(); break; + case 0x03c: op_lta(); break; + case 0x040: op_lxa(); break; + case 0x045: op_das(); break; + case 0x046: op_daa(); break; + case 0x04c: op_rec(); break; + case 0x04f: op_sec(); break; + case 0x050: op_lya(); break; + case 0x054: op_iy(); break; + case 0x058: op_ayy(); break; + case 0x060: op_lba(); break; + case 0x064: op_ib(); break; + case 0x090: op_sed(); break; + case 0x094: op_td(); break; + case 0x0a0: op_seif1(); break; + case 0x0a1: op_secf(); break; + case 0x0a2: op_seif0(); break; + case 0x0a4: op_seie(); break; + case 0x0a5: op_setf(); break; + + case 0x110: case 0x111: op_lmaiy(); break; + case 0x114: case 0x115: op_lmady(); break; + case 0x118: op_lay(); break; + case 0x120: op_or(); break; + case 0x124: op_anem(); break; + case 0x1a0: op_tif1(); break; + case 0x1a1: op_ti1(); break; + case 0x1a2: op_tif0(); break; + case 0x1a3: op_ti0(); break; + case 0x1a5: op_ttf(); break; + + case 0x224: op_rotr(); break; + case 0x225: op_rotl(); break; + case 0x230: op_smc(); break; + case 0x234: op_alem(); break; + case 0x23c: op_lat(); break; + case 0x240: op_laspx(); break; + case 0x244: op_nega(); break; + case 0x24f: op_tc(); break; + case 0x250: op_laspy(); break; + case 0x254: op_dy(); break; + case 0x258: op_syy(); break; + case 0x260: op_lab(); break; + case 0x267: op_db(); break; + case 0x290: op_red(); break; + case 0x2a0: op_reif1(); break; + case 0x2a1: op_recf(); break; + case 0x2a2: op_reif0(); break; + case 0x2a4: op_reie(); break; + case 0x2a5: op_retf(); break; + + case 0x320: op_comb(); break; + case 0x324: op_bnem(); break; + case 0x3a4: op_rtni(); break; + case 0x3a7: op_rtn(); break; + + default: op_illegal(); break; + } + break; // 0x3ff + + } + break; // 0x3fc + + } // 0x3f0 } } diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h index eb4592653dbdc..c1c24d81b0ded 100644 --- a/src/devices/cpu/hmcs40/hmcs40.h +++ b/src/devices/cpu/hmcs40/hmcs40.h @@ -12,7 +12,7 @@ #pragma once -// I/O ports setup +// input lines enum { @@ -81,6 +81,8 @@ enum class hmcs40_cpu_device : public cpu_device { public: + virtual ~hmcs40_cpu_device(); + // max 8 4-bit R ports template auto read_r() { return m_read_r[N].bind(); } template auto write_r() { return m_write_r[N].bind(); } @@ -92,38 +94,37 @@ class hmcs40_cpu_device : public cpu_device protected: enum { - HMCS40_FAMILY_HMCS42 = 0, - HMCS40_FAMILY_HMCS43, - HMCS40_FAMILY_HMCS44, - HMCS40_FAMILY_HMCS45, - HMCS40_FAMILY_HMCS46, - HMCS40_FAMILY_HMCS47 + HMCS42_FAMILY = 0, + HMCS43_FAMILY, + HMCS44_FAMILY, + HMCS45_FAMILY, + HMCS46_FAMILY, + HMCS47_FAMILY }; - // construction/destruction + // construction hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int family, u16 polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // device_execute_interface overrides + // device_execute_interface implementation virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2+1; } // max 2 + interrupt - virtual u32 execute_input_lines() const noexcept override { return 2+1; } // 3rd one is internal virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr create_disassembler() override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // memorymaps + // memory maps void program_1k(address_map &map); void program_2k(address_map &map); void data_160x4(address_map &map); @@ -137,45 +138,47 @@ class hmcs40_cpu_device : public cpu_device int m_icount; int m_state_count; - int const m_pcwidth; // Program Counter bit-width - int const m_prgwidth; - int const m_datawidth; - int const m_family; // MCU family (42-47) - u16 const m_polarity; // i/o polarity (pmos vs cmos) - int const m_stack_levels; // number of callstack levels + const int m_pcwidth; // program counter bit-width + const int m_prgwidth; + const int m_datawidth; + const int m_family; // MCU family (42-47) + const u16 m_polarity; // i/o polarity (pmos vs cmos) + const int m_stack_levels; // number of callstack levels int m_pcmask; int m_prgmask; int m_datamask; - u16 m_stack[4]; // max 4 - u16 m_op; // current opcode + + u16 m_stack[4]; // max 4 + u16 m_op; // current opcode u16 m_prev_op; - u8 m_i; // 4-bit immediate opcode param - int m_eint_line; // which input_line caused an interrupt - int m_halt; // internal HLT state - u8 m_prescaler; // internal timer prescaler - bool m_block_int; // block interrupt on next cycle + u8 m_i; // 4-bit immediate opcode param + int m_eint_line; // which input_line caused an interrupt + int m_halt; // internal HLT state + u8 m_prescaler; // internal timer prescaler + bool m_block_int; // block interrupt on next cycle - u16 m_pc; // Program Counter + u16 m_pc; // program counter u16 m_prev_pc; - u8 m_page; // LPU prepared page - u8 m_a; // 4-bit Accumulator - u8 m_b; // 4-bit B register - u8 m_x; // 1/3/4-bit X register - u8 m_spx; // 1/3/4-bit SPX register - u8 m_y; // 4-bit Y register - u8 m_spy; // 4-bit SPY register - u8 m_s; // Status F/F (F/F = flip-flop) - u8 m_c; // Carry F/F - u8 m_tc; // Timer/Counter - u8 m_cf; // CF F/F (timer mode or counter mode) - u8 m_ie; // I/E(Interrupt Enable) F/F - u8 m_iri; // external interrupt pending I/RI F/F - u8 m_irt; // timer interrupt pending I/RT F/F - u8 m_if[2]; // external interrupt mask IF0,1 F/F - u8 m_tf; // timer interrupt mask TF F/F - u8 m_int[2]; // INT0/1 pins state - u8 m_r[8]; // R outputs state - u16 m_d; // D pins state + u8 m_page; // LPU prepared page + u8 m_a; // 4-bit accumulator + u8 m_b; // 4-bit B register + u8 m_x; // 1/3/4-bit X register + u8 m_spx; // 1/3/4-bit SPX register + u8 m_y; // 4-bit Y register + u8 m_spy; // 4-bit SPY register + u8 m_s; // status F/F (F/F = flip-flop) + u8 m_c; // carry F/F + + u8 m_tc; // timer/counter + u8 m_cf; // CF F/F (timer mode or counter mode) + u8 m_ie; // I/E (interrupt enable) F/F + u8 m_iri; // external interrupt pending I/RI F/F + u8 m_irt; // timer interrupt pending I/RT F/F + u8 m_if[2]; // external interrupt mask IF0,1 F/F + u8 m_tf; // timer interrupt mask TF F/F + u8 m_int[2]; // INT0/1 pins state + u8 m_r[8]; // R outputs state + u16 m_d; // D pins state // I/O handlers devcb_read8::array<8> m_read_r; @@ -191,14 +194,15 @@ class hmcs40_cpu_device : public cpu_device void pop_stack(); void push_stack(); - virtual u8 read_r(int index); - virtual void write_r(int index, u8 data); - virtual int read_d(int index); - virtual void write_d(int index, int state); + virtual void reset_io(); + virtual u8 read_r(u8 index); + virtual void write_r(u8 index, u8 data); + virtual int read_d(u8 index); + virtual void write_d(u8 index, int state); void cycle(); void increment_tc(); - void do_interrupt(); + void take_interrupt(); // opcode handlers void op_illegal(); @@ -305,9 +309,9 @@ class hmcs43_cpu_device : public hmcs40_cpu_device hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity); // overrides - virtual u8 read_r(int index) override; - virtual void write_r(int index, u8 data) override; - virtual int read_d(int index) override; + virtual u8 read_r(u8 index) override; + virtual void write_r(u8 index, u8 data) override; + virtual int read_d(u8 index) override; }; class hd38750_device : public hmcs43_cpu_device @@ -341,8 +345,8 @@ class hmcs44_cpu_device : public hmcs40_cpu_device hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity); // overrides - virtual u8 read_r(int index) override; - virtual void write_r(int index, u8 data) override; + virtual u8 read_r(u8 index) override; + virtual void write_r(u8 index, u8 data) override; }; class hd38800_device : public hmcs44_cpu_device @@ -376,8 +380,8 @@ class hmcs45_cpu_device : public hmcs40_cpu_device hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 polarity); // overrides - virtual u8 read_r(int index) override; - virtual void write_r(int index, u8 data) override; + virtual u8 read_r(u8 index) override; + virtual void write_r(u8 index, u8 data) override; }; class hd38820_device : public hmcs45_cpu_device @@ -405,7 +409,6 @@ class hd44828_device : public hmcs45_cpu_device }; - DECLARE_DEVICE_TYPE(HD38750, hd38750_device) DECLARE_DEVICE_TYPE(HD38755, hd38755_device) DECLARE_DEVICE_TYPE(HD44750, hd44750_device) diff --git a/src/devices/cpu/hmcs40/hmcs40d.cpp b/src/devices/cpu/hmcs40/hmcs40d.cpp index cbf318eecce10..e16ff7a2bf96a 100644 --- a/src/devices/cpu/hmcs40/hmcs40d.cpp +++ b/src/devices/cpu/hmcs40/hmcs40d.cpp @@ -35,6 +35,10 @@ hmcs40_disassembler::hmcs40_disassembler() } } +hmcs40_disassembler::~hmcs40_disassembler() +{ +} + // common lookup tables @@ -231,11 +235,7 @@ offs_t hmcs40_disassembler::disassemble(std::ostream &stream, offs_t pc, const d } param &= ((1 << bits) - 1); - - if (bits > 5) - util::stream_format(stream, "$%02X", param); - else - util::stream_format(stream, "%d", param); + util::stream_format(stream, (bits > 4) ? "$%02X" : (param < 10) ? "%d" : "$%X", param); } } diff --git a/src/devices/cpu/hmcs40/hmcs40d.h b/src/devices/cpu/hmcs40/hmcs40d.h index e67d5ab0c18c2..a02d7e87a1b87 100644 --- a/src/devices/cpu/hmcs40/hmcs40d.h +++ b/src/devices/cpu/hmcs40/hmcs40d.h @@ -15,7 +15,7 @@ class hmcs40_disassembler : public util::disasm_interface { public: hmcs40_disassembler(); - virtual ~hmcs40_disassembler() = default; + virtual ~hmcs40_disassembler(); virtual u32 opcode_alignment() const override { return 1; } virtual u32 interface_flags() const override { return NONLINEAR_PC | PAGED; } diff --git a/src/devices/cpu/hmcs40/hmcs40op.cpp b/src/devices/cpu/hmcs40/hmcs40op.cpp index 3469ce495ba19..17e307ca6fa53 100644 --- a/src/devices/cpu/hmcs40/hmcs40op.cpp +++ b/src/devices/cpu/hmcs40/hmcs40op.cpp @@ -36,16 +36,15 @@ void hmcs40_cpu_device::push_stack() } - // instruction set void hmcs40_cpu_device::op_illegal() { - logerror("unknown opcode $%03X at $%04X\n", m_op, m_prev_pc); + logerror("unknown opcode $%03X @ $%04X\n", m_op, m_prev_pc); } -// Register-to-Register Instruction +// register-to-register instructions void hmcs40_cpu_device::op_lab() { @@ -86,7 +85,7 @@ void hmcs40_cpu_device::op_xamr() // HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3) // HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4 - if (m_family == HMCS40_FAMILY_HMCS42 || m_family == HMCS40_FAMILY_HMCS43) + if (m_family == HMCS42_FAMILY || m_family == HMCS43_FAMILY) address |= (address < 4) ? (address << 4) : 0x40; // HMCS44/45/46/47: all on last file @@ -100,7 +99,7 @@ void hmcs40_cpu_device::op_xamr() } -// RAM Address Instruction +// RAM address instructions void hmcs40_cpu_device::op_lxa() { @@ -144,7 +143,7 @@ void hmcs40_cpu_device::op_ayy() { // AYY: Add A to Y m_y += m_a; - m_s = m_y >> 4 & 1; + m_s = BIT(m_y, 4); m_y &= 0xf; } @@ -152,13 +151,13 @@ void hmcs40_cpu_device::op_syy() { // SYY: Subtract A from Y m_y -= m_a; - m_s = ~m_y >> 4 & 1; + m_s = BIT(~m_y, 4); m_y &= 0xf; } void hmcs40_cpu_device::op_xsp() { - // XSP (XY): Exchange X and SPX, Y and SPY, or NOP if 0 + // XSP(XY): Exchange X and SPX, Y and SPY, or NOP if 0 if (m_op & 1) { u8 old_x = m_x; @@ -174,25 +173,25 @@ void hmcs40_cpu_device::op_xsp() } -// RAM Register Instruction +// RAM register instructions void hmcs40_cpu_device::op_lam() { - // LAM (XY): Load A from Memory + // LAM(XY): Load A from Memory m_a = ram_r(); op_xsp(); } void hmcs40_cpu_device::op_lbm() { - // LBM (XY): Load B from Memory + // LBM(XY): Load B from Memory m_b = ram_r(); op_xsp(); } void hmcs40_cpu_device::op_xma() { - // XMA (XY): Exchange Memory and A + // XMA(XY): Exchange Memory and A u8 old_a = m_a; m_a = ram_r(); ram_w(old_a); @@ -201,7 +200,7 @@ void hmcs40_cpu_device::op_xma() void hmcs40_cpu_device::op_xmb() { - // XMB (XY): Exchange Memory and B + // XMB(XY): Exchange Memory and B u8 old_b = m_b; m_b = ram_r(); ram_w(old_b); @@ -210,7 +209,7 @@ void hmcs40_cpu_device::op_xmb() void hmcs40_cpu_device::op_lmaiy() { - // LMAIY (X): Load Memory from A, Increment Y + // LMAIY(X): Load Memory from A, Increment Y ram_w(m_a); op_iy(); op_xsp(); @@ -218,14 +217,14 @@ void hmcs40_cpu_device::op_lmaiy() void hmcs40_cpu_device::op_lmady() { - // LMADY (X): Load Memory from A, Decrement Y + // LMADY(X): Load Memory from A, Decrement Y ram_w(m_a); op_dy(); op_xsp(); } -// Immediate Instruction +// immediate instructions void hmcs40_cpu_device::op_lmiiy() { @@ -247,13 +246,13 @@ void hmcs40_cpu_device::op_lbi() } -// Arithmetic Instruction +// arithmetic instructions void hmcs40_cpu_device::op_ai() { // AI i: Add Immediate to A m_a += m_i; - m_s = m_a >> 4 & 1; + m_s = BIT(m_a, 4); m_a &= 0xf; } @@ -275,7 +274,7 @@ void hmcs40_cpu_device::op_amc() { // AMC: Add A to Memory with Carry m_a += ram_r() + m_c; - m_c = m_a >> 4 & 1; + m_c = BIT(m_a, 4); m_s = m_c; m_a &= 0xf; } @@ -284,7 +283,7 @@ void hmcs40_cpu_device::op_smc() { // SMC: Subtract A from Memory with Carry m_a = ram_r() - m_a - (m_c ^ 1); - m_c = ~m_a >> 4 & 1; + m_c = BIT(~m_a, 4); m_s = m_c; m_a &= 0xf; } @@ -293,7 +292,7 @@ void hmcs40_cpu_device::op_am() { // AM: Add A to Memory m_a += ram_r(); - m_s = m_a >> 4 & 1; + m_s = BIT(m_a, 4); m_a &= 0xf; } @@ -351,7 +350,7 @@ void hmcs40_cpu_device::op_rotl() { // ROTL: Rotate Left A with Carry m_a = m_a << 1 | m_c; - m_c = m_a >> 4 & 1; + m_c = BIT(m_a, 4); m_a &= 0xf; } @@ -365,17 +364,17 @@ void hmcs40_cpu_device::op_rotr() void hmcs40_cpu_device::op_or() { - // OR: OR A with B + // OR: Or A with B m_a |= m_b; } -// Compare Instruction +// compare instructions void hmcs40_cpu_device::op_mnei() { // MNEI i: Memory Not Equal to Immediate - m_s = (ram_r() != m_i); + m_s = (m_i != ram_r()); } void hmcs40_cpu_device::op_ynei() @@ -415,7 +414,7 @@ void hmcs40_cpu_device::op_blem() } -// RAM Bit Manipulation Instruction +// RAM bit manipulation instructions void hmcs40_cpu_device::op_sem() { @@ -432,11 +431,11 @@ void hmcs40_cpu_device::op_rem() void hmcs40_cpu_device::op_tm() { // TM n: Test Memory Bit - m_s = ram_r() >> (m_op & 3) & 1; + m_s = BIT(ram_r(), m_op & 3); } -// ROM Address Instruction +// ROM address instructions void hmcs40_cpu_device::op_br() { @@ -486,7 +485,7 @@ void hmcs40_cpu_device::op_rtn() } -// Interrupt Instruction +// interrupt instructions void hmcs40_cpu_device::op_seie() { @@ -606,7 +605,7 @@ void hmcs40_cpu_device::op_rtni() } -// Input/Output Instruction +// input/output instructions void hmcs40_cpu_device::op_sed() { @@ -664,24 +663,24 @@ void hmcs40_cpu_device::op_lrb() void hmcs40_cpu_device::op_p() { + // P p: Pattern Generation cycle(); - // P p: Pattern Generation u16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); - u16 o = m_program->read_word(address & m_prgmask); + u16 data = m_program->read_word(address & m_prgmask); // destination is determined by the 2 highest bits - if (o & 0x100) + if (data & 0x100) { // B3 B2 B1 B0 A0 A1 A2 A3 - m_a = bitswap<4>(o,0,1,2,3); - m_b = o >> 4 & 0xf; + m_a = bitswap<4>(data,0,1,2,3); + m_b = data >> 4 & 0xf; } - if (o & 0x200) + if (data & 0x200) { // R20 R21 R22 R23 R30 R31 R32 R33 - o = bitswap<8>(o,0,1,2,3,4,5,6,7); - write_r(2, o & 0xf); - write_r(3, o >> 4 & 0xf); + data = bitswap<8>(data,0,1,2,3,4,5,6,7); + write_r(2, data & 0xf); + write_r(3, data >> 4 & 0xf); } } diff --git a/src/devices/cpu/hmcs400/hmcs400.cpp b/src/devices/cpu/hmcs400/hmcs400.cpp new file mode 100644 index 0000000000000..01e5ace61ddca --- /dev/null +++ b/src/devices/cpu/hmcs400/hmcs400.cpp @@ -0,0 +1,936 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + +Hitachi HMCS400 MCU family cores + +It's the successor to HMCS40, it was mainly used in consumer electronics, not +much in games. + +Compared to HMCS40, it accepts a higher clock speed, and it has more versatile +peripherals, like a serial interface. The opcodes were mostly kept the same. +They added an extra RAM addressing mode, and interrupt-related opcodes were +removed (interrupt flags are via memory-mapped I/O). + +TODO: +- add serial interface +- current I/O ports are hardcoded for HMS402/4/8, which will need to be changed + when other MCU types are added +- do the LAW/LWA opcodes not work on early revisions of HMCS400? the 1988 user + manual warns that the W register is write-only, and that there is no efficient + way to save this register when using interrupts +- what happens when accessing ROM/RAM out of address range? Hitachi documentation + says 'unused', but maybe it's mirrored? + +*/ + +#include "emu.h" +#include "hmcs400.h" +#include "hmcs400d.h" + + +//------------------------------------------------- +// device types +//------------------------------------------------- + +// C = standard +// CL = low-power +// AC = high-speed + +// HMCS408, HMCS414, HMCS424 have a mask option for the system clock divider +// rev 2 apparently added LAW/LWA opcodes? + +// HMCS402C/CL/AC, 64 pins DP-64S or FP-64, 2Kx10 ROM, 160x4 RAM +DEFINE_DEVICE_TYPE(HD614022, hd614022_device, "hd614022", "Hitachi HD614022") // C, rev 2 +DEFINE_DEVICE_TYPE(HD614023, hd614023_device, "hd614023", "Hitachi HD614023") // C, rev 1 +DEFINE_DEVICE_TYPE(HD614025, hd614025_device, "hd614025", "Hitachi HD614025") // CL, rev 2 +DEFINE_DEVICE_TYPE(HD614026, hd614026_device, "hd614026", "Hitachi HD614026") // CL, rev 1 +DEFINE_DEVICE_TYPE(HD614028, hd614028_device, "hd614028", "Hitachi HD614028") // AC, rev 2 +DEFINE_DEVICE_TYPE(HD614029, hd614029_device, "hd614029", "Hitachi HD614029") // AC, rev 1 + +// HMCS404C/CL/AC, 64 pins DP-64S or FP-64, 4Kx10 ROM, 256x4 RAM +DEFINE_DEVICE_TYPE(HD614042, hd614042_device, "hd614042", "Hitachi HD614042") // C, rev 2 +DEFINE_DEVICE_TYPE(HD614043, hd614043_device, "hd614043", "Hitachi HD614043") // C, rev 1 +DEFINE_DEVICE_TYPE(HD614045, hd614045_device, "hd614045", "Hitachi HD614045") // CL, rev 2 +DEFINE_DEVICE_TYPE(HD614046, hd614046_device, "hd614046", "Hitachi HD614046") // CL, rev 1 +DEFINE_DEVICE_TYPE(HD614048, hd614048_device, "hd614048", "Hitachi HD614048") // AC, rev 2 +DEFINE_DEVICE_TYPE(HD614049, hd614049_device, "hd614049", "Hitachi HD614049") // AC, rev 1 + +// HMCS408C/CL/AC, 64 pins DP-64S or FP-64, 8Kx10 ROM, 512x4 RAM +DEFINE_DEVICE_TYPE(HD614080, hd614080_device, "hd614080", "Hitachi HD614080") // C, rev 2 +DEFINE_DEVICE_TYPE(HD614081, hd614081_device, "hd614081", "Hitachi HD614081") // C, rev 1 +DEFINE_DEVICE_TYPE(HD614085, hd614085_device, "hd614085", "Hitachi HD614085") // CL, rev 2 +DEFINE_DEVICE_TYPE(HD614086, hd614086_device, "hd614086", "Hitachi HD614086") // CL, rev 1 +DEFINE_DEVICE_TYPE(HD614088, hd614088_device, "hd614088", "Hitachi HD614088") // AC, rev 2 +DEFINE_DEVICE_TYPE(HD614089, hd614089_device, "hd614089", "Hitachi HD614089") // AC, rev 1 + + +//------------------------------------------------- +// constructor +//------------------------------------------------- + +hmcs400_cpu_device::hmcs400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size) : + cpu_device(mconfig, type, tag, owner, clock), + device_nvram_interface(mconfig, *this), + m_program_config("program", ENDIANNESS_LITTLE, 16, 14, -1, address_map_constructor(FUNC(hmcs400_cpu_device::program_map), this)), + m_data_config("data", ENDIANNESS_LITTLE, 8, 10, 0, address_map_constructor(FUNC(hmcs400_cpu_device::data_map), this)), + m_ram(*this, "ram%u", 0U), + m_nvram_defval(0), + m_nvram_battery(true), + m_rom_size(rom_size), + m_ram_size(ram_size), + m_has_div(false), + m_divider(8), + m_read_r(*this, 0), + m_write_r(*this), + m_read_d(*this, 0), + m_write_d(*this), + m_stop_cb(*this) +{ + // disable nvram by default (set to true if MCU is battery-backed when in stop mode) + nvram_enable_backup(false); +} + +hmcs400_cpu_device::~hmcs400_cpu_device() { } + + +hmcs402_cpu_device::hmcs402_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + hmcs400_cpu_device(mconfig, type, tag, owner, clock, 0x800, 96) +{ } + +hd614022_device::hd614022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614022, tag, owner, clock) +{ } +hd614023_device::hd614023_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614023, tag, owner, clock) +{ } +hd614025_device::hd614025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614025, tag, owner, clock) +{ } +hd614026_device::hd614026_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614026, tag, owner, clock) +{ } +hd614028_device::hd614028_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614028, tag, owner, clock) +{ } +hd614029_device::hd614029_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs402_cpu_device(mconfig, HD614029, tag, owner, clock) +{ } + + +hmcs404_cpu_device::hmcs404_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + hmcs400_cpu_device(mconfig, type, tag, owner, clock, 0x1000, 192) +{ } + +hd614042_device::hd614042_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614042, tag, owner, clock) +{ } +hd614043_device::hd614043_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614043, tag, owner, clock) +{ } +hd614045_device::hd614045_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614045, tag, owner, clock) +{ } +hd614046_device::hd614046_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614046, tag, owner, clock) +{ } +hd614048_device::hd614048_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614048, tag, owner, clock) +{ } +hd614049_device::hd614049_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs404_cpu_device(mconfig, HD614049, tag, owner, clock) +{ } + + +hmcs408_cpu_device::hmcs408_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + hmcs400_cpu_device(mconfig, type, tag, owner, clock, 0x2000, 448) +{ + m_has_div = true; +} + +hd614080_device::hd614080_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614080, tag, owner, clock) +{ } +hd614081_device::hd614081_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614081, tag, owner, clock) +{ } +hd614085_device::hd614085_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614085, tag, owner, clock) +{ } +hd614086_device::hd614086_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614086, tag, owner, clock) +{ } +hd614088_device::hd614088_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614088, tag, owner, clock) +{ } +hd614089_device::hd614089_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + hmcs408_cpu_device(mconfig, HD614089, tag, owner, clock) +{ } + + +//------------------------------------------------- +// initialization +//------------------------------------------------- + +void hmcs400_cpu_device::device_start() +{ + m_program = &space(AS_PROGRAM); + m_data = &space(AS_DATA); + + // zerofill + m_pc = 0; + m_prev_pc = 0; + m_sp = 0; + m_op = 0; + m_param = 0; + m_i = 0; + + m_a = 0; + m_b = 0; + m_w = 0; + m_x = 0; + m_spx = 0; + m_y = 0; + m_spy = 0; + m_st = 0; + m_ca = 0; + m_standby = false; + m_stop = false; + + memset(m_r, 0, sizeof(m_r)); + memset(m_r_mask, 0, sizeof(m_r_mask)); + m_d = 0; + m_d_mask = 0; + + m_int_line[0] = m_int_line[1] = 1; + m_irq_flags = 0; + m_pmr = 0; + m_prescaler = 0; + m_timer_mode[0] = m_timer_mode[1] = 0; + m_timer_div[0] = m_timer_div[1] = 0; + m_timer_count[0] = m_timer_count[1] = 0; + m_timer_load = 0; + m_timer_b_low = 0; + + // register for savestates + save_item(NAME(m_nvram_battery)); + save_item(NAME(m_pc)); + save_item(NAME(m_prev_pc)); + save_item(NAME(m_sp)); + save_item(NAME(m_op)); + + save_item(NAME(m_a)); + save_item(NAME(m_b)); + save_item(NAME(m_w)); + save_item(NAME(m_x)); + save_item(NAME(m_spx)); + save_item(NAME(m_y)); + save_item(NAME(m_spy)); + save_item(NAME(m_st)); + save_item(NAME(m_ca)); + save_item(NAME(m_standby)); + save_item(NAME(m_stop)); + + save_item(NAME(m_r)); + save_item(NAME(m_r_mask)); + save_item(NAME(m_d)); + save_item(NAME(m_d_mask)); + + save_item(NAME(m_int_line)); + save_item(NAME(m_irq_flags)); + save_item(NAME(m_pmr)); + save_item(NAME(m_prescaler)); + save_item(NAME(m_timer_mode)); + save_item(NAME(m_timer_div)); + save_item(NAME(m_timer_count)); + save_item(NAME(m_timer_load)); + save_item(NAME(m_timer_b_low)); + + // register state for debugger + state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).formatstr("%04X").noshow(); + state_add(STATE_GENFLAGS, "GENFLAGS", m_st).formatstr("%2s").noshow(); + + m_state_count = 0; + state_add(++m_state_count, "PC", m_pc).formatstr("%04X"); // 1 + state_add(++m_state_count, "SP", m_sp).formatstr("%03X"); // 2 + state_add(++m_state_count, "A", m_a).formatstr("%01X"); // 3 + state_add(++m_state_count, "B", m_b).formatstr("%01X"); // 4 + state_add(++m_state_count, "W", m_w).formatstr("%01X"); // 5 + state_add(++m_state_count, "X", m_x).formatstr("%01X"); // 6 + state_add(++m_state_count, "SPX", m_spx).formatstr("%01X"); // 7 + state_add(++m_state_count, "Y", m_y).formatstr("%01X"); // 8 + state_add(++m_state_count, "SPY", m_spy).formatstr("%01X"); // 9 + + state_add(++m_state_count, "ST", m_st).formatstr("%01X").noshow(); // 10 + state_add(++m_state_count, "CA", m_ca).formatstr("%01X").noshow(); // 11 + + set_icountptr(m_icount); +} + +void hmcs400_cpu_device::device_reset() +{ + m_pc = 0; + m_sp = 0x3ff; + m_st = 1; + m_standby = false; + m_stop = false; + m_stop_cb(0); + + // clear peripherals + m_irq_flags = 0xaaa8; // IM=1, IF=0, IE=0 + m_pmr = 0; + + m_prescaler = 0; + tm_w(0, 0, 0xf); + tm_w(1, 0, 0xf); + m_timer_count[0] = m_timer_count[1] = 0; + m_timer_load = 0; + m_timer_b_low = 0; + + // all I/O ports set to input + reset_io(); +} + + +//------------------------------------------------- +// disasm +//------------------------------------------------- + +void hmcs400_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("%c%c", + m_ca ? 'C':'c', + m_st ? 'S':'s' + ); + break; + + default: break; + } +} + +std::unique_ptr hmcs400_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +//------------------------------------------------- +// internal memory maps +//------------------------------------------------- + +void hmcs400_cpu_device::program_map(address_map &map) +{ + map.unmap_value_high(); + map(0, m_rom_size - 1).rom(); +} + +void hmcs400_cpu_device::data_map(address_map &map) +{ + map.unmap_value_high(); + map(0x000, 0x003).rw(FUNC(hmcs400_cpu_device::irq_control_r), FUNC(hmcs400_cpu_device::irq_control_w)); + map(0x004, 0x004).w(FUNC(hmcs400_cpu_device::pmr_w)); + map(0x008, 0x009).w(FUNC(hmcs400_cpu_device::tm_w)); + map(0x00a, 0x00a).rw(FUNC(hmcs400_cpu_device::tcbl_r), FUNC(hmcs400_cpu_device::tlrl_w)); + map(0x00b, 0x00b).rw(FUNC(hmcs400_cpu_device::tcbu_r), FUNC(hmcs400_cpu_device::tlru_w)); + + map(0x020, 0x020 + m_ram_size - 1).ram().share(m_ram[0]); + map(0x3c0, 0x3ff).ram().share(m_ram[1]); // stack +} + +device_memory_interface::space_config_vector hmcs400_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} + + +//------------------------------------------------- +// nvram +//------------------------------------------------- + +bool hmcs400_cpu_device::nvram_write(util::write_stream &file) +{ + // if it's currently not battery-backed, don't save at all + if (!m_nvram_battery) + return true; + + std::error_condition err; + size_t actual; + + // main RAM and stack area + for (auto & ram : m_ram) + { + std::tie(err, actual) = write(file, &ram[0], ram.bytes()); + if (err) + return false; + } + + return true; +} + +bool hmcs400_cpu_device::nvram_read(util::read_stream &file) +{ + std::error_condition err; + size_t actual; + + // main RAM and stack area + for (auto & ram : m_ram) + { + std::tie(err, actual) = read(file, &ram[0], ram.bytes()); + if (err || (ram.bytes() != actual)) + return false; + } + + return true; +} + +void hmcs400_cpu_device::nvram_default() +{ + if (!nvram_backup_enabled()) + return; + + // default nvram from mytag:nvram region if it exists + memory_region *region = memregion("nvram"); + if (region != nullptr) + { + const u32 total = m_ram[0].bytes() + m_ram[1].bytes(); + if (region->bytes() != total) + fatalerror("%s: Wrong region size (expected 0x%x, found 0x%x)", region->name(), total, region->bytes()); + + u32 offset = 0; + for (auto & ram : m_ram) + { + std::copy_n(®ion->as_u8(offset), ram.bytes(), &ram[0]); + offset += ram.bytes(); + } + } + else + { + for (auto & ram : m_ram) + std::fill_n(&ram[0], ram.bytes(), m_nvram_defval); + } +} + + +//------------------------------------------------- +// i/o ports +//------------------------------------------------- + +void hmcs400_cpu_device::reset_io() +{ + // D4-D15 are high-voltage + m_d_mask = m_d = 0x000f; + m_write_d(m_d_mask); + + for (int i = 0; i < 10; i++) + { + // R0-R2 and RA are high-voltage + u8 mask = (i >= 3 && i <= 9) ? 0xf : 0; + + m_r_mask[i] = m_r[i] = mask; + m_write_r[i](i, mask); + } +} + +u8 hmcs400_cpu_device::read_r(u8 index) +{ + // reads from write-only or non-existent ports are invalid + const bool write_only = (index == 0 || (index >= 6 && index <= 8)); + if (write_only || index > 10) + { + logerror("read from %s port R%X @ $%04X\n", write_only ? "output" : "unknown", index, m_prev_pc); + return 0xf; + } + + u8 mask = (index == 10) ? 3 : 0xf; // port A is 2-bit + u8 inp = m_read_r[index](index); + + if (m_read_r[index].isunset()) + { + inp = m_r_mask[index]; + logerror("read from unmapped port R%X @ $%04X\n", index, m_prev_pc); + } + + u8 out = m_r[index]; + + // R32/R33 are multiplexed with ext interrupts + if (index == 3) + { + u8 pmr_mask = m_pmr & 0xc; + u8 ext_int = m_int_line[1] << 3 | m_int_line[0] << 2; + inp = (inp & ~pmr_mask) | (ext_int & pmr_mask); + out = (out & ~pmr_mask) | (m_r_mask[index] & pmr_mask); + } + + if (m_r_mask[index]) + return (inp & out) & mask; + else + return (inp | out) & mask; +} + +void hmcs400_cpu_device::write_r(u8 index, u8 data) +{ + data &= 0xf; + + // ignore writes to read-only or non-existent ports + if (index > 8) + return; + + if (m_write_r[index].isunset()) + logerror("write $%X to unmapped port R%d @ $%04X\n", data, index, m_prev_pc); + + m_r[index] = data; + u8 out = data; + + // R32/R33 are multiplexed with ext interrupts + if (index == 3) + { + u8 pmr_mask = m_pmr & 0xc; + out = (out & ~pmr_mask) | (m_r_mask[index] & pmr_mask); + } + + m_write_r[index](index, out); +} + +int hmcs400_cpu_device::read_d(u8 index) +{ + index &= 0xf; + u16 mask = 1 << index; + u16 inp = m_read_d(0, mask); + + if (m_read_d.isunset()) + { + inp = m_d_mask; + logerror("read from unmapped port D%d @ $%04X\n", index, m_prev_pc); + } + + if (m_d_mask & mask) + return BIT(inp & m_d, index); + else + return BIT(inp | m_d, index); +} + +void hmcs400_cpu_device::write_d(u8 index, int state) +{ + index &= 0xf; + u16 mask = 1 << index; + + if (m_write_d.isunset()) + logerror("write %d to unmapped port D%d @ $%04X\n", state, index, m_prev_pc); + + m_d = (m_d & ~mask) | (state ? mask : 0); + m_write_d(0, m_d, mask); +} + + +//------------------------------------------------- +// interrupts +//------------------------------------------------- + +bool hmcs400_cpu_device::access_mode(u8 mem_mask, bool bit_mode) +{ + mem_mask &= 0xf; + bool err = true; + + if (bit_mode) + { + if (population_count_32(mem_mask) == 1) + return true; + err = mem_mask == 0xf; + } + else + { + if (mem_mask == 0xf) + return true; + } + + if (err) + logerror("invalid access to I/O register @ $%04X\n", m_prev_pc); + + return false; +} + +u8 hmcs400_cpu_device::irq_control_r(offs_t offset, u8 mem_mask) +{ + // mask out unused bits (RSP is write-only) + const u16 unused = 0xcc02; + u16 data = m_irq_flags | unused; + + if (!machine().side_effects_disabled()) + { + // can only read one bit at a time + if (!access_mode(mem_mask, true)) + return 0xf; + + if (mem_mask << (offset * 4) & unused) + logerror("read from unused IRQ control bit @ $%04X\n", m_prev_pc); + } + + return data >> (offset * 4) & 0xf; +} + +void hmcs400_cpu_device::irq_control_w(offs_t offset, u8 data, u8 mem_mask) +{ + // can only write one bit at a time + if (!access_mode(mem_mask, true)) + return; + + data &= mem_mask; + u16 mask = mem_mask << (offset * 4); + + // ignore writes to unused bits + if (mask & 0xcc00) + return; + + // ignore writing 1 to flags that can only be cleared + if (mask & 0x5556 && data) + return; + + // bit 1: RSP (reset SP) + if (mask & 0x0002) + m_sp = 0x3ff; + + m_irq_flags = (m_irq_flags & ~mask) | (data ? mask : 0); +} + +void hmcs400_cpu_device::pmr_w(offs_t offset, u8 data, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return; + + u8 prev = m_pmr; + m_pmr = data; + + // trigger irq on rising edge if ext int line was low + for (int i = 0; i < 2; i++) + if (BIT(data & ~prev, i + 2)) + ext_int_edge(i); + + // refresh R32/R33 + if ((data ^ prev) & 0xc) + write_r(3, m_r[3]); +} + +void hmcs400_cpu_device::take_interrupt(int irq) +{ + cycle(); + cycle(); + push_stack(); + m_irq_flags &= ~1; + + standard_irq_callback(irq, m_pc); + + u8 vector = irq * 2 + 2; + m_prev_pc = m_pc = vector; +} + +void hmcs400_cpu_device::check_interrupts() +{ + // irq priority is in the same order as the irq control flags + u16 irq = m_irq_flags >> 2; + + for (int i = 0; i < 7; i++) + { + // pending irq when IF=1 and IM=0 + if ((irq & 3) == 1) + { + if (m_irq_flags & 1) + take_interrupt(i); + + m_standby = false; + return; + } + + irq >>= 2; + } +} + +void hmcs400_cpu_device::ext_int_edge(int line) +{ + // ext interrupts are masked with PMR2/3 + if (!m_int_line[line] && BIT(m_pmr, line + 2)) + { + m_irq_flags |= 1 << (line * 2 + 2); + + // timer B event counter on INT1 + if (line == 1 && !m_timer_div[1]) + clock_timer(1); + } +} + +void hmcs400_cpu_device::execute_set_input(int line, int state) +{ + state = state ? 1 : 0; + + if (line != 0 && line != 1) + return; + + // active-low, irq on falling edge + state ^= 1; + bool irq = (m_int_line[line] && !state); + m_int_line[line] = state; + + if (irq && !m_stop) + ext_int_edge(line); +} + + +//------------------------------------------------- +// timers +//------------------------------------------------- + +void hmcs400_cpu_device::tm_w(offs_t offset, u8 data, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return; + + // TMA/TMB prescaler divide ratio masks + static const int div[2][8] = + { + { 0x400, 0x200, 0x100, 0x40, 0x10, 4, 2, 1 }, + { 0x400, 0x100, 0x40, 0x10, 4, 2, 1, 0 } + }; + + m_timer_mode[offset] = data & 0xf; + m_timer_div[offset] = div[offset][data & 7]; +} + +void hmcs400_cpu_device::tlrl_w(offs_t offset, u8 data, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return; + + // TLRL: timer load register lower + m_timer_load = (m_timer_load & 0xf0) | (data & 0xf); +} + +void hmcs400_cpu_device::tlru_w(offs_t offset, u8 data, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return; + + // TLRU: timer load register upper + m_timer_load = (m_timer_load & 0x0f) | data << 4; + m_timer_count[1] = m_timer_load; +} + +u8 hmcs400_cpu_device::tcbl_r(offs_t offset, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return 0xf; + + // TCBL: timer counter B lower + return m_timer_b_low; +} + +u8 hmcs400_cpu_device::tcbu_r(offs_t offset, u8 mem_mask) +{ + if (!access_mode(mem_mask)) + return 0xf; + + // TCBU: timer counter B upper (latches TCBL) + if (!machine().side_effects_disabled()) + m_timer_b_low = m_timer_count[1] & 0xf; + + return m_timer_count[1] >> 4; +} + +void hmcs400_cpu_device::clock_timer(int timer) +{ + if (++m_timer_count[timer] == 0) + { + // set timer overflow irq flag + m_irq_flags |= 1 << (timer * 2 + 6); + + // timer B reload function + if (timer == 1 && m_timer_mode[1] & 8) + m_timer_count[1] = m_timer_load; + } +} + +void hmcs400_cpu_device::clock_prescaler() +{ + u16 prev = m_prescaler; + m_prescaler = (m_prescaler + 1) & 0x7ff; + + // increment timers based on prescaler divide ratio + for (int i = 0; i < 2; i++) + if (m_prescaler & ~prev & m_timer_div[i]) + clock_timer(i); +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void hmcs400_cpu_device::cycle() +{ + m_icount--; + clock_prescaler(); +} + +u16 hmcs400_cpu_device::fetch() +{ + u16 data = m_program->read_word(m_pc); + m_pc = (m_pc + 1) & 0x3fff; + cycle(); + + return data & 0x3ff; +} + +void hmcs400_cpu_device::execute_run() +{ + // in stop mode, the internal clock is not running + if (m_stop) + { + m_icount = 0; + return; + } + + while (m_icount > 0) + { + m_prev_pc = m_pc; + check_interrupts(); + + // in standby mode, opcode execution is halted + if (m_standby) + { + cycle(); + continue; + } + + // fetch next opcode + debugger_instruction_hook(m_pc); + m_op = fetch(); + m_i = m_op & 0xf; + + // 2-byte opcodes / RAM address + if ((m_op >= 0x100 && m_op < 0x140) || (m_op >= 0x150 && m_op < 0x1b0)) + m_param = fetch(); + else + m_param = (m_w << 8 | m_x << 4 | m_y) & 0x3ff; + + // handle opcode + switch (m_op & 0x3f0) + { + case 0x1c0: case 0x1d0: case 0x1e0: case 0x1f0: op_cal(); break; + + case 0x020: case 0x120: op_inem(); break; + case 0x030: case 0x130: op_ilem(); break; + case 0x070: op_ynei(); break; + case 0x0b0: op_tbr(); break; + case 0x150: op_jmpl(); break; + case 0x160: op_call(); break; + case 0x170: op_brl(); break; + case 0x1a0: op_lmi(); break; + case 0x1b0: op_p(); break; + + case 0x200: op_lbi(); break; + case 0x210: op_lyi(); break; + case 0x220: op_lxi(); break; + case 0x230: op_lai(); break; + case 0x240: op_lbr(); break; + case 0x250: op_lar(); break; + case 0x260: op_redd(); break; + case 0x270: op_lamr(); break; + case 0x280: op_ai(); break; + case 0x290: op_lmiiy(); break; + case 0x2a0: op_tdd(); break; + case 0x2b0: op_alei(); break; + case 0x2c0: op_lrb(); break; + case 0x2d0: op_lra(); break; + case 0x2e0: op_sedd(); break; + case 0x2f0: op_xmra(); break; + + default: + if ((m_op & 0x300) == 0x300) + { + op_br(); break; + } + + switch (m_op & 0x3fc) + { + case 0x084: case 0x184: op_sem(); break; + case 0x088: case 0x188: op_rem(); break; + case 0x08c: case 0x18c: op_tm(); break; + + case 0x000: op_xsp(); break; + case 0x040: op_lbm(); break; + case 0x080: op_xma(); break; + case 0x090: op_lam(); break; + case 0x094: op_lma(); break; + case 0x0c0: op_xmb(); break; + case 0x0f0: op_lwi(); break; + + default: + switch (m_op) + { + case 0x004: case 0x104: op_anem(); break; + case 0x008: case 0x108: op_am(); break; + case 0x00c: case 0x10c: op_orm(); break; + case 0x014: case 0x114: op_alem(); break; + case 0x018: case 0x118: op_amc(); break; + case 0x01c: case 0x11c: op_eorm(); break; + case 0x098: case 0x198: op_smc(); break; + case 0x09c: case 0x19c: op_anm(); break; + + case 0x010: op_rtn(); break; + case 0x011: op_rtni(); break; + case 0x044: op_bnem(); break; + case 0x048: op_lab(); break; + case 0x04c: op_ib(); break; + case 0x050: case 0x051: op_lmaiy(); break; + case 0x054: op_ayy(); break; + case 0x058: op_laspy(); break; + case 0x05c: op_iy(); break; + case 0x060: op_nega(); break; + case 0x064: op_red(); break; + case 0x068: op_laspx(); break; + case 0x06f: op_tc(); break; + + case 0x0a0: op_rotr(); break; + case 0x0a1: op_rotl(); break; + case 0x0a6: op_daa(); break; + case 0x0aa: op_das(); break; + case 0x0af: op_lay(); break; + case 0x0c4: op_blem(); break; + case 0x0c8: op_lba(); break; + case 0x0cf: op_db(); break; + case 0x0d0: case 0x0d1: op_lmady(); break; + case 0x0d4: op_syy(); break; + case 0x0d8: op_lya(); break; + case 0x0df: op_dy(); break; + case 0x0e0: op_td(); break; + case 0x0e4: op_sed(); break; + case 0x0e8: op_lxa(); break; + case 0x0ec: op_rec(); break; + case 0x0ef: op_sec(); break; + + case 0x100: op_law(); break; + case 0x110: op_lwa(); break; + case 0x140: op_comb(); break; + case 0x144: op_or(); break; + case 0x148: op_sts(); break; + case 0x14c: op_sby(); break; + case 0x14d: op_stop(); break; + case 0x180: op_xma(); break; + case 0x190: op_lam(); break; + case 0x194: op_lma(); break; + + default: op_illegal(); break; + } + break; // 0x3ff + + } + break; // 0x3fc + + } // 0x3f0 + } +} diff --git a/src/devices/cpu/hmcs400/hmcs400.h b/src/devices/cpu/hmcs400/hmcs400.h new file mode 100644 index 0000000000000..6b26b38227af6 --- /dev/null +++ b/src/devices/cpu/hmcs400/hmcs400.h @@ -0,0 +1,459 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Hitachi HMCS400 MCU family cores + +*/ + +#ifndef MAME_CPU_HMCS400_HMCS400_H +#define MAME_CPU_HMCS400_HMCS400_H + +#pragma once + + +// input lines + +enum +{ + HMCS400_INPUT_LINE_INT0 = 0, + HMCS400_INPUT_LINE_INT1 +}; + + +// pinout reference + +/* + _________________ + D11 1 |* | 64 D10 + D12 2 | | 63 D9 + D13 3 | | 62 D8 + D14 4 | | 61 D7 + D15 5 | | 60 D6 + R00 6 | | 59 D5 + R01 7 | | 58 D4 + R02 8 | | 57 D3 + R03 9 | | 56 D2 + R10 10 | | 55 D1 + R11 11 | | 54 D0 + R12 12 | | 53 GND + R13 13 | | 52 OSC2 + R20 14 | HD61402x | 51 OSC1 + R21 15 | HD61404x | 50 _TEST + R22 16 | HD61408x | 49 RESET + R23 17 | | 48 R93 + RA0 18 | DP-64S | 47 R92 + RA1/Vdisp 19 | DC-64S | 46 R91 + R30 20 | | 45 R90 + R31 21 | | 44 R83 + R32/_INT0 22 | | 43 R82 + R33/_INT1 23 | | 42 R81 + R50 24 | | 41 R80 + R51 25 | | 40 R73 + R52 26 | | 39 R72 + R53 27 | | 38 R71 + R60 28 | | 37 R70 + R61 29 | | 36 R43 + R62 30 | | 35 R42/SO + R63 31 | | 34 R41/SI + Vcc 32 |_________________| 33 R40/_SCK + + (see datasheets for FP-64 pinouts) + +*/ + + +class hmcs400_cpu_device : public cpu_device, public device_nvram_interface +{ +public: + virtual ~hmcs400_cpu_device(); + + // configuration helpers + + // 10 4-bit R ports (port A is 2-bit) + template auto read_r() { return m_read_r[N].bind(); } + template auto write_r() { return m_write_r[N].bind(); } + + // 16-bit discrete + auto read_d() { return m_read_d.bind(); } + auto write_d() { return m_write_d.bind(); } + + // system clock divider mask option (only for HMCS408, HMCS414, HMCS424) + // valid options: 4, 8, 16, default to 8 + auto &set_divider(u8 div) { assert(m_has_div); m_divider = div; return *this; } + + // nvram + void nvram_set_battery(int state) { m_nvram_battery = bool(state); } // default is 1 (nvram_enable_backup needs to be true) + void nvram_set_default_value(u8 val) { m_nvram_defval = val & 0xf; } // default is 0 + auto stop_cb() { return m_stop_cb.bind(); } // notifier (not an output pin) + int stop_mode() { return m_stop ? 1 : 0; } + +protected: + // construction + hmcs400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size); + + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + + // device_nvram_interface implementation + virtual void nvram_default() override; + virtual bool nvram_read(util::read_stream &file) override; + virtual bool nvram_write(util::write_stream &file) override; + + // device_execute_interface implementation + virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + m_divider - 1) / m_divider; } + virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * m_divider); } + virtual u32 execute_min_cycles() const noexcept override { return 1; } + virtual u32 execute_max_cycles() const noexcept override { return 3+2; } // max 3 + interrupt + virtual void execute_set_input(int line, int state) override; + virtual void execute_run() override; + + // device_memory_interface implementation + virtual space_config_vector memory_space_config() const override; + + // device_disasm_interface implementation + virtual std::unique_ptr create_disassembler() override; + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + + // memory maps + void program_map(address_map &map); + void data_map(address_map &map); + + address_space_config m_program_config; + address_space_config m_data_config; + address_space *m_program; + address_space *m_data; + + required_shared_ptr_array m_ram; + u8 m_nvram_defval; + bool m_nvram_battery; // keeps internal RAM intact after soft power-off + + int m_icount; + int m_state_count; + + const u32 m_rom_size; // ROM size in 16-bit words + const u32 m_ram_size; // RAM size minus the 64-byte stack + bool m_has_div; // MCU supports divider mask option + u8 m_divider; // system clock divider + + u16 m_pc; // program counter + u16 m_prev_pc; + u16 m_sp; // stack pointer + u16 m_op; // current opcode + u16 m_param; // 2-byte opcode param or RAM address + u8 m_i; // 4-bit immediate opcode param + + u8 m_a; // 4-bit accumulator + u8 m_b; // 4-bit B register + u8 m_w; // 2-bit W register + u8 m_x; // 4-bit X register + u8 m_spx; // 4-bit SPX register + u8 m_y; // 4-bit Y register + u8 m_spy; // 4-bit SPY register + u8 m_st; // status flag + u8 m_ca; // carry flag + bool m_standby; // standby mode (SBY opcode) + bool m_stop; // stop mode (STOP opcode) + + u8 m_r[10]; // R outputs state + u8 m_r_mask[10]; + u16 m_d; // D pins state + u16 m_d_mask; + + u8 m_int_line[2]; // INT0/INT1 pin state + u16 m_irq_flags; // interrupt control bits + u8 m_pmr; // port mode register + u16 m_prescaler; // 11-bit clock prescaler + u8 m_timer_mode[2]; // TMA/TMB: timer mode registers + u16 m_timer_div[2]; // timer prescaler divide ratio masks from TMA/TMB + u8 m_timer_count[2]; // TCA/TCA: timer counters + u8 m_timer_load; // timer B reload register + u8 m_timer_b_low; // timer B counter low latch + + // I/O handlers + devcb_read8::array<11> m_read_r; + devcb_write8::array<11> m_write_r; + devcb_read16 m_read_d; + devcb_write16 m_write_d; + devcb_write_line m_stop_cb; + + // misc internal helpers + u8 ram_r(u8 mem_mask = 0xf); + void ram_w(u8 data, u8 mem_mask = 0xf); + void pop_stack(); + void push_stack(); + + void reset_io(); + u8 read_r(u8 index); + void write_r(u8 index, u8 data); + int read_d(u8 index); + void write_d(u8 index, int state); + + bool access_mode(u8 mem_mask, bool bit_mode = false); + u8 irq_control_r(offs_t offset, u8 mem_mask); + void irq_control_w(offs_t offset, u8 data, u8 mem_mask); + void pmr_w(offs_t offset, u8 data, u8 mem_mask); + void tm_w(offs_t offset, u8 data, u8 mem_mask); + void tlrl_w(offs_t offset, u8 data, u8 mem_mask); + void tlru_w(offs_t offset, u8 data, u8 mem_mask); + u8 tcbl_r(offs_t offset, u8 mem_mask); + u8 tcbu_r(offs_t offset, u8 mem_mask); + + void ext_int_edge(int line); + void take_interrupt(int irq); + void check_interrupts(); + void clock_timer(int timer); + void clock_prescaler(); + void cycle(); + u16 fetch(); + + // opcode handlers + void op_illegal(); + void op_todo(); + + void op_lai(); + void op_lbi(); + void op_lmi(); + void op_lmiiy(); + + void op_lab(); + void op_lba(); + void op_law(); + void op_lay(); + void op_laspx(); + void op_laspy(); + void op_lamr(); + void op_xmra(); + + void op_lwi(); + void op_lxi(); + void op_lyi(); + void op_lwa(); + void op_lxa(); + void op_lya(); + void op_iy(); + void op_dy(); + void op_ayy(); + void op_syy(); + void op_xsp(); + + void op_lam(); + void op_lbm(); + void op_lma(); + void op_lmaiy(); + void op_lmady(); + void op_xma(); + void op_xmb(); + + void op_ai(); + void op_ib(); + void op_db(); + void op_daa(); + void op_das(); + void op_nega(); + void op_comb(); + void op_rotr(); + void op_rotl(); + void op_sec(); + void op_rec(); + void op_tc(); + void op_am(); + void op_amc(); + void op_smc(); + void op_or(); + void op_anm(); + void op_orm(); + void op_eorm(); + + void op_inem(); + void op_anem(); + void op_bnem(); + void op_ynei(); + void op_ilem(); + void op_alem(); + void op_blem(); + void op_alei(); + + void op_sem(); + void op_rem(); + void op_tm(); + + void op_br(); + void op_brl(); + void op_jmpl(); + void op_cal(); + void op_call(); + void op_tbr(); + void op_rtn(); + void op_rtni(); + + void op_sed(); + void op_sedd(); + void op_red(); + void op_redd(); + void op_td(); + void op_tdd(); + void op_lar(); + void op_lbr(); + void op_lra(); + void op_lrb(); + void op_p(); + + void op_sts(); + void op_sby(); + void op_stop(); +}; + + +class hmcs402_cpu_device : public hmcs400_cpu_device +{ +protected: + hmcs402_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + +class hd614022_device : public hmcs402_cpu_device +{ +public: + hd614022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614023_device : public hmcs402_cpu_device +{ +public: + hd614023_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614025_device : public hmcs402_cpu_device +{ +public: + hd614025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614026_device : public hmcs402_cpu_device +{ +public: + hd614026_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614028_device : public hmcs402_cpu_device +{ +public: + hd614028_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614029_device : public hmcs402_cpu_device +{ +public: + hd614029_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + +class hmcs404_cpu_device : public hmcs400_cpu_device +{ +protected: + hmcs404_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + +class hd614042_device : public hmcs404_cpu_device +{ +public: + hd614042_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614043_device : public hmcs404_cpu_device +{ +public: + hd614043_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614045_device : public hmcs404_cpu_device +{ +public: + hd614045_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614046_device : public hmcs404_cpu_device +{ +public: + hd614046_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614048_device : public hmcs404_cpu_device +{ +public: + hd614048_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614049_device : public hmcs404_cpu_device +{ +public: + hd614049_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + +class hmcs408_cpu_device : public hmcs400_cpu_device +{ +protected: + hmcs408_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + +class hd614080_device : public hmcs408_cpu_device +{ +public: + hd614080_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614081_device : public hmcs408_cpu_device +{ +public: + hd614081_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614085_device : public hmcs408_cpu_device +{ +public: + hd614085_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614086_device : public hmcs408_cpu_device +{ +public: + hd614086_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614088_device : public hmcs408_cpu_device +{ +public: + hd614088_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class hd614089_device : public hmcs408_cpu_device +{ +public: + hd614089_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + +DECLARE_DEVICE_TYPE(HD614022, hd614022_device) +DECLARE_DEVICE_TYPE(HD614023, hd614023_device) +DECLARE_DEVICE_TYPE(HD614025, hd614025_device) +DECLARE_DEVICE_TYPE(HD614026, hd614026_device) +DECLARE_DEVICE_TYPE(HD614028, hd614028_device) +DECLARE_DEVICE_TYPE(HD614029, hd614029_device) + +DECLARE_DEVICE_TYPE(HD614042, hd614042_device) +DECLARE_DEVICE_TYPE(HD614043, hd614043_device) +DECLARE_DEVICE_TYPE(HD614045, hd614045_device) +DECLARE_DEVICE_TYPE(HD614046, hd614046_device) +DECLARE_DEVICE_TYPE(HD614048, hd614048_device) +DECLARE_DEVICE_TYPE(HD614049, hd614049_device) + +DECLARE_DEVICE_TYPE(HD614080, hd614080_device) +DECLARE_DEVICE_TYPE(HD614081, hd614081_device) +DECLARE_DEVICE_TYPE(HD614085, hd614085_device) +DECLARE_DEVICE_TYPE(HD614086, hd614086_device) +DECLARE_DEVICE_TYPE(HD614088, hd614088_device) +DECLARE_DEVICE_TYPE(HD614089, hd614089_device) + +#endif // MAME_CPU_HMCS400_HMCS400_H diff --git a/src/devices/cpu/hmcs400/hmcs400d.cpp b/src/devices/cpu/hmcs400/hmcs400d.cpp new file mode 100644 index 0000000000000..526053f916966 --- /dev/null +++ b/src/devices/cpu/hmcs400/hmcs400d.cpp @@ -0,0 +1,237 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Hitachi HMCS400 MCU family disassembler + +*/ + +#include "emu.h" +#include "hmcs400d.h" + +// constructor + +hmcs400_disassembler::hmcs400_disassembler() +{ +} + +hmcs400_disassembler::~hmcs400_disassembler() +{ +} + + +// common lookup tables + +enum hmcs400_disassembler::e_mnemonics : unsigned +{ + mILL1, mILL2, + mLAI, mLBI, mLMID, mLMIIY, + mLAB, mLBA, mLAW, mLAY, mLASPX, mLASPY, mLAMR, mXMRA, + mLWI, mLXI, mLYI, mLWA, mLXA, mLYA, mIY, mDY, mAYY, mSYY, mXSP, + mLAM, mLAMD, mLBM, mLMA, mLMAD, mLMAIY, mLMADY, mXMA, mXMAD, mXMB, + mAI, mIB, mDB, mDAA, mDAS, mNEGA, mCOMB, mROTR, mROTL, mSEC, mREC, mTC, + mAM, mAMD, mAMC, mAMCD, mSMC, mSMCD, mOR, mANM, mANMD, mORM, mORMD, mEORM, mEORMD, + mINEM, mINEMD, mANEM, mANEMD, mBNEM, mYNEI, mILEM, mILEMD, mALEM, mALEMD, mBLEM, mALEI, + mSEM, mSEMD, mREM, mREMD, mTM, mTMD, + mBR, mBRL, mJMPL, mCAL, mCALL, mTBR, mRTN, mRTNI, + mSED, mSEDD, mRED, mREDD, mTD, mTDD, mLAR, mLBR, mLRA, mLRB, mP, + mNOP, mSTS, mSBY, mSTOP +}; + +const char *const hmcs400_disassembler::s_mnemonics[] = +{ + "?", "?", + "LAI", "LBI", "LMID", "LMIIY", + "LAB", "LBA", "LAW", "LAY", "LASPX", "LASPY", "LAMR", "XMRA", + "LWI", "LXI", "LYI", "LWA", "LXA", "LYA", "IY", "DY", "AYY", "SYY", "XSP", + "LAM", "LAMD", "LBM", "LMA", "LMAD", "LMAIY", "LMADY", "XMA", "XMAD", "XMB", + "AI", "IB", "DB", "DAA", "DAS", "NEGA", "COMB", "ROTR", "ROTL", "SEC", "REC", "TC", + "AM", "AMD", "AMC", "AMCD", "SMC", "SMCD", "OR", "ANM", "ANMD", "ORM", "ORMD", "EORM", "EORMD", + "INEM", "INEMD", "ANEM", "ANEMD", "BNEM", "YNEI", "ILEM", "ILEMD", "ALEM", "ALEMD", "BLEM", "ALEI", + "SEM", "SEMD", "REM", "REMD", "TM", "TMD", + "BR", "BRL", "JMPL", "CAL", "CALL", "TBR", "RTN", "RTNI", + "SED", "SEDD", "RED", "REDD", "TD", "TDD", "LAR", "LBR", "LRA", "LRB", "P", + "NOP", "STS", "SBY", "STOP" +}; + +// number of bits per opcode parameter, 99 means (XY) parameter +const s8 hmcs400_disassembler::s_bits[] = +{ + 0, 10, + 4, 4, 14, 4, + 0, 0, 10, 0, 0, 0, 4, 4, + 2, 4, 4, 10, 0, 0, 0, 0, 0, 0, 99, + 99, 10, 99, 99, 10, 99, 99, 99, 10, 99, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 10, 0, 10, 0, 10, 0, 0, 10, 0, 10, 0, 10, + 4, 14, 0, 10, 0, 4, 4, 14, 0, 10, 0, 4, + 2, 12, 2, 12, 2, 12, + 8, 14, 14, 6, 14, 4, 0, 0, + 0, 4, 0, 4, 0, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0 +}; + +const u32 hmcs400_disassembler::s_flags[] = +{ + 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, 0, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, 0, STEP_OUT, STEP_OUT, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; + +const u8 hmcs400_disassembler::hmcs400_mnemonic[0x400] = +{ +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + // 0x000 + mNOP, mXSP, mXSP, mXSP, mANEM, 0, 0, 0, mAM, 0, 0, 0, mORM, 0, 0, 0, + mRTN, mRTNI, 0, 0, mALEM, 0, 0, 0, mAMC, 0, 0, 0, mEORM, 0, 0, 0, + mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, mINEM, + mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, mILEM, + // 0x040 + mLBM, mLBM, mLBM, mLBM, mBNEM, 0, 0, 0, mLAB, 0, 0, 0, mIB, 0, 0, 0, + mLMAIY,mLMAIY,0, 0, mAYY, 0, 0, 0, mLASPY,0, 0, 0, mIY, 0, 0, 0, + mNEGA, 0, 0, 0, mRED, 0, 0, 0, mLASPX,0, 0, 0, 0, 0, 0, mTC, + mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, + // 0x080 + mXMA, mXMA, mXMA, mXMA, mSEM, mSEM, mSEM, mSEM, mREM, mREM, mREM, mREM, mTM, mTM, mTM, mTM, + mLAM, mLAM, mLAM, mLAM, mLMA, mLMA, mLMA, mLMA, mSMC, 0, 0, 0, mANM, 0, 0, 0, + mROTR, mROTL, 0, 0, 0, 0, mDAA, 0, 0, 0, mDAS, 0, 0, 0, 0, mLAY, + mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, + // 0x0c0 + mXMB, mXMB, mXMB, mXMB, mBLEM, 0, 0, 0, mLBA, 0, 0, 0, 0, 0, 0, mDB, + mLMADY,mLMADY,0, 0, mSYY, 0, 0, 0, mLYA, 0, 0, 0, 0, 0, 0, mDY, + mTD, 0, 0, 0, mSED, 0, 0, 0, mLXA, 0, 0, 0, mREC, 0, 0, mSEC, + mLWI, mLWI, mLWI, mLWI, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + // 0x100 + mLAW, 1, 1, 1, mANEMD,1, 1, 1, mAMD, 1, 1, 1, mORMD, 1, 1, 1, + mLWA, 1, 1, 1, mALEMD,1, 1, 1, mAMCD, 1, 1, 1, mEORMD,1, 1, 1, + mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD,mINEMD, + mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD,mILEMD, + // 0x140 + mCOMB, 0, 0, 0, mOR, 0, 0, 0, mSTS, 0, 0, 0, mSBY, mSTOP, 0, 0, + mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, mJMPL, + mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, mCALL, + mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, mBRL, + // 0x180 + mXMAD, 1, 1, 1, mSEMD, mSEMD, mSEMD, mSEMD, mREMD, mREMD, mREMD, mREMD, mTMD, mTMD, mTMD, mTMD, + mLAMD, 1, 1, 1, mLMAD, 1, 1, 1, mSMCD, 1, 1, 1, mANMD, 1, 1, 1, + mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, mLMID, + mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, mP, + // 0x1c0 + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + // 0x200 + mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, + mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, + mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, + mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, + // 0x240 + mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, + mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, + mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, + mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, mLAMR, + // 0x280 + mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, + mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY, + mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, mTDD, + mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, + // 0x2c0 + mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, + mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, + mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, + mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, mXMRA, + +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + // 0x300 + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + // 0x340 + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + // 0x380 + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + // 0x3c0 + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR +}; + + +// disasm + +offs_t hmcs400_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + u16 op = opcodes.r16(pc++) & 0x3ff; + u8 instr = hmcs400_mnemonic[op]; + u8 bits = s_bits[instr]; + int len = 1; + + // special case for (XY) opcode + if (bits == 99) + { + util::stream_format(stream, "%s", s_mnemonics[instr]); + + if (op & 1) + stream << "X"; + if (op & 2) + stream << "Y"; + } + else + { + util::stream_format(stream, "%-8s", s_mnemonics[instr]); + + // opcode parameter + if (bits != 0) + { + u16 param1 = op & ((1 << (bits % 10)) - 1); + u16 param2 = 0; + if (bits >= 10) + { + len++; + param2 = params.r16(pc++) & 0x3ff; + } + + if (instr >= mBR && instr <= mCALL) + { + if (instr == mBR) + param1 |= pc & 0x3f00; + else if (instr != mCAL) + param1 = param1 << 10 | param2; + util::stream_format(stream, "$%04X", param1); // ROM address + } + else if (instr != mILL2 && instr != mLAW && instr != mLWA) + { + if (bits != 10) + util::stream_format(stream, (param1 < 10) ? "%d" : "$%X", param1); + if (bits > 10) + stream << ","; + if (bits >= 10) + util::stream_format(stream, "$%03X", param2); // RAM address + } + } + } + + return len | s_flags[instr] | SUPPORTED; +} diff --git a/src/devices/cpu/hmcs400/hmcs400d.h b/src/devices/cpu/hmcs400/hmcs400d.h new file mode 100644 index 0000000000000..f9395cb9d14cb --- /dev/null +++ b/src/devices/cpu/hmcs400/hmcs400d.h @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Hitachi HMCS400 MCU family disassembler + +*/ + +#ifndef MAME_CPU_HMCS400_HMCS400D_H +#define MAME_CPU_HMCS400_HMCS400D_H + +#pragma once + +class hmcs400_disassembler : public util::disasm_interface +{ +public: + hmcs400_disassembler(); + virtual ~hmcs400_disassembler(); + + virtual u32 opcode_alignment() const override { return 1; } + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + enum e_mnemonics : unsigned; + static const char *const s_mnemonics[]; + static const s8 s_bits[]; + static const u32 s_flags[]; + static const u8 hmcs400_mnemonic[0x400]; +}; + +#endif // MAME_CPU_HMCS400_HMCS400D_H diff --git a/src/devices/cpu/hmcs400/hmcs400op.cpp b/src/devices/cpu/hmcs400/hmcs400op.cpp new file mode 100644 index 0000000000000..ec7643f91937b --- /dev/null +++ b/src/devices/cpu/hmcs400/hmcs400op.cpp @@ -0,0 +1,692 @@ +// license:BSD-3-Clause +// copyright-holders:hap + +// HMCS400 opcode handlers + +#include "emu.h" +#include "hmcs400.h" + + +// internal helpers + +inline u8 hmcs400_cpu_device::ram_r(u8 mem_mask) +{ + return m_data->read_byte(m_param & 0x3ff, mem_mask & 0xf) & 0xf; +} + +inline void hmcs400_cpu_device::ram_w(u8 data, u8 mem_mask) +{ + m_data->write_byte(m_param & 0x3ff, data & 0xf, mem_mask & 0xf); +} + +void hmcs400_cpu_device::pop_stack() +{ + u16 data = 0; + for (int i = 0; i < 4; i++) + { + m_sp = ((m_sp + 1) | 0x3c0) & 0x3ff; + data = data << 4 | (m_data->read_byte(m_sp) & 0xf); + } + + if (m_op & 1) + { + // RTNI restores CA and ST + m_ca = BIT(data, 7); + m_st = BIT(data, 15); + } + m_pc = (data & 0x7f00) >> 1 | (data & 0x7f); +} + +void hmcs400_cpu_device::push_stack() +{ + u16 data = (m_pc << 1 & 0x7f00) | (m_pc & 0x7f) | m_ca << 7 | m_st << 15; + m_sp = (m_sp | 0x3c0) & 0x3ff; + + for (int i = 0; i < 4; i++) + { + m_data->write_byte(m_sp, data & 0xf); + data >>= 4; + m_sp = ((m_sp - 1) | 0x3c0) & 0x3ff; + } +} + + +// instruction set + +void hmcs400_cpu_device::op_illegal() +{ + logerror("unknown opcode $%03X @ $%04X\n", m_op, m_prev_pc); +} + +void hmcs400_cpu_device::op_todo() +{ + logerror("unimplemented opcode $%03X @ $%04X\n", m_op, m_prev_pc); +} + + +// immediate instructions + +void hmcs400_cpu_device::op_lai() +{ + // LAI i: Load A from Immediate + m_a = m_i; +} + +void hmcs400_cpu_device::op_lbi() +{ + // LBI i: Load B from Immediate + m_b = m_i; +} + +void hmcs400_cpu_device::op_lmi() +{ + // LMID i,d: Load Memory from Immediate + ram_w(m_i); +} + +void hmcs400_cpu_device::op_lmiiy() +{ + // LMIIY i: Load Memory from Immediate, Increment Y + op_lmi(); + op_iy(); +} + + +// register-to-register instructions + +void hmcs400_cpu_device::op_lab() +{ + // LAB: Load A from B + m_a = m_b; +} + +void hmcs400_cpu_device::op_lba() +{ + // LBA: Load B from A + m_b = m_a; +} + +void hmcs400_cpu_device::op_law() +{ + // LAW: Load A from W + m_a = m_w; +} + +void hmcs400_cpu_device::op_lay() +{ + // LAY: Load A from Y + m_a = m_y; +} + +void hmcs400_cpu_device::op_laspx() +{ + // LASPX: Load A from SPX + m_a = m_spx; +} + +void hmcs400_cpu_device::op_laspy() +{ + // LASPY: Load A from SPY + m_a = m_spy; +} + +void hmcs400_cpu_device::op_lamr() +{ + // LAMR m: Load A from MR + m_param = 0x20 | m_i; + m_a = ram_r(); +} + +void hmcs400_cpu_device::op_xmra() +{ + // XMRA m: Exchange MR and A + m_param = 0x20 | m_i; + u8 old_a = m_a; + m_a = ram_r(); + ram_w(old_a); +} + + +// RAM address instructions + +void hmcs400_cpu_device::op_lwi() +{ + // LWI i: Load W from Immediate + m_w = m_i; +} + +void hmcs400_cpu_device::op_lxi() +{ + // LXI i: Load X from Immediate + m_x = m_i; +} + +void hmcs400_cpu_device::op_lyi() +{ + // LYI i: Load Y from Immediate + m_y = m_i; +} + +void hmcs400_cpu_device::op_lwa() +{ + // LWA: Load W from A + m_w = m_a & 3; +} + +void hmcs400_cpu_device::op_lxa() +{ + // LXA: Load X from A + m_x = m_a; +} + +void hmcs400_cpu_device::op_lya() +{ + // LYA: Load Y from A + m_y = m_a; +} + +void hmcs400_cpu_device::op_iy() +{ + // IY: Increment Y + m_y = (m_y + 1) & 0xf; + m_st = (m_y != 0); +} + +void hmcs400_cpu_device::op_dy() +{ + // DY: Decrement Y + m_y = (m_y - 1) & 0xf; + m_st = (m_y != 0xf); +} + +void hmcs400_cpu_device::op_ayy() +{ + // AYY: Add A to Y + m_y += m_a; + m_st = BIT(m_y, 4); + m_y &= 0xf; +} + +void hmcs400_cpu_device::op_syy() +{ + // SYY: Subtract A from Y + m_y -= m_a; + m_st = BIT(~m_y, 4); + m_y &= 0xf; +} + +void hmcs400_cpu_device::op_xsp() +{ + // XSP(XY): Exchange X and SPX, Y and SPY, or NOP if 0 + if (m_op & 1) + { + u8 old_x = m_x; + m_x = m_spx; + m_spx = old_x; + } + if (m_op & 2) + { + u8 old_y = m_y; + m_y = m_spy; + m_spy = old_y; + } +} + + +// RAM register instructions + +void hmcs400_cpu_device::op_lam() +{ + // LAM(XY) / LAMD d: Load A from Memory + m_a = ram_r(); + op_xsp(); +} + +void hmcs400_cpu_device::op_lbm() +{ + // LBM(XY): Load B from Memory + m_b = ram_r(); + op_xsp(); +} + +void hmcs400_cpu_device::op_lma() +{ + // LMA(XY) / LMAD d: Load Memory from A + ram_w(m_a); + op_xsp(); +} + +void hmcs400_cpu_device::op_lmaiy() +{ + // LMAIY(X): Load Memory from A, Increment Y + op_lma(); + op_iy(); +} + +void hmcs400_cpu_device::op_lmady() +{ + // LMADY(X): Load Memory from A, Decrement Y + op_lma(); + op_dy(); +} + +void hmcs400_cpu_device::op_xma() +{ + // XMA(XY) / XMAD d: Exchange Memory and A + u8 old_a = m_a; + m_a = ram_r(); + ram_w(old_a); + op_xsp(); +} + +void hmcs400_cpu_device::op_xmb() +{ + // XMB(XY): Exchange Memory and B + u8 old_b = m_b; + m_b = ram_r(); + ram_w(old_b); + op_xsp(); +} + + +// arithmetic instructions + +void hmcs400_cpu_device::op_ai() +{ + // AI i: Add Immediate to A + m_a += m_i; + m_st = BIT(m_a, 4); + m_a &= 0xf; +} + +void hmcs400_cpu_device::op_ib() +{ + // IB: Increment B + m_b = (m_b + 1) & 0xf; + m_st = (m_b != 0); +} + +void hmcs400_cpu_device::op_db() +{ + // DB: Decrement B + m_b = (m_b - 1) & 0xf; + m_st = (m_b != 0xf); +} + +void hmcs400_cpu_device::op_daa() +{ + // DAA: Decimal Adjust for Addition + if (m_ca || m_a > 9) + { + m_a = (m_a + 6) & 0xf; + m_ca = 1; + } +} + +void hmcs400_cpu_device::op_das() +{ + // DAS: Decimal Adjust for Subtraction + if (!m_ca || m_a > 9) + { + m_a = (m_a + 10) & 0xf; + m_ca = 0; + } +} + +void hmcs400_cpu_device::op_nega() +{ + // NEGA: Negate A + m_a = (0 - m_a) & 0xf; +} + +void hmcs400_cpu_device::op_comb() +{ + // COMB: Complement B + m_b ^= 0xf; +} + +void hmcs400_cpu_device::op_rotr() +{ + // ROTR: Rotate Right with Carry + u8 ca = m_a & 1; + m_a = m_a >> 1 | m_ca << 3; + m_ca = ca; +} + +void hmcs400_cpu_device::op_rotl() +{ + // ROTL: Rotate Left with Carry + m_a = m_a << 1 | m_ca; + m_ca = BIT(m_a, 4); + m_a &= 0xf; +} + +void hmcs400_cpu_device::op_sec() +{ + // SEC: Set Carry + m_ca = 1; +} + +void hmcs400_cpu_device::op_rec() +{ + // REC: Reset Carry + m_ca = 0; +} + +void hmcs400_cpu_device::op_tc() +{ + // TC: Test Carry + m_st = m_ca; +} + +void hmcs400_cpu_device::op_am() +{ + // AM / AMD d: Add A to Memory + m_a += ram_r(); + m_st = BIT(m_a, 4); + m_a &= 0xf; +} + +void hmcs400_cpu_device::op_amc() +{ + // AMC / AMCD d: Add A to Memory with Carry + m_a += ram_r() + m_ca; + m_ca = BIT(m_a, 4); + m_st = m_ca; + m_a &= 0xf; +} + +void hmcs400_cpu_device::op_smc() +{ + // SMC / SMCD d: Subtract A from Memory with Carry + m_a = ram_r() - m_a - (m_ca ^ 1); + m_ca = BIT(~m_a, 4); + m_st = m_ca; + m_a &= 0xf; +} + +void hmcs400_cpu_device::op_or() +{ + // OR: Or A with B + m_a |= m_b; +} + +void hmcs400_cpu_device::op_anm() +{ + // ANM / ANMD d: And Memory with A + m_a &= ram_r(); + m_st = (m_a != 0); +} + +void hmcs400_cpu_device::op_orm() +{ + // ORM / ORMD d: Or Memory with A + m_a |= ram_r(); + m_st = (m_a != 0); +} + +void hmcs400_cpu_device::op_eorm() +{ + // EORM / EORMD d: Exclusive Or Memory with A + m_a ^= ram_r(); + m_st = (m_a != 0); +} + + +// compare instructions + +void hmcs400_cpu_device::op_inem() +{ + // INEM i / INEMD i,d: Immediate Not Equal to Memory + m_st = (m_i != ram_r()); +} + +void hmcs400_cpu_device::op_anem() +{ + // ANEM / ANEMD d: A Not Equal to Memory + m_st = (m_a != ram_r()); +} + +void hmcs400_cpu_device::op_bnem() +{ + // BNEM: B Not Equal to Memory + m_st = (m_b != ram_r()); +} + +void hmcs400_cpu_device::op_ynei() +{ + // YNEI i: Y Not Equal to Immediate + m_st = (m_y != m_i); +} + +void hmcs400_cpu_device::op_ilem() +{ + // ILEM i / ILEMD i,d: Immediate Less or Equal to Memory + m_st = (m_i <= ram_r()); +} + +void hmcs400_cpu_device::op_alem() +{ + // ALEM / ALEMD d: A Less or Equal to Memory + m_st = (m_a <= ram_r()); +} + +void hmcs400_cpu_device::op_blem() +{ + // BLEM: B Less or Equal to Memory + m_st = (m_b <= ram_r()); +} + +void hmcs400_cpu_device::op_alei() +{ + // ALEI i: A Less or Equal to Immediate + m_st = (m_a <= m_i); +} + + +// RAM bit manipulation instructions + +void hmcs400_cpu_device::op_sem() +{ + // SEM n / SEMD n,d: Set Memory Bit + u8 mask = 1 << (m_op & 3); + ram_w(ram_r(~mask) | mask, mask); +} + +void hmcs400_cpu_device::op_rem() +{ + // REM n / REMD n,d: Reset Memory Bit + u8 mask = 1 << (m_op & 3); + ram_w(ram_r(~mask) & ~mask, mask); +} + +void hmcs400_cpu_device::op_tm() +{ + // TM n / TMD n,d: Test Memory Bit + u8 mask = 1 << (m_op & 3); + m_st = (ram_r(mask) & mask) ? 1 : 0; +} + + +// ROM address instructions + +void hmcs400_cpu_device::op_br() +{ + // BR b: Branch on Status 1 + if (m_st) + m_pc = (m_pc & ~0xff) | (m_op & 0xff); + else + m_st = 1; +} + +void hmcs400_cpu_device::op_brl() +{ + // BRL u: Long Branch on Status 1 + if (m_st) + op_jmpl(); + else + m_st = 1; +} + +void hmcs400_cpu_device::op_jmpl() +{ + // JMPL u: Long Jump Unconditionally + m_pc = m_i << 10 | m_param; +} + +void hmcs400_cpu_device::op_cal() +{ + // CAL a: Subroutine Jump on Status 1 + if (m_st) + { + cycle(); + push_stack(); + m_pc = m_op & 0x3f; + } + else + m_st = 1; +} + +void hmcs400_cpu_device::op_call() +{ + // CALL u: Long Subroutine Jump on Status 1 + if (m_st) + { + push_stack(); + op_jmpl(); + } + else + m_st = 1; +} + +void hmcs400_cpu_device::op_tbr() +{ + // TBR p: Table Branch + m_pc = m_i << 8 | m_b << 4 | m_a; +} + +void hmcs400_cpu_device::op_rtn() +{ + // RTN: Return from Subroutine + cycle(); + cycle(); + pop_stack(); +} + +void hmcs400_cpu_device::op_rtni() +{ + // RTNI: Return from Interrupt + op_rtn(); + m_irq_flags |= 1; +} + + +// input/output instructions + +void hmcs400_cpu_device::op_sed() +{ + // SED: Set Discrete I/O Latch + write_d(m_y, 1); +} + +void hmcs400_cpu_device::op_sedd() +{ + // SEDD m: Set Discrete I/O Latch Direct + write_d(m_i, 1); +} + +void hmcs400_cpu_device::op_red() +{ + // RED: Reset Discrete I/O Latch + write_d(m_y, 0); +} + +void hmcs400_cpu_device::op_redd() +{ + // REDD m: Reset Discrete I/O Latch Direct + write_d(m_i, 0); +} + +void hmcs400_cpu_device::op_td() +{ + // TD: Test Discrete I/O Latch + m_st = read_d(m_y); +} + +void hmcs400_cpu_device::op_tdd() +{ + // TDD m: Test Discrete I/O Latch Direct + m_st = read_d(m_i); +} + +void hmcs400_cpu_device::op_lar() +{ + // LAR m: Load A from R Port Register + m_a = read_r(m_i); +} + +void hmcs400_cpu_device::op_lbr() +{ + // LBR m: Load B from R Port Register + m_b = read_r(m_i); +} + +void hmcs400_cpu_device::op_lra() +{ + // LRA m: Load R Port Register from A + write_r(m_i, m_a); +} + +void hmcs400_cpu_device::op_lrb() +{ + // LRB m: Load R Port Register from B + write_r(m_i, m_b); +} + +void hmcs400_cpu_device::op_p() +{ + // P p: Pattern Generation + cycle(); + u16 data = m_program->read_word(m_i << 8 | m_b << 4 | m_a); + + // destination is determined by the 2 highest bits + if (data & 0x100) + { + // to A/B registers + m_a = data & 0xf; + m_b = data >> 4 & 0xf; + } + if (data & 0x200) + { + // to R1/R2 ports + write_r(1, data & 0xf); + write_r(2, data >> 4 & 0xf); + } +} + + +// control instructions + +void hmcs400_cpu_device::op_sts() +{ + // STS: Start Serial + op_todo(); +} + +void hmcs400_cpu_device::op_sby() +{ + // SBY: Standby Mode + m_standby = true; +} + +void hmcs400_cpu_device::op_stop() +{ + // STOP: Stop Mode + m_stop = true; + + if (m_icount > 0) + m_icount = 0; + + // all I/O pins go high-impedance + m_stop_cb(1); +} diff --git a/src/devices/cpu/hphybrid/hphybrid.h b/src/devices/cpu/hphybrid/hphybrid.h index 48b8e37b59caa..0ab0071f26772 100644 --- a/src/devices/cpu/hphybrid/hphybrid.h +++ b/src/devices/cpu/hphybrid/hphybrid.h @@ -103,7 +103,6 @@ class hp_hybrid_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return m_r_cycles; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/ht1130/ht1130.h b/src/devices/cpu/ht1130/ht1130.h index f500ef7553aa5..1f2f9b030b6f0 100644 --- a/src/devices/cpu/ht1130/ht1130.h +++ b/src/devices/cpu/ht1130/ht1130.h @@ -45,7 +45,6 @@ class ht1130_device : public cpu_device virtual void device_reset() override; virtual void execute_run() override; - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == HT1130_EXT_WAKEUP_LINE; } virtual void execute_set_input(int inputnum, int state) override; virtual u32 execute_max_cycles() const noexcept override { return 2; } diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h index b932c75866ff9..e165e8e2606d4 100644 --- a/src/devices/cpu/i386/i386.h +++ b/src/devices/cpu/i386/i386.h @@ -52,7 +52,6 @@ class i386_device : public cpu_device, public device_vtlb_interface, public i386 // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 40; } - virtual uint32_t execute_input_lines() const noexcept override { return 32; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/i8085/i8085.h b/src/devices/cpu/i8085/i8085.h index 711f6add7ff59..6b8755210c685 100644 --- a/src/devices/cpu/i8085/i8085.h +++ b/src/devices/cpu/i8085/i8085.h @@ -72,7 +72,6 @@ class i8085a_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 4; } virtual u32 execute_max_cycles() const noexcept override { return 16; } - virtual u32 execute_input_lines() const noexcept override { return 4; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == I8085_RST75_LINE; } virtual void execute_run() override; @@ -177,7 +176,6 @@ class i8080_cpu_device : public i8085a_cpu_device protected: i8080_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return clocks; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return cycles; } diff --git a/src/devices/cpu/i86/i186.h b/src/devices/cpu/i86/i186.h index 9683bf8336b90..72a3eb008e8ae 100644 --- a/src/devices/cpu/i86/i186.h +++ b/src/devices/cpu/i86/i186.h @@ -71,7 +71,6 @@ class i80186_cpu_device : public i8086_common_cpu_device virtual void execute_run() override; virtual void device_start() override; virtual void device_reset() override; - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual uint8_t fetch() override; uint32_t update_pc() { return m_pc = (m_sregs[CS] << 4) + m_ip; } diff --git a/src/devices/cpu/i86/i286.h b/src/devices/cpu/i86/i286.h index 78b1f1d6b0306..383d0a6adb978 100644 --- a/src/devices/cpu/i86/i286.h +++ b/src/devices/cpu/i86/i286.h @@ -97,7 +97,6 @@ class i80286_cpu_device : public i8086_common_cpu_device virtual void state_import(const device_state_entry &entry) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_set_input(int inputnum, int state) override; bool memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) override; diff --git a/src/devices/cpu/i86/i86.h b/src/devices/cpu/i86/i86.h index 8999fb5b26090..917cac19dea49 100644 --- a/src/devices/cpu/i86/i86.h +++ b/src/devices/cpu/i86/i86.h @@ -359,7 +359,6 @@ class i8086_cpu_device : public i8086_common_cpu_device virtual void execute_run() override; virtual void device_start() override; - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual uint8_t fetch() override; inline address_space *sreg_to_space(int sreg) const; virtual uint8_t read_byte(uint32_t addr) override; diff --git a/src/devices/cpu/i860/i860.h b/src/devices/cpu/i860/i860.h index 3f37dda5b8775..942880a38343c 100644 --- a/src/devices/cpu/i860/i860.h +++ b/src/devices/cpu/i860/i860.h @@ -58,7 +58,6 @@ class i860_cpu_device : public cpu_device I860_F10, I860_F11, I860_F12, I860_F13, I860_F14, I860_F15, I860_F16, I860_F17, I860_F18, I860_F19, I860_F20, I860_F21, I860_F22, I860_F23, I860_F24, I860_F25, I860_F26, I860_F27, I860_F28, I860_F29, I860_F30, I860_F31 - }; @@ -69,7 +68,6 @@ class i860_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 8; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/i960/i960.h b/src/devices/cpu/i960/i960.h index 1efab1d328aab..ca7678c941830 100644 --- a/src/devices/cpu/i960/i960.h +++ b/src/devices/cpu/i960/i960.h @@ -87,7 +87,6 @@ class i960_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } /* ???? TODO: Exact timing unknown */ virtual uint32_t execute_max_cycles() const noexcept override { return 1; } /* ???? TODO: Exact timing unknown */ - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/jaguar/jaguar.h b/src/devices/cpu/jaguar/jaguar.h index 90533c3bc7c53..34dff918fbe42 100644 --- a/src/devices/cpu/jaguar/jaguar.h +++ b/src/devices/cpu/jaguar/jaguar.h @@ -74,7 +74,6 @@ class jaguar_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual u32 execute_input_lines() const noexcept override { return 5; } virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides @@ -292,7 +291,6 @@ class jaguardsp_cpu_device : public jaguar_cpu_device void io_map(address_map &map); protected: - virtual u32 execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual std::unique_ptr create_disassembler() override; diff --git a/src/devices/cpu/ks0164/ks0164.cpp b/src/devices/cpu/ks0164/ks0164.cpp index 436415f1b34a4..1dce547896e71 100644 --- a/src/devices/cpu/ks0164/ks0164.cpp +++ b/src/devices/cpu/ks0164/ks0164.cpp @@ -58,11 +58,6 @@ uint32_t ks0164_cpu_device::execute_max_cycles() const noexcept return 5; } -uint32_t ks0164_cpu_device::execute_input_lines() const noexcept -{ - return 16; -} - void ks0164_cpu_device::execute_set_input(int inputnum, int state) { if(state) diff --git a/src/devices/cpu/ks0164/ks0164.h b/src/devices/cpu/ks0164/ks0164.h index 1df7e6f5e4b8f..9cf77af727488 100644 --- a/src/devices/cpu/ks0164/ks0164.h +++ b/src/devices/cpu/ks0164/ks0164.h @@ -42,7 +42,6 @@ class ks0164_cpu_device : public cpu_device virtual void device_reset() override; virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/lc8670/lc8670.h b/src/devices/cpu/lc8670/lc8670.h index a00658a7d4d34..a6c443958bc08 100644 --- a/src/devices/cpu/lc8670/lc8670.h +++ b/src/devices/cpu/lc8670/lc8670.h @@ -97,7 +97,6 @@ class lc8670_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/lh5801/lh5801.h b/src/devices/cpu/lh5801/lh5801.h index 68c028289af38..5f77658ab471d 100644 --- a/src/devices/cpu/lh5801/lh5801.h +++ b/src/devices/cpu/lh5801/lh5801.h @@ -79,7 +79,6 @@ class lh5801_cpu_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 19; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == LH5801_LINE_MI || inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/lr35902/lr35902.h b/src/devices/cpu/lr35902/lr35902.h index f723213137ce0..578e975cfcee2 100644 --- a/src/devices/cpu/lr35902/lr35902.h +++ b/src/devices/cpu/lr35902/lr35902.h @@ -70,7 +70,6 @@ class lr35902_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 16; } - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/m37710/m37710.h b/src/devices/cpu/m37710/m37710.h index 6d09957b38ada..da888632f3e39 100644 --- a/src/devices/cpu/m37710/m37710.h +++ b/src/devices/cpu/m37710/m37710.h @@ -210,7 +210,6 @@ class m37710_cpu_device : public cpu_device, public m7700_disassembler::config virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 20; /* rough guess */ } - virtual uint32_t execute_input_lines() const noexcept override { return M37710_LINE_MAX; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index c704a114e5e98..105ae863785b7 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -140,11 +140,6 @@ uint32_t m6502_device::execute_max_cycles() const noexcept return 10; } -uint32_t m6502_device::execute_input_lines() const noexcept -{ - return NMI_LINE+1; -} - bool m6502_device::execute_input_edge_triggered(int inputnum) const noexcept { return inputnum == NMI_LINE || inputnum == V_LINE; diff --git a/src/devices/cpu/m6502/m6502.h b/src/devices/cpu/m6502/m6502.h index 0e0864f888166..6d490e98af613 100644 --- a/src/devices/cpu/m6502/m6502.h +++ b/src/devices/cpu/m6502/m6502.h @@ -101,7 +101,6 @@ class m6502_device : public cpu_device { virtual bool cpu_is_interruptible() const override { return true; } virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override; diff --git a/src/devices/cpu/m6800/m6800.h b/src/devices/cpu/m6800/m6800.h index 4cddbaa9e34dc..427db624aa749 100644 --- a/src/devices/cpu/m6800/m6800.h +++ b/src/devices/cpu/m6800/m6800.h @@ -48,7 +48,6 @@ class m6800_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 12; } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_one(); diff --git a/src/devices/cpu/m6800/m6801.h b/src/devices/cpu/m6800/m6801.h index 12d618856c2b3..e7799f4807d9f 100644 --- a/src/devices/cpu/m6800/m6801.h +++ b/src/devices/cpu/m6800/m6801.h @@ -83,7 +83,6 @@ class m6801_cpu_device : public m6800_cpu_device, public device_nvram_interface // device_execute_interface implementation virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } - virtual u32 execute_input_lines() const noexcept override { return 6; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return m6800_cpu_device::execute_input_edge_triggered(inputnum) || inputnum == M6801_STBY_LINE; } virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/m68000/m68kcommon.h b/src/devices/cpu/m68000/m68kcommon.h index 86cb0bc18e671..604cd97ad5267 100644 --- a/src/devices/cpu/m68000/m68kcommon.h +++ b/src/devices/cpu/m68000/m68kcommon.h @@ -54,7 +54,6 @@ class m68000_base_device : public cpu_device void set_interrupt_mixer(bool enable) { m_interrupt_mixer = enable; } auto reset_cb() { return m_reset_cb.bind(); } - virtual u32 execute_input_lines() const noexcept override { return m_interrupt_mixer ? 8 : 3; } // number of input lines virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return m_interrupt_mixer ? inputnum == M68K_IRQ_7 : false; } virtual bool supervisor_mode() const noexcept = 0; diff --git a/src/devices/cpu/m68000/tmp68301.cpp b/src/devices/cpu/m68000/tmp68301.cpp index 5063f50413840..20813bb9dbd93 100644 --- a/src/devices/cpu/m68000/tmp68301.cpp +++ b/src/devices/cpu/m68000/tmp68301.cpp @@ -513,11 +513,6 @@ void tmp68301_device::ieir_w(u8 data) } -u32 tmp68301_device::execute_input_lines() const noexcept -{ - return 10; -} - void tmp68301_device::execute_set_input(int inputnum, int state) { int prev_state = (m_external_interrupt_state >> inputnum) & 1; diff --git a/src/devices/cpu/m68000/tmp68301.h b/src/devices/cpu/m68000/tmp68301.h index aa49f1674ae42..2e308afa6acda 100644 --- a/src/devices/cpu/m68000/tmp68301.h +++ b/src/devices/cpu/m68000/tmp68301.h @@ -35,7 +35,6 @@ class tmp68301_device : public m68000_mcu_device void device_start() override; void device_reset() override; - u32 execute_input_lines() const noexcept override; void execute_set_input(int inputnum, int state) override; void internal_update(uint64_t current_time = 0) override; diff --git a/src/devices/cpu/m6805/m6805.cpp b/src/devices/cpu/m6805/m6805.cpp index c949cb21b23b5..7c93afbd25489 100644 --- a/src/devices/cpu/m6805/m6805.cpp +++ b/src/devices/cpu/m6805/m6805.cpp @@ -581,17 +581,6 @@ uint32_t m6805_base_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t m6805_base_device::execute_input_lines() const noexcept -{ - return 9; -} - - /* execute instructions on this CPU until icount expires */ void m6805_base_device::execute_run() { diff --git a/src/devices/cpu/m6805/m6805.h b/src/devices/cpu/m6805/m6805.h index 99f71504c8db5..1153fe87f5650 100644 --- a/src/devices/cpu/m6805/m6805.h +++ b/src/devices/cpu/m6805/m6805.h @@ -132,7 +132,6 @@ class m6805_base_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override; diff --git a/src/devices/cpu/m6809/m6809.cpp b/src/devices/cpu/m6809/m6809.cpp index 83e4662a85521..ec72856ec2fb3 100644 --- a/src/devices/cpu/m6809/m6809.cpp +++ b/src/devices/cpu/m6809/m6809.cpp @@ -451,17 +451,6 @@ uint32_t m6809_base_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t m6809_base_device::execute_input_lines() const noexcept -{ - return 3; -} - - //------------------------------------------------- // execute_set_input - act on a changed input/ // interrupt line diff --git a/src/devices/cpu/m6809/m6809.h b/src/devices/cpu/m6809/m6809.h index df9f74d18823d..6a05ab1628009 100644 --- a/src/devices/cpu/m6809/m6809.h +++ b/src/devices/cpu/m6809/m6809.h @@ -62,7 +62,6 @@ class m6809_base_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } diff --git a/src/devices/cpu/mb86233/mb86233.h b/src/devices/cpu/mb86233/mb86233.h index 34dac1407c096..5609de4910265 100644 --- a/src/devices/cpu/mb86233/mb86233.h +++ b/src/devices/cpu/mb86233/mb86233.h @@ -75,7 +75,6 @@ class mb86233_device : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual void execute_run() override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/mb86235/mb86235.h b/src/devices/cpu/mb86235/mb86235.h index c859807bf569f..c8a97cf452e15 100644 --- a/src/devices/cpu/mb86235/mb86235.h +++ b/src/devices/cpu/mb86235/mb86235.h @@ -61,7 +61,6 @@ class mb86235_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; //virtual void execute_set_input(int inputnum, int state); diff --git a/src/devices/cpu/mb88xx/mb88xx.h b/src/devices/cpu/mb88xx/mb88xx.h index 9c21d99906e83..58c3105e37c43 100644 --- a/src/devices/cpu/mb88xx/mb88xx.h +++ b/src/devices/cpu/mb88xx/mb88xx.h @@ -116,7 +116,6 @@ class mb88_cpu_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 3; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 6 - 1) / 6; } diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h index 75c12c1455c7f..6e08e2c44fc7f 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.h +++ b/src/devices/cpu/mc68hc11/mc68hc11.h @@ -62,7 +62,6 @@ class mc68hc11_cpu_device : public cpu_device, public device_nvram_interface // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 41; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 4 - 1) / 4; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 4); } virtual void execute_run() override; diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp index e7b30082012b0..e46ebe6c8d469 100644 --- a/src/devices/cpu/mcs40/mcs40.cpp +++ b/src/devices/cpu/mcs40/mcs40.cpp @@ -817,11 +817,6 @@ i4004_cpu_device::i4004_cpu_device(machine_config const &mconfig, char const *ta device_execute_interface implementation ***********************************************************************/ -u32 i4004_cpu_device::execute_input_lines() const noexcept -{ - return 1U; -} - void i4004_cpu_device::execute_set_input(int inputnum, int state) { switch (inputnum) @@ -1127,11 +1122,6 @@ i4040_cpu_device::i4040_cpu_device(machine_config const &mconfig, char const *ta device_execute_interface implementation ***********************************************************************/ -u32 i4040_cpu_device::execute_input_lines() const noexcept -{ - return 3U; -} - void i4040_cpu_device::execute_set_input(int inputnum, int state) { switch (inputnum) diff --git a/src/devices/cpu/mcs40/mcs40.h b/src/devices/cpu/mcs40/mcs40.h index 9b538fd925582..5dd54020deebf 100644 --- a/src/devices/cpu/mcs40/mcs40.h +++ b/src/devices/cpu/mcs40/mcs40.h @@ -259,7 +259,6 @@ class i4004_cpu_device : public mcs40_cpu_device_base using mcs40_cpu_device_base::mcs40_cpu_device_base; // device_execute_interface implementation - virtual u32 execute_input_lines() const noexcept override; virtual void execute_set_input(int inputnum, int state) override; // device_disasm_interface implementation @@ -289,7 +288,6 @@ class i4040_cpu_device : public i4004_cpu_device virtual std::unique_ptr create_disassembler() override; // device_execute_interface implementation - virtual u32 execute_input_lines() const noexcept override; virtual void execute_set_input(int inputnum, int state) override; // mcs40_cpu_device_base implementation diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h index 136f6a1087ee2..b5bec6833358f 100644 --- a/src/devices/cpu/mcs48/mcs48.h +++ b/src/devices/cpu/mcs48/mcs48.h @@ -148,7 +148,6 @@ class mcs48_cpu_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 15); } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2+2; } // opcode+irq - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h index 8ac6effd4d31c..9d8d4dc3dd92f 100644 --- a/src/devices/cpu/mcs51/mcs51.h +++ b/src/devices/cpu/mcs51/mcs51.h @@ -80,7 +80,6 @@ class mcs51_cpu_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 12); } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 20; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mcs96/i8x9x.h b/src/devices/cpu/mcs96/i8x9x.h index 903e2c5c4880e..d9e0832605ff8 100644 --- a/src/devices/cpu/mcs96/i8x9x.h +++ b/src/devices/cpu/mcs96/i8x9x.h @@ -73,7 +73,6 @@ class i8x9x_device : public mcs96_device { virtual void device_start() override; virtual void device_reset() override; - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_set_input(int linenum, int state) override; virtual std::unique_ptr create_disassembler() override; diff --git a/src/devices/cpu/melps4/m58846.cpp b/src/devices/cpu/melps4/m58846.cpp index 611f2d3af324a..86b5a0c5c5137 100644 --- a/src/devices/cpu/melps4/m58846.cpp +++ b/src/devices/cpu/melps4/m58846.cpp @@ -200,5 +200,5 @@ void m58846_device::execute_one() } break; // 0x1fc - } // big switch + } // 0x1f0 } diff --git a/src/devices/cpu/melps4/melps4.h b/src/devices/cpu/melps4/melps4.h index 09894a1fa8e28..6274dee32665e 100644 --- a/src/devices/cpu/melps4/melps4.h +++ b/src/devices/cpu/melps4/melps4.h @@ -101,7 +101,6 @@ class melps4_cpu_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 6); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1+1; } // max opcode cycles + interrupt duration - virtual u32 execute_input_lines() const noexcept override { return 3; } // up to 3 (some internal) virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; virtual void execute_one(); diff --git a/src/devices/cpu/minx/minx.h b/src/devices/cpu/minx/minx.h index 991916435ee36..6e7507d183f79 100644 --- a/src/devices/cpu/minx/minx.h +++ b/src/devices/cpu/minx/minx.h @@ -28,7 +28,6 @@ class minx_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mips/mips1.h b/src/devices/cpu/mips/mips1.h index c94629a789673..6baa1eb8533cf 100644 --- a/src/devices/cpu/mips/mips1.h +++ b/src/devices/cpu/mips/mips1.h @@ -26,7 +26,6 @@ class mips1core_device_base : public cpu_device // device_execute_interface implementation virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 40; } - virtual u32 execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index 67d74eea7fb40..76d035dc64bf4 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -320,7 +320,6 @@ class mips3_device : public cpu_device, public device_vtlb_interface { // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 40; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mips/ps2vu.h b/src/devices/cpu/mips/ps2vu.h index cc898ffa58d81..e5c7ef7009af8 100644 --- a/src/devices/cpu/mips/ps2vu.h +++ b/src/devices/cpu/mips/ps2vu.h @@ -116,7 +116,6 @@ class sonyvu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override { } diff --git a/src/devices/cpu/mips/r4000.h b/src/devices/cpu/mips/r4000.h index f905e520493d1..503894a53f885 100644 --- a/src/devices/cpu/mips/r4000.h +++ b/src/devices/cpu/mips/r4000.h @@ -332,7 +332,6 @@ class r4000_base_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles + 1) / 2; } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return *std::max_element(std::begin(m_hilo_cycles), std::end(m_hilo_cycles)); } - virtual u32 execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mipsx/mipsx.cpp b/src/devices/cpu/mipsx/mipsx.cpp index 72e45f84d1a36..438c4b4e3b693 100644 --- a/src/devices/cpu/mipsx/mipsx.cpp +++ b/src/devices/cpu/mipsx/mipsx.cpp @@ -11,7 +11,7 @@ DEFINE_DEVICE_TYPE(MIPSX, mipsx_cpu_device, "mipsx", "MIPS-X") mipsx_cpu_device::mipsx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MIPSX, tag, owner, clock) - , m_program_config("program", ENDIANNESS_BIG, 32, 24, 0) + , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0) , m_pc(0) , m_program(nullptr) , m_icount(0) diff --git a/src/devices/cpu/mipsx/mipsx.h b/src/devices/cpu/mipsx/mipsx.h index 34aa61d20fd21..ce189d3fcf5e3 100644 --- a/src/devices/cpu/mipsx/mipsx.h +++ b/src/devices/cpu/mipsx/mipsx.h @@ -17,7 +17,6 @@ class mipsx_cpu_device : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/mipsx/mipsxdasm.cpp b/src/devices/cpu/mipsx/mipsxdasm.cpp index 7705a666ccdc5..06f6e075aff6d 100644 --- a/src/devices/cpu/mipsx/mipsxdasm.cpp +++ b/src/devices/cpu/mipsx/mipsxdasm.cpp @@ -10,7 +10,7 @@ constexpr bool SHOW_R0_AS_0 = false; char const *const REGNAMES[32] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" }; @@ -55,16 +55,36 @@ constexpr int get_sq(u32 opcode) return BIT(opcode, 16, 1); } -constexpr int get_asr_amount(int shift) +constexpr int get_shift_amount(int shift) { - // TODO - return shift; -} - -constexpr int get_sh_amount(int shift) -{ - // TODO - return shift; + switch (shift & 0xf) + { + case 0x1: + { + shift = ((shift & 0x70) >> 2) + 0; + break; + } + case 0x2: + { + shift = ((shift & 0x70) >> 2) + 1; + break; + } + case 0x4: + { + shift = ((shift & 0x70) >> 2) + 2; + break; + } + case 0x8: + { + shift = ((shift & 0x70) >> 2) + 3; + break; + } + default: + { + return 0; + } + } + return 32 - shift; } @@ -144,7 +164,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da default: { - util::stream_format(stream, "Unhandled TY0 (%08x)", opcode); + util::stream_format(stream, "unknown TY0 (%08x)", opcode); break; } } @@ -153,7 +173,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da case 1: { - u8 op = get_op(opcode); + const u8 op = get_op(opcode); switch (op) { @@ -170,7 +190,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal mstart form"); + util::stream_format(stream, "invalid mstart TY1 OP0 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); } } else if (comp == 0x099) @@ -183,7 +203,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "unknown TY1 subcase 0 (%02x, %02x, %02x %04x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); + util::stream_format(stream, "unknown TY1 OP0 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); } break; } @@ -200,28 +220,53 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da { util::stream_format(stream, "rotlb %s,%s,%s", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode))); } - else if ((comp & 0xf80) == 0x200) - { - int shift = get_sh_amount(get_compute_compfunc(opcode) & 0x7f); - util::stream_format(stream, "sh %s,%s,%s,#%d", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode)), shift); - } else if ((comp & 0xf80) == 0x100) { const u8 src2 = get_src2_dest(opcode); if (src2 == 0x0) { - int shift = get_asr_amount((get_compute_compfunc(opcode) & 0x7f)); - util::stream_format(stream, "asr %s,%s,#%d", get_regname(get_src1(opcode)), get_regname(get_compute_dest(opcode)), shift); + const int shift = get_shift_amount((get_compute_compfunc(opcode) & 0x7f)); + if(shift != 0) + { + util::stream_format(stream, "asr %s,%s,#%d", get_regname(get_src1(opcode)), get_regname(get_compute_dest(opcode)), shift); + } + else + { + util::stream_format(stream, "asr %s,%s,#invalid (%02x)", get_regname(get_src1(opcode)), get_regname(get_compute_dest(opcode)), get_compute_compfunc(opcode) & 0x7f); + } } else { - util::stream_format(stream, "illegal asr form"); + util::stream_format(stream, "invalid asr TY1 OP1 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); + } + } + else if ((comp & 0xf80) == 0x200) + { + const int shift = get_shift_amount(get_compute_compfunc(opcode) & 0x7f); + if(shift != 0) + { + if (get_src1(opcode) == 0) + { + util::stream_format(stream, "lsl %s,%s,#%d", get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode)), 32 - shift); + } + else if (get_src2_dest(opcode) == 0) + { + util::stream_format(stream, "lsr %s,%s,#%d", get_regname(get_src1(opcode)), get_regname(get_compute_dest(opcode)), shift); + } + else + { + util::stream_format(stream, "sh %s,%s,%s,#%d", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode)), shift); + } + } + else + { + util::stream_format(stream, "sh %s,%s,%s,#invalid (%02x)", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode)), get_compute_compfunc(opcode) & 0x7f); } } else { - util::stream_format(stream, "unknown TY1 subcase 1 (%02x, %02x, %02x %04x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); + util::stream_format(stream, "unknown TY1 OP1 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); } break; } @@ -232,7 +277,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da if (comp == 0x00b) { - util::stream_format(stream, "blc %s,%s,%s", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode))); + util::stream_format(stream, "bic %s,%s,%s", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), get_regname(get_compute_dest(opcode))); } else if (comp == 0x00f) { @@ -242,24 +287,24 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal not form"); + util::stream_format(stream, "invalid not TY1 OP4 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); } } else if (comp == 0x019) { - u8 src2 = get_src2_dest(opcode); - if (src2 == 0) + const u8 src1 = get_src1(opcode); + const u8 src2 = get_src2_dest(opcode); + if ((src1 == 0) || (src2 == 0)) { - const u8 src1 = get_src1(opcode); const u8 dest = get_compute_dest(opcode); - - if ((src1 == 0) && (dest == 0)) + if (dest == 0) { util::stream_format(stream, "nop"); } else { - util::stream_format(stream, "mov %s,%s", get_regname(get_src1(opcode)), get_regname(get_compute_dest(opcode))); + // manuals say src2==0 for mov, but actual ROMs use src1==0 + util::stream_format(stream, "mov %s,%s", get_regname(get_src1(opcode) | get_src2_dest(opcode)), get_regname(get_compute_dest(opcode))); } } else @@ -289,14 +334,14 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "unknown compute (%02x, %02x, %02x %04x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); + util::stream_format(stream, "unknown TY1 OP4 (%02x, %02x, %02x %03x)", get_src1(opcode), get_src2_dest(opcode), get_compute_dest(opcode), get_compute_compfunc(opcode)); } break; } default: { - util::stream_format(stream, "Unhandled TY1 (%08x)", opcode); + util::stream_format(stream, "unknown TY1 (%08x)", opcode); break; } } @@ -336,6 +381,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da { // stt - Store Through // stt Offset[rSrc1], rDest + // maybe "store byte" on ES3210 and ES3890 util::stream_format(stream, "stt 0x%08x[%s],%s", imm17, get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode))); break; } @@ -343,11 +389,12 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da { // ldf - Load Floating Point // ldf Offset[rSrc1], rDest + // maybe "load byte" on ES3210 and ES3890 util::stream_format(stream, "ldf 0x%08x[%s],%s", imm17, get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode))); break; } - case 5: // movfrc or aluc + case 5: // movfrc or aluc, maybe "load byte" on ES3210 and ES3890 { // this is just a suggested form const u8 c2 = BIT(opcode, 0, 4); @@ -359,11 +406,11 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da if (src == 0) { - util::stream_format(stream, "movfrc %s,(%02x,%02x,%02x,%02x)", get_regname(dest), op, func, c1, c2); + util::stream_format(stream, "movfrc (%02x,%02x,%02x,%02x),%s", op, func, c1, c2, get_regname(dest)); } else { - util::stream_format(stream, "illegal movfrc form"); + util::stream_format(stream, "movfrc 0x%08x[%s],%s", imm17, get_regname(src), get_regname(dest)); } break; @@ -375,7 +422,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da util::stream_format(stream, "stf 0x%08x[%s],%s", imm17, get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode))); break; } - case 7: // movtoc + case 7: // movtoc, maybe "store byte" on ES3210 { // this is just a suggested form const u8 c2 = BIT(opcode, 0, 4); @@ -392,15 +439,15 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da else { //util::stream_format(stream, "illegal movtoc form"); - // this form appears to be used - util::stream_format(stream, "movtoc %s,(%02x,%02x,%02x,%02x) (src1 == %s)", get_regname(dest), op, func, c1, c2, get_regname(src)); + //util::stream_format(stream, "movtoc %s,(%02x,%02x,%02x,%02x) (src1 == %s)", get_regname(dest), op, func, c1, c2, get_regname(src)); + util::stream_format(stream, "movtoc 0x%08x[%s],%s", imm17, get_regname(src), get_regname(dest)); } break; } default: { - util::stream_format(stream, "Unhandled TY2 (%08x)", opcode); + util::stream_format(stream, "unknown TY2 (%08x)", opcode); break; } } @@ -417,7 +464,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da { // jspci - Jump Indexed and Store PC // jspci rSrc1,#Immed,Rdest - const int imm17 = util::sext(opcode, 17) * 2; + const int imm17 = util::sext(opcode, 17) * 4; util::stream_format(stream, "jspci %s,#%02x,%s", get_regname(get_src1(opcode)), imm17, get_regname(get_src2_dest(opcode))); break; } @@ -431,7 +478,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal hsc form"); + util::stream_format(stream, "invalid hsc TY3 OP1 (%08x)", opcode); } break; } @@ -457,12 +504,12 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal movtos form"); + util::stream_format(stream, "invalid movtos TY3 OP2 (%08x)", opcode); } } else { - util::stream_format(stream, "illegal movtos form"); + util::stream_format(stream, "invalid movtos TY3 OP2 (%08x)", opcode); } break; @@ -488,12 +535,12 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal movfrs form"); + util::stream_format(stream, "invalid movfrs TY3 OP3 (%08x)", opcode); } } else { - util::stream_format(stream, "illegal movfrs form"); + util::stream_format(stream, "invalid movfrs TY3 OP3 (%08x)", opcode); } break; @@ -502,7 +549,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da case 4: { const int imm17 = util::sext(opcode, 17); - util::stream_format(stream, "addi %s,%s,0x%08x", get_regname(get_src1(opcode)), get_regname(get_src2_dest(opcode)), imm17); + util::stream_format(stream, "addi %s,#0x%08x,%s", get_regname(get_src1(opcode)), imm17, get_regname(get_src2_dest(opcode))); break; } @@ -520,12 +567,12 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal jpc form"); + util::stream_format(stream, "invalid jpc TY3 OP5 (%08x)", opcode); } } else { - util::stream_format(stream, "illegal jpc form"); + util::stream_format(stream, "invalid jpc TY3 OP5 (%08x)", opcode); } break; } @@ -534,12 +581,12 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da { if ((opcode & 0x07fff807) == 0x00000003) { - const int vector = (opcode & 0x000007f8) >> 3; - util::stream_format(stream, "trap %02x", vector); + const u8 vector = ~((opcode & 0x000007f8) >> 3); + util::stream_format(stream, "trap 0x%02x", vector); } else { - util::stream_format(stream, "illegal trap form"); + util::stream_format(stream, "invalid trap TY3 OP6 (%08x)", opcode); } break; } @@ -558,19 +605,19 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da } else { - util::stream_format(stream, "illegal jpcrs form"); + util::stream_format(stream, "invalid jpcrs TY3 OP7 (%08x)", opcode); } } else { - util::stream_format(stream, "illegal jpcrs form"); + util::stream_format(stream, "invalid jpcrs TY3 OP7 (%08x)", opcode); } break; } default: { - util::stream_format(stream, "Unhandled TY3 (%08x)", opcode); + util::stream_format(stream, "unknown TY3 (%08x)", opcode); break; } } @@ -579,7 +626,7 @@ offs_t mipsx_disassembler::disassemble(std::ostream& stream, offs_t pc, const da default: { - util::stream_format(stream, "Unhandled (%08x)", opcode); + util::stream_format(stream, "unknown (%08x)", opcode); break; } } diff --git a/src/devices/cpu/mn10200/mn10200.h b/src/devices/cpu/mn10200/mn10200.h index 8ea31fa1d4bef..d1131b9b90975 100644 --- a/src/devices/cpu/mn10200/mn10200.h +++ b/src/devices/cpu/mn10200/mn10200.h @@ -62,7 +62,6 @@ class mn10200_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } // internal /2 divider virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 13+7; } // max opcode cycles + interrupt duration - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/mn1400/mn1400.cpp b/src/devices/cpu/mn1400/mn1400.cpp index 7573735903071..b1a8d8449fbf2 100644 --- a/src/devices/cpu/mn1400/mn1400.cpp +++ b/src/devices/cpu/mn1400/mn1400.cpp @@ -136,5 +136,6 @@ void mn1400_cpu_device::execute_one() } break; // 0xfc - } + + } // 0xf0 } diff --git a/src/devices/cpu/mpk1839/kl1839vm1.cpp b/src/devices/cpu/mpk1839/kl1839vm1.cpp new file mode 100644 index 0000000000000..00c30e8a5f21a --- /dev/null +++ b/src/devices/cpu/mpk1839/kl1839vm1.cpp @@ -0,0 +1,686 @@ +// license:BSD-3-Clause +// copyright-holders:Andrei I. Holub + +#include "emu.h" + +#include "kl1839vm1.h" +#include "kl1839vm1dasm.h" + + +#define VERBOSE ( LOG_GENERAL ) +#include "logmacro.h" + +#define UNIMPLEMENTED(msg) LOG("Unimplemented: %s\n", msg) + +#define MCA m_mca.w.l // Micro Command Address +#define VMA m_vma.d // Virtual Memory Address +#define RV m_rv.d +#define SCH m_sch.b.l // Program Counter +#define RSP m_rsp.b.l + +#define K(x) m_consts[x & 0x0f] +#define PCM K(5) +#define RC K(6) + +/* registers of various sizes */ +#define R(x) m_reg[x].d + +#define AP R(0x0c) +#define FP R(0x0d) +#define SP R(0x0e) +#define PC R(0x0f) + +#define RNK R(0x1c) +#define RKA R(0x1d) // KRSP? +#define PSL R(0x1e) +#define PSW m_reg[0x1e].w.l +#define BO R(0x1f) + +#define NF 0x08 +#define ZF 0x04 +#define VF 0x02 +#define CF 0x01 + +DEFINE_DEVICE_TYPE(KL1839VM1, kl1839vm1_device, "kl1839vm1", "KL1839VM1") + + +kl1839vm1_device::kl1839vm1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, KL1839VM1, tag, owner, clock) + , m_microcode_config("microcode", ENDIANNESS_BIG, 32, 14, -2) + , m_sysram_config("sysram", ENDIANNESS_BIG, 8, 24, 0) + , m_ram_config("ram", ENDIANNESS_LITTLE, 8, 24, 0) + , m_io_config("io", ENDIANNESS_LITTLE, 32, 6, -2) +{ +} + +device_memory_interface::space_config_vector kl1839vm1_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_OPCODES, &m_microcode_config), + std::make_pair(AS_DATA, &m_sysram_config), + std::make_pair(AS_PROGRAM, &m_ram_config), + std::make_pair(AS_IO, &m_io_config) + }; +} + +void kl1839vm1_device::flag(u32 op) +{ + const u8 copwt = BIT(op, 15, 1); + + if (copwt) + { + RNK = PC; + RKA = PSL; + } +} + +void kl1839vm1_device::rest(u32 op) +{ +} + +/* + Shift/Rotate + + val: + va: 0 - Carry read; 1 - Carry write + fo: 0 - dw, 1 - w, 2 - b; 3 - dd + a_c: 1 - arithmetical, 0 - cyclic + l_r: 1 - left, 0 - right +*/ +u32 kl1839vm1_device::shr(u32 val, bool va, u8 fo, bool a_c, bool l_r) +{ + u8 left_bit; + switch (fo & 0b11) + { + case 0b00: left_bit = 31; break; + case 0b01: left_bit = 15; break; + case 0b10: left_bit = 31; break; // ??? dd + case 0b11: left_bit = 7; break; + } + const u8 rd = l_r ? left_bit : 0; + const u8 wr = l_r ? 0 : left_bit; + + const bool carry_out = BIT(val, rd); + u32 res = l_r ? (val << 1) : (val >> 1); + res &= ~(1 << wr); + if (!a_c) + { + res |= (va ? (RSP & CF) : carry_out) << wr; + } + else if (l_r && !va) + { + res |= carry_out << wr; + } + + RSP &= ~(VF | CF); + RSP |= carry_out; + if (a_c && l_r && (fo == 0b10) && (carry_out != BIT(res, rd))) + { + RSP |= VF; + } + return res; +} + +void kl1839vm1_device::kop(u8 kop, u8 fd, u32 x, u32 y, u32 &z, u8 ps, bool va = false, u8 fo = 0) +{ + u32 res = 0; + RSP &= ~(NF | ZF | VF); + if ((kop & 0b1001) == 0b1001) // shr + { + RSP &= ~CF; + } + switch(kop) + { + case 0b0000: res = y; break; + // 0b0001: + case 0b0010: res = x + y; break; + case 0b0011: res = x; break; + case 0b0100: res = x - y; break; + // 0b0101 + case 0b0110: res = y - x; break; + case 0b0111: res = ~x; break; + case 0b1000: res = x ^ y; break; + case 0b1001: res = shr(x, va, fo, 1, 1); break; // AL + case 0b1010: res = x | y; break; + case 0b1011: res = shr(x, va, fo, 0, 1); break; // CL + case 0b1100: res = x & ~y; break; + case 0b1101: res = shr(x, va, fo, 1, 0); break; // AR + case 0b1110: res = x & y; break; + case 0b1111: res = shr(x, va, fo, 0, 0); break; // CR + default: break; // 0b0001, 0b0101 - reserved + } + + switch(fd) + { + case 0b00: + z = res; + RSP |= BIT(res, 31) ? NF : 0; + break; + case 0b01: + z = (z & 0xffff0000) | (res & 0x0000ffff); + RSP |= BIT(res, 15) ? NF : 0; + break; + case 0b11: + z = (z & 0xffffff00) | (res & 0x000000ff); + RSP |= BIT(res, 7) ? NF : 0; + break; + default: RKA = res; break; // 0b10 + } + RSP |= (res == 0) ? ZF : 0; + + switch (ps) + { + case 0b00: PSW = (PSW & ~0x0f) | (RSP & 0x0f); break; + case 0b01: PSW = (PSW & ~0x0e) | (RSP & 0x0e); break; + case 0b10: PSW = (PSW & ~0x0f) | (RSP & 0x0c); break; + default: break; + } +} + +void kl1839vm1_device::mreg_r() +{ + const u8 kob_tmp = BIT(m_vma_tmp.d, 24, 3); + if (kob_tmp == 0b001) + { + const u8 no_tmp = BIT(m_vma_tmp.d, 30, 2); + switch (no_tmp) + { + case 0b00: + BO = m_ram.read_dword(m_vma_tmp.d); + break; + case 0b10: + BO = m_io.read_dword(m_vma_tmp.d); + break; + case 0b11: + BO = m_sysram.read_dword(m_vma_tmp.d); + break; + default: + UNIMPLEMENTED("Read w/ catch BRA"); + break; + } + } +} + +void kl1839vm1_device::mreg_w() +{ + const u8 kob_tmp = BIT(m_vma_tmp.d, 24, 3); + if (kob_tmp == 0b010) + { + const u8 no_tmp = BIT(m_vma_tmp.d, 30, 2); + switch (no_tmp) + { + case 0b00: + m_ram.write_dword(m_vma_tmp.d, BO); + break; + case 0b10: + m_io.write_dword(m_vma_tmp.d, BO); + break; + case 0b11: + m_sysram.write_dword(m_vma_tmp.d, BO); + break; + default: + UNIMPLEMENTED("Write w/ catch BRA"); + break; + } + } +} + +void kl1839vm1_device::ma(u32 op) +{ + const u8 fd = BIT(op, 28, 2); + const u8 kop1 = BIT(op, 24, 4); + const u8 am = BIT(op, 20, 4); + const u8 x = BIT(op, 15, 5); + const u8 ps = BIT(op, 13, 2); + const bool va = BIT(op, 12); + const u8 no = BIT(op, 10, 2); + const u8 fo = BIT(op, 8, 2); + const u8 kob = BIT(op, 5, 3); + const bool pd = BIT(op, 4); + const bool po = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + if (am==5 || am==8 || am>=0xd) + UNIMPLEMENTED("Read regs with data mirror"); + + if (po | py | px) + UNIMPLEMENTED("MA: P*"); + + u32 kob_data = kop1 ? R(x) : K(am); + kop(kop1, fd, R(x), K(am), R(x), ps, va, fo); + if (pd || x == 0x1f) mreg_w(); + if (va) + { + kob_data = R(x); + } + kob_process(no, fo, kob, kob_data); +} + +void kl1839vm1_device::mb(u32 op) +{ + const u8 fd = BIT(op, 28, 2); + const u8 kop2 = BIT(op, 25, 3); + const u8 y = BIT(op, 20, 5); + const u8 x = BIT(op, 15, 5); + const u8 ps = BIT(op, 13, 2); + const bool va = BIT(op, 12); + const u8 no = BIT(op, 10, 2); + const u8 fo = BIT(op, 8, 2); + const u8 kob = BIT(op, 5, 3); + const bool pd = BIT(op, 4); + const bool po = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + if (po | py | px) + UNIMPLEMENTED("MB: P*"); + + u32 kob_data = kop2 ? R(x) : R(y); + if (pd || y == 0x1f) mreg_r(); + kop(kop2 << 1, fd, R(x), R(y), R(x), ps, va, fo); + if (pd || x == 0x1f) mreg_w(); + if (va) + { + kob_data = R(x); + } + kob_process(no, fo, kob, kob_data); +} + +void kl1839vm1_device::mc(u32 op) +{ + const u8 fd = BIT(op, 28, 2); + const u8 kop2 = BIT(op, 25, 3); + const u8 y = BIT(op, 20, 5); + const u8 x = BIT(op, 15, 5); + const u8 ps = BIT(op, 13, 2); + + const u8 z = BIT(op, 7, 5); + + const bool pd = BIT(op, 4); + const bool pz = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + if (pz | py | px) + UNIMPLEMENTED("MC: P*"); + + if (pd || x == 0x1f) mreg_r(); + kop(kop2 << 1, fd, R(x), kop2 ? R(y) : R(x), R(z), ps); + if (pd || z == 0x1f) mreg_w(); +} + +void kl1839vm1_device::mk(u32 op) +{ + const bool ret = BIT(op, 17); + if (!ret) + { + RV = MCA; + } + + if ((op & 0xfe000000) == 0xe0000000) + { + if (BIT(~op, 16)) // madr == 0 + { + const u16 addr = BIT(op, 2, 14); + MCA = addr; + } + else + { + u16 addr_hi = BIT(op, 8, 8) << 6; + MCA = addr_hi | (R(0x18) & 0x3f); + } + } + else if ((op & 0xfe000000) == 0xe2000000) + { + u16 addr_hi = BIT(op, 8, 8) << 6; + //u8 rpp = BIT(op, 2, 4); // TODO rpp irq code + MCA = addr_hi; + } +} + +void kl1839vm1_device::yp(u32 op) +{ + const bool uv = BIT(op, 28); + const bool n = BIT(op, 27); + const bool z = BIT(op, 26); + const bool v = BIT(op, 25); + const bool c = BIT(op, 24); + const bool fp = BIT(op, 23); + //const bool fpd = BIT(op, 22); + //const bool prb = BIT(op, 21); + //const bool rst = BIT(op, 20); + //const bool rd = BIT(op, 19); + const bool ret = BIT(op, 17); + const bool zhs = BIT(op, 16); + const u16 addr = BIT(op, 2, 14); + + bool jump = false; + if (fp) + { + jump = uv == m_fp; + } + else + { + const u8 mask = (n << 3) | (z << 2) | (v << 1) | (c << 0); + const u8 reg = zhs ? RSP : PSW; + jump = uv ? ((reg & mask) != 0) : ((reg & mask) == 0); + } + + if (jump) + { + if (!ret) + { + RV = MCA; + } + MCA = addr; + } +} + +void kl1839vm1_device::zsch(u32 op) +{ + const bool madr = BIT(op, 16); + if (madr) + { + const u8 cnst_hi = BIT(op, 8, 2) << 6; + SCH = cnst_hi | (R(0x18) & 0x3f); + } + else + { + const u8 cnst = BIT(op, 2, 8); + SCH = cnst; + } +} + +void kl1839vm1_device::psch(u32 op) +{ + const bool madr = BIT(op, 16); + if (madr) + { + const u16 addr_hi = BIT(op, 8, 8) << 6; + MCA = addr_hi | (R(0x18) & 0x3f); + } + else + { + if (SCH--) + { + const u16 addr = BIT(op, 2, 14); + MCA = addr; + } + + } +} + +void kl1839vm1_device::rts(u32 op) +{ + MCA = RV; +} + +void kl1839vm1_device::acc(u32 op) +{ + UNIMPLEMENTED("ACC"); +} + +void kl1839vm1_device::chka(u32 op) +{ + const bool madr = BIT(op, 16); + if (madr) + { + const u16 addr_hi = BIT(op, 8, 8) << 6; + RC = m_microcode.read_dword(addr_hi | (R(0x18) & 0x3f)); + } + else + { + const u16 addr = BIT(op, 2, 14); + RC= m_microcode.read_dword(addr); + } +} + +void kl1839vm1_device::chlk(u32 op) +{ + const bool sb = BIT(op, 1); + const u32 cnst = BIT(op, 2, 24); + RC = (sb * 0xff000000) | cnst; +} + +void kl1839vm1_device::srf(u32 op) +{ + if (BIT(op, 25)) // WIMM + { + UNIMPLEMENTED("SRF: WIMM"); + } + if (BIT(op, 21)) // SFP1 + { + m_fp = true; + } + if (BIT(op, 20)) // RFP1 + { + m_fp = false; + } + if (BIT(op, 5)) // DEC + { + UNIMPLEMENTED("SRF: DEC"); + } + if (BIT(op, 4)) // OCT + { + --MCA; + } + if (BIT(op, 2)) // JDZRA + { + UNIMPLEMENTED("SRF: JDZRA"); + } + if (BIT(op, 1)) // INC + { + UNIMPLEMENTED("SRF: INC"); + } +} + +void kl1839vm1_device::invalid(u32 op) +{ +} + +void kl1839vm1_device::kob_process(u8 no, u8 fo, u8 kob, u32 data) +{ + switch (kob) { + case 0b001: // Data Read + case 0b010: // Data Write + case 0b011: // Read-Modify-Write + m_vma_tmp.d = (no << 30) | (fo << 28) | (kob << 24) | data; + break; + case 0b100: // Write Accum R(17) + case 0b101: // Read Command + case 0b110: // Offset Write + UNIMPLEMENTED("KOB"); + break; + + case 0b000: // NOP + case 0b111: // Reserve + default: break; + } +} + +void kl1839vm1_device::decode_op(u32 op) +{ + if ((op & 0xc0000000) == 0x00000000) // MA + { + if ((op & 0xff000000) == 0x01000000) + flag(op); + else if ((op & 0xff000000) == 0x05000000) + rest(op); + else + ma(op); + } + else if ((op & 0xc0000000) == 0x40000000) // MB + { + mb(op); + } + else if ((op & 0xc0000000) == 0x80000000) // MC + { + mc(op); + } + else + { + if ((op & 0xfc000000) == 0xe0000000) + mk(op); + else if ((op & 0xe0000000) == 0xc0000000) + yp(op); + else if ((op & 0xfc000000) == 0xec000000) + zsch(op); + else if ((op & 0xfc000000) == 0xe4000000) + psch(op); + else if ((op & 0xfc000000) == 0xf0000000) + rts(op); + else if ((op & 0xfc000000) == 0xe8000000) + acc(op); + else if ((op & 0xfc000000) == 0xf4000000) + chka(op); + else if ((op & 0xfc000000) == 0xf8000000) + chlk(op); + else if ((op & 0xfc000000) == 0xfc000000) + srf(op); + else + invalid(op); + } +} + +void kl1839vm1_device::device_start() +{ + space(AS_OPCODES).cache(m_microcode); + space(AS_DATA).specific(m_sysram); + space(AS_PROGRAM).specific(m_ram); + space(AS_IO).specific(m_io); + + save_item(NAME(m_mca)); + save_item(NAME(m_vma)); + save_item(NAME(m_vma_tmp)); + save_item(NAME(m_rv)); + save_item(NAME(m_sch)); + save_item(NAME(m_rsp)); + save_item(NAME(m_ppc)); + save_item(NAME(m_fp)); + save_pointer(NAME(m_reg), 0x20); + save_pointer(NAME(m_consts), 0x10); + + // Register debugger state + state_add(KL1839_MCA, "MCA", MCA).formatstr("%04X"); + state_add(KL1839_VMA, "VMA", VMA).formatstr("%08X"); + state_add_divider(-1); + state_add(KL1839_IF, "cond", m_fp).formatstr("%08s"); + state_add(KL1839_RSP, "RSP", RSP).formatstr("%08s"); + state_add(KL1839_PCM, "PCM", PCM).formatstr("%08X"); + state_add(KL1839_RC, "RC", RC).formatstr("%08X"); + state_add(KL1839_RV, "RV", RV).formatstr("%08X"); + state_add(KL1839_SCH, "SCH", SCH).formatstr("%02X"); + state_add_divider(-1); + state_add(VAX_AP, "AP", AP).formatstr("%08X"); + state_add(VAX_FP, "FP", FP).formatstr("%08X"); + state_add(VAX_SP, "SP", SP).formatstr("%08X"); + state_add(VAX_PC, "PC", PC).formatstr("%08X"); + state_add_divider(-1); + state_add(VAX_R0, "R0", R(0)).formatstr("%08X"); + state_add(VAX_R1, "R1", R(1)).formatstr("%08X"); + state_add(VAX_R2, "R2", R(2)).formatstr("%08X"); + state_add(VAX_R3, "R3", R(3)).formatstr("%08X"); + state_add(VAX_R4, "R4", R(4)).formatstr("%08X"); + state_add(VAX_R5, "R5", R(5)).formatstr("%08X"); + state_add(VAX_R6, "R6", R(6)).formatstr("%08X"); + state_add(VAX_R7, "R7", R(7)).formatstr("%08X"); + state_add(VAX_R8, "R8", R(8)).formatstr("%08X"); + state_add(VAX_R9, "R9", R(9)).formatstr("%08X"); + state_add(VAX_RA, "RA", R(0x0a)).formatstr("%08X"); + state_add(VAX_RB, "RB", R(0x0b)).formatstr("%08X"); + state_add_divider(-1); + state_add(VAX_AK0, "AK0", R(0x14)).formatstr("%08X"); + state_add(VAX_AK1, "AK1", R(0x15)).formatstr("%08X"); + state_add(VAX_AK2, "AK2", R(0x16)).formatstr("%08X"); + state_add(VAX_AK3, "AK3", R(0x12)).formatstr("%08X"); + state_add(VAX_AK4, "AK4", R(0x11)).formatstr("%08X"); + state_add(VAX_AK5, "AK5", R(0x13)).formatstr("%08X"); + state_add(VAX_AK6, "AK6", R(0x17)).formatstr("%08X"); + state_add(VAX_AK7, "AK7", R(0x18)).formatstr("%08X"); + state_add(VAX_AK8, "AK8", R(0x10)).formatstr("%08X"); + state_add_divider(-1); + state_add(VAX_RNK, "RNK", RNK).formatstr("%08X"); + state_add(VAX_RKA, "RKA", RKA).formatstr("%08X"); + state_add(VAX_PSL, "PSL", PSL).formatstr("%08X"); + state_add(VAX_BO, "BO", BO).formatstr("%08X"); + + state_add(STATE_GENPC, "GENPC", MCA).noshow(); // ??? + state_add(STATE_GENPCBASE, "CURPC", m_ppc.d).noshow(); + state_add(STATE_GENFLAGS, "GENFLAGS", PSW).formatstr("%8s").noshow(); + + set_icountptr(m_icount); +} + +void kl1839vm1_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("%c%c%c%c%c%c%c%c", + PSW & 0x80 ? '?' : '.', + PSW & 0x40 ? '?' : '.', + PSW & 0x20 ? '?' : '.', + PSW & 0x10 ? '?' : '.', + PSW & NF ? 'N' : '.', + PSW & ZF ? 'Z' : '.', + PSW & VF ? 'V' : '.', + PSW & CF ? 'C' : '.' + ); + break; + case KL1839_RSP: + str = string_format("%c%c%c%c%c%c%c%c", + RSP & 0x80 ? '?' : '.', + RSP & 0x40 ? '?' : '.', + RSP & 0x20 ? '?' : '.', + RSP & 0x10 ? '?' : '.', + RSP & NF ? 'N' : '.', + RSP & ZF ? 'Z' : '.', + RSP & VF ? 'V' : '.', + RSP & CF ? 'C' : '.' + ); + break; + case KL1839_IF: + str = string_format("FP%d", m_fp); + break; + } +} + +void kl1839vm1_device::device_reset() +{ + for (auto ® : m_reg) + reg.d = 0; + + m_ppc.d = MCA = 0x2000; + VMA = 0; + m_fp = false; + RSP = 0; + m_vma_tmp.d = 0; + RV = 0; + SCH = 0; +} + +void kl1839vm1_device::execute_set_input(int irqline, int state) +{ +} + +void kl1839vm1_device::execute_run() +{ + do + { + m_ppc.d = MCA; + debugger_instruction_hook(m_ppc.d); + + u32 op = m_microcode.read_dword(MCA); + m_icount -= 2; + ++MCA &= 0x3fff; + + decode_op(op); + } while (m_icount > 0); +} + +std::unique_ptr kl1839vm1_device::create_disassembler() +{ + return std::make_unique(); +} + diff --git a/src/devices/cpu/mpk1839/kl1839vm1.h b/src/devices/cpu/mpk1839/kl1839vm1.h new file mode 100644 index 0000000000000..d04320cf83885 --- /dev/null +++ b/src/devices/cpu/mpk1839/kl1839vm1.h @@ -0,0 +1,93 @@ +// license:BSD-3-Clause +// copyright-holders:Andrei I. Holub + +#ifndef MAME_CPU_MPK1839_KL1839VM1_H +#define MAME_CPU_MPK1839_KL1839VM1_H + +#pragma once + + +enum +{ + KL1839_MCA = STATE_GENPC, KL1839_VMA, KL1839_IF, KL1839_RSP, KL1839_PCM, KL1839_RC, KL1839_RV, KL1839_SCH, + VAX_R0, VAX_R1, VAX_R2, VAX_R3, VAX_R4, VAX_R5, VAX_R6, VAX_R7, VAX_R8, VAX_R9, VAX_RA, VAX_RB, + VAX_AP, VAX_FP, VAX_SP, VAX_PC, + VAX_AK0, VAX_AK1, VAX_AK2, VAX_AK3, VAX_AK4, VAX_AK5, VAX_AK6, VAX_AK7, VAX_AK8, + VAX_RNK, VAX_RKA, VAX_PSL, VAX_BO +}; + + +class kl1839vm1_device : public cpu_device +{ +public: + // construction/destruction + kl1839vm1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // device_execute_interface overrides + virtual u32 execute_min_cycles() const noexcept override { return 1; } + virtual u32 execute_max_cycles() const noexcept override { return 16; } + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + + virtual std::unique_ptr create_disassembler() override; + +private: + void flag(u32 op); + void rest(u32 op); + void ma(u32 op); + void mb(u32 op); + void mc(u32 op); + void mk(u32 op); + void yp(u32 op); + void zsch(u32 op); + void psch(u32 op); + void rts(u32 op); + void acc(u32 op); + void chka(u32 op); + void chlk(u32 op); + void srf(u32 op); + void invalid(u32 op); + + u32 shr(u32 val, bool va, u8 fo, bool a_c, bool l_r); + void kob_process(u8 no, u8 fd, u8 kob, u32 data); + void kop(u8 kop, u8 fd, u32 x, u32 y, u32 &z, u8 ps, bool va, u8 fo); + void mreg_w(); + void mreg_r(); + void decode_op(u32 op); + + address_space_config m_microcode_config; + address_space_config m_sysram_config; + address_space_config m_ram_config; + address_space_config m_io_config; + + memory_access<14, 2, -2, ENDIANNESS_BIG>::cache m_microcode; + memory_access<24, 0, 0, ENDIANNESS_BIG>::specific m_sysram; + memory_access<24, 0, 0, ENDIANNESS_LITTLE>::specific m_ram; + memory_access<6, 2, -2, ENDIANNESS_LITTLE>::specific m_io; + PAIR m_mca; + PAIR m_vma; + PAIR m_vma_tmp; // does we have int reg for this? + PAIR m_rv; + PAIR m_sch; + PAIR m_rsp; + PAIR m_ppc; // previous program counter + bool m_fp; + u32 m_consts[0x10] = { 0x4, 0x2, 0x8, 0x1, 0x0, 0, 0, 0x66, 0, 0xc00000, 0xffffffff, 0x1f0000, 0x4000000, 0, 0, 0 }; + PAIR m_reg[0x20]; + int m_icount; +}; + +DECLARE_DEVICE_TYPE(KL1839VM1, kl1839vm1_device) + +#endif // MAME_CPU_MPK1839_KL1839VM1_H diff --git a/src/devices/cpu/mpk1839/kl1839vm1dasm.cpp b/src/devices/cpu/mpk1839/kl1839vm1dasm.cpp new file mode 100644 index 0000000000000..1b9ad4e7dc143 --- /dev/null +++ b/src/devices/cpu/mpk1839/kl1839vm1dasm.cpp @@ -0,0 +1,441 @@ +// license:BSD-3-Clause +// copyright-holders:Andrei I. Holub +/*************************************************************************** + KL1839VM1 disassembler +***************************************************************************/ + +#include "emu.h" +#include "kl1839vm1dasm.h" + +static const std::string r_name(u8 id) +{ + std::ostringstream ss; + switch (id) + { + case 0x14: ss << "AK0"; break; + case 0x15: ss << "AK1"; break; + case 0x16: ss << "AK2"; break; + case 0x12: ss << "AK3"; break; + case 0x11: ss << "AK4"; break; + case 0x13: ss << "AK5"; break; + case 0x17: ss << "AK6"; break; + case 0x18: ss << "AK7"; break; + case 0x10: ss << "AK8"; break; + case 0x1f: ss << "BO"; break; + default: util::stream_format(ss, "R(%02X)", id); break; + } + return ss.str(); +} + +static const std::string k_name(u8 id) +{ + std::ostringstream ss; + switch (id) + { + case 0x05: ss << "PCM"; break; + case 0x06: ss << "RC"; break; + default: util::stream_format(ss, "K(%X)", id); break; + } + return ss.str(); +} + +static const void m_base(std::ostream &stream, u32 op, char m, u8 kop, std::string x, std::string y, std::string z) +{ + const u8 fd = BIT(op, 28, 2); + const u8 ps = BIT(op, 13, 2); + const bool pd = BIT(op, 4); + + util::stream_format(stream, "M%c%-2s :", m, ""); + std::ostringstream ss; + switch(fd) + { + case 0b00: ss << "DS/"; break; + case 0b01: ss << "SL/"; break; + case 0b11: ss << "BT/"; break; + default: break; // 0b10 + } + switch(kop) + { + case 0b0000: ss << y << "=>" << z; break; + case 0b0010: ss << x << "+" << y << "=>" << z; break; + case 0b0011: ss << x << "=>" << z; break; + case 0b0100: ss << x << "-" << y << "=>" << z; break; + case 0b0110: ss << y << "-" << x << "=>" << z; break; + case 0b0111: ss << x << "=>!" << x; break; + case 0b1000: ss << x << "(+)" << y << "=>" << z; break; + case 0b1001: ss << "AL" << x; break; + case 0b1010: ss << x << "'" << y << "=>" << z; break; + case 0b1011: ss << "CL" << x; break; + case 0b1100: ss << x << "&!" << y << "=>" << z; break; + case 0b1101: ss << "AP" << x; break; + case 0b1110: ss << x << "&" << y << "=>" << z; break; + case 0b1111: ss << "CP" << x; break; + default: break; // 0b0001, 0b0101 - reserved + } + util::stream_format(stream, "%-24s;", ss.str()); + + stream << (pd ? "PD " : ""); + + switch(ps) + { + case 0b00: stream << "ZS "; break; + case 0b01: stream << "MS "; break; + case 0b10: stream << "NV "; break; + default: break; // 0b11 - no state store + } +} + +static const void ma(std::ostream &stream, u32 op) +{ + const u8 kop1 = BIT(op, 24, 4); + const u8 am = BIT(op, 20, 4); + const u8 x = BIT(op, 15, 5); + const bool va = BIT(op, 12); + const u8 no = BIT(op, 10, 2); + const u8 fo = BIT(op, 8, 2); + const u8 kob = BIT(op, 5, 3); + const bool po = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + m_base(stream, op, 'A', kop1, r_name(x), k_name(am), r_name(x)); + + if (kob) + { + stream << (va ? "AZ " : "A4 "); + + switch(no) + { + case 0b00: break; + case 0b01: stream << "PP "; break; + case 0b10: stream << "SR "; break; + case 0b11: stream << "SP "; break; + default: break; + } + + switch(fo) + { + case 0b00: stream << "DSO "; break; + case 0b01: stream << "SLO "; break; + case 0b10: stream << "4SO "; break; + case 0b11: stream << "BO "; break; + default: break; + } + + switch(kob) + { + case 0b000: break; + case 0b001: stream << "4D "; break; + case 0b010: stream << "ZD "; break; + case 0b011: stream << "4Z "; break; + case 0b100: stream << "?R(17)==ACC "; break; + case 0b101: stream << "4K "; break; + case 0b110: break; // reserved + case 0b111: stream << "BRD "; break; + default: break; + } + } + + if (px | po | py) + stream << "?:" << (px ? "PX " : "") << (po ? "PO " : "") << (py ? "PY " : ""); +} + +static const void mb(std::ostream &stream, u32 op) +{ + const u8 kop2 = BIT(op, 25, 3); + const u8 y = BIT(op, 20, 5); + const u8 x = BIT(op, 15, 5); + const u8 ps = BIT(op, 13, 2); + const bool va = BIT(op, 12); + const u8 no = BIT(op, 10, 2); + const u8 fo = BIT(op, 8, 2); + const u8 kob = BIT(op, 5, 3); + const bool pz = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + m_base(stream, op, 'B', kop2 << 1, r_name(x), r_name(y), r_name(x)); + + if (kob) + { + stream << (va ? "AZ " : "A4 "); + + switch(ps) + { + case 0b00: stream << "ZS "; break; + case 0b01: stream << "MS "; break; + case 0b10: stream << "NV "; break; + default: break; // 0b11 - no state store + } + + switch(no) + { + case 0b00: break; + case 0b01: stream << "PP "; break; + case 0b10: stream << "SR "; break; + case 0b11: stream << "SP "; break; + default: break; + } + + switch(fo) + { + case 0b00: stream << "DSO "; break; + case 0b01: stream << "SLO "; break; + case 0b10: stream << "4SO "; break; + case 0b11: stream << "BO "; break; + default: break; + } + + switch(kob) + { + case 0b000: break; + case 0b001: stream << "4D "; break; + case 0b010: stream << "ZD "; break; + case 0b011: stream << "4Z "; break; + case 0b100: stream << "?R(17)==ACC "; break; + case 0b101: stream << "4K "; break; + case 0b110: break; // reserved + case 0b111: stream << "BRD "; break; + default: break; + } + } + + if (px | pz | py) + stream << "?:" << (px ? "PX " : "") << (pz ? "PZ " : "") << (py ? "PY " : ""); +} + +static const void mc(std::ostream &stream, u32 op) +{ + const u8 kop2 = BIT(op, 25, 3); + const u8 y = BIT(op, 20, 5); + const u8 x = BIT(op, 15, 5); + const u8 z = BIT(op, 7, 5); + const bool pz = BIT(op, 3); + const bool py = BIT(op, 2); + const bool px = BIT(op, 1); + + m_base(stream, op, 'C', kop2 << 1, r_name(x), kop2 ? r_name(y) : r_name(x), r_name(z)); + + if (px | pz | py) + stream << "?:" << (px ? "PX " : "") << (pz ? "PZ " : "") << (py ? "PY " : ""); +} + +static const u32 mk(std::ostream &stream, u32 op) +{ + const bool ret = BIT(op, 17); + if ((op & 0xfe000000) == 0xe0000000) + { + if (BIT(~op, 16)) // madr == 0 + { + const u16 addr = BIT(op, 2, 14); + util::stream_format(stream, "BP%s : ;A=%04X", ret ? " " : "B" ,addr); + } + else + { + stream << "??MK-2"; + } + } + else if ((op & 0xfe000000) == 0xe2000000) + { + stream << "??MK-3"; + } + + return ret ? 0 : kl1839vm1_disassembler::STEP_OVER; +} + +static const u32 yp(std::ostream &stream, u32 op) +{ + const bool uv = BIT(op, 28); + const bool n = BIT(op, 27); + const bool z = BIT(op, 26); + const bool v = BIT(op, 25); + const bool c = BIT(op, 24); + const bool fp = BIT(op, 23); + const bool fpd = BIT(op, 22); + const bool prb = BIT(op, 21); + const bool rts = BIT(op, 20); + const bool rd = BIT(op, 19); + const bool ret = BIT(op, 17); + const bool js = BIT(op, 16); + const u16 addr = BIT(op, 2, 14); + if (fp) + { + util::stream_format(stream, "YPF%s : ", uv); + } + else if (fpd) + util::stream_format(stream, "YPFPD :", uv); + else + { + util::stream_format(stream, "YP%s%s :", uv , (js ? "JS" : " ")); + stream << (n ? "N" : ""); + stream << (z ? "Z" : ""); + stream << (v ? "V" : ""); + stream << (c ? "C" : ""); + } + + util::stream_format(stream, " ;A=%04X", addr); + + if (prb | rts | rd) + stream << " ?:" << (prb ? "PRB " : "") << (rts ? "RTS " : "") << (rd ? "RD " : ""); + + return ret ? 0 : kl1839vm1_disassembler::STEP_OVER; +} + +static const void zsch(std::ostream &stream, u32 op) +{ + stream << "ZS4 :"; + if (BIT(~op, 16)) // mcc == 0 + { + const u8 cnst = BIT(op, 2, 8); + util::stream_format(stream, "S4=K(%02X) ;", cnst); + } + else + { + //const u8 cnst = BIT(op, 8, 2); + const u8 obb = BIT(op, 2, 6); + util::stream_format(stream, "S4=K(%04X) ;", obb); + } +} + +static const void psch(std::ostream &stream, u32 op) +{ + stream << "PS4 :"; + if (BIT(~op, 16)) // madr == 0 + { + const u8 addr = BIT(op, 2, 14); + util::stream_format(stream, " ;A=%04X", addr); + } + else + { + stream << "..."; + } +} + +static const void rts(std::ostream &stream, u32 op) +{ + stream << "RTS : ;"; +} + +static const void acc(std::ostream &stream, u32 op) +{ + stream << "ACC : ;"; +} + +static const void chka(std::ostream &stream, u32 op) +{ + stream << "4KA :"; + if (BIT(~op, 16)) // madr == 0 + { + const u16 addr = BIT(op, 2, 14); + util::stream_format(stream, " ;A=%04X", addr); + } + else + { + stream << "??"; + } +} + +static const void chlk(std::ostream &stream, u32 op) +{ + const bool sb = BIT(op, 1); + const u32 cnst = BIT(op, 2, 24); + util::stream_format(stream, "4LK :SB%X/K(%06X) ;", sb, cnst); +} + +static const void srf(std::ostream &stream, u32 op) +{ + if (!BIT(op, 1, 25)) + { + stream << "NOP : ;"; + } + else if (BIT(op, 4)) + { + stream << "OCT : ;"; + } + else + { + stream << "SRF : ;"; + stream << (BIT(op, 25) ? "WIMM " : ""); + stream << (BIT(op, 21) ? "SFP1 " : ""); + stream << (BIT(op, 20) ? "RFP1 " : ""); + stream << (BIT(op, 5) ? "DEC " : ""); + stream << (BIT(op, 2) ? "JDZRA " : ""); + stream << (BIT(op, 1) ? "INC " : ""); + } +} + +static const void flag(std::ostream &stream, u32 op) +{ + stream << "FLAG : ;"; + stream << (BIT(op, 23) ? "INTMS " : ""); + stream << (BIT(op, 22) ? "RCPU " : ""); + stream << (BIT(op, 21) ? "SIVV " : ""); + stream << (BIT(op, 20) ? "CCFPU " : ""); + stream << (BIT(op, 19) ? "PROB " : ""); + stream << (BIT(op, 17) ? "SIU " : ""); + stream << (BIT(op, 16) ? "TOU " : ""); + stream << (BIT(op, 15) ? "COPWT " : ""); +} + +static const void rest(std::ostream &stream, u32 op) +{ + stream << "REST : ;"; +} + +offs_t kl1839vm1_disassembler::disassemble(std::ostream &stream, offs_t pc, const kl1839vm1_disassembler::data_buffer &opcodes, const kl1839vm1_disassembler::data_buffer ¶ms) +{ + u32 op = opcodes.r32(pc); + u32 step = 0; + if ((op & 0xc0000000) == 0x00000000) // MA + { + if ((op & 0xff000000) == 0x01000000) + flag(stream, op); + else if ((op & 0xff000000) == 0x05000000) + rest(stream, op); + else + ma(stream, op); + } + else if ((op & 0xc0000000) == 0x40000000) // MB + { + mb(stream, op); + } + else if ((op & 0xc0000000) == 0x80000000) // MC + { + mc(stream, op); + } + else + { + if ((op & 0xfc000000) == 0xe0000000) + { + step |= mk(stream, op); + } + else if ((op & 0xe0000000) == 0xc0000000) + { + step |= yp(stream, op) | STEP_COND; + } + else if ((op & 0xfc000000) == 0xec000000) + zsch(stream, op); + else if ((op & 0xfc000000) == 0xe4000000) + { + psch(stream, op); + step |= STEP_COND; + } + else if ((op & 0xfc000000) == 0xf0000000) + { + rts(stream, op); + step |= STEP_OUT; + } + else if ((op & 0xfc000000) == 0xe8000000) + acc(stream, op); + else if ((op & 0xfc000000) == 0xf4000000) + chka(stream, op); + else if ((op & 0xfc000000) == 0xf8000000) + chlk(stream, op); + else if ((op & 0xfc000000) == 0xfc000000) + srf(stream, op); + else + stream << ""; + } + + return 1 | SUPPORTED | step; +} diff --git a/src/devices/cpu/mpk1839/kl1839vm1dasm.h b/src/devices/cpu/mpk1839/kl1839vm1dasm.h new file mode 100644 index 0000000000000..3d13d90a1aebd --- /dev/null +++ b/src/devices/cpu/mpk1839/kl1839vm1dasm.h @@ -0,0 +1,25 @@ +// license:BSD-3-Clause +// copyright-holders:Andrei I. Holub + +#ifndef MAME_CPU_MPK1839_KL1839VM1DASM_H +#define MAME_CPU_MPK1839_KL1839VM1DASM_H + +#pragma once + +class kl1839vm1_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + kl1839vm1_disassembler() = default; + virtual ~kl1839vm1_disassembler() = default; + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override { return 1; } + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + +}; + +#endif // MAME_CPU_MPK1839_KL1839VM1DASM_H diff --git a/src/devices/cpu/nanoprocessor/nanoprocessor.h b/src/devices/cpu/nanoprocessor/nanoprocessor.h index 2aa8cf3a4abb5..49f63c5caca4d 100644 --- a/src/devices/cpu/nanoprocessor/nanoprocessor.h +++ b/src/devices/cpu/nanoprocessor/nanoprocessor.h @@ -90,7 +90,6 @@ class hp_nanoprocessor_device : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override { return 2; } // 3 cycles is for int. acknowledge + 1 instruction virtual uint32_t execute_max_cycles() const noexcept override { return 3; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } // device_memory_interface overrides diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp index 49138a745c614..afa45f7dc17f1 100644 --- a/src/devices/cpu/nec/nec.cpp +++ b/src/devices/cpu/nec/nec.cpp @@ -108,6 +108,11 @@ #include "nec.h" #include "necdasm.h" +#define LOG_BUSLOCK (1 << 1) +//#define VERBOSE (...) + +#include "logmacro.h" + typedef uint8_t BOOLEAN; typedef uint8_t BYTE; typedef uint16_t WORD; diff --git a/src/devices/cpu/nec/nec.h b/src/devices/cpu/nec/nec.h index af20d2f3a1a0e..12af9f8dc57cf 100644 --- a/src/devices/cpu/nec/nec.h +++ b/src/devices/cpu/nec/nec.h @@ -37,7 +37,6 @@ class nec_common_device : public cpu_device, public nec_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 80; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; diff --git a/src/devices/cpu/nec/necinstr.hxx b/src/devices/cpu/nec/necinstr.hxx index 11abacbedb0a0..ae1c1d50b988e 100644 --- a/src/devices/cpu/nec/necinstr.hxx +++ b/src/devices/cpu/nec/necinstr.hxx @@ -643,7 +643,7 @@ OP( 0xed, i_inaxdx ) { Wreg(AW) = read_port_word(Wreg(DW)); CLKW(12,12,7,12,8, OP( 0xee, i_outdxal ) { write_port_byte(Wreg(DW), Breg(AL)); CLKS(8,8,3); } OP( 0xef, i_outdxax ) { write_port_word(Wreg(DW), Wreg(AW)); CLKW(12,12,5,12,8,3,Wreg(DW)); } -OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",PC()); m_no_interrupt=1; CLK(2); } +OP( 0xf0, i_lock ) { LOGMASKED(LOG_BUSLOCK, "%06x: Warning - BUSLOCK\n",PC()); m_no_interrupt=1; CLK(2); } OP( 0xf2, i_repne ) { uint32_t next = fetchop(); uint16_t c = Wreg(CW); switch(next) { /* Segments */ case 0x26: m_seg_prefix=true; m_prefix_base=Sreg(DS1)<<4; next = fetchop(); CLK(2); break; diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index 6d96206f0ed90..4374da5170baf 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -38,6 +38,11 @@ #include "v25.h" #include "necdasm.h" +#define LOG_BUSLOCK (1 << 1) +//#define VERBOSE (...) + +#include "logmacro.h" + typedef uint8_t BOOLEAN; typedef uint8_t BYTE; typedef uint16_t WORD; diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h index 726f4557e59c0..6f239bb0c0a15 100644 --- a/src/devices/cpu/nec/v25.h +++ b/src/devices/cpu/nec/v25.h @@ -55,7 +55,6 @@ class v25_common_device : public cpu_device, public nec_disassembler::config virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return cycles * m_PCK; } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 80; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI || (inputnum >= NEC_INPUT_LINE_INTP0 && inputnum <= NEC_INPUT_LINE_INTP2); } virtual void execute_run() override; diff --git a/src/devices/cpu/ns32000/ns32000.h b/src/devices/cpu/ns32000/ns32000.h index cc713c26a725d..99cd956fc403f 100644 --- a/src/devices/cpu/ns32000/ns32000.h +++ b/src/devices/cpu/ns32000/ns32000.h @@ -27,7 +27,6 @@ class ns32000_device : public cpu_device // device_execute_interface implementation virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 6; } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } diff --git a/src/devices/cpu/nuon/nuon.h b/src/devices/cpu/nuon/nuon.h index f3a7311e98563..c446fad2a7617 100644 --- a/src/devices/cpu/nuon/nuon.h +++ b/src/devices/cpu/nuon/nuon.h @@ -30,7 +30,6 @@ class nuon_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/palm/palm.h b/src/devices/cpu/palm/palm.h index af19bd3f1debc..a0b474ce4798f 100644 --- a/src/devices/cpu/palm/palm.h +++ b/src/devices/cpu/palm/palm.h @@ -34,7 +34,6 @@ class palm_device : public cpu_device // device_execute_interface implementation virtual u32 execute_min_cycles() const noexcept override { return 17; } virtual u32 execute_max_cycles() const noexcept override { return 54; } - virtual u32 execute_input_lines() const noexcept override { return 3; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h index f1a4e9342366d..cbe0d5d818174 100644 --- a/src/devices/cpu/pdp1/pdp1.h +++ b/src/devices/cpu/pdp1/pdp1.h @@ -93,7 +93,6 @@ class pdp1_device : public cpu_device, public pdp1_reset_param_t // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 31; } - virtual uint32_t execute_input_lines() const noexcept override { return 16; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/pdp8/pdp8.cpp b/src/devices/cpu/pdp8/pdp8.cpp index 31086b3fb48b9..7e30766bf9083 100644 --- a/src/devices/cpu/pdp8/pdp8.cpp +++ b/src/devices/cpu/pdp8/pdp8.cpp @@ -180,17 +180,6 @@ uint32_t pdp8_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t pdp8_device::execute_input_lines() const noexcept -{ - return 0; // TODO -} - - //------------------------------------------------- // execute_set_input - set the state of an input // line during execution diff --git a/src/devices/cpu/pdp8/pdp8.h b/src/devices/cpu/pdp8/pdp8.h index ef6c4af95ae9e..98bc1fe4ed15c 100644 --- a/src/devices/cpu/pdp8/pdp8.h +++ b/src/devices/cpu/pdp8/pdp8.h @@ -32,7 +32,6 @@ class pdp8_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/pic16c5x/pic16c5x.h b/src/devices/cpu/pic16c5x/pic16c5x.h index e7a294df593dd..d78c2db973852 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.h +++ b/src/devices/cpu/pic16c5x/pic16c5x.h @@ -101,7 +101,6 @@ class pic16c5x_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == PIC16C5x_RTCC; } virtual void execute_run() override; virtual void execute_set_input(int line, int state) override; diff --git a/src/devices/cpu/pic16c62x/pic16c62x.h b/src/devices/cpu/pic16c62x/pic16c62x.h index 5465743b52df2..73692cb105d0c 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.h +++ b/src/devices/cpu/pic16c62x/pic16c62x.h @@ -75,7 +75,6 @@ class pic16c62x_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 4); } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 2; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/pic16x8x/pic16x8x.h b/src/devices/cpu/pic16x8x/pic16x8x.h index 89c0d50022751..0cd71ba978c02 100644 --- a/src/devices/cpu/pic16x8x/pic16x8x.h +++ b/src/devices/cpu/pic16x8x/pic16x8x.h @@ -81,7 +81,6 @@ class pic16x8x_device : public cpu_device, public device_nvram_interface virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == PIC16x8x_T0CKI; } virtual void execute_run() override; virtual void execute_set_input(int line, int state) override; diff --git a/src/devices/cpu/pic17/pic17c4x.h b/src/devices/cpu/pic17/pic17c4x.h index fd48f2aa49a87..406244b6ee45d 100644 --- a/src/devices/cpu/pic17/pic17c4x.h +++ b/src/devices/cpu/pic17/pic17c4x.h @@ -82,7 +82,6 @@ class pic17c4x_device : public pic17_cpu_device virtual void device_reset() override; // device_execute_interface implementation - virtual u32 execute_input_lines() const noexcept override { return 6; } // for now virtual bool execute_input_edge_triggered(int linenum) const noexcept override { return linenum == INT_LINE || linenum == T0CKI_LINE; } virtual void execute_set_input(int linenum, int state) override; diff --git a/src/devices/cpu/powerpc/ppc.h b/src/devices/cpu/powerpc/ppc.h index caf3e2b386214..f5a5d8ca7dfbb 100644 --- a/src/devices/cpu/powerpc/ppc.h +++ b/src/devices/cpu/powerpc/ppc.h @@ -257,7 +257,6 @@ class ppc_device : public cpu_device, public device_vtlb_interface // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 40; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -693,9 +692,6 @@ class ppc_device : public cpu_device, public device_vtlb_interface //{ //public: // ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); -// -//protected: -// virtual uint32_t execute_input_lines() const noexcept { return 8; } //}; // // @@ -703,9 +699,6 @@ class ppc_device : public cpu_device, public device_vtlb_interface //{ //public: // ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); -// -//protected: -// virtual uint32_t execute_input_lines() const noexcept { return 8; } //}; @@ -787,7 +780,6 @@ class ppc4xx_device : public ppc_device protected: ppc4xx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, powerpc_flavor flavor, uint32_t cap, uint32_t tb_divisor); - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_set_input(int inputnum, int state) override; }; diff --git a/src/devices/cpu/pps4/pps4.h b/src/devices/cpu/pps4/pps4.h index 4b9b82f37c0e2..38fa3d5cd77aa 100644 --- a/src/devices/cpu/pps4/pps4.h +++ b/src/devices/cpu/pps4/pps4.h @@ -59,7 +59,6 @@ class pps4_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 3; } - virtual u32 execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/pps41/mm76.cpp b/src/devices/cpu/pps41/mm76.cpp index bb7d9cd7a533f..d1eb8bac0ca96 100644 --- a/src/devices/cpu/pps41/mm76.cpp +++ b/src/devices/cpu/pps41/mm76.cpp @@ -176,6 +176,7 @@ void mm76_device::execute_one() } break; // 0xfc - } + + } // 0xf0 } } diff --git a/src/devices/cpu/pps41/mm78.cpp b/src/devices/cpu/pps41/mm78.cpp index 8512c8f3f0701..dd875551fc812 100644 --- a/src/devices/cpu/pps41/mm78.cpp +++ b/src/devices/cpu/pps41/mm78.cpp @@ -207,7 +207,8 @@ void mm78_device::execute_one() } break; // 0xfc - } + + } // 0xf0 } // TAB is delayed by 1 opcode (including a single TR) diff --git a/src/devices/cpu/pps41/pps41base.h b/src/devices/cpu/pps41/pps41base.h index 2d962b5a5d313..f024280a234e8 100644 --- a/src/devices/cpu/pps41/pps41base.h +++ b/src/devices/cpu/pps41/pps41base.h @@ -67,7 +67,6 @@ class pps41_base_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2; } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; virtual void execute_one() = 0; diff --git a/src/devices/cpu/psx/psx.h b/src/devices/cpu/psx/psx.h index f2ce1ed59d36d..30bb90d85ffd2 100644 --- a/src/devices/cpu/psx/psx.h +++ b/src/devices/cpu/psx/psx.h @@ -178,7 +178,6 @@ class psxcpu_device : public cpu_device, psxcpu_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 40; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return ( clocks + 3 ) / 4; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return cycles * 4; } virtual void execute_run() override; diff --git a/src/devices/cpu/romp/romp.h b/src/devices/cpu/romp/romp.h index 0f1f848327c5b..556de7e6e9507 100644 --- a/src/devices/cpu/romp/romp.h +++ b/src/devices/cpu/romp/romp.h @@ -113,7 +113,6 @@ class romp_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 40; } - virtual u32 execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/rsp/rsp.h b/src/devices/cpu/rsp/rsp.h index 3bbb95ca3487f..c19784ed03df5 100644 --- a/src/devices/cpu/rsp/rsp.h +++ b/src/devices/cpu/rsp/rsp.h @@ -102,7 +102,6 @@ class rsp_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override { } diff --git a/src/devices/cpu/rw5000/b5000.cpp b/src/devices/cpu/rw5000/b5000.cpp index 685fb1b519095..f173ebea6b5e0 100644 --- a/src/devices/cpu/rw5000/b5000.cpp +++ b/src/devices/cpu/rw5000/b5000.cpp @@ -145,7 +145,8 @@ void b5000_cpu_device::execute_one() } break; // 0xfc - } + + } // 0xf0 } bool b5000_cpu_device::op_is_tl(u8 op) diff --git a/src/devices/cpu/s2650/s2650.h b/src/devices/cpu/s2650/s2650.h index 008ea0bb31f2e..c17287b538091 100644 --- a/src/devices/cpu/s2650/s2650.h +++ b/src/devices/cpu/s2650/s2650.h @@ -44,7 +44,6 @@ class s2650_device : public cpu_device, public s2650_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 13; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/saturn/saturn.h b/src/devices/cpu/saturn/saturn.h index 5111de6d7edb3..f40d3eb7237c3 100644 --- a/src/devices/cpu/saturn/saturn.h +++ b/src/devices/cpu/saturn/saturn.h @@ -86,7 +86,6 @@ class saturn_device : public cpu_device, public saturn_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 21; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/sc61860/sc61860.h b/src/devices/cpu/sc61860/sc61860.h index df019b6b845ad..ab0e83c1bec4c 100644 --- a/src/devices/cpu/sc61860/sc61860.h +++ b/src/devices/cpu/sc61860/sc61860.h @@ -74,7 +74,6 @@ class sc61860_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/scmp/scmp.h b/src/devices/cpu/scmp/scmp.h index 9928bf5729087..bfa52a56e9d26 100644 --- a/src/devices/cpu/scmp/scmp.h +++ b/src/devices/cpu/scmp/scmp.h @@ -35,7 +35,6 @@ class scmp_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 23+8; } // max opcode + interrupt - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/score/score.h b/src/devices/cpu/score/score.h index badf1b2b0d8d2..887d3ad68cbb1 100644 --- a/src/devices/cpu/score/score.h +++ b/src/devices/cpu/score/score.h @@ -43,7 +43,6 @@ class score7_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 64; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/scudsp/scudsp.h b/src/devices/cpu/scudsp/scudsp.h index eba4ed5903c5c..19e2a079c4f7f 100644 --- a/src/devices/cpu/scudsp/scudsp.h +++ b/src/devices/cpu/scudsp/scudsp.h @@ -69,7 +69,6 @@ class scudsp_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/se3208/se3208.h b/src/devices/cpu/se3208/se3208.h index 0e6608540c3bf..dff3ca9888c11 100644 --- a/src/devices/cpu/se3208/se3208.h +++ b/src/devices/cpu/se3208/se3208.h @@ -32,7 +32,6 @@ class se3208_device : public cpu_device // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/sh/sh2.h b/src/devices/cpu/sh/sh2.h index a75f1c53f9277..a552318df4614 100644 --- a/src/devices/cpu/sh/sh2.h +++ b/src/devices/cpu/sh/sh2.h @@ -42,7 +42,6 @@ class sh2_device : public sh_common_execution // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 16; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; diff --git a/src/devices/cpu/sh/sh4.h b/src/devices/cpu/sh/sh4.h index e344a42385e76..ef745d85addf9 100644 --- a/src/devices/cpu/sh/sh4.h +++ b/src/devices/cpu/sh/sh4.h @@ -263,7 +263,6 @@ class sh34_base_device : public sh_common_execution // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } diff --git a/src/devices/cpu/sh/sh_mtu.cpp b/src/devices/cpu/sh/sh_mtu.cpp index 2b612bd12b41a..f11df8381e3f5 100644 --- a/src/devices/cpu/sh/sh_mtu.cpp +++ b/src/devices/cpu/sh/sh_mtu.cpp @@ -216,7 +216,7 @@ void sh_mtu_channel_device::device_reset() m_last_clock_update = 0; m_event_time = 0; m_phase = 0; - m_counter_cycle = 0; + m_counter_cycle = 1; m_counter_incrementing = true; } @@ -419,7 +419,7 @@ void sh_mtu_channel_device::recalc_event(u64 cur_time) } if(!cur_time) - cur_time = m_cpu->total_cycles(); + cur_time = m_cpu->current_cycles(); if(m_counter_incrementing) { u32 event_delay = 0xffffffff; @@ -466,7 +466,7 @@ void sh_mtu_channel_device::update_counter(u64 cur_time) return; if(!cur_time) - cur_time = m_cpu->total_cycles(); + cur_time = m_cpu->current_cycles(); if(!m_channel_active) { m_last_clock_update = cur_time; diff --git a/src/devices/cpu/sharc/sharc.h b/src/devices/cpu/sharc/sharc.h index c9c008effdbf1..eafbd7fe74f7a 100644 --- a/src/devices/cpu/sharc/sharc.h +++ b/src/devices/cpu/sharc/sharc.h @@ -210,7 +210,6 @@ class adsp21062_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 8; } virtual uint32_t execute_max_cycles() const noexcept override { return 8; } - virtual uint32_t execute_input_lines() const noexcept override { return 32; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/sm510/sm500.cpp b/src/devices/cpu/sm510/sm500.cpp index bb440388974ee..7050d99c30dba 100644 --- a/src/devices/cpu/sm510/sm500.cpp +++ b/src/devices/cpu/sm510/sm500.cpp @@ -232,7 +232,7 @@ void sm500_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 } bool sm500_device::op_argument() diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp index 624057181cb2a..f1f2490009f68 100644 --- a/src/devices/cpu/sm510/sm510.cpp +++ b/src/devices/cpu/sm510/sm510.cpp @@ -152,7 +152,7 @@ void sm510_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 // BM high bit is only valid for 1 step m_bmask = (m_op == 0x02) ? 0x40 : 0; diff --git a/src/devices/cpu/sm510/sm510base.h b/src/devices/cpu/sm510/sm510base.h index 1e3aa5c97951f..139f5cdb79c08 100644 --- a/src/devices/cpu/sm510/sm510base.h +++ b/src/devices/cpu/sm510/sm510base.h @@ -78,7 +78,6 @@ class sm510_base_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * m_clk_div); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 3+1; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; diff --git a/src/devices/cpu/sm510/sm511.cpp b/src/devices/cpu/sm510/sm511.cpp index dc3a3763d6c1b..a9a1ad61d9731 100644 --- a/src/devices/cpu/sm510/sm511.cpp +++ b/src/devices/cpu/sm510/sm511.cpp @@ -247,7 +247,7 @@ void sm511_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 // BM high bit is only valid for 1 step m_bmask = (m_op == 0x02) ? 0x40 : 0; diff --git a/src/devices/cpu/sm510/sm530.cpp b/src/devices/cpu/sm510/sm530.cpp index 1110a22db3397..e276f53d571f2 100644 --- a/src/devices/cpu/sm510/sm530.cpp +++ b/src/devices/cpu/sm510/sm530.cpp @@ -234,7 +234,7 @@ void sm530_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 // SABM/SABL is only valid for 1 step m_bmask = (m_op == 0x72) ? 0x40 : ((m_op == 0x73) ? 0x08 : 0); diff --git a/src/devices/cpu/sm510/sm590.cpp b/src/devices/cpu/sm510/sm590.cpp index f833b7e268377..b4cecee68cc2f 100644 --- a/src/devices/cpu/sm510/sm590.cpp +++ b/src/devices/cpu/sm510/sm590.cpp @@ -172,7 +172,7 @@ void sm590_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 } bool sm590_device::op_argument() diff --git a/src/devices/cpu/sm510/sm5a.cpp b/src/devices/cpu/sm510/sm5a.cpp index c2512aeaf714a..7510cd1765545 100644 --- a/src/devices/cpu/sm510/sm5a.cpp +++ b/src/devices/cpu/sm510/sm5a.cpp @@ -152,5 +152,5 @@ void sm5a_device::execute_one() } break; // 0xfc - } // big switch + } // 0xf0 } diff --git a/src/devices/cpu/sm8500/sm8500.h b/src/devices/cpu/sm8500/sm8500.h index 5e93029c0304b..936bb42a59906 100644 --- a/src/devices/cpu/sm8500/sm8500.h +++ b/src/devices/cpu/sm8500/sm8500.h @@ -57,7 +57,6 @@ class sm8500_cpu_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 16; } - virtual uint32_t execute_input_lines() const noexcept override { return 11; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/sparc/sparc.cpp b/src/devices/cpu/sparc/sparc.cpp index 8717d56e22e26..721d77b3b77fe 100644 --- a/src/devices/cpu/sparc/sparc.cpp +++ b/src/devices/cpu/sparc/sparc.cpp @@ -1210,17 +1210,6 @@ uint32_t sparc_base_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t sparc_base_device::execute_input_lines() const noexcept -{ - return 16; -} - - //------------------------------------------------- // execute_set_input - set the state of an input // line during execution diff --git a/src/devices/cpu/sparc/sparc.h b/src/devices/cpu/sparc/sparc.h index 5a3e1bd4c2d9a..821da8e9fb18f 100644 --- a/src/devices/cpu/sparc/sparc.h +++ b/src/devices/cpu/sparc/sparc.h @@ -34,7 +34,6 @@ class sparc_base_device : public cpu_device, public sparc_mmu_host_interface, pr // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/spc700/spc700.h b/src/devices/cpu/spc700/spc700.h index 33e3190ac104f..b43c6dd71f214 100644 --- a/src/devices/cpu/spc700/spc700.h +++ b/src/devices/cpu/spc700/spc700.h @@ -23,7 +23,6 @@ class spc700_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 8; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/ssem/ssem.cpp b/src/devices/cpu/ssem/ssem.cpp index 77bc62edb142b..6e80840c8dc5b 100644 --- a/src/devices/cpu/ssem/ssem.cpp +++ b/src/devices/cpu/ssem/ssem.cpp @@ -194,17 +194,6 @@ uint32_t ssem_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t ssem_device::execute_input_lines() const noexcept -{ - return 0; -} - - //------------------------------------------------- // execute_set_input - set the state of an input // line during execution diff --git a/src/devices/cpu/ssem/ssem.h b/src/devices/cpu/ssem/ssem.h index 7cfe5d17435a6..0618055146808 100644 --- a/src/devices/cpu/ssem/ssem.h +++ b/src/devices/cpu/ssem/ssem.h @@ -33,7 +33,6 @@ class ssem_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/ssp1601/ssp1601.h b/src/devices/cpu/ssp1601/ssp1601.h index e912ff9891b88..673b0eb0f55df 100644 --- a/src/devices/cpu/ssp1601/ssp1601.h +++ b/src/devices/cpu/ssp1601/ssp1601.h @@ -32,7 +32,6 @@ class ssp1601_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 4; } - virtual uint32_t execute_input_lines() const noexcept override { return 3; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/st62xx/st62xx.cpp b/src/devices/cpu/st62xx/st62xx.cpp index 7b47c087dfd68..d1cebf0e5ae7e 100644 --- a/src/devices/cpu/st62xx/st62xx.cpp +++ b/src/devices/cpu/st62xx/st62xx.cpp @@ -495,11 +495,6 @@ uint32_t st6228_device::execute_max_cycles() const noexcept return 5; } -uint32_t st6228_device::execute_input_lines() const noexcept -{ - return 0; -} - void st6228_device::execute_set_input(int inputnum, int state) { logerror("%s: Unimplemented: execute_set_input line %d = %d\n", machine().describe_context(), inputnum, state); diff --git a/src/devices/cpu/st62xx/st62xx.h b/src/devices/cpu/st62xx/st62xx.h index 30f17b5c15519..0cb3e36ea42cb 100644 --- a/src/devices/cpu/st62xx/st62xx.h +++ b/src/devices/cpu/st62xx/st62xx.h @@ -95,7 +95,6 @@ class st6228_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/superfx/superfx.h b/src/devices/cpu/superfx/superfx.h index 54f07ec184f79..9cbe9adf35371 100644 --- a/src/devices/cpu/superfx/superfx.h +++ b/src/devices/cpu/superfx/superfx.h @@ -112,7 +112,6 @@ class superfx_device : public cpu_device, public superfx_disassembler::config virtual void device_reset() override; // device_execute_interface overrides - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/t11/t11.cpp b/src/devices/cpu/t11/t11.cpp index 5e785e6d11a87..67d160a10da76 100644 --- a/src/devices/cpu/t11/t11.cpp +++ b/src/devices/cpu/t11/t11.cpp @@ -230,11 +230,7 @@ void k1801vm1_device::t11_check_irqs() // 5. illegal insn; nm else if (m_mcir == MCIR_ILL) { - WWORD(VM1_SEL1, RWORD(VM1_SEL1) & ~SEL1_HALT); - PUSH(PSW); - PUSH(PC); - PC = RWORD(m_vsel); - PSW = RWORD(m_vsel + 2); + take_interrupt(m_vsel); } // 6. trace trap; WCPU else if (m_trace_trap && m_mcir == MCIR_NONE) // allow trap_to() to execute first @@ -294,14 +290,10 @@ void k1801vm1_device::t11_check_irqs() switch (m_mcir) { case MCIR_SET: - if (m_vsel >= 0160000) // FIXME - WWORD(VM1_SEL1, RWORD(VM1_SEL1) | SEL1_HALT); + if (m_vsel >= 0160000) + take_interrupt_halt(m_vsel); else - WWORD(VM1_SEL1, RWORD(VM1_SEL1) & ~SEL1_HALT); - PUSH(PSW); - PUSH(PC); - PC = RWORD(m_vsel); - PSW = RWORD(m_vsel + 2); + take_interrupt(m_vsel); break; case MCIR_IRQ: @@ -318,6 +310,9 @@ void k1801vm1_device::t11_check_irqs() void k1801vm1_device::take_interrupt_halt(uint16_t vector) { + // vectors in HALT mode are word (not doubleworld) aligned + assert((vector & 1) == 0); + // enter HALT mode WWORD(VM1_SEL1, RWORD(VM1_SEL1) | SEL1_HALT); @@ -475,8 +470,8 @@ void t11_device::device_start() state_add( T11_R4, "R4", m_reg[4].w.l).formatstr("%06O"); state_add( T11_R5, "R5", m_reg[5].w.l).formatstr("%06O"); - state_add(STATE_GENPC, "GENPC", m_reg[7].w.l).noshow(); - state_add(STATE_GENPCBASE, "CURPC", m_ppc.w.l).noshow(); + state_add(STATE_GENPC, "GENPC", m_reg[7].w.l).formatstr("%06O").noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_ppc.w.l).formatstr("%06O").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_psw.b.l).formatstr("%8s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/t11/t11.h b/src/devices/cpu/t11/t11.h index 2cfc843d01a8f..431da089b8f75 100644 --- a/src/devices/cpu/t11/t11.h +++ b/src/devices/cpu/t11/t11.h @@ -95,7 +95,6 @@ class t11_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 12; } virtual uint32_t execute_max_cycles() const noexcept override { return 114; } - virtual uint32_t execute_input_lines() const noexcept override { return 8; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == PF_LINE || inputnum == HLT_LINE || inputnum == BUS_ERROR; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/t11/t11ops.hxx b/src/devices/cpu/t11/t11ops.hxx index cdcfedb8ced61..c34936e2983f5 100644 --- a/src/devices/cpu/t11/t11ops.hxx +++ b/src/devices/cpu/t11/t11ops.hxx @@ -352,13 +352,13 @@ void t11_device::halt(uint16_t op) void t11_device::illegal(uint16_t op) { m_icount -= 48; - trap_to(0x08); + trap_to(T11_ILLINST); } void t11_device::illegal4(uint16_t op) { m_icount -= 48; - trap_to(0x04); + trap_to(T11_TIMEOUT); } void t11_device::mark(uint16_t op) @@ -963,13 +963,13 @@ void t11_device::bcs(uint16_t op) { m_icount -= 12; { BR( GET_C); } } void t11_device::emt(uint16_t op) { m_icount -= 48; - trap_to(0x18); + trap_to(T11_EMT); } void t11_device::trap(uint16_t op) { m_icount -= 48; - trap_to(0x1c); + trap_to(T11_TRAP); } void t11_device::clrb_rg(uint16_t op) { m_icount -= 12; { CLRB_R(RG); } } diff --git a/src/devices/cpu/tlcs870/tlcs870.h b/src/devices/cpu/tlcs870/tlcs870.h index b6c3d73478d11..189fec2f90f7b 100644 --- a/src/devices/cpu/tlcs870/tlcs870.h +++ b/src/devices/cpu/tlcs870/tlcs870.h @@ -51,7 +51,6 @@ class tlcs870_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 26; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index be2f05a181aff..00e1bde96e417 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -6,10 +6,6 @@ emulation by Luca Elia, based on the Z80 core by Juergen Buchmueller - ChangeLog: - - 20150517 Fixed TRUN bit masking (timers start/stop handling) [Rainer Keuchel] - *************************************************************************************************************/ #include "emu.h" @@ -284,31 +280,28 @@ static uint8_t SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r #define OP_16 0x80 - - - -#define OP( X,CT ) m_op = X; m_cyc_t = (CT*2); -#define OP16( X,CT ) OP( (X)|OP_16,CT ) - -#define OPCC( X,CF,CT ) OP( X, CT ) m_cyc_f = (CF*2); -#define OPCC16( X,CF,CT ) OPCC( (X)|OP_16,CF,CT ) - -#define BIT8( N,I ) m_mode##N = e_mode::BIT8; m_r##N = I; -#define I8( N,I ) m_mode##N = e_mode::I8; m_r##N = I; -#define D8( N,I ) m_mode##N = e_mode::D8; m_r##N = I; -#define I16( N,I ) m_mode##N = e_mode::I16; m_r##N = I; -#define D16( N,I ) m_mode##N = e_mode::D16; m_r##N = I; -#define R8( N,R ) m_mode##N = e_mode::R8; m_r##N = R; -#define R16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; -#define Q16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; if (m_r##N == SP) m_r##N = AF; -#define MI16( N,I ) m_mode##N = e_mode::MI16; m_r##N = I; -#define MR16( N,R ) m_mode##N = e_mode::MR16; m_r##N = R; -#define MR16D8( N,R,I ) m_mode##N = e_mode::MR16D8; m_r##N = R; m_r##N##b = I; -#define MR16R8( N,R,g ) m_mode##N = e_mode::MR16R8; m_r##N = R; m_r##N##b = g; -#define NONE( N ) m_mode##N = e_mode::NONE; -#define CC( N,cc ) m_mode##N = e_mode::CC; m_r##N = cc; -#define R16D8( N,R,I ) m_mode##N = e_mode::R16D8; m_r##N = R; m_r##N##b = I; -#define R16R8( N,R,g ) m_mode##N = e_mode::R16R8; m_r##N = R; m_r##N##b = g; +#define OP( X,CT ) m_op = X; m_cyc_t = (CT*2); +#define OP16( X,CT ) OP( (X)|OP_16,CT ) + +#define OPCC( X,CF,CT ) OP( X, CT ) m_cyc_f = (CF*2); +#define OPCC16( X,CF,CT ) OPCC( (X)|OP_16,CF,CT ) + +#define BIT8( N,I ) m_mode##N = e_mode::BIT8; m_r##N = I; +#define I8( N,I ) m_mode##N = e_mode::I8; m_r##N = I; +#define D8( N,I ) m_mode##N = e_mode::D8; m_r##N = I; +#define I16( N,I ) m_mode##N = e_mode::I16; m_r##N = I; +#define D16( N,I ) m_mode##N = e_mode::D16; m_r##N = I; +#define R8( N,R ) m_mode##N = e_mode::R8; m_r##N = R; +#define R16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; +#define Q16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; if (m_r##N == SP) m_r##N = AF; +#define MI16( N,I ) m_mode##N = e_mode::MI16; m_r##N = I; +#define MR16( N,R ) m_mode##N = e_mode::MR16; m_r##N = R; +#define MR16D8( N,R,I ) m_mode##N = e_mode::MR16D8; m_r##N = R; m_r##N##b = I; +#define MR16R8( N,R,g ) m_mode##N = e_mode::MR16R8; m_r##N = R; m_r##N##b = g; +#define NONE( N ) m_mode##N = e_mode::NONE; +#define CC( N,cc ) m_mode##N = e_mode::CC; m_r##N = cc; +#define R16D8( N,R,I ) m_mode##N = e_mode::R16D8; m_r##N = R; m_r##N##b = I; +#define R16R8( N,R,g ) m_mode##N = e_mode::R16R8; m_r##N = R; m_r##N##b = g; uint8_t tlcs90_device::RM8 (uint32_t a) { return m_program->read_byte( a ); } uint16_t tlcs90_device::RM16(uint32_t a) { return RM8(a) | (RM8( (a+1) & 0xffff ) << 8); } @@ -2130,11 +2123,6 @@ void tlcs90_device::device_reset() std::fill(std::begin(m_treg_16bit), std::end(m_treg_16bit), 0); } -void tlcs90_device::execute_burn(int32_t cycles) -{ - m_icount -= 4 * ((cycles + 3) / 4); -} - /************************************************************************************************************* diff --git a/src/devices/cpu/tlcs90/tlcs90.h b/src/devices/cpu/tlcs90/tlcs90.h index d42eb7192555e..c7e9b598003cf 100644 --- a/src/devices/cpu/tlcs90/tlcs90.h +++ b/src/devices/cpu/tlcs90/tlcs90.h @@ -5,30 +5,30 @@ #pragma once -enum tlcs90_e_irq { INTSWI = 0, INTNMI, INTWD, INT0, INTT0, INTT1, INTT2, INTT3, INTT4, INT1, INTT5, INT2, INTRX, INTTX, INTMAX }; -DECLARE_ENUM_INCDEC_OPERATORS(tlcs90_e_irq) class tlcs90_device : public cpu_device { - static constexpr int MAX_PORTS = 9; - //static constexpr int MAX_ANALOG_INPUTS = 16; - -protected: - TIMER_CALLBACK_MEMBER( t90_timer_callback ); - TIMER_CALLBACK_MEMBER( t90_timer4_callback ); - - void tmp90840_regs(address_map &map); - void tmp90840_mem(address_map &map); - void tmp90841_mem(address_map &map); - void tmp90844_regs(address_map &map); - void tmp90ph44_mem(address_map &map); - void tmp91640_mem(address_map &map); - void tmp91641_mem(address_map &map); - - enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; - - public: + enum tlcs90_e_irq + { + INTSWI = 0, + INTNMI, + INTWD, + INT0, + INTT0, + INTT1, + INTT2, + INTT3, + INTT4, + INT1, + INTT5, + INT2, + INTRX, + INTTX, + + INTMAX + }; + // configuration template auto port_read() { return m_port_read_cb[Port].bind(); } template auto port_write() { return m_port_write_cb[Port].bind(); } @@ -44,11 +44,9 @@ class tlcs90_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 26; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual void execute_burn(int32_t cycles) override; // device_memory_interface overrides virtual space_config_vector memory_space_config() const override; @@ -56,6 +54,18 @@ class tlcs90_device : public cpu_device // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + // address maps + void tmp90840_regs(address_map &map); + void tmp90840_mem(address_map &map); + void tmp90841_mem(address_map &map); + void tmp90844_regs(address_map &map); + void tmp90ph44_mem(address_map &map); + void tmp91640_mem(address_map &map); + void tmp91641_mem(address_map &map); + + TIMER_CALLBACK_MEMBER(t90_timer_callback); + TIMER_CALLBACK_MEMBER(t90_timer4_callback); + // internal registers uint8_t p1_r(); void p1_w(uint8_t data); @@ -104,7 +114,21 @@ class tlcs90_device : public cpu_device void reserved_w(offs_t offset, uint8_t data); private: - enum class e_mode : u8 { + enum _e_op + { + UNKNOWN, + NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, + LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, + JP, JR, CALL, CALLR, RET, RETI, HALT, DI, + EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, + CCF, TSET, BIT, SET, RES, INC, DEC, INCX, + DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, + XOR, OR, CP, RLC, RRC, RL, RR, SLA, + SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV + }; + + enum class e_mode : u8 + { NONE, BIT8, CC, I8, D8, R8, I16, D16, R16, @@ -112,18 +136,21 @@ class tlcs90_device : public cpu_device R16D8, R16R8 }; + static constexpr int MAX_PORTS = 9; + //static constexpr int MAX_ANALOG_INPUTS = 16; + address_space_config m_program_config; devcb_read8::array m_port_read_cb; devcb_write8::array m_port_write_cb; - PAIR m_prvpc,m_pc,m_sp,m_af,m_bc,m_de,m_hl,m_ix,m_iy; - PAIR m_af2,m_bc2,m_de2,m_hl2; - uint8_t m_halt, m_after_EI; - uint16_t m_irq_state, m_irq_line_state, m_irq_mask; + PAIR m_prvpc, m_pc, m_sp, m_af, m_bc, m_de, m_hl, m_ix, m_iy; + PAIR m_af2, m_bc2, m_de2, m_hl2; + uint8_t m_halt, m_after_EI; + uint16_t m_irq_state, m_irq_line_state, m_irq_mask; address_space *m_program; - int m_icount; - int m_extra_cycles; // extra cycles for interrupts + int m_icount; + int m_extra_cycles; // extra cycles for interrupts uint8_t m_port_latch[MAX_PORTS]; @@ -134,13 +161,13 @@ class tlcs90_device : public cpu_device uint8_t m_p8cr; uint8_t m_smmod; - uint32_t m_ixbase,m_iybase; + uint32_t m_ixbase,m_iybase; // Timers: 4 x 8-bit + 1 x 16-bit - emu_timer *m_timer[4+1]; - uint8_t m_timer_value[4]; - uint16_t m_timer4_value; - attotime m_timer_period; + emu_timer *m_timer[4+1]; + uint8_t m_timer_value[4]; + uint16_t m_timer4_value; + attotime m_timer_period; uint8_t m_tmod; uint8_t m_tclk; uint8_t m_trun; @@ -149,44 +176,44 @@ class tlcs90_device : public cpu_device uint16_t m_treg_16bit[2]; // Work registers - uint8_t m_op; + uint8_t m_op; - e_mode m_mode1; - uint16_t m_r1,m_r1b; + e_mode m_mode1; + uint16_t m_r1, m_r1b; - e_mode m_mode2; - uint16_t m_r2,m_r2b; + e_mode m_mode2; + uint16_t m_r2, m_r2b; - int m_cyc_t,m_cyc_f; + int m_cyc_t, m_cyc_f; - uint32_t m_addr; + uint32_t m_addr; - inline uint8_t RM8 (uint32_t a); + inline uint8_t RM8(uint32_t a); inline uint16_t RM16(uint32_t a); - inline void WM8 (uint32_t a, uint8_t v); + inline void WM8(uint32_t a, uint8_t v); inline void WM16(uint32_t a, uint16_t v); - inline uint8_t RX8 (uint32_t a, uint32_t base); + inline uint8_t RX8(uint32_t a, uint32_t base); inline uint16_t RX16(uint32_t a, uint32_t base); - inline void WX8 (uint32_t a, uint8_t v, uint32_t base); + inline void WX8(uint32_t a, uint8_t v, uint32_t base); inline void WX16(uint32_t a, uint16_t v, uint32_t base); - inline uint8_t READ8(); + inline uint8_t READ8(); inline uint16_t READ16(); void decode(); - inline uint16_t r8( const uint16_t r ); - inline void w8( const uint16_t r, uint16_t value ); - inline uint16_t r16( const uint16_t r ); - inline void w16( const uint16_t r, uint16_t value ); + inline uint16_t r8(const uint16_t r); + inline void w8(const uint16_t r, uint16_t value); + inline uint16_t r16(const uint16_t r); + inline void w16(const uint16_t r, uint16_t value); inline uint8_t Read1_8(); inline uint16_t Read1_16(); inline uint8_t Read2_8(); inline uint16_t Read2_16(); - inline void Write1_8( uint8_t value ); - inline void Write1_16( uint16_t value ); - inline void Write2_8( uint8_t value ); - inline void Write2_16( uint16_t value ); - inline int Test( uint8_t cond ); - inline void Push( uint16_t rr ); - inline void Pop( uint16_t rr ); + inline void Write1_8(uint8_t value); + inline void Write1_16(uint16_t value); + inline void Write2_8(uint8_t value); + inline void Write2_16(uint16_t value); + inline int Test(uint8_t cond); + inline void Push(uint16_t rr); + inline void Pop(uint16_t rr); inline void halt(); inline void leave_halt(); inline void raise_irq(int irq); @@ -275,6 +302,8 @@ class tmp90ph44_device : public tlcs90_device }; +DECLARE_ENUM_INCDEC_OPERATORS(tlcs90_device::tlcs90_e_irq) + DECLARE_DEVICE_TYPE(TMP90840, tmp90840_device) DECLARE_DEVICE_TYPE(TMP90841, tmp90841_device) DECLARE_DEVICE_TYPE(TMP90845, tmp90845_device) diff --git a/src/devices/cpu/tlcs90/tlcs90d.cpp b/src/devices/cpu/tlcs90/tlcs90d.cpp index 8f850d4c48672..4254faddd2b08 100644 --- a/src/devices/cpu/tlcs90/tlcs90d.cpp +++ b/src/devices/cpu/tlcs90/tlcs90d.cpp @@ -2,25 +2,39 @@ // copyright-holders:Luca Elia /************************************************************************************************************* - Toshiba TLCS-90 Series MCU's - - emulation by Luca Elia, based on the Z80 core by Juergen Buchmueller - - ChangeLog: - - 20150517 Fixed TRUN bit masking (timers start/stop handling) [Rainer Keuchel] + Toshiba TLCS-90 Series MCU's disassembler *************************************************************************************************************/ #include "emu.h" #include "tlcs90d.h" -const char *const tlcs90_disassembler::op_names[] = { "??", "nop", "ex", "exx", "ld", "ldw", "lda", "ldi", "ldir", "ldd", "lddr", "cpi", "cpir", "cpd", "cpdr", "push", "pop", "jp", "jr", "call", "callr", "ret", "reti", "halt", "di", "ei", "swi", "daa", "cpl", "neg", "ldar", "rcf", "scf", "ccf", "tset", "bit", "set", "res", "inc", "dec", "incx", "decx", "incw", "decw", "add", "adc", "sub", "sbc", "and", "xor", "or", "cp", "rlc", "rrc", "rl", "rr", "sla", "sra", "sll", "srl", "rld", "rrd", "djnz", "mul", "div" }; +const char *const tlcs90_disassembler::op_names[] = +{ + "??", + "nop", "ex", "exx", "ld", "ldw", "lda", "ldi", "ldir", + "ldd", "lddr", "cpi", "cpir", "cpd", "cpdr", "push", "pop", + "jp", "jr", "call", "callr","ret", "reti", "halt", "di", + "ei", "swi", "daa", "cpl", "neg", "ldar", "rcf", "scf", + "ccf", "tset", "bit", "set", "res", "inc", "dec", "incx", + "decx", "incw", "decw", "add", "adc", "sub", "sbc", "and", + "xor", "or", "cp", "rlc", "rrc", "rl", "rr", "sla", + "sra", "sll", "srl", "rld", "rrd", "djnz", "mul", "div" +}; -const char *const tlcs90_disassembler::r8_names[] = { "b", "c", "d", "e", "h", "l", "a" }; -const char *const tlcs90_disassembler::r16_names[] = { "bc", "de", "hl", "??", "ix", "iy", "sp", "af", "af'", "pc" }; +const char *const tlcs90_disassembler::r8_names[] = +{ + "b", "c", "d", "e", "h", "l", "a" +}; +const char *const tlcs90_disassembler::r16_names[] = +{ + "bc", "de", "hl", "??", "ix", "iy", "sp", "af", "af'", "pc" +}; -const char *const tlcs90_disassembler::cc_names[] = { "f", "lt", "le", "ule", "ov", "mi", "z", "c", "", "ge", "gt", "ugt", "nov", "pl", "nz", "nc" }; +const char *const tlcs90_disassembler::cc_names[] = +{ + "f", "lt", "le", "ule", "ov", "mi", "z", "c", "", "ge", "gt", "ugt", "nov", "pl", "nz", "nc" +}; u32 tlcs90_disassembler::opcode_alignment() const { @@ -32,7 +46,8 @@ tlcs90_disassembler::tlcs90_disassembler(uint16_t iobase, const char *const ir_n { } -const char *const tmp90840_disassembler::ir_names[0x40] = { +const char *const tmp90840_disassembler::ir_names[0x40] = +{ "P0", "P1", "P01CR/IRFL", "IRFH", "P2", "P2CR", "P3", "P3CR", "P4", "P4CR", "P5", "SMMOD", "P6", "P7", "P67CR", "SMCR", "P8", "P8CR", "WDMOD", "WDCR", "TREG0", "TREG1", "TREG2", "TREG3", @@ -48,7 +63,8 @@ tmp90840_disassembler::tmp90840_disassembler() { } -const char *const tmp90844_disassembler::ir_names[0x40] = { +const char *const tmp90844_disassembler::ir_names[0x40] = +{ "P0", "P0CR", "P1", "P1CR", "P2", "P2CR", "P3", "P3CR", "P4", "P4CR", "P5", "P6", "P7", "P67CR", "P23FR", "P4FR", "P67FR", "P25FR", "WDMOD", "WDCR", "TREG0", "TREG1", "TREG2", "TREG3", @@ -64,7 +80,8 @@ tmp90844_disassembler::tmp90844_disassembler() { } -const char *const tmp90c051_disassembler::ir_names[0x4c] = { +const char *const tmp90c051_disassembler::ir_names[0x4c] = +{ "P2", "P2CR", "P3", "P3CR", "P3FR", "P4", "P5", "P45CR", "P45FR", "P6", "P6CR", "P6FR", "TREG0", "TREG1", "TREG2", "TREG3", "T01MOD", "T23MOD", "TFFCR", "TRDC", @@ -143,28 +160,28 @@ const char *tlcs90_disassembler::internal_registers_names(uint16_t x) const #define ZF 0x40 #define SF 0x80 -#define OP( X,CT ) m_op = X; -#define OP16( X,CT ) m_op = X; - -#define OPCC( X,CF,CT ) m_op = X; -#define OPCC16( X,CF,CT ) m_op = X; - -#define BIT8( N,I ) m_mode##N = e_mode::BIT8; m_r##N = I; -#define I8( N,I ) m_mode##N = e_mode::I8; m_r##N = I; -#define D8( N,I ) m_mode##N = e_mode::D8; m_r##N = I; -#define I16( N,I ) m_mode##N = e_mode::I16; m_r##N = I; -#define D16( N,I ) m_mode##N = e_mode::D16; m_r##N = I; -#define R8( N,R ) m_mode##N = e_mode::R8; m_r##N = R; -#define R16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; -#define Q16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; if (m_r##N == SP) m_r##N = AF; -#define MI16( N,I ) m_mode##N = e_mode::MI16; m_r##N = I; -#define MR16( N,R ) m_mode##N = e_mode::MR16; m_r##N = R; -#define MR16D8( N,R,I ) m_mode##N = e_mode::MR16D8; m_r##N = R; m_r##N##b = I; -#define MR16R8( N,R,g ) m_mode##N = e_mode::MR16R8; m_r##N = R; m_r##N##b = g; -#define NONE( N ) m_mode##N = e_mode::NONE; -#define CC( N,cc ) m_mode##N = e_mode::CC; m_r##N = cc; -#define R16D8( N,R,I ) m_mode##N = e_mode::R16D8; m_r##N = R; m_r##N##b = I; -#define R16R8( N,R,g ) m_mode##N = e_mode::R16R8; m_r##N = R; m_r##N##b = g; +#define OP( X,CT ) m_op = X; +#define OP16( X,CT ) m_op = X; + +#define OPCC( X,CF,CT ) m_op = X; +#define OPCC16( X,CF,CT ) m_op = X; + +#define BIT8( N,I ) m_mode##N = e_mode::BIT8; m_r##N = I; +#define I8( N,I ) m_mode##N = e_mode::I8; m_r##N = I; +#define D8( N,I ) m_mode##N = e_mode::D8; m_r##N = I; +#define I16( N,I ) m_mode##N = e_mode::I16; m_r##N = I; +#define D16( N,I ) m_mode##N = e_mode::D16; m_r##N = I; +#define R8( N,R ) m_mode##N = e_mode::R8; m_r##N = R; +#define R16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; +#define Q16( N,R ) m_mode##N = e_mode::R16; m_r##N = R; if (m_r##N == SP) m_r##N = AF; +#define MI16( N,I ) m_mode##N = e_mode::MI16; m_r##N = I; +#define MR16( N,R ) m_mode##N = e_mode::MR16; m_r##N = R; +#define MR16D8( N,R,I ) m_mode##N = e_mode::MR16D8; m_r##N = R; m_r##N##b = I; +#define MR16R8( N,R,g ) m_mode##N = e_mode::MR16R8; m_r##N = R; m_r##N##b = g; +#define NONE( N ) m_mode##N = e_mode::NONE; +#define CC( N,cc ) m_mode##N = e_mode::CC; m_r##N = cc; +#define R16D8( N,R,I ) m_mode##N = e_mode::R16D8; m_r##N = R; m_r##N##b = I; +#define R16R8( N,R,g ) m_mode##N = e_mode::R16R8; m_r##N = R; m_r##N##b = g; uint8_t tlcs90_disassembler::READ8() { @@ -960,7 +977,7 @@ bool tlcs90_disassembler::stream_arg(std::ostream &stream, uint32_t pc, const ch if (reg_name) util::stream_format(stream, "%s(%s)", pre, reg_name); else - util::stream_format(stream, "%s($%04X)", pre, r ); + util::stream_format(stream, "%s($%04X)", pre, r); return true; case e_mode::R8: util::stream_format(stream, "%s%s", pre, r8_names[r] ); return true; case e_mode::R16: util::stream_format(stream, "%s%s", pre, r16_names[r] ); return true; diff --git a/src/devices/cpu/tlcs90/tlcs90d.h b/src/devices/cpu/tlcs90/tlcs90d.h index 2c71cd432d27d..a8392e74eb356 100644 --- a/src/devices/cpu/tlcs90/tlcs90d.h +++ b/src/devices/cpu/tlcs90/tlcs90d.h @@ -2,13 +2,7 @@ // copyright-holders:Luca Elia /************************************************************************************************************* - Toshiba TLCS-90 Series MCU's - - emulation by Luca Elia, based on the Z80 core by Juergen Buchmueller - - ChangeLog: - - 20150517 Fixed TRUN bit masking (timers start/stop handling) [Rainer Keuchel] + Toshiba TLCS-90 Series MCU's disassembler *************************************************************************************************************/ @@ -28,9 +22,21 @@ class tlcs90_disassembler : public util::disasm_interface tlcs90_disassembler(uint16_t iobase, const char *const ir_names[]); private: - enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; + enum _e_op + { + UNKNOWN, + NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, + LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, + JP, JR, CALL, CALLR, RET, RETI, HALT, DI, + EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, + CCF, TSET, BIT, SET, RES, INC, DEC, INCX, + DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, + XOR, OR, CP, RLC, RRC, RL, RR, SLA, + SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV + }; - enum class e_mode : u8 { + enum class e_mode : u8 + { NONE, BIT8, CC, I8, D8, R8, I16, D16, R16, @@ -46,18 +52,18 @@ class tlcs90_disassembler : public util::disasm_interface const uint16_t m_iobase; const char *const *m_ir_names; - uint8_t m_op; + uint8_t m_op; - e_mode m_mode1; - uint16_t m_r1,m_r1b; + e_mode m_mode1; + uint16_t m_r1, m_r1b; - e_mode m_mode2; - uint16_t m_r2,m_r2b; + e_mode m_mode2; + uint16_t m_r2, m_r2b; offs_t m_addr; const data_buffer *m_opcodes; - inline uint8_t READ8(); + inline uint8_t READ8(); inline uint16_t READ16(); void decode(); diff --git a/src/devices/cpu/tlcs900/tlcs900.cpp b/src/devices/cpu/tlcs900/tlcs900.cpp index 166a07db6e856..0dcceeb01532d 100644 --- a/src/devices/cpu/tlcs900/tlcs900.cpp +++ b/src/devices/cpu/tlcs900/tlcs900.cpp @@ -70,13 +70,12 @@ std::unique_ptr tlcs900_device::create_disassembler() } -/* Flag defines */ -#define FLAG_CF 0x01 -#define FLAG_NF 0x02 -#define FLAG_VF 0x04 -#define FLAG_HF 0x10 -#define FLAG_ZF 0x40 -#define FLAG_SF 0x80 +static constexpr u8 FLAG_CF = 0x01; +static constexpr u8 FLAG_NF = 0x02; +static constexpr u8 FLAG_VF = 0x04; +static constexpr u8 FLAG_HF = 0x10; +static constexpr u8 FLAG_ZF = 0x40; +static constexpr u8 FLAG_SF = 0x80; inline uint8_t tlcs900_device::RDOP() diff --git a/src/devices/cpu/tlcs900/tlcs900.h b/src/devices/cpu/tlcs900/tlcs900.h index a700735e4bebb..f2cfa8d372319 100644 --- a/src/devices/cpu/tlcs900/tlcs900.h +++ b/src/devices/cpu/tlcs900/tlcs900.h @@ -57,7 +57,6 @@ class tlcs900_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } /* FIXME */ virtual uint32_t execute_max_cycles() const noexcept override { return 1; } /* FIXME */ - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; diff --git a/src/devices/cpu/tlcs900/tmp95c061.cpp b/src/devices/cpu/tlcs900/tmp95c061.cpp index d74d7baa0a114..55c591cc74542 100644 --- a/src/devices/cpu/tlcs900/tmp95c061.cpp +++ b/src/devices/cpu/tlcs900/tmp95c061.cpp @@ -14,26 +14,12 @@ DEFINE_DEVICE_TYPE(TMP95C061, tmp95c061_device, "tmp95c061", "Toshiba TMP95C061" tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C061, tag, owner, clock), - m_port1_read(*this, 0), - m_port1_write(*this), - m_port2_write(*this), - m_port5_read(*this, 0), - m_port5_write(*this), - m_port6_read(*this, 0), - m_port6_write(*this), - m_port7_read(*this, 0), - m_port7_write(*this), - m_port8_read(*this, 0), - m_port8_write(*this), - m_port9_read(*this, 0), - m_porta_read(*this, 0), - m_porta_write(*this), - m_portb_read(*this, 0), - m_portb_write(*this), m_an_read(*this, 0), - m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_read(*this, 0), + m_port_write(*this), + m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_trun(0), m_t8_reg{ 0, 0, 0, 0 }, m_t8_mode{ 0, 0 }, @@ -67,26 +53,79 @@ tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *ta { } +template +void tmp95c061_device::port_w(uint8_t data) +{ + m_port_latch[P] = data; + m_port_write[P](0, data, 0xff); +} + +template +uint8_t tmp95c061_device::port_r() +{ + return m_port_read[P](0); +} + +template +void tmp95c061_device::port_cr_w(uint8_t data) +{ + m_port_control[P] = data; +} + +template +void tmp95c061_device::port_fc_w(uint8_t data) +{ + m_port_function[P] = data; +} + +template <> +void tmp95c061_device::port_w(uint8_t data) +{ + m_port_latch[PORT_A] = data; + update_porta(); +} + +template <> +void tmp95c061_device::port_cr_w(uint8_t data) +{ + m_port_control[PORT_A] = data; + update_porta(); +} + +template <> +void tmp95c061_device::port_fc_w(uint8_t data) +{ + m_port_function[PORT_A] = data; + update_porta(); +} + +void tmp95c061_device::update_porta() +{ + int fc = (m_to1 << 2) | (m_to3 << 3); + + m_port_write[PORT_A](0, ((fc & m_port_function[PORT_A]) | (m_port_latch[PORT_A] & ~m_port_function[PORT_A])) & m_port_control[PORT_A], 0xff); +} + void tmp95c061_device::internal_mem(address_map &map) { - map(0x000001, 0x000001).rw(FUNC(tmp95c061_device::p1_r), FUNC(tmp95c061_device::p1_w)); - map(0x000004, 0x000004).w(FUNC(tmp95c061_device::p1cr_w)); - map(0x000006, 0x000006).rw(FUNC(tmp95c061_device::p2_r), FUNC(tmp95c061_device::p2_w)); - map(0x000009, 0x000009).w(FUNC(tmp95c061_device::p2fc_w)); - map(0x00000d, 0x00000d).rw(FUNC(tmp95c061_device::p5_r), FUNC(tmp95c061_device::p5_w)); - map(0x000010, 0x000010).w(FUNC(tmp95c061_device::p5cr_w)); - map(0x000011, 0x000011).w(FUNC(tmp95c061_device::p5fc_w)); - map(0x000012, 0x000012).rw(FUNC(tmp95c061_device::p6_r), FUNC(tmp95c061_device::p6_w)); - map(0x000013, 0x000013).rw(FUNC(tmp95c061_device::p7_r), FUNC(tmp95c061_device::p7_w)); - map(0x000015, 0x000015).w(FUNC(tmp95c061_device::p6fc_w)); - map(0x000016, 0x000016).w(FUNC(tmp95c061_device::p7cr_w)); - map(0x000017, 0x000017).w(FUNC(tmp95c061_device::p7fc_w)); - map(0x000018, 0x000018).rw(FUNC(tmp95c061_device::p8_r), FUNC(tmp95c061_device::p8_w)); - map(0x000019, 0x000019).r(FUNC(tmp95c061_device::p9_r)); - map(0x00001a, 0x00001a).w(FUNC(tmp95c061_device::p8cr_w)); - map(0x00001b, 0x00001b).w(FUNC(tmp95c061_device::p8fc_w)); - map(0x00001e, 0x00001e).rw(FUNC(tmp95c061_device::pa_r), FUNC(tmp95c061_device::pa_w)); - map(0x00001f, 0x00001f).rw(FUNC(tmp95c061_device::pb_r), FUNC(tmp95c061_device::pb_w)); + map(0x000001, 0x000001).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000004, 0x000004).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x000006, 0x000006).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000009, 0x000009).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x00000d, 0x00000d).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000010, 0x000010).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x000011, 0x000011).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x000012, 0x000012).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000013, 0x000013).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000015, 0x000015).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x000016, 0x000016).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x000017, 0x000017).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x000018, 0x000018).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x000019, 0x000019).r(FUNC(tmp95c061_device::port_r)); + map(0x00001a, 0x00001a).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x00001b, 0x00001b).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x00001e, 0x00001e).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); + map(0x00001f, 0x00001f).rw(FUNC(tmp95c061_device::port_r), FUNC(tmp95c061_device::port_w)); map(0x000020, 0x000020).rw(FUNC(tmp95c061_device::trun_r), FUNC(tmp95c061_device::trun_w)); map(0x000022, 0x000023).w(FUNC(tmp95c061_device::treg01_w)); map(0x000024, 0x000024).w(FUNC(tmp95c061_device::t01mod_w)); @@ -94,10 +133,10 @@ void tmp95c061_device::internal_mem(address_map &map) map(0x000026, 0x000027).w(FUNC(tmp95c061_device::treg23_w)); map(0x000028, 0x000028).w(FUNC(tmp95c061_device::t23mod_w)); map(0x000029, 0x000029).rw(FUNC(tmp95c061_device::trdc_r), FUNC(tmp95c061_device::trdc_w)); - map(0x00002c, 0x00002c).w(FUNC(tmp95c061_device::pacr_w)); - map(0x00002d, 0x00002d).w(FUNC(tmp95c061_device::pafc_w)); - map(0x00002e, 0x00002e).w(FUNC(tmp95c061_device::pbcr_w)); - map(0x00002f, 0x00002f).w(FUNC(tmp95c061_device::pbfc_w)); + map(0x00002c, 0x00002c).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x00002d, 0x00002d).w(FUNC(tmp95c061_device::port_fc_w)); + map(0x00002e, 0x00002e).w(FUNC(tmp95c061_device::port_cr_w)); + map(0x00002f, 0x00002f).w(FUNC(tmp95c061_device::port_fc_w)); map(0x000030, 0x000033).w(FUNC(tmp95c061_device::treg45_w)); map(0x000034, 0x000037).r(FUNC(tmp95c061_device::cap12_r)); map(0x000038, 0x000038).rw(FUNC(tmp95c061_device::t4mod_r), FUNC(tmp95c061_device::t4mod_w)); @@ -207,18 +246,18 @@ void tmp95c061_device::device_reset() m_timer_change[2] = 0; m_timer_change[3] = 0; - m_port_latch[1] = 0x00; - m_port_latch[2] = 0xff; - m_port_latch[5] = 0x3d; - m_port_latch[6] = 0x3b; - m_port_latch[7] = 0xff; - m_port_latch[8] = 0x3f; - m_port_latch[0xa] = 0x0f; - m_port_latch[0xb] = 0xff; - std::fill_n(&m_port_control[0], 0xc, 0x00); - std::fill_n(&m_port_function[0], 0xc, 0x00); - m_port_control[0xa] = 0x0c; // HACK ngpc needs this but should be zero - m_port_function[0xa] = 0x0c; // HACK ngpc needs this but should be zero + m_port_latch[PORT_1] = 0x00; + m_port_latch[PORT_2] = 0xff; + m_port_latch[PORT_5] = 0x3d; + m_port_latch[PORT_6] = 0x3b; + m_port_latch[PORT_7] = 0xff; + m_port_latch[PORT_8] = 0x3f; + m_port_latch[PORT_A] = 0x0f; + m_port_latch[PORT_B] = 0xff; + std::fill_n(&m_port_control[0], NUM_PORTS, 0x00); + std::fill_n(&m_port_function[0], NUM_PORTS, 0x00); + m_port_control[PORT_A] = 0x0c; // HACK ngpc needs this but should be zero + m_port_function[PORT_A] = 0x0c; // HACK ngpc needs this but should be zero m_trun = 0x00; std::fill_n(&m_t8_mode[0], 2, 0x00); m_t8_invert = 0xcc; @@ -257,50 +296,52 @@ void tmp95c061_device::device_reset() } } +enum +{ + INTE0AD, + INTE45, + INTE67, + INTET10, + INTET32, + INTET54, + INTET76, + INTES0, + INTES1, + INTETC10, + INTETC32 +}; -#define TMP95C061_INTE0AD 0x0 -#define TMP95C061_INTE45 0x1 -#define TMP95C061_INTE67 0x2 -#define TMP95C061_INTET10 0x3 -#define TMP95C061_INTET32 0x4 -#define TMP95C061_INTET54 0x5 -#define TMP95C061_INTET76 0x6 -#define TMP95C061_INTES0 0x7 -#define TMP95C061_INTES1 0x8 -#define TMP95C061_INTETC10 0x9 -#define TMP95C061_INTETC32 0xa - -#define TMP95C061_NUM_MASKABLE_IRQS 22 static const struct { uint8_t reg; uint8_t iff; uint8_t vector; -} tmp95c061_irq_vector_map[TMP95C061_NUM_MASKABLE_IRQS] = -{ - { TMP95C061_INTETC32, 0x80, 0x80 }, /* INTTC3 */ - { TMP95C061_INTETC32, 0x08, 0x7c }, /* INTTC2 */ - { TMP95C061_INTETC10, 0x80, 0x78 }, /* INTTC1 */ - { TMP95C061_INTETC10, 0x08, 0x74 }, /* INTTC0 */ - { TMP95C061_INTE0AD, 0x80, 0x70 }, /* INTAD */ - { TMP95C061_INTES1, 0x80, 0x6c }, /* INTTX1 */ - { TMP95C061_INTES1, 0x08, 0x68 }, /* INTRX1 */ - { TMP95C061_INTES0, 0x80, 0x64 }, /* INTTX0 */ - { TMP95C061_INTES0, 0x08, 0x60 }, /* INTRX0 */ - { TMP95C061_INTET76, 0x80, 0x5c }, /* INTTR7 */ - { TMP95C061_INTET76, 0x08, 0x58 }, /* INTTR6 */ - { TMP95C061_INTET54, 0x80, 0x54 }, /* INTTR5 */ - { TMP95C061_INTET54, 0x08, 0x50 }, /* INTTR4 */ - { TMP95C061_INTET32, 0x80, 0x4c }, /* INTT3 */ - { TMP95C061_INTET32, 0x08, 0x48 }, /* INTT2 */ - { TMP95C061_INTET10, 0x80, 0x44 }, /* INTT1 */ - { TMP95C061_INTET10, 0x08, 0x40 }, /* INTT0 */ - /* 0x3c - reserved */ - { TMP95C061_INTE67, 0x80, 0x38 }, /* INT7 */ - { TMP95C061_INTE67, 0x08, 0x34 }, /* INT6 */ - { TMP95C061_INTE45, 0x80, 0x30 }, /* INT5 */ - { TMP95C061_INTE45, 0x08, 0x2c }, /* INT4 */ - { TMP95C061_INTE0AD, 0x08, 0x28 } /* INT0 */ +} tmp95c061_irq_vector_map[] = +{ + { INTETC32, 0x80, 0x80 }, // INTTC3 + { INTETC32, 0x08, 0x7c }, // INTTC2 + { INTETC10, 0x80, 0x78 }, // INTTC1 + { INTETC10, 0x08, 0x74 }, // INTTC0 + { INTE0AD, 0x80, 0x70 }, // INTAD + { INTES1, 0x80, 0x6c }, // INTTX1 + { INTES1, 0x08, 0x68 }, // INTRX1 + { INTES0, 0x80, 0x64 }, // INTTX0 + { INTES0, 0x08, 0x60 }, // INTRX0 + { INTET76, 0x80, 0x5c }, // INTTR7 + { INTET76, 0x08, 0x58 }, // INTTR6 + { INTET54, 0x80, 0x54 }, // INTTR5 + { INTET54, 0x08, 0x50 }, // INTTR4 + { INTET32, 0x80, 0x4c }, // INTT3 + { INTET32, 0x08, 0x48 }, // INTT2 + { INTET10, 0x80, 0x44 }, // INTT1 + { INTET10, 0x08, 0x40 }, // INTT0 + // 0x3c - reserved + { INTE67, 0x80, 0x38 }, // INT7 + { INTE67, 0x08, 0x34 }, // INT6 + { INTE45, 0x80, 0x30 }, // INT5 + { INTE45, 0x08, 0x2c }, // INT4 + { INTE0AD, 0x08, 0x28 } // INT0 }; +static constexpr u8 NUM_MASKABLE_IRQS = sizeof(tmp95c061_irq_vector_map) / 3; int tmp95c061_device::tlcs900_process_hdma( int channel ) @@ -312,11 +353,11 @@ int tmp95c061_device::tlcs900_process_hdma( int channel ) { int irq = 0; - while( irq < TMP95C061_NUM_MASKABLE_IRQS && tmp95c061_irq_vector_map[irq].vector != vector ) + while( irq < NUM_MASKABLE_IRQS && tmp95c061_irq_vector_map[irq].vector != vector ) irq++; /* Check if our interrupt flip-flop is set */ - if ( irq < TMP95C061_NUM_MASKABLE_IRQS && m_int_reg[tmp95c061_irq_vector_map[irq].reg] & tmp95c061_irq_vector_map[irq].iff ) + if ( irq < NUM_MASKABLE_IRQS && m_int_reg[tmp95c061_irq_vector_map[irq].reg] & tmp95c061_irq_vector_map[irq].iff ) { switch( m_dmam[channel].b.l & 0x1f ) { @@ -406,16 +447,16 @@ int tmp95c061_device::tlcs900_process_hdma( int channel ) switch( channel ) { case 0: - m_int_reg[TMP95C061_INTETC10] |= 0x08; + m_int_reg[INTETC10] |= 0x08; break; case 1: - m_int_reg[TMP95C061_INTETC10] |= 0x80; + m_int_reg[INTETC10] |= 0x80; break; case 2: - m_int_reg[TMP95C061_INTETC32] |= 0x08; + m_int_reg[INTETC32] |= 0x08; break; case 3: - m_int_reg[TMP95C061_INTETC32] |= 0x80; + m_int_reg[INTETC32] |= 0x80; break; } } @@ -475,7 +516,7 @@ void tmp95c061_device::tlcs900_check_irqs() } /* Check regular irqs */ - for( i = 0; i < TMP95C061_NUM_MASKABLE_IRQS; i++ ) + for( i = 0; i < NUM_MASKABLE_IRQS; i++ ) { if ( m_int_reg[tmp95c061_irq_vector_map[i].reg] & tmp95c061_irq_vector_map[i].iff ) { @@ -563,7 +604,7 @@ void tmp95c061_device::tlcs900_handle_ad() m_ad_mode &= ~ 0x40; m_ad_mode |= 0x80; - m_int_reg[TMP95C061_INTE0AD] |= 0x80; + m_int_reg[INTE0AD] |= 0x80; m_check_irqs = 1; /* AD repeat mode */ @@ -661,7 +702,7 @@ void tmp95c061_device::tlcs900_handle_timers() if ( ( m_t8_mode[0] & 0xc0 ) != 0x40 ) { m_timer[0] = 0; - m_int_reg[TMP95C061_INTET10] |= 0x08; + m_int_reg[INTET10] |= 0x08; } } } @@ -691,7 +732,7 @@ void tmp95c061_device::tlcs900_handle_timers() if ( m_timer[1] == m_t8_reg[1] ) { m_timer[1] = 0; - m_int_reg[TMP95C061_INTET10] |= 0x80; + m_int_reg[INTET10] |= 0x80; if ( m_t8_invert & 0x02 ) { @@ -738,7 +779,7 @@ void tmp95c061_device::tlcs900_handle_timers() if ( ( m_t8_mode[1] & 0xc0 ) != 0x40 ) { m_timer[2] = 0; - m_int_reg[TMP95C061_INTET32] |= 0x08; + m_int_reg[INTET32] |= 0x08; } } } @@ -768,7 +809,7 @@ void tmp95c061_device::tlcs900_handle_timers() if ( m_timer[3] == m_t8_reg[3] ) { m_timer[3] = 0; - m_int_reg[TMP95C061_INTET32] |= 0x80; + m_int_reg[INTET32] |= 0x80; if ( m_t8_invert & 0x20 ) { @@ -815,38 +856,38 @@ void tmp95c061_device::execute_set_input(int input, int level) { /* Leave HALT state */ m_halted = 0; - m_int_reg[TMP95C061_INTE0AD] |= 0x08; + m_int_reg[INTE0AD] |= 0x08; } } else { /* Level detect */ if ( level == ASSERT_LINE ) - m_int_reg[TMP95C061_INTE0AD] |= 0x08; + m_int_reg[INTE0AD] |= 0x08; else - m_int_reg[TMP95C061_INTE0AD] &= ~ 0x08; + m_int_reg[INTE0AD] &= ~ 0x08; } } m_level[TLCS900_INT0] = level; break; case TLCS900_INT4: - if ( ! ( m_port_control[0xb] & 0x01 ) ) + if ( ! ( m_port_control[PORT_B] & 0x01 ) ) { if ( m_level[TLCS900_INT4] == CLEAR_LINE && level == ASSERT_LINE ) { - m_int_reg[TMP95C061_INTE45] |= 0x08; + m_int_reg[INTE45] |= 0x08; } } m_level[TLCS900_INT4] = level; break; case TLCS900_INT5: - if ( ! ( m_port_control[0xb] & 0x02 ) ) + if ( ! ( m_port_control[PORT_B] & 0x02 ) ) { if ( m_level[TLCS900_INT5] == CLEAR_LINE && level == ASSERT_LINE ) { - m_int_reg[TMP95C061_INTE45] |= 0x80; + m_int_reg[INTE45] |= 0x80; } } m_level[TLCS900_INT5] = level; @@ -866,175 +907,6 @@ void tmp95c061_device::execute_set_input(int input, int level) m_check_irqs = 1; } - -uint8_t tmp95c061_device::p1_r() -{ - return m_port1_read(0); -} - -void tmp95c061_device::p1_w(uint8_t data) -{ - m_port_latch[1] = data; - m_port1_write(0, data, 0xff); -} - -void tmp95c061_device::p1cr_w(uint8_t data) -{ - m_port_control[1] = data; -} - -uint8_t tmp95c061_device::p2_r() -{ - return m_port_latch[2]; -} - -void tmp95c061_device::p2_w(uint8_t data) -{ - m_port_latch[2] = data; - m_port2_write(0, data, 0xff); -} - -void tmp95c061_device::p2fc_w(uint8_t data) -{ - m_port_control[2] = data; -} - -uint8_t tmp95c061_device::p5_r() -{ - return m_port5_read(0); -} - -void tmp95c061_device::p5_w(uint8_t data) -{ - m_port_latch[5] = data; - m_port5_write(0, data, 0xff); -} - -void tmp95c061_device::p5cr_w(uint8_t data) -{ - m_port_control[5] = data; -} - -void tmp95c061_device::p5fc_w(uint8_t data) -{ - m_port_function[5] = data; -} - -uint8_t tmp95c061_device::p6_r() -{ - return m_port6_read(0); -} - -void tmp95c061_device::p6_w(uint8_t data) -{ - m_port_latch[6] = data; - m_port6_write(0, data, 0xff); -} - -void tmp95c061_device::p6fc_w(uint8_t data) -{ - m_port_function[6] = data; -} - -uint8_t tmp95c061_device::p7_r() -{ - return m_port7_read(0); -} - -void tmp95c061_device::p7_w(uint8_t data) -{ - m_port_latch[7] = data; - m_port7_write(0, data, 0xff); -} - -void tmp95c061_device::p7cr_w(uint8_t data) -{ - m_port_control[7] = data; -} - -void tmp95c061_device::p7fc_w(uint8_t data) -{ - m_port_function[7] = data; -} - -uint8_t tmp95c061_device::p8_r() -{ - return m_port8_read(0); -} - -void tmp95c061_device::p8_w(uint8_t data) -{ - m_port_latch[8] = data; - m_port8_write(0, data, 0xff); -} - -void tmp95c061_device::p8cr_w(uint8_t data) -{ - m_port_control[8] = data; -} - -void tmp95c061_device::p8fc_w(uint8_t data) -{ - m_port_function[8] = data; -} - -uint8_t tmp95c061_device::p9_r() -{ - return m_port9_read(0); -} - -uint8_t tmp95c061_device::pa_r() -{ - return m_porta_read(0); -} - -void tmp95c061_device::pa_w(uint8_t data) -{ - m_port_latch[0xa] = data; - update_porta(); -} - -void tmp95c061_device::pacr_w(uint8_t data) -{ - m_port_control[0xa] = data; - update_porta(); -} - -void tmp95c061_device::pafc_w(uint8_t data) -{ - m_port_function[0xa] = data; - update_porta(); -} - -void tmp95c061_device::update_porta() -{ - int fc = (m_to1 << 2) | (m_to3 << 3); - - m_porta_write(0, ((fc & m_port_function[0xa]) | (m_port_latch[0xa] & ~m_port_function[0xa])) & m_port_control[0xa], 0xff); -} - -uint8_t tmp95c061_device::pb_r() -{ - return m_portb_read(0); -} - -void tmp95c061_device::pb_w(uint8_t data) -{ - m_port_latch[0xb] = data; - m_portb_write(0, data, 0xff); -} - -void tmp95c061_device::pbcr_w(uint8_t data) -{ - m_port_control[0xb] = data; -} - -void tmp95c061_device::pbfc_w(uint8_t data) -{ - m_port_function[0xb] = data; -} - - uint8_t tmp95c061_device::trun_r() { return m_trun; @@ -1262,7 +1134,7 @@ uint8_t tmp95c061_device::sc0buf_r() void tmp95c061_device::sc0buf_w(uint8_t data) { // Fake finish sending data - m_int_reg[TMP95C061_INTES0] |= 0x80; + m_int_reg[INTES0] |= 0x80; m_check_irqs = 1; } @@ -1307,7 +1179,7 @@ uint8_t tmp95c061_device::sc1buf_r() void tmp95c061_device::sc1buf_w(uint8_t data) { // Fake finish sending data - m_int_reg[TMP95C061_INTES1] |= 0x80; + m_int_reg[INTES1] |= 0x80; m_check_irqs = 1; } @@ -1364,7 +1236,7 @@ uint8_t tmp95c061_device::adreg_r(offs_t offset) return m_ad_result[offset >> 1] >> 2; // Reading data from the upper 8 bits clears INTE0AD IADC - m_int_reg[TMP95C061_INTE0AD] &= ~0x80; + m_int_reg[INTE0AD] &= ~0x80; return m_ad_result[offset >> 1] << 6 | 0x3f; } diff --git a/src/devices/cpu/tlcs900/tmp95c061.h b/src/devices/cpu/tlcs900/tmp95c061.h index 106ca5c57ce71..fc59747457ece 100644 --- a/src/devices/cpu/tlcs900/tmp95c061.h +++ b/src/devices/cpu/tlcs900/tmp95c061.h @@ -13,26 +13,37 @@ DECLARE_DEVICE_TYPE(TMP95C061, tmp95c061_device) class tmp95c061_device : public tlcs900h_device { + static constexpr uint8_t PORT_1 = 0; // 8 bit I/O. Shared with D8-D15 + static constexpr uint8_t PORT_2 = 1; // 8 bit output only. Shared with A16-A23 + static constexpr uint8_t PORT_5 = 2; // 4 bit I/O. Shared with HWR, BUSRQ, BUSAK, RW + static constexpr uint8_t PORT_6 = 3; // 6 bit I/O. Shared with CS0, CS1, CS3/LCAS, RAS, REFOUT + static constexpr uint8_t PORT_7 = 4; // 8 bit I/O. Shared with PG0-OUT, PG1-OUT + static constexpr uint8_t PORT_8 = 5; // 6 bit I/O. Shared with TXD0, TXD1, RXD0, RXD1, CTS0, SCLK0, SCLK1 + static constexpr uint8_t PORT_9 = 6; // 4 bit input only. Shared with AN0-AN3 + static constexpr uint8_t PORT_A = 7; // 4 bit I/O. Shared with WAIT, TI0, TO1, TO2 + static constexpr uint8_t PORT_B = 8; // 8 bit I/O. Shared with TI4/INT4, TI5/INT5, TI6/INT6, TI7/INT7, TO4, TO5, TO6 + static constexpr uint8_t NUM_PORTS = 9; + public: // construction/destruction tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - auto port1_read() { return m_port1_read.bind(); } - auto port1_write() { return m_port1_write.bind(); } - auto port2_write() { return m_port2_write.bind(); } - auto port5_read() { return m_port5_read.bind(); } - auto port5_write() { return m_port5_write.bind(); } - auto port6_write() { return m_port6_write.bind(); } - auto port7_read() { return m_port7_read.bind(); } - auto port7_write() { return m_port7_write.bind(); } - auto port8_read() { return m_port8_read.bind(); } - auto port8_write() { return m_port8_write.bind(); } - auto port9_read() { return m_port9_read.bind(); } - auto porta_read() { return m_porta_read.bind(); } - auto porta_write() { return m_porta_write.bind(); } - auto portb_read() { return m_portb_read.bind(); } - auto portb_write() { return m_portb_write.bind(); } + auto port1_read() { return m_port_read[PORT_1].bind(); } + auto port1_write() { return m_port_write[PORT_1].bind(); } + auto port2_write() { return m_port_write[PORT_2].bind(); } + auto port5_read() { return m_port_read[PORT_5].bind(); } + auto port5_write() { return m_port_write[PORT_5].bind(); } + auto port6_write() { return m_port_write[PORT_6].bind(); } + auto port7_read() { return m_port_read[PORT_7].bind(); } + auto port7_write() { return m_port_write[PORT_7].bind(); } + auto port8_read() { return m_port_read[PORT_8].bind(); } + auto port8_write() { return m_port_write[PORT_8].bind(); } + auto port9_read() { return m_port_read[PORT_9].bind(); } + auto porta_read() { return m_port_read[PORT_A].bind(); } + auto porta_write() { return m_port_write[PORT_A].bind(); } + auto portb_read() { return m_port_read[PORT_B].bind(); } + auto portb_write() { return m_port_write[PORT_B].bind(); } template auto an_read() { return m_an_read[Bit].bind(); } protected: @@ -51,36 +62,10 @@ class tmp95c061_device : public tlcs900h_device void update_porta(); private: - uint8_t p1_r(); - void p1_w(uint8_t data); - void p1cr_w(uint8_t data); - uint8_t p2_r(); - void p2_w(uint8_t data); - void p2fc_w(uint8_t data); - uint8_t p5_r(); - void p5_w(uint8_t data); - void p5cr_w(uint8_t data); - void p5fc_w(uint8_t data); - uint8_t p6_r(); - void p6_w(uint8_t data); - void p6fc_w(uint8_t data); - uint8_t p7_r(); - void p7_w(uint8_t data); - void p7cr_w(uint8_t data); - void p7fc_w(uint8_t data); - uint8_t p8_r(); - void p8_w(uint8_t data); - void p8cr_w(uint8_t data); - void p8fc_w(uint8_t data); - uint8_t p9_r(); - uint8_t pa_r(); - void pa_w(uint8_t data); - void pacr_w(uint8_t data); - void pafc_w(uint8_t data); - uint8_t pb_r(); - void pb_w(uint8_t data); - void pbcr_w(uint8_t data); - void pbfc_w(uint8_t data); + template uint8_t port_r(); + template void port_w(uint8_t data); + template void port_cr_w(uint8_t data); + template void port_fc_w(uint8_t data); uint8_t trun_r(); void trun_w(uint8_t data); void treg01_w(offs_t offset, uint8_t data); @@ -150,47 +135,15 @@ class tmp95c061_device : public tlcs900h_device void internal_mem(address_map &map); - // Port 1: 8 bit I/O. Shared with D8-D15 - devcb_read8 m_port1_read; - devcb_write8 m_port1_write; - - // Port 2: 8 bit output only. Shared with A16-A23 - devcb_write8 m_port2_write; - - // Port 5: 4 bit I/O. Shared with HWR, BUSRQ, BUSAK, RW - devcb_read8 m_port5_read; - devcb_write8 m_port5_write; - - // Port 6: 6 bit I/O. Shared with CS0, CS1, CS3/LCAS, RAS, REFOUT - devcb_read8 m_port6_read; - devcb_write8 m_port6_write; - - // Port 7: 8 bit I/O. Shared with PG0-OUT, PG1-OUT - devcb_read8 m_port7_read; - devcb_write8 m_port7_write; - - // Port 8: 6 bit I/O. Shared with TXD0, TXD1, RXD0, RXD1, CTS0, SCLK0, SCLK1 - devcb_read8 m_port8_read; - devcb_write8 m_port8_write; - - // Port 9: 4 bit input only. Shared with AN0-AN3 - devcb_read8 m_port9_read; - - // Port A: 4 bit I/O. Shared with WAIT, TI0, TO1, TO2 - devcb_read8 m_porta_read; - devcb_write8 m_porta_write; - - // Port B: 8 bit I/O. Shared with TI4/INT4, TI5/INT5, TI6/INT6, TI7/INT7, TO4, TO5, TO6 - devcb_read8 m_portb_read; - devcb_write8 m_portb_write; - // analogue inputs, sampled at 10 bits devcb_read16::array<4> m_an_read; - // I/O Port Control - uint8_t m_port_latch[0xc]; - uint8_t m_port_control[0xc]; - uint8_t m_port_function[0xc]; + // I/O Ports + devcb_read8::array m_port_read; + devcb_write8::array m_port_write; + uint8_t m_port_latch[NUM_PORTS]; + uint8_t m_port_control[NUM_PORTS]; + uint8_t m_port_function[NUM_PORTS]; // Timer Control uint8_t m_trun; diff --git a/src/devices/cpu/tlcs900/tmp95c063.cpp b/src/devices/cpu/tlcs900/tmp95c063.cpp index c70a19e85cc31..6220434622858 100644 --- a/src/devices/cpu/tlcs900/tmp95c063.cpp +++ b/src/devices/cpu/tlcs900/tmp95c063.cpp @@ -14,32 +14,12 @@ DEFINE_DEVICE_TYPE(TMP95C063, tmp95c063_device, "tmp95c063", "Toshiba TMP95C063" tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C063, tag, owner, clock), - m_port1_read(*this, 0), - m_port1_write(*this), - m_port2_write(*this), - m_port5_read(*this, 0), - m_port5_write(*this), - m_port6_read(*this, 0), - m_port6_write(*this), - m_port7_read(*this, 0), - m_port7_write(*this), - m_port8_read(*this, 0), - m_port8_write(*this), - m_port9_read(*this, 0), - m_port9_write(*this), - m_porta_read(*this, 0), - m_porta_write(*this), - m_portb_read(*this, 0), - m_portb_write(*this), - m_portc_read(*this, 0), - m_portd_read(*this, 0), - m_portd_write(*this), - m_porte_read(*this, 0), - m_porte_write(*this), m_an_read(*this, 0), - m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_read(*this, 0), + m_port_write(*this), + m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_t8run(0), m_t8_reg{ 0, 0, 0, 0, 0, 0, 0, 0 }, m_t8_mode{ 0, 0, 0, 0 }, @@ -74,28 +54,54 @@ tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *ta { } +template +void tmp95c063_device::port_w(uint8_t data) +{ + m_port_latch[P] = data; + m_port_write[P](0, data, 0xff); +} + +template +uint8_t tmp95c063_device::port_r() +{ + return m_port_read[P](0); +} + +template +void tmp95c063_device::port_cr_w(uint8_t data) +{ + m_port_control[P] = data; +} + +template +void tmp95c063_device::port_fc_w(uint8_t data) +{ + m_port_function[P] = data; +} + + void tmp95c063_device::internal_mem(address_map &map) { - map(0x000001, 0x000001).rw(FUNC(tmp95c063_device::p1_r), FUNC(tmp95c063_device::p1_w)); - map(0x000004, 0x000004).w(FUNC(tmp95c063_device::p1cr_w)); - map(0x000006, 0x000006).rw(FUNC(tmp95c063_device::p2_r), FUNC(tmp95c063_device::p2_w)); - map(0x000009, 0x000009).w(FUNC(tmp95c063_device::p2fc_w)); - map(0x00000d, 0x00000d).rw(FUNC(tmp95c063_device::p5_r), FUNC(tmp95c063_device::p5_w)); - map(0x000010, 0x000010).w(FUNC(tmp95c063_device::p5cr_w)); - map(0x000011, 0x000011).w(FUNC(tmp95c063_device::p5fc_w)); - map(0x000012, 0x000012).rw(FUNC(tmp95c063_device::p6_r), FUNC(tmp95c063_device::p6_w)); - map(0x000013, 0x000013).rw(FUNC(tmp95c063_device::p7_r), FUNC(tmp95c063_device::p7_w)); - map(0x000015, 0x000015).w(FUNC(tmp95c063_device::p6fc_w)); - map(0x000016, 0x000016).w(FUNC(tmp95c063_device::p7cr_w)); - map(0x000017, 0x000017).w(FUNC(tmp95c063_device::p7fc_w)); - map(0x000018, 0x000018).rw(FUNC(tmp95c063_device::p8_r), FUNC(tmp95c063_device::p8_w)); - map(0x000019, 0x000019).rw(FUNC(tmp95c063_device::p9_r), FUNC(tmp95c063_device::p9_w)); - map(0x00001a, 0x00001a).w(FUNC(tmp95c063_device::p8cr_w)); - map(0x00001b, 0x00001b).w(FUNC(tmp95c063_device::p8fc_w)); - map(0x00001c, 0x00001c).w(FUNC(tmp95c063_device::p9cr_w)); - map(0x00001d, 0x00001d).w(FUNC(tmp95c063_device::p9fc_w)); - map(0x00001e, 0x00001e).rw(FUNC(tmp95c063_device::pa_r), FUNC(tmp95c063_device::pa_w)); - map(0x00001f, 0x00001f).rw(FUNC(tmp95c063_device::pb_r), FUNC(tmp95c063_device::pb_w)); + map(0x000001, 0x000001).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000004, 0x000004).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x000006, 0x000006).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000009, 0x000009).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x00000d, 0x00000d).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000010, 0x000010).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x000011, 0x000011).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x000012, 0x000012).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000013, 0x000013).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000015, 0x000015).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x000016, 0x000016).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x000017, 0x000017).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x000018, 0x000018).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000019, 0x000019).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x00001a, 0x00001a).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x00001b, 0x00001b).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x00001c, 0x00001c).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x00001d, 0x00001d).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x00001e, 0x00001e).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x00001f, 0x00001f).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); map(0x000020, 0x000020).rw(FUNC(tmp95c063_device::t8run_r), FUNC(tmp95c063_device::t8run_w)); map(0x000021, 0x000021).rw(FUNC(tmp95c063_device::trdc_r), FUNC(tmp95c063_device::trdc_w)); map(0x000022, 0x000023).w(FUNC(tmp95c063_device::treg01_w)); @@ -140,15 +146,15 @@ void tmp95c063_device::internal_mem(address_map &map) map(0x00006f, 0x00006f).w(FUNC(tmp95c063_device::wdcr_w)); map(0x000070, 0x00007e).rw(FUNC(tmp95c063_device::inte_r), FUNC(tmp95c063_device::inte_w)); map(0x00007f, 0x00007f).w(FUNC(tmp95c063_device::iimc_w)); - map(0x000080, 0x000080).w(FUNC(tmp95c063_device::pacr_w)); - map(0x000081, 0x000081).w(FUNC(tmp95c063_device::pafc_w)); - map(0x000082, 0x000082).w(FUNC(tmp95c063_device::pbcr_w)); - map(0x000083, 0x000083).w(FUNC(tmp95c063_device::pbfc_w)); - map(0x000084, 0x000084).r(FUNC(tmp95c063_device::pc_r)); - map(0x000085, 0x000085).rw(FUNC(tmp95c063_device::pd_r), FUNC(tmp95c063_device::pd_w)); - map(0x000088, 0x000088).w(FUNC(tmp95c063_device::pdcr_w)); - map(0x00008a, 0x00008a).rw(FUNC(tmp95c063_device::pe_r), FUNC(tmp95c063_device::pe_w)); - map(0x00008c, 0x00008c).w(FUNC(tmp95c063_device::pecr_w)); + map(0x000080, 0x000080).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x000081, 0x000081).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x000082, 0x000082).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x000083, 0x000083).w(FUNC(tmp95c063_device::port_fc_w)); + map(0x000084, 0x000084).r(FUNC(tmp95c063_device::port_r)); + map(0x000085, 0x000085).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x000088, 0x000088).w(FUNC(tmp95c063_device::port_cr_w)); + map(0x00008a, 0x00008a).rw(FUNC(tmp95c063_device::port_r), FUNC(tmp95c063_device::port_w)); + map(0x00008c, 0x00008c).w(FUNC(tmp95c063_device::port_cr_w)); map(0x00008f, 0x00008f).w(FUNC(tmp95c063_device::bexcs_w)); map(0x000090, 0x000093).w(FUNC(tmp95c063_device::bcs_w)); map(0x000094, 0x00009b).rw(FUNC(tmp95c063_device::msar_r), FUNC(tmp95c063_device::msar_w)); @@ -176,64 +182,64 @@ void tmp95c063_device::device_config_complete() } } +enum +{ + INTE0AD, + INTE12, + INTE34, + INTE56, + INTE78, + INTET01, + INTET23, + INTET45, + INTET67, + INTET89, + INTETAB, + INTES0, + INTES1, + INTETC01, + INTETC23 +}; - -#define TMP95C063_INTE0AD 0x0 -#define TMP95C063_INTE12 0x1 -#define TMP95C063_INTE34 0x2 -#define TMP95C063_INTE56 0x3 -#define TMP95C063_INTE78 0x4 -#define TMP95C063_INTET01 0x5 -#define TMP95C063_INTET23 0x6 -#define TMP95C063_INTET45 0x7 -#define TMP95C063_INTET67 0x8 -#define TMP95C063_INTET89 0x9 -#define TMP95C063_INTETAB 0xa -#define TMP95C063_INTES0 0xb -#define TMP95C063_INTES1 0xc -#define TMP95C063_INTETC01 0xd -#define TMP95C063_INTETC23 0xe - - -#define TMP95C063_NUM_MASKABLE_IRQS 30 static const struct { uint8_t reg; uint8_t iff; uint8_t vector; -} tmp95c063_irq_vector_map[TMP95C063_NUM_MASKABLE_IRQS] = -{ - { TMP95C063_INTETC23, 0x80, 0xa0 }, /* INTTC3 */ - { TMP95C063_INTETC23, 0x08, 0x9c }, /* INTTC2 */ - { TMP95C063_INTETC01, 0x80, 0x98 }, /* INTTC1 */ - { TMP95C063_INTETC01, 0x08, 0x94 }, /* INTTC0 */ - { TMP95C063_INTE0AD, 0x80, 0x90 }, /* INTAD */ - { TMP95C063_INTES1, 0x80, 0x8c }, /* INTTX1 */ - { TMP95C063_INTES1, 0x08, 0x88 }, /* INTRX1 */ - { TMP95C063_INTES0, 0x80, 0x84 }, /* INTTX0 */ - { TMP95C063_INTES0, 0x08, 0x80 }, /* INTRX0 */ - { TMP95C063_INTETAB, 0x80, 0x7c }, /* INTTRB */ - { TMP95C063_INTETAB, 0x08, 0x78 }, /* INTTRA */ - { TMP95C063_INTET89, 0x80, 0x74 }, /* INTTR9 */ - { TMP95C063_INTET89, 0x80, 0x70 }, /* INTTR8 */ - { TMP95C063_INTET67, 0x80, 0x6c }, /* INTT7 */ - { TMP95C063_INTET67, 0x08, 0x68 }, /* INTT6 */ - { TMP95C063_INTET45, 0x80, 0x64 }, /* INTT5 */ - { TMP95C063_INTET45, 0x08, 0x60 }, /* INTT4 */ - { TMP95C063_INTET23, 0x80, 0x5c }, /* INTT3 */ - { TMP95C063_INTET23, 0x08, 0x58 }, /* INTT2 */ - { TMP95C063_INTET01, 0x80, 0x54 }, /* INTT1 */ - { TMP95C063_INTET01, 0x08, 0x50 }, /* INTT0 */ - { TMP95C063_INTE78, 0x80, 0x4c }, /* int8_t */ - { TMP95C063_INTE78, 0x08, 0x48 }, /* INT7 */ - { TMP95C063_INTE56, 0x80, 0x44 }, /* INT6 */ - { TMP95C063_INTE56, 0x08, 0x40 }, /* INT5 */ - /* 0x3c - reserved */ - { TMP95C063_INTE34, 0x80, 0x38 }, /* INT4 */ - { TMP95C063_INTE34, 0x08, 0x34 }, /* INT3 */ - { TMP95C063_INTE12, 0x80, 0x30 }, /* INT2 */ - { TMP95C063_INTE12, 0x08, 0x2c }, /* INT1 */ - { TMP95C063_INTE0AD, 0x08, 0x28 } /* INT0 */ +} tmp95c063_irq_vector_map[] = +{ + { INTETC23, 0x80, 0xa0 }, // INTTC3 + { INTETC23, 0x08, 0x9c }, // INTTC2 + { INTETC01, 0x80, 0x98 }, // INTTC1 + { INTETC01, 0x08, 0x94 }, // INTTC0 + { INTE0AD, 0x80, 0x90 }, // INTAD + { INTES1, 0x80, 0x8c }, // INTTX1 + { INTES1, 0x08, 0x88 }, // INTRX1 + { INTES0, 0x80, 0x84 }, // INTTX0 + { INTES0, 0x08, 0x80 }, // INTRX0 + { INTETAB, 0x80, 0x7c }, // INTTRB + { INTETAB, 0x08, 0x78 }, // INTTRA + { INTET89, 0x80, 0x74 }, // INTTR9 + { INTET89, 0x80, 0x70 }, // INTTR8 + { INTET67, 0x80, 0x6c }, // INTT7 + { INTET67, 0x08, 0x68 }, // INTT6 + { INTET45, 0x80, 0x64 }, // INTT5 + { INTET45, 0x08, 0x60 }, // INTT4 + { INTET23, 0x80, 0x5c }, // INTT3 + { INTET23, 0x08, 0x58 }, // INTT2 + { INTET01, 0x80, 0x54 }, // INTT1 + { INTET01, 0x08, 0x50 }, // INTT0 + { INTE78, 0x80, 0x4c }, // INT8 + { INTE78, 0x08, 0x48 }, // INT7 + { INTE56, 0x80, 0x44 }, // INT6 + { INTE56, 0x08, 0x40 }, // INT5 + // 0x3c - reserved + { INTE34, 0x80, 0x38 }, // INT4 + { INTE34, 0x08, 0x34 }, // INT3 + { INTE12, 0x80, 0x30 }, // INT2 + { INTE12, 0x08, 0x2c }, // INT1 + { INTE0AD, 0x08, 0x28 } // INT0 }; +static constexpr u8 NUM_MASKABLE_IRQS = sizeof(tmp95c063_irq_vector_map) / 3; void tmp95c063_device::tlcs900_handle_timers() { @@ -277,7 +283,7 @@ void tmp95c063_device::tlcs900_handle_timers() if ( ( m_t8_mode[0] & 0xc0 ) != 0x40 ) { m_timer[0] = 0; - m_int_reg[TMP95C063_INTET01] |= 0x08; + m_int_reg[INTET01] |= 0x08; } } } @@ -307,7 +313,7 @@ void tmp95c063_device::tlcs900_handle_timers() if ( m_timer[1] == m_t8_reg[1] ) { m_timer[1] = 0; - m_int_reg[TMP95C063_INTET01] |= 0x80; + m_int_reg[INTET01] |= 0x80; if ( m_t8_invert[0] & 0x02 ) { @@ -354,7 +360,7 @@ void tmp95c063_device::tlcs900_handle_timers() if ( ( m_t8_mode[1] & 0xc0 ) != 0x40 ) { m_timer[2] = 0; - m_int_reg[TMP95C063_INTET23] |= 0x08; + m_int_reg[INTET23] |= 0x08; } } } @@ -384,7 +390,7 @@ void tmp95c063_device::tlcs900_handle_timers() if ( m_timer[3] == m_t8_reg[3] ) { m_timer[3] = 0; - m_int_reg[TMP95C063_INTET23] |= 0x80; + m_int_reg[INTET23] |= 0x80; if ( m_t8_invert[1] & 0x20 ) { @@ -434,7 +440,7 @@ void tmp95c063_device::tlcs900_check_irqs() } /* Check regular irqs */ - for( i = 0; i < TMP95C063_NUM_MASKABLE_IRQS; i++ ) + for( i = 0; i < NUM_MASKABLE_IRQS; i++ ) { if ( m_int_reg[tmp95c063_irq_vector_map[i].reg] & tmp95c063_irq_vector_map[i].iff ) { @@ -544,7 +550,7 @@ void tmp95c063_device::tlcs900_handle_ad() m_ad_mode1 &= ~ 0x40; m_ad_mode1 |= 0x80; - m_int_reg[TMP95C063_INTE0AD] |= 0x80; + m_int_reg[INTE0AD] |= 0x80; m_check_irqs = 1; } } @@ -603,16 +609,18 @@ void tmp95c063_device::device_reset() m_timer_change[2] = 0; m_timer_change[3] = 0; - m_port_latch[1] = 0x00; - m_port_latch[2] = 0xff; - m_port_latch[5] = 0x3d; - m_port_latch[6] = 0x3b; - m_port_latch[7] = 0xff; - m_port_latch[8] = 0x3f; - m_port_latch[0xa] = 0x0f; - m_port_latch[0xb] = 0xff; - std::fill_n(&m_port_control[0], 0xc, 0x00); - std::fill_n(&m_port_function[0], 0xc, 0x00); + m_port_latch[PORT_1] = 0x00; + m_port_latch[PORT_2] = 0xff; + m_port_latch[PORT_5] = 0x3d; + m_port_latch[PORT_6] = 0x3b; + m_port_latch[PORT_7] = 0xff; + m_port_latch[PORT_8] = 0x3f; + m_port_latch[PORT_A] = 0x0f; + m_port_latch[PORT_B] = 0xff; + // FIXME: init ports 9, C, D & E + std::fill_n(&m_port_control[0], NUM_PORTS, 0x00); + std::fill_n(&m_port_function[0], NUM_PORTS, 0x00); + m_t8run = 0x00; std::fill_n(&m_t8_mode[0], 4, 0x00); std::fill_n(&m_t8_invert[0], 2, 0xcc); @@ -652,217 +660,6 @@ void tmp95c063_device::device_reset() m_level[i] = CLEAR_LINE; } - -uint8_t tmp95c063_device::p1_r() -{ - return m_port1_read(0); -} - -void tmp95c063_device::p1_w(uint8_t data) -{ - m_port_latch[1] = data; - m_port1_write(0, data, 0xff); -} - -void tmp95c063_device::p1cr_w(uint8_t data) -{ - m_port_control[1] = data; -} - -uint8_t tmp95c063_device::p2_r() -{ - return m_port_latch[2]; -} - -void tmp95c063_device::p2_w(uint8_t data) -{ - m_port_latch[2] = data; - m_port2_write(0, data, 0xff); -} - -void tmp95c063_device::p2fc_w(uint8_t data) -{ - m_port_control[2] = data; -} - -uint8_t tmp95c063_device::p5_r() -{ - return m_port5_read(0); -} - -void tmp95c063_device::p5_w(uint8_t data) -{ - m_port_latch[5] = data; - m_port5_write(0, data, 0xff); -} - -void tmp95c063_device::p5cr_w(uint8_t data) -{ - m_port_control[5] = data; -} - -void tmp95c063_device::p5fc_w(uint8_t data) -{ - m_port_function[5] = data; -} - -uint8_t tmp95c063_device::p6_r() -{ - return m_port6_read(0); -} - -void tmp95c063_device::p6_w(uint8_t data) -{ - m_port_latch[6] = data; - m_port6_write(0, data, 0xff); -} - -void tmp95c063_device::p6fc_w(uint8_t data) -{ - m_port_function[6] = data; -} - -uint8_t tmp95c063_device::p7_r() -{ - return m_port7_read(0); -} - -void tmp95c063_device::p7_w(uint8_t data) -{ - m_port_latch[7] = data; - m_port7_write(0, data, 0xff); -} - -void tmp95c063_device::p7cr_w(uint8_t data) -{ - m_port_control[7] = data; -} - -void tmp95c063_device::p7fc_w(uint8_t data) -{ - m_port_function[7] = data; -} - -uint8_t tmp95c063_device::p8_r() -{ - return m_port8_read(0); -} - -void tmp95c063_device::p8_w(uint8_t data) -{ - m_port_latch[8] = data; - m_port8_write(0, data, 0xff); -} - -void tmp95c063_device::p8cr_w(uint8_t data) -{ - m_port_control[8] = data; -} - -void tmp95c063_device::p8fc_w(uint8_t data) -{ - m_port_function[8] = data; -} - -uint8_t tmp95c063_device::p9_r() -{ - return m_port9_read(0); -} - -void tmp95c063_device::p9_w(uint8_t data) -{ - m_port_latch[0x9] = data; -} - -void tmp95c063_device::p9cr_w(uint8_t data) -{ - m_port_control[0x9] = data; -} - -void tmp95c063_device::p9fc_w(uint8_t data) -{ - m_port_function[0x9] = data; -} - -uint8_t tmp95c063_device::pa_r() -{ - return m_porta_read(0); -} - -void tmp95c063_device::pa_w(uint8_t data) -{ - m_port_latch[0xa] = data; -} - -void tmp95c063_device::pacr_w(uint8_t data) -{ - m_port_control[0xa] = data; -} - -void tmp95c063_device::pafc_w(uint8_t data) -{ - m_port_function[0xa] = data; -} - -uint8_t tmp95c063_device::pb_r() -{ - return m_portb_read(0); -} - -void tmp95c063_device::pb_w(uint8_t data) -{ - m_port_latch[0xb] = data; - m_portb_write(0, data, 0xff); -} - -void tmp95c063_device::pbcr_w(uint8_t data) -{ - m_port_control[0xb] = data; -} - -void tmp95c063_device::pbfc_w(uint8_t data) -{ - m_port_function[0xb] = data; -} - -uint8_t tmp95c063_device::pc_r() -{ - return m_portc_read(0); -} - -uint8_t tmp95c063_device::pd_r() -{ - return m_portd_read(0); -} - -void tmp95c063_device::pd_w(uint8_t data) -{ - m_port_latch[0xd] = data; - m_portd_write(0, data, 0xff); -} - -void tmp95c063_device::pdcr_w(uint8_t data) -{ - m_port_control[0xd] = data; -} - -uint8_t tmp95c063_device::pe_r() -{ - return m_porte_read(0); -} - -void tmp95c063_device::pe_w(uint8_t data) -{ - m_port_latch[0xe] = data; - m_porte_write(0, data, 0xff); -} - -void tmp95c063_device::pecr_w(uint8_t data) -{ - m_port_control[0xe] = data; -} - - uint8_t tmp95c063_device::t8run_r() { return m_t8run; @@ -1225,7 +1022,7 @@ uint8_t tmp95c063_device::sc0buf_r() void tmp95c063_device::sc0buf_w(uint8_t data) { // Fake finish sending data - m_int_reg[TMP95C063_INTES0] |= 0x80; + m_int_reg[INTES0] |= 0x80; m_check_irqs = 1; } @@ -1270,7 +1067,7 @@ uint8_t tmp95c063_device::sc1buf_r() void tmp95c063_device::sc1buf_w(uint8_t data) { // Fake finish sending data - m_int_reg[TMP95C063_INTES1] |= 0x80; + m_int_reg[INTES1] |= 0x80; m_check_irqs = 1; } @@ -1503,16 +1300,16 @@ void tmp95c063_device::execute_set_input(int input, int level) { /* Leave HALT state */ m_halted = 0; - m_int_reg[TMP95C063_INTE0AD] |= 0x08; + m_int_reg[INTE0AD] |= 0x08; } } else { /* Level detect */ if (level == ASSERT_LINE) - m_int_reg[TMP95C063_INTE0AD] |= 0x08; + m_int_reg[INTE0AD] |= 0x08; else - m_int_reg[TMP95C063_INTE0AD] &= ~ 0x08; + m_int_reg[INTE0AD] &= ~ 0x08; } } m_level[TLCS900_INT0] = level; @@ -1521,11 +1318,11 @@ void tmp95c063_device::execute_set_input(int input, int level) case TLCS900_INT1: if (m_level[TLCS900_INT1] == CLEAR_LINE && level == ASSERT_LINE) { - m_int_reg[TMP95C063_INTE12] |= 0x08; + m_int_reg[INTE12] |= 0x08; } else if (m_level[TLCS900_INT1] == ASSERT_LINE && level == CLEAR_LINE) { - m_int_reg[TMP95C063_INTE12] &= ~0x08; + m_int_reg[INTE12] &= ~0x08; } m_level[TLCS900_INT1] = level; break; @@ -1533,11 +1330,11 @@ void tmp95c063_device::execute_set_input(int input, int level) case TLCS900_INT2: if (m_level[TLCS900_INT2] == CLEAR_LINE && level == ASSERT_LINE) { - m_int_reg[TMP95C063_INTE12] |= 0x80; + m_int_reg[INTE12] |= 0x80; } else if (m_level[TLCS900_INT2] == ASSERT_LINE && level == CLEAR_LINE) { - m_int_reg[TMP95C063_INTE12] &= ~0x80; + m_int_reg[INTE12] &= ~0x80; } m_level[TLCS900_INT2] = level; break; @@ -1545,11 +1342,11 @@ void tmp95c063_device::execute_set_input(int input, int level) case TLCS900_INT3: if (m_level[TLCS900_INT3] == CLEAR_LINE && level == ASSERT_LINE) { - m_int_reg[TMP95C063_INTE34] |= 0x08; + m_int_reg[INTE34] |= 0x08; } else if (m_level[TLCS900_INT3] == ASSERT_LINE && level == CLEAR_LINE) { - m_int_reg[TMP95C063_INTE34] &= ~0x08; + m_int_reg[INTE34] &= ~0x08; } m_level[TLCS900_INT3] = level; break; @@ -1559,7 +1356,7 @@ void tmp95c063_device::execute_set_input(int input, int level) { if ( m_level[TLCS900_INT4] == CLEAR_LINE && level == ASSERT_LINE ) { - m_int_reg[TMP95C063_INTE34] |= 0x80; + m_int_reg[INTE34] |= 0x80; } } m_level[TLCS900_INT4] = level; @@ -1570,7 +1367,7 @@ void tmp95c063_device::execute_set_input(int input, int level) { if ( m_level[TLCS900_INT5] == CLEAR_LINE && level == ASSERT_LINE ) { - m_int_reg[TMP95C063_INTE56] |= 0x08; + m_int_reg[INTE56] |= 0x08; } } m_level[TLCS900_INT5] = level; @@ -1579,11 +1376,11 @@ void tmp95c063_device::execute_set_input(int input, int level) case TLCS900_INT6: if (m_level[TLCS900_INT6] == CLEAR_LINE && level == ASSERT_LINE) { - m_int_reg[TMP95C063_INTE56] |= 0x80; + m_int_reg[INTE56] |= 0x80; } else if (m_level[TLCS900_INT6] == ASSERT_LINE && level == CLEAR_LINE) { - m_int_reg[TMP95C063_INTE56] &= ~0x80; + m_int_reg[INTE56] &= ~0x80; } m_level[TLCS900_INT6] = level; break; diff --git a/src/devices/cpu/tlcs900/tmp95c063.h b/src/devices/cpu/tlcs900/tmp95c063.h index 4c9c05bb4334b..47782529d4e91 100644 --- a/src/devices/cpu/tlcs900/tmp95c063.h +++ b/src/devices/cpu/tlcs900/tmp95c063.h @@ -13,33 +13,47 @@ DECLARE_DEVICE_TYPE(TMP95C063, tmp95c063_device) class tmp95c063_device : public tlcs900h_device { + static constexpr uint8_t PORT_1 = 0; // 8 bit I/O. Shared with d8-d15 + static constexpr uint8_t PORT_2 = 1; // 8 bit output only. Shared with a16-a23 + static constexpr uint8_t PORT_5 = 2; // 6 bit I/O + static constexpr uint8_t PORT_6 = 3; // 8 bit I/O. Shared with cs1, cs3 & dram control + static constexpr uint8_t PORT_7 = 4; // 8 bit I/O + static constexpr uint8_t PORT_8 = 5; // 8 bit I/O. Shared with SCOUT, WAIT, NMI2, INT0-INT3 + static constexpr uint8_t PORT_9 = 6; // 8 bit I/O. Shared with clock input and output for the 8-bit timers + static constexpr uint8_t PORT_A = 7; // 8 bit I/O. Shared with serial channels 0/1 + static constexpr uint8_t PORT_B = 8; // 8 bit I/O. Shared with 16bit timers + static constexpr uint8_t PORT_C = 9; // 8 bit input only. Shared with analogue inputs + static constexpr uint8_t PORT_D = 10; // 5 bit I/O. Shared with INT8 + static constexpr uint8_t PORT_E = 11; // 8 bit I/O. + static constexpr uint8_t NUM_PORTS = 12; + public: // construction/destruction tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - auto port1_read() { return m_port1_read.bind(); } - auto port1_write() { return m_port1_write.bind(); } - auto port2_write() { return m_port2_write.bind(); } - auto port5_read() { return m_port5_read.bind(); } - auto port5_write() { return m_port5_write.bind(); } - auto port6_read() { return m_port6_read.bind(); } - auto port6_write() { return m_port6_write.bind(); } - auto port7_read() { return m_port7_read.bind(); } - auto port7_write() { return m_port7_write.bind(); } - auto port8_read() { return m_port8_read.bind(); } - auto port8_write() { return m_port8_write.bind(); } - auto port9_read() { return m_port9_read.bind(); } - auto port9_write() { return m_port9_write.bind(); } - auto porta_read() { return m_porta_read.bind(); } - auto porta_write() { return m_porta_write.bind(); } - auto portb_read() { return m_portb_read.bind(); } - auto portb_write() { return m_portb_write.bind(); } - auto portc_read() { return m_portc_read.bind(); } - auto portd_read() { return m_portd_read.bind(); } - auto portd_write() { return m_portd_write.bind(); } - auto porte_read() { return m_porte_read.bind(); } - auto porte_write() { return m_porte_write.bind(); } + auto port1_read() { return m_port_read[PORT_1].bind(); } + auto port1_write() { return m_port_write[PORT_1].bind(); } + auto port2_write() { return m_port_write[PORT_2].bind(); } + auto port5_read() { return m_port_read[PORT_5].bind(); } + auto port5_write() { return m_port_write[PORT_5].bind(); } + auto port6_read() { return m_port_read[PORT_6].bind(); } + auto port6_write() { return m_port_write[PORT_6].bind(); } + auto port7_read() { return m_port_read[PORT_7].bind(); } + auto port7_write() { return m_port_write[PORT_7].bind(); } + auto port8_read() { return m_port_read[PORT_8].bind(); } + auto port8_write() { return m_port_write[PORT_8].bind(); } + auto port9_read() { return m_port_read[PORT_9].bind(); } + auto port9_write() { return m_port_write[PORT_9].bind(); } + auto porta_read() { return m_port_read[PORT_A].bind(); } + auto porta_write() { return m_port_write[PORT_A].bind(); } + auto portb_read() { return m_port_read[PORT_B].bind(); } + auto portb_write() { return m_port_write[PORT_B].bind(); } + auto portc_read() { return m_port_read[PORT_C].bind(); } + auto portd_read() { return m_port_read[PORT_D].bind(); } + auto portd_write() { return m_port_write[PORT_D].bind(); } + auto porte_read() { return m_port_read[PORT_E].bind(); } + auto porte_write() { return m_port_write[PORT_E].bind(); } template auto an_read() { return m_an_read[Bit].bind(); } protected: @@ -54,46 +68,10 @@ class tmp95c063_device : public tlcs900h_device virtual void tlcs900_handle_timers() override; private: - uint8_t p1_r(); - void p1_w(uint8_t data); - void p1cr_w(uint8_t data); - uint8_t p2_r(); - void p2_w(uint8_t data); - void p2fc_w(uint8_t data); - uint8_t p5_r(); - void p5_w(uint8_t data); - void p5cr_w(uint8_t data); - void p5fc_w(uint8_t data); - uint8_t p6_r(); - void p6_w(uint8_t data); - void p6fc_w(uint8_t data); - uint8_t p7_r(); - void p7_w(uint8_t data); - void p7cr_w(uint8_t data); - void p7fc_w(uint8_t data); - uint8_t p8_r(); - void p8_w(uint8_t data); - void p8cr_w(uint8_t data); - void p8fc_w(uint8_t data); - uint8_t p9_r(); - void p9_w(uint8_t data); - void p9cr_w(uint8_t data); - void p9fc_w(uint8_t data); - uint8_t pa_r(); - void pa_w(uint8_t data); - void pacr_w(uint8_t data); - void pafc_w(uint8_t data); - uint8_t pb_r(); - void pb_w(uint8_t data); - void pbcr_w(uint8_t data); - void pbfc_w(uint8_t data); - uint8_t pc_r(); - uint8_t pd_r(); - void pd_w(uint8_t data); - void pdcr_w(uint8_t data); - uint8_t pe_r(); - void pe_w(uint8_t data); - void pecr_w(uint8_t data); + template uint8_t port_r(); + template void port_w(uint8_t data); + template void port_cr_w(uint8_t data); + template void port_fc_w(uint8_t data); uint8_t t8run_r(); void t8run_w(uint8_t data); void treg01_w(offs_t offset, uint8_t data); @@ -182,59 +160,15 @@ class tmp95c063_device : public tlcs900h_device void internal_mem(address_map &map); - // Port 1: 8 bit I/O. Shared with d8-d15 - devcb_read8 m_port1_read; - devcb_write8 m_port1_write; - - // Port 2: 8 bit output only. Shared with a16-a23 - devcb_write8 m_port2_write; - - // Port 5: 6 bit I/O - devcb_read8 m_port5_read; - devcb_write8 m_port5_write; - - // Port 6: 8 bit I/O. Shared with cs1, cs3 & dram control - devcb_read8 m_port6_read; - devcb_write8 m_port6_write; - - // Port 7: 8 bit I/O - devcb_read8 m_port7_read; - devcb_write8 m_port7_write; - - // Port 8: 8 bit I/O. Shared with SCOUT, WAIT, NMI2, INT0-INT3 - devcb_read8 m_port8_read; - devcb_write8 m_port8_write; - - // Port 9: 8 bit I/O. Shared with clock input and output for the 8-bit timers - devcb_read8 m_port9_read; - devcb_write8 m_port9_write; - - // Port A: 8 bit I/O. Shared with serial channels 0/1 - devcb_read8 m_porta_read; - devcb_write8 m_porta_write; - - // Port B: 8 bit I/O. Shared with 16bit timers - devcb_read8 m_portb_read; - devcb_write8 m_portb_write; - - // Port C: 8 bit input only. Shared with analogue inputs - devcb_read8 m_portc_read; - - // Port D: 5 bit I/O. Shared with int8_t - devcb_read8 m_portd_read; - devcb_write8 m_portd_write; - - // Port E: 8 bit I/O. - devcb_read8 m_porte_read; - devcb_write8 m_porte_write; - // analogue inputs, sampled at 10 bits devcb_read16::array<8> m_an_read; - // I/O Port Control - uint8_t m_port_latch[0xf]; - uint8_t m_port_control[0xf]; - uint8_t m_port_function[0xf]; + // I/O Ports + devcb_read8::array m_port_read; + devcb_write8::array m_port_write; + uint8_t m_port_latch[NUM_PORTS]; + uint8_t m_port_control[NUM_PORTS]; + uint8_t m_port_function[NUM_PORTS]; // Timer Control uint8_t m_t8run; diff --git a/src/devices/cpu/tms1000/smc1102.h b/src/devices/cpu/tms1000/smc1102.h index 648d637544d91..585b70a12b09d 100644 --- a/src/devices/cpu/tms1000/smc1102.h +++ b/src/devices/cpu/tms1000/smc1102.h @@ -56,7 +56,6 @@ class smc1102_cpu_device : public tms1100_cpu_device virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override { } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_set_input(int line, int state) override; virtual std::unique_ptr create_disassembler() override; diff --git a/src/devices/cpu/tms1000/tms2100.h b/src/devices/cpu/tms1000/tms2100.h index c72edc4952f05..9cf2c9eb61d6c 100644 --- a/src/devices/cpu/tms1000/tms2100.h +++ b/src/devices/cpu/tms1000/tms2100.h @@ -80,7 +80,6 @@ class tms2100_cpu_device : public tms1100_cpu_device virtual void device_add_mconfig(machine_config &config) override; virtual void device_clock_changed() override { reset_prescaler(); } - virtual u32 execute_input_lines() const noexcept override { return 2; } virtual void execute_set_input(int line, int state) override; virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == TMS2100_INPUT_LINE_INT || inputnum == TMS2100_INPUT_LINE_EC1; } diff --git a/src/devices/cpu/tms32010/tms32010.h b/src/devices/cpu/tms32010/tms32010.h index a4287f5b274a2..7eb7a4353494d 100644 --- a/src/devices/cpu/tms32010/tms32010.h +++ b/src/devices/cpu/tms32010/tms32010.h @@ -45,7 +45,6 @@ class tms3201x_base_device : public cpu_device // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 3; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 4 - 1) / 4; } diff --git a/src/devices/cpu/tms32025/tms32025.h b/src/devices/cpu/tms32025/tms32025.h index 56ed8fd57b9b3..1aa602a838f49 100644 --- a/src/devices/cpu/tms32025/tms32025.h +++ b/src/devices/cpu/tms32025/tms32025.h @@ -84,7 +84,6 @@ class tms3202x_device : public cpu_device // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 4; } virtual uint32_t execute_max_cycles() const noexcept override { return 20; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp index dd318f7debf6c..8711c46ea1827 100644 --- a/src/devices/cpu/tms32031/tms32031.cpp +++ b/src/devices/cpu/tms32031/tms32031.cpp @@ -854,17 +854,6 @@ uint32_t tms3203x_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t tms3203x_device::execute_input_lines() const noexcept -{ - return 14; -} - - //------------------------------------------------- // execute_clocks_to_cycles - convert the raw // clock into cycles per second diff --git a/src/devices/cpu/tms32031/tms32031.h b/src/devices/cpu/tms32031/tms32031.h index 975a8d1cb32ac..39852736baf33 100644 --- a/src/devices/cpu/tms32031/tms32031.h +++ b/src/devices/cpu/tms32031/tms32031.h @@ -155,7 +155,6 @@ class tms3203x_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override; virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override; virtual void execute_run() override; diff --git a/src/devices/cpu/tms32051/tms32051.h b/src/devices/cpu/tms32051/tms32051.h index 63552d7e605bf..b1088011ef922 100644 --- a/src/devices/cpu/tms32051/tms32051.h +++ b/src/devices/cpu/tms32051/tms32051.h @@ -74,7 +74,6 @@ class tms32051_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/tms32082/tms32082.h b/src/devices/cpu/tms32082/tms32082.h index 415ce95d56414..a02ffadf6aab3 100644 --- a/src/devices/cpu/tms32082/tms32082.h +++ b/src/devices/cpu/tms32082/tms32082.h @@ -82,7 +82,6 @@ class tms32082_mp_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -173,7 +172,6 @@ class tms32082_pp_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; // device_memory_interface overrides diff --git a/src/devices/cpu/tms34010/34010ops.hxx b/src/devices/cpu/tms34010/34010ops.hxx index bb4791d9d763b..4aa88eb300dce 100644 --- a/src/devices/cpu/tms34010/34010ops.hxx +++ b/src/devices/cpu/tms34010/34010ops.hxx @@ -180,6 +180,7 @@ void tms340x0_device::cmp_xy_b(uint16_t op) { CMP_XY(B); } void tms340x0_device::cpw_a(uint16_t op) { CPW(A); } void tms340x0_device::cpw_b(uint16_t op) { CPW(B); } +// TODO: Handle cycles properly, currently we assume power of two #define CVXYL(R) \ { \ R##REG(DSTREG(op)) = DXYTOL(R##REG_XY(SRCREG(op))); \ @@ -2117,7 +2118,7 @@ void tms34020_device::clip(uint16_t op) bool is_b = wend.y > daddr.y; if (!(is_l || is_r || is_t || is_b)) { - // ...no itersection, set flags and return + // ...no intersection, set flags and return m_st |= STBIT_Z | STBIT_V; // TODO: manual does not specify cycles, only states that this is complex instruction COUNT_CYCLES(3); @@ -2245,7 +2246,34 @@ void tms34020_device::cvdxyl_a(uint16_t op) void tms34020_device::cvdxyl_b(uint16_t op) { - logerror("020:cvdxyl_b\n"); + // Convert destination XY address to linear + // (Y half of Rd x DPTCH) + (X half of Rd x PSIZE) + (A4 or B4) -> Rd + const XY rd = BREG_XY(DSTREG(op)); + const off_t dptch = DPTCH(); + const off_t offset = BREG(4); + + const off_t result = (rd.y * dptch) + (rd.x << m_pixelshift) + offset; + // logerror("020:cvdxyl_b: PC=0x%08x: DADDR=%x, x=%x, y=%x, DPTCH=%d, PIXELSIZE=%d, OFFSET=%d, result: %x\n", + // m_pc, rd, rd.x, rd.y, dptch, m_pixelshift, offset, result); + + DADDR() = result; + + // Handle cycles related to pitch: + switch (population_count_32(dptch)) + { + // power of 2: 2 clocks + case 1: + COUNT_CYCLES(2); + break; + // 2 powers of 2: 3 clocks + case 2: + COUNT_CYCLES(3); + break; + // arbitrary: 14 clocks + default: + COUNT_CYCLES(14); + break; + } } void tms34020_device::cvmxyl_a(uint16_t op) @@ -2413,7 +2441,7 @@ void tms34020_device::setcdp(uint16_t op) // Check whether we're dealing with an even number if ((dptch & 1) == 0) { - switch(population_count_32(dptch)) + switch (population_count_32(dptch)) { // .. only single bit set, pitch is power of two! case 1: @@ -2472,15 +2500,21 @@ void tms34020_device::trapl(uint16_t op) void tms34020_device::vblt_b_l(uint16_t op) { + // Linear VRAM pixel block transfer + // logerror("020:vblt_b_l: SADDR=0x%x, SPTCH=%d, DADDR=0x%x, DPTCH=%d, DYDX=(%dx%d), TEMP=%x\n", SADDR(), SPTCH(), DADDR(), DPTCH(), DYDX_X(), DYDX_Y(), TEMP()); logerror("020:vblt_b_l\n"); } void tms34020_device::vfill_l(uint16_t op) { + // Linear VRAM fast fill + // logerror("020:vfill_l: DADDR=0x%x, DPTCH=%d, DYDX=(%dx%d)\n", DADDR(), DPTCH(), DYDX_X(), DYDX_Y()); logerror("020:vfill_l\n"); } void tms34020_device::vlcol(uint16_t op) { + // Latch COLOR1 into the VRAM color registers + //logerror("020:vlcol: COLOR1=%x\n", COLOR1()); logerror("020:vlcol\n"); } diff --git a/src/devices/cpu/tms34010/tms34010.h b/src/devices/cpu/tms34010/tms34010.h index b9165b17f77f8..672aada9ee357 100644 --- a/src/devices/cpu/tms34010/tms34010.h +++ b/src/devices/cpu/tms34010/tms34010.h @@ -262,7 +262,6 @@ class tms340x0_device : public cpu_device, // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 10000; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/tms57002/tms57002.cpp b/src/devices/cpu/tms57002/tms57002.cpp index f93ca5796bf4a..4adeed1cf8545 100644 --- a/src/devices/cpu/tms57002/tms57002.cpp +++ b/src/devices/cpu/tms57002/tms57002.cpp @@ -1023,11 +1023,6 @@ u32 tms57002_device::execute_max_cycles() const noexcept return 3; } -u32 tms57002_device::execute_input_lines() const noexcept -{ - return 0; -} - device_memory_interface::space_config_vector tms57002_device::memory_space_config() const { return space_config_vector { diff --git a/src/devices/cpu/tms57002/tms57002.h b/src/devices/cpu/tms57002/tms57002.h index dd0967e72a83f..d991a5283c72b 100644 --- a/src/devices/cpu/tms57002/tms57002.h +++ b/src/devices/cpu/tms57002/tms57002.h @@ -40,7 +40,6 @@ class tms57002_device : public cpu_device, public device_sound_interface virtual space_config_vector memory_space_config() const override; virtual u32 execute_min_cycles() const noexcept override; virtual u32 execute_max_cycles() const noexcept override; - virtual u32 execute_input_lines() const noexcept override; virtual void execute_run() override; virtual std::unique_ptr create_disassembler() override; diff --git a/src/devices/cpu/tms7000/tms7000.h b/src/devices/cpu/tms7000/tms7000.h index 3c39ed217b621..54826965f2cc6 100644 --- a/src/devices/cpu/tms7000/tms7000.h +++ b/src/devices/cpu/tms7000/tms7000.h @@ -86,7 +86,6 @@ class tms7000_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * m_divider); } virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 49; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int extline, int state) override; diff --git a/src/devices/cpu/tms9900/ti990_10.cpp b/src/devices/cpu/tms9900/ti990_10.cpp index 99cf65dfb0b1c..b31849737d49f 100644 --- a/src/devices/cpu/tms9900/ti990_10.cpp +++ b/src/devices/cpu/tms9900/ti990_10.cpp @@ -118,11 +118,6 @@ uint32_t ti990_10_device::execute_max_cycles() const noexcept return 10; } -uint32_t ti990_10_device::execute_input_lines() const noexcept -{ - return 2; -} - // TODO: check 9900dasm std::unique_ptr ti990_10_device::create_disassembler() { diff --git a/src/devices/cpu/tms9900/ti990_10.h b/src/devices/cpu/tms9900/ti990_10.h index 93d3ecec4a0f6..428e27dfde62f 100644 --- a/src/devices/cpu/tms9900/ti990_10.h +++ b/src/devices/cpu/tms9900/ti990_10.h @@ -26,9 +26,8 @@ class ti990_10_device : public cpu_device void device_reset() override; // device_execute_interface overrides - uint32_t execute_min_cycles() const noexcept override; - uint32_t execute_max_cycles() const noexcept override; - uint32_t execute_input_lines() const noexcept override; + uint32_t execute_min_cycles() const noexcept override; + uint32_t execute_max_cycles() const noexcept override; void execute_set_input(int irqline, int state) override; void execute_run() override; diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp index 2f5c2d413d34b..5ae5cb54f6b5d 100644 --- a/src/devices/cpu/tms9900/tms9900.cpp +++ b/src/devices/cpu/tms9900/tms9900.cpp @@ -2771,15 +2771,6 @@ uint32_t tms99xx_device::execute_max_cycles() const noexcept return 124; } -uint32_t tms99xx_device::execute_input_lines() const noexcept -{ - return 2; -} - -// clocks to cycles, cycles to clocks = id -// execute_default_irq_vector = 0 -// execute_burn = nop - // device_disasm_interface overrides std::unique_ptr tms99xx_device::create_disassembler() diff --git a/src/devices/cpu/tms9900/tms9900.h b/src/devices/cpu/tms9900/tms9900.h index 67e6fd034c1da..c67ed48999fe4 100644 --- a/src/devices/cpu/tms9900/tms9900.h +++ b/src/devices/cpu/tms9900/tms9900.h @@ -74,7 +74,6 @@ class tms99xx_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; diff --git a/src/devices/cpu/tms9900/tms9980a.cpp b/src/devices/cpu/tms9900/tms9980a.cpp index a57bb4d363979..9f5d058705bcc 100644 --- a/src/devices/cpu/tms9900/tms9980a.cpp +++ b/src/devices/cpu/tms9900/tms9980a.cpp @@ -283,15 +283,6 @@ uint32_t tms9980a_device::execute_max_cycles() const noexcept return 136; } -uint32_t tms9980a_device::execute_input_lines() const noexcept -{ - return 8; -} - -// clocks to cycles, cycles to clocks = id -// execute_default_irq_vector = 0 -// execute_burn = nop - // device_disasm_interface overrides std::unique_ptr tms9980a_device::create_disassembler() diff --git a/src/devices/cpu/tms9900/tms9980a.h b/src/devices/cpu/tms9900/tms9980a.h index c93212e6a4c5a..4219c14f81998 100644 --- a/src/devices/cpu/tms9900/tms9980a.h +++ b/src/devices/cpu/tms9900/tms9980a.h @@ -40,7 +40,6 @@ class tms9980a_device : public tms99xx_device uint32_t execute_min_cycles() const noexcept override; uint32_t execute_max_cycles() const noexcept override; - uint32_t execute_input_lines() const noexcept override; void execute_set_input(int irqline, int state) override; // The clock is internally divided by 4 diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp index 905357dc59773..7f721c251979f 100644 --- a/src/devices/cpu/tms9900/tms9995.cpp +++ b/src/devices/cpu/tms9900/tms9995.cpp @@ -3512,11 +3512,6 @@ uint32_t tms9995_device::execute_max_cycles() const noexcept return 47; } -uint32_t tms9995_device::execute_input_lines() const noexcept -{ - return 2; -} - std::unique_ptr tms9995_device::create_disassembler() { return std::make_unique(TMS9995_ID); diff --git a/src/devices/cpu/tms9900/tms9995.h b/src/devices/cpu/tms9900/tms9995.h index 13f16ffafffa8..4e0689e406f3a 100644 --- a/src/devices/cpu/tms9900/tms9995.h +++ b/src/devices/cpu/tms9900/tms9995.h @@ -68,7 +68,6 @@ class tms9995_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; diff --git a/src/devices/cpu/ucom4/ucom4.cpp b/src/devices/cpu/ucom4/ucom4.cpp index 0a0ea9b604a17..af0f37f4c996c 100644 --- a/src/devices/cpu/ucom4/ucom4.cpp +++ b/src/devices/cpu/ucom4/ucom4.cpp @@ -495,6 +495,6 @@ void ucom4_cpu_device::execute_run() } break; // 0xff - } // big switch + } // 0xf0 } } diff --git a/src/devices/cpu/ucom4/ucom4.h b/src/devices/cpu/ucom4/ucom4.h index 29b766b5cd470..adadec64ddc5f 100644 --- a/src/devices/cpu/ucom4/ucom4.h +++ b/src/devices/cpu/ucom4/ucom4.h @@ -92,7 +92,6 @@ class ucom4_cpu_device : public cpu_device virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 2+1; } // max 2 + interrupt - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; diff --git a/src/devices/cpu/unsp/unsp.h b/src/devices/cpu/unsp/unsp.h index 010720adeec74..9be731e556f04 100644 --- a/src/devices/cpu/unsp/unsp.h +++ b/src/devices/cpu/unsp/unsp.h @@ -131,7 +131,6 @@ class unsp_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 5; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp index c8d079cc84c72..817c205ce6e1e 100644 --- a/src/devices/cpu/upd7725/upd7725.cpp +++ b/src/devices/cpu/upd7725/upd7725.cpp @@ -268,17 +268,6 @@ uint32_t necdsp_device::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- - -uint32_t necdsp_device::execute_input_lines() const noexcept -{ - return 3; // TODO: there should be 11: INT, SCK, /SIEN, /SOEN, SI, and /DACK, plus SO, /SORQ and DRQ; for now, just INT, P0, and P1 are enough. -} - - //------------------------------------------------- // execute_set_input - //------------------------------------------------- diff --git a/src/devices/cpu/upd7725/upd7725.h b/src/devices/cpu/upd7725/upd7725.h index e1f7703c3693e..c3049220b403b 100644 --- a/src/devices/cpu/upd7725/upd7725.h +++ b/src/devices/cpu/upd7725/upd7725.h @@ -50,7 +50,6 @@ class necdsp_device : public cpu_device // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/upd7810/upd7810.h b/src/devices/cpu/upd7810/upd7810.h index 294c38fa10283..a71d508701744 100644 --- a/src/devices/cpu/upd7810/upd7810.h +++ b/src/devices/cpu/upd7810/upd7810.h @@ -144,7 +144,6 @@ class upd7810_device : public cpu_device virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 3); } virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 40; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return true; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/v30mz/v30mz.h b/src/devices/cpu/v30mz/v30mz.h index f194fba269cad..cdfa6ae75397c 100644 --- a/src/devices/cpu/v30mz/v30mz.h +++ b/src/devices/cpu/v30mz/v30mz.h @@ -35,7 +35,6 @@ class v30mz_cpu_device : public cpu_device, public nec_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 80; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/v60/v60.h b/src/devices/cpu/v60/v60.h index d617ec1bd5674..3e44568e21813 100644 --- a/src/devices/cpu/v60/v60.h +++ b/src/devices/cpu/v60/v60.h @@ -98,7 +98,6 @@ class v60_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } - virtual uint32_t execute_input_lines() const noexcept override { return 1; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/v810/v810.h b/src/devices/cpu/v810/v810.h index 4a56ecf9fb1da..4451b99811976 100644 --- a/src/devices/cpu/v810/v810.h +++ b/src/devices/cpu/v810/v810.h @@ -93,7 +93,6 @@ class v810_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 3; } virtual uint32_t execute_max_cycles() const noexcept override { return 6; } - virtual uint32_t execute_input_lines() const noexcept override { return 16; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/xa/xa.cpp b/src/devices/cpu/xa/xa.cpp index e02344e4ac1a9..92062ded6c00e 100644 --- a/src/devices/cpu/xa/xa.cpp +++ b/src/devices/cpu/xa/xa.cpp @@ -2629,7 +2629,8 @@ void xa_cpu::check_interrupts() void xa_cpu::execute_set_input(int inputnum, int state) { // This is not accurate, just test code for fearless/superkds - m_irq_pending |= 1 << inputnum; + if (state) + m_irq_pending |= 1 << inputnum; check_interrupts(); } diff --git a/src/devices/cpu/xa/xa.h b/src/devices/cpu/xa/xa.h index 3fbf7a3cb9284..71b239a404da5 100644 --- a/src/devices/cpu/xa/xa.h +++ b/src/devices/cpu/xa/xa.h @@ -60,7 +60,6 @@ class xa_cpu : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 5; } - virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; diff --git a/src/devices/cpu/xa/xa_ops.cpp b/src/devices/cpu/xa/xa_ops.cpp index ae803581380a9..c66277ba6c48a 100644 --- a/src/devices/cpu/xa/xa_ops.cpp +++ b/src/devices/cpu/xa/xa_ops.cpp @@ -1123,7 +1123,7 @@ void xa_cpu::aluop_byte_rd_rsoff8(int alu_op, u8 rd, u8 rs, u8 offset8) } } -void xa_cpu::add_word_rd_rsoff8(u8 rd, u8 rs, u8 offset8) { fatalerror("ADD.w %s, [%s+#$%02x]", m_regnames16[rd], m_regnames16[rs], offset8);} +void xa_cpu::add_word_rd_rsoff8(u8 rd, u8 rs, u8 offset8) { u16 rdval = gr16(rd); u16 fulloffset = util::sext(offset8, 8); u16 address = get_addr(rs) + fulloffset; u16 val = rdat16(address); u16 result = do_add_16(rdval, val); sr16(rd, result); cy(6); } void xa_cpu::addc_word_rd_rsoff8(u8 rd, u8 rs, u8 offset8){ fatalerror("ADDC.w %s, [%s+#$%02x]", m_regnames16[rd], m_regnames16[rs], offset8);} void xa_cpu::sub_word_rd_rsoff8(u8 rd, u8 rs, u8 offset8) { fatalerror("SUB.w %s, [%s+#$%02x]", m_regnames16[rd], m_regnames16[rs], offset8);} void xa_cpu::subb_word_rd_rsoff8(u8 rd, u8 rs, u8 offset8){ fatalerror("SUBB.w %s, [%s+#$%02x]", m_regnames16[rd], m_regnames16[rs], offset8);} diff --git a/src/devices/cpu/xavix2/xavix2.cpp b/src/devices/cpu/xavix2/xavix2.cpp index 04e94af800e21..558e7404ffa95 100644 --- a/src/devices/cpu/xavix2/xavix2.cpp +++ b/src/devices/cpu/xavix2/xavix2.cpp @@ -136,11 +136,6 @@ uint32_t xavix2_device::execute_max_cycles() const noexcept return 5; } -uint32_t xavix2_device::execute_input_lines() const noexcept -{ - return 1; -} - u32 xavix2_device::check_interrupt(u32 cpc) { if(m_int_line && ((m_hr[4] & F_I) || m_wait)) { diff --git a/src/devices/cpu/xavix2/xavix2.h b/src/devices/cpu/xavix2/xavix2.h index 30e9ec5faea14..12d74c78e2ebb 100644 --- a/src/devices/cpu/xavix2/xavix2.h +++ b/src/devices/cpu/xavix2/xavix2.h @@ -31,7 +31,6 @@ class xavix2_device : public cpu_device virtual void device_reset() override; virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 3097427bd691c..b7c11b2b17589 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -2,7 +2,6 @@ // copyright-holders:Juergen Buchmueller /***************************************************************************** * - * z180.c * Portable Z180 emulator V0.3 * *****************************************************************************/ @@ -13,8 +12,8 @@ - HALT processing is not yet perfect. The manual states that during HALT, all dma and internal i/o incl. timers continue to work. Currently, only timers are implemented. Ideally, the - burn_cycles routine would go away and halt processing be - implemented in cpu_execute. + (currently unused) burn_cycles routine would go away and halt + processing be implemented in execute_run. - Documentation for RXS/CTS1 pin is contradictory. @@ -2015,7 +2014,7 @@ void z180_device::execute_run() /**************************************************************************** * Burn 'cycles' T-states. Adjust R register for the lost time ****************************************************************************/ -void z180_device::execute_burn(int32_t cycles) +void z180_device::burn_cycles(int32_t cycles) { int extra_cycles = memory_wait_states(); diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h index 69b1b979d693d..4a8e0e5e4a529 100644 --- a/src/devices/cpu/z180/z180.h +++ b/src/devices/cpu/z180/z180.h @@ -144,11 +144,9 @@ class z180_device : public cpu_device, public z80_daisy_chain_interface virtual uint32_t execute_max_cycles() const noexcept override { return 16; } virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } - virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; - virtual void execute_burn(int32_t cycles) override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface implementation @@ -165,6 +163,7 @@ class z180_device : public cpu_device, public z80_daisy_chain_interface virtual uint8_t z180_internal_port_read(uint8_t port); virtual void z180_internal_port_write(uint8_t port, uint8_t data); + [[maybe_unused]] void burn_cycles(int32_t cycles); address_space_config m_program_config; address_space_config m_io_config; diff --git a/src/devices/cpu/z180/z180dasm.cpp b/src/devices/cpu/z180/z180dasm.cpp index 393f9a51946bb..835c620770dd2 100644 --- a/src/devices/cpu/z180/z180dasm.cpp +++ b/src/devices/cpu/z180/z180dasm.cpp @@ -2,7 +2,6 @@ // copyright-holders:Juergen Buchmueller /***************************************************************************** * - * z180dasm.c * Portable Z8x180 disassembler * *****************************************************************************/ diff --git a/src/devices/cpu/z180/z180dasm.h b/src/devices/cpu/z180/z180dasm.h index a13c7d92fe198..1d6de1bbf5d04 100644 --- a/src/devices/cpu/z180/z180dasm.h +++ b/src/devices/cpu/z180/z180dasm.h @@ -2,7 +2,6 @@ // copyright-holders:Juergen Buchmueller /***************************************************************************** * - * z180dasm.c * Portable Z8x180 disassembler * *****************************************************************************/ diff --git a/src/devices/cpu/z180/z180dd.hxx b/src/devices/cpu/z180/z180dd.hxx index d73c9720cf31d..2bee2a99d629f 100644 --- a/src/devices/cpu/z180/z180dd.hxx +++ b/src/devices/cpu/z180/z180dd.hxx @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Juergen Buchmueller -OP(illegal,1) { +OP(illegal,1) +{ logerror("Z180 '%s' ill. opcode $%02x $%02x\n", tag(), m_copcodes.read_byte((_PCD-1)&0xffff), m_copcodes.read_byte(_PCD)); } diff --git a/src/devices/cpu/z8/z8.h b/src/devices/cpu/z8/z8.h index c092cfd4066b5..1074801c5578e 100644 --- a/src/devices/cpu/z8/z8.h +++ b/src/devices/cpu/z8/z8.h @@ -48,7 +48,6 @@ class z8_device : public cpu_device // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 6; } virtual uint32_t execute_max_cycles() const noexcept override { return 27; } - virtual uint32_t execute_input_lines() const noexcept override { return 4; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return true; } virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } diff --git a/src/devices/cpu/z80/kc82.cpp b/src/devices/cpu/z80/kc82.cpp index 6dc575139def8..fd09910429ca2 100644 --- a/src/devices/cpu/z80/kc82.cpp +++ b/src/devices/cpu/z80/kc82.cpp @@ -228,7 +228,7 @@ void kc82_device::data_write(u16 addr, u8 value) u8 kc82_device::opcode_read() { - u32 pc = m_pc.w.l + m_mmu_base[m_pc.b.h >> 2]; + u32 pc = m_pc.w + m_mmu_base[m_pc.b.h >> 2]; // no refresh return m_opcodes.read_byte(pc); } @@ -240,6 +240,6 @@ u8 kc82_device::opcode_read() u8 kc82_device::arg_read() { - u32 pc = m_pc.w.l + m_mmu_base[m_pc.b.h >> 2]; + u32 pc = m_pc.w + m_mmu_base[m_pc.b.h >> 2]; return m_args.read_byte(pc); } diff --git a/src/devices/cpu/z80/nsc800.cpp b/src/devices/cpu/z80/nsc800.cpp new file mode 100644 index 0000000000000..672d019a0c7b5 --- /dev/null +++ b/src/devices/cpu/z80/nsc800.cpp @@ -0,0 +1,76 @@ +// license:BSD-3-Clause +// copyright-holders:Juergen Buchmueller +/* + + National Semiconductor NSC800 + +*/ + +#include "emu.h" +#include "nsc800.h" + +#include "z80.inc" + +#define LOG_INT (1U << 1) // z80.lst + +//#define VERBOSE (LOG_INT) +#include "logmacro.h" + + +// device type definition +DEFINE_DEVICE_TYPE(NSC800, nsc800_device, "nsc800", "National Semiconductor NSC800") + +nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : z80_device(mconfig, NSC800, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// initialization +//------------------------------------------------- + +void nsc800_device::device_start() +{ + z80_device::device_start(); + + save_item(NAME(m_nsc800_irq_state)); +} + +void nsc800_device::device_reset() +{ + z80_device::device_reset(); + memset(m_nsc800_irq_state, 0, sizeof(m_nsc800_irq_state)); +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void nsc800_device::do_op() +{ + #include "cpu/z80/ncs800.hxx" +} + +void nsc800_device::execute_set_input(int inputnum, int state) +{ + switch (inputnum) + { + case NSC800_RSTA: + m_nsc800_irq_state[0] = state; + break; + + case NSC800_RSTB: + m_nsc800_irq_state[1] = state; + break; + + case NSC800_RSTC: + m_nsc800_irq_state[2] = state; + break; + + default: + z80_device::execute_set_input(inputnum, state); + break; + } +} diff --git a/src/devices/cpu/z80/nsc800.h b/src/devices/cpu/z80/nsc800.h new file mode 100644 index 0000000000000..c37179fa700e7 --- /dev/null +++ b/src/devices/cpu/z80/nsc800.h @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Juergen Buchmueller +#ifndef MAME_CPU_Z80_NSC800_H +#define MAME_CPU_Z80_NSC800_H + +#pragma once + +#include "z80.h" + +enum +{ + NSC800_RSTA = Z80_INPUT_LINE_MAX, + NSC800_RSTB, + NSC800_RSTC +}; + + +class nsc800_device : public z80_device +{ +public: + nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_t implementation + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // device_execute_interface implementation + virtual void execute_set_input(int inputnum, int state) override; + + virtual void do_op() override; + u8 m_nsc800_irq_state[3]; // state of NSC800 restart interrupts A, B, C +}; + +DECLARE_DEVICE_TYPE(NSC800, nsc800_device) + + +#endif // MAME_CPU_Z80_NSC800_H diff --git a/src/devices/cpu/z80/r800.cpp b/src/devices/cpu/z80/r800.cpp index c5279a44a33ed..6a68b9e3d07e0 100644 --- a/src/devices/cpu/z80/r800.cpp +++ b/src/devices/cpu/z80/r800.cpp @@ -19,15 +19,13 @@ #include "r800.h" #include "r800dasm.h" -#define LOG_UNDOC (1U << 1) -#define LOG_INT (1U << 2) -#define LOG_TIME (1U << 3) +#include "z80.inc" -//#define VERBOSE ( LOG_UNDOC /*| LOG_INT*/ ) +#define LOG_INT (1U << 1) // z80.lst + +//#define VERBOSE (LOG_INT) #include "logmacro.h" -#define LOGUNDOC(...) LOGMASKED(LOG_UNDOC, __VA_ARGS__) -#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__) //************************************************************************** // GLOBAL VARIABLES @@ -64,83 +62,6 @@ void r800_device::device_validity_check(validity_checker &valid) const } - -#define HAS_LDAIR_QUIRK 0 - -/**************************************************************************** - * The Z80 registers. halt is set to 1 when the CPU is halted, the refresh - * register is calculated as follows: refresh = (r & 127) | (r2 & 128) - ****************************************************************************/ -#define CF 0x01 -#define NF 0x02 -#define PF 0x04 -#define VF PF -#define XF 0x08 -#define HF 0x10 -#define YF 0x20 -#define ZF 0x40 -#define SF 0x80 - -#define INT_IRQ 0x01 -#define NMI_IRQ 0x02 - -#define PRVPC m_prvpc.d // previous program counter - -#define PCD m_pc.d -#define PC m_pc.w.l - -#define SPD m_sp.d -#define SP m_sp.w.l - -#define AFD m_af.d -#define AF m_af.w.l -#define A m_af.b.h -#define F m_af.b.l -#define Q m_q -#define QT m_qtemp -#define I m_i -#define R m_r -#define R2 m_r2 - -#define BCD m_bc.d -#define BC m_bc.w.l -#define B m_bc.b.h -#define C m_bc.b.l - -#define DED m_de.d -#define DE m_de.w.l -#define D m_de.b.h -#define E m_de.b.l - -#define HLD m_hl.d -#define HL m_hl.w.l -#define H m_hl.b.h -#define L m_hl.b.l - -#define IXD m_ix.d -#define IX m_ix.w.l -#define HX m_ix.b.h -#define LX m_ix.b.l - -#define IYD m_iy.d -#define IY m_iy.w.l -#define HY m_iy.b.h -#define LY m_iy.b.l - -#define WZ m_wz.w.l -#define WZ_H m_wz.b.h -#define WZ_L m_wz.b.l - -#define TADR m_shared_addr.w // Typically represents values from A0..15 pins. 16bit input in steps. -#define TADR_H m_shared_addr.b.h -#define TADR_L m_shared_addr.b.l -#define TDAT m_shared_data.w // 16bit input(if use as second parameter) or output in steps. -#define TDAT2 m_shared_data2.w -#define TDAT_H m_shared_data.b.h -#define TDAT_L m_shared_data.b.l -#define TDAT8 m_shared_data.b.l // Typically represents values from D0..8 pins. 8bit input or output in steps. - - /*************************************************************** * adjust cycle count by n T-states ***************************************************************/ diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index 01fd18fd0c452..e44b38ba67763 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -27,6 +27,13 @@ #include "z80.inc" +#define LOG_INT (1U << 1) // z80.lst +#define LOG_UNDOC (1U << 2) + +#define VERBOSE (LOG_UNDOC) +#include "logmacro.h" + + bool z80_device::tables_initialised = false; u8 z80_device::SZ[] = {}; // zero and sign flags u8 z80_device::SZ_BIT[] = {}; // zero, sign and parity/overflow (=zero) flags for BIT opcode @@ -84,7 +91,7 @@ void z80_device::data_write(u16 addr, u8 value) ***************************************************************/ u8 z80_device::opcode_read() { - return m_opcodes.read_byte(translate_memory_address(PCD)); + return m_opcodes.read_byte(translate_memory_address(PC)); } /**************************************************************** @@ -96,7 +103,7 @@ u8 z80_device::opcode_read() ***************************************************************/ u8 z80_device::arg_read() { - return m_args.read_byte(translate_memory_address(PCD)); + return m_args.read_byte(translate_memory_address(PC)); } /*************************************************************** @@ -163,7 +170,7 @@ void z80_device::rra() ***************************************************************/ void z80_device::add_a(u8 value) { - u32 ah = AFD & 0xff00; + u32 ah = AF & 0xff00; u32 res = (u8)((ah >> 8) + value); set_f(SZHVC_add[ah | res]); A = res; @@ -174,7 +181,7 @@ void z80_device::add_a(u8 value) ***************************************************************/ void z80_device::adc_a(u8 value) { - u32 ah = AFD & 0xff00, c = AFD & 1; + u32 ah = AF & 0xff00, c = AF & 1; u32 res = (u8)((ah >> 8) + value + c); set_f(SZHVC_add[(c << 16) | ah | res]); A = res; @@ -185,7 +192,7 @@ void z80_device::adc_a(u8 value) ***************************************************************/ void z80_device::sub(u8 value) { - u32 ah = AFD & 0xff00; + u32 ah = AF & 0xff00; u32 res = (u8)((ah >> 8) - value); set_f(SZHVC_sub[ah | res]); A = res; @@ -196,7 +203,7 @@ void z80_device::sub(u8 value) ***************************************************************/ void z80_device::sbc_a(u8 value) { - u32 ah = AFD & 0xff00, c = AFD & 1; + u32 ah = AF & 0xff00, c = AF & 1; u32 res = (u8)((ah >> 8) - value - c); set_f(SZHVC_sub[(c << 16) | ah | res]); A = res; @@ -266,7 +273,7 @@ void z80_device::xor_a(u8 value) void z80_device::cp(u8 value) { unsigned val = value; - u32 ah = AFD & 0xff00; + u32 ah = AF & 0xff00; u32 res = (u8)((ah >> 8) - val); set_f((SZHVC_sub[ah | res] & ~(YF | XF)) | (val & (YF | XF))); } @@ -459,14 +466,15 @@ void z80_device::set_f(u8 f) void z80_device::illegal_1() { - LOGUNDOC("ill. opcode $%02x $%02x ($%04x)\n", - m_opcodes.read_byte(translate_memory_address((PCD - 1) & 0xffff)), m_opcodes.read_byte(translate_memory_address(PCD)), PCD - 1); + LOGMASKED(LOG_UNDOC, "ill. opcode $%02x $%02x ($%04x)\n", + m_opcodes.read_byte(translate_memory_address((PC - 1) & 0xffff)), + m_opcodes.read_byte(translate_memory_address(PC)), PC - 1); } void z80_device::illegal_2() { - LOGUNDOC("ill. opcode $ed $%02x\n", - m_opcodes.read_byte(translate_memory_address((PCD - 1) & 0xffff))); + LOGMASKED(LOG_UNDOC, "ill. opcode $ed $%02x\n", + m_opcodes.read_byte(translate_memory_address((PC - 1) & 0xffff))); } /**************************************************************************** @@ -555,7 +563,7 @@ void z80_device::device_start() tables_initialised = true; } - save_item(NAME(m_prvpc.w.l)); + save_item(NAME(PRVPC)); save_item(NAME(PC)); save_item(NAME(SP)); save_item(NAME(AF)); @@ -565,14 +573,14 @@ void z80_device::device_start() save_item(NAME(IX)); save_item(NAME(IY)); save_item(NAME(WZ)); - save_item(NAME(m_af2.w.l)); - save_item(NAME(m_bc2.w.l)); - save_item(NAME(m_de2.w.l)); - save_item(NAME(m_hl2.w.l)); - save_item(NAME(m_r)); - save_item(NAME(m_r2)); - save_item(NAME(m_q)); - save_item(NAME(m_qtemp)); + save_item(NAME(m_af2.w)); + save_item(NAME(m_bc2.w)); + save_item(NAME(m_de2.w)); + save_item(NAME(m_hl2.w)); + save_item(NAME(QT)); + save_item(NAME(Q)); + save_item(NAME(R)); + save_item(NAME(R2)); save_item(NAME(m_iff1)); save_item(NAME(m_iff2)); save_item(NAME(m_halt)); @@ -586,29 +594,33 @@ void z80_device::device_start() save_item(NAME(m_busack_state)); save_item(NAME(m_after_ei)); save_item(NAME(m_after_ldair)); - save_item(NAME(m_ref)); + save_item(NAME(m_ea)); save_item(NAME(m_tmp_irq_vector)); save_item(NAME(m_shared_addr.w)); save_item(NAME(m_shared_data.w)); save_item(NAME(m_shared_data2.w)); + save_item(NAME(m_rtemp)); + save_item(NAME(m_ref)); // Reset registers to their initial values PRVPC = 0; - PCD = 0; - SPD = 0; - AFD = 0; - BCD = 0; - DED = 0; - HLD = 0; - IXD = 0; - IYD = 0; + PC = 0; + SP = 0; + AF = 0; + BC = 0; + DE = 0; + HL = 0; + IX = 0; + IY = 0; WZ = 0; - m_af2.d = 0; - m_bc2.d = 0; - m_de2.d = 0; - m_hl2.d = 0; - m_r = 0; - m_r2 = 0; + m_af2.w = 0; + m_bc2.w = 0; + m_de2.w = 0; + m_hl2.w = 0; + QT = 0; + Q = 0; + R = 0; + R2 = 0; m_iff1 = 0; m_iff2 = 0; m_halt = 0; @@ -623,6 +635,7 @@ void z80_device::device_start() m_after_ei = false; m_after_ldair = false; m_ea = 0; + m_rtemp = 0; space(AS_PROGRAM).cache(m_args); space(has_space(AS_OPCODES) ? AS_OPCODES : AS_PROGRAM).cache(m_opcodes); @@ -633,8 +646,8 @@ void z80_device::device_start() set_f(ZF); // Zero flag is set // set up the state table - state_add(STATE_GENPC, "PC", m_pc.w.l).callimport(); - state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).callimport().noshow(); + state_add(STATE_GENPC, "PC", m_pc.w).callimport(); + state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w).callimport().noshow(); state_add(Z80_SP, "SP", SP); state_add(STATE_GENFLAGS, "GENFLAGS", F).noshow().formatstr("%8s"); state_add(Z80_A, "A", A).noshow(); @@ -650,10 +663,10 @@ void z80_device::device_start() state_add(Z80_HL, "HL", HL); state_add(Z80_IX, "IX", IX); state_add(Z80_IY, "IY", IY); - state_add(Z80_AF2, "AF2", m_af2.w.l); - state_add(Z80_BC2, "BC2", m_bc2.w.l); - state_add(Z80_DE2, "DE2", m_de2.w.l); - state_add(Z80_HL2, "HL2", m_hl2.w.l); + state_add(Z80_AF2, "AF2", m_af2.w); + state_add(Z80_BC2, "BC2", m_bc2.w); + state_add(Z80_DE2, "DE2", m_de2.w); + state_add(Z80_HL2, "HL2", m_hl2.w); state_add(Z80_WZ, "WZ", WZ); state_add(Z80_R, "R", m_rtemp).callimport().callexport(); state_add(Z80_I, "I", m_i); @@ -666,13 +679,6 @@ void z80_device::device_start() set_icountptr(m_icount); } -void nsc800_device::device_start() -{ - z80_device::device_start(); - - save_item(NAME(m_nsc800_irq_state)); -} - /**************************************************************************** * Do a reset ****************************************************************************/ @@ -682,6 +688,7 @@ void z80_device::device_reset() m_ref = 0xffff00; PC = 0x0000; + WZ = PC; m_i = 0; m_r = 0; m_r2 = 0; @@ -690,14 +697,6 @@ void z80_device::device_reset() m_after_ldair = false; m_iff1 = 0; m_iff2 = 0; - - WZ = PCD; -} - -void nsc800_device::device_reset() -{ - z80_device::device_reset(); - memset(m_nsc800_irq_state, 0, sizeof(m_nsc800_irq_state)); } void z80_device::do_op() @@ -705,11 +704,6 @@ void z80_device::do_op() #include "cpu/z80/z80.hxx" } -void nsc800_device::do_op() -{ - #include "cpu/z80/ncs800.hxx" -} - /**************************************************************************** * Execute 'cycles' T-states. ****************************************************************************/ @@ -760,28 +754,6 @@ void z80_device::execute_set_input(int inputnum, int state) } } -void nsc800_device::execute_set_input(int inputnum, int state) -{ - switch (inputnum) - { - case NSC800_RSTA: - m_nsc800_irq_state[NSC800_RSTA] = state; - break; - - case NSC800_RSTB: - m_nsc800_irq_state[NSC800_RSTB] = state; - break; - - case NSC800_RSTC: - m_nsc800_irq_state[NSC800_RSTC] = state; - break; - - default: - z80_device::execute_set_input(inputnum, state); - break; - } -} - /************************************************************************** * STATE IMPORT/EXPORT **************************************************************************/ @@ -888,10 +860,3 @@ device_memory_interface::space_config_vector z80_device::memory_space_config() c } DEFINE_DEVICE_TYPE(Z80, z80_device, "z80", "Zilog Z80") - -nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : z80_device(mconfig, NSC800, tag, owner, clock) -{ -} - -DEFINE_DEVICE_TYPE(NSC800, nsc800_device, "nsc800", "National Semiconductor NSC800") diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h index 2d6cc1180650e..cffcfb2191749 100644 --- a/src/devices/cpu/z80/z80.h +++ b/src/devices/cpu/z80/z80.h @@ -9,12 +9,10 @@ enum { - NSC800_RSTA = INPUT_LINE_IRQ0 + 1, - NSC800_RSTB, - NSC800_RSTC, - Z80_INPUT_LINE_WAIT, - Z80_INPUT_LINE_BOGUSWAIT, // WAIT pin implementation used to be nonexistent, please remove this when all drivers are updated with Z80_INPUT_LINE_WAIT - Z80_INPUT_LINE_BUSRQ + Z80_INPUT_LINE_WAIT = INPUT_LINE_IRQ0 + 1, + Z80_INPUT_LINE_BUSRQ, + + Z80_INPUT_LINE_MAX }; enum @@ -57,7 +55,6 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface virtual bool cpu_is_interruptible() const override { return true; } virtual u32 execute_min_cycles() const noexcept override { return 2; } virtual u32 execute_max_cycles() const noexcept override { return 16; } - virtual u32 execute_input_lines() const noexcept override { return 4; } virtual u32 execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; @@ -136,20 +133,20 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface devcb_write_line m_halt_cb; devcb_write_line m_busack_cb; - PAIR m_prvpc; - PAIR m_pc; - PAIR m_sp; - PAIR m_af; - PAIR m_bc; - PAIR m_de; - PAIR m_hl; - PAIR m_ix; - PAIR m_iy; - PAIR m_wz; - PAIR m_af2; - PAIR m_bc2; - PAIR m_de2; - PAIR m_hl2; + PAIR16 m_prvpc; + PAIR16 m_pc; + PAIR16 m_sp; + PAIR16 m_af; + PAIR16 m_bc; + PAIR16 m_de; + PAIR16 m_hl; + PAIR16 m_ix; + PAIR16 m_iy; + PAIR16 m_wz; + PAIR16 m_af2; + PAIR16 m_bc2; + PAIR16 m_de2; + PAIR16 m_hl2; u8 m_qtemp; u8 m_q; u8 m_r; @@ -167,7 +164,7 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface u8 m_busack_state; // bus acknowledge pin state bool m_after_ei; // are we in the EI shadow? bool m_after_ldair; // same, but for LD A,I or LD A,R - u32 m_ea; + u16 m_ea; int m_icount; int m_tmp_irq_vector; @@ -194,25 +191,5 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface DECLARE_DEVICE_TYPE(Z80, z80_device) -class nsc800_device : public z80_device -{ -public: - nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - // device_t implementation - virtual void device_start() override ATTR_COLD; - virtual void device_reset() override ATTR_COLD; - - // device_execute_interface implementation - virtual u32 execute_input_lines() const noexcept override { return 7; } - virtual void execute_set_input(int inputnum, int state) override; - - virtual void do_op() override; - u8 m_nsc800_irq_state[4]; // state of NSC800 restart interrupts A, B, C -}; - -DECLARE_DEVICE_TYPE(NSC800, nsc800_device) - #endif // MAME_CPU_Z80_Z80_H diff --git a/src/devices/cpu/z80/z80.inc b/src/devices/cpu/z80/z80.inc index 95e41cae5d90e..caf7ce22c8f41 100644 --- a/src/devices/cpu/z80/z80.inc +++ b/src/devices/cpu/z80/z80.inc @@ -1,14 +1,3 @@ -#define LOG_UNDOC (1U << 1) -#define LOG_INT (1U << 2) -#define LOG_TIME (1U << 3) - -#define VERBOSE ( LOG_UNDOC /*| LOG_INT*/ ) -#include "logmacro.h" - -#define LOGUNDOC(...) LOGMASKED(LOG_UNDOC, __VA_ARGS__) -#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__) - - /* On an NMOS Z80, if LD A,I or LD A,R is interrupted, P/V flag gets reset, even if IFF2 was set before this instruction. This issue was fixed on the CMOS Z80, so until knowing (most) Z80 types on hardware, it's disabled */ @@ -32,16 +21,12 @@ #define INT_IRQ 0x01 #define NMI_IRQ 0x02 -#define PRVPC m_prvpc.d // previous program counter - -#define PCD m_pc.d -#define PC m_pc.w.l +#define PRVPC m_prvpc.w // previous program counter +#define PC m_pc.w -#define SPD m_sp.d -#define SP m_sp.w.l +#define SP m_sp.w -#define AFD m_af.d -#define AF m_af.w.l +#define AF m_af.w #define A m_af.b.h #define F m_af.b.l #define Q m_q @@ -50,41 +35,36 @@ #define R m_r #define R2 m_r2 -#define BCD m_bc.d -#define BC m_bc.w.l +#define BC m_bc.w #define B m_bc.b.h #define C m_bc.b.l -#define DED m_de.d -#define DE m_de.w.l +#define DE m_de.w #define D m_de.b.h #define E m_de.b.l -#define HLD m_hl.d -#define HL m_hl.w.l +#define HL m_hl.w #define H m_hl.b.h #define L m_hl.b.l -#define IXD m_ix.d -#define IX m_ix.w.l +#define IX m_ix.w #define HX m_ix.b.h #define LX m_ix.b.l -#define IYD m_iy.d -#define IY m_iy.w.l +#define IY m_iy.w #define HY m_iy.b.h #define LY m_iy.b.l -#define WZ m_wz.w.l +#define WZ m_wz.w #define WZ_H m_wz.b.h #define WZ_L m_wz.b.l -#define TADR m_shared_addr.w // Typically represents values from A0..15 pins. 16bit input in steps. -#define TADR_H m_shared_addr.b.h -#define TADR_L m_shared_addr.b.l -#define TDAT m_shared_data.w // 16bit input(if use as second parameter) or output in steps. -#define TDAT2 m_shared_data2.w -#define TDAT_H m_shared_data.b.h -#define TDAT_L m_shared_data.b.l -#define TDAT8 m_shared_data.b.l // Typically represents values from D0..8 pins. 8bit input or output in steps. +#define TADR m_shared_addr.w // Typically represents values from A0..15 pins. 16bit input in steps. +#define TADR_H m_shared_addr.b.h +#define TADR_L m_shared_addr.b.l +#define TDAT m_shared_data.w // 16bit input(if use as second parameter) or output in steps. +#define TDAT2 m_shared_data2.w +#define TDAT_H m_shared_data.b.h +#define TDAT_L m_shared_data.b.l +#define TDAT8 m_shared_data.b.l // Typically represents values from D0..8 pins. 8bit input or output in steps. diff --git a/src/devices/cpu/z80/z80.lst b/src/devices/cpu/z80/z80.lst index 378ee71bc7765..fe40d25cded4c 100644 --- a/src/devices/cpu/z80/z80.lst +++ b/src/devices/cpu/z80/z80.lst @@ -40,9 +40,9 @@ macro wm16 macro wm16_sp SP--; - m_memrq_cycles !! data_write(SPD, TDAT_H); + m_memrq_cycles !! data_write(SP, TDAT_H); SP--; - m_memrq_cycles !! data_write(SPD, TDAT_L); + m_memrq_cycles !! data_write(SP, TDAT_L); macro rop m_m1_cycles-2 !! TDAT8 = opcode_read(); @@ -66,16 +66,16 @@ macro arg16 macro eax call arg - m_ea = (u32)(u16)(IX + (s8)TDAT8); WZ = m_ea; + m_ea = (u16)(IX + (s8)TDAT8); WZ = m_ea; macro eay call arg - m_ea = (u32)(u16)(IY + (s8)TDAT8); WZ = m_ea; + m_ea = (u16)(IY + (s8)TDAT8); WZ = m_ea; macro pop - m_memrq_cycles !! TDAT_L = data_read(SPD); + m_memrq_cycles !! TDAT_L = data_read(SP); SP++; - m_memrq_cycles !! TDAT_H = data_read(SPD); + m_memrq_cycles !! TDAT_H = data_read(SP); SP++; macro push @@ -84,12 +84,12 @@ macro push macro jp call arg16 - PCD = TDAT; WZ = PC; + PC = TDAT; WZ = PC; macro jp_cond if (TDAT8) { call arg16 - PC = TDAT; WZ = PCD; + PC = TDAT; WZ = PC; } else { // implicit do PC += 2 call arg16 @@ -98,13 +98,13 @@ macro jp_cond macro jr call arg - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr PC += (s8)TDAT8; WZ = PC; macro r800:jr call arg - TADR = PCD-1; + TADR = PC-1; + 1 PC += (s8)TDAT8; WZ = PC; @@ -117,19 +117,19 @@ macro jr_cond macro arg16_call call arg16 - m_ea = TDAT; TADR = PCD-1; + m_ea = TDAT; TADR = PC-1; call nomreq_addr WZ = m_ea; TDAT = PC; call wm16_sp - PCD = m_ea; + PC = m_ea; macro r800:arg16_call call arg16 - m_ea = TDAT; TADR = PCD-1; + m_ea = TDAT; TADR = PC-1; call nomreq_addr WZ = m_ea; TDAT = PC; call wm16_sp - PCD = m_ea; + PC = m_ea; macro call_cond if (TDAT8) { @@ -148,7 +148,7 @@ macro ret_cond macro retn call pop - PC = TDAT; LOGINT("RETN m_iff1:%d m_iff2:%d\n", m_iff1, m_iff2); WZ = PC; m_iff1 = m_iff2; + PC = TDAT; LOGMASKED(LOG_INT, "RETN m_iff1:%d m_iff2:%d\n", m_iff1, m_iff2); WZ = PC; m_iff1 = m_iff2; macro z80n:retn m_out_retn_seen_cb(0); @@ -159,7 +159,7 @@ macro z80n:retn } else { PC = TDAT; } - LOGINT("RETN m_iff1:%d m_iff2:%d\n", m_iff1, m_iff2); WZ = PC; m_iff1 = m_iff2; + LOGMASKED(LOG_INT, "RETN m_iff1:%d m_iff2:%d\n", m_iff1, m_iff2); WZ = PC; m_iff1 = m_iff2; macro reti call pop @@ -236,17 +236,17 @@ macro r800:add16 macro adc_hl call nomreq_ir 7 - { u32 res = HLD + TDAT + (F & CF); WZ = HL + 1; set_f((((HLD ^ res ^ TDAT) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HLD ^ 0x8000) & (TDAT ^ res) & 0x8000) >> 13)); HL = (u16)res; } + { u32 res = HL + TDAT + (F & CF); WZ = HL + 1; set_f((((HL ^ res ^ TDAT) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HL ^ 0x8000) & (TDAT ^ res) & 0x8000) >> 13)); HL = (u16)res; } macro r800:adc_hl - { u32 res = HLD + TDAT + (F & CF); WZ = HL + 1; set_f((((HLD ^ res ^ TDAT) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HLD ^ 0x8000) & (TDAT ^ res) & 0x8000) >> 13)); HL = (u16)res; } + { u32 res = HL + TDAT + (F & CF); WZ = HL + 1; set_f((((HL ^ res ^ TDAT) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HL ^ 0x8000) & (TDAT ^ res) & 0x8000) >> 13)); HL = (u16)res; } macro sbc_hl call nomreq_ir 7 - { u32 res = HLD - TDAT - (F & CF); WZ = HL + 1; set_f((((HLD ^ res ^ TDAT) >> 8) & HF) | NF | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HLD) & (HLD ^ res) &0x8000) >> 13)); HL = (u16)res; } + { u32 res = HL - TDAT - (F & CF); WZ = HL + 1; set_f((((HL ^ res ^ TDAT) >> 8) & HF) | NF | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HL) & (HL ^ res) &0x8000) >> 13)); HL = (u16)res; } macro r800:sbc_hl - { u32 res = HLD - TDAT - (F & CF); WZ = HL + 1; set_f((((HLD ^ res ^ TDAT) >> 8) & HF) | NF | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HLD) & (HLD ^ res) &0x8000) >> 13)); HL = (u16)res; } + { u32 res = HL - TDAT - (F & CF); WZ = HL + 1; set_f((((HL ^ res ^ TDAT) >> 8) & HF) | NF | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((TDAT ^ HL) & (HL ^ res) &0x8000) >> 13)); HL = (u16)res; } macro ldi TADR = HL; @@ -519,8 +519,8 @@ macro take_nmi + 5 TDAT = PC; call wm16_sp - PCD = 0x0066; - WZ = PCD; + PC = 0x0066; + WZ = PC; m_nmi_pending = false; macro take_interrupt @@ -535,8 +535,8 @@ macro take_interrupt { // fetch the IRQ vector device_z80daisy_interface *intf = daisy_get_irq_device(); - m_tmp_irq_vector = (intf != nullptr) ? intf->z80daisy_irq_ack() : standard_irq_callback(0, m_pc.w.l); - LOGINT("single INT m_tmp_irq_vector $%02x\n", m_tmp_irq_vector); + m_tmp_irq_vector = (intf != nullptr) ? intf->z80daisy_irq_ack() : standard_irq_callback(0, m_pc.w); + LOGMASKED(LOG_INT, "single INT m_tmp_irq_vector $%02x\n", m_tmp_irq_vector); } // 'interrupt latency' cycles + 2 @@ -552,21 +552,21 @@ macro take_interrupt m_tmp_irq_vector = (m_tmp_irq_vector & 0xff) | (m_i << 8); TADR = m_tmp_irq_vector; call rm16 - PCD = TDAT; - LOGINT("IM2 [$%04x] = $%04x\n", m_tmp_irq_vector, PCD); + PC = TDAT; + LOGMASKED(LOG_INT, "IM2 [$%04x] = $%04x\n", m_tmp_irq_vector, PC); } else if (m_im == 1) { // Interrupt mode 1. RST 38h - LOGINT("'%s' IM1 $0038\n", tag()); + LOGMASKED(LOG_INT, "'%s' IM1 $0038\n", tag()); // RST $38 + 5 TDAT = PC; call wm16_sp - PCD = 0x0038; + PC = 0x0038; } else { /* Interrupt mode 0. We check for CALL and JP instructions, if neither of these were found we assume a 1 byte opcode was placed on the databus */ - LOGINT("IM0 $%04x\n", m_tmp_irq_vector); + LOGMASKED(LOG_INT, "IM0 $%04x\n", m_tmp_irq_vector); // check for nop if (m_tmp_irq_vector != 0x00) { @@ -575,27 +575,27 @@ macro take_interrupt + 11 TDAT = PC; call wm16_sp - PCD = m_tmp_irq_vector & 0xffff; + PC = m_tmp_irq_vector & 0xffff; } else if ((m_tmp_irq_vector & 0xff0000) == 0xc30000) { // JP $xxxx cycles + 10 - PCD = m_tmp_irq_vector & 0xffff; - } else if (m_tmp_irq_vector == 0xfb) { - // rst (or other opcodes?) - + 4 - ei(); + PC = m_tmp_irq_vector & 0xffff; } else if ((m_tmp_irq_vector & 0xc7) == 0xc7) { // RST $xx cycles + 5 TDAT = PC; call wm16_sp - PCD = m_tmp_irq_vector & 0x0038; + PC = m_tmp_irq_vector & 0x0038; + } else if (m_tmp_irq_vector == 0xfb) { + // EI cycles + + 4 + ei(); } else { logerror("take_interrupt: unexpected opcode in im0 mode: 0x%02x\n", m_tmp_irq_vector); } } } - WZ = PCD; + WZ = PC; #if HAS_LDAIR_QUIRK // reset parity flag after LD A,I or LD A,R if (m_after_ldair) F &= ~PF; @@ -627,23 +627,23 @@ macro nsc800_take_interrupt m_iff1 = m_iff2 = 0; // 'interrupt latency' cycles + 7 - if (m_nsc800_irq_state[NSC800_RSTA]) { + if (m_nsc800_irq_state[0]) { TDAT = PC; call wm16_sp - PCD = 0x003c; - } else if (m_nsc800_irq_state[NSC800_RSTB]) { + PC = 0x003c; + } else if (m_nsc800_irq_state[1]) { TDAT = PC; call wm16_sp - PCD = 0x0034; - } else if (m_nsc800_irq_state[NSC800_RSTC]) { + PC = 0x0034; + } else if (m_nsc800_irq_state[2]) { TDAT = PC; call wm16_sp - PCD = 0x002c; + PC = 0x002c; } else { + 2 * m_memrq_cycles ; } - WZ = PCD; + WZ = PC; #if HAS_LDAIR_QUIRK // reset parity flag after LD A,I or LD A,R if (m_after_ldair) F &= ~PF; @@ -652,7 +652,7 @@ macro nsc800_take_interrupt macro ncs800:check_interrupts if (m_nmi_pending) { call take_nmi - } else if ((m_nsc800_irq_state[NSC800_RSTA] != CLEAR_LINE || m_nsc800_irq_state[NSC800_RSTB] != CLEAR_LINE || m_nsc800_irq_state[NSC800_RSTC] != CLEAR_LINE) && m_iff1 && !m_after_ei) { + } else if ((m_nsc800_irq_state[0] != CLEAR_LINE || m_nsc800_irq_state[1] != CLEAR_LINE || m_nsc800_irq_state[2] != CLEAR_LINE) && m_iff1 && !m_after_ei) { call nsc800_take_interrupt } else if (m_irq_state != CLEAR_LINE && m_iff1 && !m_after_ei) { call take_interrupt @@ -678,8 +678,8 @@ ffff call check_interrupts m_after_ei = false; m_after_ldair = false; - PRVPC = PCD; - debugger_instruction_hook(PCD); + PRVPC = PC; + debugger_instruction_hook(PC); call rop if (m_halt) { PC--; @@ -3133,7 +3133,7 @@ dd33 # DB DD dd34 # INC (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm_reg @@ -3142,7 +3142,7 @@ dd34 # INC (IX+o) dd35 # DEC (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm_reg @@ -3152,7 +3152,7 @@ dd35 # DEC (IX+o) dd36 # LD (IX+o),n call eax call arg - TADR = PCD-1; + TADR = PC-1; 2 * call nomreq_addr TADR = m_ea; call wm @@ -3218,7 +3218,7 @@ dd45 # LD B,LX dd46 # LD B,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3252,7 +3252,7 @@ dd4d # LD C,LX dd4e # LD C,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3286,7 +3286,7 @@ dd55 # LD D,LX dd56 # LD D,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3320,7 +3320,7 @@ dd5d # LD E,LX dd5e # LD E,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3349,7 +3349,7 @@ dd65 # LD HX,LX dd66 # LD H,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3377,7 +3377,7 @@ dd6d # LD LX,LX dd6e # LD L,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3388,42 +3388,42 @@ dd6f # LD LX,A dd70 # LD (IX+o),B call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = B; call wm dd71 # LD (IX+o),C call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = C; call wm dd72 # LD (IX+o),D call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = D; call wm dd73 # LD (IX+o),E call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = E; call wm dd74 # LD (IX+o),H call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = H; call wm dd75 # LD (IX+o),L call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = L; call wm @@ -3434,7 +3434,7 @@ dd76 # DB DD dd77 # LD (IX+o),A call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = A; call wm @@ -3463,7 +3463,7 @@ dd7d # LD A,LX dd7e # LD A,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3497,7 +3497,7 @@ dd85 # ADD A,LX dd86 # ADD A,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3531,7 +3531,7 @@ dd8d # ADC A,LX dd8e # ADC A,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3565,7 +3565,7 @@ dd95 # SUB LX dd96 # SUB (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3599,7 +3599,7 @@ dd9d # SBC A,LX dd9e # SBC A,(IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3633,7 +3633,7 @@ dda5 # AND LX dda6 # AND (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3667,7 +3667,7 @@ ddad # XOR LX ddae # XOR (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3701,7 +3701,7 @@ ddb5 # OR LX ddb6 # OR (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3735,7 +3735,7 @@ ddbd # CP LX ddbe # CP (IX+o) call eax - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -3792,7 +3792,7 @@ ddca # DB DD ddcb # ** DD CB xx call eax call arg - TADR = PCD-1; + TADR = PC-1; 2 * call nomreq_addr call jump_prefixed 0xfe @@ -4221,7 +4221,7 @@ fd33 # DB FD fd34 # INC (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm_reg @@ -4230,7 +4230,7 @@ fd34 # INC (IY+o) fd35 # DEC (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm_reg @@ -4240,7 +4240,7 @@ fd35 # DEC (IY+o) fd36 # LD (IY+o),n call eay call arg - TADR = PCD-1; + TADR = PC-1; 2 * call nomreq_addr TADR = m_ea; call wm @@ -4306,7 +4306,7 @@ fd45 # LD B,LY fd46 # LD B,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4340,7 +4340,7 @@ fd4d # LD C,LY fd4e # LD C,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4374,7 +4374,7 @@ fd55 # LD D,LY fd56 # LD D,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4408,7 +4408,7 @@ fd5d # LD E,LY fd5e # LD E,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4437,7 +4437,7 @@ fd65 # LD HY,LY fd66 # LD H,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4465,7 +4465,7 @@ fd6d # LD LY,LY fd6e # LD L,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4476,42 +4476,42 @@ fd6f # LD LY,A fd70 # LD (IY+o),B call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = B; call wm fd71 # LD (IY+o),C call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = C; call wm fd72 # LD (IY+o),D call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = D; call wm fd73 # LD (IY+o),E call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = E; call wm fd74 # LD (IY+o),H call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = H; call wm fd75 # LD (IY+o),L call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = L; call wm @@ -4522,7 +4522,7 @@ fd76 # DB FD fd77 # LD (IY+o),A call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; TDAT8 = A; call wm @@ -4551,7 +4551,7 @@ fd7d # LD A,LY fd7e # LD A,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4585,7 +4585,7 @@ fd85 # ADD A,LY fd86 # ADD A,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4619,7 +4619,7 @@ fd8d # ADC A,LY fd8e # ADC A,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4653,7 +4653,7 @@ fd95 # SUB LY fd96 # SUB (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4687,7 +4687,7 @@ fd9d # SBC A,LY fd9e # SBC A,(IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4721,7 +4721,7 @@ fda5 # AND LY fda6 # AND (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4755,7 +4755,7 @@ fdad # XOR LY fdae # XOR (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4789,7 +4789,7 @@ fdb5 # OR LY fdb6 # OR (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4823,7 +4823,7 @@ fdbd # CP LY fdbe # CP (IY+o) call eay - TADR = PCD-1; + TADR = PC-1; 5 * call nomreq_addr TADR = m_ea; call rm @@ -4880,7 +4880,7 @@ fdca # DB FD fdcb # ** FD CB xx call eay call arg - TADR = PCD-1; + TADR = PC-1; 2 * call nomreq_addr call jump_prefixed 0xfe @@ -6634,7 +6634,7 @@ edff # DB ED 00c9 # RET call pop - PC = TDAT; WZ = PCD; + PC = TDAT; WZ = PC; 00ca # JP Z,a TDAT8 = F & ZF; @@ -8794,7 +8794,7 @@ z80n:ed95 # setae z80n:ed98 # jp (c) TADR = BC; call in - PCD = (PCD & 0xc000) + (TDAT8 << 6); + PC = (PC & 0xc000) + (TDAT8 << 6); z80n:eda4 # ldix call ldix diff --git a/src/devices/cpu/z80/z80n.cpp b/src/devices/cpu/z80/z80n.cpp index 6fc1751373bc9..4acc97c715f1c 100644 --- a/src/devices/cpu/z80/z80n.cpp +++ b/src/devices/cpu/z80/z80n.cpp @@ -10,6 +10,12 @@ #include "z80.inc" +#define LOG_INT (1U << 1) // z80.lst + +//#define VERBOSE (LOG_INT) +#include "logmacro.h" + + DEFINE_DEVICE_TYPE(Z80N, z80n_device, "z80n", "Z80N") std::unique_ptr z80n_device::create_disassembler() diff --git a/src/devices/cpu/z8000/z8000.h b/src/devices/cpu/z8000/z8000.h index 3f4900788a6f3..4d53285d31df7 100644 --- a/src/devices/cpu/z8000/z8000.h +++ b/src/devices/cpu/z8000/z8000.h @@ -96,7 +96,6 @@ class z8002_device : public cpu_device, public z8000_disassembler::config // device_execute_interface overrides virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 744; } - virtual uint32_t execute_input_lines() const noexcept override { return 2; } virtual uint32_t execute_default_irq_vector(int inputnum) const noexcept override { return 0xff; } virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return inputnum == INPUT_LINE_NMI; } virtual void execute_run() override; diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index da207a9d088d5..02a2aa6abbecd 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -45,16 +45,17 @@ #define PITCH_SEEK_SAMPLES 1 -#define FLUX_SCREEN 0 - #define FLOPSND_TAG "floppysound" // device type definition DEFINE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector, "floppy_connector", "Floppy drive connector abstraction") // generic 3" drives -DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided floppy drive") -DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3_sssd", "3\" single-sided single density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3_dssd", "3\" double-sided single density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided double density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided double density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_DSQD, floppy_3_dsqd, "floppy_3_dsqd", "3\" double-sided quad density floppy drive") // generic 3.5" drives DEFINE_DEVICE_TYPE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_35_ssdd", "3.5\" single-sided double density floppy drive") @@ -211,7 +212,8 @@ floppy_connector::floppy_connector(const machine_config &mconfig, const char *ta device_t(mconfig, FLOPPY_CONNECTOR, tag, owner, clock), device_slot_interface(mconfig, *this), formats(nullptr), - m_enable_sound(false) + m_enable_sound(false), + m_sectoring_type(floppy_image::SOFT) { } @@ -230,6 +232,7 @@ void floppy_connector::device_config_complete() { dev->set_formats(formats); dev->enable_sound(m_enable_sound); + dev->set_sectoring_type(m_sectoring_type); } } @@ -252,6 +255,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t m_tracks(0), m_sides(0), m_form_factor(0), + m_sectoring_type(floppy_image::SOFT), m_motor_always_on(false), m_dskchg_writable(false), m_has_trk00_sensor(true), @@ -267,8 +271,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t m_track_dirty(false), m_ready_counter(0), m_make_sound(false), - m_sound_out(nullptr), - m_flux_screen(*this, "flux") + m_sound_out(nullptr) { m_extension_list[0] = '\0'; } @@ -361,6 +364,72 @@ void floppy_image_device::register_formats() } } +void floppy_image_device::add_variant(uint32_t variant) +{ + uint32_t actual_variant = variant; + + if (m_sectoring_type == floppy_image::H10) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSSD10; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSDD10; + break; + case floppy_image::SSQD: + actual_variant = floppy_image::SSQD10; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD10; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD10; + break; + case floppy_image::DSQD: + actual_variant = floppy_image::DSQD10; + break; + } + } else if (m_sectoring_type == floppy_image::H16) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSDD16; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSSD16; + break; + case floppy_image::SSQD: + actual_variant = floppy_image::SSQD16; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD16; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD16; + break; + case floppy_image::DSQD: + actual_variant = floppy_image::DSQD16; + break; + } + } else if (m_sectoring_type == floppy_image::H32) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSSD32; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSDD32; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD32; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD32; + break; + } + } + + m_variants.push_back(actual_variant); +} + void floppy_image_device::set_formats(std::function formats) { m_format_registration_cb = formats; @@ -386,6 +455,16 @@ void floppy_image_device::set_rpm(float _rpm) m_angular_speed = m_rpm/60.0*2e8; } +void floppy_image_device::set_sectoring_type(uint32_t sectoring_type) +{ + m_sectoring_type = sectoring_type; +} + +uint32_t floppy_image_device::get_sectoring_type() +{ + return m_sectoring_type; +} + void floppy_image_device::setup_write(const floppy_image_format_t *_output_format) { m_output_format = _output_format; @@ -395,11 +474,6 @@ void floppy_image_device::setup_write(const floppy_image_format_t *_output_forma void floppy_image_device::commit_image() { - if(FLUX_SCREEN && m_track_dirty) { - flux_image_compute_for_track(((m_cyl << 2) | m_subcyl) >> (2 - m_image->get_resolution()), m_ss); - m_track_dirty = false; - } - m_image_dirty = false; if(!m_output_format || !m_output_format->supports_save()) return; @@ -493,29 +567,6 @@ void floppy_image_device::device_start() save_item(NAME(m_image_dirty)); save_item(NAME(m_ready_counter)); save_item(NAME(m_phases)); - - if(FLUX_SCREEN) { - m_flux_per_pixel_infos.resize(flux_screen_sx*flux_screen_sy); - flux_per_pixel_info *ppi = m_flux_per_pixel_infos.data(); - for(int y = 0; y != flux_screen_sy; y++) { - int head = y >= flux_screen_sy / 2 ? 1 : 0; - int yc = (flux_screen_sy/2-1)/2 + (flux_screen_sy/2)*head; - int dy = y - yc; - for(int x = 0; x != flux_screen_sx; x++) { - const int xc = (flux_screen_sx - 1)/2; - int dx = x - xc; - int r = int(sqrt(dx*dx + dy*dy) + 0.5); - ppi->m_r = r; - if(r > flux_max_r || r < flux_min_r) - ppi->m_position = 0xffffffff; - else - ppi->m_position = int((200e6 / 2 / M_PI) * atan2(dy, dx) + 100000000.5) % 200000000; - ppi->m_combined_track = 0; - ppi->m_color = 0; - ppi ++; - } - } - } } void floppy_image_device::device_reset() @@ -622,147 +673,9 @@ std::pair floppy_image_device::call_load() if (!m_cur_load_cb.isnull()) m_cur_load_cb(this); - flux_image_prepare(); - return std::make_pair(std::error_condition(), std::string()); } -void floppy_image_device::flux_image_prepare() -{ - if(!FLUX_SCREEN) - return; - - int tracks = 0, heads = 0, rez = 0; - m_image->get_maximal_geometry(tracks, heads); - rez = m_image->get_resolution(); - - int trackm = (tracks - 1) << rez; - int tmask = (1 << rez) - 1; - - m_flux_per_combined_track_infos.clear(); - m_flux_per_combined_track_infos.resize(trackm+1); - for(int track = 0; track <= trackm; track++) { - int refr = 200 + (trackm - 0.5 - track) * 290 / (trackm+1) + 200; - int span = int((200e6 / 2 / M_PI) / refr); - m_flux_per_combined_track_infos[track].m_span = span; - m_flux_per_combined_track_infos[track].m_track = track >> rez; - m_flux_per_combined_track_infos[track].m_subtrack = track & tmask; - } - - flux_per_pixel_info *ppi = m_flux_per_pixel_infos.data(); - for(int head = 0; head != heads; head++) - for(unsigned int i=0; i != flux_screen_sx*flux_screen_sy/2; i++) { - if(ppi->m_position != 0xffffffff) { - int trk = (trackm + 1) * (flux_max_r - ppi->m_r) / (flux_max_r - flux_min_r + 1); - ppi->m_combined_track = trk; - m_flux_per_combined_track_infos[trk].m_pixels[head].push_back(ppi); - } - ppi++; - } - - for(auto &t : m_flux_per_combined_track_infos) { - std::sort(t.m_pixels[0].begin(), t.m_pixels[0].end(), [](const flux_per_pixel_info *a, const flux_per_pixel_info *b) -> bool { return a->m_position < b->m_position; }); - if(heads == 2) - std::sort(t.m_pixels[1].begin(), t.m_pixels[1].end(), [](const flux_per_pixel_info *a, const flux_per_pixel_info *b) -> bool { return a->m_position < b->m_position; }); - } - - for(int head = 0; head != heads; head++) - for(int track = 0; track <= trackm; track++) - flux_image_compute_for_track(track, head); -} - -void floppy_image_device::flux_image_compute_for_track(int track, int head) -{ - auto *pcti = m_flux_per_combined_track_infos.data() + track; - const std::vector &buffer = m_image->get_buffer(pcti->m_track, head, pcti->m_subtrack); - int sz = buffer.size(); - if(!sz) { - for(flux_per_pixel_info *p : m_flux_per_combined_track_infos[track].m_pixels[head]) - p->m_color = 255; - return; - } - - int spos = pcti->m_pixels[head][0]->m_position - pcti->m_span + 200000000; - int bpos = sz; - while(bpos && (buffer[bpos-1] & floppy_image::TIME_MASK) < spos) - bpos --; - if(bpos == sz) - bpos = 0; - - int pspos = spos; - for(flux_per_pixel_info *p : m_flux_per_combined_track_infos[track].m_pixels[head]) { - int spos = p->m_position - pcti->m_span; - int epos = p->m_position + pcti->m_span; - if(spos < 0) - spos += 200000000; - if(epos >= 200000000) - epos -= 200000000; - - if(spos < pspos) - bpos = 0; - while(bpos != sz-1 && (buffer[bpos+1] & floppy_image::TIME_MASK) < spos) - bpos ++; - - int bpos2 = spos < epos ? bpos : 0; - while(bpos2 != sz-1 && (buffer[bpos2+1] & floppy_image::TIME_MASK) < epos) - bpos2 ++; - - int count; - if(bpos <= bpos2) - count = bpos2 - bpos; - else { - count = (sz - 1 - bpos) + bpos2; - if((buffer[0] ^ buffer[sz-1]) & floppy_image::MG_MASK) - count ++; - } - - count *= 5; - if(count > 255) - count = 255; - p->m_color = 255 - count; - pspos = spos; - } -} - -uint32_t floppy_image_device::flux_screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - if(m_image.get()) { - int ctrack = ((m_cyl << 2) | m_subcyl) >> (2 - m_image->get_resolution()); - if(m_mon) - ctrack = -1; - for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - int head = y >= flux_screen_sy / 2; - flux_per_pixel_info *ppi = m_flux_per_pixel_infos.data() + y * flux_screen_sx + cliprect.min_x; - uint32_t *p = &bitmap.pix(y, cliprect.min_x); - for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - if(ppi->m_position == 0xffffffff) - *p++ = 0; - else { - u32 color = 0x010101 * ppi->m_color; - if(ppi->m_combined_track == ctrack && head == m_ss) - color &= 0x0000ff; - *p++ = color; - } - ppi++; - } - } - } else { - for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - flux_per_pixel_info *ppi = m_flux_per_pixel_infos.data() + y * flux_screen_sx + cliprect.min_x; - uint32_t *p = &bitmap.pix(y, cliprect.min_x); - for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - if(ppi->m_position == 0xffffffff) - *p++ = 0; - else - *p++ = 0x404040; - ppi++; - } - } - } - - return 0; -} - void floppy_image_device::call_unload() { cache_clear(); @@ -818,8 +731,6 @@ std::pair floppy_image_device::call_create(in init_floppy_load(true); - flux_image_prepare(); - return std::make_pair(std::error_condition(), std::string()); } @@ -915,13 +826,20 @@ TIMER_CALLBACK_MEMBER(floppy_image_device::index_resync) } int position = int(delta.as_double()*m_angular_speed + 0.5); - int new_idx = position < 2000000; + uint32_t last_index = 0, next_index = 200000000; + // if hard-sectored floppy, has extra IDX pulses + if(m_image) + m_image->find_index_hole(position, last_index, next_index); + int new_idx = position - last_index < 2000000; if(new_idx) { - attotime index_up_time = attotime::from_double(2000000/m_angular_speed); + uint32_t index_up = last_index + 2000000; + attotime index_up_time = attotime::from_double(index_up/m_angular_speed); m_index_timer->adjust(index_up_time - delta); - } else - m_index_timer->adjust(m_rev_time - delta); + } else { + attotime next_index_time = next_index >= 200000000 ? m_rev_time : attotime::from_double(next_index/m_angular_speed); + m_index_timer->adjust(next_index_time - delta); + } if(new_idx != m_idx) { m_idx = new_idx; @@ -959,11 +877,6 @@ void floppy_image_device::check_led() m_cur_led_cb(this, (m_ds == m_drive_index) && !m_ready ? 1 : 0); } -double floppy_image_device::get_pos() -{ - return m_index_timer->elapsed().as_double(); -} - bool floppy_image_device::twosid_r() { int tracks = 0, heads = 0; @@ -973,6 +886,24 @@ bool floppy_image_device::twosid_r() return heads == 1; } +bool floppy_image_device::floppy_is_hd() +{ + if (!m_image) + return false; + u32 variant = m_image->get_variant(); + return variant == floppy_image::DSHD; + +} + +bool floppy_image_device::floppy_is_ed() +{ + if (!m_image) + return false; + u32 variant = m_image->get_variant(); + return variant == floppy_image::DSED; + +} + void floppy_image_device::track_changed() { } @@ -988,11 +919,6 @@ void floppy_image_device::stp_w(int state) cache_clear(); m_stp = state; if ( m_stp == 0 ) { - if(FLUX_SCREEN && m_track_dirty) { - flux_image_compute_for_track(((m_cyl << 2) | m_subcyl) >> (2 - m_image->get_resolution()), m_ss); - m_track_dirty = false; - } - int ocyl = m_cyl; if ( m_dir ) { if ( m_cyl ) m_cyl--; @@ -1049,11 +975,6 @@ void floppy_image_device::seek_phase_w(int _phases) else if(next_pos > (m_tracks-1)*4) next_pos = (m_tracks-1)*4; - if(FLUX_SCREEN && m_track_dirty) { - flux_image_compute_for_track(((m_cyl << 2) | m_subcyl) >> (2 - m_image->get_resolution()), m_ss); - m_track_dirty = false; - } - m_cyl = next_pos >> 2; m_subcyl = next_pos & 3; @@ -1784,14 +1705,6 @@ void floppy_image_device::device_add_mconfig(machine_config &config) { SPEAKER(config, FLOPSPK).front_center(); FLOPPYSOUND(config, FLOPSND_TAG, 44100).add_route(ALL_OUTPUTS, FLOPSPK, 0.5); - - if (FLUX_SCREEN) - { - SCREEN(config, m_flux_screen, SCREEN_TYPE_RASTER); - m_flux_screen->set_screen_update(FUNC(floppy_image_device::flux_screen_update)); - m_flux_screen->set_raw(30*(flux_screen_sx+1)*(flux_screen_sy+1), flux_screen_sx+1, 0, flux_screen_sx, flux_screen_sy+1, 0, flux_screen_sy); - m_flux_screen->set_physical_aspect(1, 2); - } } @@ -1802,6 +1715,53 @@ DEFINE_DEVICE_TYPE(FLOPPYSOUND, floppy_sound_device, "flopsnd", "Floppy sound") // GENERIC FLOPPY DRIVE DEFINITIONS //************************************************************************** +//------------------------------------------------- +// 3" single-sided single density +//------------------------------------------------- + +floppy_3_sssd::floppy_3_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + floppy_image_device(mconfig, FLOPPY_3_SSSD, tag, owner, clock) +{ +} + +floppy_3_sssd::~floppy_3_sssd() +{ +} + +void floppy_3_sssd::setup_characteristics() +{ + m_form_factor = floppy_image::FF_3; + m_tracks = 42; + m_sides = 1; + set_rpm(300); + + add_variant(floppy_image::SSSD); +} + +//------------------------------------------------- +// 3" double-sided single density +//------------------------------------------------- + +floppy_3_dssd::floppy_3_dssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + floppy_image_device(mconfig, FLOPPY_3_DSSD, tag, owner, clock) +{ +} + +floppy_3_dssd::~floppy_3_dssd() +{ +} + +void floppy_3_dssd::setup_characteristics() +{ + m_form_factor = floppy_image::FF_3; + m_tracks = 42; + m_sides = 2; + set_rpm(300); + + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); +} + //------------------------------------------------- // 3" single-sided double density //------------------------------------------------- @@ -1822,7 +1782,8 @@ void floppy_3_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -1845,8 +1806,37 @@ void floppy_3_dsdd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); +} + +//------------------------------------------------- +// 3" double-sided quad density +//------------------------------------------------- + +floppy_3_dsqd::floppy_3_dsqd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + floppy_image_device(mconfig, FLOPPY_3_DSQD, tag, owner, clock) +{ +} + +floppy_3_dsqd::~floppy_3_dsqd() +{ +} + +void floppy_3_dsqd::setup_characteristics() +{ + m_form_factor = floppy_image::FF_3; + m_tracks = 84; + m_sides = 2; + set_rpm(300); + + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); } //------------------------------------------------- @@ -1869,8 +1859,8 @@ void floppy_35_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -1893,9 +1883,9 @@ void floppy_35_dd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -1918,10 +1908,10 @@ void floppy_35_hd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -1944,11 +1934,11 @@ void floppy_35_ed::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); - m_variants.push_back(floppy_image::DSED); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); + add_variant(floppy_image::DSED); } //------------------------------------------------- @@ -1971,7 +1961,7 @@ void floppy_525_sssd_35t::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -1994,8 +1984,8 @@ void floppy_525_sd_35t::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -2019,7 +2009,7 @@ void floppy_525_vtech::setup_characteristics() m_sides = 1; set_rpm(85); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2042,7 +2032,7 @@ void floppy_525_sssd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2065,7 +2055,7 @@ void floppy_525_sd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2088,8 +2078,8 @@ void floppy_525_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2112,9 +2102,9 @@ void floppy_525_dd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2137,9 +2127,9 @@ void floppy_525_ssqd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); } //------------------------------------------------- @@ -2162,12 +2152,12 @@ void floppy_525_qd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); } //------------------------------------------------- @@ -2190,12 +2180,12 @@ void floppy_525_hd::setup_characteristics() m_sides = 2; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -2219,7 +2209,7 @@ void floppy_8_sssd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2243,8 +2233,8 @@ void floppy_8_dssd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -2268,8 +2258,8 @@ void floppy_8_ssdd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2293,9 +2283,9 @@ void floppy_8_dsdd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } @@ -2329,8 +2319,8 @@ void epson_smd_165::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -2376,9 +2366,9 @@ void epson_sd_320::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2404,9 +2394,9 @@ void epson_sd_321::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } @@ -2437,9 +2427,9 @@ void pana_ju_363::setup_characteristics() m_dskchg_writable = true; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2469,8 +2459,8 @@ void sony_oa_d31v::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2501,9 +2491,9 @@ void sony_oa_d32w::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2534,8 +2524,8 @@ void sony_oa_d32v::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2564,7 +2554,7 @@ void teac_fd_30a::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2593,8 +2583,8 @@ void teac_fd_55a::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2623,10 +2613,10 @@ void teac_fd_55b::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2655,9 +2645,9 @@ void teac_fd_55e::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); } //------------------------------------------------- @@ -2686,12 +2676,12 @@ void teac_fd_55f::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); } //------------------------------------------------- @@ -2720,12 +2710,12 @@ void teac_fd_55g::setup_characteristics() m_sides = 2; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -2751,7 +2741,7 @@ void alps_3255190x::setup_characteristics() set_rpm(300); m_cyl = 34; - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2776,7 +2766,7 @@ void ibm_6360::setup_characteristics() m_has_trk00_sensor = false; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } @@ -3018,7 +3008,7 @@ void oa_d34v_device::setup_characteristics() m_sides = 1; set_rpm(394); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSDD); } bool oa_d34v_device::is_2m() const @@ -3044,8 +3034,8 @@ void mfd51w_device::setup_characteristics() m_sides = 2; set_rpm(394); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } bool mfd51w_device::is_2m() const @@ -3065,9 +3055,9 @@ void mfd75w_device::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); } bool mfd75w_device::is_2m() const diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 4a9b788b3ab3a..3b60b45b59e91 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -90,6 +90,8 @@ class floppy_image_device : public device_t, const floppy_image_format_t *get_load_format() const; std::pair identify(std::string_view filename); void set_rpm(float rpm); + void set_sectoring_type(uint32_t sectoring_type); + uint32_t get_sectoring_type(); void init_fs(const fs_info *fs, const fs::meta_data &meta); @@ -121,7 +123,6 @@ class floppy_image_device : public device_t, virtual void mon_w(int state); bool ready_r(); void set_ready(bool state); - double get_pos(); virtual void tfsel_w(int state) { } // 35SEL line for Apple Sony drives virtual bool wpt_r(); // Mac sony drives using this for various reporting @@ -131,6 +132,8 @@ class floppy_image_device : public device_t, int mon_r() { return m_mon; } bool ss_r() { return m_ss; } bool twosid_r(); + bool floppy_is_hd(); + bool floppy_is_ed(); virtual bool writing_disabled() const; @@ -193,6 +196,7 @@ class floppy_image_device : public device_t, int m_tracks; /* addressable tracks */ int m_sides; /* number of heads */ uint32_t m_form_factor; /* 3"5, 5"25, etc */ + uint32_t m_sectoring_type; /* SOFT, Hard 10/16/32 */ bool m_motor_always_on; bool m_dskchg_writable; bool m_has_trk00_sensor; @@ -254,6 +258,8 @@ class floppy_image_device : public device_t, void register_formats(); + void add_variant(uint32_t variant); + void check_led(); uint32_t find_position(attotime &base, const attotime &when); attotime position_to_time(const attotime &base, int position) const; @@ -270,35 +276,6 @@ class floppy_image_device : public device_t, // Sound bool m_make_sound; floppy_sound_device* m_sound_out; - - // Flux visualization - struct flux_per_pixel_info { - uint32_t m_position; // 0-199999999 Angular position in the track, 0xffffffff if not in the floppy image - uint16_t m_r; // Distance from the center - uint8_t m_combined_track; // No need to store head, it's y >= flux_screen_sy/2 - uint8_t m_color; // Computed gray level from the flux counts - }; - - struct flux_per_combined_track_info { - std::vector m_pixels[2]; - uint32_t m_span; - uint8_t m_track; - uint8_t m_subtrack; - }; - - std::vector m_flux_per_pixel_infos; - std::vector m_flux_per_combined_track_infos; - - optional_device m_flux_screen; - - static constexpr int flux_screen_sx = 501; - static constexpr int flux_screen_sy = 1002; - static constexpr int flux_min_r = 100; - static constexpr int flux_max_r = 245; - - void flux_image_prepare(); - void flux_image_compute_for_track(int track, int head); - uint32_t flux_screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; #define DECLARE_FLOPPY_IMAGE_DEVICE(Type, Name, Interface) \ @@ -312,8 +289,11 @@ class floppy_image_device : public device_t, }; \ DECLARE_DEVICE_TYPE(Type, Name) +DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3") +DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3") +DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSQD, floppy_3_dsqd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_3_5") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_DD, floppy_35_dd, "floppy_3_5") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_HD, floppy_35_hd, "floppy_3_5") @@ -487,6 +467,7 @@ class floppy_connector: public device_t, template void set_formats(T &&_formats) { formats = std::forward(_formats); } void enable_sound(bool doit) { m_enable_sound = doit; } + void set_sectoring_type(uint32_t sectoring_type) { m_sectoring_type = sectoring_type; } floppy_image_device *get_device(); @@ -497,6 +478,7 @@ class floppy_connector: public device_t, private: std::function formats; bool m_enable_sound; + uint32_t m_sectoring_type; }; diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp index 5c908dbcfef56..a0a75c13f1f4c 100644 --- a/src/devices/imagedev/snapquik.cpp +++ b/src/devices/imagedev/snapquik.cpp @@ -36,6 +36,7 @@ snapshot_image_device::snapshot_image_device(const machine_config &mconfig, devi , m_timer(nullptr) { } + //------------------------------------------------- // snapshot_image_device - destructor //------------------------------------------------- @@ -67,7 +68,7 @@ TIMER_CALLBACK_MEMBER(snapshot_image_device::process_snapshot_or_quickload) err.value(), err.message()); popmessage( - !message.empty() ? "Error loading '%1$s': %3$s" : "Error loading '%1$s': %4$s", + !message.empty() ? "Error loading '%1$s': %2$s" : "Error loading '%1$s': %3$s", basename(), message, err.message()); diff --git a/src/devices/machine/2812fifo.cpp b/src/devices/machine/2812fifo.cpp index ea2bb69a31aa9..dd04b154240ea 100644 --- a/src/devices/machine/2812fifo.cpp +++ b/src/devices/machine/2812fifo.cpp @@ -45,6 +45,10 @@ fifo2812_device::fifo2812_device(machine_config const &mconfig, char const *tag, std::fill(std::begin(m_data), std::end(m_data), 0U); } +fifo2812_device::~fifo2812_device() +{ +} + void fifo2812_device::mr_w(int state) { diff --git a/src/devices/machine/2812fifo.h b/src/devices/machine/2812fifo.h index 5b56d70a77a72..40b6e339859bf 100644 --- a/src/devices/machine/2812fifo.h +++ b/src/devices/machine/2812fifo.h @@ -33,6 +33,7 @@ class fifo2812_device : public device_t public: // standard constructor fifo2812_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); + virtual ~fifo2812_device(); // callbacks auto q_cb() { return m_q_cb.bind(); } diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp index 39b41162734bc..5551d590f9c16 100644 --- a/src/devices/machine/arm_iomd.cpp +++ b/src/devices/machine/arm_iomd.cpp @@ -427,7 +427,7 @@ inline u8 arm_iomd_device::update_irqa_type(u8 data) inline void arm_iomd_device::flush_irq(unsigned Which) { if (m_irq_status[Which] & m_irq_mask[Which]) - m_host_cpu->pulse_input_line(ARM7_IRQ_LINE, m_host_cpu->minimum_quantum_time()); + m_host_cpu->pulse_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_host_cpu->minimum_quantum_time()); } template inline void arm_iomd_device::trigger_irq(u8 irq_type) diff --git a/src/devices/machine/arm_iomd.h b/src/devices/machine/arm_iomd.h index a6e371cfd6e48..2088f4d691876 100644 --- a/src/devices/machine/arm_iomd.h +++ b/src/devices/machine/arm_iomd.h @@ -12,7 +12,6 @@ #pragma once #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/acorn_vidc.h" #include "machine/at_keybc.h" #include "bus/pc_kbd/pc_kbdc.h" diff --git a/src/devices/machine/at_keybc.cpp b/src/devices/machine/at_keybc.cpp index a7d9ce8b9d40f..98b5b5f6ca113 100644 --- a/src/devices/machine/at_keybc.cpp +++ b/src/devices/machine/at_keybc.cpp @@ -291,6 +291,10 @@ at_kbc_device_base::at_kbc_device_base(machine_config const &mconfig, device_typ { } +at_kbc_device_base::~at_kbc_device_base() +{ +} + void at_kbc_device_base::device_start() { save_item(NAME(m_hot_res)); @@ -376,6 +380,10 @@ at_keyboard_controller_device::at_keyboard_controller_device(machine_config cons { } +at_keyboard_controller_device::~at_keyboard_controller_device() +{ +} + tiny_rom_entry const *at_keyboard_controller_device::device_rom_region() const { return ROM_NAME(at_kbc); @@ -452,6 +460,10 @@ ps2_keyboard_controller_device::ps2_keyboard_controller_device(machine_config co { } +ps2_keyboard_controller_device::~ps2_keyboard_controller_device() +{ +} + tiny_rom_entry const *ps2_keyboard_controller_device::device_rom_region() const { return ROM_NAME(ps2_kbc); diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h index d57ca81f565ff..4da3b69866148 100644 --- a/src/devices/machine/at_keybc.h +++ b/src/devices/machine/at_keybc.h @@ -20,6 +20,8 @@ class at_kbc_device_base : public device_t { public: + virtual ~at_kbc_device_base(); + // outputs to host auto hot_res() { return m_hot_res_cb.bind(); } auto gate_a20() { return m_gate_a20_cb.bind(); } @@ -83,6 +85,7 @@ class at_keyboard_controller_device : public at_kbc_device_base public: // standard constructor at_keyboard_controller_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + virtual ~at_keyboard_controller_device(); protected: // device_t implementation @@ -120,6 +123,7 @@ class ps2_keyboard_controller_device : public at_kbc_device_base // standard constructor ps2_keyboard_controller_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + virtual ~ps2_keyboard_controller_device(); protected: // device_t implementation diff --git a/src/devices/machine/chessmachine.cpp b/src/devices/machine/chessmachine.cpp index a7db23f99fd18..80ea45a91be05 100644 --- a/src/devices/machine/chessmachine.cpp +++ b/src/devices/machine/chessmachine.cpp @@ -44,9 +44,7 @@ DEFINE_DEVICE_TYPE(CHESSMACHINE, chessmachine_device, "chessmachine", "Tasc Ches chessmachine_device::chessmachine_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CHESSMACHINE, tag, owner, clock), m_maincpu(*this, "maincpu"), - m_bootrom(*this, "bootrom"), - m_ram(*this, "ram"), - m_disable_bootrom(*this, "disable_bootrom"), + m_boot_view(*this, "boot_view"), m_data_out(*this) { } @@ -58,12 +56,10 @@ chessmachine_device::chessmachine_device(const machine_config &mconfig, const ch void chessmachine_device::device_start() { - // zerofill - m_bootrom_enabled = false; memset(m_latch, 0, sizeof(m_latch)); + m_boot_timer = timer_alloc(FUNC(chessmachine_device::disable_bootrom), this); // register for savestates - save_item(NAME(m_bootrom_enabled)); save_item(NAME(m_latch)); } @@ -108,8 +104,12 @@ void chessmachine_device::reset_w_sync(s32 param) { m_maincpu->set_input_line(INPUT_LINE_RESET, param ? ASSERT_LINE : CLEAR_LINE); - if (!m_bootrom_enabled && param) - install_bootrom(true); + if (param) + { + // enable bootrom + m_boot_view.select(0); + m_boot_timer->adjust(attotime::never); + } } void chessmachine_device::reset_w(int state) @@ -123,31 +123,22 @@ void chessmachine_device::reset_w(int state) // internal //------------------------------------------------- -void chessmachine_device::install_bootrom(bool enable) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - program.unmap_readwrite(0, m_bootrom.bytes() - 1); - - if (enable) - program.install_rom(0, m_bootrom.bytes() - 1, m_bootrom); - else - program.install_ram(0, m_ram.bytes() - 1, m_ram); - - m_bootrom_enabled = enable; -} - u32 chessmachine_device::disable_bootrom_r() { // disconnect bootrom from the bus after next opcode - if (m_bootrom_enabled && !m_disable_bootrom->enabled() && !machine().side_effects_disabled()) - m_disable_bootrom->adjust(m_maincpu->cycles_to_attotime(5)); + if (!machine().side_effects_disabled() && m_boot_timer->remaining().is_never()) + m_boot_timer->adjust(m_maincpu->cycles_to_attotime(5)); return 0; } void chessmachine_device::main_map(address_map &map) { - map(0x00000000, 0x000fffff).ram().share("ram"); + map(0x00000000, 0x000fffff).ram(); + + map(0x00000000, 0x0000007f).view(m_boot_view); + m_boot_view[0](0x00000000, 0x0000007f).rom().region("bootrom", 0); + map(0x00400000, 0x00400003).mirror(0x003ffffc).rw(FUNC(chessmachine_device::internal_r), FUNC(chessmachine_device::internal_w)).umask32(0x000000ff); map(0x01800000, 0x01800003).r(FUNC(chessmachine_device::disable_bootrom_r)); } @@ -157,8 +148,6 @@ void chessmachine_device::device_add_mconfig(machine_config &config) ARM(config, m_maincpu, DERIVED_CLOCK(1,1)); m_maincpu->set_addrmap(AS_PROGRAM, &chessmachine_device::main_map); m_maincpu->set_copro_type(arm_cpu_device::copro_type::VL86C020); - - TIMER(config, "disable_bootrom").configure_generic(FUNC(chessmachine_device::disable_bootrom)); } diff --git a/src/devices/machine/chessmachine.h b/src/devices/machine/chessmachine.h index d07ac764e5b76..3b863f2e26855 100644 --- a/src/devices/machine/chessmachine.h +++ b/src/devices/machine/chessmachine.h @@ -12,7 +12,6 @@ #pragma once #include "cpu/arm/arm.h" -#include "machine/timer.h" class chessmachine_device : public device_t @@ -34,27 +33,24 @@ class chessmachine_device : public device_t virtual void device_start() override; virtual void device_reset_after_children() override { reset_w(1); } virtual void device_add_mconfig(machine_config &config) override; - virtual void device_post_load() override { install_bootrom(m_bootrom_enabled); } virtual const tiny_rom_entry *device_rom_region() const override; private: required_device m_maincpu; - required_region_ptr m_bootrom; - required_shared_ptr m_ram; - required_device m_disable_bootrom; + memory_view m_boot_view; devcb_write_line m_data_out; + emu_timer *m_boot_timer; + u8 m_latch[2]; - bool m_bootrom_enabled; void data0_w_sync(s32 param); void data1_w_sync(s32 param); void reset_w_sync(s32 param); - void install_bootrom(bool enable); - TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); } + TIMER_CALLBACK_MEMBER(disable_bootrom) { m_boot_view.disable(); } u32 disable_bootrom_r(); u8 internal_r() { return m_latch[0]; } diff --git a/src/devices/machine/input_merger.h b/src/devices/machine/input_merger.h index 073072d0d4b18..590b79c98e322 100644 --- a/src/devices/machine/input_merger.h +++ b/src/devices/machine/input_merger.h @@ -19,6 +19,8 @@ class input_merger_device : public device_t { public: + virtual ~input_merger_device() override; + // configuration auto output_handler() { return m_output_handler.bind(); } @@ -38,7 +40,6 @@ class input_merger_device : public device_t u32 initval, u32 xorval, int active); - virtual ~input_merger_device() override; // device-level overrides virtual void device_start() override; diff --git a/src/devices/machine/intelfsh.cpp b/src/devices/machine/intelfsh.cpp index d4a417567e1d3..897b1ee55be18 100644 --- a/src/devices/machine/intelfsh.cpp +++ b/src/devices/machine/intelfsh.cpp @@ -37,6 +37,8 @@ enum FM_ERASEAMD3, // part 3 of AMD erase sequence FM_ERASEAMD4, // part 4 of AMD erase sequence FM_BYTEPROGRAM, + FM_WORDPROGRAM1, + FM_WORDPROGRAM2, FM_BANKSELECT, FM_WRITEPAGEATMEL, FM_WRITEBUFFER1, // part 1 of write to buffer sequence @@ -105,6 +107,7 @@ DEFINE_DEVICE_TYPE(MACRONIX_29F1610MC, macronix_29f1610mc_device, "m DEFINE_DEVICE_TYPE(MACRONIX_29F1610MC_16BIT, macronix_29f1610mc_16bit_device, "macronix_29f1610mc_16bit", "Macronix 29F1610MC Flash (16-bit)") DEFINE_DEVICE_TYPE(MACRONIX_29L001MC, macronix_29l001mc_device, "macronix_29l001mc", "Macronix 29L001MC Flash") DEFINE_DEVICE_TYPE(MACRONIX_29LV160TMC, macronix_29lv160tmc_device, "macronix_29lv160tmc", "Macronix 29LV160TMC Flash") +DEFINE_DEVICE_TYPE(ST_M29W640GB, st_m29w640gb_device, "st_m29w640gb", "ST M29W640GB Flash") DEFINE_DEVICE_TYPE(TMS_29F040, tms_29f040_device, "tms_29f040", "Texas Instruments 29F040 Flash") DEFINE_DEVICE_TYPE(PANASONIC_MN63F805MNP, panasonic_mn63f805mnp_device, "panasonic_mn63f805mnp", "Panasonic MN63F805MNP Flash") @@ -151,6 +154,8 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type m_bits(bits), m_addrmask(0), m_device_id(device_id), + m_device_id2(0), + m_device_id3(0), m_maker_id(maker_id), m_sector_is_4k(false), m_sector_is_16k(false), @@ -250,6 +255,9 @@ macronix_29l001mc_device::macronix_29l001mc_device(const machine_config &mconfig macronix_29lv160tmc_device::macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, MACRONIX_29LV160TMC, tag, owner, clock, 0x20000, MFG_MACRONIX, 0x49) { m_sector_is_16k = true; } +st_m29w640gb_device::st_m29w640gb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : intelfsh8_device(mconfig, ST_M29W640GB, tag, owner, clock, 0x800000, MFG_ST, 0x227e) { m_bot_boot_sector = true; m_device_id2 = 0x2210; m_device_id3 = 0x2200; } + panasonic_mn63f805mnp_device::panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, PANASONIC_MN63F805MNP, tag, owner, clock, 0x10000, MFG_PANASONIC, 0x1b) { m_sector_is_4k = true; } @@ -463,6 +471,18 @@ uint32_t intelfsh_device::read_full(uint32_t address) case 4: data = 0; break; } } + else if (m_maker_id == MFG_ST) + { + switch (address & 0xff) + { + case 0x00: data = m_maker_id; break; + case 0x02: data = m_device_id; break; + case 0x04: logerror("Block Protection Status not implemented.\n"); break; + case 0x06: logerror("Extended Memory Block Verify Code not implemented.\n"); break; + case 0x1c: data = m_device_id2; break; + case 0x1e: data = m_device_id3; break; + } + } else { switch (address & 0xff) @@ -574,8 +594,10 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) m_flash_mode = FM_WRITEPART1; break; case 0x50: // clear status reg - if ((m_maker_id == MFG_SST && m_device_id == 0x61) && (m_flash_mode == FM_NORMAL)) + if (((m_maker_id == MFG_SST && m_device_id == 0x61) || (m_maker_id == MFG_AMD && m_device_id == 0x20)) && (m_flash_mode == FM_NORMAL)) logerror("Invalid flash mode byte %x\n", data & 0xff); + else if (m_maker_id == MFG_ST && (address & 0xfff) == 0xaaa) + m_flash_mode = FM_WORDPROGRAM1; else { m_status = 0x80; @@ -839,7 +861,13 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) } else if(m_bot_boot_sector && address < (64*1024)) { - if (address < (16*1024)) + if (m_maker_id == MFG_ST) + { + memset(&m_data[base & ~0x1fff], 0xff, 8 * 1024); + m_erase_sector = address & ((m_bits == 16) ? ~0xfff : ~0x1fff); + m_timer->adjust(attotime::from_msec(250)); + } + else if (address < (16*1024)) { memset(&m_data[base & ~0x3fff], 0xff, 16 * 1024); m_erase_sector = address & ((m_bits == 16) ? ~0x1fff : ~0x3fff); @@ -912,6 +940,40 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) } m_flash_mode = FM_NORMAL; break; + case FM_WORDPROGRAM1: + switch(m_bits) + { + case 8: + m_data[address] = data; + break; + case 16: // 16bit mode not tested + logerror("16-bit mode word programming not tested.\n"); + m_data[address*2] = data >> 8; + m_data[address*2+1] = data; + break; + default: + logerror("FM_WORDPROGRAM not supported when m_bits == %d (address %08x data %04x)\n", m_bits, address, data); + break; + } + m_flash_mode = FM_WORDPROGRAM2; + break; + case FM_WORDPROGRAM2: + switch(m_bits) + { + case 8: + m_data[address] = data; + break; + case 16: + logerror("16-bit mode word programming not tested.\n"); + m_data[address*2] = data >> 8; + m_data[address*2+1] = data; + break; + default: + logerror("FM_WORDPROGRAM not supported when m_bits == %d (address %08x data %04x)\n", m_bits, address, data); + break; + } + m_flash_mode = FM_NORMAL; + break; case FM_WRITEPART1: switch( m_bits ) { diff --git a/src/devices/machine/intelfsh.h b/src/devices/machine/intelfsh.h index 9f17487c6be53..c28a3b586ac27 100644 --- a/src/devices/machine/intelfsh.h +++ b/src/devices/machine/intelfsh.h @@ -42,6 +42,8 @@ class intelfsh_device : public device_t, uint8_t m_bits; uint32_t m_addrmask; uint16_t m_device_id; + uint16_t m_device_id2; + uint16_t m_device_id3; uint8_t m_maker_id; bool m_sector_is_4k; bool m_sector_is_16k; @@ -214,6 +216,12 @@ class macronix_29lv160tmc_device : public intelfsh8_device macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; +class st_m29w640gb_device : public intelfsh8_device +{ +public: + st_m29w640gb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); +}; + class panasonic_mn63f805mnp_device : public intelfsh8_device { public: @@ -396,6 +404,7 @@ DECLARE_DEVICE_TYPE(MACRONIX_29F1610MC, macronix_29f1610mc_device) DECLARE_DEVICE_TYPE(MACRONIX_29F1610MC_16BIT,macronix_29f1610mc_16bit_device) DECLARE_DEVICE_TYPE(MACRONIX_29L001MC, macronix_29l001mc_device) DECLARE_DEVICE_TYPE(MACRONIX_29LV160TMC, macronix_29lv160tmc_device) +DECLARE_DEVICE_TYPE(ST_M29W640GB, st_m29w640gb_device) DECLARE_DEVICE_TYPE(TMS_29F040, tms_29f040_device) DECLARE_DEVICE_TYPE(PANASONIC_MN63F805MNP, panasonic_mn63f805mnp_device) diff --git a/src/devices/machine/keyboard.cpp b/src/devices/machine/keyboard.cpp index d307d637d2712..444850af23fe9 100644 --- a/src/devices/machine/keyboard.cpp +++ b/src/devices/machine/keyboard.cpp @@ -261,6 +261,10 @@ generic_keyboard_device::generic_keyboard_device( { } +generic_keyboard_device::~generic_keyboard_device() +{ +} + generic_keyboard_device::generic_keyboard_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : generic_keyboard_device(mconfig, GENERIC_KEYBOARD, tag, owner, clock) diff --git a/src/devices/machine/keyboard.h b/src/devices/machine/keyboard.h index 2b4f32e856f81..7b1cad9d81702 100644 --- a/src/devices/machine/keyboard.h +++ b/src/devices/machine/keyboard.h @@ -78,6 +78,7 @@ class generic_keyboard_device : public device_t, protected device_matrix_keyboar const char *tag, device_t *owner, u32 clock); + virtual ~generic_keyboard_device(); template void set_keyboard_callback(T &&... args) diff --git a/src/devices/machine/ldp1000.cpp b/src/devices/machine/ldp1000.cpp index 64a2ec48faab6..935ed5cf1ed0c 100644 --- a/src/devices/machine/ldp1000.cpp +++ b/src/devices/machine/ldp1000.cpp @@ -127,7 +127,7 @@ void sony_ldp1000_device::set_new_player_state(ldp1000_player_state which) { m_player_state = which; m_index_state = 0; - printf("set new player state\n"); + logerror("set new player state\n"); } // TODO: probably don't even need a size ... @@ -171,7 +171,7 @@ void sony_ldp1000_device::exec_enter_cmd() // TODO: de-instantize this void sony_ldp1000_device::command_w(uint8_t data) { - printf("CMD %02x\n",data); + logerror("CMD %02x\n",data); // 0x30 to 0x69 range causes an ACK, anything else is invalid m_command = data; diff --git a/src/devices/machine/micomxe1a.cpp b/src/devices/machine/micomxe1a.cpp index 0aa0f42367d7c..d8e0dde9a8b6f 100644 --- a/src/devices/machine/micomxe1a.cpp +++ b/src/devices/machine/micomxe1a.cpp @@ -168,6 +168,10 @@ micom_xe_1a_device::micom_xe_1a_device( { } +micom_xe_1a_device::~micom_xe_1a_device() +{ +} + u8 micom_xe_1a_device::out_r() { diff --git a/src/devices/machine/micomxe1a.h b/src/devices/machine/micomxe1a.h index e581f4f7cb4e8..972c159aa0755 100644 --- a/src/devices/machine/micomxe1a.h +++ b/src/devices/machine/micomxe1a.h @@ -15,6 +15,7 @@ class micom_xe_1a_device : public device_t { public: micom_xe_1a_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0) ATTR_COLD; + virtual ~micom_xe_1a_device(); auto buttons_handler() { return m_buttons_callback.bind(); } auto analog_handler() { return m_analog_callback.bind(); } diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index c570a74680642..c6cb6ea5c71a6 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -69,6 +69,14 @@ void mos6551_device::device_add_mconfig(machine_config &config) m_internal_clock->signal_handler().set(FUNC(mos6551_device::internal_clock)); } +void mos6551_device::map(address_map &map) +{ + map(0, 0).rw(FUNC(mos6551_device::read_rdr), FUNC(mos6551_device::write_tdr)); + map(1, 1).rw(FUNC(mos6551_device::read_status), FUNC(mos6551_device::write_reset)); + map(2, 2).rw(FUNC(mos6551_device::read_command), FUNC(mos6551_device::write_command)); + map(3, 3).rw(FUNC(mos6551_device::read_control), FUNC(mos6551_device::write_control)); +} + void mos6551_device::device_start() { @@ -344,12 +352,22 @@ void mos6551_device::write_command(uint8_t data) // bit 1 m_rx_irq_enable = !((m_command >> 1) & 1) && !m_dtr; + if (!m_rx_irq_enable && (m_irq_state & IRQ_RDRF)) + { + m_irq_state &= ~IRQ_RDRF; + update_irq(); + } // bits 2-3 int transmitter_control = (m_command >> 2) & 3; m_tx_irq_enable = transmitter_controls[transmitter_control][0] && !m_dtr; m_tx_enable = transmitter_controls[transmitter_control][1]; m_brk = transmitter_controls[transmitter_control][2]; + if (!m_tx_irq_enable && (m_irq_state & IRQ_TDRE)) + { + m_irq_state &= ~IRQ_TDRE; + update_irq(); + } // bit 4 m_echo_mode = (m_command >> 4) & 1; @@ -477,7 +495,7 @@ void mos6551_device::write_cts(int state) { m_cts = state; - if (m_cts) + if (m_cts && started()) { if (m_tx_output == OUTPUT_TXD) { diff --git a/src/devices/machine/mos6551.h b/src/devices/machine/mos6551.h index 5e40ea6f2c961..0f2c00eef0f3e 100644 --- a/src/devices/machine/mos6551.h +++ b/src/devices/machine/mos6551.h @@ -17,7 +17,7 @@ _CTS 9 | | 20 DB2 TxD 10 | | 19 DB1 _DTR 11 | | 18 DB0 - RxD 12 | | 17 _DBR + RxD 12 | | 17 _DSR RS0 13 | | 16 _DCD RS1 14 |_____________| 15 Vcc @@ -41,6 +41,8 @@ class mos6551_device : public device_t auto rts_handler() { return m_rts_handler.bind(); } auto dtr_handler() { return m_dtr_handler.bind(); } + void map(address_map &map); + uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); diff --git a/src/devices/machine/pdp11.h b/src/devices/machine/pdp11.h index ee05286764558..303c94ca6992f 100644 --- a/src/devices/machine/pdp11.h +++ b/src/devices/machine/pdp11.h @@ -24,10 +24,10 @@ enum : uint16_t #define clear_virq(_callback, _csr, _ie, _intrq) \ - if ((_csr) & (_ie)) { (_intrq) = CLEAR_LINE; } + do { if ((_csr) & (_ie)) { (_intrq) = CLEAR_LINE; } } while (0) #define raise_virq(_callback, _csr, _ie, _intrq) \ - if ((_csr) & (_ie)) { (_intrq) = ASSERT_LINE; _callback (ASSERT_LINE); } + do { if ((_csr) & (_ie)) { (_intrq) = ASSERT_LINE; _callback (ASSERT_LINE); } } while (0) #define UPDATE_16BIT(_storage, _data, _mask) \ diff --git a/src/devices/machine/psion_asic5.cpp b/src/devices/machine/psion_asic5.cpp index 4dfa2c17bb86d..49a11a621fe45 100644 --- a/src/devices/machine/psion_asic5.cpp +++ b/src/devices/machine/psion_asic5.cpp @@ -133,6 +133,8 @@ void psion_asic5_device::rcv_callback() void psion_asic5_device::rcv_complete() { + receive_register_extract(); + if (is_receive_framing_error() || is_receive_parity_error()) m_int_status |= 0x04; @@ -389,7 +391,6 @@ uint8_t psion_asic5_device::data_r() break; case 0x09: // UART Receive register - receive_register_extract(); data = get_received_char(); LOG("%s data_r: UART Receive register %02x\n", machine().describe_context(), data); m_int_status &= ~0x01; diff --git a/src/devices/machine/psion_asic5.h b/src/devices/machine/psion_asic5.h index 3d6a17011dcf1..07462d2f28d68 100644 --- a/src/devices/machine/psion_asic5.h +++ b/src/devices/machine/psion_asic5.h @@ -31,8 +31,6 @@ class psion_asic5_device : public device_t, public device_serial_interface psion_asic5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - static constexpr feature_type imperfect_features() { return feature::COMMS; } - void set_mode(pc6_state mode) { m_mode = mode; } auto readpa_handler() { return m_in_a_handler.bind(); } diff --git a/src/devices/machine/pxa255.cpp b/src/devices/machine/pxa255.cpp index 1f1dff2e4522b..6436655351546 100644 --- a/src/devices/machine/pxa255.cpp +++ b/src/devices/machine/pxa255.cpp @@ -877,8 +877,8 @@ void pxa255_periphs_device::update_interrupts() { m_intc_regs.icfp = (m_intc_regs.icpr & m_intc_regs.icmr) & m_intc_regs.iclr; m_intc_regs.icip = (m_intc_regs.icpr & m_intc_regs.icmr) & (~m_intc_regs.iclr); - m_maincpu->set_input_line(ARM7_FIRQ_LINE, m_intc_regs.icfp ? ASSERT_LINE : CLEAR_LINE); - m_maincpu->set_input_line(ARM7_IRQ_LINE, m_intc_regs.icip ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_intc_regs.icfp ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_intc_regs.icip ? ASSERT_LINE : CLEAR_LINE); } void pxa255_periphs_device::set_irq_line(u32 line, int irq_state) diff --git a/src/devices/machine/pxa255.h b/src/devices/machine/pxa255.h index 3cc9b43c8a997..5a383a9f9e2e6 100644 --- a/src/devices/machine/pxa255.h +++ b/src/devices/machine/pxa255.h @@ -15,7 +15,6 @@ #pragma once #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "sound/dmadac.h" #include "emupal.h" diff --git a/src/devices/machine/s2350.cpp b/src/devices/machine/s2350.cpp index 06370b5f3408d..c781d3e7ebade 100644 --- a/src/devices/machine/s2350.cpp +++ b/src/devices/machine/s2350.cpp @@ -145,6 +145,10 @@ s2350_device::s2350_device(const machine_config &mconfig, const char *tag, devic { } +s2350_device::~s2350_device() +{ +} + void s2350_device::device_start() { save_item(NAME(m_transmit_buffer_empty)); diff --git a/src/devices/machine/s2350.h b/src/devices/machine/s2350.h index 8726f1af61141..15f87d1e5c664 100644 --- a/src/devices/machine/s2350.h +++ b/src/devices/machine/s2350.h @@ -21,6 +21,7 @@ class s2350_device : public device_t { public: s2350_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual ~s2350_device(); // transmit bits auto tx_handler() { return m_tx_cb.bind(); } diff --git a/src/devices/machine/s2636.cpp b/src/devices/machine/s2636.cpp index c8e9025179964..59c80a09abfb2 100644 --- a/src/devices/machine/s2636.cpp +++ b/src/devices/machine/s2636.cpp @@ -180,6 +180,10 @@ s2636_device::s2636_device(const machine_config &mconfig, const char *tag, devic for (auto &elem : m_obj_dup) elem = false; } +s2636_device::~s2636_device() +{ +} + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/s2636.h b/src/devices/machine/s2636.h index 8803c62901553..ee62553bf0e05 100644 --- a/src/devices/machine/s2636.h +++ b/src/devices/machine/s2636.h @@ -28,6 +28,7 @@ class s2636_device : public device_t, { public: s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~s2636_device(); void set_offsets(int y_offset, int x_offset) { m_x_offset = x_offset; m_y_offset = y_offset; } diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index 437612a83319e..3ce077d18e62c 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -11,8 +11,6 @@ #include "emu.h" #include "s3c2400.h" -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "screen.h" diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index e5017ddaed4cb..56a711532c590 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -11,8 +11,6 @@ #include "emu.h" #include "s3c2410.h" -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "screen.h" diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index 3bec1249b1164..c49c06b873882 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -11,8 +11,6 @@ #include "emu.h" #include "s3c2440.h" -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "screen.h" diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index d4deb1f0cebf1..15835cb612245 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -8,7 +8,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "coreutil.h" /******************************************************************************* @@ -883,10 +882,10 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() uint32_t width = 0; switch (pnrmode) { - case S3C24XX_PNRMODE_STN_04_SS: width = ((hozval + 1) * 4); break; - case S3C24XX_PNRMODE_STN_04_DS: width = ((hozval + 1) * 4); break; - case S3C24XX_PNRMODE_STN_08_SS: width = ((hozval + 1) * 8 / 3); break; - default: break; + case S3C24XX_PNRMODE_STN_04_SS: width = ((hozval + 1) * 4); break; + case S3C24XX_PNRMODE_STN_04_DS: width = ((hozval + 1) * 4); break; + case S3C24XX_PNRMODE_STN_08_SS: width = ((hozval + 1) * 8 / 3); break; + default: break; } uint32_t height = lineval + 1; @@ -953,12 +952,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_w(offs_t offset, uint32_t data, uint32_t mem_ COMBINE_DATA(&((uint32_t*)&m_lcd.regs)[offset]); switch (offset) { - case S3C24XX_LCDCON1 : + case S3C24XX_LCDCON1 : + if ((old_value & (1 << 0)) != (data & (1 << 0))) { - if ((old_value & (1 << 0)) != (data & (1 << 0))) - { - s3c24xx_lcd_recalc(); - } + s3c24xx_lcd_recalc(); } break; } @@ -1128,7 +1125,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { LOGMASKED(LOG_IRQS, "triggering IRQ line\n"); m_cpu->resume(SUSPEND_REASON_HALT); - m_cpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); m_irq.line_irq = ASSERT_LINE; } } @@ -1138,7 +1135,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { LOGMASKED(LOG_IRQS, "IRQ: srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); LOGMASKED(LOG_IRQS, "clearing IRQ line\n"); - m_cpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); m_irq.line_irq = CLEAR_LINE; } } @@ -1152,7 +1149,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { LOGMASKED(LOG_IRQS, "asserting FIQ line\n"); m_cpu->resume(SUSPEND_REASON_HALT); - m_cpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, ASSERT_LINE); m_irq.line_fiq = ASSERT_LINE; } } @@ -1161,7 +1158,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() if (m_irq.line_fiq != CLEAR_LINE) { LOGMASKED(LOG_IRQS, "clearing FIQ line\n"); - m_cpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, CLEAR_LINE); m_irq.line_fiq = CLEAR_LINE; } } @@ -1241,35 +1238,35 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_irq_r(offs_t offset, uint32_t mem_mask) const uint32_t data = ((uint32_t*)&m_irq.regs)[offset]; switch (offset) { - case S3C24XX_SRCPND: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_INTMOD: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMOD = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_INTMSK: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_PRIORITY: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: PRIORITY = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_INTPND: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_INTOFFSET: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTOFFSET = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; + case S3C24XX_SRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTMOD: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMOD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_PRIORITY: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: PRIORITY = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTOFFSET: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTOFFSET = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) - case S3C24XX_SUBSRCPND: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SUBSRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - case S3C24XX_INTSUBMSK: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTSUBMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; + case S3C24XX_SUBSRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SUBSRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTSUBMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTSUBMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; #endif - default: - LOGMASKED(LOG_IRQ_REGS, "%s: irq read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_INT + (offset << 2), data, mem_mask); - break; + default: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_INT + (offset << 2), data, mem_mask); + break; } return data; } @@ -1394,8 +1391,7 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) auto_reload = BIT(m_pwm.regs.tcon, 22); break; default: - cnt = cmp = auto_reload = 0; - break; + fatalerror("Invalid timer index %d!", timer); } // hz = freq / (cnt - cmp + 1); if (cnt < 2) @@ -2290,8 +2286,8 @@ void S3C24_CLASS_NAME::iic_start() int mode_selection = BITS(m_iic.regs.iicstat, 7, 6); switch (mode_selection) { - case 2: i2c_send_byte(m_iic.regs.iicds | 0x01); break; - case 3: i2c_send_byte(m_iic.regs.iicds & 0xFE); break; + case 2: i2c_send_byte(m_iic.regs.iicds | 0x01); break; + case 3: i2c_send_byte(m_iic.regs.iicds & 0xFE); break; } m_iic.timer->adjust( attotime::from_usec( 1)); } @@ -2309,8 +2305,8 @@ void S3C24_CLASS_NAME::iic_resume() int mode_selection = BITS(m_iic.regs.iicstat, 7, 6); switch (mode_selection) { - case 2: m_iic.regs.iicds = i2c_receive_byte(BIT(m_iic.regs.iiccon, 7)); break; - case 3: i2c_send_byte(m_iic.regs.iicds & 0xFF); break; + case 2: m_iic.regs.iicds = i2c_receive_byte(BIT(m_iic.regs.iiccon, 7)); break; + case 3: i2c_send_byte(m_iic.regs.iicds & 0xFF); break; } m_iic.timer->adjust(attotime::from_usec(1)); } @@ -2338,70 +2334,70 @@ void S3C24_CLASS_NAME::s3c24xx_iic_w(offs_t offset, uint32_t data, uint32_t mem_ switch (offset) { case S3C24XX_IICCON: - { - LOGMASKED(LOG_I2C, "%s: i2c write: IICCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + { + LOGMASKED(LOG_I2C, "%s: i2c write: IICCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); #if 0 - static constexpr int div_table[] = { 16, 512 }; - int transmit_clock_value = (data >> 0) & 0xF; - int tx_clock_source_selection = (data >> 6) & 1; - int enable_interrupt = (data >> 5) & 1; - double clock = (double)s3c24xx_get_pclk() / div_table[tx_clock_source_selection] / (transmit_clock_value + 1); -#endif - int interrupt_pending_flag = BIT(old_value, 4); - if (interrupt_pending_flag != 0) + static constexpr int div_table[] = { 16, 512 }; + int transmit_clock_value = (data >> 0) & 0xF; + int tx_clock_source_selection = (data >> 6) & 1; + int enable_interrupt = (data >> 5) & 1; + double clock = (double)s3c24xx_get_pclk() / div_table[tx_clock_source_selection] / (transmit_clock_value + 1); +#endif + int interrupt_pending_flag = BIT(old_value, 4); + if (interrupt_pending_flag != 0) + { + interrupt_pending_flag = BIT(data, 4); + if (interrupt_pending_flag == 0) { - interrupt_pending_flag = BIT(data, 4); - if (interrupt_pending_flag == 0) + int start_stop_condition; + start_stop_condition = BIT(m_iic.regs.iicstat, 5); + if (start_stop_condition != 0) { - int start_stop_condition; - start_stop_condition = BIT(m_iic.regs.iicstat, 5); - if (start_stop_condition != 0) + if (m_iic.count == 0) { - if (m_iic.count == 0) - { - iic_start(); - - } - else - { - iic_resume(); - } + iic_start(); + } else { - iic_stop(); + iic_resume(); } } + else + { + iic_stop(); + } } } break; + } case S3C24XX_IICSTAT: + { + LOGMASKED(LOG_I2C, "%s: i2c write: IICSTAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_iic.count = 0; + int interrupt_pending_flag = BIT(m_iic.regs.iiccon, 4); + if (interrupt_pending_flag == 0) { - LOGMASKED(LOG_I2C, "%s: i2c write: IICSTAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); - m_iic.count = 0; - int interrupt_pending_flag = BIT(m_iic.regs.iiccon, 4); - if (interrupt_pending_flag == 0) + int start_stop_condition = BIT(data, 5); + if (start_stop_condition != 0) { - int start_stop_condition = BIT(data, 5); - if (start_stop_condition != 0) + if (m_iic.count == 0) { - if (m_iic.count == 0) - { - iic_start(); + iic_start(); - } - else - { - iic_resume(); - } } else { - iic_stop(); + iic_resume(); } } + else + { + iic_stop(); + } } break; + } default: LOGMASKED(LOG_I2C, "%s: i2c write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_IIC + (offset << 2), data, mem_mask); break; @@ -2628,16 +2624,16 @@ void S3C24_CLASS_NAME::s3c24xx_adc_w(offs_t offset, uint32_t data, uint32_t mem_ COMBINE_DATA(&((uint32_t*)&m_adc.regs)[offset]); switch (offset) { - case S3C24XX_ADCCON: - if (((old_value & (1 << 0)) == 0) && ((data & (1 << 0)) != 0)) - { - s3c24xx_adc_start(); - } - LOGMASKED(LOG_ADC, "%s: ADC write: ADCCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); - break; - default: - LOGMASKED(LOG_ADC, "%s: ADC write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_ADC + (offset << 2), data, mem_mask); - break; + case S3C24XX_ADCCON: + if (((old_value & (1 << 0)) == 0) && ((data & (1 << 0)) != 0)) + { + s3c24xx_adc_start(); + } + LOGMASKED(LOG_ADC, "%s: ADC write: ADCCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + default: + LOGMASKED(LOG_ADC, "%s: ADC write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_ADC + (offset << 2), data, mem_mask); + break; } } diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index a67be48455cb0..6182c47cddb85 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -12,7 +12,6 @@ #include "s3c44b0.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "screen.h" #include @@ -891,7 +890,7 @@ void s3c44b0_device::check_pending_irq() m_irq.regs.i_ispr |= (1 << int_type); if (m_irq.line_irq != ASSERT_LINE) { - m_cpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); m_irq.line_irq = ASSERT_LINE; } } @@ -899,7 +898,7 @@ void s3c44b0_device::check_pending_irq() { if (m_irq.line_irq != CLEAR_LINE) { - m_cpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); m_irq.line_irq = CLEAR_LINE; } } @@ -909,7 +908,7 @@ void s3c44b0_device::check_pending_irq() { if (m_irq.line_fiq != ASSERT_LINE) { - m_cpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, ASSERT_LINE); m_irq.line_fiq = ASSERT_LINE; } } @@ -917,7 +916,7 @@ void s3c44b0_device::check_pending_irq() { if (m_irq.line_fiq != CLEAR_LINE) { - m_cpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); + m_cpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, CLEAR_LINE); m_irq.line_fiq = CLEAR_LINE; } } @@ -1106,9 +1105,8 @@ void s3c44b0_device::pwm_start(int timer) break; default : { - cnt = cmp = auto_reload = 0; + fatalerror("Invalid timer index %d!", timer); } - break; } // hz = freq / (cnt - cmp + 1); if (cnt < 2) diff --git a/src/devices/machine/sa1110.cpp b/src/devices/machine/sa1110.cpp index 3e1c2f95f772a..11deca48a405d 100644 --- a/src/devices/machine/sa1110.cpp +++ b/src/devices/machine/sa1110.cpp @@ -2287,14 +2287,14 @@ void sa1110_periphs_device::update_interrupts() m_intc_regs.icfp = (m_intc_regs.icpr & m_intc_regs.icmr) & m_intc_regs.iclr; if (old_fiq != m_intc_regs.icfp) { - m_maincpu->set_input_line(ARM7_FIRQ_LINE, m_intc_regs.icfp ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_intc_regs.icfp ? ASSERT_LINE : CLEAR_LINE); } const u32 old_irq = m_intc_regs.icip; m_intc_regs.icip = (m_intc_regs.icpr & m_intc_regs.icmr) & (~m_intc_regs.iclr); if (old_irq != m_intc_regs.icip) { - m_maincpu->set_input_line(ARM7_IRQ_LINE, m_intc_regs.icip ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_intc_regs.icip ? ASSERT_LINE : CLEAR_LINE); } } diff --git a/src/devices/machine/sa1110.h b/src/devices/machine/sa1110.h index b39c4f2821790..dcfd232f1f3a7 100644 --- a/src/devices/machine/sa1110.h +++ b/src/devices/machine/sa1110.h @@ -12,7 +12,6 @@ #pragma once #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/input_merger.h" #include "machine/ucb1200.h" diff --git a/src/devices/machine/sa1111.h b/src/devices/machine/sa1111.h index 46cf677917995..20ed6a0ac8b34 100644 --- a/src/devices/machine/sa1111.h +++ b/src/devices/machine/sa1111.h @@ -12,7 +12,6 @@ #pragma once #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" class sa1111_device : public device_t { diff --git a/src/devices/machine/sdlc.cpp b/src/devices/machine/sdlc.cpp index a6d727f2e5fa7..b664126213fed 100644 --- a/src/devices/machine/sdlc.cpp +++ b/src/devices/machine/sdlc.cpp @@ -37,6 +37,10 @@ device_sdlc_consumer_interface::device_sdlc_consumer_interface(machine_config co { } +device_sdlc_consumer_interface::~device_sdlc_consumer_interface() +{ +} + void device_sdlc_consumer_interface::interface_post_start() { device().save_item(NAME(m_line_active)); @@ -139,6 +143,10 @@ sdlc_logger_device::sdlc_logger_device(machine_config const &mconfig, char const { } +sdlc_logger_device::~sdlc_logger_device() +{ +} + void sdlc_logger_device::clock_w(int state) { if (bool(state) != bool(m_current_clock)) diff --git a/src/devices/machine/sdlc.h b/src/devices/machine/sdlc.h index 126dfed766ed0..6f68c44cfc006 100644 --- a/src/devices/machine/sdlc.h +++ b/src/devices/machine/sdlc.h @@ -23,6 +23,7 @@ class device_sdlc_consumer_interface : public device_interface protected: device_sdlc_consumer_interface(machine_config const &mconfig, device_t &device); + virtual ~device_sdlc_consumer_interface(); virtual void interface_post_start() override; @@ -55,6 +56,7 @@ class sdlc_logger_device : public device_t, public device_sdlc_consumer_interfac { public: sdlc_logger_device(machine_config const &mconfig, char const *tag, device_t *owner, std::uint32_t clock); + virtual ~sdlc_logger_device(); // input signals void data_w(int state) { m_current_data = state ? 1U : 0U; } diff --git a/src/devices/machine/sensorboard.h b/src/devices/machine/sensorboard.h index 3d5596f0f826c..90347f318439a 100644 --- a/src/devices/machine/sensorboard.h +++ b/src/devices/machine/sensorboard.h @@ -76,10 +76,10 @@ class sensorboard_device : public device_t, public device_nvram_interface DECLARE_INPUT_CHANGED_MEMBER(ui_init); DECLARE_INPUT_CHANGED_MEMBER(ui_refresh) { refresh(); } - DECLARE_CUSTOM_INPUT_MEMBER(check_sensor_busy) { return (m_sensorpos == -1) ? 0 : 1; } - DECLARE_CUSTOM_INPUT_MEMBER(check_bs_mask) { return m_bs_mask; } - DECLARE_CUSTOM_INPUT_MEMBER(check_ss_mask) { return m_ss_mask; } - DECLARE_CUSTOM_INPUT_MEMBER(check_ui_enabled) { return m_ui_enabled; } + ioport_value check_sensor_busy() { return (m_sensorpos == -1) ? 0 : 1; } + ioport_value check_bs_mask() { return m_bs_mask; } + ioport_value check_ss_mask() { return m_ss_mask; } + ioport_value check_ui_enabled() { return m_ui_enabled; } protected: // device-level overrides diff --git a/src/devices/machine/sis7018_audio.cpp b/src/devices/machine/sis7018_audio.cpp index afcbfb13efdfa..67ac73597c596 100644 --- a/src/devices/machine/sis7018_audio.cpp +++ b/src/devices/machine/sis7018_audio.cpp @@ -2,7 +2,7 @@ // copyright-holders: Angelo Salese /************************************************************************************************** -SiS 7018 Audio device (AC97 complaint) +SiS 7018 Audio device (AC97 compliant) TODO: - Stub interface, to be improved; diff --git a/src/devices/machine/sis950_lpc.cpp b/src/devices/machine/sis950_lpc.cpp index 2cac38194fae0..3bc81dd9b2d1c 100644 --- a/src/devices/machine/sis950_lpc.cpp +++ b/src/devices/machine/sis950_lpc.cpp @@ -430,7 +430,7 @@ void sis950_lpc_device::io_map(address_map &map) map(0x0060, 0x0060).rw(m_keybc, FUNC(ps2_keyboard_controller_device::data_r), FUNC(ps2_keyboard_controller_device::data_w)); // map(0x0061, 0x0061) NMI Status Register map(0x0061, 0x0061).rw(FUNC(sis950_lpc_device::nmi_status_r), FUNC(sis950_lpc_device::nmi_control_w)); - // undocumented but read, assume LPC complaint + // undocumented but read, assume LPC compliant map(0x0064, 0x0064).rw(m_keybc, FUNC(ps2_keyboard_controller_device::status_r), FUNC(ps2_keyboard_controller_device::command_w)); // map(0x0070, 0x0070) CMOS and NMI Mask map(0x0070, 0x0070).w(FUNC(sis950_lpc_device::rtc_index_w)); diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp index c0c5e41fed428..d95aaa8d9101f 100644 --- a/src/devices/machine/tc009xlvc.cpp +++ b/src/devices/machine/tc009xlvc.cpp @@ -102,7 +102,7 @@ void tc0090lvc_device::cpu_map(address_map &map) void tc0090lvc_device::vram_map(address_map &map) { map(0x010000, 0x01ffff).readonly().share("vram"); - // note, the way tiles are addressed suggests that 0x0000-0x3fff of this might be usable, + // NOTE: the way tiles are addressed suggests that 0x0000-0x3fff of this might be usable, // but we don't map it anywhere, so the first tiles are always blank at the moment. map(0x014000, 0x01ffff).lw8(NAME([this] (offs_t offset, u8 data) { vram_w(offset + 0x4000, data); })); map(0x040000, 0x05ffff).ram().share("bitmap_ram"); diff --git a/src/devices/machine/ticket.cpp b/src/devices/machine/ticket.cpp index 92e5f31681985..e8cd2d419b604 100644 --- a/src/devices/machine/ticket.cpp +++ b/src/devices/machine/ticket.cpp @@ -11,18 +11,10 @@ #include "emu.h" #include "ticket.h" - -//************************************************************************** -// DEBUGGING -//************************************************************************** - -#define DEBUG_TICKET 0 - -#define VERBOSE (DEBUG_TICKET) +#define VERBOSE (0) #include "logmacro.h" - //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -38,38 +30,36 @@ DEFINE_DEVICE_TYPE(HOPPER, hopper_device, "coin_hopper", "Coin Hopper") //************************************************************************** //------------------------------------------------- -// ticket_dispenser_device - constructor +// constructor //------------------------------------------------- ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) - , m_motor_sense(TICKET_MOTOR_ACTIVE_LOW) - , m_status_sense(TICKET_STATUS_ACTIVE_LOW) , m_period(attotime::from_msec(100)) , m_hopper_type(false) - , m_motoron(0) - , m_ticketdispensed(0) - , m_ticketnotdispensed(0) - , m_status(0) - , m_power(0) + , m_status(false) + , m_power(false) , m_timer(nullptr) , m_output(*this, tag) // TODO: change to "tag:status" - , m_dispense_handler(*this) // TODO: can we use m_output for this? + , m_dispense_handler(*this) { } ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ticket_dispenser_device(mconfig, TICKET_DISPENSER, tag, owner, clock) { + m_hopper_type = false; } hopper_device::hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ticket_dispenser_device(mconfig, HOPPER, tag, owner, clock) { + m_hopper_type = true; } + //------------------------------------------------- -// ~ticket_dispenser_device - destructor +// destructor //------------------------------------------------- ticket_dispenser_device::~ticket_dispenser_device() @@ -77,6 +67,7 @@ ticket_dispenser_device::~ticket_dispenser_device() } + //************************************************************************** // READ/WRITE HANDLERS //************************************************************************** @@ -97,22 +88,22 @@ int ticket_dispenser_device::line_r() void ticket_dispenser_device::motor_w(int state) { - // On an activate signal, start dispensing! - if (bool(state) == m_motoron) + // On rising edge, start dispensing! + if (state) { if (!m_power) { LOG("%s: Ticket Power On\n", machine().describe_context()); m_timer->adjust(m_period); m_power = true; - m_status = m_ticketnotdispensed; + m_status = false; } } else { if (m_power) { - if (m_hopper_type == false || m_status == m_ticketnotdispensed) + if (!m_hopper_type || !m_status) { LOG("%s: Ticket Power Off\n", machine().describe_context()); m_timer->adjust(attotime::never); @@ -134,10 +125,6 @@ void ticket_dispenser_device::motor_w(int state) void ticket_dispenser_device::device_start() { - m_motoron = (m_motor_sense == TICKET_MOTOR_ACTIVE_HIGH); - m_ticketdispensed = (m_status_sense == TICKET_STATUS_ACTIVE_HIGH); - m_ticketnotdispensed = !m_ticketdispensed; - m_timer = timer_alloc(FUNC(ticket_dispenser_device::update_output_state), this); m_output.resolve(); @@ -153,7 +140,7 @@ void ticket_dispenser_device::device_start() void ticket_dispenser_device::device_reset() { - m_status = m_ticketnotdispensed; + m_status = false; m_power = false; } @@ -180,14 +167,15 @@ TIMER_CALLBACK_MEMBER(ticket_dispenser_device::update_output_state) } // update output status - m_output = m_status == m_ticketdispensed; + m_output = m_status; if (m_hopper_type) { m_dispense_handler(m_status); } + // if we just dispensed, increment global count - if (m_status == m_ticketdispensed) + if (m_status) { machine().bookkeeping().increment_dispensed_tickets(1); LOG("Ticket Dispensed\n"); diff --git a/src/devices/machine/ticket.h b/src/devices/machine/ticket.h index 797fac5bd4e49..350baf7c4be0d 100644 --- a/src/devices/machine/ticket.h +++ b/src/devices/machine/ticket.h @@ -17,21 +17,9 @@ // GLOBAL VARIABLES //************************************************************************** -// device type definition DECLARE_DEVICE_TYPE(TICKET_DISPENSER, ticket_dispenser_device) DECLARE_DEVICE_TYPE(HOPPER, hopper_device) -//************************************************************************** -// CONSTANTS -//************************************************************************** - -const uint8_t TICKET_MOTOR_ACTIVE_LOW = 0; /* Ticket motor is triggered by D7=0 */ -const uint8_t TICKET_MOTOR_ACTIVE_HIGH = 1; /* Ticket motor is triggered by D7=1 */ - -const uint8_t TICKET_STATUS_ACTIVE_LOW = 0; /* Ticket is done dispensing when D7=0 */ -const uint8_t TICKET_STATUS_ACTIVE_HIGH = 1; /* Ticket is done dispensing when D7=1 */ - - //************************************************************************** // TYPE DEFINITIONS @@ -43,24 +31,16 @@ class ticket_dispenser_device : public device_t { public: // construction/destruction - ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense) + ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period) : ticket_dispenser_device(mconfig, tag, owner) { set_period(period); - set_senses(motor_sense, status_sense, false); } ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~ticket_dispenser_device(); // inline configuration helpers void set_period(const attotime &period) { m_period = period; } - void set_senses(uint8_t motor_sense, uint8_t status_sense, bool hopper_type) - { - m_motor_sense = motor_sense; - m_status_sense = status_sense; - m_hopper_type = hopper_type; - } - auto dispense_handler() { return m_dispense_handler.bind(); } // read/write handlers @@ -77,16 +57,9 @@ class ticket_dispenser_device : public device_t TIMER_CALLBACK_MEMBER(update_output_state); // configuration state - uint8_t m_motor_sense; - uint8_t m_status_sense; attotime m_period; bool m_hopper_type; - // active state - bool m_motoron; - bool m_ticketdispensed; - bool m_ticketnotdispensed; - bool m_status; bool m_power; emu_timer *m_timer; @@ -98,16 +71,12 @@ class hopper_device : public ticket_dispenser_device { public: // construction/destruction - hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense) + hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period) : hopper_device(mconfig, tag, owner) { set_period(period); - set_senses(motor_sense, status_sense, true); } hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - -private: - }; #endif // MAME_MACHINE_TICKET_H diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index 6c624134f4c3b..db8e1653191bb 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -1862,12 +1862,6 @@ void upd765_family_device::read_data_continue(floppy_info &fi) case SCAN_ID: LOGSTATE("SCAN_ID\n"); - if(cur_live.crc) { - fi.st0 |= ST0_FAIL; - st1 |= ST1_DE|ST1_ND; - fi.sub_state = COMMAND_DONE; - break; - } // MZ: This st1 handling ensures that both HX5102 floppy and the // Speedlock protection scheme are properly working. // a) HX5102 requires that the ND flag not be set when no address @@ -1889,6 +1883,13 @@ void upd765_family_device::read_data_continue(floppy_info &fi) live_start(fi, SEARCH_ADDRESS_MARK_HEADER); return; } + if(cur_live.crc) { + fi.st0 |= ST0_FAIL; + st1 |= ST1_DE; + st1 &= ~ST1_ND; + fi.sub_state = COMMAND_DONE; + break; + } st1 &= ~ST1_ND; st2 &= ~ST2_WC; LOGRW("reading sector %02x %02x %02x %02x\n", diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp index 578503aff358d..534546d47d6e2 100644 --- a/src/devices/machine/z80dma.cpp +++ b/src/devices/machine/z80dma.cpp @@ -262,7 +262,7 @@ int z80dma_device::z80daisy_irq_ack() else { LOGINT("z80dma_irq_ack: failed to find an interrupt to ack!\n"); - return 0; + return 0; } } diff --git a/src/devices/sound/dave.cpp b/src/devices/sound/dave.cpp index 1d2a153a214de..e56fa34bd642c 100644 --- a/src/devices/sound/dave.cpp +++ b/src/devices/sound/dave.cpp @@ -25,7 +25,7 @@ // DEVICE DEFINITIONS //************************************************************************** -DEFINE_DEVICE_TYPE(DAVE, dave_device, "dave", "Inteligent Designs DAVE") +DEFINE_DEVICE_TYPE(DAVE, dave_device, "dave", "Intelligent Designs DAVE") void dave_device::z80_program_map(address_map &map) diff --git a/src/devices/sound/dspv.cpp b/src/devices/sound/dspv.cpp index b0f4d8f35966c..9877cee3fb10d 100644 --- a/src/devices/sound/dspv.cpp +++ b/src/devices/sound/dspv.cpp @@ -151,11 +151,6 @@ uint32_t dspv_device::execute_max_cycles() const noexcept return 1; } -uint32_t dspv_device::execute_input_lines() const noexcept -{ - return 0; -} - void dspv_device::execute_run() { if(machine().debug_flags & DEBUG_FLAG_ENABLED) diff --git a/src/devices/sound/dspv.h b/src/devices/sound/dspv.h index 9be1cb3963d9e..33604fc454dd4 100644 --- a/src/devices/sound/dspv.h +++ b/src/devices/sound/dspv.h @@ -22,7 +22,6 @@ class dspv_device : public cpu_device, public device_sound_interface virtual void device_reset() override; virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual space_config_vector memory_space_config() const override; virtual void state_import(const device_state_entry &entry) override; diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index 257fa135bb574..e1b4966a78a06 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -139,6 +139,10 @@ qsound_device::qsound_device(machine_config const &mconfig, char const *tag, dev { } +qsound_device::~qsound_device() +{ +} + void qsound_device::qsound_w(offs_t offset, u8 data) { diff --git a/src/devices/sound/qsound.h b/src/devices/sound/qsound.h index 427326157ebab..f3a442c9235c5 100644 --- a/src/devices/sound/qsound.h +++ b/src/devices/sound/qsound.h @@ -19,6 +19,7 @@ class qsound_device : public device_t, public device_sound_interface, public dev public: // default 60MHz clock (divided by 2 for DSP core clock, and then by 1248 for sample rate) qsound_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 60'000'000); + virtual ~qsound_device(); void qsound_w(offs_t offset, u8 data); u8 qsound_r(); diff --git a/src/devices/sound/s14001a.cpp b/src/devices/sound/s14001a.cpp index 0c54622e46d12..64e2303320679 100644 --- a/src/devices/sound/s14001a.cpp +++ b/src/devices/sound/s14001a.cpp @@ -247,7 +247,7 @@ void s14001a_device::device_start() m_bPPQCarryP2 = false; m_bRepeatCarryP2 = false; m_bLengthCarryP2 = false; - m_RomAddrP1 = 0; + m_uRomAddrP1 = 0; m_uRomAddrP2 = 0; m_bBusyP1 = false; m_bStart = false; @@ -283,7 +283,7 @@ void s14001a_device::device_start() save_item(NAME(m_bPPQCarryP2)); save_item(NAME(m_bRepeatCarryP2)); save_item(NAME(m_bLengthCarryP2)); - save_item(NAME(m_RomAddrP1)); + save_item(NAME(m_uRomAddrP1)); save_item(NAME(m_uOutputP2)); save_item(NAME(m_uRomAddrP2)); @@ -333,15 +333,9 @@ void s14001a_device::data_w(u8 data) void s14001a_device::start_w(int state) { m_stream->update(); - m_bStart = (state != 0); - if (m_bStart) + if (state && !m_bStart) m_uStateP1 = states::WORDWAIT; -} - -void s14001a_device::set_clock(u32 clock) -{ - m_stream->update(); - m_stream->set_sample_rate(clock); + m_bStart = (state != 0); } @@ -385,7 +379,7 @@ bool s14001a_device::Clock() m_uDeltaOldP2 = m_uDeltaOldP1; m_uOutputP2 = m_uOutputP1; - m_uRomAddrP2 = m_RomAddrP1; + m_uRomAddrP2 = m_uRomAddrP1; // setup carries from phase 2 values m_bDAR04To00CarryP2 = m_uDAR04To00P2 == 0x1f; @@ -415,7 +409,7 @@ bool s14001a_device::Clock() // all other bits forced to 0. 04 to 08 makes a multiply by two. m_uDAR13To05P1 = (m_uWord & 0x3c) >> 2; m_uDAR04To00P1 = (m_uWord & 0x03) << 3; - m_RomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits + m_uRomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits m_uOutputP1 = 7; m_uStateP1 = m_bStart ? states::WORDWAIT : states::CWARMSB; @@ -434,7 +428,7 @@ bool s14001a_device::Clock() m_uDAR04To00P1 += 4; if (m_uDAR04To00P1 >= 32) m_uDAR04To00P1 = 0; // emulate 5 bit counter - m_RomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits + m_uRomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits m_uOutputP1 = 7; m_uStateP1 = m_bStart ? states::WORDWAIT : states::CWARLSB; @@ -442,7 +436,7 @@ bool s14001a_device::Clock() case states::CWARLSB: m_uCWARP1 = m_uCWARP2 | (ReadMem(m_uRomAddrP2, m_bPhase1) >> 4); // setup in previous state - m_RomAddrP1 = m_uCWARP1; + m_uRomAddrP1 = m_uCWARP1; m_uOutputP1 = 7; m_uStateP1 = m_bStart ? states::WORDWAIT : states::DARMSB; @@ -452,7 +446,7 @@ bool s14001a_device::Clock() m_uDAR13To05P1 = ReadMem(m_uRomAddrP2, m_bPhase1) << 1; // 9 bit counter, 8 MSBs from ROM, lsb zeroed m_uDAR04To00P1 = 0; m_uCWARP1++; - m_RomAddrP1 = m_uCWARP1; + m_uRomAddrP1 = m_uCWARP1; m_uOutputP1 = 7; m_uStateP1 = m_bStart ? states::WORDWAIT : states::CTRLBITS; @@ -469,7 +463,7 @@ bool s14001a_device::Clock() m_uLengthP1 = (data & 0x1f) << 2; // includes external length and repeat m_uDAR04To00P1 = 0; m_uCWARP1++; // gets ready for next DARMSB - m_RomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits + m_uRomAddrP1 = (m_uDAR13To05P1 << 3) | (m_uDAR04To00P1 >> 2); // remove lower two bits m_uOutputP1 = 7; m_uStateP1 = m_bStart ? states::WORDWAIT : states::PLAY; @@ -540,11 +534,11 @@ bool s14001a_device::Clock() m_uDAR13To05P1 = 0; // emulate 9 bit counter } - // construct m_RomAddrP1 - m_RomAddrP1 = m_uDAR04To00P1; + // construct m_uRomAddrP1 + m_uRomAddrP1 = m_uDAR04To00P1; if (m_bVoicedP2 && m_uLengthP1 & 0x1) // mirroring - m_RomAddrP1 ^= 0x1f; // count backwards - m_RomAddrP1 = (m_uDAR13To05P1 << 3) | m_RomAddrP1 >> 2; + m_uRomAddrP1 ^= 0x1f; // count backwards + m_uRomAddrP1 = (m_uDAR13To05P1 << 3) | m_uRomAddrP1 >> 2; // next state if (m_bStart) @@ -554,7 +548,7 @@ bool s14001a_device::Clock() else if (m_bLengthCarryP2) { m_uStateP1 = states::DARMSB; - m_RomAddrP1 = m_uCWARP1; // output correct address + m_uRomAddrP1 = m_uCWARP1; // output correct address } else m_uStateP1 = states::PLAY; diff --git a/src/devices/sound/s14001a.h b/src/devices/sound/s14001a.h index 151d62de2b132..44fe973cfeb23 100644 --- a/src/devices/sound/s14001a.h +++ b/src/devices/sound/s14001a.h @@ -25,12 +25,10 @@ class s14001a_device : public device_t, public device_sound_interface, public de void start_w(int state); // START (pin 10) void data_w(u8 data); // 6-bit word - void set_clock(u32 clock); // set new CLK frequency - void set_clock(const XTAL &xtal) { set_clock(xtal.value()); } - protected: // device-level overrides virtual void device_start() override; + virtual void device_clock_changed() override { m_stream->update(); m_stream->set_sample_rate(clock()); } virtual void rom_bank_pre_change() override { m_stream->update(); } // sound stream update overrides @@ -96,7 +94,7 @@ class s14001a_device : public device_t, public device_sound_interface, public de bool m_bPPQCarryP2; bool m_bRepeatCarryP2; bool m_bLengthCarryP2; - u16 m_RomAddrP1; // rom address + u16 m_uRomAddrP1; // rom address // output pins u8 m_uOutputP2; // output changes on phase2 diff --git a/src/devices/sound/swp30.cpp b/src/devices/sound/swp30.cpp index 70ba7c5c7e68d..15d87e4233ff9 100644 --- a/src/devices/sound/swp30.cpp +++ b/src/devices/sound/swp30.cpp @@ -1233,11 +1233,6 @@ uint32_t swp30_device::execute_max_cycles() const noexcept return 1; } -uint32_t swp30_device::execute_input_lines() const noexcept -{ - return 0; -} - void swp30_device::meg_prg_map(address_map &map) { diff --git a/src/devices/sound/swp30.h b/src/devices/sound/swp30.h index 3529a39a03237..4c07776c06e6d 100644 --- a/src/devices/sound/swp30.h +++ b/src/devices/sound/swp30.h @@ -25,7 +25,6 @@ class swp30_device : public cpu_device, public device_sound_interface, public sw virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 1) / 2; } virtual void execute_run() override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp index 42899a0ac4dad..bc08ea2a18d0c 100644 --- a/src/devices/sound/tms5110.cpp +++ b/src/devices/sound/tms5110.cpp @@ -277,11 +277,11 @@ static void printbits(long data, int num) /****************************************************************************************** - extract_bits -- extract a specific number of bits from the VSM + read_bits -- read a specific number of bits from the VSM ******************************************************************************************/ -int tms5110_device::extract_bits(int count) +int tms5110_device::read_bits(int count) { int val = 0; if (DEBUG_5110) logerror("requesting %d bits", count); @@ -846,7 +846,7 @@ void tms5110_device::PDC_set(int data) fprintf(stderr,"actually reading a bit now\n"); #endif m_CTL_buffer >>= 1; - m_CTL_buffer |= (extract_bits(1)<<3); + m_CTL_buffer |= (read_bits(1)<<3); m_CTL_buffer &= 0xF; } break; @@ -924,7 +924,7 @@ void tms5110_device::parse_frame() m_uv_zpar = m_zpar = 0; // attempt to extract the energy index - m_new_frame_energy_idx = extract_bits(m_coeff->energy_bits); + m_new_frame_energy_idx = read_bits(m_coeff->energy_bits); #ifdef DEBUG_PARSE_FRAME_DUMP printbits(m_new_frame_energy_idx,m_coeff->energy_bits); fprintf(stderr," "); @@ -934,13 +934,13 @@ void tms5110_device::parse_frame() if ((m_new_frame_energy_idx == 0) || (m_new_frame_energy_idx == 15)) return; - rep_flag = extract_bits(1); + rep_flag = read_bits(1); #ifdef DEBUG_PARSE_FRAME_DUMP printbits(rep_flag, 1); fprintf(stderr," "); #endif - m_new_frame_pitch_idx = extract_bits(m_coeff->pitch_bits); + m_new_frame_pitch_idx = read_bits(m_coeff->pitch_bits); #ifdef DEBUG_PARSE_FRAME_DUMP printbits(m_new_frame_pitch_idx,m_coeff->pitch_bits); fprintf(stderr," "); @@ -954,7 +954,7 @@ void tms5110_device::parse_frame() // extract first 4 K coefficients for (i = 0; i < 4; i++) { - m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]); + m_new_frame_k_idx[i] = read_bits(m_coeff->kbits[i]); #ifdef DEBUG_PARSE_FRAME_DUMP printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]); fprintf(stderr," "); @@ -971,7 +971,7 @@ void tms5110_device::parse_frame() // If we got here, we need the remaining 6 K's for (i = 4; i < m_coeff->num_k; i++) { - m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]); + m_new_frame_k_idx[i] = read_bits(m_coeff->kbits[i]); #ifdef DEBUG_PARSE_FRAME_DUMP printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]); fprintf(stderr," "); diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h index 9d907668a703a..c6e2a38900ee9 100644 --- a/src/devices/sound/tms5110.h +++ b/src/devices/sound/tms5110.h @@ -74,7 +74,7 @@ class tms5110_device : public device_t, public device_sound_interface void new_int_write_addr(uint8_t addr); uint8_t new_int_read(); void register_for_save_states(); - int extract_bits(int count); + int read_bits(int count); void perform_dummy_read(); int32_t lattice_filter(); void process(int16_t *buffer, unsigned int size); diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index 77a7faeca7672..79ffe28cee7d9 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -746,11 +746,11 @@ void tms5220_device::update_fifo_status_and_ints() /********************************************************************************************** - extract_bits -- extract a specific number of bits from the current input stream (FIFO or VSM) + read_bits -- read a specific number of bits from the current input stream (FIFO or VSM) ***********************************************************************************************/ -int tms5220_device::extract_bits(int count) +int tms5220_device::read_bits(int count) { int val = 0; @@ -1469,7 +1469,7 @@ void tms5220_device::parse_frame() has a 2 bit rate preceding it, grab two bits here and store them as the rate; */ if ((TMS5220_HAS_RATE_CONTROL) && (m_c_variant_rate & 0x04)) { - i = extract_bits(2); + i = read_bits(2); printbits(i, 2); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); m_IP = reload_table[i]; @@ -1481,7 +1481,7 @@ void tms5220_device::parse_frame() if (m_DDIS && m_buffer_empty) goto ranout; // attempt to extract the energy index - m_new_frame_energy_idx = extract_bits(m_coeff->energy_bits); + m_new_frame_energy_idx = read_bits(m_coeff->energy_bits); printbits(m_new_frame_energy_idx, m_coeff->energy_bits); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); update_fifo_status_and_ints(); @@ -1492,12 +1492,12 @@ void tms5220_device::parse_frame() // attempt to extract the repeat flag - rep_flag = extract_bits(1); + rep_flag = read_bits(1); printbits(rep_flag, 1); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); // attempt to extract the pitch - m_new_frame_pitch_idx = extract_bits(m_coeff->pitch_bits); + m_new_frame_pitch_idx = read_bits(m_coeff->pitch_bits); printbits(m_new_frame_pitch_idx, m_coeff->pitch_bits); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); // if the new frame is unvoiced, be sure to zero out the k5-k10 parameters @@ -1511,7 +1511,7 @@ void tms5220_device::parse_frame() // extract first 4 K coefficients for (i = 0; i < 4; i++) { - m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]); + m_new_frame_k_idx[i] = read_bits(m_coeff->kbits[i]); printbits(m_new_frame_k_idx[i], m_coeff->kbits[i]); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); update_fifo_status_and_ints(); @@ -1528,7 +1528,7 @@ void tms5220_device::parse_frame() // If we got here, we need the remaining 6 K's for (i = 4; i < m_coeff->num_k; i++) { - m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]); + m_new_frame_k_idx[i] = read_bits(m_coeff->kbits[i]); printbits(m_new_frame_k_idx[i], m_coeff->kbits[i]); LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, " "); update_fifo_status_and_ints(); diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 061df7b0266d3..f7ff1dcc091a4 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -89,7 +89,7 @@ class tms5220_device : public device_t, public device_sound_interface void register_for_save_states(); void data_write(int data); void update_fifo_status_and_ints(); - int extract_bits(int count); + int read_bits(int count); uint8_t status_read(bool clear_int); bool ready_read(); bool int_read(); diff --git a/src/devices/sound/upd65043gfu01.cpp b/src/devices/sound/upd65043gfu01.cpp new file mode 100644 index 0000000000000..7ef6c9d98de24 --- /dev/null +++ b/src/devices/sound/upd65043gfu01.cpp @@ -0,0 +1,249 @@ +// license: BSD-3-Clause +// copyright-holders: Devin Acker + +/* + NEC uPD65043GF-U01 + + This is the custom sound chip used in the Zoomer PDA. + It features 3 square wave generators and 1 noise generator configurable as either white or + "metal" noise, as well as an interrupt-driven 8-bit PCM stream. + + TODO: + - Verify noise generator behavior (the current implementation is based on presumed similarities + with the SN76489) + - Verify PCM interrupt behavior (currently only tested with the "About" dialog in Palm-developed + Zoomer system apps, which play a short .wav file) +*/ + +#include "emu.h" +#include "upd65043gfu01.h" + +#include + + +namespace { + +constexpr s8 OUTPUT_LEVEL[16] = +{ + 0, 5, 6, 8, 10, 12, 15, 20, 25, 31, 40, 50, 63, 80, 100, 127 +}; + +} // anonymous namespace + + +DEFINE_DEVICE_TYPE(UPD65043GFU01, upd65043gfu01_device, "upd65043gfu01", "NEC uPD65043GF-U01") + +//************************************************************************** +upd65043gfu01_device::upd65043gfu01_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, UPD65043GFU01, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , m_irq_cb(*this) +{ +} + +//************************************************************************** +void upd65043gfu01_device::device_start() +{ + m_stream = stream_alloc(0, 1, clock() / 8); + m_irq_timer = timer_alloc(FUNC(upd65043gfu01_device::irq_timer), this); + + std::fill(std::begin(m_period), std::end(m_period), 0); + std::fill(std::begin(m_count), std::end(m_count), 0); + std::fill(std::begin(m_volume), std::end(m_volume), 0); + std::fill(std::begin(m_output), std::end(m_output), 0); + + m_noise_mode = 0; + + m_pcm_period = m_pcm_count = 0; + m_pcm_buffer_read = 0; + m_pcm_buffer_write = 1; + + std::fill(std::begin(m_pcm_buffer), std::end(m_pcm_buffer), 0); + + save_item(NAME(m_control)); + save_item(NAME(m_period)); + save_item(NAME(m_count)); + save_item(NAME(m_volume)); + save_item(NAME(m_output)); + save_item(NAME(m_noise_mode)); + save_item(NAME(m_pcm_period)); + save_item(NAME(m_pcm_count)); + save_item(NAME(m_pcm_buffer)); + save_item(NAME(m_pcm_buffer_read)); + save_item(NAME(m_pcm_buffer_write)); +} + +//************************************************************************** +void upd65043gfu01_device::device_reset() +{ + m_control = 0xff; // disable everything? + + m_irq_timer->adjust(attotime::never); + m_irq_cb(0); +} + +//************************************************************************** +void upd65043gfu01_device::device_clock_changed() +{ + m_stream->set_sample_rate(clock() / 8); + update_irq(); +} + +//************************************************************************** +u8 upd65043gfu01_device::read(offs_t offset) +{ + switch (offset & 0xf) + { + case 0x0: case 0x2: case 0x4: + return m_period[offset >> 1]; + + case 0x1: case 0x3: case 0x5: + return m_period[offset >> 1] >> 8; + + case 0x6: + return m_noise_mode; + + case 0x7: case 0x8: case 0x9: case 0xa: + return m_volume[offset - 0x7]; + + case 0xc: + return m_control; + + case 0xd: + return m_pcm_period; + + default: + if (!machine().side_effects_disabled()) + logerror("%s: unknown register read 0x%x\n", machine().describe_context(), offset & 0xf); + return 0; + } +} + +//************************************************************************** +void upd65043gfu01_device::write(offs_t offset, u8 data) +{ + m_stream->update(); + + switch (offset) + { + case 0x0: case 0x2: case 0x4: + m_period[offset >> 1] &= 0x0f00; + m_period[offset >> 1] |= data; + + if (offset == 0x4) + update_noise(); + break; + + case 0x1: case 0x3: case 0x5: + m_period[offset >> 1] &= 0x00ff; + m_period[offset >> 1] |= (data << 8); + + if (offset == 0x5) + update_noise(); + break; + + case 0x6: + m_noise_mode = data; + update_noise(); + break; + + case 0x7: case 0x8: case 0x9: case 0xa: + m_volume[offset - 0x7] = data & 0xf; + break; + + case 0xb: + m_pcm_buffer[m_pcm_buffer_write & 0x1ff] = s8(u8(data - 0x80)); + m_pcm_buffer_write++; + break; + + case 0xc: + m_control = data; + update_irq(); + break; + + case 0xd: + m_pcm_period = data << 1; + update_irq(); + break; + + default: + logerror("%s: unknown register write %x = %02x\n", machine().describe_context(), offset, data); + break; + } +} + +//************************************************************************** +TIMER_CALLBACK_MEMBER(upd65043gfu01_device::irq_timer) +{ + m_irq_cb(1); +} + +//************************************************************************** +void upd65043gfu01_device::update_irq() +{ + if (!BIT(m_control, 2) || BIT(m_control, 4)) + { + // IRQ disabled or PCM stopped + m_irq_timer->adjust(attotime::never); + m_irq_cb(0); + } + else + { + // recalculate timer so the IRQ fires when there are 128 samples or fewer in the buffer + // (GEOS will push up to 128 more samples at this point) + const u16 samples_left = std::min(128, (m_pcm_buffer_write - m_pcm_buffer_read) & 0x1ff); + const u16 ticks_left = (samples_left * m_pcm_period) - m_pcm_count; + m_irq_timer->adjust(m_stream->sample_period() * ticks_left); + } +} + +//************************************************************************** +void upd65043gfu01_device::update_noise() +{ + // TODO: this behavior is a complete guess + m_period[3] = BIT(m_control, 0) ? (m_period[2] << 1) : (1 << 5); +} + +//************************************************************************** +void upd65043gfu01_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +{ + for (int i = 0; i < outputs[0].samples(); i++) + { + s16 sample = 0; + + for (int i = 0; i < 4; i++) + { + m_count[i]++; + if (m_count[i] >= m_period[i]) + { + m_count[i] = 0; + + if (i < 3) + m_output[i] ^= 1; + else + m_output[i] = machine().rand() & 1; + } + + if (!BIT(m_control, 3)) + { + if (BIT(m_output[i], 0)) + sample += OUTPUT_LEVEL[m_volume[i] & 0xf]; + else + sample -= OUTPUT_LEVEL[m_volume[i] & 0xf]; + } + } + + m_pcm_count++; + if (m_pcm_count >= m_pcm_period) + { + m_pcm_count = 0; + if (((m_pcm_buffer_read + 1) ^ m_pcm_buffer_write) & 0x1ff) + m_pcm_buffer_read++; + } + + if (!BIT(m_control, 4)) + sample += m_pcm_buffer[m_pcm_buffer_read & 0x1ff]; + + outputs[0].put_int_clamp(i, sample, 1 << 10); + } +} diff --git a/src/devices/sound/upd65043gfu01.h b/src/devices/sound/upd65043gfu01.h new file mode 100644 index 0000000000000..4bcaf6ebf690b --- /dev/null +++ b/src/devices/sound/upd65043gfu01.h @@ -0,0 +1,56 @@ +// license: BSD-3-Clause +// copyright-holders: Devin Acker + +#ifndef MAME_SOUND_UPD65043GFU01_H +#define MAME_SOUND_UPD65043GFU01_H + +#pragma once + +class upd65043gfu01_device : public device_t, public device_sound_interface +{ +public: + upd65043gfu01_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + static constexpr feature_type imperfect_features() { return feature::SOUND; } + + auto irq_cb() { return m_irq_cb.bind(); } + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_clock_changed() override; + + virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; + +private: + TIMER_CALLBACK_MEMBER(irq_timer); + void update_irq(); + + void update_noise(); + + sound_stream *m_stream; + emu_timer *m_irq_timer; + + devcb_write_line m_irq_cb; + + u8 m_control; + + u16 m_period[4]; + u16 m_count[4]; + u8 m_volume[4]; + u8 m_output[4]; + u8 m_noise_mode; + + u8 m_pcm_period; + u8 m_pcm_count; + + s8 m_pcm_buffer[0x200]; + u16 m_pcm_buffer_read, m_pcm_buffer_write; +}; + +DECLARE_DEVICE_TYPE(UPD65043GFU01, upd65043gfu01_device) + +#endif // MAME_SOUND_UPD65043GFU01_H diff --git a/src/devices/video/dl1416.cpp b/src/devices/video/dl1416.cpp index ca5ef344f3848..5926bd7cc98c4 100644 --- a/src/devices/video/dl1416.cpp +++ b/src/devices/video/dl1416.cpp @@ -194,6 +194,10 @@ dl1414_device::dl1414_device( { } +dl1414_device::~dl1414_device() +{ +} + dl1416_device::dl1416_device( machine_config const &mconfig, device_type type, @@ -208,6 +212,10 @@ dl1416_device::dl1416_device( { } +dl1416_device::~dl1416_device() +{ +} + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/video/dl1416.h b/src/devices/video/dl1416.h index 9a220b5e781ba..eae4e09008536 100644 --- a/src/devices/video/dl1416.h +++ b/src/devices/video/dl1416.h @@ -33,6 +33,8 @@ DECLARE_DEVICE_TYPE(DL1416T, dl1416_device) class dl1414_device : public device_t { public: + virtual ~dl1414_device(); + auto update() { return m_update_cb.bind(); } // signal-level interface @@ -51,7 +53,7 @@ class dl1414_device : public device_t device_t *owner, u32 clock); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -76,6 +78,8 @@ class dl1414_device : public device_t class dl1416_device : public dl1414_device { public: + virtual ~dl1416_device(); + virtual void wr_w(int state) override; void ce_w(int state); // chip enable (active low) void cu_w(int state); // cursor enable (active low) diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index 8054b08a4f781..8ae471017d23c 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -1280,11 +1280,13 @@ void mc6845_device::device_reset() m_light_pen_latched = false; + // TODO: as per the note above, none of these should reset unless otherwise proven. m_cursor_addr = 0; m_line_address = 0; - m_horiz_disp = 0; + // bml3 in particular disagrees with these two. + //m_horiz_disp = 0; + //m_mode_control = 0; m_cursor_x = 0; - m_mode_control = 0; m_register_address_latch = 0; m_update_addr = 0; m_light_pen_addr = 0; diff --git a/src/devices/video/pc_vga_paradise.cpp b/src/devices/video/pc_vga_paradise.cpp index e205a3f409d45..5b5ac35c3853f 100644 --- a/src/devices/video/pc_vga_paradise.cpp +++ b/src/devices/video/pc_vga_paradise.cpp @@ -277,8 +277,8 @@ void pvga1a_vga_device::video_control_w(offs_t offset, u8 data) /* * [0x0f] PR5 Lock/Status * - * xxxx ---- MD7/MD4 config reads - * ---- x--- MD8 config read (on later chipsets) + * xxxx ---- CNF(7)-CNF(4) / MD7/MD4 config reads + * ---- x--- CNF(8) / MD8 config read (on later chipsets) * ---- -xxx lock register * ---- -101 unlock, any other value locks r/w to the extensions */ @@ -301,6 +301,10 @@ void pvga1a_vga_device::ext_gc_unlock_w(offs_t offset, u8 data) wd90c00_vga_device::wd90c00_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pvga1a_vga_device(mconfig, type, tag, owner, clock) + , m_cnf15_read_cb(*this, 1) + , m_cnf14_read_cb(*this, 1) + , m_cnf13_read_cb(*this, 1) + , m_cnf12_read_cb(*this, 1) { m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(wd90c00_vga_device::crtc_map), this)); } @@ -317,13 +321,32 @@ void wd90c00_vga_device::device_reset() m_pr10_scratch = 0; m_ext_crtc_read_unlock = false; m_ext_crtc_write_unlock = false; - m_egasw = 0xf0; + // egasw + m_pr11 = (m_cnf15_read_cb() << 7) | (m_cnf14_read_cb() << 6) | m_cnf13_read_cb() << 5 | m_cnf12_read_cb() << 4; m_interlace_start = 0; m_interlace_end = 0; m_interlace_mode = false; m_pr15 = 0; } +ioport_value wd90c00_vga_device::egasw1_r() { return BIT(m_pr11, 4); } +ioport_value wd90c00_vga_device::egasw2_r() { return BIT(m_pr11, 5); } +ioport_value wd90c00_vga_device::egasw3_r() { return BIT(m_pr11, 6); } +ioport_value wd90c00_vga_device::egasw4_r() { return BIT(m_pr11, 7); } + +static INPUT_PORTS_START(paradise_vga_sense) + PORT_START("VGA_SENSE") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wd90c00_vga_device, egasw1_r) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wd90c00_vga_device, egasw2_r) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wd90c00_vga_device, egasw3_r) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wd90c00_vga_device, egasw4_r) +INPUT_PORTS_END + +ioport_constructor wd90c00_vga_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(paradise_vga_sense); +} + u8 wd90c00_vga_device::crtc_data_r(offs_t offset) { if (!m_ext_crtc_read_unlock && vga.crtc.index >= 0x2a && !machine().side_effects_disabled()) @@ -415,6 +438,7 @@ void wd90c00_vga_device::ext_crtc_unlock_w(offs_t offset, u8 data) * [0x2a] PR11 EGA Switches * * xxxx ---- EGA switches (MD15-MD12), latches high if written to. + * CONF15-12 on 'C26 for panel support. Pulling up will latch high these pins. * ---- x--- EGA emulation on Analog Display * ---- -x-- Lock Clock Select (disables external chip select for VCLK1) * ---- --x- Locks GC $5 bits 6:5, sequencer $1 bits 5:2, sequencer $3 bits 5:0 @@ -422,15 +446,14 @@ void wd90c00_vga_device::ext_crtc_unlock_w(offs_t offset, u8 data) */ u8 wd90c00_vga_device::egasw_r(offs_t offset) { - const u8 ega_config = (m_input_sense->read() << 4); - LOG("PR11 EGA Switch R (%02x | %02x)\n", ega_config, m_egasw); - return (ega_config | m_egasw); + LOG("PR11 EGA Switch R (%02x)\n", m_pr11); + return m_pr11; } void wd90c00_vga_device::egasw_w(offs_t offset, u8 data) { LOG("PR11 EGA Switch W %02x\n", data); - m_egasw = data & 0xff; + m_pr11 = data & 0xff; } /* diff --git a/src/devices/video/pc_vga_paradise.h b/src/devices/video/pc_vga_paradise.h index 63bec929ec501..af5cac190038d 100644 --- a/src/devices/video/pc_vga_paradise.h +++ b/src/devices/video/pc_vga_paradise.h @@ -54,6 +54,18 @@ class wd90c00_vga_device : public pvga1a_vga_device public: wd90c00_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // TODO: backport to original PVGA1A + // claims these as CNF(7)-CNF(4), which implies input sense read from GC register instead. + auto read_cnf15_callback() { return m_cnf15_read_cb.bind(); } + auto read_cnf14_callback() { return m_cnf14_read_cb.bind(); } + auto read_cnf13_callback() { return m_cnf13_read_cb.bind(); } + auto read_cnf12_callback() { return m_cnf12_read_cb.bind(); } + + // NOTE: these are internal shadows, for the input sense. + ioport_value egasw4_r(); + ioport_value egasw3_r(); + ioport_value egasw2_r(); + ioport_value egasw1_r(); protected: wd90c00_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -64,6 +76,8 @@ class wd90c00_vga_device : public pvga1a_vga_device virtual bool get_interlace_mode() override { return m_interlace_mode; } + virtual ioport_constructor device_input_ports() const override; + private: virtual u8 crtc_data_r(offs_t offset) override; virtual void crtc_data_w(offs_t offset, u8 data) override; @@ -80,11 +94,16 @@ class wd90c00_vga_device : public pvga1a_vga_device bool m_ext_crtc_read_unlock = false; bool m_ext_crtc_write_unlock = false; u8 m_pr10_scratch = 0; - u8 m_egasw = 0; + u8 m_pr11 = 0; u8 m_interlace_start = 0; u8 m_interlace_end = 0; bool m_interlace_mode = 0; u8 m_pr15 = 0; + + devcb_read_line m_cnf15_read_cb; + devcb_read_line m_cnf14_read_cb; + devcb_read_line m_cnf13_read_cb; + devcb_read_line m_cnf12_read_cb; }; class wd90c11a_vga_device : public wd90c00_vga_device diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index 0dcc0b989820d..a189a5b021097 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -394,25 +394,25 @@ void debug_view_disasm::view_update() // print - print a string in the disassembly view //------------------------------------------------- -void debug_view_disasm::print(int row, std::string text, int start, int end, u8 attrib) +void debug_view_disasm::print(u32 row, std::string text, s32 start, s32 end, u8 attrib) { - int view_end = end - m_topleft.x; + s32 view_end = end - m_topleft.x; if(view_end < 0) return; - int string_0 = start - m_topleft.x; + s32 string_0 = start - m_topleft.x; if(string_0 >= m_visible.x) return; - int view_start = string_0 > 0 ? string_0 : 0; + s32 view_start = string_0 > 0 ? string_0 : 0; debug_view_char *dest = &m_viewdata[row * m_visible.x + view_start]; if(view_end >= m_visible.x) view_end = m_visible.x; - for(int pos = view_start; pos < view_end; pos++) { - int spos = pos - string_0; - if(spos >= int(text.size())) + for(s32 pos = view_start; pos < view_end; pos++) { + s32 spos = pos - string_0; + if(spos >= s32(text.size())) *dest++ = { ' ', attrib }; else *dest++ = { u8(text[spos]), attrib }; @@ -427,13 +427,15 @@ void debug_view_disasm::print(int row, std::string text, int start, int end, u8 void debug_view_disasm::redraw() { // determine how many characters we need for an address and set the divider - int m_divider1 = 1 + m_dasm[0].m_tadr.size() + 1; + s32 divider1 = 1 + m_dasm[0].m_tadr.size() + 1; // assume a fixed number of characters for the disassembly - int m_divider2 = m_divider1 + 1 + m_dasm_width + 1; + s32 divider2 = divider1 + 1 + m_dasm_width + 1; // set the width of the third column to max comment length - m_total.x = m_divider2 + 1 + 50; // DEBUG_COMMENT_MAX_LINE_LENGTH + m_total.x = divider2 + 1 + 50; // DEBUG_COMMENT_MAX_LINE_LENGTH + + const s32 max_visible_col = m_topleft.x + m_visible.x; // loop over visible rows for(u32 row = 0; row < m_visible.y; row++) @@ -460,22 +462,22 @@ void debug_view_disasm::redraw() if(m_dasm[effrow].m_is_visited) attrib |= DCA_VISITED; - print(row, ' ' + m_dasm[effrow].m_tadr, 0, m_divider1, attrib | DCA_ANCILLARY); - print(row, ' ' + m_dasm[effrow].m_dasm, m_divider1, m_divider2, attrib); + print(row, ' ' + m_dasm[effrow].m_tadr, 0, divider1, attrib | DCA_ANCILLARY); + print(row, ' ' + m_dasm[effrow].m_dasm, divider1, divider2, attrib); if(m_right_column == DASM_RIGHTCOL_RAW || m_right_column == DASM_RIGHTCOL_ENCRYPTED) { std::string text = ' ' +(m_right_column == DASM_RIGHTCOL_RAW ? m_dasm[effrow].m_topcodes : m_dasm[effrow].m_tparams); - print(row, text, m_divider2, m_visible.x, attrib | DCA_ANCILLARY); - if(int(text.size()) > m_visible.x - m_divider2) { - int base = m_total.x - 3; - if(base < m_divider2) - base = m_divider2; - print(row, "...", base, m_visible.x, attrib | DCA_ANCILLARY); + print(row, text, divider2, max_visible_col, attrib | DCA_ANCILLARY); + if(s32(text.size()) > max_visible_col - divider2) { + s32 base = max_visible_col - 3; + if(base < divider2) + base = divider2; + print(row, "...", base, max_visible_col, attrib | DCA_ANCILLARY); } } else if(!m_dasm[effrow].m_comment.empty()) - print(row, " // " + m_dasm[effrow].m_comment, m_divider2, m_visible.x, attrib | DCA_COMMENT | DCA_ANCILLARY); + print(row, " // " + m_dasm[effrow].m_comment, divider2, max_visible_col, attrib | DCA_COMMENT | DCA_ANCILLARY); else - print(row, "", m_divider2, m_visible.x, attrib | DCA_COMMENT | DCA_ANCILLARY); + print(row, "", divider2, max_visible_col, attrib | DCA_COMMENT | DCA_ANCILLARY); } } } diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index 0a16f95d5fe0f..4778793532234 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -119,7 +119,7 @@ class debug_view_disasm : public debug_view void complete_information(const debug_view_disasm_source &source, debug_disasm_buffer &buffer, offs_t pc); void enumerate_sources(); - void print(int row, std::string text, int start, int end, u8 attrib); + void print(u32 row, std::string text, s32 start, s32 end, u8 attrib); void redraw(); // internal state diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp index 715f0c384590d..60ba1e7e8babb 100644 --- a/src/emu/diexec.cpp +++ b/src/emu/diexec.cpp @@ -282,17 +282,6 @@ u32 device_execute_interface::execute_max_cycles() const noexcept } -//------------------------------------------------- -// execute_input_lines - return the total number -// of input lines for the device -//------------------------------------------------- - -u32 device_execute_interface::execute_input_lines() const noexcept -{ - return 0; -} - - //------------------------------------------------- // execute_default_irq_vector - return the default // IRQ vector when an acknowledge is processed @@ -315,18 +304,6 @@ bool device_execute_interface::execute_input_edge_triggered(int linenum) const n } -//------------------------------------------------- -// execute_burn - called after we consume a bunch -// of cycles for artifical reasons (such as -// spinning devices for performance optimization) -//------------------------------------------------- - -void device_execute_interface::execute_burn(s32 cycles) -{ - // by default, do nothing -} - - //------------------------------------------------- // execute_set_input - called when a synchronized // input is changed diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 51973ad19cca0..81c337645bb74 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -109,7 +109,6 @@ class device_execute_interface : public device_interface u32 max_cycles() const { return execute_max_cycles(); } attotime cycles_to_attotime(u64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); } u64 attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); } - u32 input_lines() const { return execute_input_lines(); } u32 default_irq_vector(int linenum) const { return execute_default_irq_vector(linenum); } bool input_edge_triggered(int linenum) const { return execute_input_edge_triggered(linenum); } @@ -201,13 +200,11 @@ class device_execute_interface : public device_interface virtual u32 execute_max_cycles() const noexcept; // input line information getters - virtual u32 execute_input_lines() const noexcept; virtual u32 execute_default_irq_vector(int linenum) const noexcept; virtual bool execute_input_edge_triggered(int linenum) const noexcept; // optional operation overrides virtual void execute_run() = 0; - virtual void execute_burn(s32 cycles); virtual void execute_set_input(int linenum, int state); // interface-level overrides diff --git a/src/emu/emumem.h b/src/emu/emumem.h index ce55ed86a3607..4c48355975731 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -75,6 +75,7 @@ using address_map_constructor = named_delegate; struct data_accessors { u8 (*read_byte)(address_space &space, offs_t address); + u8 (*read_byte_masked)(address_space &space, offs_t address, u8 mask); u16 (*read_word)(address_space &space, offs_t address); u16 (*read_word_masked)(address_space &space, offs_t address, u16 mask); u32 (*read_dword)(address_space &space, offs_t address); @@ -83,6 +84,7 @@ struct data_accessors u64 (*read_qword_masked)(address_space &space, offs_t address, u64 mask); void (*write_byte)(address_space &space, offs_t address, u8 data); + void (*write_byte_masked)(address_space &space, offs_t address, u8 data, u8 mask); void (*write_word)(address_space &space, offs_t address, u16 data); void (*write_word_masked)(address_space &space, offs_t address, u16 data, u16 mask); void (*write_dword)(address_space &space, offs_t address, u32 data); @@ -1731,6 +1733,7 @@ template class memory_ auto lwopf() { return [this](offs_t offset, NativeType mask) -> u16 { return lookup_write_native_flags(offset, mask); }; } u8 read_byte(offs_t address) { if constexpr(Width == 0) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xff); } + u8 read_byte(offs_t address, u8 mask) { return memory_read_generic(rop(), address, mask); } u16 read_word(offs_t address) { if constexpr(Width == 1) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xffff); } u16 read_word(offs_t address, u16 mask) { return memory_read_generic(rop(), address, mask); } u16 read_word_unaligned(offs_t address) { return memory_read_generic(rop(), address, 0xffff); } @@ -1745,6 +1748,7 @@ template class memory_ u64 read_qword_unaligned(offs_t address, u64 mask) { return memory_read_generic(rop(), address, mask); } void write_byte(offs_t address, u8 data) { if constexpr(Width == 0) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xff); } + void write_byte(offs_t address, u8 data, u8 mask) { memory_write_generic(wop(), address, data, mask); } void write_word(offs_t address, u16 data) { if constexpr(Width == 1) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xffff); } void write_word(offs_t address, u16 data, u16 mask) { memory_write_generic(wop(), address, data, mask); } void write_word_unaligned(offs_t address, u16 data) { memory_write_generic(wop(), address, data, 0xffff); } @@ -1760,6 +1764,7 @@ template class memory_ std::pair read_byte_flags(offs_t address) { if constexpr(Width == 0) return read_native_flags(address & ~NATIVE_MASK); else return memory_read_generic_flags(ropf(), address, 0xff); } + std::pair read_byte_flags(offs_t address, u8 mask) { return memory_read_generic_flags(ropf(), address, mask); } std::pair read_word_flags(offs_t address) { if constexpr(Width == 1) return read_native_flags(address & ~NATIVE_MASK); else return memory_read_generic_flags(ropf(), address, 0xffff); } std::pair read_word_flags(offs_t address, u16 mask) { return memory_read_generic_flags(ropf(), address, mask); } std::pair read_word_unaligned_flags(offs_t address) { return memory_read_generic_flags(ropf(), address, 0xffff); } @@ -1774,6 +1779,7 @@ template class memory_ std::pair read_qword_unaligned_flags(offs_t address, u64 mask) { return memory_read_generic_flags(ropf(), address, mask); } u16 write_byte_flags(offs_t address, u8 data) { if constexpr(Width == 0) return write_native_flags(address & ~NATIVE_MASK, data); else return memory_write_generic_flags(wopf(), address, data, 0xff); } + u16 write_byte_flags(offs_t address, u8 data, u8 mask) { return memory_write_generic_flags(wopf(), address, data, mask); } u16 write_word_flags(offs_t address, u16 data) { if constexpr(Width == 1) return write_native_flags(address & ~NATIVE_MASK, data); else return memory_write_generic_flags(wopf(), address, data, 0xffff); } u16 write_word_flags(offs_t address, u16 data, u16 mask) { return memory_write_generic_flags(wopf(), address, data, mask); } u16 write_word_unaligned_flags(offs_t address, u16 data) { return memory_write_generic_flags(wopf(), address, data, 0xffff); } @@ -1788,6 +1794,7 @@ template class memory_ u16 write_qword_unaligned_flags(offs_t address, u64 data, u64 mask) { return memory_write_generic_flags(wopf(), address, data, mask); } u16 lookup_read_byte_flags(offs_t address) { if constexpr(Width == 0) return lookup_read_native_flags(address & ~NATIVE_MASK); else return lookup_memory_read_generic_flags(lropf(), address, 0xff); } + u16 lookup_read_byte_flags(offs_t address, u8 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_read_word_flags(offs_t address) { if constexpr(Width == 1) return lookup_read_native_flags(address & ~NATIVE_MASK); else return lookup_memory_read_generic_flags(lropf(), address, 0xffff); } u16 lookup_read_word_flags(offs_t address, u16 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_read_word_unaligned_flags(offs_t address) { return lookup_memory_read_generic_flags(lropf(), address, 0xffff); } @@ -1802,6 +1809,7 @@ template class memory_ u16 lookup_read_qword_unaligned_flags(offs_t address, u64 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_write_byte_flags(offs_t address) { if constexpr(Width == 0) return lookup_write_native_flags(address & ~NATIVE_MASK); else return lookup_memory_write_generic_flags(lwopf(), address, 0xff); } + u16 lookup_write_byte_flags(offs_t address, u8 mask) { return lookup_memory_write_generic_flags(lwopf(), address, mask); } u16 lookup_write_word_flags(offs_t address) { if constexpr(Width == 1) return lookup_write_native_flags(address & ~NATIVE_MASK); else return lookup_memory_write_generic_flags(lwopf(), address, 0xffff); } u16 lookup_write_word_flags(offs_t address, u16 mask) { return lookup_memory_write_generic_flags(lwopf(), address, mask); } u16 lookup_write_word_unaligned_flags(offs_t address) { return lookup_memory_write_generic_flags(lwopf(), address, 0xffff); } @@ -1922,6 +1930,7 @@ template class memory_access_cach auto lwopf() { return [this](offs_t offset, NativeType mask) -> u16 { return lookup_write_native_flags(offset, mask); }; } u8 read_byte(offs_t address) { if constexpr(Width == 0) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xff); } + u8 read_byte(offs_t address, u8 mask) { return memory_read_generic(rop(), address, mask); } u16 read_word(offs_t address) { if constexpr(Width == 1) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xffff); } u16 read_word(offs_t address, u16 mask) { return memory_read_generic(rop(), address, mask); } u16 read_word_unaligned(offs_t address) { return memory_read_generic(rop(), address, 0xffff); } @@ -1936,6 +1945,7 @@ template class memory_access_cach u64 read_qword_unaligned(offs_t address, u64 mask) { return memory_read_generic(rop(), address, mask); } void write_byte(offs_t address, u8 data) { if constexpr(Width == 0) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xff); } + void write_byte(offs_t address, u8 data, u8 mask) { memory_write_generic(wop(), address, data, mask); } void write_word(offs_t address, u16 data) { if constexpr(Width == 1) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xffff); } void write_word(offs_t address, u16 data, u16 mask) { memory_write_generic(wop(), address, data, mask); } void write_word_unaligned(offs_t address, u16 data) { memory_write_generic(wop(), address, data, 0xffff); } @@ -1951,6 +1961,7 @@ template class memory_access_cach std::pair read_byte_flags(offs_t address) { if constexpr(Width == 0) return read_native_flags(address & ~NATIVE_MASK); else return memory_read_generic_flags(ropf(), address, 0xff); } + std::pair read_byte_flags(offs_t address, u8 mask) { return memory_read_generic_flags(ropf(), address, mask); } std::pair read_word_flags(offs_t address) { if constexpr(Width == 1) return read_native_flags(address & ~NATIVE_MASK); else return memory_read_generic_flags(ropf(), address, 0xffff); } std::pair read_word_flags(offs_t address, u16 mask) { return memory_read_generic_flags(ropf(), address, mask); } std::pair read_word_unaligned_flags(offs_t address) { return memory_read_generic_flags(ropf(), address, 0xffff); } @@ -1965,6 +1976,7 @@ template class memory_access_cach std::pair read_qword_unaligned_flags(offs_t address, u64 mask) { return memory_read_generic_flags(ropf(), address, mask); } u16 write_byte_flags(offs_t address, u8 data) { if constexpr(Width == 0) return write_native_flags(address & ~NATIVE_MASK, data); else return memory_write_generic_flags(wopf(), address, data, 0xff); } + u16 write_byte_flags(offs_t address, u8 data, u8 mask) { return memory_write_generic_flags(wopf(), address, data, mask); } u16 write_word_flags(offs_t address, u16 data) { if constexpr(Width == 1) return write_native_flags(address & ~NATIVE_MASK, data); else return memory_write_generic_flags(wopf(), address, data, 0xffff); } u16 write_word_flags(offs_t address, u16 data, u16 mask) { return memory_write_generic_flags(wopf(), address, data, mask); } u16 write_word_unaligned_flags(offs_t address, u16 data) { return memory_write_generic_flags(wopf(), address, data, 0xffff); } @@ -1980,6 +1992,7 @@ template class memory_access_cach u16 lookup_read_byte_flags(offs_t address) { if constexpr(Width == 0) return lookup_read_native_flags(address & ~NATIVE_MASK); else return lookup_memory_read_generic_flags(lropf(), address, 0xff); } + u16 lookup_read_byte_flags(offs_t address, u8 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_read_word_flags(offs_t address) { if constexpr(Width == 1) return lookup_read_native_flags(address & ~NATIVE_MASK); else return lookup_memory_read_generic_flags(lropf(), address, 0xffff); } u16 lookup_read_word_flags(offs_t address, u16 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_read_word_unaligned_flags(offs_t address) { return lookup_memory_read_generic_flags(lropf(), address, 0xffff); } @@ -1994,6 +2007,7 @@ template class memory_access_cach u16 lookup_read_qword_unaligned_flags(offs_t address, u64 mask) { return lookup_memory_read_generic_flags(lropf(), address, mask); } u16 lookup_write_byte_flags(offs_t address) { if constexpr(Width == 0) return lookup_write_native_flags(address & ~NATIVE_MASK); else return lookup_memory_write_generic_flags(lwopf(), address, 0xff); } + u16 lookup_write_byte_flags(offs_t address, u8 mask) { return lookup_memory_write_generic_flags(lwopf(), address, mask); } u16 lookup_write_word_flags(offs_t address) { if constexpr(Width == 1) return lookup_write_native_flags(address & ~NATIVE_MASK); else return lookup_memory_write_generic_flags(lwopf(), address, 0xffff); } u16 lookup_write_word_flags(offs_t address, u16 mask) { return lookup_memory_write_generic_flags(lwopf(), address, mask); } u16 lookup_write_word_unaligned_flags(offs_t address) { return lookup_memory_write_generic_flags(lwopf(), address, 0xffff); } @@ -2412,6 +2426,7 @@ class address_space : public address_space_installer // read accessors virtual u8 read_byte(offs_t address) = 0; + virtual u8 read_byte(offs_t address, u8 mask) = 0; virtual u16 read_word(offs_t address) = 0; virtual u16 read_word(offs_t address, u16 mask) = 0; virtual u16 read_word_unaligned(offs_t address) = 0; @@ -2427,6 +2442,7 @@ class address_space : public address_space_installer // write accessors virtual void write_byte(offs_t address, u8 data) = 0; + virtual void write_byte(offs_t address, u8 data, u8 mask) = 0; virtual void write_word(offs_t address, u16 data) = 0; virtual void write_word(offs_t address, u16 data, u16 mask) = 0; virtual void write_word_unaligned(offs_t address, u16 data) = 0; diff --git a/src/emu/emumem_aspace.cpp b/src/emu/emumem_aspace.cpp index b0d00d6fca894..656cec8d7d943 100644 --- a/src/emu/emumem_aspace.cpp +++ b/src/emu/emumem_aspace.cpp @@ -314,6 +314,7 @@ class address_space_specific : public address_space virtual void accessors(data_accessors &accessors) const override { accessors.read_byte = reinterpret_cast(&read_byte_static); + accessors.read_byte_masked = reinterpret_cast(&read_byte_masked_static); accessors.read_word = reinterpret_cast(&read_word_static); accessors.read_word_masked = reinterpret_cast(&read_word_masked_static); accessors.read_dword = reinterpret_cast(&read_dword_static); @@ -321,6 +322,7 @@ class address_space_specific : public address_space accessors.read_qword = reinterpret_cast(&read_qword_static); accessors.read_qword_masked = reinterpret_cast(&read_qword_masked_static); accessors.write_byte = reinterpret_cast(&write_byte_static); + accessors.write_byte_masked = reinterpret_cast(&write_byte_masked_static); accessors.write_word = reinterpret_cast(&write_word_static); accessors.write_word_masked = reinterpret_cast(&write_word_masked_static); accessors.write_dword = reinterpret_cast(&write_dword_static); @@ -370,6 +372,7 @@ class address_space_specific : public address_space // virtual access to these functions u8 read_byte(offs_t address) override { if constexpr(Width == 0) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xff); } + u8 read_byte(offs_t address, u8 mask) override { return memory_read_generic(rop(), address, mask); } u16 read_word(offs_t address) override { if constexpr(Width == 1) return read_native(address & ~NATIVE_MASK); else return memory_read_generic(rop(), address, 0xffff); } u16 read_word(offs_t address, u16 mask) override { return memory_read_generic(rop(), address, mask); } u16 read_word_unaligned(offs_t address) override { return memory_read_generic(rop(), address, 0xffff); } @@ -384,6 +387,7 @@ class address_space_specific : public address_space u64 read_qword_unaligned(offs_t address, u64 mask) override { return memory_read_generic(rop(), address, mask); } void write_byte(offs_t address, u8 data) override { if constexpr(Width == 0) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xff); } + void write_byte(offs_t address, u8 data, u8 mask) override { memory_write_generic(wop(), address, data, mask); } void write_word(offs_t address, u16 data) override { if constexpr(Width == 1) write_native(address & ~NATIVE_MASK, data); else memory_write_generic(wop(), address, data, 0xffff); } void write_word(offs_t address, u16 data, u16 mask) override { memory_write_generic(wop(), address, data, mask); } void write_word_unaligned(offs_t address, u16 data) override { memory_write_generic(wop(), address, data, 0xffff); } @@ -397,9 +401,9 @@ class address_space_specific : public address_space void write_qword_unaligned(offs_t address, u64 data) override { memory_write_generic(wop(), address, data, 0xffffffffffffffffU); } void write_qword_unaligned(offs_t address, u64 data, u64 mask) override { memory_write_generic(wop(), address, data, mask); } - // static access to these functions static u8 read_byte_static(this_type &space, offs_t address) { return Width == 0 ? space.read_native(address & ~NATIVE_MASK) : memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, 0xff); } + static u8 read_byte_masked_static(this_type &space, offs_t address, u8 mask) { return memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, mask); } static u16 read_word_static(this_type &space, offs_t address) { return Width == 1 ? space.read_native(address & ~NATIVE_MASK) : memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, 0xffff); } static u16 read_word_masked_static(this_type &space, offs_t address, u16 mask) { return memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, mask); } static u32 read_dword_static(this_type &space, offs_t address) { return Width == 2 ? space.read_native(address & ~NATIVE_MASK) : memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, 0xffffffff); } @@ -407,6 +411,7 @@ class address_space_specific : public address_space static u64 read_qword_static(this_type &space, offs_t address) { return Width == 3 ? space.read_native(address & ~NATIVE_MASK) : memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, 0xffffffffffffffffU); } static u64 read_qword_masked_static(this_type &space, offs_t address, u64 mask) { return memory_read_generic([&space](offs_t offset, NativeType mask) -> NativeType { return space.read_native(offset, mask); }, address, mask); } static void write_byte_static(this_type &space, offs_t address, u8 data) { if (Width == 0) space.write_native(address & ~NATIVE_MASK, data); else memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, 0xff); } + static void write_byte_masked_static(this_type &space, offs_t address, u8 data, u8 mask) { memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, mask); } static void write_word_static(this_type &space, offs_t address, u16 data) { if (Width == 1) space.write_native(address & ~NATIVE_MASK, data); else memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, 0xffff); } static void write_word_masked_static(this_type &space, offs_t address, u16 data, u16 mask) { memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, mask); } static void write_dword_static(this_type &space, offs_t address, u32 data) { if (Width == 2) space.write_native(address & ~NATIVE_MASK, data); else memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, 0xffffffff); } diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index 9c69c51f4c87a..cba5646ec816e 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -206,6 +206,7 @@ enum ioport_type : osd::u32 IPT_SLOT_STOP2, IPT_SLOT_STOP3, IPT_SLOT_STOP4, + IPT_SLOT_STOP5, IPT_SLOT_STOP_ALL, IPT_GAMBLING_LAST, diff --git a/src/emu/inpttype.ipp b/src/emu/inpttype.ipp index 8c217a1d39c8f..4749827c3d558 100644 --- a/src/emu/inpttype.ipp +++ b/src/emu/inpttype.ipp @@ -132,6 +132,7 @@ namespace { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP2, N_p("input-name", "Stop Reel 2"), input_seq(KEYCODE_C) ) \ INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP3, N_p("input-name", "Stop Reel 3"), input_seq(KEYCODE_V) ) \ INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP4, N_p("input-name", "Stop Reel 4"), input_seq(KEYCODE_B) ) \ + INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP5, N_p("input-name", "Stop Reel 5"), input_seq(KEYCODE_N) ) \ INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP_ALL, N_p("input-name", "Stop All Reels"), input_seq(KEYCODE_Z) ) \ CORE_INPUT_TYPES_END() diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index c36d5dd046788..67cde9f3bec3a 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -1413,12 +1413,11 @@ void ioport_field::expand_diplocation(const char *location, std::string &errorbu } // then verify the number of bits in the mask matches - ioport_value temp; - int bits; - for (bits = 0, temp = m_mask; temp != 0 && bits < 32; bits++) - temp &= temp - 1; - if (bits != entries) + int const bits = population_count_32(m_mask); + if (bits > entries) errorbuf.append(string_format("Switch location '%s' does not describe enough bits for mask %X\n", location, m_mask)); + else if (bits < entries) + errorbuf.append(string_format("Switch location '%s' describes too many bits for mask %X\n", location, m_mask)); } diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 42ff9c69608ae..62cf84e57889d 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1130,10 +1130,6 @@ class ioport_configurer #define UCHAR_MAMEKEY(code) (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code) -// macro for a read callback function (PORT_CUSTOM) -#define CUSTOM_INPUT_MEMBER(name) ioport_value name() -#define DECLARE_CUSTOM_INPUT_MEMBER(name) ioport_value name() - // macro for port write callback functions (PORT_CHANGED) #define INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, u32 param, ioport_value oldval, ioport_value newval) #define DECLARE_INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, u32 param, ioport_value oldval, ioport_value newval) diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 681f64cd2636f..3a83ea2a1977c 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -455,22 +455,19 @@ void natural_keyboard::post_char(char32_t ch, bool normalize_crlf) // post - post a unicode encoded string //------------------------------------------------- -void natural_keyboard::post(const char32_t *text, size_t length, const attotime &rate) +void natural_keyboard::post(std::u32string_view text, const attotime &rate) { // set the fixed rate m_current_rate = rate; - // 0 length means strlen - if (length == 0) - for (const char32_t *scan = text; *scan != 0; scan++) - length++; - // iterate over characters or until the buffer is full up - while (length > 0 && !full()) + for (char32_t ch : text) { + if (full()) + break; + // fetch next character - post_char(*text++, true); - length--; + post_char(ch, true); } } @@ -479,21 +476,17 @@ void natural_keyboard::post(const char32_t *text, size_t length, const attotime // post_utf8 - post a UTF-8 encoded string //------------------------------------------------- -void natural_keyboard::post_utf8(const char *text, size_t length, const attotime &rate) +void natural_keyboard::post_utf8(std::string_view text, const attotime &rate) { // set the fixed rate m_current_rate = rate; - // 0-length means strlen - if (length == 0) - length = strlen(text); - // iterate until out of characters - while (length > 0) + while (!text.empty()) { // decode the next character char32_t uc; - int count = uchar_from_utf8(&uc, text, length); + int count = uchar_from_utf8(&uc, text); if (count < 0) { count = 1; @@ -502,83 +495,71 @@ void natural_keyboard::post_utf8(const char *text, size_t length, const attotime // append to the buffer post_char(uc, true); - text += count; - length -= count; + text.remove_prefix(count); } } -void natural_keyboard::post_utf8(std::string_view text, const attotime &rate) -{ - if (!text.empty()) - post_utf8(text.data(), text.size(), rate); -} - - //------------------------------------------------- // post_coded - post a coded string //------------------------------------------------- -void natural_keyboard::post_coded(const char *text, size_t length, const attotime &rate) +void natural_keyboard::post_coded(std::string_view text, const attotime &rate) { + using namespace std::literals; static const struct { - const char *key; + std::string_view key; char32_t code; } codes[] = { - { "BACKSPACE", 8 }, - { "BS", 8 }, - { "BKSP", 8 }, - { "DEL", UCHAR_MAMEKEY(DEL) }, - { "DELETE", UCHAR_MAMEKEY(DEL) }, - { "END", UCHAR_MAMEKEY(END) }, - { "ENTER", 13 }, - { "ESC", '\033' }, - { "HOME", UCHAR_MAMEKEY(HOME) }, - { "INS", UCHAR_MAMEKEY(INSERT) }, - { "INSERT", UCHAR_MAMEKEY(INSERT) }, - { "PGDN", UCHAR_MAMEKEY(PGDN) }, - { "PGUP", UCHAR_MAMEKEY(PGUP) }, - { "SPACE", 32 }, - { "TAB", 9 }, - { "F1", UCHAR_MAMEKEY(F1) }, - { "F2", UCHAR_MAMEKEY(F2) }, - { "F3", UCHAR_MAMEKEY(F3) }, - { "F4", UCHAR_MAMEKEY(F4) }, - { "F5", UCHAR_MAMEKEY(F5) }, - { "F6", UCHAR_MAMEKEY(F6) }, - { "F7", UCHAR_MAMEKEY(F7) }, - { "F8", UCHAR_MAMEKEY(F8) }, - { "F9", UCHAR_MAMEKEY(F9) }, - { "F10", UCHAR_MAMEKEY(F10) }, - { "F11", UCHAR_MAMEKEY(F11) }, - { "F12", UCHAR_MAMEKEY(F12) }, - { "QUOTE", '\"' } + { "BACKSPACE"sv, 8 }, + { "BS"sv, 8 }, + { "BKSP"sv, 8 }, + { "DEL"sv, UCHAR_MAMEKEY(DEL) }, + { "DELETE"sv, UCHAR_MAMEKEY(DEL) }, + { "END"sv, UCHAR_MAMEKEY(END) }, + { "ENTER"sv, 13 }, + { "ESC"sv, '\033' }, + { "HOME"sv, UCHAR_MAMEKEY(HOME) }, + { "INS"sv, UCHAR_MAMEKEY(INSERT) }, + { "INSERT"sv, UCHAR_MAMEKEY(INSERT) }, + { "PGDN"sv, UCHAR_MAMEKEY(PGDN) }, + { "PGUP"sv, UCHAR_MAMEKEY(PGUP) }, + { "SPACE"sv, 32 }, + { "TAB"sv, 9 }, + { "F1"sv, UCHAR_MAMEKEY(F1) }, + { "F2"sv, UCHAR_MAMEKEY(F2) }, + { "F3"sv, UCHAR_MAMEKEY(F3) }, + { "F4"sv, UCHAR_MAMEKEY(F4) }, + { "F5"sv, UCHAR_MAMEKEY(F5) }, + { "F6"sv, UCHAR_MAMEKEY(F6) }, + { "F7"sv, UCHAR_MAMEKEY(F7) }, + { "F8"sv, UCHAR_MAMEKEY(F8) }, + { "F9"sv, UCHAR_MAMEKEY(F9) }, + { "F10"sv, UCHAR_MAMEKEY(F10) }, + { "F11"sv, UCHAR_MAMEKEY(F11) }, + { "F12"sv, UCHAR_MAMEKEY(F12) }, + { "QUOTE"sv, '\"' } }; // set the fixed rate m_current_rate = rate; - // 0-length means strlen - if (length == 0) - length = strlen(text); - // iterate through the source string - size_t curpos = 0; - while (curpos < length) + while (!text.empty()) { // extract next character - char32_t ch = text[curpos]; - size_t increment = 1; + char32_t ch = text.front(); + std::string_view::size_type increment = 1; // look for escape characters if (ch == '{') for (auto & code : codes) { - size_t keylen = strlen(code.key); - if (curpos + keylen + 2 <= length) - if (core_strnicmp(code.key, &text[curpos + 1], keylen) == 0 && text[curpos + keylen + 1] == '}') + std::string_view::size_type keylen = code.key.length(); + if (keylen + 2 <= text.length()) + if (util::strequpper(text.substr(1, keylen), code.key) && text[keylen + 1] == '}') { ch = code.code; increment = keylen + 2; @@ -588,18 +569,11 @@ void natural_keyboard::post_coded(const char *text, size_t length, const attotim // if we got a code, post it if (ch != 0) post_char(ch); - curpos += increment; + text.remove_prefix(increment); } } -void natural_keyboard::post_coded(std::string_view text, const attotime &rate) -{ - if (!text.empty()) - post_coded(text.data(), text.size(), rate); -} - - //------------------------------------------------- // paste - does a paste from the keyboard //------------------------------------------------- diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index c14de66fa6605..6903f662e477a 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -62,10 +62,8 @@ class natural_keyboard // posting void post_char(char32_t ch, bool normalize_crlf = false); - void post(const char32_t *text, size_t length = 0, const attotime &rate = attotime::zero); - void post_utf8(const char *text, size_t length = 0, const attotime &rate = attotime::zero); + void post(std::u32string_view text, const attotime &rate = attotime::zero); void post_utf8(std::string_view text, const attotime &rate = attotime::zero); - void post_coded(const char *text, size_t length = 0, const attotime &rate = attotime::zero); void post_coded(std::string_view text, const attotime &rate = attotime::zero); void paste(); diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 25b0e4aa5d2f2..d4ea77f184dc4 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -57,461 +57,463 @@ const double XTAL::known_xtals[] = { /* Frequency Sugarvassed Examples ----------- ---------------------- ---------------------------------------- */ - 32'768, /* 32.768_kHz_XTAL Used to drive RTC chips */ - 38'400, /* 38.4_kHz_XTAL Resonator */ - 384'000, /* 384_kHz_XTAL Resonator - Commonly used for driving OKI MSM5205 */ - 400'000, /* 400_kHz_XTAL Resonator - OKI MSM5205 on Great Swordman h/w */ - 430'000, /* 430_kHz_XTAL Resonator */ - 455'000, /* 455_kHz_XTAL Resonator - OKI MSM5205 on Gladiator h/w */ - 500'000, /* 500_kHz_XTAL Resonator - MIDI clock on various synthesizers (31250 * 16) */ - 512'000, /* 512_kHz_XTAL Resonator - Toshiba TC8830F */ - 600'000, /* 600_kHz_XTAL - */ - 640'000, /* 640_kHz_XTAL Resonator - NEC UPD7759, Texas Instruments Speech Chips @ 8khz */ - 960'000, /* 960_kHz_XTAL Resonator - Xerox Notetaker Keyboard UART */ - 1'000'000, /* 1_MHz_XTAL Used to drive OKI M6295 chips */ - 1'008'000, /* 1.008_MHz_XTAL Acorn Microcomputer (System 1) */ - 1'056'000, /* 1.056_MHz_XTAL Resonator - OKI M6295 on Trio The Punch h/w */ - 1'294'400, /* 1.2944_MHz_XTAL BBN BitGraph PSG */ - 1'600'000, /* 1.6_MHz_XTAL Resonator - Roland TR-707 */ - 1'689'600, /* 1.6896_MHz_XTAL Diablo 1355WP Printer */ - 1'750'000, /* 1.75_MHz_XTAL RCA CDP1861 */ - 1'797'100, /* 1.7971_MHz_XTAL SWTPC 6800 (with MIKBUG) */ - 1'843'200, /* 1.8432_MHz_XTAL Bondwell 12/14 */ - 2'000'000, /* 2_MHz_XTAL - */ - 2'012'160, /* 2.01216_MHz_XTAL Cidelsa Draco sound board */ - 2'097'152, /* 2.097152_MHz_XTAL Icatel 1995 - Brazilian public payphone */ - 2'250'000, /* 2.25_MHz_XTAL Resonator - YM2154 on Yamaha PSR-60 & PSR-70 */ - 2'376'000, /* 2.376_MHz_XTAL CIT-101 keyboard */ - 2'457'600, /* 2.4576_MHz_XTAL Atari ST MFP */ - 2'500'000, /* 2.5_MHz_XTAL Janken Man units */ - 2'600'000, /* 2.6_MHz_XTAL Sharp PC-1500 */ - 2'700'000, /* 2.7_MHz_XTAL Resonator - YM2154 on Yamaha RX15 */ - 2'950'000, /* 2.95_MHz_XTAL Playmatic MPU-C, MPU-III & Sound-3 */ - 3'000'000, /* 3_MHz_XTAL Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs */ - 3'072'000, /* 3.072_MHz_XTAL INS 8520 input clock rate */ - 3'120'000, /* 3.12_MHz_XTAL SP0250 clock on Gottlieb games */ - 3'276'800, /* 3.2768_MHz_XTAL SP0256 clock in Speech Synthesis for Dragon 32 */ - 3'300'000, /* 3.3_MHz_XTAL LC 80 (export) */ - 3'521'280, /* 3.52128_MHz_XTAL RCA COSMAC VIP */ - 3'546'800, /* 3.5468_MHz_XTAL Atari 400 PAL */ - 3'546'894, /* 3.546894_MHz_XTAL Atari 2600 PAL */ - 3'547'000, /* 3.547_MHz_XTAL Philips G7200, Philips C7240 */ - 3'562'500, /* 3.5625_MHz_XTAL Jopac JO7400 */ - 3'570'000, /* 3.57_MHz_XTAL Telmac TMC-600 */ - 3'578'640, /* 3.57864_MHz_XTAL Atari Portfolio PCD3311T */ - 3'579'000, /* 3.579_MHz_XTAL BeebOPL */ - 3'579'545, /* 3.579545_MHz_XTAL NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */ - 3'579'575, /* 3.579575_MHz_XTAL Atari 2600 NTSC */ - 3'680'000, /* 3.68_MHz_XTAL Resonator - Baud rate clock for the 6551 in the MTU-130 */ - 3'686'400, /* 3.6864_MHz_XTAL Baud rate clock for MC68681 and similar UARTs */ - 3'840'000, /* 3.84_MHz_XTAL Fairlight CMI Alphanumeric Keyboard */ - 3'900'000, /* 3.9_MHz_XTAL Resonator - Used on some Fidelity boards */ - 3'932'160, /* 3.93216_MHz_XTAL Apple Lisa COP421 (197-0016A) */ - 4'000'000, /* 4_MHz_XTAL - */ - 4'028'000, /* 4.028_MHz_XTAL Sony SMC-777 */ - 4'032'000, /* 4.032_MHz_XTAL GRiD Compass modem board */ - 4'096'000, /* 4.096_MHz_XTAL Used to drive OKI M9810 chips */ - 4'194'304, /* 4.194304_MHz_XTAL Used to drive MC146818 / Nintendo Game Boy */ - 4'220'000, /* 4.220_MHz_XTAL Used to drive OKI M6295 chips on some Namco boards, usually with /4 divider */ - 4'224'000, /* 4.224_MHz_XTAL Used to drive OKI M6295 chips, usually with /4 divider */ - 4'410'000, /* 4.41_MHz_XTAL Pioneer PR-8210 ldplayer */ - 4'433'610, /* 4.43361_MHz_XTAL Cidelsa Draco */ - 4'433'619, /* 4.433619_MHz_XTAL PAL color subcarrier (technically 4.43361875mhz)*/ - 4'608'000, /* 4.608_MHz_XTAL Luxor ABC-77 keyboard (Keytronic custom part #48-300-107 is equivalent) */ - 4'915'200, /* 4.9152_MHz_XTAL - */ - 4'952'000, /* 4.952_MHz_XTAL IGS M036 based mahjong games, for TT5665 sound chip */ - 5'000'000, /* 5_MHz_XTAL Mutant Night */ - 5'068'800, /* 5.0688_MHz_XTAL Usually used as MC2661 or COM8116 baud rate clock */ - 5'185'000, /* 5.185_MHz_XTAL Intel INTELLEC® 4 */ - 5'370'000, /* 5.37_MHz_XTAL HP 95LX */ - 5'460'000, /* 5.46_MHz_XTAL ec1840 and ec1841 keyboard */ - 5'500'000, /* 5.5_MHz_XTAL Yamaha PSS-480 */ - 5'529'600, /* 5.5296_MHz_XTAL Kontron PSI98 keyboard */ - 5'626'000, /* 5.626_MHz_XTAL RCA CDP1869 PAL dot clock */ - 5'659'200, /* 5.6592_MHz_XTAL Digilog 320 dot clock */ - 5'670'000, /* 5.67_MHz_XTAL RCA CDP1869 NTSC dot clock */ - 5'714'300, /* 5.7143_MHz_XTAL Cidelsa Destroyer, TeleVideo serial keyboards */ - 5'856'000, /* 5.856_MHz_XTAL HP 3478A Multimeter */ - 5'911'000, /* 5.911_MHz_XTAL Philips Videopac Plus G7400 */ - 5'990'400, /* 5.9904_MHz_XTAL Luxor ABC 800 keyboard (Keytronic custom part #48-300-008 is equivalent) */ - 6'000'000, /* 6_MHz_XTAL American Poker II, Taito SJ System */ - 6'048'000, /* 6.048_MHz_XTAL Hektor II */ - 6'144'000, /* 6.144_MHz_XTAL Used on Alpha Denshi early 80's games sound board, Casio FP-200 and Namco Universal System 16 */ - 6'400'000, /* 6.4_MHz_XTAL Textel Compact */ - 6'500'000, /* 6.5_MHz_XTAL Jupiter Ace, Roland QDD interface */ - 6'880'000, /* 6.88_MHz_XTAL Barcrest MPU4 */ - 6'900'000, /* 6.9_MHz_XTAL BBN BitGraph CPU */ - 7'000'000, /* 7_MHz_XTAL Jaleco Mega System PCBs */ - 7'056'000, /* 7.056_MHz_XTAL Alesis QS FXCHIP (LCM of 44.1 kHz and 48 kHz) */ - 7'159'090, /* 7.15909_MHz_XTAL Blood Bros (2x NTSC subcarrier) */ - 7'200'000, /* 7.2_MHz_XTAL Novag Constellation (later models, with /2 divider), Kawai K1 keyscan IC */ - 7'372'800, /* 7.3728_MHz_XTAL - */ - 7'680'000, /* 7.68_MHz_XTAL Psion Series 3 */ - 7'864'300, /* 7.8643_MHz_XTAL Used on InterFlip games as video clock */ - 7'987'000, /* 7.987_MHz_XTAL PC9801-86 YM2608 clock */ - 7'995'500, /* 7.9955_MHz_XTAL Used on Electronic Devices Italy Galaxy Gunners sound board */ - 8'000'000, /* 8_MHz_XTAL Extremely common, used on 100's of PCBs */ - 8'200'000, /* 8.2_MHz_XTAL Universal Mr. Do - Model 8021 PCB */ - 8'388'000, /* 8.388_MHz_XTAL Nintendo Game Boy Color */ - 8'448'000, /* 8.448_MHz_XTAL Banpresto's Note Chance - Used to drive OKI M6295 chips, usually with /8 divider */ - 8'467'200, /* 8.4672_MHz_XTAL Subsino's Ying Hua Lian */ - 8'664'000, /* 8.664_MHz_XTAL Touchmaster */ - 8'700'000, /* 8.7_MHz_XTAL Tandberg TDV 2324 */ - 8'860'000, /* 8.86_MHz_XTAL AlphaTantel */ - 8'867'000, /* 8.867_MHz_XTAL Philips G7400 (~2x PAL subcarrier) */ - 8'867'236, /* 8.867236_MHz_XTAL RCA CDP1869 PAL color clock (~2x PAL subcarrier) */ - 8'867'238, /* 8.867238_MHz_XTAL ETI-660 (~2x PAL subcarrier) */ - 8'945'000, /* 8.945_MHz_XTAL Hit Me */ - 8'960'000, /* 8.96_MHz_XTAL Casio CZ-101 (divided by 2 for Music LSI) */ - 9'000'000, /* 9_MHz_XTAL Homedata PCBs */ - 9'216'000, /* 9.216_MHz_XTAL Univac UTS 20 */ - 9'263'750, /* 9.263750_MHz_XTAL Sai Yu Gou Ma Roku bootleg */ - 9'400'000, /* 9.4_MHz_XTAL Yamaha MU-5 and TG-100 */ - 9'426'500, /* 9.4265_MHz_XTAL Yamaha DX7, and DX9 */ - 9'600'000, /* 9.6_MHz_XTAL WD37C65 second clock (for 300 KB/sec rate) */ - 9'732'000, /* 9.732_MHz_XTAL CTA Invader */ - 9'828'000, /* 9.828_MHz_XTAL Universal PCBs */ - 9'830'400, /* 9.8304_MHz_XTAL Epson PX-8 */ - 9'832'000, /* 9.832_MHz_XTAL Robotron A7150 */ - 9'877'680, /* 9.87768_MHz_XTAL Microterm 420 */ - 9'987'000, /* 9.987_MHz_XTAL Crazy Balloon */ - 10'000'000, /* 10_MHz_XTAL - */ - 10'137'600, /* 10.1376_MHz_XTAL Wyse WY-100 */ - 10'240'000, /* 10.240_MHz_XTAL Stella 8085 based fruit machines */ - 10'245'000, /* 10.245_MHz_XTAL PES Speech box */ - 10'380'000, /* 10.38_MHz_XTAL Fairlight Q219 Lightpen/Graphics Card */ - 10'480'000, /* 10.48_MHz_XTAL System-80 (50 Hz) */ - 10'500'000, /* 10.5_MHz_XTAL Agat-7 */ - 10'595'000, /* 10.595_MHz_XTAL Mad Alien */ - 10'644'000, /* 10.644_MHz_XTAL Northwest Digitial Systems GP-19 */ - 10'644'500, /* 10.6445_MHz_XTAL TRS-80 Model I */ - 10'687'500, /* 10.6875_MHz_XTAL BBC Bridge Companion */ - 10'694'250, /* 10.69425_MHz_XTAL Xerox 820 */ - 10'717'200, /* 10.7172_MHz_XTAL Eltec EurocomII */ - 10'730'000, /* 10.73_MHz_XTAL Ruleta RE-900 VDP Clock */ - 10'733'000, /* 10.733_MHz_XTAL The Fairyland Story */ - 10'738'000, /* 10.738_MHz_XTAL Pokerout (poker+breakout) TMS9129 VDP Clock */ - 10'738'635, /* 10.738635_MHz_XTAL TMS9918 family (3x NTSC subcarrier) */ - 10'816'000, /* 10.816_MHz_XTAL Universal 1979-1980 (Cosmic Alien, etc) */ - 10'886'400, /* 10.8864_MHz_XTAL Systel System 100 */ - 10'920'000, /* 10.92_MHz_XTAL ADDS Viewpoint 60, Viewpoint A2 */ - 11'000'000, /* 11_MHz_XTAL Mario I8039 sound */ - 11'004'000, /* 11.004_MHz_XTAL TI 911 VDT */ - 11'059'200, /* 11.0592_MHz_XTAL Used with MCS-51 to generate common baud rates */ - 11'200'000, /* 11.2_MHz_XTAL New York, New York */ - 11'289'000, /* 11.289_MHz_XTAL Vanguard */ - 11'289'600, /* 11.2896_MHz_XTAL Frantic Fred */ - 11'400'000, /* 11.4_MHz_XTAL HP 9845 */ - 11'668'800, /* 11.6688_MHz_XTAL Gameplan pixel clock */ - 11'730'000, /* 11.73_MHz_XTAL Irem M-11 */ - 11'800'000, /* 11.8_MHz_XTAL IBM PC Music Feature Card */ - 11'980'800, /* 11.9808_MHz_XTAL Luxor ABC 80 */ - 12'000'000, /* 12_MHz_XTAL Extremely common, used on 100's of PCBs */ - 12'057'600, /* 12.0576_MHz_XTAL Poly 1 (38400 * 314) */ - 12'096'000, /* 12.096_MHz_XTAL Some early 80's Atari games */ - 12'288'000, /* 12.288_MHz_XTAL Sega Model 3 digital audio board */ - 12'292'000, /* 12.292_MHz_XTAL Northwest Digitial Systems GP-19 */ - 12'324'000, /* 12.324_MHz_XTAL Otrona Attache */ - 12'335'600, /* 12.3356_MHz_XTAL RasterOps ColorBoard 264 (~784x NTSC line rate) */ - 12'472'500, /* 12.4725_MHz_XTAL Bonanza's Mini Boy 7 */ - 12'480'000, /* 12.48_MHz_XTAL TRS-80 Model II */ - 12'500'000, /* 12.5_MHz_XTAL Red Alert audio board */ - 12'638'000, /* 12.638_MHz_XTAL Exidy Sorcerer */ - 12'672'000, /* 12.672_MHz_XTAL TRS-80 Model 4 80*24 video */ - 12'800'000, /* 12.8_MHz_XTAL Cave CV1000 */ - 12'854'400, /* 12.8544_MHz_XTAL Alphatronic P3 */ - 12'936'000, /* 12.936_MHz_XTAL CDC 721 */ - 12'979'200, /* 12.9792_MHz_XTAL Exidy 440 */ - 13'000'000, /* 13_MHz_XTAL STM Pied Piper dot clock */ - 13'300'000, /* 13.3_MHz_XTAL BMC bowling */ - 13'330'560, /* 13.33056_MHz_XTAL Taito L */ - 13'333'000, /* 13.333_MHz_XTAL Ojanko High School */ - 13'400'000, /* 13.4_MHz_XTAL TNK3, Ikari Warriors h/w */ - 13'478'400, /* 13.4784_MHz_XTAL TeleVideo 970 80-column display clock */ - 13'495'200, /* 13.4952_MHz_XTAL Used on Shadow Force pcb and maybe other Technos pcbs? */ - 13'500'000, /* 13.5_MHz_XTAL Microbee */ - 13'516'800, /* 13.5168_MHz_XTAL Kontron KDT6 */ - 13'560'000, /* 13.560_MHz_XTAL Tong Zi Maque */ - 13'608'000, /* 13.608_MHz_XTAL TeleVideo 910 & 925 */ - 13'824'000, /* 13.824_MHz_XTAL Robotron PC-1715 display circuit */ - 13'977'600, /* 13.9776_MHz_XTAL Kaypro II dot clock */ - 14'000'000, /* 14_MHz_XTAL - */ - 14'112'000, /* 14.112_MHz_XTAL Timex/Sinclair TS2068 */ - 14'192'640, /* 14.19264_MHz_XTAL Central Data 2650 */ - 14'218'000, /* 14.218_MHz_XTAL Dragon */ - 14'250'450, /* 14.25045_MHz_XTAL Apple II Europlus */ - 14'300'000, /* 14.3_MHz_XTAL Agat-7 */ - 14'314'000, /* 14.314_MHz_XTAL Taito TTL Board */ - 14'318'181, /* 14.318181_MHz_XTAL Extremely common, used on 100's of PCBs (4x NTSC subcarrier) */ - 14'349'600, /* 14.3496_MHz_XTAL Roland S-50 VDP */ - 14'469'000, /* 14.469_MHz_XTAL Esprit Systems Executive 10/102 */ - 14'580'000, /* 14.58_MHz_XTAL Fortune 32:16 Video Controller */ - 14'705'882, /* 14.705882_MHz_XTAL Aleck64 */ - 14'728'000, /* 14.728_MHz_XTAL ADM 36 */ - 14'742'800, /* 14.7428_MHz_XTAL ADM 23 */ - 14'745'000, /* 14.745_MHz_XTAL Synertek KTM-3 */ - 14'745'600, /* 14.7456_MHz_XTAL Namco System 12 & System Super 22/23 for JVS */ - 14'746'000, /* 14.746_MHz_XTAL Namco System 10 MGEXIO */ - 14'784'000, /* 14.784_MHz_XTAL Zenith Z-29 */ - 14'916'000, /* 14.916_MHz_XTAL ADDS Viewpoint 122 */ - 14'976'000, /* 14.976_MHz_XTAL CIT-101 80-column display clock */ - 15'000'000, /* 15_MHz_XTAL Sinclair QL, Amusco Poker */ - 15'148'800, /* 15.1488_MHz_XTAL Zentec 9002/9003 */ - 15'206'400, /* 15.2064_MHz_XTAL Falco TS-1 */ - 15'288'000, /* 15.288_MHz_XTAL DEC VT220 80-column display clock */ - 15'300'720, /* 15.30072_MHz_XTAL Microterm 420 */ - 15'360'000, /* 15.36_MHz_XTAL Visual 1050 */ - 15'400'000, /* 15.4_MHz_XTAL DVK KSM */ - 15'468'480, /* 15.46848_MHz_XTAL Bank Panic h/w, Sega G80 */ - 15'582'000, /* 15.582_MHz_XTAL Zentec Zephyr */ - 15'625'000, /* 15.625_MHz_XTAL Zaccaria The Invaders */ - 15'667'200, /* 15.6672_MHz_XTAL Apple Macintosh */ - 15'700'000, /* 15.7_MHz_XTAL Motogonki */ - 15'741'000, /* 15.741_MHz_XTAL DECmate II 80-column display clock */ - 15'897'600, /* 15.8976_MHz_XTAL IAI Swyft */ - 15'920'000, /* 15.92_MHz_XTAL HP Integral PC */ - 15'930'000, /* 15.93_MHz_XTAL ADM 12 */ - 15'974'400, /* 15.9744_MHz_XTAL Osborne 1 (9600 * 52 * 32) */ - 16'000'000, /* 16_MHz_XTAL Extremely common, used on 100's of PCBs */ - 16'097'280, /* 16.09728_MHz_XTAL DEC VT240 (1024 * 262 * 60) */ - 16'128'000, /* 16.128_MHz_XTAL Fujitsu FM-7 */ - 16'200'000, /* 16.2_MHz_XTAL Debut */ - 16'257'000, /* 16.257_MHz_XTAL IBM PC MDA & EGA */ - 16'313'000, /* 16.313_MHz_XTAL Micro-Term ERGO 201 */ - 16'364'000, /* 16.364_MHz_XTAL Corvus Concept */ - 16'384'000, /* 16.384_MHz_XTAL - */ - 16'400'000, /* 16.4_MHz_XTAL MS 6102 */ - 16'537'000, /* 16.537_MHz_XTAL Falco terminals 80-column clock */ - 16'572'000, /* 16.572_MHz_XTAL Micro-Term ACT-5A */ - 16'588'800, /* 16.5888_MHz_XTAL SM 7238 */ - 16'666'600, /* 16.6666_MHz_XTAL Firebeat GCU */ - 16'667'000, /* 16.667_MHz_XTAL Visual XDS-19P */ - 16'669'800, /* 16.6698_MHz_XTAL Qume QVT-102 */ - 16'670'000, /* 16.67_MHz_XTAL - */ - 16'777'216, /* 16.777216_MHz_XTAL Nintendo Game Boy Advance */ - 16'934'400, /* 16.9344_MHz_XTAL Usually used to drive 90's Yamaha OPL/FM chips (44100 * 384) */ - 16'960'000, /* 16.960_MHz_XTAL Esprit Systems Executive 10/102 */ - 17'010'000, /* 17.01_MHz_XTAL Epic 14E */ - 17'064'000, /* 17.064_MHz_XTAL Memorex 1377 */ - 17'074'800, /* 17.0748_MHz_XTAL SWTPC 8212 */ - 17'320'000, /* 17.320_MHz_XTAL Visual 50 */ - 17'350'000, /* 17.35_MHz_XTAL ITT Courier 1700 */ - 17'360'000, /* 17.36_MHz_XTAL OMTI Series 10 SCSI controller */ - 17'430'000, /* 17.43_MHz_XTAL Videx Videoterm */ - 17'550'000, /* 17.55_MHz_XTAL HP 264x display clock (50 Hz configuration) */ - 17'600'000, /* 17.6_MHz_XTAL LSI Octopus */ - 17'734'470, /* 17.73447_MHz_XTAL 4x PAL subcarrier */ - 17'734'472, /* 17.734472_MHz_XTAL 4x PAL subcarrier - All of these exist, exact 4x PAL is actually 17'734'475 */ - 17'734'475, /* 17.734475_MHz_XTAL 4x PAL subcarrier - " */ - 17'734'476, /* 17.734476_MHz_XTAL 4x PAL subcarrier - " */ - 17'812'000, /* 17.812_MHz_XTAL Videopac C52 */ - 17'971'200, /* 17.9712_MHz_XTAL Compucolor II, Hazeltine Esprit III */ - 18'000'000, /* 18_MHz_XTAL S.A.R, Ikari Warriors 3 */ - 18'414'000, /* 18.414_MHz_XTAL Ann Arbor Ambassador */ - 18'432'000, /* 18.432_MHz_XTAL Extremely common, used on 100's of PCBs (48000 * 384) */ - 18'480'000, /* 18.48_MHz_XTAL Wyse WY-100 video */ - 18'575'000, /* 18.575_MHz_XTAL Visual 102, Visual 220 */ - 18'600'000, /* 18.6_MHz_XTAL Teleray Model 10 */ - 18'720'000, /* 18.72_MHz_XTAL Nokia MikroMikko 1 */ - 18'867'000, /* 18.867_MHz_XTAL Decision Data IS-482 */ - 18'869'600, /* 18.8696_MHz_XTAL Memorex 2178 */ - 19'170'000, /* 19.17_MHz_XTAL Ericsson ISA8 Monochrome HR Graphics Board */ - 19'339'600, /* 19.3396_MHz_XTAL TeleVideo TVI-955 80-column display clock */ - 19'584'000, /* 19.584_MHz_XTAL ADM-42 */ - 19'600'000, /* 19.6_MHz_XTAL Universal Mr. Do - Model 8021 PCB */ - 19'602'000, /* 19.602_MHz_XTAL Ampex 210+ 80-column display clock */ - 19'660'800, /* 19.6608_MHz_XTAL Euro League (bootleg), labeled as "UKI 19.6608 20PF" */ - 19'661'400, /* 19.6614_MHz_XTAL Wyse WY-30 */ - 19'718'400, /* 19.7184_MHz_XTAL Informer 207/100 */ - 19'923'000, /* 19.923_MHz_XTAL Cinematronics vectors */ - 19'968'000, /* 19.968_MHz_XTAL Used mostly by some Taito games */ - 20'000'000, /* 20_MHz_XTAL - */ - 20'160'000, /* 20.16_MHz_XTAL Nintendo 8080 */ - 20'275'200, /* 20.2752_MHz_XTAL TRS-80 Model III */ - 20'282'000, /* 20.282_MHz_XTAL Northwest Digitial Systems GP-19 */ - 20'375'040, /* 20.37504_MHz_XTAL Apple Lisa dot clock (197-0019A) */ - 20'625'000, /* 20.625_MHz_XTAL SM 7238 */ - 20'790'000, /* 20.79_MHz_XTAL Blockade-hardware Gremlin games */ - 21'000'000, /* 21_MHz_XTAL Lock-On pixel clock */ - 21'052'600, /* 21.0526_MHz_XTAL NEC PC-98xx pixel clock */ - 21'060'000, /* 21.06_MHz_XTAL HP 264x display clock (60 Hz configuration) */ - 21'254'400, /* 21.2544_MHz_XTAL TeleVideo 970 132-column display clock */ - 21'281'370, /* 21.28137_MHz_XTAL Radica Tetris (PAL) */ - 21'300'000, /* 21.3_MHz_XTAL - */ - 21'328'100, /* 21.3281_MHz_XTAL Philips NMS8245 */ - 21'477'272, /* 21.477272_MHz_XTAL BMC bowling, some Data East 90's games, Vtech Socrates; (6x NTSC subcarrier) */ - 21'667'500, /* 21.6675_MHz_XTAL AT&T 610 80-column display clock */ - 21'756'600, /* 21.7566_MHz_XTAL Tab Products E-22 80-column display clock */ - 22'000'000, /* 22_MHz_XTAL - */ - 22'032'000, /* 22.032_MHz_XTAL Intellec Series II I/O controller */ - 22'096'000, /* 22.096_MHz_XTAL ADDS Viewpoint 122 */ - 22'118'400, /* 22.1184_MHz_XTAL Amusco Poker */ - 22'168'000, /* 22.168_MHz_XTAL Sony HB-10P VDP (5x PAL subcarrier) */ - 22'248'000, /* 22.248_MHz_XTAL Quantel DPB-7000 */ - 22'321'000, /* 22.321_MHz_XTAL Apple LaserWriter II NT */ - 22'464'000, /* 22.464_MHz_XTAL CIT-101 132-column display clock */ - 22'579'000, /* 22.579_MHz_XTAL Sega System H1 SCSP clock */ - 22'579'200, /* 22.5792_MHz_XTAL Enhanced Apple Digital Sound Chip clock (44100 * 512) */ - 22'656'000, /* 22.656_MHz_XTAL Super Pinball Action (~1440x NTSC line rate) */ - 22'680'000, /* 22.680_MHz_XTAL HDS200 80-columns display clock */ - 22'896'000, /* 22.896_MHz_XTAL DEC VT220 132-column display clock */ - 23'200'000, /* 23.2_MHz_XTAL Roland JV-80 & JV-880 PCM clock */ - 23'814'000, /* 23.814_MHz_XTAL TeleVideo TVI-912, 920 & 950 */ - 23'961'600, /* 23.9616_MHz_XTAL Osborne 4 (Vixen) */ - 24'000'000, /* 24_MHz_XTAL Mario, 80's Data East games, 80's Konami games */ - 24'073'400, /* 24.0734_MHz_XTAL DEC Rainbow 100 */ - 24'167'829, /* 24.167829_MHz_XTAL Neo Geo AES rev. 3-3 and later (~1536x NTSC line rate) */ - 24'270'000, /* 24.27_MHz_XTAL CIT-101XL */ - 24'300'000, /* 24.3_MHz_XTAL ADM 36 132-column display clock */ - 24'576'000, /* 24.576_MHz_XTAL Pole Position h/w, Model 3 CPU board */ - 24'883'200, /* 24.8832_MHz_XTAL DEC VT100 */ - 25'000'000, /* 25_MHz_XTAL Namco System 22, Taito GNET, Dogyuun h/w */ - 25'174'800, /* 25.1748_MHz_XTAL Sega System 16A/16B (1600x NTSC line rate) */ - 25'175'000, /* 25.175_MHz_XTAL IBM MCGA/VGA 320/640-pixel graphics */ - 25'200'000, /* 25.2_MHz_XTAL Tektronix 4404 video clock */ - 25'398'360, /* 25.39836_MHz_XTAL Tandberg TDV 2324 */ - 25'400'000, /* 25.4_MHz_XTAL PC9801-86 PCM base clock */ - 25'447'000, /* 25.447_MHz_XTAL Namco EVA3A (Funcube2) */ - 25'771'500, /* 25.7715_MHz_XTAL HP-2622A */ - 25'920'000, /* 25.92_MHz_XTAL ADDS Viewpoint 60 */ - 26'000'000, /* 26_MHz_XTAL Gaelco PCBs */ - 26'195'000, /* 26.195_MHz_XTAL Roland JD-800 */ - 26'366'000, /* 26.366_MHz_XTAL DEC VT320 */ - 26'580'000, /* 26.58_MHz_XTAL Wyse WY-60 80-column display clock */ - 26'590'906, /* 26.590906_MHz_XTAL Atari Jaguar NTSC */ - 26'593'900, /* 26.5939_MHz_XTAL Atari Jaguar PAL */ - 26'601'712, /* 26.601712_MHz_XTAL Astro Corp.'s Show Hand, PAL Vtech/Yeno Socrates (6x PAL subcarrier) */ - 26'666'000, /* 26.666_MHz_XTAL Imagetek I4220/I4300 */ - 26'666'666, /* 26.666666_MHz_XTAL Irem M92 but most use 27MHz */ - 26'670'000, /* 26.670_MHz_XTAL Namco EVA */ - 26'686'000, /* 26.686_MHz_XTAL Typically used on 90's Taito PCBs to drive the custom chips */ - 26'824'000, /* 26.824_MHz_XTAL Astro Corp.'s Zoo */ - 26'880'000, /* 26.88_MHz_XTAL Roland RF5C36/SA-16 clock (30000 * 896) */ - 26'989'200, /* 26.9892_MHz_XTAL TeleVideo 965 */ - 27'000'000, /* 27_MHz_XTAL Some Banpresto games macrossp, Irem M92 and 90's Toaplan games */ - 27'164'000, /* 27.164_MHz_XTAL Typically used on 90's Taito PCBs to drive the custom chips */ - 27'210'900, /* 27.2109_MHz_XTAL LA Girl */ - 27'562'000, /* 27.562_MHz_XTAL Visual 220 */ - 27'720'000, /* 27.72_MHz_XTAL AT&T 610 132-column display clock */ - 27'956'000, /* 27.956_MHz_XTAL CIT-101e 132-column display clock */ - 28'000'000, /* 28_MHz_XTAL Sega System H1 SH2 clock, Kyukyoku Tiger / Twin Cobra */ - 28'224'000, /* 28.224_MHz_XTAL Roland JD-800 */ - 28'322'000, /* 28.322_MHz_XTAL Saitek RISC 2500, Mephisto Montreux */ - 28'375'160, /* 28.37516_MHz_XTAL Amiga PAL systems */ - 28'475'000, /* 28.475_MHz_XTAL CoCo 3 PAL */ - 28'480'000, /* 28.48_MHz_XTAL Chromatics CGC-7900 */ - 28'636'000, /* 28.636_MHz_XTAL Super Kaneko Nova System */ - 28'636'363, /* 28.636363_MHz_XTAL Later Leland games and Atari GT, Amiga NTSC, Raiden2 h/w (8x NTSC subcarrier), NEC PC-88xx */ - 28'640'000, /* 28.64_MHz_XTAL Fuuki FG-1c AI AM-2 PCB */ - 28'700'000, /* 28.7_MHz_XTAL - */ - 29'376'000, /* 29.376_MHz_XTAL Qume QVT-103 */ - 29'491'200, /* 29.4912_MHz_XTAL Xerox Alto-II system clock (tagged 29.4MHz in the schematics) */ - 30'000'000, /* 30_MHz_XTAL Impera Magic Card */ - 30'209'800, /* 30.2098_MHz_XTAL Philips CD-i NTSC (1920x NTSC line rate) */ - 30'240'000, /* 30.24_MHz_XTAL Macintosh IIci RBV, 12- or 13-inch display */ - 30'476'180, /* 30.47618_MHz_XTAL Taito F3, JC, Under Fire */ - 30'800'000, /* 30.8_MHz_XTAL 15IE-00-013 */ - 31'279'500, /* 31.2795_MHz_XTAL Wyse WY-30+ */ - 31'334'400, /* 31.3344_MHz_XTAL Macintosh II */ - 31'684'000, /* 31.684_MHz_XTAL TeleVideo TVI-955 132-column display clock */ - 31'948'800, /* 31.9488_MHz_XTAL NEC PC-88xx, PC-98xx */ - 32'000'000, /* 32_MHz_XTAL - */ - 32'147'000, /* 32.147_MHz_XTAL Ampex 210+ 132-column display clock */ - 32'220'000, /* 32.22_MHz_XTAL Typically used on 90's Data East PCBs (close to 9x NTSC subcarrier which is 32.215905Mhz */ - 32'256'000, /* 32.256_MHz_XTAL Hitachi MB-6890 */ - 32'317'400, /* 32.3174_MHz_XTAL DEC VT330, VT340 */ - 32'530'470, /* 32.53047_MHz_XTAL Seta 2 */ - 32'640'000, /* 32.64_MHz_XTAL Vector 4 */ - 32'768'000, /* 32.768_MHz_XTAL Roland D-50 audio clock */ - 33'000'000, /* 33_MHz_XTAL Sega Model 3 video board */ - 33'264'000, /* 33.264_MHz_XTAL Hazeltine 1500 terminal */ - 33'330'000, /* 33.33_MHz_XTAL Sharp X68000 XVI */ - 33'333'000, /* 33.333_MHz_XTAL Sega Model 3 CPU board, Vegas */ - 33'333'333, /* 33.333333_MHz_XTAL Super Kaneko Nova System Sound clock with /2 divider */ - 33'833'000, /* 33.833_MHz_XTAL - */ - 33'868'800, /* 33.8688_MHz_XTAL Usually used to drive 90's Yamaha OPL/FM chips with /2 divider */ - 34'000'000, /* 34_MHz_XTAL Gaelco PCBs */ - 34'291'712, /* 34.291712_MHz_XTAL Fairlight CMI master card */ - 34'846'000, /* 34.846_MHz_XTAL Visual 550 */ - 35'452'500, /* 35.4525_MHz_XTAL Nokia MikroMikko 2 */ - 35'469'000, /* 35.469_MHz_XTAL ZX Spectrum +2/+3 (~8x PAL subcarrier) */ - 35'640'000, /* 35.640_MHz_XTAL HDS200 132-column display clock */ - 35'834'400, /* 35.8344_MHz_XTAL Tab Products E-22 132-column display clock */ - 35'840'000, /* 35.84_MHz_XTAL Akai MPC 60 voice PCB */ - 35'904'000, /* 35.904_MHz_XTAL Used on HP98543 graphics board */ - 36'000'000, /* 36_MHz_XTAL Sega Model 1 video board */ - 36'864'000, /* 36.864_MHz_XTAL Unidesa Cirsa Rock 'n' Roll */ - 37'980'000, /* 37.98_MHz_XTAL Falco 5220 */ - 38'769'220, /* 38.76922_MHz_XTAL Namco System 21 video board */ - 38'863'630, /* 38.86363_MHz_XTAL Sharp X68000 15.98kHz video */ - 39'321'600, /* 39.3216_MHz_XTAL Sun 2/120 */ - 39'710'000, /* 39.71_MHz_XTAL Wyse WY-60 132-column display clock */ - 40'000'000, /* 40_MHz_XTAL - */ - 40'210'000, /* 40.21_MHz_XTAL Fairlight CMI IIx */ - 41'539'000, /* 41.539_MHz_XTAL IBM PS/2 132-column text mode */ - 42'000'000, /* 42_MHz_XTAL BMC A-00211 - Popo Bear */ - 42'105'200, /* 42.1052_MHz_XTAL NEC PC-88xx */ - 42'954'545, /* 42.954545_MHz_XTAL CPS3 (12x NTSC subcarrier)*/ - 43'320'000, /* 43.32_MHz_XTAL DEC VT420 */ - 44'100'000, /* 44.1_MHz_XTAL Subsino's Bishou Jan */ - 44'236'800, /* 44.2368_MHz_XTAL ReCo6502, Fortune 32:16 */ - 44'452'800, /* 44.4528_MHz_XTAL TeleVideo 965 */ - 44'900'000, /* 44.9_MHz_XTAL IBM 8514 1024x768 43.5Hz graphics */ - 45'000'000, /* 45_MHz_XTAL Eolith with Hyperstone CPUs */ - 45'158'400, /* 45.1584_MHz_XTAL Philips CD-i CDIC, Sega Model 2A video, Sega Model 3 CPU */ - 45'619'200, /* 45.6192_MHz_XTAL DEC VK100 */ - 45'830'400, /* 45.8304_MHz_XTAL Microterm 5510 */ - 46'615'120, /* 46.61512_MHz_XTAL Soundblaster 16 PCM base clock */ - 47'736'000, /* 47.736_MHz_XTAL Visual 100 */ - 48'000'000, /* 48_MHz_XTAL Williams/Midway Y/Z-unit system / SSV board */ - 48'384'000, /* 48.384_MHz_XTAL Namco NB-1 */ - 48'556'800, /* 48.5568_MHz_XTAL Wyse WY-85 */ - 48'654'000, /* 48.654_MHz_XTAL Qume QVT-201 */ - 48'660'000, /* 48.66_MHz_XTAL Zaxxon */ - 49'152'000, /* 49.152_MHz_XTAL Used on some Namco PCBs, Baraduke h/w, System 21, Super System 22 */ - 49'423'500, /* 49.4235_MHz_XTAL Wyse WY-185 */ - 50'000'000, /* 50_MHz_XTAL Williams/Midway T/W/V-unit system */ - 50'113'000, /* 50.113_MHz_XTAL Namco NA-1 (14x NTSC subcarrier)*/ - 50'349'000, /* 50.349_MHz_XTAL Sega System 18 (~3200x NTSC line rate) */ - 50'350'000, /* 50.35_MHz_XTAL Sharp X68030 video */ - 51'200'000, /* 51.2_MHz_XTAL Namco Super System 22 video clock */ - 52'000'000, /* 52_MHz_XTAL Cojag */ - 52'832'000, /* 52.832_MHz_XTAL Wang PC TIG video controller */ - 52'867'000, /* 52.867_MHz_XTAL Atlus Print Club (Sega C2 PCB) */ - 53'203'424, /* 53.203424_MHz_XTAL Master System, Mega Drive PAL (12x PAL subcarrier) */ - 53'693'175, /* 53.693175_MHz_XTAL PSX-based h/w, Sony ZN1-2-based (15x NTSC subcarrier) */ - 54'000'000, /* 54_MHz_XTAL Taito JC */ - 55'000'000, /* 55_MHz_XTAL Eolith Vega */ - 57'272'727, /* 57.272727_MHz_XTAL Psikyo SH2 with /2 divider (16x NTSC subcarrier)*/ - 57'283'200, /* 57.2832_MHz_XTAL Macintosh IIci RBV, 15-inch portrait display */ - 58'000'000, /* 58_MHz_XTAL Magic Reel (Play System) */ - 58'982'400, /* 58.9824_MHz_XTAL Wyse WY-65 */ - 59'292'000, /* 59.292_MHz_XTAL Data General D461 */ - 60'000'000, /* 60_MHz_XTAL ARM610 */ - 61'440'000, /* 61.44_MHz_XTAL Donkey Kong */ - 64'000'000, /* 64_MHz_XTAL BattleToads */ - 64'108'800, /* 64.1088_MHz_XTAL HP Topcat high-res */ - 66'000'000, /* 66_MHz_XTAL - */ - 66'666'700, /* 66.6667_MHz_XTAL Later Midway games */ - 67'737'600, /* 67.7376_MHz_XTAL PSX-based h/w, Sony ZN1-2-based */ - 68'850'000, /* 68.85_MHz_XTAL Wyse WY-50 */ - 69'551'990, /* 69.55199_MHz_XTAL Sharp X68000 31.5kHz video */ - 72'000'000, /* 72_MHz_XTAL Aristocrat MKV */ - 72'576'000, /* 72.576_MHz_XTAL Centipede, Millipede, Missile Command, Let's Go Bowling "Multipede" */ - 73'728'000, /* 73.728_MHz_XTAL Ms. Pac-Man/Galaga 20th Anniversary */ - 75'000'000, /* 75_MHz_XTAL Sony NEWS NWS-5000X */ - 77'414'400, /* 77.4144_MHz_XTAL NCD17c */ - 80'000'000, /* 80_MHz_XTAL ARM710 */ - 87'183'360, /* 87.18336_MHz_XTAL AT&T 630 MTG */ - 92'940'500, /* 92.9405_MHz_XTAL Sun cgthree */ - 96'000'000, /* 96_MHz_XTAL Acorn A680 */ - 99'522'000, /* 99.522_MHz_XTAL Radius Two Page Display */ - 100'000'000, /* 100_MHz_XTAL PSX-based Namco System 12, Vegas, Sony ZN1-2-based */ - 101'491'200, /* 101.4912_MHz_XTAL PSX-based Namco System 10 */ - 105'561'000, /* 105.561_MHz_XTAL Sun cgsix */ - 108'108'000, /* 108.108_MHz_XTAL HP 98550 high-res color card */ - 120'000'000, /* 120_MHz_XTAL Astro Corp.'s Stone Age */ - 200'000'000 /* 200_MHz_XTAL Base SH4 CPU (Naomi, Hikaru etc.) */ + 32'768, // 32.768_kHz_XTAL Used to drive RTC chips + 38'400, // 38.4_kHz_XTAL Resonator + 384'000, // 384_kHz_XTAL Resonator - Commonly used for driving OKI MSM5205 + 400'000, // 400_kHz_XTAL Resonator - OKI MSM5205 on Great Swordman h/w + 430'000, // 430_kHz_XTAL Resonator + 455'000, // 455_kHz_XTAL Resonator - OKI MSM5205 on Gladiator h/w + 500'000, // 500_kHz_XTAL Resonator - MIDI clock on various synthesizers (31250 * 16) + 512'000, // 512_kHz_XTAL Resonator - Toshiba TC8830F + 600'000, // 600_kHz_XTAL - + 640'000, // 640_kHz_XTAL Resonator - NEC UPD7759, Texas Instruments Speech Chips @ 8khz + 960'000, // 960_kHz_XTAL Resonator - Xerox Notetaker Keyboard UART + 1'000'000, // 1_MHz_XTAL Used to drive OKI M6295 chips + 1'008'000, // 1.008_MHz_XTAL Acorn Microcomputer (System 1) + 1'056'000, // 1.056_MHz_XTAL Resonator - OKI M6295 on Trio The Punch h/w + 1'294'400, // 1.2944_MHz_XTAL BBN BitGraph PSG + 1'600'000, // 1.6_MHz_XTAL Resonator - Roland TR-707 + 1'689'600, // 1.6896_MHz_XTAL Diablo 1355WP Printer + 1'750'000, // 1.75_MHz_XTAL RCA CDP1861 + 1'797'100, // 1.7971_MHz_XTAL SWTPC 6800 (with MIKBUG) + 1'843'200, // 1.8432_MHz_XTAL Bondwell 12/14 + 2'000'000, // 2_MHz_XTAL - + 2'012'160, // 2.01216_MHz_XTAL Cidelsa Draco sound board + 2'097'152, // 2.097152_MHz_XTAL Icatel 1995 - Brazilian public payphone + 2'250'000, // 2.25_MHz_XTAL Resonator - YM2154 on Yamaha PSR-60 & PSR-70 + 2'376'000, // 2.376_MHz_XTAL CIT-101 keyboard + 2'457'600, // 2.4576_MHz_XTAL Atari ST MFP + 2'500'000, // 2.5_MHz_XTAL Janken Man units + 2'600'000, // 2.6_MHz_XTAL Sharp PC-1500 + 2'700'000, // 2.7_MHz_XTAL Resonator - YM2154 on Yamaha RX15 + 2'950'000, // 2.95_MHz_XTAL Playmatic MPU-C, MPU-III & Sound-3 + 3'000'000, // 3_MHz_XTAL Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs + 3'072'000, // 3.072_MHz_XTAL INS 8520 input clock rate + 3'120'000, // 3.12_MHz_XTAL SP0250 clock on Gottlieb games + 3'276'800, // 3.2768_MHz_XTAL SP0256 clock in Speech Synthesis for Dragon 32 + 3'300'000, // 3.3_MHz_XTAL LC 80 (export) + 3'521'280, // 3.52128_MHz_XTAL RCA COSMAC VIP + 3'546'800, // 3.5468_MHz_XTAL Atari 400 PAL + 3'546'894, // 3.546894_MHz_XTAL Atari 2600 PAL + 3'547'000, // 3.547_MHz_XTAL Philips G7200, Philips C7240 + 3'562'500, // 3.5625_MHz_XTAL Jopac JO7400 + 3'570'000, // 3.57_MHz_XTAL Telmac TMC-600 + 3'578'640, // 3.57864_MHz_XTAL Atari Portfolio PCD3311T + 3'579'000, // 3.579_MHz_XTAL BeebOPL + 3'579'545, // 3.579545_MHz_XTAL NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) + 3'579'575, // 3.579575_MHz_XTAL Atari 2600 NTSC + 3'580'000, // 3.58_MHz_XTAL Resonator - Ritam Monty + 3'680'000, // 3.68_MHz_XTAL Resonator - Baud rate clock for the 6551 in the MTU-130 + 3'686'400, // 3.6864_MHz_XTAL Baud rate clock for MC68681 and similar UARTs + 3'840'000, // 3.84_MHz_XTAL Fairlight CMI Alphanumeric Keyboard + 3'900'000, // 3.9_MHz_XTAL Resonator - Used on some Fidelity boards + 3'932'160, // 3.93216_MHz_XTAL Apple Lisa COP421 (197-0016A) + 4'000'000, // 4_MHz_XTAL - + 4'032'000, // 4.032_MHz_XTAL GRiD Compass modem board + 4'096'000, // 4.096_MHz_XTAL Used to drive OKI M9810 chips + 4'194'304, // 4.194304_MHz_XTAL Used to drive MC146818 / Nintendo Game Boy + 4'220'000, // 4.220_MHz_XTAL Used to drive OKI M6295 chips on some Namco boards, usually with /4 divider + 4'224'000, // 4.224_MHz_XTAL Used to drive OKI M6295 chips, usually with /4 divider + 4'410'000, // 4.41_MHz_XTAL Pioneer PR-8210 ldplayer + 4'433'610, // 4.43361_MHz_XTAL Cidelsa Draco + 4'433'619, // 4.433619_MHz_XTAL PAL color subcarrier (technically 4.43361875mhz) + 4'608'000, // 4.608_MHz_XTAL Luxor ABC-77 keyboard (Keytronic custom part #48-300-107 is equivalent) + 4'915'200, // 4.9152_MHz_XTAL - + 4'952'000, // 4.952_MHz_XTAL IGS M036 based mahjong games, for TT5665 sound chip + 5'000'000, // 5_MHz_XTAL Mutant Night + 5'068'800, // 5.0688_MHz_XTAL Usually used as MC2661 or COM8116 baud rate clock + 5'185'000, // 5.185_MHz_XTAL Intel INTELLEC® 4 + 5'370'000, // 5.37_MHz_XTAL HP 95LX + 5'460'000, // 5.46_MHz_XTAL ec1840 and ec1841 keyboard + 5'500'000, // 5.5_MHz_XTAL Yamaha PSS-480 + 5'529'600, // 5.5296_MHz_XTAL Kontron PSI98 keyboard + 5'626'000, // 5.626_MHz_XTAL RCA CDP1869 PAL dot clock + 5'659'200, // 5.6592_MHz_XTAL Digilog 320 dot clock + 5'670'000, // 5.67_MHz_XTAL RCA CDP1869 NTSC dot clock + 5'714'300, // 5.7143_MHz_XTAL Cidelsa Destroyer, TeleVideo serial keyboards + 5'856'000, // 5.856_MHz_XTAL HP 3478A Multimeter + 5'911'000, // 5.911_MHz_XTAL Philips Videopac Plus G7400 + 5'990'400, // 5.9904_MHz_XTAL Luxor ABC 800 keyboard (Keytronic custom part #48-300-008 is equivalent) + 6'000'000, // 6_MHz_XTAL American Poker II, Taito SJ System + 6'048'000, // 6.048_MHz_XTAL Hektor II + 6'144'000, // 6.144_MHz_XTAL Used on Alpha Denshi early 80's games sound board, Casio FP-200 and Namco Universal System 16 + 6'400'000, // 6.4_MHz_XTAL Textel Compact + 6'500'000, // 6.5_MHz_XTAL Jupiter Ace, Roland QDD interface + 6'880'000, // 6.88_MHz_XTAL Barcrest MPU4 + 6'900'000, // 6.9_MHz_XTAL BBN BitGraph CPU + 7'000'000, // 7_MHz_XTAL Jaleco Mega System PCBs + 7'056'000, // 7.056_MHz_XTAL Alesis QS FXCHIP (LCM of 44.1 kHz and 48 kHz) + 7'159'090, // 7.15909_MHz_XTAL Blood Bros (2x NTSC subcarrier) + 7'200'000, // 7.2_MHz_XTAL Novag Constellation (later models, with /2 divider), Kawai K1 keyscan IC + 7'372'800, // 7.3728_MHz_XTAL - + 7'680'000, // 7.68_MHz_XTAL Psion Series 3 + 7'864'300, // 7.8643_MHz_XTAL Used on InterFlip games as video clock + 7'987'000, // 7.987_MHz_XTAL PC9801-86 YM2608 clock + 7'995'500, // 7.9955_MHz_XTAL Used on Electronic Devices Italy Galaxy Gunners sound board + 8'000'000, // 8_MHz_XTAL Extremely common, used on 100's of PCBs + 8'200'000, // 8.2_MHz_XTAL Universal Mr. Do - Model 8021 PCB + 8'388'000, // 8.388_MHz_XTAL Nintendo Game Boy Color + 8'448'000, // 8.448_MHz_XTAL Banpresto's Note Chance - Used to drive OKI M6295 chips, usually with /8 divider + 8'467'200, // 8.4672_MHz_XTAL Subsino's Ying Hua Lian + 8'664'000, // 8.664_MHz_XTAL Touchmaster + 8'700'000, // 8.7_MHz_XTAL Tandberg TDV 2324 + 8'860'000, // 8.86_MHz_XTAL AlphaTantel + 8'867'000, // 8.867_MHz_XTAL Philips G7400 (~2x PAL subcarrier) + 8'867'236, // 8.867236_MHz_XTAL RCA CDP1869 PAL color clock (~2x PAL subcarrier) + 8'867'238, // 8.867238_MHz_XTAL ETI-660 (~2x PAL subcarrier) + 8'945'000, // 8.945_MHz_XTAL Hit Me + 8'960'000, // 8.96_MHz_XTAL Casio CZ-101 (divided by 2 for Music LSI) + 9'000'000, // 9_MHz_XTAL Homedata PCBs + 9'216'000, // 9.216_MHz_XTAL Univac UTS 20 + 9'263'750, // 9.263750_MHz_XTAL Sai Yu Gou Ma Roku bootleg + 9'400'000, // 9.4_MHz_XTAL Yamaha MU-5 and TG-100 + 9'426'500, // 9.4265_MHz_XTAL Yamaha DX7, and DX9 + 9'600'000, // 9.6_MHz_XTAL WD37C65 second clock (for 300 KB/sec rate) + 9'732'000, // 9.732_MHz_XTAL CTA Invader + 9'828'000, // 9.828_MHz_XTAL Universal PCBs + 9'830'400, // 9.8304_MHz_XTAL Epson PX-8 + 9'832'000, // 9.832_MHz_XTAL Robotron A7150 + 9'877'680, // 9.87768_MHz_XTAL Microterm 420 + 9'987'000, // 9.987_MHz_XTAL Crazy Balloon + 10'000'000, // 10_MHz_XTAL - + 10'137'600, // 10.1376_MHz_XTAL Wyse WY-100 + 10'240'000, // 10.240_MHz_XTAL Stella 8085 based fruit machines + 10'245'000, // 10.245_MHz_XTAL PES Speech box + 10'380'000, // 10.38_MHz_XTAL Fairlight Q219 Lightpen/Graphics Card + 10'480'000, // 10.48_MHz_XTAL System-80 (50 Hz) + 10'500'000, // 10.5_MHz_XTAL Agat-7 + 10'595'000, // 10.595_MHz_XTAL Mad Alien + 10'644'000, // 10.644_MHz_XTAL Northwest Digitial Systems GP-19 + 10'644'500, // 10.6445_MHz_XTAL TRS-80 Model I + 10'687'500, // 10.6875_MHz_XTAL BBC Bridge Companion + 10'694'250, // 10.69425_MHz_XTAL Xerox 820 + 10'717'200, // 10.7172_MHz_XTAL Eltec EurocomII + 10'730'000, // 10.73_MHz_XTAL Ruleta RE-900 VDP Clock + 10'733'000, // 10.733_MHz_XTAL The Fairyland Story + 10'738'000, // 10.738_MHz_XTAL Pokerout (poker+breakout) TMS9129 VDP Clock + 10'738'635, // 10.738635_MHz_XTAL TMS9918 family (3x NTSC subcarrier) + 10'816'000, // 10.816_MHz_XTAL Universal 1979-1980 (Cosmic Alien, etc) + 10'886'400, // 10.8864_MHz_XTAL Systel System 100 + 10'920'000, // 10.92_MHz_XTAL ADDS Viewpoint 60, Viewpoint A2 + 11'000'000, // 11_MHz_XTAL Mario I8039 sound + 11'004'000, // 11.004_MHz_XTAL TI 911 VDT + 11'059'200, // 11.0592_MHz_XTAL Used with MCS-51 to generate common baud rates + 11'200'000, // 11.2_MHz_XTAL New York, New York + 11'289'000, // 11.289_MHz_XTAL Vanguard + 11'289'600, // 11.2896_MHz_XTAL Frantic Fred + 11'400'000, // 11.4_MHz_XTAL HP 9845 + 11'668'800, // 11.6688_MHz_XTAL Gameplan pixel clock + 11'730'000, // 11.73_MHz_XTAL Irem M-11 + 11'800'000, // 11.8_MHz_XTAL IBM PC Music Feature Card + 11'980'800, // 11.9808_MHz_XTAL Luxor ABC 80 + 12'000'000, // 12_MHz_XTAL Extremely common, used on 100's of PCBs + 12'057'600, // 12.0576_MHz_XTAL Poly 1 (38400 * 314) + 12'096'000, // 12.096_MHz_XTAL Some early 80's Atari games + 12'288'000, // 12.288_MHz_XTAL Sega Model 3 digital audio board + 12'292'000, // 12.292_MHz_XTAL Northwest Digitial Systems GP-19 + 12'324'000, // 12.324_MHz_XTAL Otrona Attache + 12'335'600, // 12.3356_MHz_XTAL RasterOps ColorBoard 264 (~784x NTSC line rate) + 12'472'500, // 12.4725_MHz_XTAL Bonanza's Mini Boy 7 + 12'480'000, // 12.48_MHz_XTAL TRS-80 Model II + 12'500'000, // 12.5_MHz_XTAL Red Alert audio board + 12'638'000, // 12.638_MHz_XTAL Exidy Sorcerer + 12'672'000, // 12.672_MHz_XTAL TRS-80 Model 4 80*24 video + 12'800'000, // 12.8_MHz_XTAL Cave CV1000 + 12'854'400, // 12.8544_MHz_XTAL Alphatronic P3 + 12'936'000, // 12.936_MHz_XTAL CDC 721 + 12'979'200, // 12.9792_MHz_XTAL Exidy 440 + 13'000'000, // 13_MHz_XTAL STM Pied Piper dot clock + 13'300'000, // 13.3_MHz_XTAL BMC bowling + 13'330'560, // 13.33056_MHz_XTAL Taito L + 13'333'000, // 13.333_MHz_XTAL Ojanko High School + 13'400'000, // 13.4_MHz_XTAL TNK3, Ikari Warriors h/w + 13'478'400, // 13.4784_MHz_XTAL TeleVideo 970 80-column display clock + 13'495'200, // 13.4952_MHz_XTAL Used on Shadow Force pcb and maybe other Technos pcbs? + 13'500'000, // 13.5_MHz_XTAL Microbee + 13'516'800, // 13.5168_MHz_XTAL Kontron KDT6 + 13'560'000, // 13.560_MHz_XTAL Tong Zi Maque + 13'608'000, // 13.608_MHz_XTAL TeleVideo 910 & 925 + 13'824'000, // 13.824_MHz_XTAL Robotron PC-1715 display circuit + 13'977'600, // 13.9776_MHz_XTAL Kaypro II dot clock + 14'000'000, // 14_MHz_XTAL - + 14'112'000, // 14.112_MHz_XTAL Timex/Sinclair TS2068 + 14'192'640, // 14.19264_MHz_XTAL Central Data 2650 + 14'218'000, // 14.218_MHz_XTAL Dragon + 14'250'450, // 14.25045_MHz_XTAL Apple II Europlus + 14'300'000, // 14.3_MHz_XTAL Agat-7 + 14'314'000, // 14.314_MHz_XTAL Taito TTL Board + 14'318'181, // 14.318181_MHz_XTAL Extremely common, used on 100's of PCBs (4x NTSC subcarrier) + 14'349'600, // 14.3496_MHz_XTAL Roland S-50 VDP + 14'469'000, // 14.469_MHz_XTAL Esprit Systems Executive 10/102 + 14'580'000, // 14.58_MHz_XTAL Fortune 32:16 Video Controller + 14'705'882, // 14.705882_MHz_XTAL Aleck64 + 14'728'000, // 14.728_MHz_XTAL ADM 36 + 14'742'800, // 14.7428_MHz_XTAL ADM 23 + 14'745'000, // 14.745_MHz_XTAL Synertek KTM-3 + 14'745'600, // 14.7456_MHz_XTAL Namco System 12 & System Super 22/23 for JVS + 14'746'000, // 14.746_MHz_XTAL Namco System 10 MGEXIO + 14'784'000, // 14.784_MHz_XTAL Zenith Z-29 + 14'916'000, // 14.916_MHz_XTAL ADDS Viewpoint 122 + 14'976'000, // 14.976_MHz_XTAL CIT-101 80-column display clock + 15'000'000, // 15_MHz_XTAL Sinclair QL, Amusco Poker + 15'148'800, // 15.1488_MHz_XTAL Zentec 9002/9003 + 15'206'400, // 15.2064_MHz_XTAL Falco TS-1 + 15'288'000, // 15.288_MHz_XTAL DEC VT220 80-column display clock + 15'300'720, // 15.30072_MHz_XTAL Microterm 420 + 15'360'000, // 15.36_MHz_XTAL Visual 1050 + 15'400'000, // 15.4_MHz_XTAL DVK KSM + 15'468'480, // 15.46848_MHz_XTAL Bank Panic h/w, Sega G80 + 15'582'000, // 15.582_MHz_XTAL Zentec Zephyr + 15'625'000, // 15.625_MHz_XTAL Zaccaria The Invaders + 15'667'200, // 15.6672_MHz_XTAL Apple Macintosh + 15'700'000, // 15.7_MHz_XTAL Motogonki + 15'741'000, // 15.741_MHz_XTAL DECmate II 80-column display clock + 15'897'600, // 15.8976_MHz_XTAL IAI Swyft + 15'920'000, // 15.92_MHz_XTAL HP Integral PC + 15'930'000, // 15.93_MHz_XTAL ADM 12 + 15'974'400, // 15.9744_MHz_XTAL Osborne 1 (9600 * 52 * 32) + 16'000'000, // 16_MHz_XTAL Extremely common, used on 100's of PCBs + 16'097'280, // 16.09728_MHz_XTAL DEC VT240 (1024 * 262 * 60) + 16'128'000, // 16.128_MHz_XTAL Fujitsu FM-7 + 16'200'000, // 16.2_MHz_XTAL Debut + 16'257'000, // 16.257_MHz_XTAL IBM PC MDA & EGA + 16'313'000, // 16.313_MHz_XTAL Micro-Term ERGO 201 + 16'364'000, // 16.364_MHz_XTAL Corvus Concept + 16'384'000, // 16.384_MHz_XTAL - + 16'400'000, // 16.4_MHz_XTAL MS 6102 + 16'537'000, // 16.537_MHz_XTAL Falco terminals 80-column clock + 16'572'000, // 16.572_MHz_XTAL Micro-Term ACT-5A + 16'588'800, // 16.5888_MHz_XTAL SM 7238 + 16'666'600, // 16.6666_MHz_XTAL Firebeat GCU + 16'667'000, // 16.667_MHz_XTAL Visual XDS-19P + 16'669'800, // 16.6698_MHz_XTAL Qume QVT-102 + 16'670'000, // 16.67_MHz_XTAL - + 16'777'216, // 16.777216_MHz_XTAL Nintendo Game Boy Advance + 16'934'400, // 16.9344_MHz_XTAL Usually used to drive 90's Yamaha OPL/FM chips (44100 * 384) + 16'960'000, // 16.960_MHz_XTAL Esprit Systems Executive 10/102 + 17'010'000, // 17.01_MHz_XTAL Epic 14E + 17'064'000, // 17.064_MHz_XTAL Memorex 1377 + 17'074'800, // 17.0748_MHz_XTAL SWTPC 8212 + 17'320'000, // 17.320_MHz_XTAL Visual 50 + 17'350'000, // 17.35_MHz_XTAL ITT Courier 1700 + 17'360'000, // 17.36_MHz_XTAL OMTI Series 10 SCSI controller + 17'430'000, // 17.43_MHz_XTAL Videx Videoterm + 17'550'000, // 17.55_MHz_XTAL HP 264x display clock (50 Hz configuration) + 17'600'000, // 17.6_MHz_XTAL LSI Octopus + 17'734'470, // 17.73447_MHz_XTAL 4x PAL subcarrier + 17'734'472, // 17.734472_MHz_XTAL 4x PAL subcarrier - All of these exist, exact 4x PAL is actually 17'734'475 + 17'734'475, // 17.734475_MHz_XTAL 4x PAL subcarrier - " + 17'734'476, // 17.734476_MHz_XTAL 4x PAL subcarrier - " + 17'812'000, // 17.812_MHz_XTAL Videopac C52 + 17'971'200, // 17.9712_MHz_XTAL Compucolor II, Hazeltine Esprit III + 18'000'000, // 18_MHz_XTAL S.A.R, Ikari Warriors 3 + 18'414'000, // 18.414_MHz_XTAL Ann Arbor Ambassador + 18'432'000, // 18.432_MHz_XTAL Extremely common, used on 100's of PCBs (48000 * 384) + 18'480'000, // 18.48_MHz_XTAL Wyse WY-100 video + 18'575'000, // 18.575_MHz_XTAL Visual 102, Visual 220 + 18'600'000, // 18.6_MHz_XTAL Teleray Model 10 + 18'720'000, // 18.72_MHz_XTAL Nokia MikroMikko 1 + 18'867'000, // 18.867_MHz_XTAL Decision Data IS-482 + 18'869'600, // 18.8696_MHz_XTAL Memorex 2178 + 19'170'000, // 19.17_MHz_XTAL Ericsson ISA8 Monochrome HR Graphics Board + 19'339'600, // 19.3396_MHz_XTAL TeleVideo TVI-955 80-column display clock + 19'584'000, // 19.584_MHz_XTAL ADM-42 + 19'600'000, // 19.6_MHz_XTAL Universal Mr. Do - Model 8021 PCB + 19'602'000, // 19.602_MHz_XTAL Ampex 210+ 80-column display clock + 19'660'800, // 19.6608_MHz_XTAL Euro League (bootleg), labeled as "UKI 19.6608 20PF" + 19'661'400, // 19.6614_MHz_XTAL Wyse WY-30 + 19'718'400, // 19.7184_MHz_XTAL Informer 207/100 + 19'923'000, // 19.923_MHz_XTAL Cinematronics vectors + 19'968'000, // 19.968_MHz_XTAL Used mostly by some Taito games + 20'000'000, // 20_MHz_XTAL - + 20'160'000, // 20.16_MHz_XTAL Nintendo 8080 + 20'275'200, // 20.2752_MHz_XTAL TRS-80 Model III + 20'282'000, // 20.282_MHz_XTAL Northwest Digitial Systems GP-19 + 20'375'040, // 20.37504_MHz_XTAL Apple Lisa dot clock (197-0019A) + 20'625'000, // 20.625_MHz_XTAL SM 7238 + 20'790'000, // 20.79_MHz_XTAL Blockade-hardware Gremlin games + 21'000'000, // 21_MHz_XTAL Lock-On pixel clock + 21'052'600, // 21.0526_MHz_XTAL NEC PC-98xx pixel clock + 21'060'000, // 21.06_MHz_XTAL HP 264x display clock (60 Hz configuration) + 21'254'400, // 21.2544_MHz_XTAL TeleVideo 970 132-column display clock + 21'281'370, // 21.28137_MHz_XTAL Radica Tetris (PAL) + 21'300'000, // 21.3_MHz_XTAL - + 21'328'100, // 21.3281_MHz_XTAL Philips NMS8245 + 21'477'272, // 21.477272_MHz_XTAL BMC bowling, some Data East 90's games, Vtech Socrates; (6x NTSC subcarrier) + 21'667'500, // 21.6675_MHz_XTAL AT&T 610 80-column display clock + 21'756'600, // 21.7566_MHz_XTAL Tab Products E-22 80-column display clock + 22'000'000, // 22_MHz_XTAL - + 22'032'000, // 22.032_MHz_XTAL Intellec Series II I/O controller + 22'096'000, // 22.096_MHz_XTAL ADDS Viewpoint 122 + 22'118'400, // 22.1184_MHz_XTAL Amusco Poker + 22'168'000, // 22.168_MHz_XTAL Sony HB-10P VDP (5x PAL subcarrier) + 22'248'000, // 22.248_MHz_XTAL Quantel DPB-7000 + 22'321'000, // 22.321_MHz_XTAL Apple LaserWriter II NT + 22'464'000, // 22.464_MHz_XTAL CIT-101 132-column display clock + 22'579'000, // 22.579_MHz_XTAL Sega System H1 SCSP clock + 22'579'200, // 22.5792_MHz_XTAL Enhanced Apple Digital Sound Chip clock (44100 * 512) + 22'656'000, // 22.656_MHz_XTAL Super Pinball Action (~1440x NTSC line rate) + 22'680'000, // 22.680_MHz_XTAL HDS200 80-columns display clock + 22'896'000, // 22.896_MHz_XTAL DEC VT220 132-column display clock + 23'200'000, // 23.2_MHz_XTAL Roland JV-80 & JV-880 PCM clock + 23'814'000, // 23.814_MHz_XTAL TeleVideo TVI-912, 920 & 950 + 23'961'600, // 23.9616_MHz_XTAL Osborne 4 (Vixen) + 24'000'000, // 24_MHz_XTAL Mario, 80's Data East games, 80's Konami games + 24'073'400, // 24.0734_MHz_XTAL DEC Rainbow 100 + 24'167'829, // 24.167829_MHz_XTAL Neo Geo AES rev. 3-3 and later (~1536x NTSC line rate) + 24'270'000, // 24.27_MHz_XTAL CIT-101XL + 24'300'000, // 24.3_MHz_XTAL ADM 36 132-column display clock + 24'576'000, // 24.576_MHz_XTAL Pole Position h/w, Model 3 CPU board + 24'883'200, // 24.8832_MHz_XTAL DEC VT100 + 25'000'000, // 25_MHz_XTAL Namco System 22, Taito GNET, Dogyuun h/w + 25'174'800, // 25.1748_MHz_XTAL Sega System 16A/16B (1600x NTSC line rate) + 25'175'000, // 25.175_MHz_XTAL IBM MCGA/VGA 320/640-pixel graphics + 25'200'000, // 25.2_MHz_XTAL Tektronix 4404 video clock + 25'398'360, // 25.39836_MHz_XTAL Tandberg TDV 2324 + 25'400'000, // 25.4_MHz_XTAL PC9801-86 PCM base clock + 25'447'000, // 25.447_MHz_XTAL Namco EVA3A (Funcube2) + 25'771'500, // 25.7715_MHz_XTAL HP-2622A + 25'920'000, // 25.92_MHz_XTAL ADDS Viewpoint 60 + 26'000'000, // 26_MHz_XTAL Gaelco PCBs + 26'195'000, // 26.195_MHz_XTAL Roland JD-800 + 26'366'000, // 26.366_MHz_XTAL DEC VT320 + 26'580'000, // 26.58_MHz_XTAL Wyse WY-60 80-column display clock + 26'590'906, // 26.590906_MHz_XTAL Atari Jaguar NTSC + 26'593'900, // 26.5939_MHz_XTAL Atari Jaguar PAL + 26'601'712, // 26.601712_MHz_XTAL Astro Corp.'s Show Hand, PAL Vtech/Yeno Socrates (6x PAL subcarrier) + 26'666'000, // 26.666_MHz_XTAL Imagetek I4220/I4300 + 26'666'666, // 26.666666_MHz_XTAL Irem M92 but most use 27MHz + 26'670'000, // 26.670_MHz_XTAL Namco EVA + 26'686'000, // 26.686_MHz_XTAL Typically used on 90's Taito PCBs to drive the custom chips + 26'824'000, // 26.824_MHz_XTAL Astro Corp.'s Zoo + 26'880'000, // 26.88_MHz_XTAL Roland RF5C36/SA-16 clock (30000 * 896) + 26'989'200, // 26.9892_MHz_XTAL TeleVideo 965 + 27'000'000, // 27_MHz_XTAL Some Banpresto games macrossp, Irem M92 and 90's Toaplan games + 27'164'000, // 27.164_MHz_XTAL Typically used on 90's Taito PCBs to drive the custom chips + 27'210'900, // 27.2109_MHz_XTAL LA Girl + 27'562'000, // 27.562_MHz_XTAL Visual 220 + 27'720'000, // 27.72_MHz_XTAL AT&T 610 132-column display clock + 27'956'000, // 27.956_MHz_XTAL CIT-101e 132-column display clock + 28'000'000, // 28_MHz_XTAL Sega System H1 SH2 clock, Kyukyoku Tiger / Twin Cobra + 28'224'000, // 28.224_MHz_XTAL Roland JD-800 + 28'322'000, // 28.322_MHz_XTAL Saitek RISC 2500, Mephisto Montreux + 28'375'160, // 28.37516_MHz_XTAL Amiga PAL systems + 28'475'000, // 28.475_MHz_XTAL CoCo 3 PAL + 28'480'000, // 28.48_MHz_XTAL Chromatics CGC-7900 + 28'636'000, // 28.636_MHz_XTAL Super Kaneko Nova System + 28'636'363, // 28.636363_MHz_XTAL Later Leland games and Atari GT, Amiga NTSC, Raiden2 h/w (8x NTSC subcarrier), NEC PC-88xx + 28'640'000, // 28.64_MHz_XTAL Fuuki FG-1c AI AM-2 PCB + 28'700'000, // 28.7_MHz_XTAL - + 29'376'000, // 29.376_MHz_XTAL Qume QVT-103 + 29'491'200, // 29.4912_MHz_XTAL Xerox Alto-II system clock (tagged 29.4MHz in the schematics) + 30'000'000, // 30_MHz_XTAL Impera Magic Card + 30'209'800, // 30.2098_MHz_XTAL Philips CD-i NTSC (1920x NTSC line rate) + 30'240'000, // 30.24_MHz_XTAL Macintosh IIci RBV, 12- or 13-inch display + 30'476'180, // 30.47618_MHz_XTAL Taito F3, JC, Under Fire + 30'800'000, // 30.8_MHz_XTAL 15IE-00-013 + 31'279'500, // 31.2795_MHz_XTAL Wyse WY-30+ + 31'334'400, // 31.3344_MHz_XTAL Macintosh II + 31'684'000, // 31.684_MHz_XTAL TeleVideo TVI-955 132-column display clock + 31'948'800, // 31.9488_MHz_XTAL NEC PC-88xx, PC-98xx + 32'000'000, // 32_MHz_XTAL - + 32'147'000, // 32.147_MHz_XTAL Ampex 210+ 132-column display clock + 32'215'900, // 32.2159_MHz_XTAL Sega System 32, Sega Game Gear (close to 9x NTSC subcarrier which is 32.215905Mhz + 32'220'000, // 32.22_MHz_XTAL Typically used on 90's Data East PCBs + 32'223'800, // 32.2238_MHz_XTAL Sony SMC-777 (~2048x NTSC line rate) + 32'256'000, // 32.256_MHz_XTAL Hitachi MB-6890 + 32'317'400, // 32.3174_MHz_XTAL DEC VT330, VT340 + 32'530'470, // 32.53047_MHz_XTAL Seta 2 + 32'640'000, // 32.64_MHz_XTAL Vector 4 + 32'768'000, // 32.768_MHz_XTAL Roland D-50 audio clock + 33'000'000, // 33_MHz_XTAL Sega Model 3 video board + 33'264'000, // 33.264_MHz_XTAL Hazeltine 1500 terminal + 33'330'000, // 33.33_MHz_XTAL Sharp X68000 XVI + 33'333'000, // 33.333_MHz_XTAL Sega Model 3 CPU board, Vegas + 33'333'333, // 33.333333_MHz_XTAL Super Kaneko Nova System Sound clock with /2 divider + 33'833'000, // 33.833_MHz_XTAL - + 33'868'800, // 33.8688_MHz_XTAL Usually used to drive 90's Yamaha OPL/FM chips with /2 divider + 34'000'000, // 34_MHz_XTAL Gaelco PCBs + 34'291'712, // 34.291712_MHz_XTAL Fairlight CMI master card + 34'846'000, // 34.846_MHz_XTAL Visual 550 + 35'452'500, // 35.4525_MHz_XTAL Nokia MikroMikko 2 + 35'469'000, // 35.469_MHz_XTAL ZX Spectrum +2/+3 (~8x PAL subcarrier) + 35'640'000, // 35.640_MHz_XTAL HDS200 132-column display clock + 35'834'400, // 35.8344_MHz_XTAL Tab Products E-22 132-column display clock + 35'840'000, // 35.84_MHz_XTAL Akai MPC 60 voice PCB + 35'904'000, // 35.904_MHz_XTAL Used on HP98543 graphics board + 36'000'000, // 36_MHz_XTAL Sega Model 1 video board + 36'864'000, // 36.864_MHz_XTAL Unidesa Cirsa Rock 'n' Roll + 37'980'000, // 37.98_MHz_XTAL Falco 5220 + 38'769'220, // 38.76922_MHz_XTAL Namco System 21 video board + 38'863'630, // 38.86363_MHz_XTAL Sharp X68000 15.98kHz video + 39'321'600, // 39.3216_MHz_XTAL Sun 2/120 + 39'710'000, // 39.71_MHz_XTAL Wyse WY-60 132-column display clock + 40'000'000, // 40_MHz_XTAL - + 40'210'000, // 40.21_MHz_XTAL Fairlight CMI IIx + 41'539'000, // 41.539_MHz_XTAL IBM PS/2 132-column text mode + 42'000'000, // 42_MHz_XTAL BMC A-00211 - Popo Bear + 42'105'200, // 42.1052_MHz_XTAL NEC PC-88xx + 42'954'545, // 42.954545_MHz_XTAL CPS3 (12x NTSC subcarrier) + 43'320'000, // 43.32_MHz_XTAL DEC VT420 + 44'100'000, // 44.1_MHz_XTAL Subsino's Bishou Jan + 44'236'800, // 44.2368_MHz_XTAL ReCo6502, Fortune 32:16 + 44'452'800, // 44.4528_MHz_XTAL TeleVideo 965 + 44'900'000, // 44.9_MHz_XTAL IBM 8514 1024x768 43.5Hz graphics + 45'000'000, // 45_MHz_XTAL Eolith with Hyperstone CPUs + 45'158'400, // 45.1584_MHz_XTAL Philips CD-i CDIC, Sega Model 2A video, Sega Model 3 CPU + 45'619'200, // 45.6192_MHz_XTAL DEC VK100 + 45'830'400, // 45.8304_MHz_XTAL Microterm 5510 + 46'615'120, // 46.61512_MHz_XTAL Soundblaster 16 PCM base clock + 47'736'000, // 47.736_MHz_XTAL Visual 100 + 48'000'000, // 48_MHz_XTAL Williams/Midway Y/Z-unit system / SSV board + 48'384'000, // 48.384_MHz_XTAL Namco NB-1 + 48'556'800, // 48.5568_MHz_XTAL Wyse WY-85 + 48'654'000, // 48.654_MHz_XTAL Qume QVT-201 + 48'660'000, // 48.66_MHz_XTAL Zaxxon + 49'152'000, // 49.152_MHz_XTAL Used on some Namco PCBs, Baraduke h/w, System 21, Super System 22 + 49'423'500, // 49.4235_MHz_XTAL Wyse WY-185 + 50'000'000, // 50_MHz_XTAL Williams/Midway T/W/V-unit system + 50'113'000, // 50.113_MHz_XTAL Namco NA-1 (14x NTSC subcarrier) + 50'349'000, // 50.349_MHz_XTAL Sega System 18 (~3200x NTSC line rate) + 50'350'000, // 50.35_MHz_XTAL Sharp X68030 video + 51'200'000, // 51.2_MHz_XTAL Namco Super System 22 video clock + 52'000'000, // 52_MHz_XTAL Cojag + 52'832'000, // 52.832_MHz_XTAL Wang PC TIG video controller + 52'867'000, // 52.867_MHz_XTAL Atlus Print Club (Sega C2 PCB) + 53'203'424, // 53.203424_MHz_XTAL Master System, Mega Drive PAL (12x PAL subcarrier) + 53'693'175, // 53.693175_MHz_XTAL PSX-based h/w, Sony ZN1-2-based (15x NTSC subcarrier) + 54'000'000, // 54_MHz_XTAL Taito JC + 55'000'000, // 55_MHz_XTAL Eolith Vega + 57'272'727, // 57.272727_MHz_XTAL Psikyo SH2 with /2 divider (16x NTSC subcarrier) + 57'283'200, // 57.2832_MHz_XTAL Macintosh IIci RBV, 15-inch portrait display + 58'000'000, // 58_MHz_XTAL Magic Reel (Play System) + 58'982'400, // 58.9824_MHz_XTAL Wyse WY-65 + 59'292'000, // 59.292_MHz_XTAL Data General D461 + 60'000'000, // 60_MHz_XTAL ARM610 + 61'440'000, // 61.44_MHz_XTAL Donkey Kong + 64'000'000, // 64_MHz_XTAL BattleToads + 64'108'800, // 64.1088_MHz_XTAL HP Topcat high-res + 66'000'000, // 66_MHz_XTAL - + 66'666'700, // 66.6667_MHz_XTAL Later Midway games + 67'737'600, // 67.7376_MHz_XTAL PSX-based h/w, Sony ZN1-2-based + 68'850'000, // 68.85_MHz_XTAL Wyse WY-50 + 69'551'990, // 69.55199_MHz_XTAL Sharp X68000 31.5kHz video + 72'000'000, // 72_MHz_XTAL Aristocrat MKV + 72'576'000, // 72.576_MHz_XTAL Centipede, Millipede, Missile Command, Let's Go Bowling "Multipede" + 73'728'000, // 73.728_MHz_XTAL Ms. Pac-Man/Galaga 20th Anniversary + 75'000'000, // 75_MHz_XTAL Sony NEWS NWS-5000X + 77'414'400, // 77.4144_MHz_XTAL NCD17c + 80'000'000, // 80_MHz_XTAL ARM710 + 87'183'360, // 87.18336_MHz_XTAL AT&T 630 MTG + 92'940'500, // 92.9405_MHz_XTAL Sun cgthree + 96'000'000, // 96_MHz_XTAL Acorn A680 + 99'522'000, // 99.522_MHz_XTAL Radius Two Page Display + 100'000'000, // 100_MHz_XTAL PSX-based Namco System 12, Vegas, Sony ZN1-2-based + 101'491'200, // 101.4912_MHz_XTAL PSX-based Namco System 10 + 105'561'000, // 105.561_MHz_XTAL Sun cgsix + 108'108'000, // 108.108_MHz_XTAL HP 98550 high-res color card + 120'000'000, // 120_MHz_XTAL Astro Corp.'s Stone Age + 200'000'000 // 200_MHz_XTAL Base SH4 CPU (Naomi, Hikaru etc.) }; double XTAL::last_correct_value = -1; @@ -594,369 +596,3 @@ void XTAL::fail(double base_clock, const std::string &message) full_message += util::string_format(" Context: %s\n", message); fatalerror("%s\n", full_message); } - -/* - -For further reference: - -A search at http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=852333;keywords=cry -reveals the following shipping frequencies as of 1/1/2008: - -20kHz -25.600kHz -26.667kHz -28kHz - -30kHz -30.720kHz -30.76kHz -31.2kHz -31.25kHz -31.5kHz -32.000kHz -32.56kHz -32.768kHz -32.919kHz -34kHz -36kHz -38kHz -38.4kHz -39.500kHz - -40kHz -44.100kHz -46.604kHz -46.6084kHz - -50kHz -59.787kHz - -60.000kHz -60.002kHz -60.005kHz -65.535kHz -65.536kHz -69kHz - -70kHz -71kHz -72kHz -73kHz -74kHz -74.3kHz -74.4kHz -75kHz -76kHz -76.79kHz -76.8kHz -76.81kHz -77kHz -77.204kHz -77.287kHz -77.500kHz -77.503kHz -77.504kHz -78kHz -79kHz - -83kHz - -96kHz -96.006kHz - -100kHz -111kHz -117.72kHz -120kHz -120.8475kHz -125kHz -131.072kHz -149.475kHz -153.600kHz - -200kHz - -307.2kHz - -1.000MHz -1.8432MHz - -2.000MHz -2.048MHz -2.097152MHz -2.4576MHz -2.5MHz -2.560MHz -2.949120MHz - -3.000MHz -3.276MHz -3.2768MHz -3.579MHz -3.579545MHz -3.640MHz -3.6864MHz -3.700MHz -3.859MHz -3.93216MHz - -4.000MHz -4.032MHz -4.096MHz -4.09625MHz -4.194MHz -4.194304MHz -4.332MHz -4.433MHz -4.433616MHz -4.433618MHz -4.433619MHz -4.74687MHz -4.800MHz -4.8970MHz -4.90625MHz -4.915MHz -4.9152MHz - -5.000MHz -5.0688MHz -5.120MHz -5.223438MHz -5.5MHz -5.5296MHz -5.9904MHz - -6.000MHz -6.14MHz -6.144MHz -6.1760MHz -6.400 MHz -6.49830MHz -6.5MHz -6.5536MHz -6.612813MHz -6.7458MHz -6.757MHz -6.76438MHz - -7.1505MHz -7.15909 MHz -7.2MHz -7.3728MHz -7.68MHz -7.94888MHz - -8.000MHz -8.000156MHz -8.192MHz -8.388608MHz -8.432MHz -8.5MHz -8.6432MHz - -9.000MHz -9.216MHz -9.509375MHz -9.545MHz -9.6MHz -9.7941MHz -9.830MHz -9.8304MHz -9.84375MHz -9.8438MHz - -10.000MHz -10.240MHz -10.245MHz -10.6244MHz -10.738635MHz -10.73865MHz - -11.000MHz -11.046MHz -11.0592MHz -11.228MHz -11.2896MHz -11.520MHz -11.981350MHz - -12.000MHz -12.000393MHz -12.096MHz -12.1875MHz -12.288MHz -12.352MHz -12.500MHz -12.688MHz -12.800MHz -12.96MHz - -13.000MHz -13.0625MHz -13.225MHz -13.2256MHz -13.500MHz -13.5168MHz -13.56MHz -13.605MHz -13.824MHz -13.94916MHz - -14.00MHz -14.318MHz -14.31818MHz -14.3359MHz -14.3594MHz -14.4MHz -14.5MHz -14.69MHz -14.7456MHz -14.850MHz - -15MHz -15.360MHz - -16.000MHz -16.000312MHz -16.128MHz -16.257MHz -16.3676MHz -16.368MHz -16.384MHz -16.576MHz -16.6660MHz -16.667MHz -16.670MHz -16.800MHz -16.934MHz -16.9344MHz - -17.734475MHz - -18.000MHz -18.432MHz -18.869MHz - -19.200MHz -19.440MHz -19.660MHz -19.6608MHz -19.68MHz -19.800MHz - -20.000MHz -20.35625MHz -20.3563MHz -20.480MHz - -21.47727MHz - -22.000MHz -22.118MHz -22.1184MHz -22.400MHz -22.5MHz -22.5792MHz -22.6278MHz - -23MHz -23.2643MHz -23.5MHz -23.5122MHz -23.592MHz - -24.000MHz -24.00014MHz -24.5MHz -24.545454 MHz -24.5535MHz -24.576MHz -24.704MHz -24.7456MHz - -25.000MHz -25MHz -25.175MHz -25.2235MHz -25.4563MHz -25.5MHz - -26.000MHz -26.45125MHz -26.4513MHz -26.5MHz -26.5971MHz -26.800MHz - -27.000MHz -27.1344MHz -27.3067MHz -27.4688MHz - -28.000MHz -28.224MHz -28.259375MHz -28.2594MHz -28.322MHz -28.375MHz -28.5938MHz -28.636MHz -28.6363MHz -28.63636MHz - -29.4912MHz -29.498928MHz -29.500MHz - -30.000MHz -32.000MHz -32.514MHz -32.768MHz -33.000MHz -33.333MHz -33.3333MHz -33.8688MHz -35.2512MHz -35.3280MHz -36.000MHz -38.000MHz -38.00053MHz -38.400MHz -38.880MHz -39MHz - -40.000MHz -40.320MHz -40.960 MHz -42.000MHz -44.000MHz -44.2368MHz -44.545MHz -44.736MHz -44.800MHz -44.900MHz -45.000MHz -46.000MHz -48.000MHz -49.152MHz -49.86MHz - -50.000MHz -53.125MHz -55.000MHz - -60.000MHz -64.000MHz -66.000MHz -66.666MHz -66.6666MHz - -73.66979MHz -75.957292MHz -76.121875MHz - -80.000MHz - -100.00MHz - -*/ diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 3d6ee1bc1b717..7e17c1abaef02 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -28,6 +28,7 @@ #include "osdepend.h" #include +#include #include #include #include @@ -1931,7 +1932,7 @@ bool menu::check_metrics() render_target &target(render.ui_target()); std::pair const uisize(target.width(), target.height()); float const aspect = render.ui_aspect(&container()); - if ((uisize == m_last_size) && (aspect == m_last_aspect)) + if ((uisize == m_last_size) && (std::fabs(1.0F - (aspect / m_last_aspect)) < 1e-6F)) return false; m_last_size = uisize; diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp index c127762fae657..93a995a47fb68 100644 --- a/src/lib/formats/d88_dsk.cpp +++ b/src/lib/formats/d88_dsk.cpp @@ -477,6 +477,14 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve if(!head_count) return false; + int img_tracks, img_heads; + image.get_maximal_geometry(img_tracks, img_heads); + if (track_count > img_tracks) + osd_printf_warning("d88: Floppy disk has too many tracks for this drive (floppy tracks=%d, drive tracks=%d).\n", track_count, img_tracks); + + if (head_count > img_heads) + osd_printf_warning("d88: Floppy disk has excess of heads for this drive that will be discarded (floppy heads=%d, drive heads=%d).\n", head_count, img_heads); + uint32_t track_pos[164]; std::tie(err, actual) = read_at(io, 32, track_pos, 164*4); // FIXME: check for errors and premature EOF @@ -535,10 +543,12 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve sects[i].data = nullptr; } - if(density == 0x40) - build_pc_track_fm(track, head, image, cell_count / 2, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); - else - build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + if(head < img_heads) { + if(density == 0x40) + build_pc_track_fm(track, head, image, cell_count / 2, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + else + build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + } } return true; diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp index cb18b2036c9fa..fa4903447fb1d 100644 --- a/src/lib/formats/flopimg.cpp +++ b/src/lib/formats/flopimg.cpp @@ -39,6 +39,39 @@ floppy_image::~floppy_image() { } +void floppy_image::set_variant(uint32_t _variant) +{ + variant = _variant; + + // Initialize hard sectors + index_array.clear(); + + uint32_t sectors; + switch(variant) { + case SSDD16: + case SSQD16: + case DSDD16: + case DSQD16: + sectors = 16; + break; + default: + sectors = 0; + } + if(sectors) { + uint32_t sector_angle = 200000000/sectors; + for(int i = 1; i < sectors; i++) + index_array.push_back(i*sector_angle); + index_array.push_back((sectors-1)*sector_angle + sector_angle/2); + } +} + +void floppy_image::find_index_hole(uint32_t pos, uint32_t &last, uint32_t &next) const +{ + auto nexti = std::lower_bound(index_array.begin(), index_array.end(), pos+1); + next = nexti == index_array.end() ? 200000000 : *nexti; + last = nexti == index_array.begin() ? 0 : *--nexti; +} + void floppy_image::get_maximal_geometry(int &_tracks, int &_heads) const noexcept { _tracks = tracks; @@ -104,13 +137,30 @@ bool floppy_image::track_is_formatted(int track, int head, int subtrack) const n const char *floppy_image::get_variant_name(uint32_t form_factor, uint32_t variant) noexcept { switch(variant) { - case SSSD: return "Single side, single density"; - case SSDD: return "Single side, double density"; - case SSQD: return "Single side, quad density"; - case DSDD: return "Double side, double density"; - case DSQD: return "Double side, quad density"; - case DSHD: return "Double side, high density"; - case DSED: return "Double side, extended density"; + case SSSD: return "Single side, single density"; + case SSSD10: return "Single side, single density, 10-sector"; + case SSSD16: return "Single side, single density, 16-sector"; + case SSSD32: return "Single side, single density, 32-sector"; + case SSDD: return "Single side, double density"; + case SSDD10: return "Single side, double density, 10-sector"; + case SSDD16: return "Single side, double density, 16 hard sector"; + case SSDD32: return "Single side, double density, 32-sector"; + case SSQD: return "Single side, quad density"; + case SSQD10: return "Single side, quad density, 10-sector"; + case SSQD16: return "Single side, quad density, 16 hard sector"; + case DSSD: return "Double side, single density"; + case DSSD10: return "Double side, single density, 10-sector"; + case DSSD16: return "Double side, single density, 16-sector"; + case DSSD32: return "Double side, single density, 32-sector"; + case DSDD: return "Double side, double density"; + case DSDD10: return "Double side, double density, 10-sector"; + case DSDD16: return "Double side, double density, 16 hard sector"; + case DSDD32: return "Double side, double density, 32-sector"; + case DSQD: return "Double side, quad density"; + case DSQD10: return "Double side, quad density, 10-sector"; + case DSQD16: return "Double side, quad density, 16 hard sector"; + case DSHD: return "Double side, high density"; + case DSED: return "Double side, extended density"; } return "Unknown"; } diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index 4098ab3d4180b..18cc17ea73ba4 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -525,14 +525,30 @@ class floppy_image //! Variants enum { - SSSD = 0x44535353, //!< "SSSD", Single-sided single-density - SSDD = 0x44445353, //!< "SSDD", Single-sided double-density - SSQD = 0x44515353, //!< "SSQD", Single-sided quad-density - DSSD = 0x44535344, //!< "DSSD", Double-sided single-density - DSDD = 0x44445344, //!< "DSDD", Double-sided double-density (720K in 3.5, 360K in 5.25) - DSQD = 0x44515344, //!< "DSQD", Double-sided quad-density (720K in 5.25, means DD+80 tracks) - DSHD = 0x44485344, //!< "DSHD", Double-sided high-density (1440K) - DSED = 0x44455344 //!< "DSED", Double-sided extra-density (2880K) + SSSD = 0x44535353, //!< "SSSD", Single-sided single-density + SSSD10 = 0x30315353, //!< "SS10", Single-sided single-density 10 hard sector + SSSD16 = 0x36315353, //!< "SS16", Single-sided single-density 16 hard sector + SSSD32 = 0x32335353, //!< "SS32", Single-sided single-density 32 hard sector + SSDD = 0x44445353, //!< "SSDD", Single-sided double-density + SSDD10 = 0x30314453, //!< "SD10", Single-sided double-density 10 hard sector + SSDD16 = 0x36314453, //!< "SD16", Single-sided double-density 16 hard sector + SSDD32 = 0x32334453, //!< "SD32", Single-sided double-density 32 hard sector + SSQD = 0x44515353, //!< "SSQD", Single-sided quad-density + SSQD10 = 0x30315153, //!< "SQ10", Single-sided quad-density 10 hard sector + SSQD16 = 0x36315153, //!< "SQ16", Single-sided quad-density 16 hard sector + DSSD = 0x44535344, //!< "DSSD", Double-sided single-density + DSSD10 = 0x30315344, //!< "DS10", Double-sided single-density 10 hard sector + DSSD16 = 0x36315344, //!< "DS16", Double-sided single-density 16 hard sector + DSSD32 = 0x32335344, //!< "DS32", Double-sided single-density 32 hard sector + DSDD = 0x44445344, //!< "DSDD", Double-sided double-density (720K in 3.5, 360K in 5.25) + DSDD10 = 0x30314444, //!< "DD10", Double-sided double-density 10 hard sector + DSDD16 = 0x36314444, //!< "DD16", Double-sided double-density 16 hard sector (360K in 5.25) + DSDD32 = 0x32334444, //!< "DD32", Double-sided double-density 32 hard sector + DSQD = 0x44515344, //!< "DSQD", Double-sided quad-density (720K in 5.25, means DD+80 tracks) + DSQD10 = 0x30315144, //!< "DQ10", Double-sided quad-density 10 hard sector + DSQD16 = 0x36315144, //!< "DQ16", Double-sided quad-density 16 hard sector (720K in 5.25, means DD+80 tracks) + DSHD = 0x44485344, //!< "DSHD", Double-sided high-density (1440K) + DSED = 0x44455344 //!< "DSED", Double-sided extra-density (2880K) }; //! Encodings @@ -542,6 +558,14 @@ class floppy_image M2FM = 0x4D32464D //!< "M2FM", modified modified frequency modulation }; + //! Sectoring + enum { + SOFT = 0x54464F53, //!< "SOFT", Soft-sectored + H10 = 0x20303148, //!< "H10 ", Hard 10-sectored + H16 = 0x20363148, //!< "H16 ", Hard 16-sectored + H32 = 0x20323348 //!< "H32 ", Hard 32-sectored (8 inch disk) + }; + // construction/destruction @@ -558,10 +582,25 @@ class floppy_image uint32_t get_form_factor() const noexcept { return form_factor; } //! @return the variant. uint32_t get_variant() const noexcept { return variant; } + //! @return the disk sectoring. + uint32_t get_sectoring() const noexcept { return sectoring; } //! @param v the variant. - void set_variant(uint32_t v) { variant = v; } + void set_variant(uint32_t v); //! @param v the variant. - void set_form_variant(uint32_t f, uint32_t v) { if(form_factor == FF_UNKNOWN) form_factor = f; variant = v; } + void set_form_variant(uint32_t f, uint32_t v) { if(form_factor == FF_UNKNOWN) form_factor = f; set_variant(v); } + //! @param s the sectoring. + void set_sectoring(uint32_t s) { sectoring = s; } + + //! Find most recent and next index hole for provided angular position. + //! The most recent hole may be equal to provided position. The next + //! hole will be 200000000 if all holes of the current rotation are in + //! the past. + + /*! @param pos angular position + @param last most recent index hole + @param next next index hole + */ + void find_index_hole(uint32_t pos, uint32_t &last, uint32_t &next) const; /*! @param track @@ -608,7 +647,7 @@ class floppy_image private: int tracks, heads; - uint32_t form_factor, variant; + uint32_t form_factor, variant, sectoring; struct track_info { @@ -621,6 +660,14 @@ class floppy_image // track number multiplied by 4 then head // last array size may be bigger than actual track size std::vector > track_array; + + // Additional index holes in increasing order. Entries are absolute + // positions of index holes in the same units as cell_data. The + // positions are the start of the hole, not the center of the hole. The + // hole at angular position 0 is implicit, so an empty list encodes a + // regular soft-sectored disk. Additional holes are found on + // hard-sectored disks. + std::vector index_array; }; #endif // MAME_FORMATS_FLOPIMG_H diff --git a/src/lib/formats/fs_unformatted.cpp b/src/lib/formats/fs_unformatted.cpp index df618c6485d8a..995c2b761485b 100644 --- a/src/lib/formats/fs_unformatted.cpp +++ b/src/lib/formats/fs_unformatted.cpp @@ -35,11 +35,15 @@ void unformatted_image::enumerate_f(floppy_enumerator &fe) const u32 best_525 = form_factor == floppy_image::FF_525 ? - has_variant(variants, floppy_image::DSHD) ? FSI_525_DSHD : - has_variant(variants, floppy_image::DSQD) ? FSI_525_DSQD : - has_variant(variants, floppy_image::DSDD) ? FSI_525_DSDD : - has_variant(variants, floppy_image::SSQD) ? FSI_525_SSQD : - has_variant(variants, floppy_image::SSDD) ? FSI_525_SSDD : FSI_525_SSSD + has_variant(variants, floppy_image::DSHD) ? FSI_525_DSHD : + has_variant(variants, floppy_image::DSQD16) ? FSI_525_DSQD16 : + has_variant(variants, floppy_image::DSQD) ? FSI_525_DSQD : + has_variant(variants, floppy_image::DSDD16) ? FSI_525_DSDD16 : + has_variant(variants, floppy_image::DSDD) ? FSI_525_DSDD : + has_variant(variants, floppy_image::SSQD16) ? FSI_525_SSQD16 : + has_variant(variants, floppy_image::SSQD) ? FSI_525_SSQD : + has_variant(variants, floppy_image::SSDD16) ? FSI_525_SSDD16 : + has_variant(variants, floppy_image::SSDD) ? FSI_525_SSDD : FSI_525_SSSD : FSI_NONE; u32 best_35 = @@ -61,14 +65,22 @@ void unformatted_image::enumerate_f(floppy_enumerator &fe) const if(all || best_525 == FSI_525_DSHD) fe.add_raw("u525dshd", FSI_525_DSHD, "Unformatted 5\"25 double-sided high-density"); + if(all || best_525 == FSI_525_DSQD16) + fe.add_raw("u525dsqd16", FSI_525_DSQD16, "Unformatted 5\"25 double-sided quad-density 16 hard sectors"); if(all || best_525 == FSI_525_DSQD) fe.add_raw("u525dsqd", FSI_525_DSQD, "Unformatted 5\"25 double-sided quad-density"); + if(all || best_525 == FSI_525_DSDD16) + fe.add_raw("u525dsdd16", FSI_525_DSDD16, "Unformatted 5\"25 double-sided double-density 16 hard sectors"); if(all || best_525 == FSI_525_DSDD) fe.add_raw("u525dsdd", FSI_525_DSDD, "Unformatted 5\"25 double-sided double-density"); if(all) fe.add_raw("u525dssd", FSI_525_DSSD, "Unformatted 5\"25 double-sided single-density"); + if(all || best_525 == FSI_525_SSQD16) + fe.add_raw("u525ssqd16", FSI_525_SSQD16, "Unformatted 5\"25 single-sided quad-density 16 hard sectors"); if(all || best_525 == FSI_525_SSQD) fe.add_raw("u525ssqd", FSI_525_SSQD, "Unformatted 5\"25 single-sided quad-density"); + if(all || best_525 == FSI_525_SSDD16) + fe.add_raw("u525ssdd16", FSI_525_SSDD16, "Unformatted 5\"25 single-sided double-density 16 hard sectors"); if(all || best_525 == FSI_525_SSDD) fe.add_raw("u525ssdd", FSI_525_SSDD, "Unformatted 5\"25 single-sided double-density"); if(all || best_525 == FSI_525_SSSD) @@ -96,13 +108,17 @@ void unformatted_image::format(u32 key, floppy_image *image) case FSI_8_DSSD: image->set_form_variant(floppy_image::FF_8, floppy_image::DSSD); break; case FSI_8_SSSD: image->set_form_variant(floppy_image::FF_8, floppy_image::SSSD); break; - case FSI_525_DSHD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSHD); break; - case FSI_525_DSQD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSQD); break; - case FSI_525_DSDD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSDD); break; - case FSI_525_DSSD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSSD); break; - case FSI_525_SSQD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSQD); break; - case FSI_525_SSDD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSDD); break; - case FSI_525_SSSD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD); break; + case FSI_525_DSHD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSHD); break; + case FSI_525_DSQD16: image->set_form_variant(floppy_image::FF_525, floppy_image::DSQD16); break; + case FSI_525_DSQD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSQD); break; + case FSI_525_DSDD16: image->set_form_variant(floppy_image::FF_525, floppy_image::DSDD16); break; + case FSI_525_DSDD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSDD); break; + case FSI_525_DSSD: image->set_form_variant(floppy_image::FF_525, floppy_image::DSSD); break; + case FSI_525_SSQD16: image->set_form_variant(floppy_image::FF_525, floppy_image::SSQD16); break; + case FSI_525_SSQD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSQD); break; + case FSI_525_SSDD16: image->set_form_variant(floppy_image::FF_525, floppy_image::SSDD16); break; + case FSI_525_SSDD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSDD); break; + case FSI_525_SSSD: image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD); break; case FSI_35_DSED: image->set_form_variant(floppy_image::FF_35, floppy_image::DSED); break; case FSI_35_DSHD: image->set_form_variant(floppy_image::FF_35, floppy_image::DSHD); break; diff --git a/src/lib/formats/fs_unformatted.h b/src/lib/formats/fs_unformatted.h index 949bb6aae0883..fa51049f38409 100644 --- a/src/lib/formats/fs_unformatted.h +++ b/src/lib/formats/fs_unformatted.h @@ -25,10 +25,14 @@ class unformatted_image : public manager_t { FSI_525_SSSD, FSI_525_SSDD, + FSI_525_SSDD16, FSI_525_SSQD, + FSI_525_SSQD16, FSI_525_DSSD, FSI_525_DSDD, + FSI_525_DSDD16, FSI_525_DSQD, + FSI_525_DSQD16, FSI_525_DSHD, FSI_35_SSDD, diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp index e8ab99ee85239..eb1e632ec03db 100644 --- a/src/lib/formats/mfi_dsk.cpp +++ b/src/lib/formats/mfi_dsk.cpp @@ -42,8 +42,10 @@ - 2, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing - 3, MG_E -> End of zone - Tracks data is aligned so that the index pulse is at the start, - whether the disk is hard-sectored or not. + Tracks data is aligned so that the index pulse is at the start for soft- + sectored disks. For hard-sectored disks, the sector hole for the first + sector is at the start and the index hole is half a sector from the end + of the track. The position is the angular position in units of 1/200,000,000th of a turn. A size in such units, not coincidentally at all, is also @@ -59,7 +61,9 @@ if you try to rewrite a physical disk with the data. Some preservation formats encode that information, it is guessed for others. The write track function of fdcs should set it. The - representation is the angular position relative to the index. + representation is the angular position relative to the index, for + soft-sectored disks, and the first sector hole for hard-sectored + disks. The media type is divided in two parts. The first half indicate the physical form factor, i.e. all medias with that diff --git a/src/lib/formats/oric_dsk.cpp b/src/lib/formats/oric_dsk.cpp index 23433f1c3aa9d..15bb5ce1455e7 100644 --- a/src/lib/formats/oric_dsk.cpp +++ b/src/lib/formats/oric_dsk.cpp @@ -12,6 +12,7 @@ #include "ioprocs.h" #include "multibyte.h" +#include "osdcore.h" #include @@ -68,6 +69,17 @@ bool oric_dsk_format::load(util::random_read &io, uint32_t form_factor, const st int sides = get_u32le(&h[ 8]); int tracks = get_u32le(&h[12]); + int max_tracks, max_sides; + image.get_maximal_geometry(max_tracks, max_sides); + if (tracks > max_tracks) { + osd_printf_error("oric_dsk: Floppy disk has too many tracks for this drive (floppy tracks=%d, drive tracks=%d).\n", tracks, max_tracks); + return false; + } + if (sides > max_sides) { + osd_printf_warning("oric_dsk: Floppy disk has excess of heads for this drive that will be discarded (floppy heads=%d, drive heads=%d).\n", sides, max_sides); + sides = max_sides; + } + for(int side=0; sideread() & 0x01) m_ldor_shift_reg = 0; // open the Logic door clears the shift register - return (m_ldor_shift_reg & 0x80) | 0x60 | ((m_hopper_test && m_hopper->line_r()) ? 0x10 : 0x00); + return (m_ldor_shift_reg & 0x80) | 0x60 | ((m_hopper_test && !m_hopper->line_r()) ? 0x10 : 0x00); } void aristmk5_state::ldor_clk_w(uint8_t data) @@ -1280,10 +1280,10 @@ void aristmk5_state::aristmk5_drame_map(address_map &map) int aristmk5_state::hopper_r() { - return (m_hopper_test && m_hopper->line_r()) ? 0 : 1; + return (m_hopper_test && !m_hopper->line_r()) ? 0 : 1; } -CUSTOM_INPUT_MEMBER(aristmk5_state::coin_usa_r) +ioport_value aristmk5_state::coin_usa_r() { // ---x Coin Acceptor // --x- Credit Sense @@ -1313,7 +1313,7 @@ CUSTOM_INPUT_MEMBER(aristmk5_state::coin_usa_r) return data; } -CUSTOM_INPUT_MEMBER(aristmk5_state::coin_r) +ioport_value aristmk5_state::coin_r() { uint8_t data = 0x01; @@ -2422,7 +2422,7 @@ void aristmk5_state::aristmk5(machine_config &config) DS1302(config, m_rtc, 32.768_kHz_XTAL); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); // some games (jungjuic, penpir2) use the IOC KART interface for debug rs232_port_device &rs232(RS232_PORT(config, "kart", default_rs232_devices, nullptr)); diff --git a/src/mame/acorn/riscpc.cpp b/src/mame/acorn/riscpc.cpp index 4c71ed8770560..b64d93a06dc39 100644 --- a/src/mame/acorn/riscpc.cpp +++ b/src/mame/acorn/riscpc.cpp @@ -16,7 +16,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/acorn_vidc.h" #include "machine/arm_iomd.h" #include "machine/i2cmem.h" diff --git a/src/mame/acorn/ssfindo.cpp b/src/mame/acorn/ssfindo.cpp index abc836fa19279..d97a511a5754b 100644 --- a/src/mame/acorn/ssfindo.cpp +++ b/src/mame/acorn/ssfindo.cpp @@ -128,7 +128,6 @@ PCB Layout #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/acorn_vidc.h" #include "machine/arm_iomd.h" #include "machine/i2cmem.h" diff --git a/src/mame/adc/super6.cpp b/src/mame/adc/super6.cpp index b1b7bc96d066e..6afe2d17f0da4 100644 --- a/src/mame/adc/super6.cpp +++ b/src/mame/adc/super6.cpp @@ -2,20 +2,17 @@ // copyright-holders:Curt Coder /* - -ToDo: +TODO: - peripheral interfaces - Fix floppy. It needs to WAIT the cpu whenever port 0x14 is read, wait for either DRQ or INTRQ to assert, then release the cpu and then do the - actual port read. Our Z80 cannot do that. + actual port read. But it doesn't work properly at the moment. It gets stuck + if you load up the cpm disk (from software list). The other disks are useless. + The schematic isn't clear, but it seems the 2 halves of U16 (as shown) have a common element, so that activity on one side can affect what happens on the other side. - If you uncomment the line in fdc_intrq_w, and change the BOGUSWAIT to WAIT - in fdc_r, then load up the cpm disk (from software list), it will read the - CP/M boot track into memory and attempt to run it. However, it has an issue - and returns to the monitor. The other disks are useless. */ @@ -201,7 +198,16 @@ uint8_t super6_state::fdc_r() */ - m_maincpu->set_input_line(Z80_INPUT_LINE_BOGUSWAIT, ASSERT_LINE); + if (!machine().side_effects_disabled()) + { + if (!m_z80_wait) + { + m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE); + m_maincpu->defer_access(); + } + + m_z80_wait = !m_z80_wait; + } return m_fdc->intrq_r() ? 0x7f : 0xff; } @@ -384,7 +390,6 @@ void super6_state::fdc_intrq_w(int state) if (state) m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, CLEAR_LINE); m_ctc->trg3(state); // J6 pin 7-8 - // m_maincpu->set_state_int(Z80_AF, 0x7f00); // hack, see notes } void super6_state::fdc_drq_w(int state) @@ -420,6 +425,7 @@ void super6_state::fdc_drq_w(int state) void super6_state::machine_start() { // state saving + save_item(NAME(m_z80_wait)); save_item(NAME(m_s100)); save_item(NAME(m_bank0)); save_item(NAME(m_bank1)); @@ -428,6 +434,7 @@ void super6_state::machine_start() void super6_state::machine_reset() { + m_z80_wait = false; m_bank0 = m_bank1 = 0; bankswitch(); diff --git a/src/mame/adc/super6.h b/src/mame/adc/super6.h index db0cdb58019e5..78dc74d2b6a5c 100644 --- a/src/mame/adc/super6.h +++ b/src/mame/adc/super6.h @@ -80,6 +80,8 @@ class super6_state : public driver_device required_region_ptr m_rom; required_ioport m_j7; + bool m_z80_wait = false; + // memory state uint8_t m_s100 = 0; uint8_t m_bank0 = 0; diff --git a/src/mame/alpha/alpha8201.cpp b/src/mame/alpha/alpha8201.cpp index 23c1578264d52..b28374ccc3cde 100644 --- a/src/mame/alpha/alpha8201.cpp +++ b/src/mame/alpha/alpha8201.cpp @@ -405,14 +405,14 @@ void alpha_8201_device::bus_dir_w(int state) // set RAM bus direction to 0: external, 1: MCU side // selects one of two 74LS245 (octal bus transceiver) for databus, address bus via // a couple of 74LS157 (2-input multiplexer) - m_bus = (state) ? 1 : 0; + m_bus = state ? 1 : 0; mcu_writeram(); } void alpha_8201_device::mcu_start_w(int state) { // connected to MCU INT0 - m_mcu->set_input_line(0, (state) ? ASSERT_LINE : CLEAR_LINE); + m_mcu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); } u8 alpha_8201_device::ext_ram_r(offs_t offset) diff --git a/src/mame/altos/altos5.cpp b/src/mame/altos/altos5.cpp index ce80a963dc110..a927b99da0ebc 100644 --- a/src/mame/altos/altos5.cpp +++ b/src/mame/altos/altos5.cpp @@ -302,37 +302,38 @@ void altos5_state::port09_w(uint8_t data) QUICKLOAD_LOAD_MEMBER(altos5_state::quickload_cb) { - address_space& prog_space = m_maincpu->space(AS_PROGRAM); - - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); - setup_banks(2); - /* Avoid loading a program if CP/M-80 is not in memory */ + address_space& prog_space = m_maincpu->space(AS_PROGRAM); + + // Avoid loading a program if CP/M-80 is not in memory if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) { machine_reset(); - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); } - /* Load image to the TPA (Transient Program Area) */ + const int mem_avail = 256 * prog_space.read_byte(7) + prog_space.read_byte(6) - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); + + // Load image to the TPA (Transient Program Area) uint16_t quickload_size = image.length(); for (uint16_t i = 0; i < quickload_size; i++) { uint8_t data; - - if (image.fread( &data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - prog_space.write_byte(i+0x100, data); + if (image.fread(&data, 1) != 1) + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + prog_space.write_byte(i + 0x100, data); } - /* clear out command tail */ - prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); + // clear out command tail + prog_space.write_byte(0x80, 0); + prog_space.write_byte(0x81, 0); - /* Roughly set SP basing on the BDOS position */ - m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 300); - m_maincpu->set_pc(0x100); // start program + // Roughly set SP basing on the BDOS position + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } diff --git a/src/mame/altos/altos586.cpp b/src/mame/altos/altos586.cpp index d6b58b02751b0..b495a34295111 100644 --- a/src/mame/altos/altos586.cpp +++ b/src/mame/altos/altos586.cpp @@ -143,21 +143,21 @@ class altos586_mmu_device : public device_t, public device_memory_interface u16 m_err_addr2; enum : u16 { - INVALID_INSN = 0x0001, // Invalid Instruction - END_OF_STACK = 0x0008, // End of Stack Warning - SYS_W_VIOLATION = 0x0010, // System write Violation - USER_W_VIOLATION = 0x0080, // User Mode Write Violation - IOP_W_VIOLATION = 0x0400, // I/O Processor Write Violation - USER_ACC_VIOLATION = 0x0800, // User Mode Access Violation + INVALID_INSN = 0x0001, // Invalid Instruction + END_OF_STACK = 0x0008, // End of Stack Warning + SYS_W_VIOLATION = 0x0010, // System write Violation + USER_W_VIOLATION = 0x0080, // User Mode Write Violation + IOP_W_VIOLATION = 0x0400, // I/O Processor Write Violation + USER_ACC_VIOLATION = 0x0800, // User Mode Access Violation }; u16 m_violation; enum { - IOP_W = 11, // Allow I/O Processor Write - SYS_W = 12, // Allow System Write - STACK_BOUND = 13, // Stack Boundary Page - USER_ACC = 14, // Allow User Access - USER_W = 15, // Allow User Write + IOP_W = 11, // Allow I/O Processor Write + SYS_W = 12, // Allow System Write + STACK_BOUND = 13, // Stack Boundary Page + USER_ACC = 14, // Allow User Access + USER_W = 15, // Allow User Write }; u16 m_map_ram[256]; }; @@ -499,17 +499,17 @@ void altos586_state::iop_io(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(altos586_state::hiaddr_w)); // 0x00 Address Latch - map(0x20, 0x23).rw("iop_pit0", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); // 0x20 PIT 0 - map(0x24, 0x27).rw("iop_pit1", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); // 0x24 PIT 1 - map(0x28, 0x2b).rw("iop_sio0", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x28 SIO 0 - map(0x2c, 0x2f).rw("iop_sio1", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x2C SIO 1 - map(0x30, 0x33).rw("iop_sio2", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x30 SIO 2 - map(0x34, 0x37).rw("iop_pio", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); // 0x34 PIO - map(0x38, 0x3b).rw(m_fdc, FUNC(fd1797_device::read), FUNC(fd1797_device::write)); // 0x38 FDC - map(0x3c, 0x3f).rw("iop_dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); // 0x3C DMA - map(0x40, 0x40).noprw(); // 0x40 DMA - Clear carrier sense and parity error bit - map(0x80, 0x9f).rw("iop_rtc", FUNC(mm58167_device::read), FUNC(mm58167_device::write)); // 0x80 RTC - Counter - thousandths of seconds + map(0x00, 0x00).w(FUNC(altos586_state::hiaddr_w)); // 0x00 Address Latch + map(0x20, 0x23).rw("iop_pit0", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); // 0x20 PIT 0 + map(0x24, 0x27).rw("iop_pit1", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); // 0x24 PIT 1 + map(0x28, 0x2b).rw("iop_sio0", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x28 SIO 0 + map(0x2c, 0x2f).rw("iop_sio1", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x2C SIO 1 + map(0x30, 0x33).rw("iop_sio2", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w)); // 0x30 SIO 2 + map(0x34, 0x37).rw("iop_pio", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); // 0x34 PIO + map(0x38, 0x3b).rw(m_fdc, FUNC(fd1797_device::read), FUNC(fd1797_device::write)); // 0x38 FDC + map(0x3c, 0x3f).rw("iop_dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); // 0x3C DMA + map(0x40, 0x40).noprw(); // 0x40 DMA - Clear carrier sense and parity error bit + map(0x80, 0x9f).rw("iop_rtc", FUNC(mm58167_device::read), FUNC(mm58167_device::write)); // 0x80 RTC - Counter - thousandths of seconds // 0x60 586T Generate MULTIBUS interrupt } diff --git a/src/mame/altos/altos586_hdc.cpp b/src/mame/altos/altos586_hdc.cpp index 37bef261b1c47..d70dd39bc7a52 100644 --- a/src/mame/altos/altos586_hdc.cpp +++ b/src/mame/altos/altos586_hdc.cpp @@ -29,13 +29,13 @@ [2] Preliminary 8600 User Manual Section 7. System Specs. - 4.5. Rigid Disk Controllers and Interface - Specification Revision 4.2, May 27, 1982, Page 52-62 + 4.5. Rigid Disk Controllers and Interface + Specification Revision 4.2, May 27, 1982, Page 52-62 [3] Preliminary 8600 User Manual Section 7. System Specs. - A. Rigid Disk Controller Documentation - Specification Revision 4.2, May 27, 1982, Page 95-108 + A. Rigid Disk Controller Documentation + Specification Revision 4.2, May 27, 1982, Page 95-108 Note: The Altos 8600 manuals [2] and [3] describe a controller wired differently (the 8089 seems to be in local mode, not remote), @@ -369,13 +369,13 @@ void altos586_hdc_device::attn_w(uint16_t data) void altos586_hdc_device::device_start() { - save_item(NAME(m_status)); - save_item(NAME(m_seek_status)); - save_item(NAME(m_cyl_latch)); - save_item(NAME(m_cyl[0])); - save_item(NAME(m_cyl[1])); - save_pointer(NAME(m_sector), std::size(m_sector)); - save_item(NAME(m_secoffset)); - save_item(NAME(m_drive)); - save_item(NAME(m_head)); + save_item(NAME(m_status)); + save_item(NAME(m_seek_status)); + save_item(NAME(m_cyl_latch)); + save_item(NAME(m_cyl[0])); + save_item(NAME(m_cyl[1])); + save_pointer(NAME(m_sector), std::size(m_sector)); + save_item(NAME(m_secoffset)); + save_item(NAME(m_drive)); + save_item(NAME(m_head)); } diff --git a/src/mame/amiga/alg.cpp b/src/mame/amiga/alg.cpp index 14e1401aeb9c6..74eb266fd700b 100644 --- a/src/mame/amiga/alg.cpp +++ b/src/mame/amiga/alg.cpp @@ -70,7 +70,7 @@ class alg_state : public amiga_state , m_triggers(*this, "TRIGGERS") { } - DECLARE_CUSTOM_INPUT_MEMBER(lightgun_pos_r); + ioport_value lightgun_pos_r(); int lightgun_trigger_r(); int lightgun_holster_r(); @@ -167,7 +167,7 @@ void alg_state::potgo_w(uint16_t data) } -CUSTOM_INPUT_MEMBER(alg_state::lightgun_pos_r) +ioport_value alg_state::lightgun_pos_r() { int x = 0, y = 0; diff --git a/src/mame/amiga/amiga.cpp b/src/mame/amiga/amiga.cpp index b85916308c914..7e96618939355 100644 --- a/src/mame/amiga/amiga.cpp +++ b/src/mame/amiga/amiga.cpp @@ -576,7 +576,7 @@ class cd32_state : public amiga_state void handle_joystick_cia(u8 pra, u8 dra); u16 handle_joystick_potgor(u16 potgor); - DECLARE_CUSTOM_INPUT_MEMBER( cd32_input ); + ioport_value cd32_input(); template int cd32_sel_mirror_input(); void init_pal(); @@ -1165,7 +1165,7 @@ u16 cd32_state::handle_joystick_potgor(u16 potgor) return potgor; } -CUSTOM_INPUT_MEMBER( cd32_state::cd32_input ) +ioport_value cd32_state::cd32_input() { return handle_joystick_potgor(m_potgo_value) >> 8; } @@ -1495,7 +1495,7 @@ void a4000_state::a4000t_mem(address_map &map) //************************************************************************** template -CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert ) +ioport_value amiga_state::amiga_joystick_convert() { uint8_t bits = m_joy_ports[P].read_safe(0xff); diff --git a/src/mame/amiga/amiga.h b/src/mame/amiga/amiga.h index 2ecbe1d877dde..517bd85d3f231 100644 --- a/src/mame/amiga/amiga.h +++ b/src/mame/amiga/amiga.h @@ -442,8 +442,8 @@ class amiga_state : public driver_device TIMER_CALLBACK_MEMBER( blitter_process_callback ); void update_irqs(); - template DECLARE_CUSTOM_INPUT_MEMBER( amiga_joystick_convert ); - DECLARE_CUSTOM_INPUT_MEMBER( floppy_drive_status ); + template ioport_value amiga_joystick_convert(); + ioport_value floppy_drive_status(); void m68k_reset(int state); void kbreset_w(int state); diff --git a/src/mame/amiga/amiga_m.cpp b/src/mame/amiga/amiga_m.cpp index 15f1739aea0ce..6f5c074bb5332 100644 --- a/src/mame/amiga/amiga_m.cpp +++ b/src/mame/amiga/amiga_m.cpp @@ -1048,7 +1048,7 @@ void amiga_state::gayle_cia_w(offs_t offset, uint16_t data, uint16_t mem_mask) cia_w(offset, data, mem_mask); } -CUSTOM_INPUT_MEMBER( amiga_state::floppy_drive_status ) +ioport_value amiga_state::floppy_drive_status() { return m_fdc->ciaapra_r(); } diff --git a/src/mame/amiga/arsystems.cpp b/src/mame/amiga/arsystems.cpp index 53cf48f1100d1..4f8de48a7e117 100644 --- a/src/mame/amiga/arsystems.cpp +++ b/src/mame/amiga/arsystems.cpp @@ -90,7 +90,7 @@ class arcadia_amiga_state : public amiga_state void init_dlta(); void init_argh(); - template DECLARE_CUSTOM_INPUT_MEMBER(coin_counter_r); + template ioport_value coin_counter_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_changed_callback); protected: @@ -167,7 +167,7 @@ void arcadia_amiga_state::arcadia_cia_0_portb_w(uint8_t data) *************************************/ template -CUSTOM_INPUT_MEMBER(arcadia_amiga_state::coin_counter_r) +ioport_value arcadia_amiga_state::coin_counter_r() { /* return coin counter values */ return m_coin_counter[Coin] & 3; diff --git a/src/mame/amiga/cubo.cpp b/src/mame/amiga/cubo.cpp index 9a31cb65c426d..981411dc6a494 100644 --- a/src/mame/amiga/cubo.cpp +++ b/src/mame/amiga/cubo.cpp @@ -343,7 +343,7 @@ class cubo_state : public amiga_state void handle_joystick_cia(uint8_t pra, uint8_t dra); uint16_t handle_joystick_potgor(uint16_t potgor); - DECLARE_CUSTOM_INPUT_MEMBER(cubo_input); + ioport_value cubo_input(); template int cd32_sel_mirror_input(); void akiko_int_w(int state); @@ -537,7 +537,7 @@ uint16_t cubo_state::handle_joystick_potgor(uint16_t potgor) return potgor; } -CUSTOM_INPUT_MEMBER( cubo_state::cubo_input ) +ioport_value cubo_state::cubo_input() { return handle_joystick_potgor(m_potgo_value) >> 8; } diff --git a/src/mame/amstrad/pcw.cpp b/src/mame/amstrad/pcw.cpp index d1290189727a9..bac4f6b2333f4 100644 --- a/src/mame/amstrad/pcw.cpp +++ b/src/mame/amstrad/pcw.cpp @@ -1236,7 +1236,7 @@ static void pcw_ssfloppies(device_slot_interface &device) static void pcw_dsfloppies(device_slot_interface &device) { - device.option_add("3dsdd", FLOPPY_3_DSDD); + device.option_add("3dsqd", FLOPPY_3_DSQD); } static void pcw_35floppies(device_slot_interface &device) @@ -1321,7 +1321,7 @@ void pcw_state::pcw8512(machine_config &config) m_palette->set_init(FUNC(pcw_state::set_8xxx_palette)); FLOPPY_CONNECTOR(config, "upd765:0", pcw_ssfloppies, "3ssdd", floppy_image_device::default_mfm_floppy_formats); - FLOPPY_CONNECTOR(config, "upd765:1", pcw_dsfloppies, "3dsdd", floppy_image_device::default_mfm_floppy_formats); + FLOPPY_CONNECTOR(config, "upd765:1", pcw_dsfloppies, "3dsqd", floppy_image_device::default_mfm_floppy_formats); screen_device &printer(SCREEN(config, "printer", SCREEN_TYPE_RASTER)); printer.set_refresh_hz(50); @@ -1342,7 +1342,7 @@ void pcw_state::pcw9512(machine_config &config) pcw(config); m_palette->set_init(FUNC(pcw_state::set_9xxx_palette)); - FLOPPY_CONNECTOR(config, "upd765:0", pcw_dsfloppies, "3dsdd", floppy_image_device::default_mfm_floppy_formats); + FLOPPY_CONNECTOR(config, "upd765:0", pcw_dsfloppies, "3dsqd", floppy_image_device::default_mfm_floppy_formats); FLOPPY_CONNECTOR(config, "upd765:1", pcw_dsfloppies, nullptr, floppy_image_device::default_mfm_floppy_formats); m_maincpu->set_addrmap(AS_IO, &pcw_state::pcw9512_io); diff --git a/src/mame/apple/apple2.cpp b/src/mame/apple/apple2.cpp index 2ff28d763352c..37d068bbaa8e5 100644 --- a/src/mame/apple/apple2.cpp +++ b/src/mame/apple/apple2.cpp @@ -1155,7 +1155,7 @@ void apple2_state::apple2_common(machine_config &config) m_softlatch->q_out_cb<6>().append(m_video, FUNC(a2_video_device::an2_w)); m_softlatch->q_out_cb<7>().set(m_gameio, FUNC(apple2_gameio_device::an3_w)); - APPLE2_GAMEIO(config, m_gameio, apple2_gameio_device::iiandplus_options, nullptr); + APPLE2_GAMEIO(config, m_gameio, m_screen, apple2_gameio_device::iiandplus_options, nullptr); /* keyboard controller */ AY3600(config, m_ay3600, 0); diff --git a/src/mame/apple/apple2e.cpp b/src/mame/apple/apple2e.cpp index 73bddb30d9d9a..81c2905b0ed39 100644 --- a/src/mame/apple/apple2e.cpp +++ b/src/mame/apple/apple2e.cpp @@ -1037,6 +1037,13 @@ void apple2e_state::machine_start() m_joystick_x1_time = m_joystick_x2_time = m_joystick_y1_time = m_joystick_y2_time = 0; m_reset_latch = false; + last_mx = 0; + last_my = 0; + count_x = 0; + count_y = 0; + m_x0 = false; + m_y0 = false; + // setup save states save_item(NAME(m_speaker_state)); save_item(NAME(m_cassette_state)); @@ -1165,6 +1172,8 @@ void apple2e_state::machine_reset() m_xy = false; m_x0edge = false; m_y0edge = false; + m_x1 = false; + m_y1 = false; m_xirq = false; m_yirq = false; m_mockingboard4c = false; @@ -2681,6 +2690,7 @@ void apple2e_state::c000_iic_w(offs_t offset, u8 data) void apple2e_state::update_iic_mouse() { int new_mx, new_my; + bool raise_mousexy_irq = false; // read the axes and check for changes new_mx = m_mousex->read(); @@ -2750,13 +2760,14 @@ void apple2e_state::update_iic_mouse() if (m_xy) { m_xirq = true; - raise_irq(IRQ_MOUSEXY); + raise_mousexy_irq = true; } } m_x0 = !m_x0; } - else if (count_y) + + if (count_y) { if (count_y < 0) { @@ -2776,12 +2787,17 @@ void apple2e_state::update_iic_mouse() if (m_xy) { m_yirq = true; - raise_irq(IRQ_MOUSEXY); + raise_mousexy_irq = true; } } m_y0 = !m_y0; } + + if (raise_mousexy_irq) + { + raise_irq(IRQ_MOUSEXY); + } } u8 apple2e_state::laser_mouse_r(offs_t offset) @@ -4374,10 +4390,10 @@ static INPUT_PORTS_START( apple2c ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) PORT_START(MOUSE_XAXIS_TAG) /* Mouse - X AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_START(MOUSE_YAXIS_TAG) /* Mouse - Y AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END static INPUT_PORTS_START( laser128 ) @@ -4397,10 +4413,10 @@ static INPUT_PORTS_START( laser128 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) PORT_START(MOUSE_XAXIS_TAG) /* Mouse - X AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_START(MOUSE_YAXIS_TAG) /* Mouse - Y AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END static INPUT_PORTS_START( ace500 ) @@ -4438,10 +4454,10 @@ static INPUT_PORTS_START( ace500 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) PORT_START(MOUSE_XAXIS_TAG) /* Mouse - X AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_START(MOUSE_YAXIS_TAG) /* Mouse - Y AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END static INPUT_PORTS_START( apple2cp ) @@ -4453,10 +4469,10 @@ static INPUT_PORTS_START( apple2cp ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) PORT_START(MOUSE_XAXIS_TAG) /* Mouse - X AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_START(MOUSE_YAXIS_TAG) /* Mouse - Y AXIS */ - PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(20) PORT_KEYDELTA(0) PORT_PLAYER(1) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END static INPUT_PORTS_START( apple2euk ) diff --git a/src/mame/apple/iphone2g.cpp b/src/mame/apple/iphone2g.cpp index 316a34ff5be34..4b44c59f31a77 100644 --- a/src/mame/apple/iphone2g.cpp +++ b/src/mame/apple/iphone2g.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/vic_pl192.h" #include "screen.h" @@ -283,8 +282,8 @@ void iphone2g_state::iphone2g(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &iphone2g_state::mem_map); PL192_VIC(config, m_vic0); - m_vic0->out_irq_cb().set_inputline("maincpu", ARM7_IRQ_LINE); - m_vic0->out_fiq_cb().set_inputline("maincpu", ARM7_FIRQ_LINE); + m_vic0->out_irq_cb().set_inputline("maincpu", arm7_cpu_device::ARM7_IRQ_LINE); + m_vic0->out_fiq_cb().set_inputline("maincpu", arm7_cpu_device::ARM7_FIRQ_LINE); IPHONE2G_SPI(config, m_spi[0], XTAL(12'000'000)); m_spi[0]->out_irq_cb().set(m_vic0, FUNC(vic_pl192_device::irq_w<0x09>)); diff --git a/src/mame/apple/newton.cpp b/src/mame/apple/newton.cpp index f4cfe2b620d8b..5bd529f0486be 100644 --- a/src/mame/apple/newton.cpp +++ b/src/mame/apple/newton.cpp @@ -22,7 +22,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/ram.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/appliedconcepts/ggm.cpp b/src/mame/appliedconcepts/ggm.cpp index dd32bc8e0b16f..3eeeafb40cb51 100644 --- a/src/mame/appliedconcepts/ggm.cpp +++ b/src/mame/appliedconcepts/ggm.cpp @@ -95,7 +95,7 @@ class ggm_state : public driver_device DECLARE_INPUT_CHANGED_MEMBER(reset_switch) { update_reset(newval); } DECLARE_INPUT_CHANGED_MEMBER(overlay_switch) { update_overlay(); } - DECLARE_CUSTOM_INPUT_MEMBER(overlay_r); + ioport_value overlay_r(); protected: virtual void machine_start() override; @@ -190,7 +190,7 @@ void ggm_state::update_reset(ioport_value state) Keypad Overlay *******************************************************************************/ -CUSTOM_INPUT_MEMBER(ggm_state::overlay_r) +ioport_value ggm_state::overlay_r() { u8 data = m_inputs[5]->read() & 0xf; return (data == 0xf) ? m_overlay : data; diff --git a/src/mame/misc/astrcorp.cpp b/src/mame/astrocorp/astrcorp.cpp similarity index 99% rename from src/mame/misc/astrcorp.cpp rename to src/mame/astrocorp/astrcorp.cpp index beaa8783d5682..9098ec71780ef 100644 --- a/src/mame/misc/astrcorp.cpp +++ b/src/mame/astrocorp/astrcorp.cpp @@ -3,6 +3,7 @@ /************************************************************************************************************* -= Astro Corp. CGA Hardware =- + (known as "Permus") driver by Luca Elia (l.elia@tin.it) decryption by Olivier Galibert @@ -71,7 +72,8 @@ Year + Game PCB ID CPU Video - speedmst,a,b: need RE of the CPU code, correct EEPROM. Won't boot right now. - cptshark: needs verifying of inputs and layout - wwitch: needs correct GFX ROMs loading / decode, RE of the CPU code, inputs, outputs. Currently starts but then freezes. -- hapfarm: doesn't work, possibly wrong interrupts. Code base differs significantly, needs studying. +- hapfarm: doesn't work, possibly wrong interrupts. Code base differs significantly, needs studying. Probably the link between + this generation of hardware and the one in astrocorp/hummer.cpp. *************************************************************************************************************/ @@ -1041,7 +1043,7 @@ static INPUT_PORTS_START( showhand ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Look / Small") // HOLD5 in full test mode PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) // settings PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Yes / Big") // HOLD4 in full test mode PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // HOLD1 in full test mode PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Select") // HOLD2 in full test mode @@ -1049,7 +1051,7 @@ static INPUT_PORTS_START( showhand ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // press with keyout if eeprom error (green screen) or to reset settings PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_START( "EEPROM_IN" ) PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -1079,7 +1081,7 @@ static INPUT_PORTS_START( showhanc ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Yes / Big") // HOLD4 in full test mode PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // press with keyout if eeprom error (green screen) or to reset settings. "DOOR OPEN" error in-game. PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be 0 for payout/lamps to work, might be a hopper empty sense? - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1101,9 +1103,9 @@ static INPUT_PORTS_START( skilldrp ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1167,9 +1169,9 @@ static INPUT_PORTS_START( dinodino ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Auto") PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Odds") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_START( "CPUCODE_IN" ) @@ -1210,7 +1212,7 @@ static INPUT_PORTS_START( astoneag ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reserve Switch") // shown in test mode PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1261,8 +1263,8 @@ void astrocorp_state::showhand(machine_config &config) NVRAM(config, "nvram"); EEPROM_93C46_16BIT(config, "eeprom"); - HOPPER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + HOPPER(config, m_ticket, attotime::from_msec(200)); + HOPPER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1306,8 +1308,8 @@ void astrocorp_state::skilldrp(machine_config &config) NVRAM(config, "nvram"); EEPROM_93C46_16BIT(config, "eeprom"); - HOPPER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + HOPPER(config, m_ticket, attotime::from_msec(200)); + HOPPER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/misc/astropc.cpp b/src/mame/astrocorp/astropc.cpp similarity index 92% rename from src/mame/misc/astropc.cpp rename to src/mame/astrocorp/astropc.cpp index 8429e1b891db2..d87d61a9778f9 100644 --- a/src/mame/misc/astropc.cpp +++ b/src/mame/astrocorp/astropc.cpp @@ -30,7 +30,7 @@ Arabian Night NO https://www.astrocorp.com.tw/eng/game_1_1.php?gid=31 Black Beard YES https://www.astrocorp.com.tw/eng/game_1_1.php?gid=32 Dragon Slayer YES https://www.astrocorp.com.tw/eng/game_1_1.php?gid=33 Flying Age NO https://www.astrocorp.com.tw/eng/game_1_1.php?gid=34 -Halloween Party NO https://www.astrocorp.com.tw/eng/game_1_1.php?gid=35 +Halloween Party YES https://www.astrocorp.com.tw/eng/game_1_1.php?gid=35 Olympian Games YES https://www.astrocorp.com.tw/eng/game_1_1.php?gid=36 The Circus NO https://www.astrocorp.com.tw/eng/game_1_1.php?gid=37 Treasure Hunting NO https://www.astrocorp.com.tw/eng/game_1_1.php?gid=38 @@ -286,6 +286,22 @@ ROM_START( rasce ) ROM_LOAD( "rs.06.03r", 0x0000, 0x7a80000, CRC(66132c3d) SHA1(4a73bab9518548950e11aebc6edf67f64d0d7798) ) ROM_END + // Pallas GX1 REV:B - AMD Geode CS5530A-UCE, SMC FDC37C932APM. Sub board with ROMs, ASTRO M and ASTRO V102PX-003 customs +ROM_START( hwparty ) + // GAME NAME : HALLOWEEN PARTY + // GAME TYPE : MULTI-LINER + // DEVELOPER : ASTRO CORP + ROM_REGION32_LE(0x40000, "pci:12.0", 0) /* motherboard bios */ + ROM_LOAD( "phoenixbios_e586 bios.u16", 0x0000, 0x040000, CRC(885e3cde) SHA1(ff90cda4383a119c7f54545c11fa432505e66c1b) ) + + ROM_REGION(0x20000, "rom", 0) // on subboard + ROM_LOAD16_BYTE( "1_hwus-112.u22", 0x00000, 0x010000, CRC(5cbe992c) SHA1(e785e5863ccc52d4ca5485569244d89e226398a0) ) + ROM_LOAD16_BYTE( "2_hwus-112.u11", 0x00001, 0x010000, CRC(7b0187ed) SHA1(7d0791990aec06d929bcb40a6d9888b3bb350071) ) + + ROM_REGION(0x8000000, "drive", 0) + ROM_LOAD( "halloween_us.23.a.img", 0x0000, 0x7a80000, CRC(65d3877f) SHA1(076035bd55189a186368ae42463ab7471be1583c) ) +ROM_END + void astropc_state::init_astropc() { @@ -301,6 +317,8 @@ GAME( 2005, blackbdb, blackbd, astropc, astropc, astropc_state, init_astropc, R GAME( 2005, dslayrr, 0, astropc, astropc, astropc_state, init_astropc, ROT0, "Astro", "Dragon Slayer (Russia, v15.B, 2005/08/10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 2006, dslayrra, dslayrr, astropc, astropc, astropc_state, init_astropc, ROT0, "Astro", "Dragon Slayer (Russia, v16.B, 2005/11/10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 2005, hwparty, 0, astropc, astropc, astropc_state, init_astropc, ROT0, "Astro", "Halloween Party (US.23.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) + GAME( 2004, hawaii, 0, astropc, astropc, astropc_state, init_astropc, ROT0, "Astro", "Hawaii (Russia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 2005, oligam, 0, astropc, astropc, astropc_state, init_astropc, ROT0, "Astro", "Olympian Games (Russia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/astrocorp/hummer.cpp b/src/mame/astrocorp/hummer.cpp new file mode 100644 index 0000000000000..37a3c83f21009 --- /dev/null +++ b/src/mame/astrocorp/hummer.cpp @@ -0,0 +1,142 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Astro Corp. 'Hummer' (VGA) +Main components: +Astro V102PX-0XX CPU (004 for Jack's Venture, 013 for Penguin Party) +DigiArt AM001 ADPCM & MP3 sound chip +22.579 MHz XTAL +Actel Igloo AGLP125-CSG289 +Astro ROHS (GFX?) +4x LY61L25616ML-20 SRAM +2x LY621024SL-70LL SRAM +4-DIP bank +*/ + +#include "emu.h" + +#include "cpu/m68000/m68000.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class hummer_state : public driver_device +{ +public: + hummer_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void hummer(machine_config &config); + +private: + required_device m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map); +}; + + +uint32_t hummer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void hummer_state::program_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); +} + + +static INPUT_PORTS_START( hummer ) + PORT_START("IN0") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +void hummer_state::hummer(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 22.579_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &hummer_state::program_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(120_MHz_XTAL / 10 * 2, 781, 0, 512, 261*2, 0, 240*2); // TODO + screen.set_screen_update(FUNC(hummer_state::screen_update)); + screen.set_palette("palette"); + + PALETTE(config, "palette").set_format(palette_device::BGR_565, 0x100); // TODO + + // sound hardware + SPEAKER(config, "mono").front_center(); + + // AM001 for sound +} + + +ROM_START( pengprty ) // PCBHR REV:E + Flash Card V1.1 riser board for GFX ROMs + CS350P093 TSOP to DIP riser board for sound ROM + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "1-tm_fpus01.01b.tu1", 0x00000, 0x40000, CRC(2569e2b9) SHA1(dcec1e9bfe73a062b891812f2c8eb8407066b993) ) + ROM_LOAD16_BYTE( "2-tm_fpus01.01b.tu3", 0x00001, 0x40000, CRC(23cda107) SHA1(f2c5cba9a3c2c8bfea6bce0b221fd9209810fdf3) ) + + ROM_REGION( 0x8000000, "sprites", 0 ) // TODO: probably interleaved + ROM_LOAD( "mx29gl128eh.u1", 0x0000000, 0x1000000, CRC(80f0d70f) SHA1(82de9bb82a2c5901d5e2dc8f93cd2eee5d65a20b) ) + ROM_LOAD( "mx29gl128eh.u2", 0x1000000, 0x1000000, CRC(9a9da6b4) SHA1(41d95e2de41a99c172ba210e51170e14219d393e) ) + ROM_LOAD( "mx29gl128eh.u3", 0x2000000, 0x1000000, CRC(458f22e5) SHA1(cf3b3084a980568646c588d33123576bd25261a5) ) + ROM_LOAD( "mx29gl128eh.u4", 0x3000000, 0x1000000, CRC(91f1069c) SHA1(67c7e56345f63c01279d39527b31fa9eeb7b4bf0) ) + ROM_LOAD( "mx29gl128eh.u5", 0x4000000, 0x1000000, CRC(fd4bc0d5) SHA1(0829ed0762311b3afd3b2a86c128077138793b53) ) + ROM_LOAD( "mx29gl128eh.u6", 0x5000000, 0x1000000, CRC(2280b3db) SHA1(601a7c1a7b868a0bb9395f38999426b45f008199) ) + ROM_LOAD( "mx29gl128eh.u7", 0x6000000, 0x1000000, CRC(8cfc06f9) SHA1(cc4386c3cde41145672102e3e29cb5c949246f62) ) + ROM_LOAD( "mx29gl128eh.u8", 0x7000000, 0x1000000, CRC(83907de9) SHA1(480df6092e9a78da69b220bfd0f2727a58d677c0) ) + + ROM_REGION( 0x800000, "am001", 0 ) + ROM_LOAD( "mx29lv640eb.u53", 0x000000, 0x800000, CRC(0289fef0) SHA1(f349abd69fcbb9b92ba1362f01c3a83a521fdcc3) ) +ROM_END + +ROM_START( jackvent ) // PCBHR REV:C + Flash Card V1.1 riser board for GFX ROMs + CS350P093 TSOP to DIP riser board for sound ROM + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "1_jvus02.01a.tu1", 0x00000, 0x40000, CRC(71471ff7) SHA1(b342d93417b9f8d2e5e36152a31acb09b6a5acd3) ) + ROM_LOAD16_BYTE( "2_jvus02.01a.tu3", 0x00001, 0x40000, CRC(945a01b1) SHA1(e621c1dd0db573dd5e3bc2202b04c997d84af4fc) ) + + ROM_REGION( 0x4000000, "sprites", 0 ) // TODO: probably interleaved + ROM_LOAD( "29lv640.u1", 0x0000000, 0x0800000, CRC(5be4c27d) SHA1(f16bb283e7d28148efacae7d42091985d96825b8) ) + ROM_LOAD( "29lv640.u2", 0x0800000, 0x0800000, CRC(1dd17d97) SHA1(a8e3b9f47bc8cf85f1008e16223245bbe6dc7f79) ) + ROM_LOAD( "29lv640.u3", 0x1000000, 0x0800000, CRC(970f6dd2) SHA1(b5db6c64e3ad6c8b0c0014b9cbdc2efadeb9b900) ) + ROM_LOAD( "29lv640.u4", 0x1800000, 0x0800000, CRC(d92453da) SHA1(612aacbb6724c195cf28ed25a73a6220c2e1fc32) ) + ROM_LOAD( "29lv640.u5", 0x2000000, 0x0800000, CRC(113218d6) SHA1(1182fe1ce29fbbbbfdd7ea0a5f6f6f85eab7acc6) ) // 1xxxxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_LOAD( "29lv640.u6", 0x2800000, 0x0800000, CRC(e8e06adb) SHA1(4c7871c405d6caa5ab5516410f730017c713984d) ) // 1xxxxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_LOAD( "29lv640.u7", 0x3000000, 0x0800000, CRC(ef777222) SHA1(5a53c72584c1a8b098df085bade866d887f48b29) ) // 1xxxxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_LOAD( "29lv640.u8", 0x3800000, 0x0800000, CRC(a48acc31) SHA1(4d35fd060dc86a10bd69715e17a9399ff97e4343) ) // 1xxxxxxxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x800000, "am001", 0 ) + ROM_LOAD( "29lv640.u53", 0x000000, 0x800000, CRC(c891b5ff) SHA1(5e0dce5b33230bd181f3eed94f64da328d11be28) ) +ROM_END + +} // anonymous namespace + +GAME ( 2009, pengprty, 0, hummer, hummer, hummer_state, empty_init, ROT0, "Astro Corp.", "Penguin Party", MACHINE_IS_SKELETON ) +GAME ( 2012, jackvent, 0, hummer, hummer, hummer_state, empty_init, ROT0, "Astro Corp.", "Jack's Venture - Inca Treasure", MACHINE_IS_SKELETON ) diff --git a/src/mame/atari/a2600.cpp b/src/mame/atari/a2600.cpp index 429f68ecc9377..b6e52f84c23db 100644 --- a/src/mame/atari/a2600.cpp +++ b/src/mame/atari/a2600.cpp @@ -246,7 +246,7 @@ class tvboy_state : public a2600_base_state void tvboy(machine_config &config); void tvboyn(machine_config &config); - + protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -672,7 +672,6 @@ void a2600_state::a2600(machine_config &config) subdevice("cart_list")->set_filter("NTSC"); } - void a2600p_state::a2600p(machine_config &config) { a2600_base_pal(config); @@ -700,6 +699,7 @@ void tvboy_state::tvboyn(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &tvboy_state::tvboy_mem); } + ROM_START(a2600) ROM_REGION(0x2000, "maincpu", ROMREGION_ERASEFF) ROM_END diff --git a/src/mame/atari/atarisy2.cpp b/src/mame/atari/atarisy2.cpp index 2a0169897a2ae..43347970f836d 100644 --- a/src/mame/atari/atarisy2.cpp +++ b/src/mame/atari/atarisy2.cpp @@ -339,48 +339,6 @@ void atarisy2_state::bankselect_w(offs_t offset, uint16_t data) } -void atarisy2_state::device_post_load() -{ -} - - - -/************************************* - * - * I/O read dispatch. - * - *************************************/ - -uint16_t atarisy2_state::switch_r() -{ - return ioport("1800")->read() | (ioport("1801")->read() << 8); -} - - -uint8_t atarisy2_state::switch_6502_r() -{ - int result = ioport("1840")->read(); - - if (m_tms5220.found() && (m_tms5220->readyq_r() == 0)) - result &= ~0x04; - if (!(ioport("1801")->read() & 0x80)) result |= 0x10; - - return result; -} - - -void atarisy2_state::switch_6502_w(uint8_t data) -{ - m_leds[0] = BIT(data, 2); - m_leds[1] = BIT(data, 3); - if (m_tms5220.found()) - { - data = 12 | ((data >> 5) & 1); - m_tms5220->set_unscaled_clock(MASTER_CLOCK/4 / (16 - data) / 2); - } -} - - /************************************* * @@ -392,14 +350,14 @@ uint8_t atarisy2_state::leta_r(offs_t offset) { static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" }; - if (offset <= 1 && m_pedal_count == -1) // 720 + if (offset <= 1 && m_pedal_count == -1) // 720 { switch (ioport("SELECT")->read()) { case 0: // Real break; - case 1: // Fake Joystick */ + case 1: // Fake Joystick /* special thanks to MAME Analog+ for the mapping code */ { int analogx = ioport("FAKE_JOY_X")->read() - 128; @@ -684,7 +642,12 @@ void atarisy2_state::sndrst_6502_w(uint8_t data) if (m_tms5220.found()) { - m_tms5220->reset(); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip. + // Technically what happens is the tms5220 gets a long stream of 0xFF written to it + // when sound_reset_state is 0, which halts the chip after a few frames, but this works + // just as well, even if it isn't exactly true to hardware... + // The hardware may not have worked either, the resistors to pull input to 0xFF are + // fighting against the ls263 gate holding the latched value to be sent to the chip. + m_tms5220->reset(); } mixer_w(0); } @@ -752,6 +715,7 @@ void atarisy2_state::tms5220_strobe_w(offs_t offset, uint8_t data) } } + /************************************* * * Misc. sound @@ -764,6 +728,17 @@ void atarisy2_state::coincount_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, (data >> 1) & 1); } +void atarisy2_state::switch_6502_w(uint8_t data) +{ + m_leds[0] = BIT(data, 2); + m_leds[1] = BIT(data, 3); + if (m_tms5220.found()) + { + int const divider = 16 - (12 | BIT(data, 5)); + m_tms5220->set_unscaled_clock(MASTER_CLOCK/4 / divider / 2); + } +} + /************************************* * @@ -788,7 +763,7 @@ void atarisy2_state::main_map(address_map &map) map(0013200, 0013200).mirror(00176).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0013400, 0013401).mirror(00176).w(FUNC(atarisy2_state::xscroll_w)).share("xscroll"); map(0013600, 0013601).mirror(00176).w(FUNC(atarisy2_state::yscroll_w)).share("yscroll"); - map(0014000, 0014001).mirror(01776).r(FUNC(atarisy2_state::switch_r)); + map(0014000, 0014001).mirror(01776).portr("IN0"); map(0014000, 0014000).mirror(01776).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0016000, 0016001).mirror(01776).r(FUNC(atarisy2_state::sound_r)); map(0020000, 0037777).view(m_vmmu); @@ -816,7 +791,7 @@ void atarisy2_state::sound_map(address_map &map) map(0x1800, 0x180f).mirror(0x2780).rw(m_pokey[0], FUNC(pokey_device::read), FUNC(pokey_device::write)); map(0x1810, 0x1813).mirror(0x278c).r(FUNC(atarisy2_state::leta_r)); map(0x1830, 0x183f).mirror(0x2780).rw(m_pokey[1], FUNC(pokey_device::read), FUNC(pokey_device::write)); - map(0x1840, 0x1840).mirror(0x278f).r(FUNC(atarisy2_state::switch_6502_r)); + map(0x1840, 0x1840).mirror(0x278f).portr("IN1"); map(0x1850, 0x1851).mirror(0x278e).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); map(0x1860, 0x1860).mirror(0x278f).r(FUNC(atarisy2_state::sound_6502_r)); map(0x1870, 0x1870).mirror(0x2781).w(FUNC(atarisy2_state::tms5220_w)); @@ -838,30 +813,28 @@ void atarisy2_state::sound_map(address_map &map) *************************************/ static INPUT_PORTS_START( paperboy ) - PORT_START("1840") /*(sound) */ + PORT_START("IN0") // T11 + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // P2TALK + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // P1TALK + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x7f00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) + + PORT_START("IN1") // 6502 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // P1TALK PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // P2TALK - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tms", tms5220_device, readyq_r) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("IN0", 0x8000, EQUALS, 0x8000) // self-test PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_START("1800") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // P2TALK - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // P1TALK - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) - - PORT_START("1801") - PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - PORT_START("ADC0") PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) @@ -1009,17 +982,18 @@ INPUT_PORTS_END static INPUT_PORTS_START( ssprint ) PORT_INCLUDE( paperboy ) - PORT_MODIFY("1840") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) - - PORT_MODIFY("1800") + PORT_MODIFY("IN0") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + PORT_MODIFY("IN1") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_MODIFY("ADC0") PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_INVERT PORT_PLAYER(1) @@ -1071,17 +1045,17 @@ INPUT_PORTS_END static INPUT_PORTS_START( csprint ) PORT_INCLUDE( ssprint ) - PORT_MODIFY("1840") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) - - PORT_MODIFY("1800") + PORT_MODIFY("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_UNUSED ) + PORT_MODIFY("IN1") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_MODIFY("ADC2") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -1098,16 +1072,16 @@ INPUT_PORTS_END static INPUT_PORTS_START( apb ) PORT_INCLUDE( paperboy ) - PORT_MODIFY("1840") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) - - PORT_MODIFY("1800") + PORT_MODIFY("IN0") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_MODIFY("IN1") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_MODIFY("ADC0") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) diff --git a/src/mame/atari/atarisy2.h b/src/mame/atari/atarisy2.h index bd82fcd398bdf..cc58e5f9f97c0 100644 --- a/src/mame/atari/atarisy2.h +++ b/src/mame/atari/atarisy2.h @@ -64,7 +64,6 @@ class atarisy2_state : public driver_device protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_post_load() override; virtual void video_start() override; private: @@ -127,9 +126,6 @@ class atarisy2_state : public driver_device INTERRUPT_GEN_MEMBER(sound_irq_gen); void sound_irq_ack_w(uint8_t data); void bankselect_w(offs_t offset, uint16_t data); - uint16_t switch_r(); - uint8_t switch_6502_r(); - void switch_6502_w(uint8_t data); uint8_t leta_r(offs_t offset); void mixer_w(uint8_t data); void sndrst_6502_w(uint8_t data); @@ -139,6 +135,7 @@ class atarisy2_state : public driver_device void tms5220_w(uint8_t data); void tms5220_strobe_w(offs_t offset, uint8_t data); void coincount_w(uint8_t data); + void switch_6502_w(uint8_t data); TIMER_DEVICE_CALLBACK_MEMBER(scanline_update); diff --git a/src/mame/atari/atarixga.cpp b/src/mame/atari/atarixga.cpp index 9e17b6018b618..e37dd8b7136e6 100644 --- a/src/mame/atari/atarixga.cpp +++ b/src/mame/atari/atarixga.cpp @@ -74,7 +74,7 @@ void atari_136094_0072_device::device_start() { m_ram = std::make_unique(RAM_WORDS); - save_pointer(NAME(m_ram), RAM_WORDS * sizeof(uint16_t)); + save_pointer(NAME(m_ram), RAM_WORDS); save_item(NAME(m_address)); save_item(NAME(m_ciphertext)); } @@ -293,7 +293,7 @@ atari_136095_0072_device::atari_136095_0072_device(const machine_config &mconfig void atari_136095_0072_device::device_start() { m_ram = std::make_unique(RAM_WORDS); - save_pointer(NAME(m_ram), RAM_WORDS * sizeof(uint16_t)); + save_pointer(NAME(m_ram), RAM_WORDS); save_item(NAME(m_update.addr)); save_item(NAME(m_update.data)); diff --git a/src/mame/atari/jaguar.cpp b/src/mame/atari/jaguar.cpp index 45cccf07e27ef..003a4b0b589aa 100644 --- a/src/mame/atari/jaguar.cpp +++ b/src/mame/atari/jaguar.cpp @@ -1119,8 +1119,8 @@ void jaguar_state::console_base_map(address_map &map) map(0xf03000, 0xf03fff).mirror(0x008000).rw(FUNC(jaguar_state::gpu_ram_r16), FUNC(jaguar_state::gpu_ram_w16)); map(0xf10000, 0xf103ff).rw(FUNC(jaguar_state::jerry_regs_r), FUNC(jaguar_state::jerry_regs_w)); // might be reversed endian of the others.. map(0xf14000, 0xf14003).rw(FUNC(jaguar_state::joystick_r16), FUNC(jaguar_state::joystick_w16)); - map(0xf14800, 0xf14803).rw(FUNC(jaguar_state::eeprom_clk16), FUNC(jaguar_state::eeprom_w16)); // GPI00 - map(0xf15000, 0xf15003).r(FUNC(jaguar_state::eeprom_cs16)); // GPI01 + map(0xf14800, 0xf14803).rw(FUNC(jaguar_state::eeprom_clk16), FUNC(jaguar_state::eeprom_w16)); // GPIO0 + map(0xf15000, 0xf15003).r(FUNC(jaguar_state::eeprom_cs16)); // GPIO1 map(0xf1a100, 0xf1a13f).rw(FUNC(jaguar_state::dspctrl_r16), FUNC(jaguar_state::dspctrl_w16)); map(0xf1a140, 0xf1a17f).rw(FUNC(jaguar_state::serial_r16), FUNC(jaguar_state::serial_w16)); map(0xf1b000, 0xf1cfff).rw(FUNC(jaguar_state::dsp_ram_r16), FUNC(jaguar_state::dsp_ram_w16)); @@ -1351,10 +1351,10 @@ void jaguar_state::r3000_map(address_map &map) map(0x04f02200, 0x04f022ff).rw(FUNC(jaguar_state::blitter_r), FUNC(jaguar_state::blitter_w)); map(0x04f03000, 0x04f03fff).mirror(0x00008000).ram().share("gpuram"); map(0x04f10000, 0x04f103ff).rw(FUNC(jaguar_state::jerry_regs_r), FUNC(jaguar_state::jerry_regs_w)); - map(0x04f16000, 0x04f1600b).r(FUNC(jaguar_state::cojag_gun_input_r)); // GPI02 - map(0x04f17000, 0x04f17003).lr16(NAME([this] () { return uint16_t(m_system->read()); })); // GPI03 - map(0x04f17800, 0x04f17803).w(FUNC(jaguar_state::latch_w)); // GPI04 - map(0x04f17c00, 0x04f17c03).portr("P1_P2"); // GPI05 + map(0x04f16000, 0x04f1600b).r(FUNC(jaguar_state::cojag_gun_input_r)); // GPIO2 + map(0x04f17000, 0x04f17003).lr16(NAME([this] () { return uint16_t(m_system->read()); })); // GPIO3 + map(0x04f17800, 0x04f17803).w(FUNC(jaguar_state::latch_w)); // GPIO4 + map(0x04f17c00, 0x04f17c03).portr("P1_P2"); // GPIO5 map(0x04f1a100, 0x04f1a13f).rw(FUNC(jaguar_state::dspctrl_r), FUNC(jaguar_state::dspctrl_w)); map(0x04f1a140, 0x04f1a17f).rw(FUNC(jaguar_state::serial_r), FUNC(jaguar_state::serial_w)); map(0x04f1b000, 0x04f1cfff).ram().share("dspram"); @@ -1395,10 +1395,10 @@ void jaguar_state::m68020_map(address_map &map) map(0xf02200, 0xf022ff).rw(FUNC(jaguar_state::blitter_r), FUNC(jaguar_state::blitter_w)); map(0xf03000, 0xf03fff).mirror(0x008000).ram().share("gpuram"); map(0xf10000, 0xf103ff).rw(FUNC(jaguar_state::jerry_regs_r), FUNC(jaguar_state::jerry_regs_w)); - map(0xf16000, 0xf1600b).r(FUNC(jaguar_state::cojag_gun_input_r)); // GPI02 - map(0xf17000, 0xf17003).lr16(NAME([this] () { return uint16_t(m_system->read()); })); // GPI03 -// map(0xf17800, 0xf17803).w(FUNC(jaguar_state::(latch_w)); // GPI04 - map(0xf17c00, 0xf17c03).portr("P1_P2"); // GPI05 + map(0xf16000, 0xf1600b).r(FUNC(jaguar_state::cojag_gun_input_r)); // GPIO2 + map(0xf17000, 0xf17003).lr16(NAME([this] () { return uint16_t(m_system->read()); })); // GPIO3 +// map(0xf17800, 0xf17803).w(FUNC(jaguar_state::(latch_w)); // GPIO4 + map(0xf17c00, 0xf17c03).portr("P1_P2"); // GPIO5 map(0xf1a100, 0xf1a13f).rw(FUNC(jaguar_state::dspctrl_r), FUNC(jaguar_state::dspctrl_w)); map(0xf1a140, 0xf1a17f).rw(FUNC(jaguar_state::serial_r), FUNC(jaguar_state::serial_w)); map(0xf1b000, 0xf1cfff).ram().share("dspram"); diff --git a/src/mame/atari/jedi.cpp b/src/mame/atari/jedi.cpp index 77052798d9c05..bee56f30b3c09 100644 --- a/src/mame/atari/jedi.cpp +++ b/src/mame/atari/jedi.cpp @@ -164,7 +164,7 @@ class jedi_state : public driver_device m_mainbank(*this, "mainbank") { } - DECLARE_CUSTOM_INPUT_MEMBER(audio_comm_stat_0c01_r); + ioport_value audio_comm_stat_0c01_r(); void jedi(machine_config &config); protected: @@ -264,7 +264,7 @@ u8 jedi_state::audio_comm_stat_r() } -CUSTOM_INPUT_MEMBER(jedi_state::audio_comm_stat_0c01_r) +ioport_value jedi_state::audio_comm_stat_0c01_r() { return (m_soundlatch->pending_r() << 1) | m_sacklatch->pending_r(); } diff --git a/src/mame/atari/mhavoc.cpp b/src/mame/atari/mhavoc.cpp index b1764b07f93ab..fa6edde07873f 100644 --- a/src/mame/atari/mhavoc.cpp +++ b/src/mame/atari/mhavoc.cpp @@ -277,7 +277,7 @@ class mhavoc_state : public alphaone_state void mhavoc(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(coin_service_r); + ioport_value coin_service_r(); int gamma_rcvd_r(); int gamma_xmtd_r(); int alpha_rcvd_r(); @@ -557,7 +557,7 @@ void alphaone_state::rom_banksel_w(uint8_t data) * *************************************/ -CUSTOM_INPUT_MEMBER(mhavoc_state::coin_service_r) +ioport_value mhavoc_state::coin_service_r() { return (m_player_1 ? m_service : m_coin)->read() & 0x03; } diff --git a/src/mame/atari/quizshow.cpp b/src/mame/atari/quizshow.cpp index c17b385c2c830..8b2f2200b343f 100644 --- a/src/mame/atari/quizshow.cpp +++ b/src/mame/atari/quizshow.cpp @@ -58,7 +58,7 @@ class quizshow_state : public driver_device m_lamps(*this, "lamp%u", 0U) { } - DECLARE_CUSTOM_INPUT_MEMBER(tape_headpos_r); + ioport_value tape_headpos_r(); DECLARE_INPUT_CHANGED_MEMBER(category_select); void init_quizshow(); void quizshow(machine_config &config); @@ -271,7 +271,7 @@ void quizshow_state::mem_map(address_map &map) ***************************************************************************/ -CUSTOM_INPUT_MEMBER(quizshow_state::tape_headpos_r) +ioport_value quizshow_state::tape_headpos_r() { return 1 << m_tape_head_pos; } diff --git a/src/mame/atari/starshp1.cpp b/src/mame/atari/starshp1.cpp index 0f676d253f6ee..1ec2c49b17aba 100644 --- a/src/mame/atari/starshp1.cpp +++ b/src/mame/atari/starshp1.cpp @@ -71,8 +71,8 @@ class starshp1_state : public driver_device void starshp1(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(analog_r); - DECLARE_CUSTOM_INPUT_MEMBER(collision_latch_r); + ioport_value analog_r(); + ioport_value collision_latch_r(); protected: virtual void machine_start() override; @@ -562,7 +562,7 @@ void starshp1_state::collision_reset_w(uint8_t data) } -CUSTOM_INPUT_MEMBER(starshp1_state::analog_r) +ioport_value starshp1_state::analog_r() { int val = 0; @@ -586,7 +586,7 @@ CUSTOM_INPUT_MEMBER(starshp1_state::analog_r) } -CUSTOM_INPUT_MEMBER(starshp1_state::collision_latch_r) +ioport_value starshp1_state::collision_latch_r() { return m_collision_latch & 0x0f; } diff --git a/src/mame/atari/tempest.cpp b/src/mame/atari/tempest.cpp index 226d9a5f6ae15..94b7ea49ceca7 100644 --- a/src/mame/atari/tempest.cpp +++ b/src/mame/atari/tempest.cpp @@ -322,8 +322,8 @@ class tempest_state : public driver_device void tempest(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(tempest_knob_r); - DECLARE_CUSTOM_INPUT_MEMBER(tempest_buttons_r); + ioport_value tempest_knob_r(); + ioport_value tempest_buttons_r(); int clock_r(); protected: @@ -385,12 +385,12 @@ void tempest_state::wdclr_w(uint8_t data) * *************************************/ -CUSTOM_INPUT_MEMBER(tempest_state::tempest_knob_r) +ioport_value tempest_state::tempest_knob_r() { return (m_player_select == 0) ? m_knob_p1->read() : m_knob_p2->read(); } -CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r) +ioport_value tempest_state::tempest_buttons_r() { return (m_player_select == 0) ? m_buttons_p1->read() : m_buttons_p2->read(); } diff --git a/src/mame/ausnz/aussiebyte.cpp b/src/mame/ausnz/aussiebyte.cpp index 1a350bca67d09..26213ad6e8317 100644 --- a/src/mame/ausnz/aussiebyte.cpp +++ b/src/mame/ausnz/aussiebyte.cpp @@ -398,40 +398,42 @@ static void aussiebyte_floppies(device_slot_interface &device) QUICKLOAD_LOAD_MEMBER(aussiebyte_state::quickload_cb) { - address_space& prog_space = m_maincpu->space(AS_PROGRAM); - - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); - - /* RAM must be banked in */ - m_port15 = true; // disable boot rom + // RAM must be banked in + m_port15 = true; // disable boot rom m_port1a = 4; - m_bankr0->set_entry(m_port1a); /* enable correct program bank */ + m_bankr0->set_entry(m_port1a); // enable correct program bank m_bankw0->set_entry(m_port1a); - /* Avoid loading a program if CP/M-80 is not in memory */ + address_space& prog_space = m_maincpu->space(AS_PROGRAM); + + // Avoid loading a program if CP/M-80 is not in memory if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) { machine_reset(); - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); } - /* Load image to the TPA (Transient Program Area) */ + const int mem_avail = 256 * prog_space.read_byte(7) + prog_space.read_byte(6) - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); + + // Load image to the TPA (Transient Program Area) u16 quickload_size = image.length(); for (u16 i = 0; i < quickload_size; i++) { u8 data; - if (image.fread( &data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - prog_space.write_byte(i+0x100, data); + if (image.fread(&data, 1) != 1) + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + prog_space.write_byte(i + 0x100, data); } - /* clear out command tail */ - prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); + // clear out command tail + prog_space.write_byte(0x80, 0); + prog_space.write_byte(0x81, 0); - /* Roughly set SP basing on the BDOS position */ - m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 0x400); - m_maincpu->set_pc(0x100); // start program + // Roughly set SP basing on the BDOS position + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } diff --git a/src/mame/ausnz/pipbug.cpp b/src/mame/ausnz/pipbug.cpp index 6946b7ac980b3..dcee614b40127 100644 --- a/src/mame/ausnz/pipbug.cpp +++ b/src/mame/ausnz/pipbug.cpp @@ -118,7 +118,7 @@ int pipbug_state::serial_r() void pipbug_state::machine_start() { - save_pointer(NAME(m_cass_data), 4); + save_item(NAME(m_cass_data)); save_item(NAME(m_cassold)); save_item(NAME(m_cassinbit)); } diff --git a/src/mame/bandai/rx78.cpp b/src/mame/bandai/rx78.cpp index 07030e1e30a9c..820421aa8c585 100644 --- a/src/mame/bandai/rx78.cpp +++ b/src/mame/bandai/rx78.cpp @@ -459,7 +459,7 @@ void rx78_state::machine_start() save_pointer(NAME(m_vram), 0xc000); save_item(NAME(m_vram_read_bank)); save_item(NAME(m_vram_write_bank)); - save_pointer(NAME(m_pal_reg), 7); + save_item(NAME(m_pal_reg)); save_item(NAME(m_pri_mask)); save_item(NAME(m_key_mux)); save_item(NAME(m_background)); diff --git a/src/mame/barcrest/mpu4.cpp b/src/mame/barcrest/mpu4.cpp index 3292ac4f68597..283975abe40db 100644 --- a/src/mame/barcrest/mpu4.cpp +++ b/src/mame/barcrest/mpu4.cpp @@ -2321,7 +2321,7 @@ void mpu4_state::mpu4_common(machine_config &config) BACTA_DATALOGGER(config, m_dataport, 0); m_dataport->rxd_handler().set(FUNC(mpu4_state::dataport_rxd)); - HOPPER(config, m_hopper1, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper1, attotime::from_msec(100)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 63331cebcb53e..2be8ed1aeace1 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -382,7 +382,7 @@ int bmcpokr_state::hopper_r() { // motor off should clear the sense bit (I guess ticket.cpp should actually do this). // Otherwise a hopper bit stuck low will prevent several keys from being registered. - return (m_mux & 0x01) ? m_hopper->line_r() : 1; + return (m_mux & 0x01) ? (m_hopper->line_r() ^ 1) : 1; } void bmcpokr_state::irq_enable_w(offs_t offset, uint8_t data, uint8_t mem_mask) @@ -1149,7 +1149,7 @@ void bmcpokr_state::bmcpokr(machine_config &config) TIMER(config, "scantimer", 0).configure_scanline(FUNC(bmcpokr_state::interrupt), "screen", 0, 1); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh(HZ_TO_ATTOSECONDS(58.935)); // HSync - 15.440kHz, VSync - 58.935Hz + screen.set_refresh(HZ_TO_ATTOSECONDS(58.935)); // HSync - 15.440kHz, VSync - 58.935Hz screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_screen_update(FUNC(bmcpokr_state::screen_update)); screen.set_size(64*8, 32*8); @@ -1165,15 +1165,13 @@ void bmcpokr_state::bmcpokr(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, 0); - m_hopper->set_period(attotime::from_msec(10)); - m_hopper->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); // hopper stuck low if too slow + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(10)); // hopper stuck low if too slow SPEAKER(config, "mono").front_center(); - YM2413(config, "ymsnd", XTAL(42'000'000) / 12).add_route(ALL_OUTPUTS, "mono", 1.00); // UM3567 @3.50MHz (42/12) + YM2413(config, "ymsnd", XTAL(42'000'000) / 12).add_route(ALL_OUTPUTS, "mono", 1.00); // UM3567 @3.50MHz (42/12) - OKIM6295(config, "oki", XTAL(42'000'000) / 40, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.00); // M6295 @1.05MHz (42/40) + OKIM6295(config, "oki", XTAL(42'000'000) / 40, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.00); // M6295 @1.05MHz (42/40) } void bmcpokr_state::fengyunh(machine_config &config) diff --git a/src/mame/bmc/popobear.cpp b/src/mame/bmc/popobear.cpp index c553d00a43068..f17996ace19cb 100644 --- a/src/mame/bmc/popobear.cpp +++ b/src/mame/bmc/popobear.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese, David Haywood +// copyright-holders: Angelo Salese, David Haywood + /************************************************************************************************** Popo Bear (c) 2000 BMC @@ -10,6 +11,8 @@ Popo Bear (c) 2000 BMC - complete I/Os; - Identify what's on $600000 & $620000; - Uses tas opcode to sync to irq, from VDP? +- magkengo: doesn't boot, same as popobear would do without the 0x620000 work-around, but it doesn't + read there. =================================================================================================== @@ -72,10 +75,12 @@ Component Side A B Solder Side **************************************************************************************************/ #include "emu.h" + #include "cpu/m68000/m68000.h" #include "machine/timer.h" #include "sound/okim6295.h" #include "sound/ymopl.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -105,6 +110,9 @@ class popobear_state : public driver_device void popobear(machine_config &config); +protected: + virtual void video_start() override; + private: required_device m_maincpu; required_device m_screen; @@ -124,9 +132,8 @@ class popobear_state : public driver_device void irq_ack_w(uint8_t data); void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - virtual void video_start() override; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb); @@ -149,9 +156,9 @@ void popobear_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) ); COMBINE_DATA(&m_vram_rearranged[swapped_offset]); - m_gfxdecode->gfx(0)->mark_dirty((swapped_offset)/32); + m_gfxdecode->gfx(0)->mark_dirty((swapped_offset) / 32); - // unfortunately tilemaps and tilegfx share the same ram so we're always dirty if we write to RAM + // unfortunately tilemaps and tilegfx share the same RAM so we're always dirty if we write to RAM m_bg_tilemap[0]->mark_all_dirty(); m_bg_tilemap[1]->mark_all_dirty(); m_bg_tilemap[2]->mark_all_dirty(); @@ -175,9 +182,9 @@ GFXDECODE_END template TILE_GET_INFO_MEMBER(popobear_state::get_tile_info) { - int base = m_tilemap_base[N]; - int tileno = m_vram[base / 2 + tile_index]; - int flipyx = (tileno >> 14); + int const base = m_tilemap_base[N]; + int const tileno = m_vram[base / 2 + tile_index]; + int const flipyx = (tileno >> 14); tileinfo.set(0, tileno & 0x3fff, 0, TILE_FLIPYX(flipyx)); } @@ -218,42 +225,40 @@ void popobear_state::video_start() * ---- ---- ---- --x- NOT set on the enemy character / characters in your line * ---- ---- ---- ---x set on opposite to above? */ -void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +void popobear_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { uint8_t* vram = reinterpret_cast(m_spriteram.target()); - int i; - - for (int drawpri = 0xf;drawpri>=0x0;drawpri--) + for (int drawpri = 0xf; drawpri >= 0x0; drawpri--) { - /* 0x106 = 8 x 8 */ - /* 0x*29 = 32 x 32 */ - for(i = 0x800-8;i >= 0; i-=8) + // 0x106 = 8 x 8 + // 0x*29 = 32 x 32 + for (int i = 0x800 - 8; i >= 0; i -= 8) { uint16_t *sprdata = &m_spriteram[(0x7f800 + i) / 2]; - int param = sprdata[0]; - int pri = (param & 0x0f00)>>8; + int const param = sprdata[0]; + int const pri = (param & 0x0f00) >> 8; // we do this because it's sprite<->sprite priority, - if (pri!=drawpri) + if (pri != drawpri) continue; int y = sprdata[1]; int x = sprdata[2]; int spr_num = sprdata[3]; - int width = 8 << ((param & 0x30)>>4); - int height = width; // sprites are always square? + int const width = 8 << ((param & 0x30) >> 4); + int const height = width; // sprites are always square? - int color_bank = ((param & 0xc)>>2); - int x_dir = param & 0x40; - int y_dir = param & 0x80; + int color_bank = ((param & 0xc) >> 2); + int const x_dir = param & 0x40; + int const y_dir = param & 0x80; - if (x&0x8000) x-= 0x10000; - if (y&0x8000) y-= 0x10000; + if (x & 0x8000) x -= 0x10000; + if (y & 0x8000) y -= 0x10000; - if (param&0xf000) color_bank = (machine().rand() & 0x3); + if (param & 0xf000) color_bank = (machine().rand() & 0x3); @@ -269,46 +274,46 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect case 0x1: // butterflies in intro, enemy characters, line of characters, stage start text //color_bank = (machine().rand() & 0x3); - add_it = color_bank*0x40; + add_it = color_bank * 0x40; break; case 0x2: // characters in intro, main player, powerups, timer, large dancing chars between levels (0x3f?) //color_bank = (machine().rand() & 0x3); - add_it = color_bank*0x40; + add_it = color_bank * 0x40; break; case 0x3: // letters on GAME OVER need this.. - add_it = color_bank*0x40; + add_it = color_bank * 0x40; add_it += 0x20; break; } - if(param == 0) + if (param == 0) continue; spr_num <<= 3; - for(int yi=0;yipen(((pix+(add_it))&0xff)+0x100); + bitmap.pix(y_draw, x_draw) = m_palette->pen(((pix + (add_it)) & 0xff) + 0x100); } } @@ -322,13 +327,9 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); - int line; - rectangle clip; - int scrollbase; - int scrollbase2; const rectangle &visarea = screen.visible_area(); - clip = visarea; + rectangle clip = visarea; //popmessage("%04x",m_vregs[0/2]); uint16_t* vreg = m_vregs; @@ -338,7 +339,7 @@ uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitm // vreg[0x00] also looks like it could be some enable registers // 0x82ff - BMC logo // 0x8aff - some attract scenes (no sprites) - // 0x8bff - game attract scense etc. (sprites) + // 0x8bff - game attract scenes etc. (sprites) // vreg[0x01] is always // 0xfefb @@ -347,10 +348,10 @@ uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitm // these are more than just enable, they get written with 0x0d and 0x1f (and 0x00 when a layer is off) // seems to be related to the linescroll mode at least? maybe sizes? - int enable0 = (m_vregs[0x0c] & 0xff00)>>8; - int enable1 = (m_vregs[0x0c] & 0x00ff)>>0; - int enable2 = (m_vregs[0x0d] & 0xff00)>>8; - int enable3 = (m_vregs[0x0d] & 0x00ff)>>0; + int const enable0 = (m_vregs[0x0c] & 0xff00) >> 8; + int const enable1 = (m_vregs[0x0c] & 0x00ff) >> 0; + int const enable2 = (m_vregs[0x0d] & 0xff00) >> 8; + int const enable3 = (m_vregs[0x0d] & 0x00ff) >> 0; if ((enable0 != 0x00) && (enable0 != 0x0d) && (enable0 != 0x1f)) popmessage("unknown enable0 value %02x", enable0); if ((enable1 != 0x00) && (enable1 != 0x0d) && (enable1 != 0x1f)) popmessage("unknown enable1 value %02x", enable1); @@ -370,20 +371,23 @@ uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitm // the upper 2 tilemaps have a lineselect / linescroll logic + int scrollbase; + int scrollbase2; + if (enable1 == 0x1f) { scrollbase = 0xdf600; scrollbase2 = 0xdf800; - for (line = 0; line < 240;line++) + for (int line = 0; line < 240; line++) { - uint16_t val = m_vram[scrollbase/2 + line]; - uint16_t upper = (m_vram[scrollbase2/2 + line]&0xff00)>>8; + uint16_t const val = m_vram[scrollbase / 2 + line]; + uint16_t const upper = (m_vram[scrollbase2 / 2 + line] & 0xff00) >> 8; clip.sety(line, line); - m_bg_tilemap[1]->set_scrollx(0,(val&0x00ff) | (upper << 8)); - m_bg_tilemap[1]->set_scrolly(0,((val&0xff00)>>8)-line); + m_bg_tilemap[1]->set_scrollx(0, (val & 0x00ff) | (upper << 8)); + m_bg_tilemap[1]->set_scrolly(0, ((val & 0xff00) >> 8) - line); m_bg_tilemap[1]->draw(screen, bitmap, clip, 0, 0); } @@ -400,15 +404,15 @@ uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitm scrollbase = 0xdf400; scrollbase2 = 0xdf800; - for (line = 0; line < 240;line++) + for (int line = 0; line < 240; line++) { - uint16_t val = m_vram[scrollbase/2 + line]; - uint16_t upper = (m_vram[scrollbase2/2 + line]&0x00ff)>>0; + uint16_t const val = m_vram[scrollbase / 2 + line]; + uint16_t const upper = (m_vram[scrollbase2 / 2 + line] & 0x00ff) >> 0; clip.sety(line, line); - m_bg_tilemap[0]->set_scrollx(0,(val&0x00ff) | (upper << 8)); - m_bg_tilemap[0]->set_scrolly(0,((val&0xff00)>>8)-line); + m_bg_tilemap[0]->set_scrollx(0, (val & 0x00ff) | (upper << 8)); + m_bg_tilemap[0]->set_scrolly(0, ((val & 0xff00) >> 8) - line); m_bg_tilemap[0]->draw(screen, bitmap, clip, 0, 0); } @@ -420,16 +424,16 @@ uint32_t popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); } - draw_sprites(bitmap,cliprect); + draw_sprites(bitmap, cliprect); return 0; } void popobear_state::irq_ack_w(uint8_t data) { - for(int i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { - if(BIT(data, i)) + if (BIT(data, i)) m_maincpu->set_input_line(i, CLEAR_LINE); } } @@ -439,11 +443,11 @@ void popobear_state::main_map(address_map &map) map.unmap_value_high(); map(0x000000, 0x03ffff).rom(); map(0x210000, 0x21ffff).ram(); - map(0x280000, 0x2fffff).ram().share("spriteram"); // unknown boundaries - map(0x300000, 0x3fffff).ram().w(FUNC(popobear_state::vram_w)).share("vram"); // tile definitions + tilemaps + map(0x280000, 0x2fffff).ram().share(m_spriteram); // unknown boundaries + map(0x300000, 0x3fffff).ram().w(FUNC(popobear_state::vram_w)).share(m_vram); // tile definitions + tilemaps // TODO: is the 48xxxx block entirely from AIA90423? - map(0x480000, 0x48001f).ram().share("vregs"); + map(0x480000, 0x48001f).ram().share(m_vregs); map(0x480031, 0x480031).w(FUNC(popobear_state::irq_ack_w)); map(0x480034, 0x480035).nopr(); // uses bset/bclr to write, which causes a read (ignored) map(0x480035, 0x480035).lw8( @@ -484,31 +488,56 @@ void popobear_state::main_map(address_map &map) // TODO: unconfirmed diplocations static INPUT_PORTS_START( popobear ) - PORT_START("DSW1") + PORT_START("IN0") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x0e, 0x00, "Coin_A" ) PORT_DIPLOCATION("SW1:2,3,4") - PORT_DIPSETTING( 0x0c, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0e, "Freeplay" ) - PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") - PORT_DIPSETTING( 0x10, "2" ) - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x20, "4" ) - PORT_DIPSETTING( 0x30, "5" ) - PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING( 0x80, DEF_STR( Very_Easy ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( Hard ) ) - - PORT_START("DSW2") + PORT_DIPNAME( 0x0e, 0x0e, "Coin_A" ) PORT_DIPLOCATION("SW1:2,3,4") + PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0a, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x20, "2" ) + PORT_DIPSETTING( 0x30, "3" ) + PORT_DIPSETTING( 0x10, "4" ) + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0x40, DEF_STR( Very_Easy ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_BIT( 0x1e00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x2000, 0x2000, "Service?" ) // hangs if flipped on during attract + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("DSW2") // TODO: where are this read? PORT_DIPNAME( 0x01, 0x00, "Arrow" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -533,65 +562,37 @@ static INPUT_PORTS_START( popobear ) PORT_DIPNAME( 0x80, 0x00, "DSW2:8" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("IN0") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x1e00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_DIPNAME( 0x2000, 0x2000, "Service?" ) // hangs if flipped on during attract - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) INPUT_PORTS_END TIMER_DEVICE_CALLBACK_MEMBER(popobear_state::scanline_cb) { - int scanline = param; + int const scanline = param; // vblank-in // Order is trusted, 5 as vblank-in makes title mosaic-esque rotation to draw incorrectly - if(scanline == 240) + if (scanline == 240) m_maincpu->set_input_line(3, ASSERT_LINE); // vblank-out - if(scanline == 0) + if (scanline == 0) m_maincpu->set_input_line(5, ASSERT_LINE); - /* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */ - /* the YM2413 doesn't have interrupts? */ - if(scanline == 64 || scanline == 192) + // TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) + // the YM2413 doesn't have interrupts? + if (scanline == 64 || scanline == 192) m_maincpu->set_input_line(2, ASSERT_LINE); } void popobear_state::popobear(machine_config &config) { - M68000(config, m_maincpu, XTAL(42'000'000)/4); // divisor guessed + M68000(config, m_maincpu, XTAL(42'000'000) / 4); // divisor guessed m_maincpu->set_addrmap(AS_PROGRAM, &popobear_state::main_map); TIMER(config, "scantimer").configure_scanline(FUNC(popobear_state::scanline_cb), "screen", 0, 1); 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_screen_update(FUNC(popobear_state::screen_update)); m_screen->set_palette(m_palette); m_screen->set_size(128*8, 32*8); @@ -603,9 +604,9 @@ void popobear_state::popobear(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_popobear); - YM2413(config, "ymsnd", XTAL(42'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + YM2413(config, "ymsnd", XTAL(42'000'000) / 16).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed - OKIM6295(config, "oki", XTAL(42'000'000)/32, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + OKIM6295(config, "oki", XTAL(42'000'000) / 32, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed } @@ -624,7 +625,25 @@ ROM_START( popobear ) ROM_LOAD( "popobear_ta-a-901.u9", 0x00000, 0x40000, CRC(f1e94926) SHA1(f4d6f5b5811d90d0069f6efbb44d725ff0d07e1c) ) ROM_END +// HERBHOME 20A23-1 PCB. Mostly same components as popobear's (BMC AIA90423, BMC AIA90610, OKI6295, 42 MHz XTAL, etc.), different layout. +// Has a Altera MAX EPM7064SLC84-10 and only 1 8-DIP bank +// Has Herb Home 2003 copyright in ROM but stickers have 2005. TODO: Verify date on title screen when it boots. +ROM_START( magkengo ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "magical_kengo_2005_l1_a_201_u27.u27", 0x000000, 0x020000, CRC(eddfd8b1) SHA1(9eaeff2c0798b2b6b727ad6f3749cc427a52db41) ) // M27C1001 + ROM_LOAD16_BYTE( "magical_kengo_2005_l1_a_101_u26.u26", 0x000001, 0x020000, CRC(449ad8ab) SHA1(625bd2491eb95aa8e39f75db0d0cd01ec649f5b8) ) // M27C1001 + + ROM_REGION16_BE( 0x400000, "gfx_data", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "magical_kengo_2005_l8_a_401_u6.u6", 0x000000, 0x100000, CRC(857e34e6) SHA1(17681a684f451c92f577d6cb3443a3801b192df3) ) // M27C801 + ROM_LOAD16_BYTE( "magical_kengo_2005_l8_a_301_u5.u5", 0x000001, 0x100000, CRC(ca03b9fd) SHA1(b9fb407760ed1fc276f42a6dd326edbf97c1660d) ) // M27C801 + // u3 and u4 empty not populated + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "magical_kengo_2005_l4_a_701_u20.u20", 0x00000, 0x80000, CRC(a2c563a7) SHA1(ce33e95887cdf76cb4c5f944bbdd219de1b2c7c0) ) // AMD AM27C040 +ROM_END + } // anonymous namespace -GAME( 2000, popobear, 0, popobear, popobear, popobear_state, empty_init, ROT0, "BMC", "PoPo Bear", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_SUPPORTS_SAVE ) +GAME( 2000, popobear, 0, popobear, popobear, popobear_state, empty_init, ROT0, "BMC", "PoPo Bear", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_SUPPORTS_SAVE ) +GAME( 2005, magkengo, 0, popobear, popobear, popobear_state, empty_init, ROT0, "Herb Home", "Magical Kengo", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/canon/x07.h b/src/mame/canon/x07.h index c0b999b7a5554..cb773ec1bb0de 100644 --- a/src/mame/canon/x07.h +++ b/src/mame/canon/x07.h @@ -10,7 +10,7 @@ #pragma once -#include "cpu/z80/z80.h" +#include "cpu/z80/nsc800.h" #include "sound/beep.h" #include "machine/nvram.h" #include "machine/ram.h" diff --git a/src/mame/capcom/alien.cpp b/src/mame/capcom/alien.cpp index bc3d6dc26ca59..436dc45daabca 100644 --- a/src/mame/capcom/alien.cpp +++ b/src/mame/capcom/alien.cpp @@ -624,7 +624,7 @@ ROM_END ROM_START( dokodemo ) ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) // BIOS code ROM_LOAD32_WORD( "ic30", 0x000000, 0x400000, BAD_DUMP CRC(74687757) SHA1(96b6e3725bcf16e92c6966f9b9ce93cfdd7ba641) ) // needs verification if this game really use same boot ROMs as pingu/gekimaka - ROM_LOAD32_WORD( "ic33", 0x000002, 0x400000, BAD_DUMP CRC(ba2e6716) SHA1(49c5abb9d96e3f4a78ed4dced7a9f052a96b186d) ) // + ROM_LOAD32_WORD( "ic33", 0x000002, 0x400000, BAD_DUMP CRC(ba2e6716) SHA1(49c5abb9d96e3f4a78ed4dced7a9f052a96b186d) ) // ROM_REGION( 0x800100, "ymz770_flash1", ROMREGION_ERASEFF ) //sound samples flash rom, not really needed, programmed by boot loader ROM_LOAD16_WORD_SWAP( "flash1", 0x000000, 0x800000, BAD_DUMP CRC(dda4879f) SHA1(4aa06247ca674e86be6c111db7f6abf1ed6e121d) ) @@ -673,7 +673,7 @@ ROM_END ROM_START( wontame ) ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) // BIOS code ROM_LOAD32_WORD( "ic30", 0x000000, 0x400000, BAD_DUMP CRC(74687757) SHA1(96b6e3725bcf16e92c6966f9b9ce93cfdd7ba641) ) // needs verification if this game really use same boot ROMs as pingu/gekimaka - ROM_LOAD32_WORD( "ic33", 0x000002, 0x400000, BAD_DUMP CRC(ba2e6716) SHA1(49c5abb9d96e3f4a78ed4dced7a9f052a96b186d) ) // + ROM_LOAD32_WORD( "ic33", 0x000002, 0x400000, BAD_DUMP CRC(ba2e6716) SHA1(49c5abb9d96e3f4a78ed4dced7a9f052a96b186d) ) // ROM_REGION( 0x800100, "ymz770_flash1", ROMREGION_ERASEFF ) ROM_LOAD16_WORD_SWAP( "flash1", 0x000000, 0x800000, BAD_DUMP CRC(056e982e) SHA1(4b29218b00d7023c0b748aae13752f0c12539750) ) diff --git a/src/mame/capcom/kenseim.cpp b/src/mame/capcom/kenseim.cpp index fdfa8d119b2f3..e0f3ec336ff05 100644 --- a/src/mame/capcom/kenseim.cpp +++ b/src/mame/capcom/kenseim.cpp @@ -178,8 +178,8 @@ class kenseim_state : public cps_state void init_kenseim(); - DECLARE_CUSTOM_INPUT_MEMBER(cmd_1234_r); - DECLARE_CUSTOM_INPUT_MEMBER(cmd_5678_r); + ioport_value cmd_1234_r(); + ioport_value cmd_5678_r(); int cmd_9_r(); int cmd_req_r(); int cmd_LVm_r(); @@ -374,12 +374,12 @@ void kenseim_state::cpu_portc_w(uint8_t data) /* 68k side COMMS reads */ -CUSTOM_INPUT_MEMBER(kenseim_state::cmd_1234_r) +ioport_value kenseim_state::cmd_1234_r() { return (m_to_68k_cmd_low & 0x0f) >> 0; } -CUSTOM_INPUT_MEMBER(kenseim_state::cmd_5678_r) +ioport_value kenseim_state::cmd_5678_r() { return (m_to_68k_cmd_low & 0xf0) >> 4; } diff --git a/src/mame/capcom/lwings.cpp b/src/mame/capcom/lwings.cpp index f2486ccea27b9..7932bfd42ef23 100644 --- a/src/mame/capcom/lwings.cpp +++ b/src/mame/capcom/lwings.cpp @@ -9,23 +9,15 @@ Driver provided by Paul Leaman -To Do: -- sectionz does "false contacts" on the coin counters, causing them to - increment twice per coin. -- accurate music tempo (audiocpu irq freq) -- accurate video timing, raw params +TODO: +- sectionz does "false contacts" on the coin counters, causing them to + increment twice per coin. +- accurate music tempo (audiocpu irq freq) +- accurate video timing, raw params +- verify avengers MCU comms, and redump internal ROM as well (see note + in ROM defs under AVENGERS_MCU) -Change Log: - -FEB-2003 (AT) - -- bug fixes: - - avengers061gre: missing sound effects in Avengers - avengers37b16gre: screen artifacts in Avengers - lwingsc37b7gre: incorrect sprite clipping in all games - Notes: Avengers has a protection chip underneath the sound module. @@ -111,9 +103,9 @@ class lwings_state : public driver_device private: // devices - required_device m_maincpu; - required_device m_soundcpu; - optional_device m_adpcmcpu; + required_device m_maincpu; + required_device m_soundcpu; + optional_device m_adpcmcpu; optional_device m_mcu; optional_device_array m_mculatch; optional_device m_msm; @@ -152,7 +144,6 @@ class lwings_state : public driver_device void avengers_adpcm_w(uint8_t data); uint8_t avengers_adpcm_r(); void lwings_bankswitch_w(uint8_t data); - uint8_t avengers_m1_r(offs_t offset); uint8_t avengers_soundlatch_ack_r(); void lwings_fgvideoram_w(offs_t offset, uint8_t data); void lwings_bg1videoram_w(offs_t offset, uint8_t data); @@ -187,7 +178,6 @@ class lwings_state : public driver_device void avengers_adpcm_io_map(address_map &map); void avengers_map(address_map &map); - void avengers_m1_map(address_map &map); void buraikenb_map(address_map &map); void fball_map(address_map &map); void fball_oki_map(address_map &map); @@ -299,14 +289,6 @@ void lwings_state::mcu_control_w(uint8_t data) m_mcu_control = data; } -uint8_t lwings_state::avengers_m1_r(offs_t offset) -{ - // 2 wait states on each M1 access (needed to keep in sync with MCU) - if (!machine().side_effects_disabled()) - m_maincpu->adjust_icount(-2); - return m_maincpu_program.read_byte(offset); -} - uint8_t lwings_state::avengers_soundlatch_ack_r() { uint8_t data = m_soundlatch->read() | (m_soundlatch->pending_r() ? 0x80 : 0); @@ -358,11 +340,6 @@ void lwings_state::avengers_map(address_map &map) map(0xf80d, 0xf80d).r(m_mculatch[2], FUNC(generic_latch_8_device::read)); } -void lwings_state::avengers_m1_map(address_map &map) -{ - map(0x0000, 0xffff).r(FUNC(lwings_state::avengers_m1_r)); -} - void lwings_state::lwings_map(address_map &map) { map(0x0000, 0x7fff).rom(); @@ -1360,8 +1337,8 @@ void lwings_state::avengers(machine_config &config) // basic machine hardware m_maincpu->set_clock(12_MHz_XTAL/2); + m_maincpu->z80_set_m1_cycles(6); // 2 WAIT states per M1? (needed to keep in sync with MCU) m_maincpu->set_addrmap(AS_PROGRAM, &lwings_state::avengers_map); - m_maincpu->set_addrmap(AS_OPCODES, &lwings_state::avengers_m1_map); I8751(config, m_mcu, 12_MHz_XTAL/2); m_mcu->port_in_cb<0>().set(FUNC(lwings_state::mcu_p0_r)); @@ -2074,12 +2051,7 @@ It was common for Capcom to use the same ROM label across regional sets but add #define AVENGERS_MCU \ ROM_REGION( 0x1000, "mcu", 0 ) /* Intel C8751H - 88 */ \ ROM_LOAD( "av.13k", 0x0000, 0x1000, BAD_DUMP CRC(505a0987) SHA1(ea1d855a9870d79d0e00eaa88a23038355a1203a) ) \ - ROM_FILL(0x0b84, 0x01, 0x02) /* bad code! bit 0x80 was flipped */ \ - /* these palette entries look wrong, but the low bit is unused, so could just be like that */ \ - ROM_FILL(0x0481, 0x01, 0x00) \ - ROM_FILL(0x04e0, 0x01, 0x00) \ - ROM_FILL(0x0483, 0x01, 0xa0) \ - ROM_FILL(0x04c3, 0x01, 0x30) + ROM_FILL(0x0b84, 0x01, 0x02) /* bad code! bit 0x80 was flipped */ ROM_START( avengers ) ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + 3*16k for the banked ROMs images */ diff --git a/src/mame/casio/ctk2000.cpp b/src/mame/casio/ctk2000.cpp index 5dbbba1479b0d..a5bf0673459b6 100644 --- a/src/mame/casio/ctk2000.cpp +++ b/src/mame/casio/ctk2000.cpp @@ -48,7 +48,7 @@ class ctk2000_state : public driver_device void ctk2000(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(lcd_r) { return m_lcdc->db_r() >> 4; } + ioport_value lcd_r() { return m_lcdc->db_r() >> 4; } void lcd_w(int state) { m_lcdc->db_w(state << 4); } void apo_w(int state); diff --git a/src/mame/casio/ctk551.cpp b/src/mame/casio/ctk551.cpp index ba830d5003e7f..fabde372a96ca 100644 --- a/src/mame/casio/ctk551.cpp +++ b/src/mame/casio/ctk551.cpp @@ -230,7 +230,7 @@ class ctk551_state : public driver_device void pwm_row_w(int state) { m_pwm->write_my(state); } void pwm_col_w(int state) { m_pwm->write_mx(state ^ 0xff); } - DECLARE_CUSTOM_INPUT_MEMBER(lcd_r) { return m_lcdc->db_r() >> 4; } + ioport_value lcd_r() { return m_lcdc->db_r() >> 4; } void lcd_w(int state) { m_lcd_data = state << 4; @@ -241,7 +241,7 @@ class ctk551_state : public driver_device // (and even those don't always have them wired the same way - // in some cases they're not even all connected to the same port) template - DECLARE_CUSTOM_INPUT_MEMBER(lcd_bit_r) { return BIT(m_lcdc->db_r(), Bit); } + ioport_value lcd_bit_r() { return BIT(m_lcdc->db_r(), Bit); } template void lcd_bit_w(int state) { @@ -252,13 +252,13 @@ class ctk551_state : public driver_device // handle the 4-position mode switch // some models treat this as 3 modes plus power off, // while others have 4 modes and move power to a separate button instead - DECLARE_CUSTOM_INPUT_MEMBER(switch_r) { return m_switch; } + ioport_value switch_r() { return m_switch; } DECLARE_INPUT_CHANGED_MEMBER(switch_w); DECLARE_INPUT_CHANGED_MEMBER(power_w); DECLARE_INPUT_CHANGED_MEMBER(switch_power_w); void inputs_w(int state) { m_input_sel = state; } - DECLARE_CUSTOM_INPUT_MEMBER(inputs_r); + ioport_value inputs_r(); void dsp_data_w(uint8_t data); void dsp_cmd_w(uint8_t cmd); @@ -331,7 +331,7 @@ INPUT_CHANGED_MEMBER(ctk551_state::switch_power_w) } } -CUSTOM_INPUT_MEMBER(ctk551_state::inputs_r) +ioport_value ctk551_state::inputs_r() { uint8_t result = 0xff; for (unsigned i = 0U; i < m_inputs.size(); i++) diff --git a/src/mame/casio/cz230s.cpp b/src/mame/casio/cz230s.cpp index 0a695e6495e96..40859e4e5ef6a 100644 --- a/src/mame/casio/cz230s.cpp +++ b/src/mame/casio/cz230s.cpp @@ -69,17 +69,17 @@ class cz230s_state : public driver_device void keys_w(int state) { m_key_sel = state; } void keys_mux_w(int state) { m_key_mux = state; } - template DECLARE_CUSTOM_INPUT_MEMBER(keys_row_r); + template ioport_value keys_row_r(); template u8 keys_analog_r(); DECLARE_INPUT_CHANGED_MEMBER(rhythm_w); - template DECLARE_CUSTOM_INPUT_MEMBER(rhythm_r) { return m_rhythm >> Bit; } + template ioport_value rhythm_r() { return m_rhythm >> Bit; } DECLARE_INPUT_CHANGED_MEMBER(mode_w); - DECLARE_CUSTOM_INPUT_MEMBER(mode_r) { return m_mode; } + ioport_value mode_r() { return m_mode; } void cassette_w(int state); void cassette_motor_w(int state); - DECLARE_CUSTOM_INPUT_MEMBER(cassette_r); + ioport_value cassette_r(); protected: virtual void machine_start() override; @@ -491,7 +491,7 @@ u8 cz230s_state::keys_r() /**************************************************************************/ template -CUSTOM_INPUT_MEMBER(cz230s_state::keys_row_r) +ioport_value cz230s_state::keys_row_r() { u8 data = 0xff; @@ -536,7 +536,7 @@ void cz230s_state::cassette_motor_w(int state) } /**************************************************************************/ -CUSTOM_INPUT_MEMBER(cz230s_state::cassette_r) +ioport_value cz230s_state::cassette_r() { return m_cassette->input() > 0 ? 0 : 1; } diff --git a/src/mame/casio/ld50.cpp b/src/mame/casio/ld50.cpp index f68bd04523b27..424e8afc5a8e1 100644 --- a/src/mame/casio/ld50.cpp +++ b/src/mame/casio/ld50.cpp @@ -74,7 +74,7 @@ class ld50_state : public driver_device void ld50(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(dial_r); + ioport_value dial_r(); private: u8 port0_r(); @@ -239,7 +239,7 @@ void ld50_state::port3_w(u8 data) } } -CUSTOM_INPUT_MEMBER(ld50_state::dial_r) +ioport_value ld50_state::dial_r() { // return the dial position as a 2-bit gray code const u8 val = m_dial->read(); diff --git a/src/mame/casio/pickytlk.cpp b/src/mame/casio/pickytlk.cpp index 31257d70a5fa6..1078856ff9a48 100644 --- a/src/mame/casio/pickytlk.cpp +++ b/src/mame/casio/pickytlk.cpp @@ -65,7 +65,7 @@ class pickytlk_state : public driver_device void pickytlk(machine_config &config); DECLARE_CROSSHAIR_MAPPER_MEMBER(pen_y_mapper); - DECLARE_CUSTOM_INPUT_MEMBER(pen_y_rescale_r); + ioport_value pen_y_rescale_r(); ioport_value pen_target_r(); private: @@ -155,7 +155,7 @@ CROSSHAIR_MAPPER_MEMBER(pickytlk_state::pen_y_mapper) return (float) pen_y_rescale_r() / 0xff; } -CUSTOM_INPUT_MEMBER(pickytlk_state::pen_y_rescale_r) +ioport_value pickytlk_state::pen_y_rescale_r() { /* There are two distinct areas that can be interacted with the pen: diff --git a/src/mame/casio/pv1000.cpp b/src/mame/casio/pv1000.cpp index da88bed9f11ae..2b31e1ba6eff8 100644 --- a/src/mame/casio/pv1000.cpp +++ b/src/mame/casio/pv1000.cpp @@ -78,19 +78,20 @@ void pv1000_sound_device::voice_w(offs_t offset, uint8_t data) case 0x03: m_ctrl = data; break; - default: - { - const uint8_t per = ~data & 0x3f; - if ((per == 0) && (m_voice[offset].period != 0)) - { - // flip output once and stall there! - m_voice[offset].val = !m_voice[offset].val; - } + default: + { + const uint8_t per = ~data & 0x3f; - m_voice[offset].period = per; + if ((per == 0) && (m_voice[offset].period != 0)) + { + // flip output once and stall there! + m_voice[offset].val = !m_voice[offset].val; } - break; + + m_voice[offset].period = per; + } + break; } } @@ -121,7 +122,7 @@ void pv1000_sound_device::sound_stream_update(sound_stream &stream, std::vector< auto &buffer = outputs[0]; // Each channel has a different volume via resistor mixing which correspond to -6dB, -3dB, 0dB drops - static const int volumes[3] = {0x1000, 0x1800, 0x2000}; + static const int volumes[3] = { 0x1000, 0x1800, 0x2000 }; for (int index = 0; index < buffer.samples(); index++) { @@ -175,10 +176,11 @@ class pv1000_state : public driver_device m_maincpu(*this, "maincpu"), m_sound(*this, "pv1000_sound"), m_cart(*this, "cartslot"), - m_p_videoram(*this, "videoram"), + m_videoram(*this, "videoram"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_joysticks(*this, "IN%u", 0) { } void pv1000(machine_config &config); @@ -191,16 +193,16 @@ class pv1000_state : public driver_device void io_w(offs_t offset, uint8_t data); uint8_t io_r(offs_t offset); void gfxram_w(offs_t offset, uint8_t data); + uint8_t joystick_r(); uint8_t m_io_regs[8]{}; - uint8_t m_fd_data = 0; emu_timer *m_irq_on_timer = nullptr; - emu_timer *m_irq_off_timer = nullptr; emu_timer *m_busrq_on_timer = nullptr; emu_timer *m_busrq_off_timer = nullptr; + uint8_t m_irq_enabled = 0; + uint8_t m_irq_active = 0; uint8_t m_pcg_bank = 0; uint8_t m_force_pattern = 0; - uint8_t m_fd_buffer_flag = 0; uint8_t m_border_col = 0; uint8_t m_render_disable = 0; @@ -210,16 +212,18 @@ class pv1000_state : public driver_device required_device m_maincpu; required_device m_sound; required_device m_cart; - required_shared_ptr m_p_videoram; + required_shared_ptr m_videoram; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_ioport_array<4> m_joysticks; + uint32_t screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(d65010_irq_on_cb); - TIMER_CALLBACK_MEMBER(d65010_irq_off_cb); TIMER_CALLBACK_MEMBER(d65010_busrq_on_cb); TIMER_CALLBACK_MEMBER(d65010_busrq_off_cb); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; + void pv1000_mem(address_map &map); void pv1000_io(address_map &map); }; @@ -227,8 +231,8 @@ class pv1000_state : public driver_device void pv1000_state::pv1000_mem(address_map &map) { - //map(0x0000, 0x7fff) // mapped by the cartslot - map(0xb800, 0xbbff).ram().share("videoram"); + //map(0x0000, 0x7fff) // mapped by the cartslot + map(0xb800, 0xbbff).ram().share(m_videoram); map(0xbc00, 0xbfff).ram().w(FUNC(pv1000_state::gfxram_w)).region("gfxram", 0); } @@ -242,10 +246,8 @@ void pv1000_state::pv1000_io(address_map &map) void pv1000_state::gfxram_w(offs_t offset, uint8_t data) { - uint8_t *gfxram = memregion("gfxram")->base(); - - gfxram[offset] = data; - m_gfxdecode->gfx(1)->mark_dirty(offset/32); + m_gfxram[offset] = data; + m_gfxdecode->gfx(1)->mark_dirty(offset / 32); } @@ -259,12 +261,30 @@ void pv1000_state::io_w(offs_t offset, uint8_t data) case 0x03: //logerror("io_w offset=%02x, data=%02x (%03d)\n", offset, data , data); m_sound->voice_w(offset, data); - break; + break; + + case 0x04: + /* Bit 1 = Matrix IRQ enabled * + * Bit 0 = Prerender IRQ enabled */ + m_irq_enabled = data & 3; + m_irq_active &= m_irq_enabled; + if (m_irq_active == 0) + m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); + + break; case 0x05: - m_fd_data = 0xf; + // Acknowledge Prerender IRQ + if (m_irq_active & 1) + { + m_irq_active &= ~1; + if (m_irq_active == 0) + m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); + } break; -// case 0x06 VRAM + PCG location, always fixed at 0xb8xx + + //case 0x06 VRAM + PCG location, always fixed at 0xb8xx + case 0x07: /* ---- -xxx unknown, border color? */ m_pcg_bank = (data & 0xe0) >> 5; @@ -291,39 +311,39 @@ void pv1000_state::io_w(offs_t offset, uint8_t data) uint8_t pv1000_state::io_r(offs_t offset) { - uint8_t data = m_io_regs[offset]; - -// logerror("io_r offset=%02x\n", offset); - + /* Real hardware always reads MSbit set from the two readable registers; + lidnariq suspects D7 is input-only and the 128s bit is high due to the + weak pull-ups on the data bus */ switch (offset) { - case 0x04: - /* Bit 1 = 1 => Data is available in port FD */ - /* Bit 0 = 1 => Buffer at port FD is empty */ - data = 0; - data = m_fd_buffer_flag & 1; - data |= m_fd_data ? 2 : 0; - m_fd_buffer_flag &= ~1; - break; - case 0x05: - static const char *const joynames[] = { "IN0", "IN1", "IN2", "IN3" }; - - data = 0; + case 0x04: // port $FC returns player 2 joystick and interrupt status + return 0x80 | (joystick_r() & 0x0c) | (m_irq_active & 3); // Bit 1 = Matrix IRQ, Bit 0 = Prerender IRQ - for (int i = 0; i < 4; i++) - { - if (m_io_regs[5] & 1 << i) + case 0x05: // port $FD returns both joysticks and acknowledges matrix scan IRQ + if (!machine().side_effects_disabled() && (m_irq_active & 2)) { - data |= ioport(joynames[i])->read(); - m_fd_data &= ~(1 << i); + m_irq_active &= ~2; + if (m_irq_active == 0) + m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); } - } + return 0x80 | joystick_r(); - //m_fd_data = 0; - break; + default: + /* Ports $F8-$FB, $FE, and $FF are undriven, and pulled high by the + resistors next to the Z80 */ + return 0xff; } +} - return data; +uint8_t pv1000_state::joystick_r() +{ + uint8_t data = 0; + + for (int i = 0; i < 4; i++) + if (BIT(m_io_regs[5], i)) + data |= m_joysticks[i]->read(); + + return data & 0x0f; } @@ -379,7 +399,7 @@ uint32_t pv1000_state::screen_update_pv1000(screen_device &screen, bitmap_ind16 { for (int x = 2; x < 30; x++) // left-right most columns never even drawn, black instead { - uint16_t tile = m_p_videoram[y * 32 + x]; + uint16_t tile = m_videoram[y * 32 + x]; if (tile < 0xe0 || m_force_pattern) { @@ -407,14 +427,21 @@ TIMER_CALLBACK_MEMBER(pv1000_state::d65010_irq_on_cb) int vpos = m_screen->vpos(); int next_vpos = vpos + 4; - if(vpos == 20) - m_fd_buffer_flag |= 1; /* TODO: exact timing of this */ + m_irq_active |= 2 & m_irq_enabled; + if (vpos == 20) + { + m_irq_active |= 1 & m_irq_enabled; + } - /* Set IRQ line and schedule release of IRQ line */ - m_maincpu->set_input_line(0, ASSERT_LINE); - m_irq_off_timer->adjust(m_screen->time_until_pos(vpos, 380/2)); + if (m_irq_active) + { + m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); + } - /* Schedule next IRQ trigger */ + /* Schedule next IRQ trigger + + These numbers are an artifact of defining Y=0 as the + top scanline of the non-blanking display. */ if (vpos >= 258) { next_vpos = 0; // 262=0, 4, 8, 12, 16, 20 @@ -423,34 +450,28 @@ TIMER_CALLBACK_MEMBER(pv1000_state::d65010_irq_on_cb) { next_vpos = 222; // 226, 230, 234, 238, 242, 246, 250, 254, 258 } - m_irq_on_timer->adjust(m_screen->time_until_pos(next_vpos, 224)); -} - - -TIMER_CALLBACK_MEMBER(pv1000_state::d65010_irq_off_cb) -{ - m_maincpu->set_input_line(0, CLEAR_LINE); + m_irq_on_timer->adjust(m_screen->time_until_pos(next_vpos, 224+32)); } -/* if 0,0 is the top left corner of non-black pixels, - then busreq is asserted at X=288-32 = 256 */ +/* Add BUSACK-triggered scanline renderer */ TIMER_CALLBACK_MEMBER(pv1000_state::d65010_busrq_on_cb) { int vpos = m_screen->vpos(); int next_vpos = vpos + 1; - if (m_render_disable == 0) { + if (m_render_disable == 0) + { m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, ASSERT_LINE); } // schedule the de-assertion of Busreq that corresponds to the current assertion - m_busrq_off_timer->adjust(m_screen->time_until_pos(vpos,248)); + m_busrq_off_timer->adjust(m_screen->time_until_pos(vpos, 248)); if (vpos >= 192 + 26) { next_vpos = 26; } - m_busrq_on_timer->adjust(m_screen->time_until_pos(next_vpos,0)); + m_busrq_on_timer->adjust(m_screen->time_until_pos(next_vpos, 0)); } TIMER_CALLBACK_MEMBER(pv1000_state::d65010_busrq_off_cb) @@ -468,7 +489,6 @@ void pv1000_state::pv1000_postload() void pv1000_state::machine_start() { m_irq_on_timer = timer_alloc(FUNC(pv1000_state::d65010_irq_on_cb), this); - m_irq_off_timer = timer_alloc(FUNC(pv1000_state::d65010_irq_off_cb), this); m_busrq_on_timer = timer_alloc(FUNC(pv1000_state::d65010_busrq_on_cb), this); m_busrq_off_timer = timer_alloc(FUNC(pv1000_state::d65010_busrq_off_cb), this); @@ -485,10 +505,10 @@ void pv1000_state::machine_start() } save_item(NAME(m_io_regs)); - save_item(NAME(m_fd_data)); + save_item(NAME(m_irq_enabled)); + save_item(NAME(m_irq_active)); save_item(NAME(m_pcg_bank)); save_item(NAME(m_force_pattern)); - save_item(NAME(m_fd_buffer_flag)); save_item(NAME(m_border_col)); save_item(NAME(m_render_disable)); @@ -499,9 +519,7 @@ void pv1000_state::machine_start() void pv1000_state::machine_reset() { m_io_regs[5] = 0; - m_fd_data = 0; - m_irq_on_timer->adjust(m_screen->time_until_pos(195, 0)); - m_irq_off_timer->adjust(attotime::never); + m_irq_on_timer->adjust(m_screen->time_until_pos(222, 256)); m_busrq_on_timer->adjust(m_screen->time_until_pos(26, 0)); m_busrq_off_timer->adjust(m_screen->time_until_pos(26, 248)); } diff --git a/src/mame/casio/sk1.cpp b/src/mame/casio/sk1.cpp index 50a9c93d9c40a..bf21e496dc845 100644 --- a/src/mame/casio/sk1.cpp +++ b/src/mame/casio/sk1.cpp @@ -45,8 +45,8 @@ class sk1_state : public driver_device template DECLARE_INPUT_CHANGED_MEMBER(sw_function); template DECLARE_INPUT_CHANGED_MEMBER(sw_mode); - DECLARE_CUSTOM_INPUT_MEMBER(function_in) { return m_sw_function; } - DECLARE_CUSTOM_INPUT_MEMBER(mode_in) { return m_sw_mode; } + ioport_value function_in() { return m_sw_function; } + ioport_value mode_in() { return m_sw_mode; } private: void sk1_memory(address_map &map); diff --git a/src/mame/casio/zoomer.cpp b/src/mame/casio/zoomer.cpp new file mode 100644 index 0000000000000..5f06f07a0a167 --- /dev/null +++ b/src/mame/casio/zoomer.cpp @@ -0,0 +1,700 @@ +// license: BSD-3-Clause +// copyright-holders: Devin Acker + +/* + Casio/Tandy "Zoomer" PDA (1993) + + This early pen-based PDA was created jointly by Casio (who created the hardware and BIOS) + and Tandy, with the built-in software provided by GeoWorks and Palm Computing. + It was sold by both Casio (as the Z-7000) and Tandy (as the Z-PDA), as well as AST Research + as the GRiDPad 2390. + + Main board: + LSI101: Casio/NEC uPD95130GD (V20-based CPU) + LSI102: Casio/Fujitsu MBCG25173-5104 (I/O controller) + LSI201: Toshiba TC35083 (10-bit ADC for touch screen) + LSI401: Analog Devices MAX223 (RS232 interface) + LSI601: NEC uPD65043GF-U01 (sound chip, SN76489-like with PCM streaming) + + Memory daughterboard: + LSI1, LSI2: Fujitsu MB838200AL (8Mbit mask ROM, 16.4mm TSOP) + LSI3, LSI4: Fujitsu MB838200AL (8Mbit mask ROM, 16.4mm TSOP, reverse pinout) + LSI5, LSI6: Hitachi HM65V8512 (4Mbit SRAM) + + TODO: + - PCMCIA (requires 8-bit SRAM or flash cards with specific attribute memory contents) + See other TODOs for where/how it should be hooked up, including the card lock switch + - Serial and infrared ports + - Make suspended unit state persist after pressing the power button and then quitting MAME? + (ports 70, 90-af and c0-c7 must be saved as nvram for this to work) +*/ + +#include "emu.h" + +#include "zoomer_rtc.h" + +#include "cpu/nec/nec.h" +#include "machine/bankdev.h" +#include "machine/clock.h" +#include "machine/nvram.h" +#include "sound/upd65043gfu01.h" + +#include "crsshair.h" +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + +#include "zoomer.lh" + +namespace { + +class zoomer_state : public driver_device +{ +public: + zoomer_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_bank_2000(*this, "bank_2000_%u", 0), + m_bank_a000(*this, "bank_a000_%u", 0), + m_wp_view{ + { *this, "wp_view0" }, { *this, "wp_view1" }, { *this, "wp_view2" }, { *this, "wp_view3" }, + { *this, "wp_view4" }, { *this, "wp_view5" }, { *this, "wp_view6" }, { *this, "wp_view7" }, + { *this, "wp_view8" }, { *this, "wp_view9" }, { *this, "wp_view10" }, { *this, "wp_view11" }, + { *this, "wp_view12" }, { *this, "wp_view13" }, { *this, "wp_view14" }, {*this, "wp_view15" } }, + m_rtc(*this, "rtc"), + m_psg(*this, "psg"), + m_nvram(*this, "nvram", 0x100000, endianness_t::little), + m_pen(*this, "PEN"), + m_pen_x(*this, "PEN_X"), + m_pen_y(*this, "PEN_Y") + { } + + void zoomer(machine_config &config) ATTR_COLD; + + template + void irq_set(int state); + + void power_w(int state); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + +private: + static inline constexpr unsigned TIMER_RATE = (32768 / 8); + + void maincpu_map(address_map &map) ATTR_COLD; + void maincpu_ems_map(address_map &map) ATTR_COLD; + void maincpu_io_map(address_map &map) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void apo_w(u8 data); + + u8 ems_2000_bank_r(offs_t offset); + void ems_2000_bank_w(offs_t offset, u8 data); + u8 ems_a000_bank_r(offs_t offset); + void ems_a000_bank_w(offs_t offset, u8 data); + + template + TIMER_CALLBACK_MEMBER(timer_irq) { irq_set(1); } + + u16 timer_count(u8 timer) const; + u8 timer_r(offs_t offset); + void timer_w(offs_t offset, u8 data); + + u8 irq_status_r(offs_t offset); + void irq_ack_w(offs_t offset, u8 data); + + void update_irq(); + + u16 pen_x_scaled(); + u16 pen_y_scaled(); + u8 pen_value_r(offs_t offset); + void pen_select_w(u8 data); + + u8 lcd_ctrl_r(offs_t offset); + void lcd_ctrl_w(offs_t offset, u8 data); + + u8 lcdram_latch_r(); + void lcdram_w(offs_t offset, u8 data); + + required_device m_maincpu; + required_device_array m_bank_2000; // 128kb windows (banked w/ 64kb granularity) at 20000-9ffff + required_device_array m_bank_a000; // 16kb windows at a0000-dffff + memory_view m_wp_view[16]; // view used for enabling write-protect trap in a0000-dffff area + required_device m_rtc; + required_device m_psg; + + memory_share_creator m_nvram; + + required_ioport m_pen, m_pen_x, m_pen_y; + + u8 m_power; + + emu_timer *m_timer[3]; + u16 m_timer_rate[3]; + + u16 m_irq_status; + u16 m_pending_irq; + + u16 m_bank_2000_num[4]; + u16 m_bank_a000_num[16]; + + u8 m_pen_select; + + u8 m_lcdram_latch; + u16 m_lcd_ctrl; +}; + +enum +{ + IRQ_TIMER0, + IRQ_TIMER1, + IRQ_TIMER2, + IRQ_KEYPAD, + IRQ_SERIAL, // TODO + IRQ_RTC_ALARM, + IRQ_RTC_TICK, + IRQ_PEN, + IRQ_PCMCIA, // TODO + IRQ_SOUND, + IRQ_POWER, + IRQ_PCMCIA_LOCK, // TODO: PCMCIA card lock switch + IRQ_PCMCIA_UNLOCK, // TODO: PCMCIA card lock switch + IRQ_EMS +}; + + +//************************************************************************** +// ADDRESS MAPS +//************************************************************************** + +void zoomer_state::maincpu_map(address_map &map) +{ + for (int i = 0; i < 4; i++) + { + const offs_t start = 0x20000 + (i << 17); + map(start, start | 0x1ffff).rw(m_bank_2000[i], FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8)); + } + for (int i = 0; i < 16; i++) + { + const offs_t start = 0xa0000 + (i << 14); + map(start, start | 0x3fff).rw(m_bank_a000[i], FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8)); + map(start, start | 0x3fff).view(m_wp_view[i]); + m_wp_view[i][0](start, start | 0x3fff).lw8(NAME([this](u8 data) { irq_set(1); })); + } + + map(0xd8000, 0xdffff).w(FUNC(zoomer_state::lcdram_w)); + map(0xe0000, 0xfffff).rom().region("maincpu", 0); +} + +void zoomer_state::maincpu_ems_map(address_map &map) +{ + map(0x0000000, 0x00fffff).ram().share("nvram"); + map(0x0400000, 0x07fffff).rom().region("maincpu", 0); + //map(0x1000000, 0x1ffffff) - TODO: PCMCIA +} + +void zoomer_state::maincpu_io_map(address_map &map) +{ + map(0x0020, 0x0023).ram(); // TODO: irq related + map(0x0024, 0x0025).r(FUNC(zoomer_state::irq_status_r)); + map(0x0026, 0x0027).w(FUNC(zoomer_state::irq_ack_w)); + map(0x0040, 0x004b).rw(FUNC(zoomer_state::timer_r), FUNC(zoomer_state::timer_w)); + map(0x004d, 0x004d).nopw(); // unknown, pen related + map(0x0069, 0x0069).lr8(NAME([] { return 0x80; })); // suppress PCMCIA power usage warning + map(0x0070, 0x0070).ram(); // suspend flag, used when pressing power switch or automatically powering off + map(0x0071, 0x0071).lr8(NAME([] { return 0x07; })); // unknown, needed for BIOS to start up + map(0x0072, 0x0072).portr("PORT72"); + map(0x0073, 0x0073).lr8(NAME([] { return 0x06; })); // PCMCIA slot voltage? + map(0x0075, 0x0076).noprw(); // unknown, pen related + map(0x0077, 0x0077).w(FUNC(zoomer_state::apo_w)); + map(0x0090, 0x00af).rw(FUNC(zoomer_state::ems_a000_bank_r), FUNC(zoomer_state::ems_a000_bank_w)); + map(0x00c0, 0x00c7).rw(FUNC(zoomer_state::ems_2000_bank_r), FUNC(zoomer_state::ems_2000_bank_w)); + map(0x00d0, 0x00d1).noprw(); // unknown, input related + map(0x00d2, 0x00d2).portr("KEYPAD"); + map(0x00d3, 0x00d3).nopw(); // unknown, input related + map(0x00d4, 0x00d4).portr("POWER"); + map(0x00d5, 0x00d5).nopw(); // unknown, pen related + map(0x00d7, 0x00d7).lr8(NAME([] { return 0x01; })); // unknown, pen related + map(0x00d8, 0x00d9).r(FUNC(zoomer_state::pen_value_r)); + map(0x00da, 0x00da).w(FUNC(zoomer_state::pen_select_w)); + map(0x00db, 0x00db).nopr(); // pen ADC ready + map(0x00dc, 0x00dd).nopw(); // unknown, pen related + map(0x00e0, 0x00ef).rw(m_rtc, FUNC(zoomer_rtc_device::read), FUNC(zoomer_rtc_device::write)); + map(0x0110, 0x011f).rw(m_psg, FUNC(upd65043gfu01_device::read), FUNC(upd65043gfu01_device::write)); + map(0x0204, 0x0205).rw(FUNC(zoomer_state::lcd_ctrl_r), FUNC(zoomer_state::lcd_ctrl_w)); + map(0x0213, 0x0213).r(FUNC(zoomer_state::lcdram_latch_r)); + /* + TODO: port 414 = PCMCIA card status + bit 0: ready + bit 1: write protect + bit 2: BVD1 (or 2?) + bit 3: BVD2 (or 1?) + bit 6: CD1 (or 2?) + bit 7: CD2 (or 1?) + */ + map(0x0414, 0x0414).lr8(NAME([] { return 0xff; })); + map(0x0800, 0x0fff).noprw(); // TODO: PCMCIA attribute memory? +} + + +//************************************************************************** +// INPUT PORT DEFINITIONS +//************************************************************************** + +static INPUT_PORTS_START( zoomer ) + PORT_START("PORT72") + PORT_CONFNAME( 0x01, IP_ACTIVE_HIGH, "Main Battery") + PORT_CONFSETTING(0x00, "Normal") + PORT_CONFSETTING(0x01, "Low") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN) // needs to be low to boot + PORT_CONFNAME( 0x04, IP_ACTIVE_HIGH, "Backup Battery") + PORT_CONFSETTING(0x00, "Normal") + PORT_CONFSETTING(0x04, "Low") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) // needs to be high to boot + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("PCMCIA Lock Switch") // TODO: PCMCIA lock switch (generates IRQ_PCMCIA_LOCK and IRQ_PCMCIA_UNLOCK) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN) + + PORT_START("KEYPAD") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Button B") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Button A") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_NAME("Cursor Up") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("Cursor Left") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_NAME("Cursor Down") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("Cursor Right") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN) + + PORT_START("POWER") + PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_NAME("Power") PORT_WRITE_LINE_MEMBER(zoomer_state, power_w) + + PORT_START("PEN") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Pen") PORT_WRITE_LINE_MEMBER(zoomer_state, irq_set) + + PORT_START("PEN_X") + PORT_BIT(0x3ff, 128, IPT_LIGHTGUN_X) PORT_NAME("Pen X") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0, 255) PORT_SENSITIVITY(45) PORT_KEYDELTA(30) + + PORT_START("PEN_Y") + PORT_BIT(0x3ff, 179, IPT_LIGHTGUN_Y) PORT_NAME("Pen Y") PORT_CROSSHAIR(Y, 358.0 / 320, 0.0, 0) PORT_MINMAX(0, 357) PORT_SENSITIVITY(45) PORT_KEYDELTA(30) +INPUT_PORTS_END + + +//************************************************************************** +// MACHINE EMULATION +//************************************************************************** + +void zoomer_state::machine_start() +{ + m_irq_status = 0; + m_pending_irq = 0; + + std::fill(std::begin(m_timer_rate), std::end(m_timer_rate), 0); + std::fill(std::begin(m_bank_2000_num), std::end(m_bank_2000_num), 0); + std::fill(std::begin(m_bank_a000_num), std::end(m_bank_a000_num), 0); + + m_pen_select = 0; + + m_lcdram_latch = 0; + m_lcd_ctrl = 0; + + m_maincpu->space(AS_PROGRAM).install_ram(0x00000, 0x1ffff, m_nvram.begin()); + + m_timer[0] = timer_alloc(FUNC(zoomer_state::timer_irq), this); + m_timer[1] = timer_alloc(FUNC(zoomer_state::timer_irq), this); + m_timer[2] = timer_alloc(FUNC(zoomer_state::timer_irq), this); + + save_item(NAME(m_power)); + save_item(NAME(m_irq_status)); + save_item(NAME(m_pending_irq)); + save_item(NAME(m_timer_rate)); + save_item(NAME(m_bank_2000_num)); + save_item(NAME(m_bank_a000_num)); + save_item(NAME(m_pen_select)); + save_item(NAME(m_lcdram_latch)); + save_item(NAME(m_lcd_ctrl)); +} + +//************************************************************************** +void zoomer_state::machine_reset() +{ + m_power = 1; + m_psg->set_output_gain(ALL_OUTPUTS, 1.0); +} + +//************************************************************************** +u32 zoomer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + auto &crosshair = machine().crosshair().get_crosshair(0); + crosshair.set_screen(crosshair.y() < 1.0 ? &screen : CROSSHAIR_SCREEN_NONE); + + if (!m_power || !BIT(m_lcd_ctrl, 7)) + { + bitmap.fill(0, cliprect); + } + else + { + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + const u8 data = m_nvram[0xf8000 + (y << 6) + (x >> 3)]; + bitmap.pix(y, x) = BIT(data, 7 - (x & 7)); + } + } + } + + return 0; +} + +//************************************************************************** +void zoomer_state::power_w(int state) +{ + if (state) + { + irq_set(1); + m_power = 1; + m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + m_psg->set_output_gain(ALL_OUTPUTS, 1.0); + } +} + +//************************************************************************** +void zoomer_state::apo_w(u8 data) +{ + if (BIT(data, 7)) + { + m_power = 0; + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_psg->set_output_gain(ALL_OUTPUTS, 0.0); + } +} + +//************************************************************************** +u8 zoomer_state::ems_2000_bank_r(offs_t offset) +{ + return m_bank_2000_num[offset >> 1] >> (BIT(offset, 0) * 8); +} + +//************************************************************************** +void zoomer_state::ems_2000_bank_w(offs_t offset, u8 data) +{ + const offs_t bank = offset >> 1; + + if (BIT(offset, 0)) + { + m_bank_2000_num[bank] &= 0x00ff; + m_bank_2000_num[bank] |= (data << 8); + } + else + { + m_bank_2000_num[bank] &= 0xff00; + m_bank_2000_num[bank] |= data; + } + + m_bank_2000[bank]->set_bank(m_bank_2000_num[bank]); +} + +//************************************************************************** +u8 zoomer_state::ems_a000_bank_r(offs_t offset) +{ + return m_bank_a000_num[offset >> 1] >> (BIT(offset, 0) * 8); +} + +//************************************************************************** +void zoomer_state::ems_a000_bank_w(offs_t offset, u8 data) +{ + const offs_t bank = offset >> 1; + + if (BIT(offset, 0)) + { + m_bank_a000_num[offset >> 1] &= 0x00ff; + m_bank_a000_num[offset >> 1] |= (data << 8); + + if (BIT(data, 7)) + m_wp_view[bank].select(0); + else + m_wp_view[bank].disable(); + } + else + { + m_bank_a000_num[offset >> 1] &= 0xff00; + m_bank_a000_num[offset >> 1] |= data; + } + + m_bank_a000[bank]->set_bank(m_bank_a000_num[bank]); +} + +//************************************************************************** +u16 zoomer_state::timer_count(u8 timer) const +{ + return m_timer_rate[timer] - m_timer[timer]->remaining().as_ticks(TIMER_RATE); +} + +//************************************************************************** +u8 zoomer_state::timer_r(offs_t offset) +{ + const u8 timer = offset >> 2; + + switch (offset & 3) + { + case 0: return m_timer_rate[timer]; + case 1: return m_timer_rate[timer] >> 8; + case 2: return timer_count(timer); + case 3: return timer_count(timer) >> 8; + } + + return 0; +} + +//************************************************************************** +void zoomer_state::timer_w(offs_t offset, u8 data) +{ + const u8 timer = offset >> 2; + + switch (offset & 3) + { + case 0: + m_timer_rate[timer] &= 0x0f00; + m_timer_rate[timer] |= data; + break; + case 1: + m_timer_rate[timer] &= 0x00ff; + m_timer_rate[timer] |= ((data & 0xf) << 8); + break; + default: + break; + } + + if (!m_timer_rate[timer]) + { + m_timer[timer]->adjust(attotime::never); + } + else + { + /* + period needs to be based on value+1 for the GEOS system clock to not run fast + (for some reason it reads the RTC only on boot, and then uses an OS-level software timer to keep time after that) + */ + const attotime period = attotime::from_ticks(m_timer_rate[timer] + 1, TIMER_RATE); + + /* + DOS allows performing a factory reset by holding A+B on boot, which it checks by enabling input polling, + waiting briefly in a loop, and then disabling input polling. in order for the input poll/debounce code + to be called the expected number of times before polling is disabled again, the timer IRQ needs to go off + immediately when set + */ + if (m_timer[timer]->expire().is_never()) + m_timer[timer]->adjust(attotime::zero, 0, period); + else + m_timer[timer]->adjust(m_timer[timer]->remaining(), 0, period); + } +} + +//************************************************************************** +u8 zoomer_state::irq_status_r(offs_t offset) +{ + return m_irq_status >> (BIT(offset, 0) * 8); +} + +//************************************************************************** +void zoomer_state::irq_ack_w(offs_t offset, u8 data) +{ + const u16 clear = data << (BIT(offset, 0) * 8); + + if (BIT(clear, 15)) + { + // clear current irq only (used by default handler) + m_irq_status &= ~m_pending_irq; + m_pending_irq = 0; + } + else + { + m_irq_status &= ~clear; + m_pending_irq &= ~clear; + } + + update_irq(); +} + +//************************************************************************** +void zoomer_state::update_irq() +{ + if (m_pending_irq) return; + + int state = CLEAR_LINE; + int vector = 0; + + for (int i = 0; i < 14; i++) + { + if (BIT(m_irq_status, i)) + { + state = ASSERT_LINE; + vector = 0x70 + i; + m_pending_irq = 1 << i; + break; + } + } + + m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, vector); +} + +//************************************************************************** +template +void zoomer_state::irq_set(int state) +{ + if (state) + { + m_irq_status |= (1 << Num); + update_irq(); + } +} + +//************************************************************************** +u16 zoomer_state::pen_x_scaled() +{ + // 0...255 scaled to 0x069..396 + static constexpr float scale = 0x32d / 255.0; + return 0x69 + (m_pen_x->read() * scale); +} + +//************************************************************************** +u16 zoomer_state::pen_y_scaled() +{ + // 0...357 scaled to 0x044..3d4 + static constexpr float scale = 0x390 / 357.0; + return 0x44 + (m_pen_y->read() * scale); +} + +//************************************************************************** +u8 zoomer_state::pen_value_r(offs_t offset) +{ + u16 value = 0; + + if (m_pen->read() & 1) + { + switch (m_pen_select) + { + case 0x9: value = pen_x_scaled() ^ 0x3ff; break; + case 0xb: value = pen_x_scaled(); break; + case 0xd: value = pen_y_scaled() ^ 0x3ff; break; + case 0xf: value = pen_y_scaled(); break; + } + } + + return value >> (BIT(offset, 0) * 8); +} + +//************************************************************************** +void zoomer_state::pen_select_w(u8 data) +{ + m_pen_select = data; +} + +//************************************************************************** +u8 zoomer_state::lcd_ctrl_r(offs_t offset) +{ + return m_lcd_ctrl >> (BIT(offset, 0) * 8); +} + +//************************************************************************** +void zoomer_state::lcd_ctrl_w(offs_t offset, u8 data) +{ + if (BIT(offset, 0)) + { + m_lcd_ctrl &= 0x00ff; + m_lcd_ctrl |= (data << 8); + } + else + { + m_lcd_ctrl &= 0xff00; + m_lcd_ctrl |= data; + } +} + +//************************************************************************** +u8 zoomer_state::lcdram_latch_r() +{ + return m_lcdram_latch; +} + +//************************************************************************** +void zoomer_state::lcdram_w(offs_t offset, u8 data) +{ + offset |= 0xf8000; // TODO: can VRAM be relocated? + + switch (BIT(m_lcd_ctrl, 10, 2)) + { + case 0: m_nvram[offset] = data; break; + case 1: m_nvram[offset] |= data; break; + case 2: m_nvram[offset] &= data; break; + // GEOS seems to read VRAM freely via EMS, but the BIOS does it this way instead + case 3: m_lcdram_latch = m_nvram[offset]; break; + } +} + + +//************************************************************************** +// MACHINE DEFINTIONS +//************************************************************************** + +void zoomer_state::zoomer(machine_config &config) +{ + V20(config, m_maincpu, 7.3728_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &zoomer_state::maincpu_map); + m_maincpu->set_addrmap(AS_IO, &zoomer_state::maincpu_io_map); + + for (int i = 0; i < 4; i++) + ADDRESS_MAP_BANK(config, m_bank_2000[i]).set_map(&zoomer_state::maincpu_ems_map).set_options(ENDIANNESS_LITTLE, 8, 25, 0x10000); + for (int i = 0; i < 16; i++) + ADDRESS_MAP_BANK(config, m_bank_a000[i]).set_map(&zoomer_state::maincpu_ems_map).set_options(ENDIANNESS_LITTLE, 8, 25, 0x4000); + + ZOOMER_RTC(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->alarm_cb().set(FUNC(zoomer_state::irq_set)); + m_rtc->tick_cb().set(FUNC(zoomer_state::irq_set)); + + NVRAM(config, "nvram"); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(256, 320); + screen.set_visarea_full(); + screen.set_palette("palette"); + screen.set_screen_update(FUNC(zoomer_state::screen_update)); + + PALETTE(config, "palette", palette_device::MONOCHROME_INVERTED); + + SPEAKER(config, "speaker").front_center(); + + UPD65043GFU01(config, m_psg, 7.3728_MHz_XTAL); + m_psg->add_route(0, "speaker", 1.0); + m_psg->irq_cb().set(FUNC(zoomer_state::irq_set)); + + config.set_default_layout(layout_zoomer); +} + + +//************************************************************************** +// ROM DEFINITIONS +//************************************************************************** + +ROM_START( zoomer ) + ROM_REGION(0x400000, "maincpu", 0) + ROM_LOAD("mb838200al700.lsi1", 0x000000, 0x100000, CRC(5fe48af6) SHA1(790adb436d80409b216996ee02f78164832b5de6)) + ROM_LOAD("mb838200al701.lsi2", 0x100000, 0x100000, CRC(3104492b) SHA1(9c752c381d5506d7175e3c9645b5d2c731cc0990)) + ROM_LOAD("mb838200al702.lsi3", 0x200000, 0x100000, CRC(6013e531) SHA1(955c8c0bdf4bc3e262e5f2fe8b0f7d224a855c96)) + ROM_LOAD("mb838200al703.lsi4", 0x300000, 0x100000, CRC(64038705) SHA1(81ce3e8564d0579cf57a670517ebd2dbf35996c5)) +ROM_END + +} // anonymous namespace + + +//************************************************************************** +// SYSTEM DRIVERS +//************************************************************************** + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1993, zoomer, 0, 0, zoomer, zoomer, zoomer_state, empty_init, "Casio / Tandy", "Zoomer (Z-PDA / Z-7000)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/casio/zoomer_rtc.cpp b/src/mame/casio/zoomer_rtc.cpp new file mode 100644 index 0000000000000..73cb203325e2b --- /dev/null +++ b/src/mame/casio/zoomer_rtc.cpp @@ -0,0 +1,150 @@ +// license:BSD-3-Clause +// copyright-holders:Devin Acker + +#include "emu.h" +#include "zoomer_rtc.h" + +#include + +DEFINE_DEVICE_TYPE(ZOOMER_RTC, zoomer_rtc_device, "zoomer_rtc", "Zoomer Real Time Clock") + +//************************************************************************** +zoomer_rtc_device::zoomer_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, ZOOMER_RTC, tag, owner, clock) + , device_rtc_interface(mconfig, *this) + , device_nvram_interface(mconfig, *this) + , m_tick_cb(*this) + , m_alarm_cb(*this) +{ +} + +//************************************************************************** +void zoomer_rtc_device::device_start() +{ + m_month = m_day = m_year = 0; + + m_tick_timer = timer_alloc(FUNC(zoomer_rtc_device::tick_timer), this); + m_sec_timer = timer_alloc(FUNC(zoomer_rtc_device::sec_timer), this); + + save_item(NAME(m_data)); + save_item(NAME(m_month)); + save_item(NAME(m_day)); + save_item(NAME(m_year)); +} + +//************************************************************************** +void zoomer_rtc_device::device_reset() +{ +} + +//************************************************************************** +void zoomer_rtc_device::device_clock_changed() +{ + const attotime period = attotime::from_hz(clock() / 32768.0); + m_tick_timer->adjust(period / TICKS_PER_SEC, 0, period / TICKS_PER_SEC); + m_sec_timer->adjust(period, 0, period); +} + +//************************************************************************** +u8 zoomer_rtc_device::read(offs_t offset) +{ + return m_data[offset & 0xf]; +} + +//************************************************************************** +void zoomer_rtc_device::write(offs_t offset, u8 data) +{ + offset &= 0xf; + + m_data[offset] = data; + + if (offset >= REG_DATE_LOW && offset <= REG_DATE_HIGH) + update_date(); + + if (offset >= REG_SECOND && offset <= REG_DATE_HIGH) + { + set_time(1, m_year, m_month, m_day, 0, + bcd_to_integer(m_data[REG_HOUR]), + bcd_to_integer(m_data[REG_MINUTE]), + bcd_to_integer(m_data[REG_SECOND])); + } +} + +//************************************************************************** +void zoomer_rtc_device::rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) +{ + m_data[REG_HOUR] = convert_to_bcd(hour); + m_data[REG_MINUTE] = convert_to_bcd(minute); + m_data[REG_SECOND] = convert_to_bcd(second); + + if (year != m_year || month != m_month || day != m_day) + { + struct tm date = {}; + date.tm_year = year - 1900; + date.tm_mon = month - 1; + date.tm_mday = day; + + const time_t timediff = (mktime(&date) - RTC_EPOCH) / (60 * 60 * 24); + m_data[REG_DATE_LOW] = convert_to_bcd(timediff % 100); + m_data[REG_DATE_MID] = convert_to_bcd((timediff / 100) % 100); + m_data[REG_DATE_HIGH] = convert_to_bcd((timediff / 10000) % 100); + } +} + +//************************************************************************** +void zoomer_rtc_device::update_date() +{ + const time_t date = RTC_EPOCH + + (bcd_to_integer(m_data[REG_DATE_LOW]) + + bcd_to_integer(m_data[REG_DATE_MID]) * 100 + + bcd_to_integer(m_data[REG_DATE_HIGH]) * 10000) + * 60 * 60 * 24; + + const struct tm *timenow = localtime(&date); + if (timenow) + { + m_year = timenow->tm_year + 1900; + m_month = timenow->tm_mon + 1; + m_day = timenow->tm_mday; + } +} + +//************************************************************************** +TIMER_CALLBACK_MEMBER(zoomer_rtc_device::tick_timer) +{ + m_tick_cb(1); + m_tick_cb(0); +} + +//************************************************************************** +TIMER_CALLBACK_MEMBER(zoomer_rtc_device::sec_timer) +{ + advance_seconds(); + + if (!memcmp(m_data + REG_SECOND, m_data + REG_ALARM_SECOND, REG_DATE_HIGH - REG_SECOND + 1)) + m_alarm_cb(1); + else + m_alarm_cb(0); +} + +//************************************************************************** +void zoomer_rtc_device::nvram_default() +{ + std::fill(std::begin(m_data), std::end(m_data), 0); + update_date(); +} + +//************************************************************************** +bool zoomer_rtc_device::nvram_read(util::read_stream &file) +{ + auto const [err, actual] = util::read(file, m_data, sizeof(m_data)); + update_date(); + return !err; +} + +//************************************************************************** +bool zoomer_rtc_device::nvram_write(util::write_stream &file) +{ + auto const [err, actual] = util::write(file, m_data, sizeof(m_data)); + return !err; +} diff --git a/src/mame/casio/zoomer_rtc.h b/src/mame/casio/zoomer_rtc.h new file mode 100644 index 0000000000000..482f80ee4b3f3 --- /dev/null +++ b/src/mame/casio/zoomer_rtc.h @@ -0,0 +1,72 @@ +// license:BSD-3-Clause +// copyright-holders:Devin Acker + +#ifndef MAME_CASIO_ZOOMER_RTC_H +#define MAME_CASIO_ZOOMER_RTC_H + +#pragma once + +#include "dirtc.h" + +class zoomer_rtc_device : public device_t, + public device_rtc_interface, + public device_nvram_interface +{ +public: + zoomer_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + auto alarm_cb() { return m_alarm_cb.bind(); } + auto tick_cb() { return m_tick_cb.bind(); } + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_clock_changed() override; + + virtual bool rtc_feature_leap_year() const override { return true; } + virtual bool rtc_feature_y2k() const override { return true; } + virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override; + + virtual void nvram_default() override; + virtual bool nvram_read(util::read_stream &file) override; + virtual bool nvram_write(util::write_stream &file) override; + +private: + static constexpr int TICKS_PER_SEC = 8; + static constexpr s64 RTC_EPOCH = -2203959600LL; // 2/28/1900 + + enum + { + REG_SECOND = 0x1, + REG_MINUTE, + REG_HOUR, + REG_DATE_LOW, + REG_DATE_MID, + REG_DATE_HIGH, + REG_ALARM_SECOND = 0x9, + REG_ALARM_MINUTE, + REG_ALARM_HOUR, + REG_ALARM_DATE_LOW, + REG_ALARM_DATE_MID, + REG_ALARM_DATE_HIGH + }; + + void update_date(); + + TIMER_CALLBACK_MEMBER(tick_timer); + TIMER_CALLBACK_MEMBER(sec_timer); + + emu_timer *m_tick_timer, *m_sec_timer; + devcb_write_line m_tick_cb, m_alarm_cb; + + u8 m_data[16]; + u8 m_day, m_month; + u16 m_year; +}; + +DECLARE_DEVICE_TYPE(ZOOMER_RTC, zoomer_rtc_device) + +#endif // MAME_CASIO_ZOOMER_RTC_H diff --git a/src/mame/chess/cking_master.cpp b/src/mame/chess/cking_master.cpp index a65e45699f356..b45aeacdf119b 100644 --- a/src/mame/chess/cking_master.cpp +++ b/src/mame/chess/cking_master.cpp @@ -5,9 +5,10 @@ Chess King Master (yes, it's plainly named "Master") -Chess King was a UK business formed by Intelligent Software (aka Intelligent Chess -Software), so logically, all the programs were by them. According to the manual, -the chess engine is Cyrus (by Richard Lang). +Chess King was a UK business formed by Intelligent Software Ltd (later known as +Intelligent Chess Software Ltd, after the fiasco with the Enterprise home computer), +so logically, all the programs were by them. According to the manual, the chess +engine is Cyrus (by Richard Lang). To start a new game, press CHANGE POSITION, NEW GAME, and CHANGE POSITION again. diff --git a/src/mame/chess/cking_triomphe.cpp b/src/mame/chess/cking_triomphe.cpp index 2d251ec0024d9..3ce23b059b978 100644 --- a/src/mame/chess/cking_triomphe.cpp +++ b/src/mame/chess/cking_triomphe.cpp @@ -5,8 +5,9 @@ Chess King Triomphe -For some reason, the programmer decided to (ab)use the HD6301 undefined opcode -TRAP interrupt for the beeper routine. Very strange. +The ROM includes (C)1985ICSL, that's Intelligent Chess Software Ltd. For some +reason, the programmer decided to (ab)use the HD6301 undefined opcode TRAP +interrupt for the beeper routine. Very strange. Hardware notes: - PCB label: TRIUMPHE CHESS KING @@ -186,4 +187,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1985, triomphe, 0, 0, triomphe, triomphe, triomphe_state, empty_init, "Chess King / Intelligent Software", "Triomphe", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, triomphe, 0, 0, triomphe, triomphe, triomphe_state, empty_init, "Chess King / Intelligent Chess Software", "Triomphe", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/chess/conchess.cpp b/src/mame/chess/conchess.cpp index 741417a9741ac..a9b77f9af6074 100644 --- a/src/mame/chess/conchess.cpp +++ b/src/mame/chess/conchess.cpp @@ -16,7 +16,7 @@ continued by Systemhuset. - concvicp unmapped reads/writes - verify irq/beeper for concvicp, though it is probably correct --------------------------------------------------------------------------------- +================================================================================ Hardware notes: diff --git a/src/mame/chess/regence.cpp b/src/mame/chess/regence.cpp index eaa7867c74069..9570afc1bdfd1 100644 --- a/src/mame/chess/regence.cpp +++ b/src/mame/chess/regence.cpp @@ -193,7 +193,7 @@ static INPUT_PORTS_START( regence ) // see comments for German version labels PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) 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, regence_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, regence_state, power_off, 0) INPUT_PORTS_END diff --git a/src/mame/chess/tasc.cpp b/src/mame/chess/tasc.cpp index 4a90b864f16bb..660f1b3090782 100644 --- a/src/mame/chess/tasc.cpp +++ b/src/mame/chess/tasc.cpp @@ -59,7 +59,6 @@ EPROMs are interchangeable between R30 and R40. #include "machine/nvram.h" #include "machine/ram.h" #include "machine/smartboard.h" -#include "machine/timer.h" #include "sound/dac.h" #include "video/t6963c.h" @@ -77,13 +76,13 @@ class tasc_state : public driver_device tasc_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_boot_view(*this, "boot_view"), m_rom(*this, "maincpu"), m_ram(*this, "ram"), m_nvram(*this, "nvram", 0x20000, ENDIANNESS_LITTLE), m_lcd(*this, "lcd"), m_smartboard(*this, "smartboard"), m_dac(*this, "dac"), - m_disable_bootrom(*this, "disable_bootrom"), m_inputs(*this, "IN.%u", 0U), m_out_leds(*this, "pled%u", 0U) { } @@ -95,22 +94,21 @@ class tasc_state : public driver_device protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_post_load() override { install_bootrom(m_bootrom_enabled); } private: // devices/pointers required_device m_maincpu; + memory_view m_boot_view; required_region_ptr m_rom; required_device m_ram; memory_share_creator m_nvram; required_device m_lcd; required_device m_smartboard; required_device m_dac; - required_device m_disable_bootrom; required_ioport_array<4> m_inputs; output_finder<2> m_out_leds; - bool m_bootrom_enabled = false; + emu_timer *m_boot_timer; u32 m_control = 0; u32 m_prev_pc = 0; @@ -126,15 +124,23 @@ class tasc_state : public driver_device u8 nvram_r(offs_t offset) { return m_nvram[offset]; } void nvram_w(offs_t offset, u8 data) { m_nvram[offset] = data; } - void install_bootrom(bool enable); - TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); } + TIMER_CALLBACK_MEMBER(disable_bootrom) { m_boot_view.select(1); } }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void tasc_state::machine_start() { m_out_leds.resolve(); - save_item(NAME(m_bootrom_enabled)); + m_boot_timer = timer_alloc(FUNC(tasc_state::disable_bootrom), this); + m_boot_view[1].install_ram(0, m_ram->size() - 1, m_ram->pointer()); + + // register for savestates save_item(NAME(m_control)); save_item(NAME(m_prev_pc)); save_item(NAME(m_prev_cycle)); @@ -142,7 +148,8 @@ void tasc_state::machine_start() void tasc_state::machine_reset() { - install_bootrom(true); + m_boot_view.select(0); + m_boot_timer->adjust(attotime::never); m_prev_pc = m_maincpu->pc(); m_prev_cycle = m_maincpu->total_cycles(); @@ -160,27 +167,13 @@ INPUT_CHANGED_MEMBER(tasc_state::change_cpu_freq) I/O *******************************************************************************/ -void tasc_state::install_bootrom(bool enable) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - program.unmap_readwrite(0, std::max(m_rom.bytes(), size_t(m_ram->size())) - 1); - - // bootrom bankswitch - if (enable) - program.install_read_handler(0, m_rom.bytes() - 1, read32sm_delegate(*this, FUNC(tasc_state::rom_r))); - else - program.install_ram(0, m_ram->size() - 1, m_ram->pointer()); - - m_bootrom_enabled = enable; -} - u32 tasc_state::input_r() { if (!machine().side_effects_disabled()) { // disconnect bootrom from the bus after next opcode - if (m_bootrom_enabled && !m_disable_bootrom->enabled()) - m_disable_bootrom->adjust(m_maincpu->cycles_to_attotime(10)); + if (m_boot_timer->remaining().is_never()) + m_boot_timer->adjust(m_maincpu->cycles_to_attotime(10)); m_maincpu->set_input_line(ARM_FIRQ_LINE, CLEAR_LINE); } @@ -254,6 +247,9 @@ u32 tasc_state::rom_r(offs_t offset) void tasc_state::main_map(address_map &map) { + map(0x00000000, 0x007fffff).view(m_boot_view); + m_boot_view[0](0x00000000, 0x0003ffff).r(FUNC(tasc_state::rom_r)); + map(0x01000000, 0x01000003).rw(FUNC(tasc_state::input_r), FUNC(tasc_state::control_w)); map(0x02000000, 0x0203ffff).r(FUNC(tasc_state::rom_r)); map(0x03000000, 0x0307ffff).rw(FUNC(tasc_state::nvram_r), FUNC(tasc_state::nvram_w)).umask32(0x000000ff); @@ -308,8 +304,6 @@ void tasc_state::tasc(machine_config &config) const attotime irq_period = attotime::from_hz(32.768_kHz_XTAL / 128); // 256Hz m_maincpu->set_periodic_int(FUNC(tasc_state::irq1_line_assert), irq_period); - TIMER(config, "disable_bootrom").configure_generic(FUNC(tasc_state::disable_bootrom)); - RAM(config, m_ram).set_extra_options("512K, 1M, 2M, 4M, 8M"); // see driver notes m_ram->set_default_size("512K"); m_ram->set_default_value(0); diff --git a/src/mame/cirsa/neptunp2.cpp b/src/mame/cirsa/neptunp2.cpp index c2c96f0a91644..2281f1e3cbccc 100644 --- a/src/mame/cirsa/neptunp2.cpp +++ b/src/mame/cirsa/neptunp2.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Tomasz Slanina +// copyright-holders: Tomasz Slanina /*************************************************************************** Unidesa/Cirsa "960606-5" hardware. @@ -49,9 +49,10 @@ The same hardware from Unidesa/Cirsa was also used on some games from Unidesa/Cirsa/Europea Oklahoma Express Unidesa/Cirsa/Europea Ruleta de la Fortuna -The "960606-3" version of this hardware was also used in several fruit -machines released for the UK market by BGT Gaming Technology Ltd. -(a division of Cirsa?). +This hardware was also used in several fruit machines released for the UK market by B. Gaming Technology Ltd. +B. Gaming Technology (BGT) was a brand of International Amusement Machine Corporation (IAMC), which was a +member of the CIRSA Corporation. +BGT was was formed in 1995 in Cannock, Staffordshire, to develop and supply gaming machines for the UK market. CIRSA / UNIDESA 960606-5 CPU BOARD @@ -576,10 +577,40 @@ ROM_START( unk960606b ) ROM_LOAD( "pat_063_tibpal16l8-25cn.u6", 0x000, 0x104, NO_DUMP ) // "PAT 063", protected ROM_END +ROM_START( bg_barmy ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "barmyarmy_ndp16", 0x0000, 0x080000, CRC(ae488f48) SHA1(c417a3d1a79a0ca54ade2d9a4f6d70467e6c5cb4) ) + ROM_RELOAD(0x80000, 0x80000) + + ROM_REGION( 0x100000, "oki", 0 ) + ROM_LOAD( "barmyarmy_sound1", 0x000000, 0x080000, CRC(3530d77c) SHA1(c7a42f698090fcd9644f9929b92935cf85183d23) ) + ROM_LOAD( "barmyarmy_sound2", 0x080000, 0x080000, CRC(48d4c2f3) SHA1(71e64e3e76a55275484a7c72ce2a17232b27a4eb) ) +ROM_END + +// '960606-5 PCB and 'CB1 (CS4)' security counters module. +ROM_START( bg_dbells ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "sldb.28c4.073nkyly014.u2", 0x0000, 0x080000, CRC(e0c855da) SHA1(1a12dee87705f2b9c4413fbad2a7bff89860ef19) ) + ROM_RELOAD(0x80000, 0x80000) + + ROM_REGION( 0x100000, "oki", ROMREGION_ERASE00 ) + ROM_LOAD( "073snd1.u14", 0x000000, 0x080000, CRC(0ad1e49a) SHA1(e737936d377a46e2c0bf8eb856aa738f9f9c9675) ) + ROM_LOAD( "073snd2.u15", 0x080000, 0x080000, CRC(5feecf8c) SHA1(5e85e3180087faca5f4e6e6cb7deed1a37360ac2) ) + + ROM_REGION( 0x800, "eeprom", 0 ) + ROM_LOAD( "24c16.u10", 0x000, 0x800, CRC(0cba036f) SHA1(d5bfe96d32e97e820b22a36cd8fee08cfe812a69) ) + + ROM_REGION( 0x800, "counters", 0 ) + ROM_LOAD( "cirsa_cs-4.bin", 0x000, 0x800, NO_DUMP ) + + ROM_REGION( 0x104, "plds", 0 ) + ROM_LOAD( "pat.u6", 0x000, 0x104, NO_DUMP ) +ROM_END + ROM_START( bg_ddb ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "nkyky_0-15_5", 0x0000, 0x080000, CRC(ac4a5094) SHA1(db4eab0be63e5daddca603af290debd8e929757e) ) - ROM_RELOAD(0x80000,0x80000) + ROM_RELOAD(0x80000, 0x80000) ROM_REGION( 0x100000, "oki", ROMREGION_ERASE00 ) /* There were sound ROMs in the 'CoinWorld Ding Dong Bells' set which might belong here, otherwise @@ -595,20 +626,10 @@ ROM_START( bg_ddb ) ROM_LOAD( "pat.u6", 0x000, 0x104, NO_DUMP ) ROM_END -ROM_START( bg_barmy ) - ROM_REGION( 0x100000, "maincpu", 0 ) - ROM_LOAD( "barmyarmy_ndp16", 0x0000, 0x080000, CRC(ae488f48) SHA1(c417a3d1a79a0ca54ade2d9a4f6d70467e6c5cb4) ) - ROM_RELOAD(0x80000,0x80000) - - ROM_REGION( 0x100000, "oki", 0 ) - ROM_LOAD( "barmyarmy_sound1", 0x000000, 0x080000, CRC(3530d77c) SHA1(c7a42f698090fcd9644f9929b92935cf85183d23) ) - ROM_LOAD( "barmyarmy_sound2", 0x080000, 0x080000, CRC(48d4c2f3) SHA1(71e64e3e76a55275484a7c72ce2a17232b27a4eb) ) -ROM_END - ROM_START( bg_max ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "max_a_million_v014", 0x0000, 0x080000, CRC(32fe9c3b) SHA1(77519657e6e478b3cd1bf2ad2aecc6e191abe554) ) - ROM_RELOAD(0x80000,0x80000) + ROM_RELOAD(0x80000, 0x80000) ROM_REGION( 0x100000, "oki", ROMREGION_ERASE00 ) // probably missing @@ -626,7 +647,7 @@ ROM_END ROM_START( bg_maxa ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "max_a_million_v114", 0x0000, 0x080000, CRC(a66851e9) SHA1(733ec52fa01615e740ebd40fba4a88efe9d9f24f) ) - ROM_RELOAD(0x80000,0x80000) + ROM_RELOAD(0x80000, 0x80000) ROM_REGION( 0x100000, "oki", ROMREGION_ERASE00 ) // probably missing @@ -643,7 +664,6 @@ ROM_END } // Anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS // Video games on Cirsa "960606-5" CPU PCB + "IS040302-3" VGA SOC-Legacy PCB (or similar video PCB) GAME( 2003, neptunp2, 0, neptunp2_video, neptunp2, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa", "Neptune's Pearls 2", MACHINE_IS_SKELETON ) // Year from legal registry date @@ -659,8 +679,9 @@ GAME( 1999, rockroll, 0, neptunp2_no_video, c960606, neptunp2_state, GAME( 2001?, unk960606, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa", "unknown 960606-5 based machine (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) // Year taken from sticker on PCB GAME( 2001?, unk960606b, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/Europea", "unknown 960606-5 based machine (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) // Year taken from sticker on PCB -// BGT Fruit Machines -GAME( 199?, bg_ddb, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "BGT", "Ding Dong Bells (BGT)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 199?, bg_barmy, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "BGT", "Barmy Army (BGT)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 199?, bg_max, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "BGT", "Max A Million (BGT) (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 199?, bg_maxa, bg_max, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "BGT", "Max A Million (BGT) (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) +// B. Gaming Technology Ltd. (BGT) fruit machines on Cirsa "960606-5" CPU PCB +GAME( 1997, bg_barmy, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/B. Gaming Technology", "Barmy Army", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 2000, bg_dbells, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/B. Gaming Technology", "Dancing Bells", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1999, bg_ddb, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/B. Gaming Technology", "Ding Dong Bells (B Gaming Technology)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 2000, bg_max, 0, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/B. Gaming Technology", "Max A Million (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 2000, bg_maxa, bg_max, neptunp2_no_video, c960606, neptunp2_state, empty_init, ROT0, "Unidesa/Cirsa/B. Gaming Technology", "Max A Million (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/commodore/c65.cpp b/src/mame/commodore/c65.cpp index 822205db28b8e..0ae69cadd4da9 100644 --- a/src/mame/commodore/c65.cpp +++ b/src/mame/commodore/c65.cpp @@ -1411,7 +1411,6 @@ void c65_state::cpu_w(uint8_t data) void c65_state::c65(machine_config &config) { - /* basic machine hardware */ M4510(config, m_maincpu, MAIN_C65_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &c65_state::c65_map); m_maincpu->read_callback().set(FUNC(c65_state::cpu_r)); @@ -1443,8 +1442,6 @@ void c65_state::c65(machine_config &config) // m_cia[1]->pa_rd_callback().set(FUNC(c65_state::c65_cia1_port_a_r)); m_cia[1]->pa_wr_callback().set(FUNC(c65_state::cia1_porta_w)); - - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_screen_update(FUNC(c65_state::screen_update)); // TODO: stub parameters @@ -1456,7 +1453,6 @@ void c65_state::c65(machine_config &config) PALETTE(config, m_palette, FUNC(c65_state::palette_init), 0x100); - /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); // 8580 SID diff --git a/src/mame/concept/concept.cpp b/src/mame/concept/concept.cpp index eeb793cd8e922..b2bf59658afed 100644 --- a/src/mame/concept/concept.cpp +++ b/src/mame/concept/concept.cpp @@ -39,6 +39,7 @@ #include "emu.h" #include "concept.h" +#include "concept_kbd.h" #include "cpu/m68000/m68000.h" #include "bus/a2bus/a2corvus.h" @@ -63,113 +64,6 @@ void concept_state::concept_memmap(address_map &map) static INPUT_PORTS_START( corvus_concept ) - - PORT_START("KEY0") /* port 0: keys 0x00 through 0x0f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(right)") PORT_CODE(KEYCODE_RIGHT) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3_PAD) - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9_PAD) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6_PAD) - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_PLUS_PAD) - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS_PAD) - PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER_PAD) - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(left)") PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1_PAD) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7_PAD) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(down)") PORT_CODE(KEYCODE_DOWN) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4_PAD) - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8_PAD) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5_PAD) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2_PAD) - - PORT_START("KEY1") /* port 1: keys 0x10 through 0x1f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) - - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH) - - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_BACKSLASH2) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT (r)") PORT_CODE(KEYCODE_RSHIFT) - - PORT_START("KEY2") /* port 2: keys 0x20 through 0x2f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) - - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) - - PORT_START("KEY3") /* port 3: keys 0x30 through 0x3f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) - PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT (l)") PORT_CODE(KEYCODE_LSHIFT) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) - - PORT_START("KEY4") /* port 4: keys 0x40 through 0x4f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) - PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CONTROL") PORT_CODE(KEYCODE_LCONTROL) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("FAST") PORT_CODE(KEYCODE_TILDE) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("COMMAND") PORT_CODE(KEYCODE_LALT) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(space)") PORT_CODE(KEYCODE_SPACE) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ALT") PORT_CODE(KEYCODE_RALT) - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0_PAD) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("00") PORT_CODE(KEYCODE_ASTERISK) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_DEL_PAD) - - PORT_START("KEY5") /* port 5: keys 0x50 through 0x5f */ - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) - PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(up)") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("???") PORT_CODE(KEYCODE_SLASH_PAD) - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_PAUSE) - PORT_START("DSW0") /* port 6: on-board DIP switches */ PORT_DIPNAME(0x01, 0x00, "Omninet Address bit 0") PORT_DIPSETTING(0x00, DEF_STR( Off )) @@ -246,19 +140,28 @@ void concept_state::corvus_concept(machine_config &config) m_via0->writepa_handler().set(FUNC(concept_state::via_out_a)); m_via0->writepb_handler().set(FUNC(concept_state::via_out_b)); m_via0->cb2_handler().set(FUNC(concept_state::via_out_cb2)); - m_via0->irq_handler().set(FUNC(concept_state::via_irq_func)); + m_via0->irq_handler().set_inputline(m_maincpu, M68K_IRQ_5); /* ACIAs */ MOS6551(config, m_acia0, 16.364_MHz_XTAL / 16); m_acia0->set_xtal(16.364_MHz_XTAL / 9); m_acia0->txd_handler().set("rs232a", FUNC(rs232_port_device::write_txd)); + m_acia0->irq_handler().set_inputline(m_maincpu, M68K_IRQ_4); MOS6551(config, m_acia1, 16.364_MHz_XTAL / 16); m_acia1->set_xtal(16.364_MHz_XTAL / 9); m_acia1->txd_handler().set("rs232b", FUNC(rs232_port_device::write_txd)); + m_acia1->irq_handler().set_inputline(m_maincpu, M68K_IRQ_2); MOS6551(config, m_kbdacia, 16.364_MHz_XTAL / 16); m_kbdacia->set_xtal(16.364_MHz_XTAL / 9); + m_kbdacia->txd_handler().set("keyboard", FUNC(concept_keyboard_device::write_rxd)); + m_kbdacia->dtr_handler().set("keyrxd", FUNC(input_merger_device::in_w<0>)).invert(); // open collector + m_kbdacia->irq_handler().set_inputline(m_maincpu, M68K_IRQ_6); + + CONCEPT_KEYBOARD(config, "keyboard").txd_callback().set("keyrxd", FUNC(input_merger_device::in_w<1>)); + + INPUT_MERGER_ALL_HIGH(config, "keyrxd").output_handler().set(m_kbdacia, FUNC(mos6551_device::write_rxd)); /* Apple II bus */ A2BUS(config, m_a2bus, 0).set_space(m_maincpu, AS_PROGRAM); @@ -269,20 +172,20 @@ void concept_state::corvus_concept(machine_config &config) A2BUS_SLOT(config, "sl3", m_a2bus, concept_a2_cards, nullptr); A2BUS_SLOT(config, "sl4", m_a2bus, concept_a2_cards, "fdc01"); - INPUT_MERGER_ANY_HIGH(config, "iocint").output_handler().set(FUNC(concept_state::ioc_interrupt)); + INPUT_MERGER_ANY_HIGH(config, "iocint").output_handler().set_inputline(m_maincpu, M68K_IRQ_1); /* 2x RS232 ports */ rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, nullptr)); rs232a.rxd_handler().set(m_acia0, FUNC(mos6551_device::write_rxd)); - rs232a.dcd_handler().set(m_acia0, FUNC(mos6551_device::write_dcd)); - rs232a.dsr_handler().set(m_acia0, FUNC(mos6551_device::write_dsr)); - rs232a.cts_handler().set(m_acia0, FUNC(mos6551_device::write_cts)); + //rs232a.dcd_handler().set("iocint", FUNC(input_merger_device::in_w<2>)).invert(); + //rs232a.dsr_handler().set("iocint", FUNC(input_merger_device::in_w<3>)).invert(); + //rs232a.cts_handler().set("iocint", FUNC(input_merger_device::in_w<4>)).invert(); rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr)); rs232b.rxd_handler().set(m_acia1, FUNC(mos6551_device::write_rxd)); - rs232b.dcd_handler().set(m_acia1, FUNC(mos6551_device::write_dcd)); - rs232b.dsr_handler().set(m_acia1, FUNC(mos6551_device::write_dsr)); - rs232b.cts_handler().set(m_acia1, FUNC(mos6551_device::write_cts)); + //rs232b.dcd_handler().set("iocint", FUNC(input_merger_device::in_w<5>)).invert(); + //rs232b.dsr_handler().set("iocint", FUNC(input_merger_device::in_w<6>)).invert(); + //rs232b.cts_handler().set("iocint", FUNC(input_merger_device::in_w<7>)).invert(); } diff --git a/src/mame/concept/concept.h b/src/mame/concept/concept.h index e06663116e55f..957d1cfd0fd75 100644 --- a/src/mame/concept/concept.h +++ b/src/mame/concept/concept.h @@ -54,7 +54,6 @@ class concept_state : public driver_device required_device m_a2bus; required_shared_ptr m_videoram; - uint8_t m_pending_interrupts = 0U; bool m_clock_enable = false; uint8_t m_clock_address = 0U; uint8_t io_r(offs_t offset); @@ -69,9 +68,6 @@ class concept_state : public driver_device uint8_t via_in_b(); void via_out_b(uint8_t data); void via_out_cb2(int state); - void via_irq_func(int state); - void ioc_interrupt(int state); - void concept_set_interrupt(int level, int state); void concept_memmap(address_map &map); }; diff --git a/src/mame/concept/concept_kbd.cpp b/src/mame/concept/concept_kbd.cpp new file mode 100644 index 0000000000000..e9a5570be203b --- /dev/null +++ b/src/mame/concept/concept_kbd.cpp @@ -0,0 +1,227 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + Corvus Concept 91-key keyboard + + This is a rather generic Key Tronic Corp. product using their + 22-950-3B and 22-908-03 custom ICs. + + The program outputs raw make and break scan codes in TTL-level + asynchronous serial at a rate somewhat less than 600 bits per + second (the host ACIA also happens to runs slow). It occupies + very little of the external ROM. + + Corvus seems to have swapped the positions of the backspace and + backslash keys at least once. + + The serial input from the host ACIA appears to have the sole + function of driving the LED on the Break key. The program reads + inputs only from the key matrix. + +**********************************************************************/ + +#include "emu.h" +#include "concept_kbd.h" + + +// device type definition +DEFINE_DEVICE_TYPE(CONCEPT_KEYBOARD, concept_keyboard_device, "concept_kbd", "Corvus Concept Keyboard") + +concept_keyboard_device::concept_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, CONCEPT_KEYBOARD, tag, owner, clock) + , m_mcu(*this, "mcu") + , m_keys(*this, "KEYS%X", 0U) + , m_led(*this, "led") + , m_txd_callback(*this) + , m_p2_output(0xff) + , m_key_input(0xff) +{ +} + +void concept_keyboard_device::device_resolve_objects() +{ + m_led.resolve(); +} + +void concept_keyboard_device::device_start() +{ + save_item(NAME(m_p2_output)); + save_item(NAME(m_key_input)); +} + +void concept_keyboard_device::write_rxd(int state) +{ + m_led = !state; +} + + +u8 concept_keyboard_device::p1_r() +{ + return m_key_input; +} + +void concept_keyboard_device::p2_w(u8 data) +{ + m_txd_callback(BIT(data, 4)); + + if (!BIT(data, 7)) + m_key_input = 0xff; + else if (!BIT(m_p2_output, 7)) + { + u8 row = m_mcu->p1_r() & 0x0f; + m_key_input = row >= 0x0c ? 0xff : m_keys[row]->read(); + } + + m_p2_output = data; +} + +void concept_keyboard_device::prog_map(address_map &map) +{ + map(0x000, 0x3ff).rom().region("program", 0); +} + + +static INPUT_PORTS_START(concept_keyboard) + PORT_START("KEYS0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(COMMA_PAD)) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) + + PORT_START("KEYS1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + + PORT_START("KEYS2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back Space") PORT_CHAR(0x08) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Return") PORT_CHAR(0x0d) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') PORT_CHAR(0x1d) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') PORT_CHAR(0x1c) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("KEYS3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_NAME("P") PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR(0x10) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Right Shift") + + PORT_START("KEYS4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) + PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("KEYS5") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_NAME("R") PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR(0x12) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_NAME("T") PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(0x14) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_NAME("F") PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR(0x06) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_NAME("G") PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR(0x07) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_NAME("V") PORT_CHAR('v') PORT_CHAR('V') PORT_CHAR(0x16) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_NAME("B") PORT_CHAR('b') PORT_CHAR('B') PORT_CHAR(0x02) + + PORT_START("KEYS6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_NAME("W") PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR(0x17) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_NAME("E") PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(0x05) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_NAME("S") PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(0x13) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_NAME("D") PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(0x04) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_NAME("X") PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(0x18) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_NAME("C") PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR(0x03) + + PORT_START("KEYS7") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("Esc") PORT_CHAR(0x1b) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_NAME("Tab") // not normally translated to 0x09 here + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_NAME("Q") PORT_CHAR('q') PORT_CHAR('Q') PORT_CHAR(0x11) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_NAME("Caps Lock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_NAME("A") PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR(0x01) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Left Shift") PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_NAME("Z") PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR(0x1a) + + PORT_START("KEYS8") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_NAME("Y") PORT_CHAR('y') PORT_CHAR('Y') PORT_CHAR(0x19) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_NAME("U") PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR(0x14) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_NAME("H") PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_NAME("J") PORT_CHAR('j') PORT_CHAR('J') PORT_CHAR(0x0a) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_NAME("N") PORT_CHAR('n') PORT_CHAR('N') PORT_CHAR(0x0e) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_NAME("M") PORT_CHAR('m') PORT_CHAR('M') + + PORT_START("KEYS9") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_SHIFT_2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Fast") // actually between Ctrl and Command + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_NAME("Command") PORT_CHAR(UCHAR_MAMEKEY(LALT)) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Space") PORT_CHAR(' ') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RALT) PORT_NAME("Alt") PORT_CHAR(UCHAR_MAMEKEY(RALT)) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_00_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + + PORT_START("KEYSA") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_NAME("I") PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR(0x09) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_NAME("O") PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR(0x0f) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_NAME("K") PORT_CHAR('k') PORT_CHAR('K') PORT_CHAR(0x0b) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_NAME("L") PORT_CHAR('l') PORT_CHAR('L') PORT_CHAR(0x0c) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + + PORT_START("KEYSB") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("Blank key") + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("Break") +INPUT_PORTS_END + +ioport_constructor concept_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(concept_keyboard); +} + +void concept_keyboard_device::device_add_mconfig(machine_config &config) +{ + I8035(config, m_mcu, 4.608_MHz_XTAL); // Intel P8048 in EA mode (XTAL marked "48-300-007") + m_mcu->set_addrmap(AS_PROGRAM, &concept_keyboard_device::prog_map); + m_mcu->p1_in_cb().set(FUNC(concept_keyboard_device::p1_r)); + m_mcu->p2_out_cb().set(FUNC(concept_keyboard_device::p2_w)); +} + + +ROM_START(concept_kbd) + ROM_REGION(0x400, "program", 0) + ROM_LOAD("112.z1", 0x000, 0x400, CRC(b3d37000) SHA1(fc58d77919739b66b85eb52b084af9716cd7f260)) // Intel D2758 +ROM_END + +const tiny_rom_entry *concept_keyboard_device::device_rom_region() const +{ + return ROM_NAME(concept_kbd); +} diff --git a/src/mame/concept/concept_kbd.h b/src/mame/concept/concept_kbd.h new file mode 100644 index 0000000000000..86671f00f25c8 --- /dev/null +++ b/src/mame/concept/concept_kbd.h @@ -0,0 +1,62 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CONCEPT_CONCEPT_KBD_H +#define MAME_CONCEPT_CONCEPT_KBD_H + +#pragma once + +#include "cpu/mcs48/mcs48.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> concept_keyboard_device + +class concept_keyboard_device : public device_t +{ +public: + // device type constructor + concept_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + // callback configuration + auto txd_callback() { return m_txd_callback.bind(); } + + // serial line input + void write_rxd(int state); + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: + // MCU handlers + u8 p1_r(); + void p2_w(u8 data); + + // address maps + void prog_map(address_map &map); + + // object finders + required_device m_mcu; + required_ioport_array<12> m_keys; + output_finder<> m_led; + + // output callback + devcb_write_line m_txd_callback; + + // internal state + u8 m_p2_output; + u8 m_key_input; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(CONCEPT_KEYBOARD, concept_keyboard_device) + +#endif // MAME_CONCEPT_CONCEPT_KBD_H diff --git a/src/mame/concept/concept_m.cpp b/src/mame/concept/concept_m.cpp index 883f2f12f19c3..c410ca38c65e2 100644 --- a/src/mame/concept/concept_m.cpp +++ b/src/mame/concept/concept_m.cpp @@ -16,6 +16,7 @@ #define VLOG(x) do { if (VERBOSE > 1) logerror x; } while (0) +#if 0 /* interrupt priority encoder */ enum { @@ -27,6 +28,7 @@ enum KEYINT_level, /* keyboard acia */ NMIINT_level /* reserved */ }; +#endif /* Clock interface */ @@ -38,13 +40,20 @@ enum void concept_state::machine_start() { - /* initialize int state */ - m_pending_interrupts = 0; + // OS will not boot if TDRE is clear on ACIA 0; this fixes that + m_acia0->write_cts(0); + m_acia0->write_dcd(0); + m_acia0->write_dsr(0); + m_acia1->write_cts(0); + m_acia1->write_dcd(0); + m_acia1->write_dsr(0); + m_kbdacia->write_cts(0); + m_kbdacia->write_dcd(0); + m_kbdacia->write_dsr(0); /* initialize clock interface */ m_clock_enable = false /*true*/; - save_item(NAME(m_pending_interrupts)); save_item(NAME(m_clock_enable)); save_item(NAME(m_clock_address)); } @@ -52,9 +61,6 @@ void concept_state::machine_start() void concept_state::machine_reset() { - // OS will not boot if TDRE is clear on ACIA 0; this fixes that - m_acia0->write_cts(CLEAR_LINE); - m_acia1->write_cts(CLEAR_LINE); } void concept_state::video_start() @@ -73,34 +79,6 @@ uint32_t concept_state::screen_update(screen_device &screen, bitmap_ind16 &bitma return 0; } -void concept_state::ioc_interrupt(int state) -{ - concept_set_interrupt(IOCINT_level, state); -} - -void concept_state::concept_set_interrupt(int level, int state) -{ - int interrupt_mask; - int final_level; - - if (state) - m_pending_interrupts |= 1 << level; - else - m_pending_interrupts &= ~ (1 << level); - - for (final_level = 7, interrupt_mask = m_pending_interrupts; (final_level > 0) && ! (interrupt_mask & 0x80); final_level--, interrupt_mask <<= 1) - ; - - if (final_level) - /* assert interrupt */ - m_maincpu->set_input_line(M68K_IRQ_1 + final_level - 1, ASSERT_LINE); - else - { - /* clear all interrupts */ - m_maincpu->set_input_line(M68K_IRQ_1 + level - 1, CLEAR_LINE); - } -} - /* VIA port A @@ -161,14 +139,6 @@ void concept_state::via_out_cb2(int state) m_speaker->level_w(state); } -/* - VIA irq -> 68k level 5 -*/ -void concept_state::via_irq_func(int state) -{ - concept_set_interrupt(TIMINT_level, state); -} - uint8_t concept_state::io_r(offs_t offset) { switch ((offset >> 8) & 7) diff --git a/src/mame/cxg/computachess.cpp b/src/mame/cxg/computachess.cpp index 59d05d14882ba..b55e37950c59e 100644 --- a/src/mame/cxg/computachess.cpp +++ b/src/mame/cxg/computachess.cpp @@ -22,12 +22,12 @@ switch which puts the MCU in halt state. Hardware notes: Sensor Computachess: -- PCB label WA 001 600 002 +- PCB label: WA 001 600 002 - Hitachi 44801A50 MCU @ ~400kHz - buzzer, 16 leds, button sensors chessboard Portachess II: -- PCB label CXG223-600-001 (main pcb), CXG 211 600 101 (led pcb taken from +- PCB label: CXG223-600-001 (main pcb), CXG 211 600 101 (led pcb taken from Advanced Star Chess, extra led row unused here) - Hitachi HD44801C89 MCU @ ~400kHz (serial 202: from Portachess 1985 version) - rest same as above @@ -102,18 +102,15 @@ class computachess_state : public driver_device required_ioport m_inputs; u8 m_inp_mux = 0; - u8 m_led_data = 0; - void update_display(); template void mux_w(u8 data); - void leds_w(u16 data); + void control_w(u16 data); u16 input_r(); }; void computachess_state::machine_start() { save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_data)); } @@ -122,27 +119,21 @@ void computachess_state::machine_start() I/O *******************************************************************************/ -void computachess_state::update_display() -{ - m_display->matrix(m_inp_mux, m_led_data); -} - template void computachess_state::mux_w(u8 data) { - // R2x,R3x: input mux, led select + // R2x,R3x: input mux, led data m_inp_mux = (m_inp_mux & ~(0xf << (N*4))) | (data << (N*4)); - update_display(); + m_display->write_mx(m_inp_mux); } -void computachess_state::leds_w(u16 data) +void computachess_state::control_w(u16 data) { - // D2,D3: led data - m_led_data = ~data >> 2 & 3; - update_display(); - // D0: speaker out - m_dac->write(data & 1); + m_dac->write(~data & 1); + + // D2,D3: led select + m_display->write_my(~data >> 2 & 3); } u16 computachess_state::input_r() @@ -169,19 +160,21 @@ u16 computachess_state::input_r() static INPUT_PORTS_START( scptchess ) PORT_START("IN.0") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") // only hooked up on 1st version PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Reverse Play") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") + + PORT_START("RESET") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, computachess_state, reset_button, 0) PORT_NAME("New Game") INPUT_PORTS_END static INPUT_PORTS_START( scptchessa ) PORT_INCLUDE( scptchess ) PORT_MODIFY("IN.0") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") // only hooked up on 1st version - PORT_START("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, computachess_state, reset_button, 0) PORT_NAME("New Game") + PORT_MODIFY("RESET") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) INPUT_PORTS_END @@ -193,10 +186,10 @@ INPUT_PORTS_END void computachess_state::scptchess(machine_config &config) { // basic machine hardware - HD44801(config, m_maincpu, 400'000); + HD44801(config, m_maincpu, 400'000); // approximation m_maincpu->write_r<2>().set(FUNC(computachess_state::mux_w<0>)); m_maincpu->write_r<3>().set(FUNC(computachess_state::mux_w<1>)); - m_maincpu->write_d().set(FUNC(computachess_state::leds_w)); + m_maincpu->write_d().set(FUNC(computachess_state::control_w)); m_maincpu->read_d().set(FUNC(computachess_state::input_r)); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); @@ -204,7 +197,7 @@ void computachess_state::scptchess(machine_config &config) m_board->set_delay(attotime::from_msec(150)); // video hardware - PWM_DISPLAY(config, m_display).set_size(8, 2); + PWM_DISPLAY(config, m_display).set_size(2, 8); config.set_default_layout(layout_cxg_scptchess); // sound hardware @@ -215,6 +208,8 @@ void computachess_state::scptchess(machine_config &config) void computachess_state::scptchessa(machine_config &config) { scptchess(config); + + m_maincpu->write_d().set(FUNC(computachess_state::control_w)).exor(1); config.set_default_layout(layout_cxg_scptchessa); } @@ -226,12 +221,12 @@ void computachess_state::scptchessa(machine_config &config) ROM_START( scptchess ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD("white_allcock_44801a50", 0x0000, 0x2000, CRC(c5c53e05) SHA1(8fa9b8e48ca54f08585afd83ae78fb1970fbd382) ) + ROM_LOAD("202_newcrest_16_hd44801c89", 0x0000, 0x2000, CRC(56b48f70) SHA1(84ec62323c6d3314e0515bccfde2f65f6d753e99) ) ROM_END ROM_START( scptchessa ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD("202_newcrest_16_hd44801c89", 0x0000, 0x2000, CRC(56b48f70) SHA1(84ec62323c6d3314e0515bccfde2f65f6d753e99) ) + ROM_LOAD("white_allcock_44801a50", 0x0000, 0x2000, CRC(c5c53e05) SHA1(8fa9b8e48ca54f08585afd83ae78fb1970fbd382) ) ROM_END } // anonymous namespace @@ -243,5 +238,5 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1981, scptchess, 0, 0, scptchess, scptchess, computachess_state, empty_init, "CXG Systems / White and Allcock / Intelligent Software", "Sensor Computachess (1981 version)", MACHINE_SUPPORTS_SAVE ) -SYST( 1985, scptchessa, scptchess, 0, scptchessa, scptchessa, computachess_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Software", "Sensor Computachess (1985 version)", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, scptchess, 0, 0, scptchess, scptchess, computachess_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Chess Software", "Sensor Computachess (1985 version)", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, scptchessa, scptchess, 0, scptchessa, scptchessa, computachess_state, empty_init, "CXG Systems / White and Allcock / Intelligent Software", "Sensor Computachess (1981 version)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/cxg/professor.cpp b/src/mame/cxg/professor.cpp index 6ab0a4b04c2fa..7bc8c79dc0e03 100644 --- a/src/mame/cxg/professor.cpp +++ b/src/mame/cxg/professor.cpp @@ -9,7 +9,7 @@ NOTE: Before exiting MAME, press the OFF button to turn the power off. Otherwise NVRAM won't save properly. The chess engine is by Frans Morsch, similar to the one in Mephisto Europa. -For some reason, they've put the row leds on the right instead of on the left. +For some reason, they've put the row LEDs on the right instead of on the left. Hardware notes: - PCB label: 243 600 001 @@ -179,11 +179,11 @@ static INPUT_PORTS_START( professor ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Monitor") PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_BIT(0xfe, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_CHANGED_MEMBER(DEVICE_SELF, professor_state, on_button, 0) PORT_NAME("On") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, professor_state, on_button, 0) INPUT_PORTS_END diff --git a/src/mame/cxg/royal.cpp b/src/mame/cxg/royal.cpp new file mode 100644 index 0000000000000..0c7ff7a6457bb --- /dev/null +++ b/src/mame/cxg/royal.cpp @@ -0,0 +1,364 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/******************************************************************************* + +CXG Sphinx Royal family + +NOTE: Turn the power switch (or button in supra's case) off before exiting MAME, +otherwise NVRAM won't save properly. And only turn the power off when it's the +user's turn to move, this is warned about in the manual. + +TODO: +- if/when MAME supports an exit callback, hook up power-off switch/button to that + +Hardware notes: +- HD614042S, 4MHz XTAL +- optional LCD panel(s), see below +- chessboard buttons, 16+4 LEDs, piezo + +Royal has 2 LCD panels, Supra has 1 (D12 pin is low), Granada and others have 0. +The LCD panel has 4 7segs and 2 unused segments: an x in the middle, and a white +square under the first digit. + +The 1992 versions by National Telecommunications System Ltd (Granada CXG-347, +Sierra, Seville) have a lower-speed 3.58MHz XTAL, but since none of them have +LCD panels, users won't notice the slower chess clocks. + +Excluding other brands with the same product name, HD614042SJ02 MCU was used in: +- CXG Sphinx Royal (model 240) +- CXG Sphinx Supra (model 048) +- CXG Sphinx Granada (model 247/347) +- CXG Sphinx Seville (model 807) +- CXG Sphinx Sierra (model 647W) +- CXG Sphinx Alicante (model 328, suspected) +- Excalibur Chess Wizard (model 807E), Excalibur brand Sphinx Seville +- Excalibur Stiletto (model 328E/638E), Excalibur brand Sphinx Alicante (suspected) + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/hmcs400/hmcs400.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "video/pwm.h" + +#include "speaker.h" + +// internal artwork +#include "cxg_granada.lh" +#include "cxg_royal.lh" +#include "cxg_supra.lh" + + +namespace { + +class royal_state : public driver_device +{ +public: + royal_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_led_pwm(*this, "led_pwm"), + m_lcd_pwm(*this, "lcd_pwm"), + m_dac(*this, "dac"), + m_inputs(*this, "IN.%u", 0), + m_out_digit(*this, "digit%u", 0U) + { } + + void royal(machine_config &config); + void granada(machine_config &config); + void supra(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(granada_change_cpu_freq); + DECLARE_INPUT_CHANGED_MEMBER(supra_on_button); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device m_maincpu; + required_device m_board; + required_device m_led_pwm; + required_device m_lcd_pwm; + required_device m_dac; + required_ioport_array<2> m_inputs; + output_finder<8> m_out_digit; + + u8 m_inp_mux = 0; + u8 m_lcd_com = 0; + u16 m_lcd_segs = 0; + u8 m_lcd_select = 0; + + // I/O handlers + void stop_mode(int state); + + void update_lcd(); + template void lcd_segs_w(u8 data); + void lcd_com_w(u8 data); + + template u8 board_r(); + template void input_w(u8 data); + void control_w(u16 data); + u16 input_r(); +}; + +void royal_state::machine_start() +{ + m_out_digit.resolve(); + + // register for savestates + save_item(NAME(m_inp_mux)); + save_item(NAME(m_lcd_com)); + save_item(NAME(m_lcd_segs)); + save_item(NAME(m_lcd_select)); +} + +INPUT_CHANGED_MEMBER(royal_state::granada_change_cpu_freq) +{ + // 1992 models run at lower speed + m_maincpu->set_unscaled_clock((newval & 1) ? 4_MHz_XTAL : 3.58_MHz_XTAL); +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +// power + +void royal_state::stop_mode(int state) +{ + // clear display + if (state) + { + m_lcd_pwm->clear(); + m_led_pwm->clear(); + } +} + +INPUT_CHANGED_MEMBER(royal_state::supra_on_button) +{ + // stop mode check actually comes from D3 high-impedance state + if (newval && m_maincpu->stop_mode()) + m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); +} + + +// LCD + +void royal_state::update_lcd() +{ + 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 u16 data = (com == 0) ? m_lcd_segs : (com == 2) ? ~m_lcd_segs : 0; + + // 2 digits per common + for (int j = 0; j < 2; j++) + { + u8 digit = bitswap<8>(data >> (j * 8), 0,1,2,3,4,5,6,7); + m_lcd_pwm->write_row(m_lcd_select * 4 + i * 2 + j, digit); + } + } +} + +template +void royal_state::lcd_segs_w(u8 data) +{ + // R0x,R6x-R8x: LCD segment data + m_lcd_segs = (m_lcd_segs & ~(0xf << (N*4))) | (data << (N*4)); + update_lcd(); +} + +void royal_state::lcd_com_w(u8 data) +{ + // R50-R53: LCD common + m_lcd_com = data; + update_lcd(); +} + + +// misc + +template +u8 royal_state::board_r() +{ + // R1x,R2x: read chessboard + u8 data = 0; + + for (int i = 0; i < 8; i++) + if (BIT(m_inp_mux, i)) + data |= m_board->read_rank(i); + + return data >> (N * 4) & 0xf; +} + +template +void royal_state::input_w(u8 data) +{ + // R3x,R4x: input mux, LED data + m_inp_mux = (m_inp_mux & ~(0xf << (N*4))) | (data << (N*4)); + m_led_pwm->write_mx(~m_inp_mux); +} + +void royal_state::control_w(u16 data) +{ + // D4,D5: LED select + // D6-D9: status LEDs (direct) + m_led_pwm->write_my(data >> 4 & 0x3f); + + // D13: LCD panel select + m_lcd_select = BIT(data, 13); + update_lcd(); + + // D14: speaker out + m_dac->write(BIT(data, 14)); +} + +u16 royal_state::input_r() +{ + u16 data = 0; + + // D0,D1: read buttons + for (int i = 0; i < 2; i++) + if (m_inp_mux & m_inputs[i]->read()) + data |= 1 << i; + + // D10,D11: freq sel + // D12: 1/2 LCD panels + return data | 0x140c; +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( royal ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Rook") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_POWER_OFF) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Move") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set-Up") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Sound") +INPUT_PORTS_END + +static INPUT_PORTS_START( granada ) + PORT_INCLUDE( royal ) + + PORT_START("CPU") + PORT_CONFNAME( 0x01, 0x01, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, royal_state, granada_change_cpu_freq, 0) // factory set + PORT_CONFSETTING( 0x00, "3.58MHz (1992 version)" ) + PORT_CONFSETTING( 0x01, "4MHz (1988 version)" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( supra ) + PORT_INCLUDE( royal ) + + PORT_START("RESET") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, royal_state, supra_on_button, 0) +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void royal_state::royal(machine_config &config) +{ + // basic machine hardware + HD614042(config, m_maincpu, 4_MHz_XTAL); + m_maincpu->nvram_enable_backup(true); + m_maincpu->stop_cb().set(m_maincpu, FUNC(hmcs400_cpu_device::nvram_set_battery)); + m_maincpu->stop_cb().append(FUNC(royal_state::stop_mode)); + m_maincpu->write_r<0>().set(FUNC(royal_state::lcd_segs_w<0>)); + m_maincpu->read_r<1>().set(FUNC(royal_state::board_r<0>)); + m_maincpu->read_r<2>().set(FUNC(royal_state::board_r<1>)); + m_maincpu->write_r<3>().set(FUNC(royal_state::input_w<0>)); + m_maincpu->write_r<4>().set(FUNC(royal_state::input_w<1>)); + m_maincpu->write_r<5>().set(FUNC(royal_state::lcd_com_w)); + m_maincpu->write_r<6>().set(FUNC(royal_state::lcd_segs_w<3>)); + m_maincpu->write_r<7>().set(FUNC(royal_state::lcd_segs_w<2>)); + m_maincpu->write_r<8>().set(FUNC(royal_state::lcd_segs_w<1>)); + m_maincpu->write_d().set(FUNC(royal_state::control_w)); + m_maincpu->read_d().set(FUNC(royal_state::input_r)); + + 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(8, 8); + m_lcd_pwm->set_bri_levels(0.05); + m_lcd_pwm->set_segmask(0xff, 0x7f); + m_lcd_pwm->output_digit().set([this](offs_t offset, u64 data) { m_out_digit[offset] = data; }); + + PWM_DISPLAY(config, m_led_pwm).set_size(6, 8); + config.set_default_layout(layout_cxg_royal); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); +} + +void royal_state::supra(machine_config &config) +{ + royal(config); + m_maincpu->read_d().set(FUNC(royal_state::input_r)).exor(0x1000); + config.set_default_layout(layout_cxg_supra); +} + +void royal_state::granada(machine_config &config) +{ + supra(config); + config.set_default_layout(layout_cxg_granada); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( sroyal ) + ROM_REGION( 0x2000, "maincpu", 0 ) + ROM_LOAD("1988_105_newcrest_hd614042sj02", 0x0000, 0x2000, CRC(47334ac9) SHA1(b4dc930e34926f1b33f6d247af45627c891202ff) ) +ROM_END + +#define rom_granada rom_sroyal +#define rom_supra rom_sroyal + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1988, sroyal, 0, 0, royal, royal, royal_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Chess Software", "Sphinx Royal", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, granada, sroyal, 0, granada, granada, royal_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Chess Software", "Sphinx Granada", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, supra, sroyal, 0, supra, supra, royal_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Chess Software", "Sphinx Supra", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/cxg/senterprise.cpp b/src/mame/cxg/senterprise.cpp index 2ba9e82c98b3b..d79c482c17e55 100644 --- a/src/mame/cxg/senterprise.cpp +++ b/src/mame/cxg/senterprise.cpp @@ -305,7 +305,7 @@ static INPUT_PORTS_START( senterp ) 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") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, senterp_state, power_off, 0) INPUT_PORTS_END static INPUT_PORTS_START( senterpc ) @@ -395,5 +395,5 @@ ROM_END *******************************************************************************/ // 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 ) -SYST( 1986, senterpc, senterp, 0, senterpc, senterpc, senterpc_state, empty_init, "CXG Systems / Newcrest Technology", "Super Enterprise (model 210.C)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, senterp, 0, 0, senterp, senterp, senterp_state, empty_init, "CXG Systems / Newcrest Technology / LogiSoft", "Super Enterprise (model 210)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, senterpc, senterp, 0, senterpc, senterpc, senterpc_state, empty_init, "CXG Systems / Newcrest Technology / LogiSoft", "Super Enterprise (model 210.C)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/cxg/sphinx40.cpp b/src/mame/cxg/sphinx40.cpp index 143750c8361c7..41a73f7f119b2 100644 --- a/src/mame/cxg/sphinx40.cpp +++ b/src/mame/cxg/sphinx40.cpp @@ -324,4 +324,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, sphinx40, 0, 0, sphinx40, sphinx40, sphinx40_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Software", "Sphinx 40", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, sphinx40, 0, 0, sphinx40, sphinx40, sphinx40_state, empty_init, "CXG Systems / Newcrest Technology / Intelligent Chess Software", "Sphinx 40", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/astrof.cpp b/src/mame/dataeast/astrof.cpp index b627cfb8e9ecc..f30bac1997cac 100644 --- a/src/mame/dataeast/astrof.cpp +++ b/src/mame/dataeast/astrof.cpp @@ -124,13 +124,13 @@ INPUT_CHANGED_MEMBER(astrof_state::service_coin_inserted) } -CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r) +ioport_value astrof_state::astrof_p1_controls_r() { return ioport("P1")->read(); } -CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r) +ioport_value astrof_state::astrof_p2_controls_r() { uint32_t ret; @@ -146,7 +146,7 @@ CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r) } -CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r) +ioport_value astrof_state::tomahawk_controls_r() { uint32_t ret; diff --git a/src/mame/dataeast/astrof.h b/src/mame/dataeast/astrof.h index 16ff6d6dc57eb..85d5021f092d4 100644 --- a/src/mame/dataeast/astrof.h +++ b/src/mame/dataeast/astrof.h @@ -40,9 +40,9 @@ class astrof_state : public driver_device void spfghmk2_audio(machine_config &config); void tomahawk_audio(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(astrof_p1_controls_r); - DECLARE_CUSTOM_INPUT_MEMBER(astrof_p2_controls_r); - DECLARE_CUSTOM_INPUT_MEMBER(tomahawk_controls_r); + ioport_value astrof_p1_controls_r(); + ioport_value astrof_p2_controls_r(); + ioport_value tomahawk_controls_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); DECLARE_INPUT_CHANGED_MEMBER(service_coin_inserted); diff --git a/src/mame/dataeast/cntsteer.cpp b/src/mame/dataeast/cntsteer.cpp index afa1e7e008f37..084e13de7cbe5 100644 --- a/src/mame/dataeast/cntsteer.cpp +++ b/src/mame/dataeast/cntsteer.cpp @@ -15,21 +15,30 @@ - flip screen support; - according to a side-by-side test, sound should be "darker" by some octaves, likely that a sound filter is needed; - cntsteer specific: - - In Back Rotate Test, rotation is tested with the following arrangement (upper bits of rotation parameter): + - tilemap paging may be wrong + Maybe upper scroll bits also controls startdx/dy? + zerotrgt: + - ROZ is misaligned in attract mode ranking (should be X +576 not -576) + - ROZ doesn't align with tanks in stage 2 (red circles should follow them) + cntsteer: + - In Back Rotate Test, rotation is tested with the following arrangement + (upper bits of rotation parameter): 04 -> 05 -> 02 -> 03 -> 00 -> 01 -> 06 -> 07 -> 04 and backwards Anything with bit 0 set is tested from 0xff to 0, with bit 0 clear that's 0 -> 0xff, fun. - - Understand how irq communication works between CPUs. Buffer $415-6 seems involved in the protocol. - We currently have slave CPU irq hooked up to vblank, might or might not be correct. - - invert order between maincpu and subcpu, subcpu is clearly the master CPU here. - - understand why background mirroring causes wrong gfxs on title screen_device. - Probably area 0x2000-0x2fff enables tile bank bit 8 and write addresses have same mapping as reading. - A preliminary decoding is in tilelayout_swap; - - tilemap flashing when gameplay timer is running out; - - tilemap scrolling, correct only for title screen. - Maybe upper scroll bits also controls startdx/dy? + - scrolling goes backwards on gameplay; + - tilemap should flash when gameplay timer is running out; + - understand why background mirroring causes wrong gfxs at end of title screen sequence. + Uses $2000-$2fff and should just draw the same USA flag as the ones shown at start of the + sequence; + - color decoding slightly off, needs resnet; + - Understand how irq communication works between CPUs. Buffer $415-6 seems involved in the + protocol. + We currently have slave CPU irq hooked up to vblank, might or might not be correct. + - sound keeps ringing once it start executing SOUND TEST; cleanup - - split into driver/video; + - split state objects, consider using composable devices rather than inherit one with the + other (has HMC20 + VSC30 custom chips); + - Document PCB components for both; ***************************************************************************************/ @@ -104,7 +113,6 @@ class cntsteer_state : public driver_device void cntsteer_background_w(offs_t offset, uint8_t data); uint8_t cntsteer_background_mirror_r(offs_t offset); void gekitsui_sub_irq_ack(uint8_t data); - void cntsteer_sound_w(uint8_t data); void zerotrgt_ctrl_w(offs_t offset, uint8_t data); void cntsteer_sub_irq_w(uint8_t data); void cntsteer_sub_nmi_w(uint8_t data); @@ -484,6 +492,7 @@ void cntsteer_state::cntsteer_vregs_w(offs_t offset, uint8_t data) case 0: m_scrolly = data; break; case 1: m_scrollx = data; break; case 2: m_bg_bank = (data & 0x01) << 9; + // crosses above, verified to be correct by service mode BACK CG PALLETE TEST item m_bg_color_bank = (data & 7); m_bg_tilemap->mark_all_dirty(); break; @@ -515,13 +524,13 @@ void cntsteer_state::cntsteer_background_w(offs_t offset, uint8_t data) m_bg_tilemap->mark_tile_dirty(offset); } -/* checks area 0x2000-0x2fff with this address config. */ +/* checks area $2000-$2fff with this address config. */ uint8_t cntsteer_state::cntsteer_background_mirror_r(offs_t offset) { return m_videoram2[bitswap<16>(offset,15,14,13,12,5,4,3,2,1,0,11,10,9,8,7,6)]; } -// TODO: on write prolly selects bit 8 of tile bank (which needs better decoding too) +// TODO: $2000-$2fff on write most likely also selects the alt rotated tiles at 0x1**/0x3** /************************************* * @@ -534,12 +543,6 @@ void cntsteer_state::gekitsui_sub_irq_ack(uint8_t data) m_subcpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); } -void cntsteer_state::cntsteer_sound_w(uint8_t data) -{ - m_soundlatch->write(data); - m_audiocpu->set_input_line(0, HOLD_LINE); -} - void cntsteer_state::zerotrgt_ctrl_w(offs_t offset, uint8_t data) { /*TODO: check this.*/ @@ -625,7 +628,7 @@ void cntsteer_state::gekitsui_cpu2_map(address_map &map) map(0x3003, 0x3003).portr("COINS"); map(0x3000, 0x3004).w(FUNC(cntsteer_state::zerotrgt_vregs_w)); map(0x3005, 0x3005).w(FUNC(cntsteer_state::gekitsui_sub_irq_ack)); - map(0x3007, 0x3007).w(FUNC(cntsteer_state::cntsteer_sound_w)); + map(0x3007, 0x3007).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x4000, 0xffff).rom(); } @@ -652,8 +655,7 @@ void cntsteer_state::cntsteer_cpu2_map(address_map &map) map(0x3000, 0x3004).w(FUNC(cntsteer_state::cntsteer_vregs_w)); map(0x3005, 0x3005).w(FUNC(cntsteer_state::gekitsui_sub_irq_ack)); map(0x3006, 0x3006).w(FUNC(cntsteer_state::cntsteer_main_irq_w)); - map(0x3007, 0x3007).w(FUNC(cntsteer_state::cntsteer_sound_w)); - map(0x3007, 0x3007).nopr(); //m6809 bug. + map(0x3007, 0x3007).nopr().w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x4000, 0xffff).rom(); } @@ -985,7 +987,6 @@ void cntsteer_state::cntsteer(machine_config &config) MC6809E(config, m_subcpu, 2000000); /* MC68B09E */ m_subcpu->set_addrmap(AS_PROGRAM, &cntsteer_state::cntsteer_cpu2_map); -// m_subcpu->set_disable(); M6502(config, m_audiocpu, XTAL(12'000'000)/8); /* ? */ m_audiocpu->set_addrmap(AS_PROGRAM, &cntsteer_state::sound_map); @@ -1016,6 +1017,7 @@ void cntsteer_state::cntsteer(machine_config &config) SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); ay8910_device &ay1(YM2149(config, "ay1", XTAL(12'000'000)/8)); ay1.port_a_write_callback().set("dac", FUNC(dac_byte_interface::data_w)); @@ -1063,6 +1065,7 @@ void cntsteer_state::zerotrgt(machine_config &config) SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); YM2149(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "speaker", 0.5); @@ -1291,4 +1294,4 @@ void cntsteer_state::init_zerotrgt() GAME( 1985, zerotrgt, 0, zerotrgt, zerotrgt, cntsteer_state, init_zerotrgt, ROT0, "Data East Corporation", "Zero Target (World, CW)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND|MACHINE_NO_COCKTAIL|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE ) GAME( 1985, zerotrgta, zerotrgt, zerotrgt, zerotrgta, cntsteer_state, init_zerotrgt, ROT0, "Data East Corporation", "Zero Target (World, CT)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND|MACHINE_NO_COCKTAIL|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE ) GAME( 1985, gekitsui, zerotrgt, zerotrgt, zerotrgta, cntsteer_state, init_zerotrgt, ROT0, "Data East Corporation", "Gekitsui Oh (Japan)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND|MACHINE_NO_COCKTAIL|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE ) -GAME( 1985, cntsteer, 0, cntsteer, cntsteer, cntsteer_state, init_zerotrgt, ROT270, "Data East Corporation", "Counter Steer (Japan)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND|MACHINE_WRONG_COLORS|MACHINE_NO_COCKTAIL|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cntsteer, 0, cntsteer, cntsteer, cntsteer_state, init_zerotrgt, ROT270, "Data East Corporation", "Counter Steer (Japan)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND|MACHINE_IMPERFECT_COLORS|MACHINE_NO_COCKTAIL|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/compgolf.cpp b/src/mame/dataeast/compgolf.cpp index d25697e0edac7..ad9c382903615 100644 --- a/src/mame/dataeast/compgolf.cpp +++ b/src/mame/dataeast/compgolf.cpp @@ -80,7 +80,7 @@ class compgolf_state : public driver_device TILE_GET_INFO_MEMBER(get_text_info); TILEMAP_MAPPER_MEMBER(back_scan); TILE_GET_INFO_MEMBER(get_back_info); - void palette(palette_device &palette) const; + void palette_init(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void expand_bg() ATTR_COLD; @@ -88,7 +88,7 @@ class compgolf_state : public driver_device }; -void compgolf_state::palette(palette_device &palette) const +void compgolf_state::palette_init(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); @@ -423,10 +423,9 @@ void compgolf_state::compgolf(machine_config &config) screen.set_palette(m_palette); screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); - PALETTE(config, m_palette, FUNC(compgolf_state::palette), 0x100); + PALETTE(config, m_palette, FUNC(compgolf_state::palette_init), 0x100); GFXDECODE(config, m_gfxdecode, m_palette, gfx_compgolf); - SPEAKER(config, "mono").front_center(); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1'500'000)); diff --git a/src/mame/dataeast/deco_ld.cpp b/src/mame/dataeast/deco_ld.cpp index 4699565d20e18..9233473e26640 100644 --- a/src/mame/dataeast/deco_ld.cpp +++ b/src/mame/dataeast/deco_ld.cpp @@ -8,13 +8,12 @@ preliminary driver by Angelo Salese TODO: - laserdisc hook-up and 6850 comms; -- "RAM TEST ERROR 5J" in Bega's Battle and Cobra Command -- "SOUND TEST READ ERROR" -- color offset number origin is unknown; -- Bega's Battle VBLANK hack (ld/framework fault most likely) -- CPU clocks -- dip-switches -- clean-ups +- "SOUND TEST READ ERROR"; +- video color offsets are a mystery, where it gets calculated from? +- Bega's Battle VBLANK hack; +- CPU clocks; +- dip-switches; +- clean-ups; *************************************************************************** @@ -116,6 +115,7 @@ Sound processor - 6502 #include "machine/6850acia.h" #include "emupal.h" #include "speaker.h" +#include "tilemap.h" namespace { @@ -133,10 +133,8 @@ class deco_ld_state : public driver_device , m_palette(*this, "palette") , m_soundlatch(*this, "soundlatch") , m_soundlatch2(*this, "soundlatch2") - , m_vram0(*this, "vram0") - , m_attr0(*this, "attr0") - , m_vram1(*this, "vram1") - , m_attr1(*this, "attr1") + , m_vram(*this, "vram%u", 0U) + , m_attr(*this, "attr%u", 0U) { } void rblaster(machine_config &config); @@ -146,6 +144,7 @@ class deco_ld_state : public driver_device protected: virtual void machine_start() override; + virtual void video_start() override; private: required_device m_maincpu; @@ -157,37 +156,73 @@ class deco_ld_state : public driver_device required_device m_palette; required_device m_soundlatch; required_device m_soundlatch2; - required_shared_ptr m_vram0; - required_shared_ptr m_attr0; - required_shared_ptr m_vram1; - required_shared_ptr m_attr1; + required_shared_ptr_array m_vram; + required_shared_ptr_array m_attr; int m_nmimask = 0; + tilemap_t *m_tilemap[2]; + + void main_map(address_map &map); + void sound_map(address_map &map); uint8_t acia_status_hack_r(); uint8_t sound_status_r(); - void decold_sound_cmd_w(uint8_t data); - uint32_t screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); [[maybe_unused]] void nmimask_w(uint8_t data); - INTERRUPT_GEN_MEMBER(sound_interrupt); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ); - void rblaster_map(address_map &map); - void rblaster_sound_map(address_map &map); + + template void vram_w(offs_t offset, u8 data); + template void attr_w(offs_t offset, u8 data); + template TILE_GET_INFO_MEMBER(get_tile_info); + + INTERRUPT_GEN_MEMBER(sound_interrupt); }; +template void deco_ld_state::vram_w(offs_t offset, u8 data) +{ + m_vram[N][offset] = data; + m_tilemap[N]->mark_tile_dirty(offset); +} + +template void deco_ld_state::attr_w(offs_t offset, u8 data) +{ + m_attr[N][offset] = data; + m_tilemap[N]->mark_tile_dirty(offset); +} + +template TILE_GET_INFO_MEMBER(deco_ld_state::get_tile_info) +{ + u8 attr = m_attr[N][tile_index]; + u16 tile = m_vram[N][tile_index] | (attr & 3) << 8; + tileinfo.set(0, tile, 5, 0); +} + + +void deco_ld_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_ld_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_ld_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap[0]->set_transparent_pen(0); + m_tilemap[1]->set_transparent_pen(0); + + // flush palette to all black: ends up using a very similar pattern than the MAME default one ... + for (int i = 0; i < 0x800; i++) + m_palette->set_pen_color(i, 0, 0, 0); +} + +/* +[+0] ---- -x-- flip X +[+0] ---- --x- flip Y +[+0] ---- ---x enable this sprite +[+1] tile number +[+2] y coord +[+3] x coord +*/ void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ) { gfx_element *gfx = m_gfxdecode->gfx(1); - /* - [+0] ---- -x-- flip X - [+0] ---- --x- flip Y - [+0] ---- ---x enable this sprite - [+1] tile number - [+2] y coord - [+3] x coord - */ - for (int i = 0; i < 0x20; i += 4) { if (~spriteram[i] & 1) @@ -196,7 +231,7 @@ void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect int spr_offs = spriteram[i + 1] | tile_bank; int x = spriteram[i + 3]; int y = spriteram[i + 2]; - int col = 6; /* TODO */ + int col = 6; int fx = (spriteram[i] & 0x04) ? 1 : 0; int fy = (spriteram[i] & 0x02) ? 1 : 0; @@ -211,7 +246,7 @@ void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect int spr_offs = spriteram[i + 1] | tile_bank; int x = spriteram[i + 3]; int y = spriteram[i + 2]; - int col = 6; /* TODO */ + int col = 6; int fx = (spriteram[i] & 0x04) ? 1 : 0; int fy = (spriteram[i] & 0x02) ? 1 : 0; @@ -219,49 +254,20 @@ void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect } } -uint32_t deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t deco_ld_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - gfx_element *gfx = m_gfxdecode->gfx(0); - bitmap.fill(0, cliprect); - draw_sprites(bitmap, cliprect, m_vram1, 0x000); - draw_sprites(bitmap, cliprect, m_vram0, 0x100); + draw_sprites(bitmap, cliprect, m_vram[1], 0x000); + draw_sprites(bitmap, cliprect, m_vram[0], 0x100); - for (int y = 0; y < 32; y++) - { - for (int x = 0; x < 32; x++) - { - int attr = m_attr0[x + y * 32]; - int tile = m_vram0[x + y * 32] | ((attr & 3) << 8); - int colour = (6 & 0x7); /* TODO */ - - gfx->transpen(bitmap, cliprect, tile | 0x400, colour, 0, 0, x * 8, y * 8, 0); - } - } - - for (int y = 0; y < 32; y++) - { - for (int x = 0; x < 32; x++) - { - int attr = m_attr1[x + y * 32]; - int tile = m_vram1[x + y * 32] | ((attr & 3) << 8); - int colour = (6 & 0x7); /* TODO */ - - gfx->transpen(bitmap, cliprect, tile, colour, 0, 0, x * 8, y * 8, 0); - } - } + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); return 0; } -void deco_ld_state::decold_sound_cmd_w(uint8_t data) -{ - m_soundlatch->write(data); - m_audiocpu->set_input_line(0, HOLD_LINE); -} - /* unknown, but certainly related to audiocpu somehow */ uint8_t deco_ld_state::sound_status_r() { @@ -274,25 +280,23 @@ uint8_t deco_ld_state::acia_status_hack_r() return 0xff; } -void deco_ld_state::rblaster_map(address_map &map) +void deco_ld_state::main_map(address_map &map) { map(0x0000, 0x0fff).ram(); map(0x1000, 0x1000).portr("IN0").nopw(); // (w) coin lockout map(0x1001, 0x1001).portr("DSW1"); map(0x1002, 0x1002).portr("DSW2"); map(0x1003, 0x1003).portr("IN1"); - map(0x1004, 0x1004).r(m_soundlatch2, FUNC(generic_latch_8_device::read)).w(FUNC(deco_ld_state::decold_sound_cmd_w)); + map(0x1004, 0x1004).r(m_soundlatch2, FUNC(generic_latch_8_device::read)).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x1005, 0x1005).r(FUNC(deco_ld_state::sound_status_r)); //map(0x1006, 0x1007).rw("acia", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); map(0x1006, 0x1006).r(FUNC(deco_ld_state::acia_status_hack_r)); map(0x1007, 0x1007).rw(m_laserdisc, FUNC(sony_ldp1000_device::status_r), FUNC(sony_ldp1000_device::command_w)); map(0x1800, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); - map(0x2000, 0x27ff).ram(); - map(0x2800, 0x2bff).ram().share("vram0"); - map(0x2c00, 0x2fff).ram().share("attr0"); - map(0x3000, 0x37ff).ram(); - map(0x3800, 0x3bff).ram().share("vram1"); - map(0x3c00, 0x3fff).ram().share("attr1"); + map(0x2000, 0x23ff).mirror(0x800).ram().w(FUNC(deco_ld_state::vram_w<0>)).share(m_vram[0]); + map(0x2400, 0x27ff).mirror(0x800).ram().w(FUNC(deco_ld_state::attr_w<0>)).share(m_attr[0]); + map(0x3000, 0x33ff).mirror(0x800).ram().w(FUNC(deco_ld_state::vram_w<1>)).share(m_vram[1]); + map(0x3400, 0x37ff).mirror(0x800).ram().w(FUNC(deco_ld_state::attr_w<1>)).share(m_attr[1]); map(0x4000, 0xffff).rom(); } @@ -310,7 +314,7 @@ INTERRUPT_GEN_MEMBER(deco_ld_state::sound_interrupt) } -void deco_ld_state::rblaster_sound_map(address_map &map) +void deco_ld_state::sound_map(address_map &map) { map(0x0000, 0x01ff).ram(); map(0x2000, 0x2000).w("ay1", FUNC(ay8910_device::data_w)); @@ -367,16 +371,17 @@ static INPUT_PORTS_START( begas ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(deco_ld_state, begas_vblank_r) // TODO: IPT_VBLANK doesn't seem to work fine? PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "DSWA" ) + // should be coinage + PORT_DIPNAME( 0x01, 0x01, "DSW1" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) @@ -385,28 +390,28 @@ static INPUT_PORTS_START( begas ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, deco_ld_state,coin_inserted, 0) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "DSWA" ) + PORT_DIPNAME( 0x01, 0x01, "DSW2" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -418,7 +423,7 @@ static INPUT_PORTS_START( cobra ) PORT_MODIFY("IN1") PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") - /* TODO: dips */ + // TODO: different dips INPUT_PORTS_END static INPUT_PORTS_START( rblaster ) @@ -427,7 +432,7 @@ static INPUT_PORTS_START( rblaster ) PORT_MODIFY("IN1") PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") - /* TODO: dips */ + // TODO: different dips INPUT_PORTS_END static const gfx_layout charlayout = @@ -467,17 +472,17 @@ void deco_ld_state::rblaster(machine_config &config) { /* basic machine hardware */ M6502(config, m_maincpu, 8000000/2); - m_maincpu->set_addrmap(AS_PROGRAM, &deco_ld_state::rblaster_map); + m_maincpu->set_addrmap(AS_PROGRAM, &deco_ld_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(deco_ld_state::irq0_line_hold)); M6502(config, m_audiocpu, 8000000/2); - m_audiocpu->set_addrmap(AS_PROGRAM, &deco_ld_state::rblaster_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &deco_ld_state::sound_map); m_audiocpu->set_periodic_int(FUNC(deco_ld_state::sound_interrupt), attotime::from_hz(640)); // config.set_maximum_quantum(attotime::from_hz(6000)); SONY_LDP1000(config, m_laserdisc, 0); - m_laserdisc->set_overlay(256, 256, FUNC(deco_ld_state::screen_update_rblaster)); + m_laserdisc->set_overlay(256, 256, FUNC(deco_ld_state::screen_update)); //m_laserdisc->set_overlay_clip(0, 256-1, 8, 240-1); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); @@ -492,11 +497,13 @@ void deco_ld_state::rblaster(machine_config &config) //m_acia->rxd_handler().set("laserdisc", FUNC(sony_ldp1000_device::read)); /* sound hardware */ - /* TODO: mixing */ + // TODO: mixing with laserdisc SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); + GENERIC_LATCH_8(config, m_soundlatch2); AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.25); @@ -652,9 +659,9 @@ ROM_START( cobraa ) // ROM_LOAD( "lp4-2-pal10l8.d6.jed", 0x0000, 0x00249, CRC(309b3ce5) SHA1(04f185911d33730004c7cd44a693dd1b69b82032) ) ROM_LOAD( "lp4-2-pal10l8.d6.bin", 0x0000, 0x0002c, CRC(e594fd13) SHA1(4bb8a9b7cf8f8eaa3c9f290b6e5085a10c927e20) ) - ROM_REGION( 0x20, "proms", 0 ) + ROM_REGION( 0x40, "proms", 0 ) ROM_LOAD( "vd0-c.h15", 0x0000, 0x00020, CRC(02c27aa0) SHA1(e7b814aabbfbcd992f78254b29b6ab6fa8115429) ) - ROM_LOAD( "vd0-t.f6", 0x0000, 0x00020, CRC(78449942) SHA1(584e25f7bffccd943c4db1edf05552f7989e08a4) ) + ROM_LOAD( "vd0-t.f6", 0x0020, 0x00020, CRC(78449942) SHA1(584e25f7bffccd943c4db1edf05552f7989e08a4) ) ROM_END } // anonymous namespace diff --git a/src/mame/dataeast/dietgo.cpp b/src/mame/dataeast/dietgo.cpp index f5053c8cd4162..d16e46b985414 100644 --- a/src/mame/dataeast/dietgo.cpp +++ b/src/mame/dataeast/dietgo.cpp @@ -19,6 +19,10 @@ PAL16L8B 7H PAL16L8B 6H PAL16R6A 11H +European versions were seen with either the MAY-01 and MAY-02, +or MAY-04 and MAY-05 sprite ROMs. The latter is more common on newer versions, +these contain data for alternative title screen graphics enabled with a DIP switch. + */ #include "emu.h" @@ -92,7 +96,7 @@ uint32_t dietgo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen->pf_update(m_pf_rowscroll[0], m_pf_rowscroll[1]); - bitmap.fill(256, cliprect); /* not verified */ + bitmap.fill(256, cliprect); // not verified m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); @@ -130,7 +134,7 @@ void dietgo_state::main_map(address_map &map) map(0x280000, 0x2807ff).ram().share(m_spriteram); map(0x300000, 0x300bff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x340000, 0x343fff).rw(FUNC(dietgo_state::ioprot_r), FUNC(dietgo_state::ioprot_w)).share("prot16ram"); // Protection device - map(0x380000, 0x38ffff).ram(); // mainram + map(0x380000, 0x38ffff).ram(); } void dietgo_state::decrypted_opcodes_map(address_map &map) @@ -220,7 +224,7 @@ static INPUT_PORTS_START( dietgo ) 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 ) ) // Demo_Sounds ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) // Demo_Sounds PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) // Players don't move in attract mode if on!? PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) @@ -228,6 +232,15 @@ static INPUT_PORTS_START( dietgo ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END +static INPUT_PORTS_START( dietgon ) // New European version with optional alternative graphics + PORT_INCLUDE( dietgo ) + + PORT_MODIFY("DSW") + PORT_DIPNAME( 0x2000, 0x2000, "Alternative graphics" ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + static const gfx_layout tile_8x8_layout = { 8,8, @@ -267,12 +280,12 @@ DECO16IC_BANK_CB_MEMBER(dietgo_state::bank_callback) void dietgo_state::dietgo(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, XTAL(28'000'000) / 2); // DE102 (verified on PCB) + M68000(config, m_maincpu, 28_MHz_XTAL / 2); // DE102 (verified on PCB) m_maincpu->set_addrmap(AS_PROGRAM, &dietgo_state::main_map); m_maincpu->set_addrmap(AS_OPCODES, &dietgo_state::decrypted_opcodes_map); m_maincpu->set_vblank_int("screen", FUNC(dietgo_state::irq6_line_hold)); - H6280(config, m_audiocpu, XTAL(32'220'000) / 4 / 3); // Custom chip 45; XIN is 32.220MHZ/4, verified on PCB + H6280(config, m_audiocpu, 32.22_MHz_XTAL / 4 / 3); // Custom chip 45; XIN is 32.220MHZ/4, verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &dietgo_state::sound_map); m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused @@ -315,15 +328,38 @@ void dietgo_state::dietgo(machine_config &config) // sound hardware SPEAKER(config, "mono").front_center(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(32'220'000) / 9)); // verified on PCB + ym2151_device &ymsnd(YM2151(config, "ymsnd", 32.22_MHz_XTAL / 9)); // verified on PCB ymsnd.irq_handler().set_inputline(m_audiocpu, 1); // IRQ2 ymsnd.add_route(ALL_OUTPUTS, "mono", 0.45); - OKIM6295(config, "oki", XTAL(32'220'000) / 32, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // verified on PCB + OKIM6295(config, "oki", 32.22_MHz_XTAL / 32, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // verified on PCB } +ROM_START( dietgo ) // same version 1.1 and same program ROMs as dietgoe but newer sprite ROMs + ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) + ROM_LOAD16_BYTE( "jy_00-3.4h", 0x000001, 0x040000, CRC(a863ad0c) SHA1(61bf2fe5dce92e3995791a7e9ef813d64bcc2b93) ) + ROM_LOAD16_BYTE( "jy_01-3.5h", 0x000000, 0x040000, CRC(ef243eda) SHA1(b8efbb80c5bf40ef6c26a06fc7232d6e63596cb4) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "jy_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) + + ROM_REGION( 0x100000, "tiles", 0 ) + ROM_LOAD( "may-00.10a", 0x00000, 0x100000, CRC(234d1f8d) SHA1(42d23aad20df20cbd2359cc12bdd47636b2027d3) ) + + ROM_REGION( 0x200000, "sprites", 0 ) + ROM_LOAD( "may-04_w78_9235kd011.14a", 0x000000, 0x100000, CRC(dedd2dd3) SHA1(c1021edb0b377a030ab9593c838083f0f3b996b2) ) + ROM_LOAD( "may-05_w79_9235kd019.16a", 0x100000, 0x100000, CRC(cb23835f) SHA1(c504ff99f9029355f69e7fd7e9528d647bd491bf) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "may-03.11l", 0x00000, 0x80000, CRC(b6e42bae) SHA1(c282cdf7db30fb63340cc609bf00f5ab63a75583) ) + + ROM_REGION( 0x0600, "plds", 0 ) + ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected +ROM_END -ROM_START( dietgo ) // same version 1.1 and same date as dietgoe but newer version in rom labels +ROM_START( dietgoe ) // same version 1.1 and same date as dietgoea but newer version in ROM labels ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jy_00-3.4h", 0x000001, 0x040000, CRC(a863ad0c) SHA1(61bf2fe5dce92e3995791a7e9ef813d64bcc2b93) ) ROM_LOAD16_BYTE( "jy_01-3.5h", 0x000000, 0x040000, CRC(ef243eda) SHA1(b8efbb80c5bf40ef6c26a06fc7232d6e63596cb4) ) @@ -347,7 +383,7 @@ ROM_START( dietgo ) // same version 1.1 and same date as dietgoe but newer versi ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END -ROM_START( dietgoe ) // weird, still version 1.1 and same date +ROM_START( dietgoea ) // weird, still version 1.1 and same date ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jy_00-2.4h", 0x000001, 0x040000, CRC(014dcf62) SHA1(1a28ce4a643ec8b6f062b1200342ed4dc6db38a1) ) ROM_LOAD16_BYTE( "jy_01-2.5h", 0x000000, 0x040000, CRC(793ebd83) SHA1(b9178f18ce6e9fca848cbbf9dce3f3856672bf94) ) @@ -371,7 +407,7 @@ ROM_START( dietgoe ) // weird, still version 1.1 and same date ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END -ROM_START( dietgoea ) // weird, still version 1.1 but different (earlier) date +ROM_START( dietgoeb ) // weird, still version 1.1 but different (earlier) date ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jy_00-1.4h", 0x000001, 0x040000, CRC(8bce137d) SHA1(55f5b1c89330803c6147f9656f2cabe8d1de8478) ) ROM_LOAD16_BYTE( "jy_01-1.5h", 0x000000, 0x040000, CRC(eca50450) SHA1(1a24117e3b1b66d7dbc5484c94cc2c627d34e6a3) ) @@ -453,8 +489,9 @@ void dietgo_state::init_dietgo() } // Anonymous namespace -GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.09.26 v3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.09.26 v2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dietgoea, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.08.04)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgo, 0, dietgo, dietgon, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.09.26, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.09.26, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgoea, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.09.26, set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgoeb, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Europe v1.1 1992.08.04)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/ffantasy_ms.cpp b/src/mame/dataeast/ffantasy_ms.cpp index 7498c0eaccc6e..6c8dd5cbd4ea5 100644 --- a/src/mame/dataeast/ffantasy_ms.cpp +++ b/src/mame/dataeast/ffantasy_ms.cpp @@ -5,10 +5,12 @@ Fighting Fantasy (Modular System) Dragon Ninja (Modular System) Secret Agent (Modular System) + Automat (Modular System) [bootleg of Robocop] As with most of the 'Modular System' setups, the hardware is heavily modified from the original and consists of a multi-board stack in a cage, hence different driver. + For Fighting Fantasy the Modular System cage contains 8 main boards and 1 sub board. MOD-6/1 - TSC68000CP12, 4 ROMs, RAMs, 20 MHz XTAL. @@ -22,6 +24,7 @@ PCBs pictures and dip listing are available at: http://www.recreativas.org/modular-system-fighting-fantasy-5694-gaelco-sa + For Dragon Ninja the Modular System cage contains 7 main boards and 1 sub board. MOD-6/1 - MC68000P10, 2 ROMs, RAMs, 20 MHz XTAL. @@ -34,6 +37,7 @@ PCBs pictures and dip listing are available at: https://www.recreativas.org/modular-system-dragon-ninja-4319-gaelco-sa + For Secret Agent the Modular System cage contains 8 main boards and 1 sub board. MOD-6/1 - MC68000P10, 4 ROMs, RAMs, 22.1184 MHz XTAL. @@ -46,6 +50,18 @@ MOD 4/2 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0464) with no chips, just routing along one edge. PCBs pictures and dip listing are available at: https://www.recreativas.org/modular-system-secret-agent-11088-gaelco-sa + + + For Automat the Modular System cage contains 6 main boards and 1 sub board. + + MOD 1/5 - Sound board (Z80B, 2 x YM2203C). Two 8 dip switches banks + small sub board with OKI M5205. + MOD 6/1 - TSC68000CP12, 4 ROMs, RAMs, 20 MHz XTAL. + MOD 2 - Logic + 20 MHz XTAL. + MOD 7/8 - Logic + RAM (2 x + Sony CXK58256PM-10) + PLDs. + MOD 8 - ROM (eight EPROMs) + MOD 51/3 - Sprite board, has logic + 4 EPROMs. + + PCBs pictures and dip listing are available at: https://www.recreativas.org/modular-system-automat-robocop-14508-gaelco-sa */ @@ -170,6 +186,96 @@ void ffantasy_ms_state::secretagm(machine_config &config) m_maincpu->set_clock(22.1184_MHz_XTAL); } +ROM_START( automatm ) + ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board + ROM_LOAD16_BYTE( "mod_6-1_automat_2au_603.ic17", 0x00000, 0x10000, CRC(efce0f8e) SHA1(c27a2db6c5cf92b9682be12d00d4c8b2998a88ee) ) + ROM_LOAD16_BYTE( "mod_6-1_automat_2au_606.ic26", 0x00001, 0x10000, CRC(f19fc5b6) SHA1(3d27ed69a4ab4d799c4afa779ac5d5083cd73cc2) ) + ROM_LOAD16_BYTE( "mod_6-1_automat_2au_602.ic20", 0x20000, 0x10000, CRC(9d7b79e0) SHA1(e0d901b9b3cd62f7c947da04f7447ebfa88bf44a) ) + ROM_LOAD16_BYTE( "mod_6-1_automat_2au_605.ic11", 0x20001, 0x10000, CRC(e655f9c3) SHA1(d5e99d542303d009277ccfc245f877e4e28603c9) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/5 board + ROM_LOAD( "mod_1-5_automat_2au_101.ic12", 0x00000, 0x10000, CRC(fc80cac1) SHA1(0f31d6c3f2ca1aa1c6d9ac5da28b75a6fbf8444b) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) // on MOD 8 board + ROM_LOAD( "mod_8_automat_2au_301.ic15", 0x00000, 0x10000, CRC(fd3b363b) SHA1(af63d57e362f159c5b54a764e2069ca24849164b) ) + ROM_LOAD( "mod_8_automat_2au_302.ic22", 0x10000, 0x10000, CRC(05755c02) SHA1(e1fa7d464eb7bbf2f22ca132e7df8e92911a0685) ) + ROM_LOAD( "mod_8_automat_2au_303.ic30", 0x20000, 0x10000, CRC(9440bb38) SHA1(aee9372bfc3b2b036a208d91a706312b77042001) ) + ROM_LOAD( "mod_8_automat_2au_304.ic37", 0x30000, 0x10000, CRC(a1c9d781) SHA1(8e062af8a9c2eef74c8e578624f3c961750ac260) ) + ROM_LOAD( "mod_8_automat_2au_305.ic14", 0x40000, 0x10000, CRC(53cb118e) SHA1(cf2329cb8f41c6ddc81dea8fa8def0e47e25b723) ) + ROM_LOAD( "mod_8_automat_2au_306.ic21", 0x50000, 0x10000, CRC(21b682f7) SHA1(1e9bdae1317f215ffdffdd2c1a3c0e08c14ab00c) ) + ROM_LOAD( "mod_8_automat_2au_307.ic29", 0x60000, 0x10000, CRC(be822d87) SHA1(d5f9bb55a16f0ab2d6d11fea5d22b7ced59f9128) ) + ROM_LOAD( "mod_8_automat_2au_308.ic36", 0x70000, 0x10000, CRC(9459159a) SHA1(20fc3f33f2e23d88b2bd21f248ed7814f03b387f) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) // on MOD 51/1 board + ROM_LOAD( "mod_51-3_automat_2au_501.ic43", 0x00000, 0x20000, CRC(8e7ec3fc) SHA1(0c40cf90bb105dca2629a61ff13227b82d3b10de) ) + ROM_LOAD( "mod_51-3_automat_2au_502.ic42", 0x20000, 0x20000, CRC(d0a46eae) SHA1(3efe3b1462b442b4a16704d15e201a4d7bd402c8) ) + ROM_LOAD( "mod_51-3_automat_2au_503.ic41", 0x40000, 0x20000, CRC(e174cdaf) SHA1(e66c8adc6df08e30365bd0e360e78397b495582c) ) + ROM_LOAD( "mod_51-3_automat_2au_504.ic40", 0x60000, 0x20000, CRC(e8662060) SHA1(f59f55fe5bf79be0c66f4984a0ecab17504438c7) ) + + ROM_REGION( 0x120, "proms", 0 ) // PROMs (function unknown) + ROM_LOAD( "mod_1-5_automat_110_82s123.ic20", 0x000, 0x020, NO_DUMP ) + ROM_LOAD( "mod_51-3_a502_63s141.ic10", 0x020, 0x100, NO_DUMP ) + + ROM_REGION( 0x200, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "mod_6-1_automat_604_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod_6-1_automat_633_gal16v8.ic7", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod_7-8_7133_gal20v8.ic7", 0x000, 0x157, NO_DUMP ) + ROM_LOAD( "mod_7-8_7233_gal20v8.ic54", 0x000, 0x157, NO_DUMP ) + ROM_LOAD( "mod_7-8_7333_gal16v8.ic55", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod_7-8_7433_gal16v8.ic9", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod_7-8_7533_gal16v8.ic59", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod_7-8_7633_gal20v9.ic44", 0x000, 0x157, NO_DUMP ) +ROM_END + +ROM_START( drgninjam ) + ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, extremely similar to drgninjab in dec0.cpp. TODO: ROM loading may be wrong (check 0x20000 - 0x3ffff being empty in drgninjab) + ROM_LOAD16_BYTE( "6-1_cpu_dn_603.ic17", 0x00000, 0x20000, CRC(1c3670df) SHA1(0e287a0b4494e702080e80a911c4762bbc6a5815) ) + ROM_LOAD16_BYTE( "6-1_cpu_dn_606.ic8", 0x00001, 0x20000, CRC(07669458) SHA1(c5dcf72eba5e345228ee3f9e0228cba526e1156a) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/2 board + ROM_LOAD( "1-4_snd_dn_101.ic12", 0x00000, 0x10000, CRC(0b82c205) SHA1(0be243b19693c54914eccefbf6a8b8b513eec299) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) // on one of the MOD 4/3 boards + ROM_LOAD( "4-3_dn_401.ic17", 0x0000, 0x4000, CRC(45ab2822) SHA1(0cf0f74ad5325a66f74fc20cabd6a9d3d8c42f2a) ) + ROM_LOAD( "4-3_dn_402.ic16", 0x4000, 0x4000, CRC(26f0095b) SHA1(9e568a23df2b0ca05d8b87fea445f5f98e55fac5) ) + ROM_LOAD( "4-3_dn_403.ic15", 0x8000, 0x4000, CRC(c2061c37) SHA1(b06737ecece7da4785c2e98977f6dc35986a445e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + ROM_LOAD( "4-3_dn_404.ic14", 0xc000, 0x4000, CRC(1da44e82) SHA1(ccb9464b711025a5c2c18ecb765f7f0e15f7d4a5) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + + ROM_REGION( 0x80000, "gfx2", 0 ) // on a second MOD 4/3 board + ROM_LOAD( "4-3-a_dn_4a01.ic17", 0x00000, 0x8000, CRC(c89982ac) SHA1(7509322bf4dcaceefdbaf6e9f4087a576133fe39) ) + ROM_LOAD( "4-3-a_dn_4a02.ic16", 0x08000, 0x8000, CRC(144b0359) SHA1(46565c5694f0cfcf06c1ee7c131ab3c88c804d35) ) + ROM_LOAD( "4-3-a_dn_4a03.ic15", 0x10000, 0x8000, CRC(ae98a684) SHA1(d6fe7237b82125a21b9804500ba2166906475a0e) ) + ROM_LOAD( "4-3-a_dn_4a04.ic14", 0x18000, 0x8000, CRC(8292c4ad) SHA1(f83acf64b101022927b678749d754374a20f5444) ) + + ROM_REGION( 0x80000, "gfx3", 0 ) // on a MOD 4/2 board + ROM_LOAD( "4-2-b_dn_4b01.ic17", 0x00000, 0x10000, CRC(65002e5c) SHA1(e1fa0a0395d3fbcf31e15b63b7eaf478063aa971) ) + ROM_LOAD( "4-2-b_dn_4b02.ic16", 0x10000, 0x10000, CRC(dd6acd2d) SHA1(e2a0ccf49dce421b10ad0ed54d02ba1ca6525404) ) + ROM_LOAD( "4-2-b_dn_4b03.ic15", 0x20000, 0x10000, CRC(63e337c1) SHA1(ca347d6a46ee643edfdc8614760dc9b0994e1745) ) + ROM_LOAD( "4-2-b_dn_4b04.ic14", 0x30000, 0x10000, CRC(5cc7ec8c) SHA1(3f17e13af7152c51ce025ca06ece70b4a6f65f94) ) + + ROM_REGION( 0x100000, "gfx4", 0 ) // on MOD 51/1 board + ROM_LOAD( "51-3_dn_501.ic43", 0x00000, 0x20000, CRC(0fccce1f) SHA1(e2e5625b62ddd73a4363596a4b1b2d72c2fe1c38) ) + ROM_LOAD( "51-3_dn_502.ic42", 0x20000, 0x20000, CRC(361f4616) SHA1(40279c76d027bcf698b8ff694afc2afb15279381) ) + ROM_LOAD( "51-3_dn_503.ic41", 0x40000, 0x20000, CRC(b3c97ad1) SHA1(f77426e1ee347b8cae9c5aef1e31058344c019c2) ) + ROM_LOAD( "51-3_dn_504.ic40", 0x60000, 0x20000, CRC(1445dccb) SHA1(fddbb9d136ea6dbb2704ac93e5536ed0e6bfb19c) ) + + ROM_REGION( 0x0400, "proms", 0 ) // PROMs (function unknown) + ROM_LOAD( "1-4_snd_110_82s123.ic20", 0x000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) + ROM_LOAD( "21-1_p0201_tbp24s10n.ic4", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) + ROM_LOAD( "21-1_p0205_82s129n.ic12", 0x200, 0x100, CRC(204a7aee) SHA1(322164134aa65c37a9389024f921364a81d13e88) ) + ROM_LOAD( "51-3_502_82s129.ic10", 0x300, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) + + ROM_REGION( 0xc00, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "6-1_cpu_604_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "6-1_cpu_630_gal16v8.ic7", 0x200, 0x117, NO_DUMP ) + ROM_LOAD( "4-3_p0403_pal16r8a.ic29", 0x400, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "4-3-a_p0403.ic29", 0x600, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "4-2-b_403_gal16v8.ic29", 0x800, 0x104, NO_DUMP ) + ROM_LOAD( "51-3_503_gal16v8.ic46", 0xa00, 0x117, CRC(11470ea1) SHA1(cfcafbcc7e55be717348f895df61e144fdd0cc9b) ) +ROM_END + ROM_START( ffantasym ) ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, extremely similar to ffantasybl in dec0.cpp ROM_LOAD16_BYTE( "ff_6-1_5fa_603.ic17", 0x00000, 0x10000, CRC(124ebff8) SHA1(20423990903dc3d682e2df6fb4dec0ae6b49036d) ) @@ -225,55 +331,6 @@ ROM_START( ffantasym ) ROM_LOAD( "ff_5-1_5235_gal16v8.ic8", 0x000, 0x117, NO_DUMP ) ROM_END -ROM_START( drgninjam ) - ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, extremely similar to drgninjab in dec0.cpp. TODO: ROM loading may be wrong (check 0x20000 - 0x3ffff being empty in drgninjab) - ROM_LOAD16_BYTE( "6-1_cpu_dn_603.ic17", 0x00000, 0x20000, CRC(1c3670df) SHA1(0e287a0b4494e702080e80a911c4762bbc6a5815) ) - ROM_LOAD16_BYTE( "6-1_cpu_dn_606.ic8", 0x00001, 0x20000, CRC(07669458) SHA1(c5dcf72eba5e345228ee3f9e0228cba526e1156a) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/2 board - ROM_LOAD( "1-4_snd_dn_101.ic12", 0x00000, 0x10000, CRC(0b82c205) SHA1(0be243b19693c54914eccefbf6a8b8b513eec299) ) - - ROM_REGION( 0x80000, "gfx1", 0 ) // on one of the MOD 4/3 boards - ROM_LOAD( "4-3_dn_401.ic17", 0x0000, 0x4000, CRC(45ab2822) SHA1(0cf0f74ad5325a66f74fc20cabd6a9d3d8c42f2a) ) - ROM_LOAD( "4-3_dn_402.ic16", 0x4000, 0x4000, CRC(26f0095b) SHA1(9e568a23df2b0ca05d8b87fea445f5f98e55fac5) ) - ROM_LOAD( "4-3_dn_403.ic15", 0x8000, 0x4000, CRC(c2061c37) SHA1(b06737ecece7da4785c2e98977f6dc35986a445e) ) // 1ST AND 2ND HALF IDENTICAL - ROM_IGNORE( 0x4000 ) - ROM_LOAD( "4-3_dn_404.ic14", 0xc000, 0x4000, CRC(1da44e82) SHA1(ccb9464b711025a5c2c18ecb765f7f0e15f7d4a5) ) // 1ST AND 2ND HALF IDENTICAL - ROM_IGNORE( 0x4000 ) - - ROM_REGION( 0x80000, "gfx2", 0 ) // on a second MOD 4/3 board - ROM_LOAD( "4-3-a_dn_4a01.ic17", 0x00000, 0x8000, CRC(c89982ac) SHA1(7509322bf4dcaceefdbaf6e9f4087a576133fe39) ) - ROM_LOAD( "4-3-a_dn_4a02.ic16", 0x08000, 0x8000, CRC(144b0359) SHA1(46565c5694f0cfcf06c1ee7c131ab3c88c804d35) ) - ROM_LOAD( "4-3-a_dn_4a03.ic15", 0x10000, 0x8000, CRC(ae98a684) SHA1(d6fe7237b82125a21b9804500ba2166906475a0e) ) - ROM_LOAD( "4-3-a_dn_4a04.ic14", 0x18000, 0x8000, CRC(8292c4ad) SHA1(f83acf64b101022927b678749d754374a20f5444) ) - - ROM_REGION( 0x80000, "gfx3", 0 ) // on a MOD 4/2 board - ROM_LOAD( "4-2-b_dn_4b01.ic17", 0x00000, 0x10000, CRC(65002e5c) SHA1(e1fa0a0395d3fbcf31e15b63b7eaf478063aa971) ) - ROM_LOAD( "4-2-b_dn_4b02.ic16", 0x10000, 0x10000, CRC(dd6acd2d) SHA1(e2a0ccf49dce421b10ad0ed54d02ba1ca6525404) ) - ROM_LOAD( "4-2-b_dn_4b03.ic15", 0x20000, 0x10000, CRC(63e337c1) SHA1(ca347d6a46ee643edfdc8614760dc9b0994e1745) ) - ROM_LOAD( "4-2-b_dn_4b04.ic14", 0x30000, 0x10000, CRC(5cc7ec8c) SHA1(3f17e13af7152c51ce025ca06ece70b4a6f65f94) ) - - ROM_REGION( 0x100000, "gfx4", 0 ) // on MOD 51/1 board - ROM_LOAD( "51-3_dn_501.ic43", 0x00000, 0x20000, CRC(0fccce1f) SHA1(e2e5625b62ddd73a4363596a4b1b2d72c2fe1c38) ) - ROM_LOAD( "51-3_dn_502.ic42", 0x20000, 0x20000, CRC(361f4616) SHA1(40279c76d027bcf698b8ff694afc2afb15279381) ) - ROM_LOAD( "51-3_dn_503.ic41", 0x40000, 0x20000, CRC(b3c97ad1) SHA1(f77426e1ee347b8cae9c5aef1e31058344c019c2) ) - ROM_LOAD( "51-3_dn_504.ic40", 0x60000, 0x20000, CRC(1445dccb) SHA1(fddbb9d136ea6dbb2704ac93e5536ed0e6bfb19c) ) - - ROM_REGION( 0x0400, "proms", 0 ) // PROMs (function unknown) - ROM_LOAD( "1-4_snd_110_82s123.ic20", 0x000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) - ROM_LOAD( "21-1_p0201_tbp24s10n.ic4", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) - ROM_LOAD( "21-1_p0205_82s129n.ic12", 0x200, 0x100, CRC(204a7aee) SHA1(322164134aa65c37a9389024f921364a81d13e88) ) - ROM_LOAD( "51-3_502_82s129.ic10", 0x300, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) - - ROM_REGION( 0xc00, "plds", ROMREGION_ERASEFF ) - ROM_LOAD( "6-1_cpu_604_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) - ROM_LOAD( "6-1_cpu_630_gal16v8.ic7", 0x200, 0x117, NO_DUMP ) - ROM_LOAD( "4-3_p0403_pal16r8a.ic29", 0x400, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) - ROM_LOAD( "4-3-a_p0403.ic29", 0x600, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) - ROM_LOAD( "4-2-b_403_gal16v8.ic29", 0x800, 0x104, NO_DUMP ) - ROM_LOAD( "51-3_503_gal16v8.ic46", 0xa00, 0x117, CRC(11470ea1) SHA1(cfcafbcc7e55be717348f895df61e144fdd0cc9b) ) -ROM_END - ROM_START( secretagm ) ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board ROM_LOAD16_BYTE( "mod_6-1_ag_603.ic17", 0x00000, 0x10000, CRC(4a61489b) SHA1(41f3b99bbd60ebac567477b98dc7c0158f972d60) ) @@ -332,6 +389,7 @@ ROM_END } // anonymous namespace -GAME( 199?, drgninjam, baddudes, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Dragon Ninja (Modular System)", MACHINE_IS_SKELETON ) -GAME( 199?, ffantasym, hippodrm, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Fighting Fantasy (Modular System)", MACHINE_IS_SKELETON ) -GAME( 199?, secretagm, secretag, secretagm, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Secret Agent (Modular System)", MACHINE_IS_SKELETON ) +GAME( 199?, automatm, robocop, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Automat (bootleg of Robocop, Modular System)", MACHINE_IS_SKELETON ) +GAME( 199?, drgninjam, baddudes, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Dragon Ninja (Modular System)", MACHINE_IS_SKELETON ) +GAME( 199?, ffantasym, hippodrm, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Fighting Fantasy (Modular System)", MACHINE_IS_SKELETON ) +GAME( 199?, secretagm, secretag, secretagm, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Secret Agent (Modular System)", MACHINE_IS_SKELETON ) diff --git a/src/mame/dataeast/kchamp.cpp b/src/mame/dataeast/kchamp.cpp index ea7514edd657c..f1af8bc53f150 100644 --- a/src/mame/dataeast/kchamp.cpp +++ b/src/mame/dataeast/kchamp.cpp @@ -149,6 +149,7 @@ void kchamp_state::kchampvs_sound_io_map(address_map &map) /******************** * 1 Player Version * ********************/ + uint8_t kchamp_state::sound_reset_r() { if (!machine().side_effects_disabled()) @@ -160,12 +161,12 @@ void kchamp_state::kc_sound_control_w(offs_t offset, uint8_t data) { if (offset == 0) { - m_sound_nmi_enable = ((data >> 7) & 1); + m_sound_nmi_enable = BIT(data, 7); if (!m_sound_nmi_enable) m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } else - m_dac->set_output_gain(0, BIT(data,0) ? 1.0 : 0); + m_dac->set_output_gain(0, BIT(data, 0) ? 1.0 : 0); } void kchamp_state::kchamp_map(address_map &map) diff --git a/src/mame/dataeast/kchamp.h b/src/mame/dataeast/kchamp.h index 70969b3a5440d..4d0d17b1d728d 100644 --- a/src/mame/dataeast/kchamp.h +++ b/src/mame/dataeast/kchamp.h @@ -88,8 +88,7 @@ class kchamp_state : public driver_device uint32_t screen_update_kchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void vblank_irq(int state); INTERRUPT_GEN_MEMBER(sound_int); - void kchamp_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void kchampvs_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int dx, int dy); void decrypt_code(); void msmint(int state); void decrypted_opcodes_map(address_map &map); diff --git a/src/mame/dataeast/kchamp_v.cpp b/src/mame/dataeast/kchamp_v.cpp index 38ef03fc38ca3..030da4d9403b7 100644 --- a/src/mame/dataeast/kchamp_v.cpp +++ b/src/mame/dataeast/kchamp_v.cpp @@ -60,49 +60,18 @@ void kchamp_state::video_start() 3 XXXXXXXX */ -void kchamp_state::kchamp_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +void kchamp_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int dx, int dy) { - uint8_t *spriteram = m_spriteram; - int offs; - - for (offs = 0; offs < 0x100; offs += 4) - { - int attr = spriteram[offs + 2]; - int bank = 1 + ((attr & 0x60) >> 5); - int code = spriteram[offs + 1] + ((attr & 0x10) << 4); - int color = attr & 0x0f; - int flipx = 0; - int flipy = attr & 0x80; - int sx = spriteram[offs + 3] - 8; - int sy = 247 - spriteram[offs]; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(bank)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 0); - } -} - -void kchamp_state::kchampvs_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram = m_spriteram; - int offs; - - for (offs = 0; offs < 0x100; offs += 4) + for (int offs = 0; offs < 0x100; offs += 4) { - int attr = spriteram[offs + 2]; + int attr = m_spriteram[offs + 2]; int bank = 1 + ((attr & 0x60) >> 5); - int code = spriteram[offs + 1] + ((attr & 0x10) << 4); + int code = m_spriteram[offs + 1] + ((attr & 0x10) << 4); int color = attr & 0x0f; int flipx = 0; int flipy = attr & 0x80; - int sx = spriteram[offs + 3]; - int sy = 240 - spriteram[offs]; + int sx = m_spriteram[offs + 3] + dx; + int sy = 240 - m_spriteram[offs] + dy; if (flip_screen()) { @@ -120,13 +89,13 @@ void kchamp_state::kchampvs_draw_sprites( bitmap_ind16 &bitmap, const rectangle uint32_t kchamp_state::screen_update_kchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - kchamp_draw_sprites(bitmap, cliprect); + draw_sprites(bitmap, cliprect, -8, 7); return 0; } uint32_t kchamp_state::screen_update_kchampvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - kchampvs_draw_sprites(bitmap, cliprect); + draw_sprites(bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/dataeast/mirage.cpp b/src/mame/dataeast/mirage.cpp index 5d70fe45a0f57..1858db92d1d20 100644 --- a/src/mame/dataeast/mirage.cpp +++ b/src/mame/dataeast/mirage.cpp @@ -80,15 +80,15 @@ class miragemj_state : public driver_device virtual void machine_reset() override; private: - void mjmux_w(uint16_t data); - uint16_t mjmux_r(); + void key_matrix_w(uint16_t data); + uint16_t key_matrix_r(); void okim1_rombank_w(uint16_t data); void okim0_rombank_w(uint16_t data); DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - uint32_t screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); - void mirage_map(address_map &map); + void main_map(address_map &map); /* devices */ required_device m_maincpu; @@ -105,11 +105,11 @@ class miragemj_state : public driver_device required_ioport_array<5> m_io_key; /* misc */ - uint8_t m_mux_data = 0; + uint8_t m_key_matrix_select = 0; }; -uint32_t miragemj_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t miragemj_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { uint16_t const flip = m_deco_tilegen->pf_control_r(0); @@ -128,17 +128,17 @@ uint32_t miragemj_state::screen_update_mirage(screen_device &screen, bitmap_rgb3 } -void miragemj_state::mjmux_w(uint16_t data) +void miragemj_state::key_matrix_w(uint16_t data) { - m_mux_data = data & 0x1f; + m_key_matrix_select = data & 0x1f; } -uint16_t miragemj_state::mjmux_r() +uint16_t miragemj_state::key_matrix_r() { uint16_t result = 0xffff; for (int i = 0; m_io_key.size() > i; ++i) { - if (BIT(m_mux_data, i)) + if (BIT(m_key_matrix_select, i)) result &= m_io_key[i]->read(); } return result; @@ -159,7 +159,7 @@ void miragemj_state::okim0_rombank_w(uint16_t data) m_oki_bgm->set_rom_bank(data & 0x7); } -void miragemj_state::mirage_map(address_map &map) +void miragemj_state::main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); /* tilemaps */ @@ -177,8 +177,8 @@ void miragemj_state::mirage_map(address_map &map) map(0x16a000, 0x16a001).nopw(); map(0x16c000, 0x16c001).w(FUNC(miragemj_state::okim1_rombank_w)); map(0x16c002, 0x16c003).w(FUNC(miragemj_state::okim0_rombank_w)); - map(0x16c004, 0x16c005).w(FUNC(miragemj_state::mjmux_w)); - map(0x16c006, 0x16c007).r(FUNC(miragemj_state::mjmux_r)); + map(0x16c004, 0x16c005).w(FUNC(miragemj_state::key_matrix_w)); + map(0x16c006, 0x16c007).r(FUNC(miragemj_state::key_matrix_r)); map(0x16e000, 0x16e001).nopw(); map(0x16e002, 0x16e003).portr("SYSTEM_IN"); map(0x170000, 0x173fff).ram(); @@ -281,19 +281,19 @@ DECO16IC_BANK_CB_MEMBER(miragemj_state::bank_callback) void miragemj_state::machine_start() { - save_item(NAME(m_mux_data)); + save_item(NAME(m_key_matrix_select)); } void miragemj_state::machine_reset() { - m_mux_data = 0; + m_key_matrix_select = 0; } void miragemj_state::mirage(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 28000000/2); - m_maincpu->set_addrmap(AS_PROGRAM, &miragemj_state::mirage_map); + m_maincpu->set_addrmap(AS_PROGRAM, &miragemj_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(miragemj_state::irq6_line_hold)); EEPROM_93C46_16BIT(config, "eeprom"); // 93C45 @@ -306,7 +306,7 @@ void miragemj_state::mirage(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, 1*8, 31*8-1); - screen.set_screen_update(FUNC(miragemj_state::screen_update_mirage)); + screen.set_screen_update(FUNC(miragemj_state::screen_update)); screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising)); GFXDECODE(config, "gfxdecode", "palette", gfx_mirage); diff --git a/src/mame/dataeast/tumbleb.cpp b/src/mame/dataeast/tumbleb.cpp index 33029a57e0756..45a0780e3e1e5 100644 --- a/src/mame/dataeast/tumbleb.cpp +++ b/src/mame/dataeast/tumbleb.cpp @@ -1112,7 +1112,7 @@ static INPUT_PORTS_START( metlsavr ) PORT_DIPSETTING( 0x0000, "80 Seconds" ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(tumbleb_state::suprtrio_prot_latch_r) +ioport_value tumbleb_state::suprtrio_prot_latch_r() { return m_suprtrio_prot_latch; } diff --git a/src/mame/dataeast/tumbleb.h b/src/mame/dataeast/tumbleb.h index 8dd2c4b3b5c30..daf6a91315e94 100644 --- a/src/mame/dataeast/tumbleb.h +++ b/src/mame/dataeast/tumbleb.h @@ -70,7 +70,7 @@ class tumbleb_state : public driver_device void init_magipur(); void init_carket(); - DECLARE_CUSTOM_INPUT_MEMBER(suprtrio_prot_latch_r); + ioport_value suprtrio_prot_latch_r(); protected: /* memory pointers */ diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index f4acc3d211359..38658c65fc3bb 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -213,9 +213,9 @@ class ddenlovr_state : public dynax_state void init_rongrong(); int blitter_irq_r(); - DECLARE_CUSTOM_INPUT_MEMBER(ddenlovj_blitter_r); - DECLARE_CUSTOM_INPUT_MEMBER(nettoqc_special_r); - DECLARE_CUSTOM_INPUT_MEMBER(mjflove_blitter_r); + ioport_value ddenlovj_blitter_r(); + ioport_value nettoqc_special_r(); + ioport_value mjflove_blitter_r(); protected: auto blitter_irq() { return m_blitter_irq_handler.bind(); } @@ -2094,7 +2094,7 @@ void ddenlovr_state::ddenlovj_coincounter_w(uint8_t data) // data & 0x80 ? } -CUSTOM_INPUT_MEMBER(ddenlovr_state::ddenlovj_blitter_r) +ioport_value ddenlovr_state::ddenlovj_blitter_r() { return m_ddenlovr_blitter_irq_flag ? 0x03 : 0x00; // bit 4 = 1 -> blitter busy } @@ -2226,7 +2226,7 @@ void ddenlovr_state::ddenlovr_map(address_map &map) } -CUSTOM_INPUT_MEMBER(ddenlovr_state::nettoqc_special_r) +ioport_value ddenlovr_state::nettoqc_special_r() { return m_ddenlovr_blitter_irq_flag ? 0x03 : 0x00; } @@ -3921,7 +3921,7 @@ uint8_t ddenlovr_state::mjflove_keyb_r(offs_t offset) return val; } -CUSTOM_INPUT_MEMBER(ddenlovr_state::mjflove_blitter_r) +ioport_value ddenlovr_state::mjflove_blitter_r() { // bit 7 = 1 -> blitter busy // bit 6 = 0 -> VBLANK? diff --git a/src/mame/dynax/royalmah.cpp b/src/mame/dynax/royalmah.cpp index da390a485c3f2..1f946c9d2ce63 100644 --- a/src/mame/dynax/royalmah.cpp +++ b/src/mame/dynax/royalmah.cpp @@ -4469,6 +4469,19 @@ ROM_START( ippatsu ) ROM_LOAD( "82s123an", 0x00, 0x20, CRC(3bde1bbd) SHA1(729498483943f960e38c4ada992b099b698b497a) ) ROM_END +// has NEW DOUBLE BET MOJHONG (sic) in ROM but title screen shows 赤麻雀 (Red Mahjong) +ROM_START( akamj ) + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "b3.bin", 0x00000, 0x8000, CRC(fb2e5a3e) SHA1(6a06b36dd3baa4c0aba339aaf2e00d82d08cbb22) ) + ROM_LOAD( "bc2.bin", 0x08000, 0x8000, CRC(38d2aa91) SHA1(b0469803265c6359dc5680e669324a41b84548d7) ) + ROM_LOAD( "bc1.bin", 0x10000, 0x8000, CRC(38d2aa91) SHA1(b0469803265c6359dc5680e669324a41b84548d7) ) // yes, same ROM 2 times + + ROM_REGION( 0x20, "proms", 0 ) + // taken from Royal Mahjong, might or might not be the same. + ROM_LOAD( "82s123.prm", 0x00, 0x20, BAD_DUMP CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) ) +ROM_END + + ROM_START( suzume ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "p1.bin", 0x00000, 0x1000, CRC(e9706967) SHA1(2e3d78178623de6552c9036da90e02f240d94055) ) @@ -6182,6 +6195,7 @@ GAME( 1983, seljan, 0, seljan, seljan, royalmah_state, emp GAME( 1983, janyoup2, royalmj, janyoup2, janyoup2, royalmah_state, empty_init, ROT0, "Cosmo Denshi", "Janyou Part II (ver 7.03, July 1 1983)",0 ) GAME( 1985, tahjong, royalmj, tahjong, tahjong, royalmah_prgbank_state, init_tahjong, ROT0, "Bally Pond / Nasco", "Tahjong Yakitori (ver. 2-1)", 0 ) // 1985 Jun. 17 GAME( 1981, janputer, 0, royalmah, royalmah, royalmah_state, empty_init, ROT0, "bootleg (Paradise Denshi Ltd. / Mes)", "New Double Bet Mahjong (bootleg of Royal Mahjong)", 0 ) // MT #05392 +GAME( 1981, akamj, 0, ippatsu, ippatsu, royalmah_state, empty_init, ROT0, "bootleg (Paradise Denshi Ltd.)", "Aka Mahjong (Double Bet)", 0 ) GAME( 1984, rkjanoh2, 0, rkjanoh2, royalmah, royalmah_prgbank_state, init_chalgirl, ROT0, "SNK / Dyna Corp", "Royal King Jang Oh 2 (v4.00 1984 Jun 10th)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING ) // never seems to set the palette bank? GAME( 1984, janoh, 0, janoh, royalmah, royalmah_state, empty_init, ROT0, "Toaplan", "Jan Oh (set 1)", MACHINE_NOT_WORKING ) GAME( 1984, janoha, janoh, janoha, royalmah, royalmah_state, empty_init, ROT0, "Toaplan", "Jan Oh (set 2)", MACHINE_NOT_WORKING ) // this one is complete? diff --git a/src/mame/edevices/fantland.cpp b/src/mame/edevices/fantland.cpp index e4e1715937c2a..0dcc90ddbe95a 100644 --- a/src/mame/edevices/fantland.cpp +++ b/src/mame/edevices/fantland.cpp @@ -686,7 +686,7 @@ INPUT_PORTS_END ***************************************************************************/ template -CUSTOM_INPUT_MEMBER(fantland_state::wheelrun_wheel_r) +ioport_value fantland_state::wheelrun_wheel_r() { int delta = m_wheel[Player]->read(); delta = (delta & 0x7f) - (delta & 0x80) + 4; diff --git a/src/mame/edevices/fantland.h b/src/mame/edevices/fantland.h index f8dc7b17154eb..e5135e9435a9c 100644 --- a/src/mame/edevices/fantland.h +++ b/src/mame/edevices/fantland.h @@ -30,7 +30,7 @@ class fantland_state : public driver_device void wheelrun(machine_config &config); void galaxygn(machine_config &config); - template DECLARE_CUSTOM_INPUT_MEMBER(wheelrun_wheel_r); + template ioport_value wheelrun_wheel_r(); protected: /* misc */ diff --git a/src/mame/edevices/mwarr.cpp b/src/mame/edevices/mwarr.cpp index 8b3b6c722d8e1..3f2d114e2be74 100644 --- a/src/mame/edevices/mwarr.cpp +++ b/src/mame/edevices/mwarr.cpp @@ -415,4 +415,4 @@ ROM_END * *************************************/ -GAME( 199?, mwarr, 0, mwarr, mwarr, mwarr_state, empty_init, ROT0, "Elettronica Video-Games S.R.L.", "Mighty Warriors (24/1)", MACHINE_SUPPORTS_SAVE ) +GAME( 199?, mwarr, 0, mwarr, mwarr, mwarr_state, empty_init, ROT0, "Elettronica Video-Games", "Mighty Warriors (24/1)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/edevices/pzletime.cpp b/src/mame/edevices/pzletime.cpp index 571908c43ecbd..741e580d215b5 100644 --- a/src/mame/edevices/pzletime.cpp +++ b/src/mame/edevices/pzletime.cpp @@ -1,25 +1,28 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese, Pierpaolo Prazzoli -/***************************************************************************************** +/************************************************************************************************** - Puzzle Time (Prototype) - Elettronica Video-Games S.R.L, 199? +Puzzle Time (Prototype) +Elettronica Video-Games S.R.L, 199? - driver by Angelo Salese and Pierpaolo Prazzoli - dump and info provided by Yoshi +dump and info provided by Yoshi - To initialize the eeprom, keep Service button pressed at boot. +To initialize the eeprom keep Service button pressed at boot. - Notes: - - Text tilemap flickering could be a bit slower / faster - - Brightness effect could be a bit darker / lighter +TODO: +- Text tilemap blinking could be a bit slower / faster +- Brightness effect could be a bit darker / lighter +- Ticket test in service mode keeps outputting tickets once enabled, and flips statuses between + "IN SEDE" (online) and "FUORI SEDE" (offline). Is it intended behaviour? Verify in-game. -*****************************************************************************************/ +**************************************************************************************************/ #include "emu.h" #include "cpu/m68000/m68000.h" -#include "sound/okim6295.h" #include "machine/eepromser.h" +#include "machine/ticket.h" +#include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -31,28 +34,35 @@ namespace { class pzletime_state : public driver_device { public: - pzletime_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_video_regs(*this, "video_regs"), - m_tilemap_regs(*this, "tilemap_regs"), - m_bg_videoram(*this, "bg_videoram"), - m_mid_videoram(*this, "mid_videoram"), - m_txt_videoram(*this, "txt_videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_oki(*this, "oki"), - m_eeprom(*this, "eeprom"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette%u", 0U) + pzletime_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_oki(*this, "oki") + , m_eeprom(*this, "eeprom") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette%u", 0U) + , m_ticket(*this, "ticket") + + , m_video_regs(*this, "video_regs") + , m_tilemap_regs(*this, "tilemap_regs") + , m_bg_videoram(*this, "bg_videoram") + , m_mid_videoram(*this, "mid_videoram") + , m_txt_videoram(*this, "txt_videoram") + , m_spriteram(*this, "spriteram") { } void pzletime(machine_config &config); - int ticket_status_r(); - private: - /* memory pointers */ + required_device m_maincpu; + required_device m_oki; + required_device m_eeprom; + required_device m_gfxdecode; + required_device m_screen; + required_device_array m_palette; + required_device m_ticket; + required_shared_ptr m_video_regs; required_shared_ptr m_tilemap_regs; required_shared_ptr m_bg_videoram; @@ -60,32 +70,22 @@ class pzletime_state : public driver_device required_shared_ptr m_txt_videoram; required_shared_ptr m_spriteram; - /* video-related */ - tilemap_t *m_mid_tilemap = nullptr; - tilemap_t *m_txt_tilemap = nullptr; + tilemap_t *m_mid_tilemap = nullptr; + tilemap_t *m_txt_tilemap = nullptr; + + void main_map(address_map &map); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; - /* misc */ - int m_ticket = 0; void mid_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void txt_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void ticket_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void video_regs_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void eeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void oki_bank_w(uint16_t data); TILE_GET_INFO_MEMBER(get_mid_tile_info); TILE_GET_INFO_MEMBER(get_txt_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void pzletime_palette(palette_device &palette) const; - uint32_t screen_update_pzletime(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_oki; - required_device m_eeprom; - required_device m_gfxdecode; - required_device m_screen; - required_device_array m_palette; - void pzletime_map(address_map &map); + void palette_init(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -117,10 +117,11 @@ void pzletime_state::video_start() m_txt_tilemap->set_transparent_pen(0); } -uint32_t pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pzletime_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - bitmap.fill(m_palette[0]->pen(0), cliprect); //bg pen + bitmap.fill(m_palette[0]->pen(0), cliprect); + // TODO: [3] bits 0-2 may actually control tilemap enable, per layer m_txt_tilemap->set_scrolly(0, m_tilemap_regs[0] - 3); m_txt_tilemap->set_scrollx(0, m_tilemap_regs[1]); @@ -135,8 +136,11 @@ uint32_t pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_rg { for (int x = 0; x < 512; x++) { - if (m_bg_videoram[count] & 0x8000) - bitmap.pix((y - 18) & 0xff, (x - 32) & 0x1ff) = m_palette[1]->pen(m_bg_videoram[count] & 0x7fff); + const uint16_t pen_dot = m_bg_videoram[count]; + const int res_y = (y - 18) & 0xff; + const int res_x = (x - 32) & 0x1ff; + if (pen_dot & 0x8000 && cliprect.contains(res_x, res_y)) + bitmap.pix(res_y, res_x) = m_palette[1]->pen(pen_dot & 0x7fff); count++; } @@ -162,7 +166,8 @@ uint32_t pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_rg } m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0); - if ((screen.frame_number() % 16) != 0) + // TODO: unconfirmed blink ratio + if ((screen.frame_number() & 8) != 0) m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 0); return 0; @@ -180,22 +185,6 @@ void pzletime_state::txt_videoram_w(offs_t offset, uint16_t data, uint16_t mem_m m_txt_tilemap->mark_tile_dirty(offset); } -void pzletime_state::eeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_eeprom->di_write(data & 0x01); - m_eeprom->cs_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); - m_eeprom->clk_write((data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); - } -} - -void pzletime_state::ticket_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - m_ticket = data & 1; -} - void pzletime_state::video_regs_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_video_regs[offset]); @@ -214,12 +203,7 @@ void pzletime_state::oki_bank_w(uint16_t data) m_oki->set_rom_bank(data & 0x3); } -int pzletime_state::ticket_status_r() -{ - return (m_ticket && !(m_screen->frame_number() % 128)); -} - -void pzletime_state::pzletime_map(address_map &map) +void pzletime_state::main_map(address_map &map) { map(0x000000, 0x3fffff).rom(); map(0x700000, 0x700005).ram().w(FUNC(pzletime_state::video_regs_w)).share("video_regs"); @@ -230,8 +214,8 @@ void pzletime_state::pzletime_map(address_map &map) map(0xc00000, 0xc00fff).ram().w(FUNC(pzletime_state::mid_videoram_w)).share("mid_videoram"); map(0xc01000, 0xc01fff).ram().w(FUNC(pzletime_state::txt_videoram_w)).share("txt_videoram"); map(0xd00000, 0xd01fff).ram().share("spriteram"); - map(0xe00000, 0xe00001).portr("INPUT").w(FUNC(pzletime_state::eeprom_w)); - map(0xe00002, 0xe00003).portr("SYSTEM").w(FUNC(pzletime_state::ticket_w)); + map(0xe00000, 0xe00001).portr("INPUT").portw("EEPROMOUT"); + map(0xe00002, 0xe00003).portr("SYSTEM").portw("TICKETOUT"); map(0xe00004, 0xe00005).w(FUNC(pzletime_state::oki_bank_w)); map(0xf00000, 0xf0ffff).ram(); } @@ -245,8 +229,9 @@ static INPUT_PORTS_START( pzletime ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) /* eeprom */ - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pzletime_state, ticket_status_r) /* ticket dispenser */ + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) + // NOTE: was (m_ticket && !(m_screen->frame_number() % 128)); + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("INPUT") @@ -266,6 +251,14 @@ static INPUT_PORTS_START( pzletime ) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) + + PORT_START("EEPROMOUT") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write) + + PORT_START("TICKETOUT") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, motor_w) INPUT_PORTS_END @@ -277,19 +270,17 @@ GFXDECODE_END void pzletime_state::machine_start() { - save_item(NAME(m_ticket)); } void pzletime_state::machine_reset() { - m_ticket = 0; } void pzletime_state::pzletime(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 10000000); - m_maincpu->set_addrmap(AS_PROGRAM, &pzletime_state::pzletime_map); + m_maincpu->set_addrmap(AS_PROGRAM, &pzletime_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(pzletime_state::irq4_line_hold)); /* video hardware */ @@ -298,7 +289,7 @@ void pzletime_state::pzletime(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); m_screen->set_size(64*8, 32*8); m_screen->set_visarea(0*8, 48*8-1, 0*8, 28*8-1); - m_screen->set_screen_update(FUNC(pzletime_state::screen_update_pzletime)); + m_screen->set_screen_update(FUNC(pzletime_state::screen_update)); GFXDECODE(config, m_gfxdecode, m_palette[0], gfx_pzletime); @@ -307,8 +298,8 @@ void pzletime_state::pzletime(machine_config &config) PALETTE(config, m_palette[1], palette_device::RGB_555); EEPROM_93C46_16BIT(config, "eeprom"); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(2000)); - /* sound hardware */ SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki, 937500, okim6295_device::PIN7_HIGH); //freq & pin7 taken from stlforce m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); @@ -360,4 +351,4 @@ ROM_END } // anonymous namespace -GAME( 199?, pzletime, 0, pzletime, pzletime, pzletime_state, empty_init, ROT0, "Elettronica Video-Games S.R.L.", "Puzzle Time (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 199?, pzletime, 0, pzletime, pzletime, pzletime_state, empty_init, ROT0, "Elettronica Video-Games", "Puzzle Time (prototype)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/edevices/stlforce.cpp b/src/mame/edevices/stlforce.cpp index 8ae1bcf82111a..4dddec8ffb444 100644 --- a/src/mame/edevices/stlforce.cpp +++ b/src/mame/edevices/stlforce.cpp @@ -591,6 +591,6 @@ GAME( 1994, stlforce, 0, stlforce, stlforce, stlforce_state, empty_init, GAME( 1995, mortalr, 0, mortalr, stlforce, stlforce_state, empty_init, ROT0, "New Dream Games", "Mortal Race", MACHINE_SUPPORTS_SAVE ) // based on the same rough codebase as Top Driving tch/topdrive.cpp but not the same game, so not a clone -GAME( 1995, twinbrat, 0, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, twinbrata, twinbrat, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, twinbratb, twinbrat, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, twinbrat, 0, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games", "Twin Brats (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, twinbrata, twinbrat, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games", "Twin Brats (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, twinbratb, twinbrat, twinbrat, stlforce, twinbrat_state, empty_init, ROT0, "Elettronica Video-Games", "Twin Brats (set 3)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/enterprise/ep64.cpp b/src/mame/enterprise/ep64.cpp index f9c9ccb07f648..1f8f88ee7758a 100644 --- a/src/mame/enterprise/ep64.cpp +++ b/src/mame/enterprise/ep64.cpp @@ -9,7 +9,7 @@ /* Enterprise Sixty Four / Enterprise One Two Eight -Enterprise Computers Ltd. 1985 +Developed by Intelligent Software, marketed by Enterprise Computers Ltd. 1985 MAIN PCB Layout --------------- @@ -608,7 +608,7 @@ void ep64_state::ep64(machine_config &config) m_exp->set_io_space(m_dave, AS_IO); m_exp->irq_wr().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_exp->nmi_wr().set_inputline(m_maincpu, INPUT_LINE_NMI); - m_exp->wait_wr().set_inputline(m_maincpu, Z80_INPUT_LINE_BOGUSWAIT); + m_exp->wait_wr().set_inputline(m_maincpu, Z80_INPUT_LINE_WAIT); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(FUNC(ep64_state::write_centronics_busy)); @@ -688,7 +688,7 @@ ROM_END // SYSTEM DRIVERS //************************************************************************** -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1985, ep64, 0, 0, ep64, ep64, ep64_state, empty_init, "Enterprise Computers", "Enterprise Sixty Four", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -COMP( 1985, phc64, ep64, 0, ep64, ep64, ep64_state, empty_init, "Hegener + Glaser", "Mephisto PHC 64 (Germany)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -COMP( 1986, ep128, ep64, 0, ep128, ep64, ep64_state, empty_init, "Enterprise Computers", "Enterprise One Two Eight", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1985, ep64, 0, 0, ep64, ep64, ep64_state, empty_init, "Intelligent Software / Enterprise Computers", "Enterprise Sixty Four", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +COMP( 1985, phc64, ep64, 0, ep64, ep64, ep64_state, empty_init, "Intelligent Software / Hegener + Glaser", "Mephisto PHC 64 (Germany)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +COMP( 1986, ep128, ep64, 0, ep128, ep64, ep64_state, empty_init, "Intelligent Software / Enterprise Computers", "Enterprise One Two Eight", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/eolith/ghosteo.cpp b/src/mame/eolith/ghosteo.cpp index 6f775078a98fb..3a32bb478221f 100644 --- a/src/mame/eolith/ghosteo.cpp +++ b/src/mame/eolith/ghosteo.cpp @@ -59,7 +59,6 @@ ToDo: verify QS1000 hook-up #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/gen_latch.h" #include "machine/i2cmem.h" //#include "machine/nandflash.h" diff --git a/src/mame/epson/qx10.cpp b/src/mame/epson/qx10.cpp index 6255eddb2486c..755c108ef3050 100644 --- a/src/mame/epson/qx10.cpp +++ b/src/mame/epson/qx10.cpp @@ -40,6 +40,7 @@ #include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" #include "imagedev/floppy.h" +#include "imagedev/snapquik.h" #include "machine/am9517a.h" #include "machine/i8255.h" #include "machine/mc146818.h" @@ -50,13 +51,12 @@ #include "machine/upd765.h" #include "machine/z80sio.h" #include "sound/spkrdev.h" -#include "speaker.h" #include "video/upd7220.h" -#include "emupal.h" +#include "emupal.h" #include "screen.h" #include "softlist_dev.h" -#include "imagedev/snapquik.h" +#include "speaker.h" namespace { @@ -149,7 +149,7 @@ class qx10_state : public driver_device DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); - void qx10_palette(palette_device &palette) const; + void palette_init(palette_device &palette) const; void dma_hrq_changed(int state); UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels ); @@ -185,6 +185,8 @@ class qx10_state : public driver_device required_device m_ram; required_device m_palette; + bitmap_rgb32 m_bitmap; + /* FDD */ int m_fdcint = 0; uint8_t m_motor_clk = 0; @@ -239,13 +241,8 @@ UPD7220_DISPLAY_PIXELS_MEMBER( qx10_state::hgdc_display_pixels ) pen = ((gfx[0] >> xi) & 1) ? 1 : 0; pen|= ((gfx[1] >> xi) & 1) ? 2 : 0; pen|= ((gfx[2] >> xi) & 1) ? 4 : 0; - for (int z = 0; z <= m_zoom; ++z) - { - int xval = ((x+xi)*(m_zoom+1))+z; - if (xval >= bitmap.cliprect().width() * 2) - continue; - bitmap.pix(y, xval) = palette[pen]; - } + + bitmap.pix(y, x+xi) = palette[pen]; } } @@ -259,7 +256,8 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) int tile = m_video_ram[((addr+x)*2) >> 1] & 0xff; int attr = m_video_ram[((addr+x)*2) >> 1] >> 8; - uint8_t color = (m_color_mode) ? 1 : (attr & 4) ? 2 : 1; /* TODO: color mode */ + // TODO: color mode support + uint8_t color = (m_color_mode) ? 1 : (attr & 4) ? 2 : 1; for (int yi = 0; yi < lr; yi++) { @@ -268,17 +266,19 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) if(attr & 8) tile_data^=0xff; - if(cursor_on && cursor_addr == addr+x) //TODO + if(cursor_on && cursor_addr == addr+x) tile_data^=0xff; - if(attr & 0x80 && m_screen->frame_number() & 0x10) //TODO: check for blinking interval + //TODO: check for blinking interval + if(attr & 0x80 && m_screen->frame_number() & 0x10) tile_data=0; for (int xi = 0; xi < 8; xi++) { - int res_x = ((x * 8) + xi) * (m_zoom + 1); - int res_y = y + (yi * (m_zoom + 1)); + int res_x = ((x * 8) + xi); + int res_y = y + yi; + // TODO: cpm22mf:flop2 display random character test will go out of bounds here if(!m_screen->visible_area().contains(res_x, res_y)) continue; @@ -288,14 +288,8 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) else pen = ((tile_data >> xi) & 1) ? color : 0; - for (int zx = 0; zx <= m_zoom; ++zx) - { - for (int zy = 0; zy <= m_zoom; ++zy) - { - if(pen) - bitmap.pix(res_y+zy, res_x+zx) = palette[pen]; - } - } + if (pen) + bitmap.pix(res_y, res_x) = palette[pen]; } } } @@ -303,9 +297,17 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) uint32_t qx10_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { - bitmap.fill(m_palette->black_pen(), cliprect); - - m_hgdc->screen_update(screen, bitmap, cliprect); + m_bitmap.fill(m_palette->black_pen(), cliprect); + + m_hgdc->screen_update(screen, m_bitmap, cliprect); + // cpm22mf:flop2 will test this under Zoom Test + const u32 pixel_size = 0x10000 / (m_zoom+1); + copyrozbitmap( + bitmap, cliprect, m_bitmap, + 0, 0, + pixel_size, 0, 0, pixel_size, + false + ); return 0; } @@ -813,7 +815,7 @@ void qx10_state::machine_reset() { int i; - /* TODO: is there a bit that sets this up? */ + // TODO: expose to slot monitor option m_color_mode = ioport("CONFIG")->read() & 1; if(m_color_mode) //color @@ -855,9 +857,12 @@ void qx10_state::video_start() { // allocate memory m_video_ram = make_unique_clear(0x30000); + + m_screen->register_screen_bitmap(m_bitmap); + } -void qx10_state::qx10_palette(palette_device &palette) const +void qx10_state::palette_init(palette_device &palette) const { // ... } @@ -902,7 +907,7 @@ void qx10_state::qx10(machine_config &config) m_screen->set_screen_update(FUNC(qx10_state::screen_update)); m_screen->set_raw(16.67_MHz_XTAL, 872, 152, 792, 421, 4, 404); GFXDECODE(config, "gfxdecode", m_palette, gfx_qx10); - PALETTE(config, m_palette, FUNC(qx10_state::qx10_palette), 8); + PALETTE(config, m_palette, FUNC(qx10_state::palette_init), 8); /* Devices */ diff --git a/src/mame/excellent/d9final.cpp b/src/mame/excellent/d9final.cpp index ba7ad4f4fd970..940710ad430e7 100644 --- a/src/mame/excellent/d9final.cpp +++ b/src/mame/excellent/d9final.cpp @@ -2,23 +2,19 @@ // copyright-holders:Angelo Salese, David Haywood /******************************************************************************************* - Dream 9 Final (c) 1992 Excellent Systems +Dream 9 Final (c) 1992 Excellent Systems - driver by Angelo Salese & David Haywood - - TODO: - - What does the ES8712 control? There's definitely no ADPCM chip or sample ROM here; - - Main CPU banking is wrong; - - Some inputs not understood; - - A bunch of missing port outputs (including payout); - - screen disable? Start-up fading looks horrible; - - Game looks IGS-esque, is there any correlation? +TODO: +- What does the ES8712 control? There's definitely no ADPCM chip or sample ROM here; +- lamps; +- Start-up fading looks horrible, video timings? btanb? +- Game looks IGS-esque, is there any correlation? ============================================================================================ - PCB: ES-9112 +PCB: ES-9112 - Main Chips: Z80, ES8712, 24Mhz OSC, RTC62421B 9262, YM2413, 4x8DSW +Main Chips: Z80, ES8712, 24Mhz OSC, RTC62421B 9262, YM2413, 4x8DSW *******************************************************************************************/ @@ -27,6 +23,7 @@ #include "cpu/z80/z80.h" #include "machine/msm6242.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "sound/es8712.h" #include "sound/ymopl.h" #include "emupal.h" @@ -40,14 +37,15 @@ namespace { class d9final_state : public driver_device { public: - d9final_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_lo_vram(*this, "lo_vram"), - m_hi_vram(*this, "hi_vram"), - m_cram(*this, "cram"), - m_mainbank(*this, "mainbank") + d9final_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_gfxdecode(*this, "gfxdecode") + , m_hopper(*this, "hopper") + , m_lo_vram(*this, "lo_vram") + , m_hi_vram(*this, "hi_vram") + , m_cram(*this, "cram") + , m_mainbank(*this, "mainbank") { } void d9final(machine_config &config); @@ -59,6 +57,7 @@ class d9final_state : public driver_device private: required_device m_maincpu; required_device m_gfxdecode; + required_device m_hopper; required_shared_ptr m_lo_vram; required_shared_ptr m_hi_vram; @@ -67,15 +66,15 @@ class d9final_state : public driver_device tilemap_t *m_sc0_tilemap; - void sc0_lovram(offs_t offset, uint8_t data); - void sc0_hivram(offs_t offset, uint8_t data); - void sc0_cram(offs_t offset, uint8_t data); void bank_w(uint8_t data); uint8_t prot_latch_r(); + void sc0_lovram(offs_t offset, uint8_t data); + void sc0_hivram(offs_t offset, uint8_t data); + void sc0_cram(offs_t offset, uint8_t data); TILE_GET_INFO_MEMBER(get_sc0_tile_info); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void io_map(address_map &map); void prg_map(address_map &map); }; @@ -153,12 +152,29 @@ void d9final_state::prg_map(address_map &map) void d9final_state::io_map(address_map &map) { map.global_mask(0xff); -// map(0x00, 0x00).nopw(); //bit 0: irq enable? screen enable? - map(0x00, 0x00).portr("DSWA"); - map(0x20, 0x20).portr("DSWB"); + map(0x00, 0x00).portr("DSWA").lw8( + NAME([this] (offs_t offset, u8 data) { + machine().bookkeeping().coin_lockout_global_w(!BIT(data, 0)); + // bit 1: bet lamp + // bit 2-3: take score & double up lamps + // bit 4: big lamp + // bit 5: small lamp (lit for instruction sheet in bet phase) + // bit 6: start lamp + // bit 7: payout lamp + }) + ); + map(0x20, 0x20).portr("DSWB").lw8( + NAME([this] (offs_t offset, u8 data) { + // NOTE: keyin goes to coin counter 2, coin 2 and 3 to 1 & 2 + for (int i = 0; i < 4; i++) + machine().bookkeeping().coin_counter_w(i, BIT(data, i)); + + m_hopper->motor_w(BIT(data, 7)); + }) + ); map(0x40, 0x40).portr("DSWC"); map(0x40, 0x41).w("ymsnd", FUNC(ym2413_device::write)); - map(0x60, 0x60).portr("DSWD"); + map(0x60, 0x60).portr("DSWD").nopw(); // write: irq ack? shadows bank_w writes, twice, at line ~8 map(0x80, 0x80).portr("IN0"); map(0xa0, 0xa0).portr("IN1").w(FUNC(d9final_state::bank_w)); map(0xe0, 0xe0).portr("IN2"); @@ -167,9 +183,11 @@ void d9final_state::io_map(address_map &map) static INPUT_PORTS_START( d9final ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) - PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -310,7 +328,6 @@ void d9final_state::machine_start() void d9final_state::d9final(machine_config &config) { - // basic machine hardware Z80(config, m_maincpu, 24000000 / 4); /* ? MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &d9final_state::prg_map); m_maincpu->set_addrmap(AS_IO, &d9final_state::io_map); @@ -318,7 +335,8 @@ void d9final_state::d9final(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // Sharp LH5116D-10 + battery - // video hardware + HOPPER(config, m_hopper, attotime::from_msec(20)); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); diff --git a/src/mame/excellent/dblcrown.cpp b/src/mame/excellent/dblcrown.cpp index 4d65b7fd2f785..be6527fd1af9d 100644 --- a/src/mame/excellent/dblcrown.cpp +++ b/src/mame/excellent/dblcrown.cpp @@ -1,43 +1,41 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese, Roberto Fresca -/*************************************************************************** +/************************************************************************************************** - Double Crown (c) 1997 Cadence Technology / Dyna - - Driver by Angelo Salese - Additional work by Roberto Fresca. - - TODO: - - Bogus "Hole" in main screen display; - - Is the background pen really black? - - Lots of unmapped I/Os (game doesn't make much use of the HW); - - video / irq timings; - - Notes: - - at POST the SW tries to write to the palette RAM in a banking fashion. - I think it's just an HW left-over. - - there are various bogus checks to ROM region throughout the whole SW - (0x0030-0x0033? O.o), trying to change the values of these ones changes - the functionality of the game, almost like that the DSWs are tied to - these ... - -============================================================================ - - Excellent System - boardlabel: ES-9411B - - 28.6363 xtal - ES-9409 QFP is 208 pins.. for graphics only? - Z0840006PSC Zilog z80, is rated 6.17 MHz - OKI M82C55A-2 - 65764H-5 .. 64kbit ram CMOS - 2 * N341256P-25 - CMOS SRAM 256K-BIT(32KX8) - 4 * dipsw 8pos - YMZ284-D (ay8910, but without i/o ports) - MAXIM MAX693ACPE is a "Microprocessor Supervisory Circuit", for watchdog - and for nvram functions. +Double Crown (c) 1997 Cadence Technology / Dyna -***************************************************************************/ +TODO: +- Is the background pen really black? +- Pinpoint optional hopper line_r hookup, via dip4:8. +- Lots of unmapped I/Os (game doesn't make much use of the HW); +- video / irq timings; + +Notes: +- at POST the SW tries to write to the palette RAM in a banking fashion. HW left-over? +- there are various $0030-$0033 ROM checks across the SW, changing these values to non-zero + effectively changes game functionality (cfr. matrix mode at POST), ROM overlay or just + different ROM versions? +- Topmost 2 rows are intended to be seen, cfr. analyzer "5 of a kind" and "royal flush" drawn there. + Whatever these rows are supposed to indicate in gameplay (scoring cards for a fever bonus?) + is untested. + +=================================================================================================== + +Excellent System +boardlabel: ES-9411B + +28.6363 xtal +ES-9409 QFP is 208 pins.. for graphics only? +Z0840006PSC Zilog z80, is rated 6.17 MHz +OKI M82C55A-2 +65764H-5 .. 64kbit ram CMOS +2 * N341256P-25 - CMOS SRAM 256K-BIT(32KX8) +4 * dipsw 8pos +YMZ284-D (ay8910, but without i/o ports) +MAXIM MAX693ACPE is a "Microprocessor Supervisory Circuit", for watchdog +and for nvram functions. + +**************************************************************************************************/ #define MAIN_CLOCK XTAL(28'636'363) @@ -46,22 +44,24 @@ #include "emu.h" #include "cpu/z80/z80.h" -#include "sound/ay8910.h" +#include "machine/bankdev.h" #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "machine/watchdog.h" +#include "sound/ay8910.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" #include "dblcrown.lh" namespace { -#define DEBUG_VRAM - class dblcrown_state : public driver_device { public: @@ -69,6 +69,9 @@ class dblcrown_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_watchdog(*this, "watchdog") + , m_hopper(*this, "hopper") + , m_vram(*this, "vram") + , m_vram_bank(*this, "vram_bank%u", 0U) , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") , m_inputs(*this, "IN%u", 0U) @@ -78,14 +81,20 @@ class dblcrown_state : public driver_device void dblcrown(machine_config &config); private: - // driver_device overrides virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - // screen updates - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_device m_maincpu; + required_device m_watchdog; + required_device m_hopper; + required_shared_ptr m_vram; + required_device_array m_vram_bank; + required_device m_gfxdecode; + required_device m_palette; + required_ioport_array<4> m_inputs; + output_finder<8> m_lamps; void bank_w(uint8_t data); uint8_t irq_source_r(); @@ -96,80 +105,72 @@ class dblcrown_state : public driver_device void vram_w(offs_t offset, uint8_t data); uint8_t vram_bank_r(offs_t offset); void vram_bank_w(offs_t offset, uint8_t data); - void mux_w(uint8_t data); - uint8_t in_mux_r(); - uint8_t in_mux_type_r(); + void key_select_w(uint8_t data); + uint8_t key_matrix_r(); + uint8_t key_pending_r(); void output_w(uint8_t data); void lamps_w(uint8_t data); void watchdog_w(uint8_t data); - TIMER_DEVICE_CALLBACK_MEMBER(dblcrown_irq_scanline); - void dblcrown_palette(palette_device &palette) const; - - void dblcrown_io(address_map &map); - void dblcrown_map(address_map &map); + TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb); - // devices - required_device m_maincpu; - required_device m_watchdog; - required_device m_gfxdecode; - required_device m_palette; - required_ioport_array<4> m_inputs; - output_finder<8> m_lamps; + void main_map(address_map &map); + void main_io(address_map &map); + void vram_map(address_map &map); uint8_t m_bank = 0; uint8_t m_irq_src = 0; + uint8_t m_key_select = 0; + std::unique_ptr m_pal_ram; - std::unique_ptr m_vram; - uint8_t m_vram_bank[2]{}; - uint8_t m_mux_data = 0; + uint8_t m_vram_bank_entry[2]{}; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; -void dblcrown_state::video_start() +TILE_GET_INFO_MEMBER(dblcrown_state::get_bg_tile_info) { - m_pal_ram = std::make_unique(0x200 * 2); - m_vram = std::make_unique(0x1000 * 0x10); + const u8 *rambase = (const u8 *)tilemap.user_data(); + const u16 code = (rambase[tile_index * 2 + 0] | (rambase[tile_index * 2 + 1] << 8)) & 0xfff; + const u8 color = (rambase[tile_index * 2 + 1] >> 4); - save_pointer(NAME(m_vram), 0x1000 * 0x10); + tileinfo.set(0, code, color, 0); } -uint32_t dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +TILE_GET_INFO_MEMBER(dblcrown_state::get_fg_tile_info) { - gfx_element *gfx = m_gfxdecode->gfx(0); - gfx_element *gfx_2 = m_gfxdecode->gfx(1); - int x,y; - int count; - - count = 0xa000; - - for (y = 0; y < 16; y++) - { - for (x = 0; x < 32; x++) - { - uint16_t tile = ((m_vram[count]) | (m_vram[count+1] << 8)) & 0xfff; - uint8_t col = (m_vram[count+1] >> 4); - - gfx_2->opaque(bitmap, cliprect, tile, col, 0, 0, x * 16, y * 16); + const u8 *rambase = (const u8 *)tilemap.user_data(); + const u16 code = (rambase[tile_index * 2 + 0] | (rambase[tile_index * 2 + 1] << 8)) & 0x7ff; + const u8 color = (rambase[tile_index * 2 + 1] >> 4); - count += 2; - } - } + tileinfo.set(1, code, color, 0); +} - count = 0xb000; +void dblcrown_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dblcrown_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 16); + m_bg_tilemap->set_user_data(&m_vram[0xa000]); - for (y = 0; y < 32; y++) - { - for (x = 0; x < 64; x++) - { - uint16_t tile = ((m_vram[count]) | (m_vram[count + 1] << 8)) & 0xfff; - uint8_t col = (m_vram[count + 1] >> 4); // ok? + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dblcrown_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_user_data(&m_vram[0xb000]); - gfx->transpen(bitmap, cliprect, tile, col, 0, 0, x * 8, y * 8, 0); + m_fg_tilemap->set_transparent_pen(0); - count += 2; - } - } + m_pal_ram = std::make_unique(0x200 * 2); + // NOTE: set_source alone will crash with 0-length gfxdecoding + // need to explicitly use a fn otherwise unused by the rest of + // the MAME ecosystem at the time of this writing. + m_gfxdecode->gfx(1)->set_source_and_total(m_vram, m_vram.length() / 32); +} +uint32_t dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -216,64 +217,52 @@ void dblcrown_state::palette_w(offs_t offset, uint8_t data) m_palette->set_pen_color(offset, pal4bit(r), pal4bit(g), pal4bit(b)); } - -uint8_t dblcrown_state::vram_r(offs_t offset) -{ - uint32_t hi_offs; - hi_offs = m_vram_bank[(offset & 0x1000) >> 12] << 12; - - return m_vram[(offset & 0xfff) | hi_offs]; -} - void dblcrown_state::vram_w(offs_t offset, uint8_t data) { - uint32_t hi_offs; - hi_offs = m_vram_bank[(offset & 0x1000) >> 12] << 12; + m_vram[offset] = data; - m_vram[(offset & 0xfff) | hi_offs] = data; + if ((offset & 0xf000) == 0xa000) + m_bg_tilemap->mark_tile_dirty((offset & 0xfff) >> 1); - #ifdef DEBUG_VRAM - { - uint8_t *VRAM = memregion("vram")->base(); + if ((offset & 0xf000) == 0xb000) + m_fg_tilemap->mark_tile_dirty((offset & 0xfff) >> 1); - VRAM[(offset & 0xfff) | hi_offs] = data; - m_gfxdecode->gfx(0)->mark_dirty(((offset & 0xfff) | hi_offs) / 32); - } - #endif + m_gfxdecode->gfx(1)->mark_dirty(offset / 32); } uint8_t dblcrown_state::vram_bank_r(offs_t offset) { - return m_vram_bank[offset]; + return m_vram_bank_entry[offset]; } void dblcrown_state::vram_bank_w(offs_t offset, uint8_t data) { - m_vram_bank[offset] = data & 0xf; + m_vram_bank_entry[offset] = data & 0xf; + m_vram_bank[offset]->set_bank(m_vram_bank_entry[offset]); if(data & 0xf0) - printf("vram bank = %02x\n",data); + logerror("Upper vram bank write = %02x\n",data); } -void dblcrown_state::mux_w(uint8_t data) +void dblcrown_state::key_select_w(uint8_t data) { - m_mux_data = data; + m_key_select = data; } -uint8_t dblcrown_state::in_mux_r() +uint8_t dblcrown_state::key_matrix_r() { uint8_t res = 0; for(int i = 0; i < 4; i++) { - if(m_mux_data & 1 << i) + if(m_key_select & 1 << i) res |= m_inputs[i]->read(); } return res; } -uint8_t dblcrown_state::in_mux_type_r() +uint8_t dblcrown_state::key_pending_r() { uint8_t res = 0xff; @@ -286,47 +275,43 @@ uint8_t dblcrown_state::in_mux_type_r() return res; } +/* bits + * 7654 3210 + * ---- -x-- coin lockout + * ---- x--- Payout counter pulse + * ---x ---- Coin In counter pulse + * -x-- ---- unknown (active after deal) + * x-x- --xx unknown + */ void dblcrown_state::output_w(uint8_t data) { -/* bits - 7654 3210 - ---- -x-- unknown (active after deal) - ---- x--- Payout counter pulse - ---x ---- Coin In counter pulse - -x-- ---- unknown (active after deal) - x-x- --xx unknown -*/ - - machine().bookkeeping().coin_counter_w(0, data & 0x10); /* Coin In counter pulse */ - machine().bookkeeping().coin_counter_w(1 ,data & 0x08); /* Payout counter pulse */ -// popmessage("out: %02x", data); + machine().bookkeeping().coin_counter_w(0, BIT(data, 4)); + m_hopper->motor_w(BIT(data, 3)); + machine().bookkeeping().coin_lockout_global_w(!BIT(data, 2)); } - +/* bits + * 7654 3210 + * ---- ---x Deal + * ---- --x- Bet + * ---- -x-- Cancel + * ---- x--- Hold 5 + * ---x ---- Hold 4 + * --x- ---- Hold 3 + * -x-- ---- Hold 2 + * x--- ---- Hold 1 + */ void dblcrown_state::lamps_w(uint8_t data) { -/* bits - 7654 3210 - ---- ---x Deal - ---- --x- Bet - ---- -x-- Cancel - ---- x--- Hold 5 - ---x ---- Hold 4 - --x- ---- Hold 3 - -x-- ---- Hold 2 - x--- ---- Hold 1 -*/ - for (int n = 0; n < 8; n++) m_lamps[n] = BIT(data, n); } +// MAX693A void dblcrown_state::watchdog_w(uint8_t data) -/* - Always 0x01... -*/ { - if (data & 0x01) /* check for refresh value (0x01) */ + // check for refresh value (0x01) + if (data & 0x01) { m_watchdog->watchdog_reset(); } @@ -337,23 +322,23 @@ void dblcrown_state::watchdog_w(uint8_t data) } -void dblcrown_state::dblcrown_map(address_map &map) +void dblcrown_state::main_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x7fff).rom(); map(0x8000, 0x9fff).bankr("rom_bank"); map(0xa000, 0xb7ff).ram(); // work ram map(0xb800, 0xbfff).ram().share("nvram"); - map(0xc000, 0xdfff).rw(FUNC(dblcrown_state::vram_r), FUNC(dblcrown_state::vram_w)); + map(0xc000, 0xcfff).m(m_vram_bank[0], FUNC(address_map_bank_device::amap8)); + map(0xd000, 0xdfff).m(m_vram_bank[1], FUNC(address_map_bank_device::amap8)); map(0xf000, 0xf1ff).rw(FUNC(dblcrown_state::palette_r), FUNC(dblcrown_state::palette_w)); map(0xfe00, 0xfeff).ram(); // ??? map(0xff00, 0xffff).ram(); // ???, intentional fall-through map(0xff00, 0xff01).rw(FUNC(dblcrown_state::vram_bank_r), FUNC(dblcrown_state::vram_bank_w)); map(0xff04, 0xff04).rw(FUNC(dblcrown_state::irq_source_r), FUNC(dblcrown_state::irq_source_w)); - } -void dblcrown_state::dblcrown_io(address_map &map) +void dblcrown_state::main_io(address_map &map) { map.global_mask(0xff); map.unmap_value_high(); @@ -361,14 +346,19 @@ void dblcrown_state::dblcrown_io(address_map &map) map(0x01, 0x01).portr("DSWB"); map(0x02, 0x02).portr("DSWC"); map(0x03, 0x03).portr("DSWD"); - map(0x04, 0x04).r(FUNC(dblcrown_state::in_mux_r)); - map(0x05, 0x05).r(FUNC(dblcrown_state::in_mux_type_r)); + map(0x04, 0x04).r(FUNC(dblcrown_state::key_matrix_r)); + map(0x05, 0x05).r(FUNC(dblcrown_state::key_pending_r)); map(0x10, 0x13).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x20, 0x21).w("ymz", FUNC(ymz284_device::address_data_w)); map(0x30, 0x30).w(FUNC(dblcrown_state::watchdog_w)); map(0x40, 0x40).w(FUNC(dblcrown_state::output_w)); } +void dblcrown_state::vram_map(address_map &map) +{ + map(0x0000, 0xffff).ram().w(FUNC(dblcrown_state::vram_w)).share("vram"); +} + static INPUT_PORTS_START( dblcrown ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) @@ -381,7 +371,7 @@ static INPUT_PORTS_START( dblcrown ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Payout") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN2") @@ -445,9 +435,9 @@ static INPUT_PORTS_START( dblcrown ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Card Reveal Animation" ) + PORT_DIPSETTING( 0x40, "Normal" ) + PORT_DIPSETTING( 0x00, "Fast" ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -468,39 +458,45 @@ static INPUT_PORTS_START( dblcrown ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, "Credit Limit" ) + PORT_DIPSETTING( 0xe0, "1000" ) + PORT_DIPSETTING( 0xc0, "3000") + PORT_DIPSETTING( 0xa0, "5000" ) + PORT_DIPSETTING( 0x80, "10000" ) + PORT_DIPSETTING( 0x60, "20000" ) + PORT_DIPSETTING( 0x40, "30000" ) + PORT_DIPSETTING( 0x20, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) PORT_START("DSWD") - PORT_DIPNAME( 0x01, 0x01, "DSWD" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x00, "10 Coins/1 Credit" ) + PORT_DIPSETTING( 0x02, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x01, "1 Coin/1 Credit (again 1)" ) + PORT_DIPSETTING( 0x07, "1 Coin/1 Credit (again 2)" ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0b, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x0a, "1 Coin/20 Credits" ) + PORT_DIPSETTING( 0x09, "1 Coin/25 Credits" ) + PORT_DIPSETTING( 0x08, "1 Coin/50 Credits" ) + PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coin_B ) ) // Coinage for note in + PORT_DIPSETTING( 0x70, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x40, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x30, "1 Coin/25 Credits" ) + PORT_DIPSETTING( 0x20, "1 Coin/50 Credits" ) + PORT_DIPSETTING( 0x10, "1 Coin/100 Credits" ) + PORT_DIPSETTING( 0x00, "1 Coin/500 Credits" ) + // TODO: game will error blink if On at payout time + PORT_DIPNAME( 0x80, 0x80, "Hopper Status?" ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -518,10 +514,8 @@ static const gfx_layout char_16x16_layout = static GFXDECODE_START( gfx_dblcrown ) -#ifdef DEBUG_VRAM - GFXDECODE_ENTRY( "vram", 0, gfx_8x8x4_packed_lsb, 0, 0x10 ) -#endif GFXDECODE_ENTRY( "gfx1", 0, char_16x16_layout, 0, 0x10 ) + GFXDECODE_ENTRY( nullptr, 0, gfx_8x8x4_packed_lsb, 0, 0x10 ) GFXDECODE_END @@ -536,14 +530,12 @@ void dblcrown_state::machine_start() void dblcrown_state::machine_reset() { + m_vram_bank[0]->set_bank(0); + m_vram_bank[1]->set_bank(0); } -void dblcrown_state::dblcrown_palette(palette_device &palette) const -{ -} - -TIMER_DEVICE_CALLBACK_MEMBER(dblcrown_state::dblcrown_irq_scanline) +TIMER_DEVICE_CALLBACK_MEMBER(dblcrown_state::scanline_cb) { int scanline = param; @@ -588,35 +580,38 @@ It needs at least 64 instances because 0xa05b will be eventually nuked by the vb void dblcrown_state::dblcrown(machine_config &config) { - /* basic machine hardware */ Z80(config, m_maincpu, CPU_CLOCK); - m_maincpu->set_addrmap(AS_PROGRAM, &dblcrown_state::dblcrown_map); - m_maincpu->set_addrmap(AS_IO, &dblcrown_state::dblcrown_io); - TIMER(config, "scantimer").configure_scanline(FUNC(dblcrown_state::dblcrown_irq_scanline), "screen", 0, 1); + m_maincpu->set_addrmap(AS_PROGRAM, &dblcrown_state::main_map); + m_maincpu->set_addrmap(AS_IO, &dblcrown_state::main_io); + TIMER(config, "scantimer").configure_scanline(FUNC(dblcrown_state::scanline_cb), "screen", 0, 1); + + // 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) + WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(1000)); - WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(1000)); /* 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) */ + HOPPER(config, m_hopper, attotime::from_msec(50)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + i8255_device &ppi(I8255(config, "ppi")); + ppi.out_pa_callback().set(FUNC(dblcrown_state::lamps_w)); + ppi.out_pb_callback().set(FUNC(dblcrown_state::bank_w)); + ppi.out_pc_callback().set(FUNC(dblcrown_state::key_select_w)); + + for (auto bank : m_vram_bank) + ADDRESS_MAP_BANK(config, bank).set_map(&dblcrown_state::vram_map).set_options(ENDIANNESS_LITTLE, 8, 16, 0x1000); - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); screen.set_screen_update(FUNC(dblcrown_state::screen_update)); screen.set_size(64*8, 64*8); - screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1); + screen.set_visarea(0*8, 40*8-1, 0*8, 30*8-1); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_dblcrown); - PALETTE(config, m_palette, FUNC(dblcrown_state::dblcrown_palette), 0x100); + PALETTE(config, m_palette).set_entries(0x100); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - i8255_device &ppi(I8255(config, "ppi")); - ppi.out_pa_callback().set(FUNC(dblcrown_state::lamps_w)); - ppi.out_pb_callback().set(FUNC(dblcrown_state::bank_w)); - ppi.out_pc_callback().set(FUNC(dblcrown_state::mux_w)); - - /* sound hardware */ SPEAKER(config, "mono").front_center(); YMZ284(config, "ymz", SND_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.75); } @@ -636,10 +631,6 @@ ROM_START( dblcrown ) ROM_REGION( 0x80000, "gfx1", ROMREGION_ERASE00 ) ROM_LOAD("2.u43", 0x00000, 0x80000, CRC(58200bd4) SHA1(2795cfc41056111f66bfb82916343d1c733baa83) ) -#ifdef DEBUG_VRAM - ROM_REGION( 0x1000*0x10, "vram", ROMREGION_ERASE00 ) -#endif - ROM_REGION( 0x0bf1, "plds", 0 ) ROM_LOAD("palce16v8h.u39", 0x0000, 0x0117, CRC(c74231ee) SHA1(f1b9e98f1fde53eee64d5da38fb8a6c22b6333e2) ) ROM_END @@ -647,5 +638,4 @@ ROM_END } // anonymous namespace -/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ GAMEL( 1997, dblcrown, 0, dblcrown, dblcrown, dblcrown_state, empty_init, ROT0, "Cadence Technology", "Double Crown (v1.0.3)", MACHINE_IMPERFECT_GRAPHICS, layout_dblcrown ) // 1997 DYNA copyright in tile GFX diff --git a/src/mame/excellent/lastbank.cpp b/src/mame/excellent/lastbank.cpp index 0f80c608bac1d..0f0c77d297d8b 100644 --- a/src/mame/excellent/lastbank.cpp +++ b/src/mame/excellent/lastbank.cpp @@ -1,82 +1,106 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese -/*************************************************************************** +// copyright-holders: Angelo Salese +/************************************************************************************************** - Last Bank (c) 1994 Excellent System +Last Bank (c) 1994 Excellent System - driver by Angelo Salese +Uses a TC0091LVC, a variant of the one used on Taito L HW - Uses a TC0091LVC, a variant of the one used on Taito L HW +Undumped games on similar hardware (ES-9402 or ES-9410): +* Gold Strike +* Lucky Pierrot / Wonder Circus +* Miracle Seven - Heaven's Gate +* Miracle Seven - Heaven's Gate Turbo +* Ukiyo Box - Undumped games on similar hardware (ES-9402 or ES-9410): - * Gold Strike - * Lucky Pierrot / Wonder Circus - * Miracle Seven - Heaven's Gate - * Miracle Seven - Heaven's Gate Turbo - * Ukiyo Box +TODO: +- lastbank: sprites should be clip masked during gameplay (verify); +- fever13: OKI sound volume overdrives a lot; +- hookup hopper device; -***************************************************************************/ +**************************************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" -#include "sound/es8712.h" -#include "sound/okim6295.h" -#include "sound/ymopn.h" #include "machine/gen_latch.h" #include "machine/nvram.h" #include "machine/tc009xlvc.h" +#include "machine/ticket.h" #include "machine/timer.h" +#include "sound/es8712.h" +#include "sound/okim6295.h" +#include "sound/ymopn.h" + #include "screen.h" #include "speaker.h" namespace { -#define MASTER_CLOCK XTAL(14'318'181) - class lastbank_state : public driver_device { public: lastbank_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_hopper(*this, "hopper") , m_oki(*this, "oki") , m_essnd(*this, "essnd") + , m_key{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } } { } void lastbank(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(sound_status_r); + ioport_value sound_status_r(); protected: virtual void machine_start() override; + virtual void main_map(address_map &map); + virtual void audio_io(address_map &map); + + void sound_flags_w(uint8_t data); + private: required_device m_maincpu; + required_device m_hopper; required_device m_oki; required_device m_essnd; - void screen_vblank(int state); + required_ioport_array<5> m_key[2]; - uint8_t m_mux_data = 0; + uint8_t m_key_select = 0; uint8_t m_sound_flags = 0; + void screen_vblank(int state); + void output_w(offs_t offset, uint8_t data); - uint8_t mux_0_r(); - void mux_w(uint8_t data); - void sound_flags_w(uint8_t data); + template uint8_t key_matrix_r(); + void key_select_w(uint8_t data); - TIMER_DEVICE_CALLBACK_MEMBER(irq_scanline); - void lastbank_audio_io(address_map &map); - void lastbank_audio_map(address_map &map); - void lastbank_map(address_map &map); + TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb); + void audio_map(address_map &map); void tc0091lvc_map(address_map &map); }; +class fever13_state : public lastbank_state +{ +public: + fever13_state(const machine_config &mconfig, device_type type, const char *tag) + : lastbank_state(mconfig, type, tag) + { } + +protected: + virtual void main_map(address_map &map) override; + virtual void audio_io(address_map &map) override; +}; + + void lastbank_state::machine_start() { - save_item(NAME(m_mux_data)); + save_item(NAME(m_key_select)); save_item(NAME(m_sound_flags)); } @@ -89,21 +113,14 @@ void lastbank_state::screen_vblank(int state) } -uint8_t lastbank_state::mux_0_r() +template +uint8_t lastbank_state::key_matrix_r() { - const char *const keynames[2][5] = { - {"P1_KEY0", "P1_KEY1", "P1_KEY2", "P1_KEY3", "P1_KEY4"}, - {"P2_KEY0", "P2_KEY1", "P2_KEY2", "P2_KEY3", "P2_KEY4"} }; - uint8_t res; - int i; + uint8_t res = 0xff; - res = 0xff; - - for(i=0;i<5;i++) - { - if(m_mux_data & 1 << i) - res = ioport(keynames[0][i])->read(); - } + for (int i = 0; i < 5; i++) + if (BIT(m_key_select, i)) + res &= m_key[Player][i]->read(); return res; } @@ -113,8 +130,12 @@ void lastbank_state::output_w(offs_t offset, uint8_t data) switch (offset) { case 0: + // lamps? + break; + case 1: - //logerror("%s: Writing %02x to A80%x\n", machine().describe_context(), data, offset); + // xxxx ---- probably individual lockouts + m_hopper->motor_w(BIT(data, 2)); break; case 2: @@ -126,9 +147,9 @@ void lastbank_state::output_w(offs_t offset, uint8_t data) } } -void lastbank_state::mux_w(uint8_t data) +void lastbank_state::key_select_w(uint8_t data) { - m_mux_data = data; + m_key_select = data; } void lastbank_state::sound_flags_w(uint8_t data) @@ -140,7 +161,7 @@ void lastbank_state::sound_flags_w(uint8_t data) m_oki->reset(); } -CUSTOM_INPUT_MEMBER(lastbank_state::sound_status_r) +ioport_value lastbank_state::sound_status_r() { return BIT(m_sound_flags, 0) << 1 | BIT(m_sound_flags, 1); } @@ -156,42 +177,56 @@ void lastbank_state::tc0091lvc_map(address_map &map) map(0xff08, 0xff08).rw(m_maincpu, FUNC(tc0091lvc_device::rom_bank_r), FUNC(tc0091lvc_device::rom_bank_w)); } -void lastbank_state::lastbank_map(address_map &map) +void lastbank_state::main_map(address_map &map) { tc0091lvc_map(map); map(0xa000, 0xa00d).noprw(); // MSM62X42B or equivalent probably read from here map(0xa800, 0xa800).portr("COINS"); map(0xa800, 0xa802).w(FUNC(lastbank_state::output_w)); - map(0xa803, 0xa803).w(FUNC(lastbank_state::mux_w)); // mux for $a808 / $a80c + map(0xa803, 0xa803).w(FUNC(lastbank_state::key_select_w)); map(0xa804, 0xa804).portr("SPECIAL"); map(0xa805, 0xa805).w("soundlatch1", FUNC(generic_latch_8_device::write)); map(0xa806, 0xa806).w("soundlatch2", FUNC(generic_latch_8_device::write)); - map(0xa807, 0xa807).nopw(); // hopper? - map(0xa808, 0xa808).r(FUNC(lastbank_state::mux_0_r)); - map(0xa80c, 0xa80c).r(FUNC(lastbank_state::mux_0_r)); - map(0xa81c, 0xa81c).portr("DSW0"); - map(0xa81d, 0xa81d).portr("DSW1"); - map(0xa81e, 0xa81e).portr("DSW2"); - map(0xa81f, 0xa81f).portr("DSW3"); + map(0xa807, 0xa807).nopw(); + map(0xa808, 0xa808).r(FUNC(lastbank_state::key_matrix_r<0>)); + map(0xa80c, 0xa80c).r(FUNC(lastbank_state::key_matrix_r<1>)); + map(0xa81c, 0xa81c).portr("DSW1"); + map(0xa81d, 0xa81d).portr("DSW2"); + map(0xa81e, 0xa81e).portr("DSW3"); + map(0xa81f, 0xa81f).portr("DSW4"); } -void lastbank_state::lastbank_audio_map(address_map &map) +void lastbank_state::audio_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xdfff).ram(); map(0xe000, 0xe7ff).ram(); } -void lastbank_state::lastbank_audio_io(address_map &map) +void lastbank_state::audio_io(address_map &map) { map.global_mask(0xff); map(0x00, 0x06).rw(m_essnd, FUNC(es8712_device::read), FUNC(es8712_device::write)); map(0x40, 0x40).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x80, 0x80).w(FUNC(lastbank_state::sound_flags_w)); - map(0x80, 0x80).r("soundlatch1", FUNC(generic_latch_8_device::read)); + map(0x80, 0x80).r("soundlatch1", FUNC(generic_latch_8_device::read)).w(FUNC(lastbank_state::sound_flags_w)); map(0xc0, 0xc0).r("soundlatch2", FUNC(generic_latch_8_device::read)); } +void fever13_state::main_map(address_map &map) +{ + lastbank_state::main_map(map); + map(0xa808, 0xa808).portr("IN0"); + map(0xa80c, 0xa80c).portr("IN0"); +} + +void fever13_state::audio_io(address_map &map) +{ + lastbank_state::audio_io(map); + + map(0x80, 0x80).r("soundlatch2", FUNC(generic_latch_8_device::read)); + map(0xc0, 0xc0).r("soundlatch1", FUNC(generic_latch_8_device::read)).w(FUNC(fever13_state::sound_flags_w)); +} + static INPUT_PORTS_START( lastbank ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CODE(KEYCODE_M) @@ -206,9 +241,7 @@ static INPUT_PORTS_START( lastbank ) PORT_START("SPECIAL") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) - PORT_DIPNAME( 0x04, 0x04, "Hopper Count" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_DIPNAME( 0x08, 0x08, "Hopper Empty" ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -259,7 +292,23 @@ static INPUT_PORTS_START( lastbank ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2-3") PORT_CODE(KEYCODE_A) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW0") + // TODO + PORT_START("P2_KEY0") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2_KEY1") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2_KEY2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2_KEY3") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2_KEY4") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -285,7 +334,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW1") + PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -311,7 +360,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW2") + PORT_START("DSW3") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:1,2,3,4") PORT_DIPSETTING( 0x07, "1 Coin /100 Credits" ) PORT_DIPSETTING( 0x08, "1 Coin /50 Credits" ) @@ -347,7 +396,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x20, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) - PORT_START("DSW3") + PORT_START("DSW4") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -374,9 +423,154 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::irq_scanline) +static INPUT_PORTS_START( fever13 ) + PORT_INCLUDE( lastbank ) + + PORT_MODIFY("P1_KEY0") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY1") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY3") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY4") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) // "Right" + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) // "Left" + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("DSW1:1,2") + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "50" ) + PORT_DIPSETTING( 0x00, "90" ) + PORT_DIPNAME( 0x1c, 0x1c, "Win Percentage" ) PORT_DIPLOCATION("DSW1:3,4,5") + PORT_DIPSETTING( 0x1c, "95%" ) + PORT_DIPSETTING( 0x18, "90%" ) + PORT_DIPSETTING( 0x14, "85%" ) + PORT_DIPSETTING( 0x10, "80%" ) + PORT_DIPSETTING( 0x0c, "75%" ) + PORT_DIPSETTING( 0x08, "70%" ) + PORT_DIPSETTING( 0x04, "65%" ) + PORT_DIPSETTING( 0x00, "60%" ) + PORT_DIPNAME( 0x20, 0x20, "Hopper Motor" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Hopper Count" ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x40, "Sensor SW" ) + PORT_DIPSETTING( 0x00, "Micro SW" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x01, 0x00, "Payout calculation" ) PORT_DIPLOCATION("DSW2:1") // "% Calculate with" + PORT_DIPSETTING( 0x01, "Gambling" ) + PORT_DIPSETTING( 0x00, "Amusement" ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Difficulty" ) PORT_DIPLOCATION("DSW2:3,4") + PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x10, 0x10, "Double-Up Game" ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "L/R SW Reverse" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Auto Stop" ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Auto Start" ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_MODIFY("DSW3") + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:1,2,3,4") + PORT_DIPSETTING( 0x07, "1 Coin /100 Credits" ) + PORT_DIPSETTING( 0x08, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x09, "1 Coin /25 Credits" ) + PORT_DIPSETTING( 0x0a, "1 Coin /20 Credits" ) + PORT_DIPSETTING( 0x0b, "1 Coin /10 Credits" ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x01, "5 Coins /2 Credits" ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW3:5,6,7,8") + PORT_DIPSETTING( 0x70, "1 Coin /100 Credits" ) + PORT_DIPSETTING( 0x80, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x90, "1 Coin /25 Credits" ) + PORT_DIPSETTING( 0xa0, "1 Coin /20 Credits" ) + PORT_DIPSETTING( 0xb0, "1 Coin /10 Credits" ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x10, "5 Coins /2 Credits" ) + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + + PORT_MODIFY("DSW4") + PORT_DIPNAME( 0x07, 0x07, "Coin C" ) PORT_DIPLOCATION("DSW4:1,2,3") + PORT_DIPSETTING( 0x06, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x01, "9 Coins /1 Credit" ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + PORT_DIPNAME( 0x38, 0x38, "Credit Limit" ) PORT_DIPLOCATION("DSW4:4,5,6") // "Give Up" + PORT_DIPSETTING( 0x38, "1000" ) + PORT_DIPSETTING( 0x30, "3000" ) + PORT_DIPSETTING( 0x28, "5000" ) + PORT_DIPSETTING( 0x20, "10000" ) + PORT_DIPSETTING( 0x18, "20000" ) + PORT_DIPSETTING( 0x10, "30000" ) + PORT_DIPSETTING( 0x08, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + +TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::scanline_cb) { - int scanline = param; + int const scanline = param; if (scanline == 240 && (m_maincpu->irq_enable() & 4)) { @@ -391,23 +585,26 @@ TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::irq_scanline) void lastbank_state::lastbank(machine_config &config) { - /* basic machine hardware */ - TC0091LVC(config, m_maincpu, MASTER_CLOCK/4); //!!! TC0091LVC !!! - m_maincpu->set_addrmap(AS_PROGRAM, &lastbank_state::lastbank_map); + constexpr XTAL MASTER_CLOCK = 14.318181_MHz_XTAL; + + // NOTE: too slow with /4, cfr. animation of official ringing the bell during gameplay + TC0091LVC(config, m_maincpu, MASTER_CLOCK / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &lastbank_state::main_map); m_maincpu->set_tilemap_xoffs(0,192); // TODO: correct? - TIMER(config, "scantimer").configure_scanline(FUNC(lastbank_state::irq_scanline), "screen", 0, 1); + TIMER(config, "scantimer").configure_scanline(FUNC(lastbank_state::scanline_cb), "screen", 0, 1); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK/4)); - audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::lastbank_audio_map); - audiocpu.set_addrmap(AS_IO, &lastbank_state::lastbank_audio_io); - // yes, we have no interrupts + HOPPER(config, m_hopper, attotime::from_msec(50)); + + z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK / 4)); + audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::audio_map); + audiocpu.set_addrmap(AS_IO, &lastbank_state::audio_io); config.set_perfect_quantum(m_maincpu); - /* 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)); @@ -417,19 +614,19 @@ void lastbank_state::lastbank(machine_config &config) screen.screen_vblank().set(FUNC(lastbank_state::screen_vblank)); screen.set_palette("maincpu:palette"); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch1"); GENERIC_LATCH_8(config, "soundlatch2"); - OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.75); + OKIM6295(config, m_oki, 1_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.75); ES8712(config, m_essnd, 0); m_essnd->msm_write_handler().set("msm", FUNC(msm6585_device::data_w)); m_essnd->set_msm_tag("msm"); - msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL)); /* Not verified, It's actually MSM6585? */ + msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL)); msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int)); msm.set_prescaler_selector(msm6585_device::S40); /* Not verified */ msm.add_route(ALL_OUTPUTS, "mono", 0.50); @@ -459,11 +656,32 @@ ROM_START( lastbank ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "6.u55", 0x00000, 0x40000, CRC(9e78e234) SHA1(031f93e4bc338d0257fa673da7ce656bb1cda5fb) ) - ROM_REGION( 0x80000, "essnd", 0 ) /* Samples */ + ROM_REGION( 0x80000, "essnd", 0 ) // Samples ROM_LOAD( "7.u60", 0x00000, 0x80000, CRC(41be7146) SHA1(00f1c0d5809efccf888e27518a2a5876c4b633d8) ) ROM_END + // ES-9410 PCB (TC0090LVC marked ES9402LA, Z80, ES8712, 14'318'181 MHz XTAL, + // OKI M6295 with 1000J resonator, MSM6585 with 640J resonator) +ROM_START( fever13 ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD( "9.u9", 0x00000, 0x40000, CRC(a17a6a9c) SHA1(b2bff250d1ea879bcdd9bea92537975a168babc8) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "4.u48", 0x00000, 0x10000, CRC(33cba6b2) SHA1(cf7d1c7c6215b2f83c9266f92f46d3cfc0242afc) ) + + ROM_REGION( 0x120000, "maincpu:gfx", 0 ) + // unlabeled mask ROM, socket marked as 23C8000 CG ROM + ROM_LOAD( "u11", 0x000000, 0x100000, CRC(da59b0d8) SHA1(86fd3cd77aae22e103d11e697b8b4f70ae8b8197) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "es-9410.u55", 0x00000, 0x40000, CRC(09b5e4d6) SHA1(cf0235e9cf0577bf932beda7e4fb1b84410a3e0c) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x80000, "essnd", 0 ) // Samples + ROM_LOAD( "2.u60", 0x00000, 0x80000, CRC(4e0da568) SHA1(6cd4d3facf8f05747d6cff03617bdfc91b5e9d67) ) +ROM_END + } // Anonymous namespace -GAME( 1994, lastbank, 0, lastbank, lastbank, lastbank_state, empty_init, ROT0, "Excellent System", "Last Bank (v1.16)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, lastbank, 0, lastbank, lastbank, lastbank_state, empty_init, ROT0, "Excellent System", "Last Bank (v1.16)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, fever13, 0, lastbank, fever13, fever13_state, empty_init, ROT0, "Excellent System", "Fever 13 (Japan, v1.3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/excellent/witch.cpp b/src/mame/excellent/witch.cpp index 2b530f067fe49..cd2aa6cafd07c 100644 --- a/src/mame/excellent/witch.cpp +++ b/src/mame/excellent/witch.cpp @@ -1080,7 +1080,7 @@ void base_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // time between hopper pulses in milliseconds (not right for attendant pay) + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // time between hopper pulses in milliseconds (not right for attendant pay) // 82C255 (actual chip on PCB) is equivalent to two 8255s I8255(config, m_ppi[0]); diff --git a/src/mame/exidy/exidy.cpp b/src/mame/exidy/exidy.cpp index fc1fcc36fd0ee..5661ac7db5114 100644 --- a/src/mame/exidy/exidy.cpp +++ b/src/mame/exidy/exidy.cpp @@ -209,7 +209,7 @@ class exidy_state : public driver_device void mtrap(machine_config &config); void pepper2(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(intsource_coins_r); + ioport_value intsource_coins_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_count_w); protected: @@ -289,8 +289,8 @@ class spectar_state : public exidy_state void rallys(machine_config &config); void phantoma(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(spectar_coins_r); - DECLARE_CUSTOM_INPUT_MEMBER(rallys_coin1_r); + ioport_value spectar_coins_r(); + ioport_value rallys_coin1_r(); void init_sidetrac(); void init_spectar(); @@ -364,7 +364,7 @@ class teetert_state : public exidy_state void teetert(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(teetert_input_r); + ioport_value teetert_input_r(); protected: virtual void machine_start() override; @@ -404,26 +404,26 @@ class fax_state : public exidy_state * *************************************/ -CUSTOM_INPUT_MEMBER(exidy_state::intsource_coins_r) +ioport_value exidy_state::intsource_coins_r() { uint8_t const dsw = m_dsw->read(); uint8_t const in0 = m_in0->read(); return (BIT(~in0, 7) << 1) | BIT(dsw, 0); } -CUSTOM_INPUT_MEMBER(spectar_state::spectar_coins_r) +ioport_value spectar_state::spectar_coins_r() { uint8_t const dsw = m_dsw->read(); uint8_t const in0 = m_in0->read(); return (BIT(~in0, 7) << 1) | BIT(~dsw, 0); } -CUSTOM_INPUT_MEMBER(spectar_state::rallys_coin1_r) +ioport_value spectar_state::rallys_coin1_r() { return BIT(m_in0->read(), 7); } -CUSTOM_INPUT_MEMBER(teetert_state::teetert_input_r) +ioport_value teetert_state::teetert_input_r() { uint8_t const dial = m_dial->read(); diff --git a/src/mame/exidy/exidy440.cpp b/src/mame/exidy/exidy440.cpp index b7079b8ff6635..f1dae8d1210d0 100644 --- a/src/mame/exidy/exidy440.cpp +++ b/src/mame/exidy/exidy440.cpp @@ -280,7 +280,7 @@ int exidy440_state::firq_vblank_r() } -CUSTOM_INPUT_MEMBER(exidy440_state::hitnmiss_button1_r) +ioport_value exidy440_state::hitnmiss_button1_r() { /* button 1 shows up in two bits */ uint32_t button1 = ioport("HITNMISS_BUTTON1")->read(); diff --git a/src/mame/exidy/exidy440.h b/src/mame/exidy/exidy440.h index a2539969b5f4b..b22edbfa9b3eb 100644 --- a/src/mame/exidy/exidy440.h +++ b/src/mame/exidy/exidy440.h @@ -33,7 +33,7 @@ class exidy440_state : public driver_device int firq_beam_r(); int firq_vblank_r(); - DECLARE_CUSTOM_INPUT_MEMBER(hitnmiss_button1_r); + ioport_value hitnmiss_button1_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); void init_showdown(); void init_yukon(); diff --git a/src/mame/f32/f-32.cpp b/src/mame/f32/f-32.cpp index 52a9d3e208114..6546337b41bf0 100644 --- a/src/mame/f32/f-32.cpp +++ b/src/mame/f32/f-32.cpp @@ -114,8 +114,6 @@ class royalpk2_state : public fe132_state void royalpk2(machine_config &config); - int hopper_r(); - protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -313,7 +311,7 @@ static INPUT_PORTS_START( royalpk2 ) PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Medal Clear") PORT_CODE(KEYCODE_Y) PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Operator Gift") PORT_CODE(KEYCODE_U) - PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(royalpk2_state, hopper_r) + PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Over Flow") PORT_CODE(KEYCODE_O) PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Medal Empty") PORT_CODE(KEYCODE_L) @@ -338,11 +336,6 @@ void royalpk2_state::royalpk2_map(address_map &map) map(0xfff00000, 0xffffffff).rom().region("user1", 0); } -int royalpk2_state::hopper_r() -{ - return m_hopper->line_r() ? 0 : 1; -} - void royalpk2_state::royalpk2_io(address_map &map) { // map(0x4000, 0x41ff).readonly().share("nvram"); // seems to expect to read NVRAM from here @@ -477,7 +470,7 @@ void royalpk2_state::royalpk2(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/falco/falcots.cpp b/src/mame/falco/falcots.cpp index c91f91fc3ce90..863116ee14690 100644 --- a/src/mame/falco/falcots.cpp +++ b/src/mame/falco/falcots.cpp @@ -2,20 +2,25 @@ // copyright-holders:AJR /*************************************************************************** - Skeleton driver for Falco TS-series terminals. + Preliminary driver for Falco TS-series terminals. ***************************************************************************/ #include "emu.h" + +#include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" -//#include "bus/rs232/rs232.h" +#include "machine/input_merger.h" #include "machine/nvram.h" +#include "machine/ripple_counter.h" #include "machine/rstbuf.h" #include "machine/scn_pci.h" #include "machine/z80ctc.h" #include "machine/z80sio.h" +#include "sound/spkrdev.h" #include "video/mc6845.h" #include "screen.h" +#include "speaker.h" namespace { @@ -27,7 +32,10 @@ class falcots_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_rstbuf(*this, "rstbuf") + , m_lineint(*this, "lineint") + , m_bell(*this, "bell") , m_crtc(*this, "crtc") + , m_blinkcnt(*this, "blinkcnt") , m_vram(*this, "vram") , m_chargen(*this, "chargen") , m_keys(*this, "KEY%X", 0U) @@ -39,14 +47,26 @@ class falcots_state : public driver_device protected: virtual void machine_start() override; + virtual void machine_reset() override; private: + MC6845_UPDATE_ROW(ts1_update_row); MC6845_UPDATE_ROW(update_row); + void load_counters(); + void row_clock_w(int state); + void vsync_w(int state); + void bell_toggle_w(int state); u8 key_status_r(); void key_scan_w(u8 data); - void vram0_w(u8 data); - void vram1_w(u8 data); + void video_reset_w(u8 data); + void line_addr_upper_w(u8 data); + void line_addr_lower_w(u8 data); + void line_attr_w(u8 data); + void line_int_clear_w(u8 data); + void brightness_w(u8 data); + void bell_w(u8 data); + void control_w(u8 data); void mem_map(address_map &map); void io_map(address_map &map); @@ -55,22 +75,164 @@ class falcots_state : public driver_device required_device m_maincpu; optional_device m_rstbuf; + required_device m_lineint; + optional_device m_bell; required_device m_crtc; + required_device m_blinkcnt; required_shared_ptr m_vram; required_region_ptr m_chargen; optional_ioport_array<16> m_keys; + u16 m_line_addr_latch = 0; + u16 m_line_addr_base = 0; + u8 m_lines_left = 0; + u8 m_line_attr_latch = 0; + u8 m_line_attr = 0; + u8 m_brightness = 0; u8 m_key_scan = 0; + bool m_bell_toggle = false; }; void falcots_state::machine_start() { - m_key_scan = 0; + save_item(NAME(m_line_addr_latch)); + save_item(NAME(m_line_addr_base)); + save_item(NAME(m_lines_left)); + save_item(NAME(m_line_attr_latch)); + save_item(NAME(m_line_attr)); + save_item(NAME(m_brightness)); save_item(NAME(m_key_scan)); + if (!m_rstbuf.found()) + save_item(NAME(m_bell_toggle)); +} + +void falcots_state::machine_reset() +{ + control_w(0); +} + +MC6845_UPDATE_ROW(falcots_state::ts1_update_row) +{ + rgb_t fg(m_brightness, m_brightness, m_brightness); + u32 *pix = &bitmap.pix(y); + + if (BIT(m_line_attr, 5)) + x_count /= 2; + for (int x = 0; x < x_count; ++x) + { + u8 char_code = BIT(m_line_attr, 4) ? m_vram[(m_line_addr_base + x) & 0x7ff] : 0; + u8 attr_code = BIT(m_line_attr, 4) ? m_vram[0x800 + ((m_line_addr_base + x) & 0x7ff)] : 0; + + u8 dots = 0; + if (!BIT(attr_code, 5)) + { + if (!BIT(attr_code, 1) || !BIT(m_blinkcnt->count(), 4)) + dots = ~m_chargen[u16(char_code & 0x7f) << 4 | (m_line_attr & 0x0f)]; + if (BIT(attr_code, 0) && (m_line_attr & 0x0b) == 0x0b) + dots = ~dots; + if (BIT(attr_code, 2)) + dots = ~dots; + } + + for (int n = 8; n-- != 0; ) + { + *pix++ = BIT(dots, n) ? fg : rgb_t::black(); + if (BIT(m_line_attr, 5)) + *pix++ = BIT(dots, n) ? fg : rgb_t::black(); + } + } } MC6845_UPDATE_ROW(falcots_state::update_row) { + rgb_t fg(m_brightness, m_brightness, m_brightness); + u32 *pix = &bitmap.pix(y); + + if (!BIT(m_line_attr, 5)) + x_count *= 2; + for (int x = 0; x < x_count; ++x) + { + u8 char_code = BIT(m_line_attr, 4) ? m_vram[(m_line_addr_base + x) & 0x0fff] : 0; + u8 attr_code = BIT(m_line_attr, 4) ? m_vram[0x1000 + ((m_line_addr_base + x) & 0x0fff)] : 0; + + u8 dots = 0; + if (!BIT(attr_code, 5)) + { + if (!BIT(attr_code, 1) || !BIT(m_blinkcnt->count(), 4)) + dots = ~m_chargen[u16(attr_code & 0x18) << 8 | u16(char_code & 0x7f) << 4 | (m_line_attr & 0x0f)]; + if (BIT(attr_code, 0) && (m_line_attr & 0x0b) == 0x0b) + dots = ~dots; + if (BIT(attr_code, 2)) + dots = ~dots; + } + + for (int n = 8; n-- != 0; ) + { + *pix++ = BIT(dots, n) ? fg : rgb_t::black(); + if (BIT(m_line_attr, 5)) + *pix++ = BIT(dots, n) ? fg : rgb_t::black(); + } + } +} + +void falcots_state::load_counters() +{ + m_line_addr_base = m_line_addr_latch >> 4; + if (m_rstbuf.found()) + m_lines_left = ((m_line_attr_latch & 0x0f) >= 0x0c ? 0x0f : 0x0b) - (m_line_attr_latch & 0x0f); + else + m_lines_left = ~m_line_addr_latch & 0x000f; + if (m_rstbuf.found() && BIT(m_line_attr_latch, 6)) + m_line_attr = (m_line_attr_latch & 0xf0) | (m_line_attr & 0x0f); + else + m_line_attr = m_line_attr_latch; +} + +void falcots_state::row_clock_w(int state) +{ + if (state) + { + if (m_lines_left == 0) + m_lineint->in_w<1>(1); + } + else + { + if (m_lines_left == 0) + load_counters(); + else + { + --m_lines_left; + if (BIT(m_line_attr, 7) != m_rstbuf.found()) + m_line_attr = (m_line_attr & 0xf0) | ((m_line_attr + 1) & 0x0f); + if (BIT(m_line_attr, 6)) + m_line_attr ^= 0x80; + } + if (!m_rstbuf.found()) + m_lineint->in_w<1>(0); + } +} + +void falcots_state::vsync_w(int state) +{ + if (state) + { + m_lineint->in_w<1>(1); + } + else + { + if (!m_rstbuf.found()) + m_lineint->in_w<1>(0); + load_counters(); + } +} + +void falcots_state::bell_toggle_w(int state) +{ + if (state) + { + m_bell_toggle = !m_bell_toggle; + m_bell->level_w(m_bell_toggle); + } } u8 falcots_state::key_status_r() @@ -79,7 +241,7 @@ u8 falcots_state::key_status_r() u8 i = (m_key_scan & 0x70) >> 4; u8 j = m_key_scan & 0x0f; - if (BIT(m_keys[j].read_safe(0xff), i) == BIT(m_key_scan, 7)) + if (!BIT(m_keys[j].read_safe(0xff), i)) status |= 0x01; return status; @@ -92,28 +254,67 @@ void falcots_state::key_scan_w(u8 data) m_key_scan = data; } -void falcots_state::vram0_w(u8 data) +void falcots_state::video_reset_w(u8 data) +{ + m_line_addr_latch = 0; + m_line_attr_latch = 0; +} + +void falcots_state::line_addr_upper_w(u8 data) +{ + m_line_addr_latch = u16(data) << 8 | (m_line_addr_latch & 0x00ff); +} + +void falcots_state::line_addr_lower_w(u8 data) +{ + m_line_addr_latch = (m_line_addr_latch & 0xff00) | data; +} + +void falcots_state::line_attr_w(u8 data) +{ + m_line_attr_latch = data; +} + +void falcots_state::line_int_clear_w(u8 data) +{ + m_lineint->in_w<1>(0); +} + +void falcots_state::brightness_w(u8 data) +{ + m_brightness = data; +} + +void falcots_state::bell_w(u8 data) { + // TODO + logerror("%s: Bell triggered\n", machine().describe_context()); } -void falcots_state::vram1_w(u8 data) +void falcots_state::control_w(u8 data) { + m_lineint->in_w<0>(BIT(data, 0)); } void falcots_state::ts1_mem_map(address_map &map) { map(0x0000, 0x1fff).rom().region("maincpu", 0); - map(0x8000, 0xbfff).ram().share("vram"); // 8x NEC D416C + map(0x8000, 0xbfff).ram(); // 8x NEC D416C map(0xec00, 0xefff).ram().share("nvram"); - map(0xf000, 0xffff).ram(); // 6x(!?) AM9114EPC + map(0xf000, 0xffff).ram().share("vram"); // 6x(!?) AM9114EPC } void falcots_state::ts1_io_map(address_map &map) { map.global_mask(0xff); + map(0xe0, 0xe0).w(FUNC(falcots_state::video_reset_w)); map(0xe1, 0xe1).w(FUNC(falcots_state::key_scan_w)); - map(0xe2, 0xe2).w(FUNC(falcots_state::vram0_w)); - map(0xe4, 0xe4).w(FUNC(falcots_state::vram1_w)); + map(0xe2, 0xe2).w(FUNC(falcots_state::line_addr_upper_w)); + map(0xe3, 0xe3).w(FUNC(falcots_state::brightness_w)); + map(0xe4, 0xe4).w(FUNC(falcots_state::line_attr_w)); + map(0xe5, 0xe5).w(FUNC(falcots_state::line_int_clear_w)); + map(0xe6, 0xe6).w(FUNC(falcots_state::bell_w)); + map(0xe7, 0xe7).w(FUNC(falcots_state::control_w)); map(0xe8, 0xe8).r(FUNC(falcots_state::key_status_r)); map(0xf0, 0xf0).w(m_crtc, FUNC(mc6845_device::address_w)); map(0xf1, 0xf1).w(m_crtc, FUNC(mc6845_device::register_w)); @@ -125,19 +326,24 @@ void falcots_state::mem_map(address_map &map) { map(0x0000, 0x7fff).rom().region("maincpu", 0); map(0x8000, 0x87ff).ram().share("nvram"); - map(0xa000, 0xbfff).ram(); // 4x HM6116P-3 - map(0xc000, 0xffff).ram().share("vram"); // 8x AM9016EPC (4116) + map(0xa000, 0xbfff).ram().share("vram"); // 4x HM6116P-3 + map(0xc000, 0xffff).ram(); // 8x AM9016EPC (4116) } void falcots_state::io_map(address_map &map) { map.global_mask(0xff); map(0xe0, 0xe0).r(FUNC(falcots_state::key_status_r)); + map(0xe0, 0xe0).w(FUNC(falcots_state::video_reset_w)); map(0xe1, 0xe1).w(FUNC(falcots_state::key_scan_w)); - map(0xe2, 0xe2).w(FUNC(falcots_state::vram0_w)); - map(0xe4, 0xe4).w(FUNC(falcots_state::vram1_w)); + map(0xe2, 0xe2).w(FUNC(falcots_state::line_addr_upper_w)); + map(0xe3, 0xe3).w(FUNC(falcots_state::brightness_w)); + map(0xe4, 0xe4).w(FUNC(falcots_state::line_attr_w)); + map(0xe5, 0xe5).w(FUNC(falcots_state::line_addr_lower_w)); + map(0xe7, 0xe7).w(FUNC(falcots_state::control_w)); map(0xe8, 0xe8).w(m_crtc, FUNC(mc6845_device::address_w)); map(0xe9, 0xe9).w(m_crtc, FUNC(mc6845_device::register_w)); + map(0xeb, 0xeb).r(m_crtc, FUNC(mc6845_device::register_r)); map(0xf0, 0xf3).rw("dart", FUNC(z80dart_device::ba_cd_r), FUNC(z80dart_device::ba_cd_w)); map(0xf8, 0xfb).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); } @@ -374,22 +580,39 @@ void falcots_state::ts1(machine_config &config) m_maincpu->set_irq_acknowledge_callback("rstbuf", FUNC(rst_pos_buffer_device::inta_cb)); RST_POS_BUFFER(config, m_rstbuf).int_callback().set_inputline(m_maincpu, 0); + INPUT_MERGER_ALL_HIGH(config, m_lineint).output_handler().set(m_rstbuf, FUNC(rst_pos_buffer_device::rst4_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 2x NEC D444C + battery? scn2651_device &pci(SCN2651(config, "pci", 15.2064_MHz_XTAL / 3)); // SCN2651N + pci.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + pci.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); + pci.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); pci.txrdy_handler().set(m_rstbuf, FUNC(rst_pos_buffer_device::rst1_w)); pci.rxrdy_handler().set(m_rstbuf, FUNC(rst_pos_buffer_device::rst2_w)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(15.2064_MHz_XTAL, 792, 0, 640, 320, 0, 300); - screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); + screen.set_screen_update(m_crtc, FUNC(mc6845_device::screen_update)); + screen.set_video_attributes(VIDEO_UPDATE_SCANLINE); MC6845(config, m_crtc, 15.2064_MHz_XTAL / 8); // MC6845P m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); - m_crtc->set_update_row_callback(FUNC(falcots_state::update_row)); + m_crtc->set_update_row_callback(FUNC(falcots_state::ts1_update_row)); + m_crtc->out_de_callback().set(FUNC(falcots_state::row_clock_w)); + m_crtc->out_vsync_callback().set(FUNC(falcots_state::vsync_w)); + m_crtc->out_vsync_callback().append(m_blinkcnt, FUNC(ripple_counter_device::clock_w)).invert(); + + RIPPLE_COUNTER(config, m_blinkcnt).set_stages(5); + + // TODO: actually has two RS-232C ports (A & B) + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "loopback")); + rs232.rxd_handler().set("pci", FUNC(scn2651_device::rxd_w)); + rs232.cts_handler().set("pci", FUNC(scn2651_device::cts_w)); + rs232.dcd_handler().set("pci", FUNC(scn2651_device::dcd_w)); + rs232.dsr_handler().set("pci", FUNC(scn2651_device::dsr_w)); } static const z80_daisy_config daisy_chain[] = @@ -406,29 +629,57 @@ void falcots_state::ts2624(machine_config &config) m_maincpu->set_addrmap(AS_IO, &falcots_state::io_map); m_maincpu->set_daisy_config(daisy_chain); + INPUT_MERGER_ALL_HIGH(config, m_lineint).output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // HM6116LP-4 + battery z80ctc_device &ctc(Z80CTC(config, "ctc", 14.7456_MHz_XTAL / 4)); // Z8430AB1 ctc.set_clk<0>(14.7456_MHz_XTAL / 16); ctc.set_clk<1>(14.7456_MHz_XTAL / 16); ctc.zc_callback<0>().set("dart", FUNC(z80dart_device::rxca_w)); - ctc.zc_callback<1>().set("dart", FUNC(z80dart_device::txca_w)); - ctc.zc_callback<2>().set("dart", FUNC(z80dart_device::rxtxcb_w)); + ctc.zc_callback<0>().append("dart", FUNC(z80dart_device::txca_w)); + ctc.zc_callback<1>().set("dart", FUNC(z80dart_device::rxtxcb_w)); + ctc.zc_callback<2>().set(FUNC(falcots_state::bell_toggle_w)); ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); z80dart_device &dart(Z80DART(config, "dart", 14.7456_MHz_XTAL / 4)); // Z8470AB1 dart.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + dart.out_txda_callback().set("rs232a", FUNC(rs232_port_device::write_txd)); + dart.out_dtra_callback().set("rs232a", FUNC(rs232_port_device::write_dtr)); + dart.out_rtsa_callback().set("rs232a", FUNC(rs232_port_device::write_rts)); + dart.out_txdb_callback().set("rs232b", FUNC(rs232_port_device::write_txd)); + dart.out_dtrb_callback().set("rs232b", FUNC(rs232_port_device::write_dtr)); + dart.out_rtsb_callback().set("rs232b", FUNC(rs232_port_device::write_rts)); + + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_bell).add_route(ALL_OUTPUTS, "mono", 0.05); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(14.7456_MHz_XTAL, 768, 0, 640, 320, 0, 286); //screen.set_raw(23.9616_MHz_XTAL, 1248, 0, 1056, 320, 0, 286); screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); + screen.set_video_attributes(VIDEO_UPDATE_SCANLINE); MC6845(config, m_crtc, 14.7456_MHz_XTAL / 16); m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(16); m_crtc->set_update_row_callback(FUNC(falcots_state::update_row)); + m_crtc->out_de_callback().set(FUNC(falcots_state::row_clock_w)); + m_crtc->out_vsync_callback().set(FUNC(falcots_state::vsync_w)); + m_crtc->out_vsync_callback().append(m_blinkcnt, FUNC(ripple_counter_device::clock_w)).invert(); + + RIPPLE_COUNTER(config, m_blinkcnt).set_stages(5); // 1/2 74LS393 + 1/2 74LS74 + + rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, nullptr)); + rs232a.rxd_handler().set("dart", FUNC(z80dart_device::rxa_w)); + rs232a.cts_handler().set("dart", FUNC(z80dart_device::ctsa_w)); + rs232a.dcd_handler().set("dart", FUNC(z80dart_device::dcda_w)); + + rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr)); + rs232b.rxd_handler().set("dart", FUNC(z80dart_device::rxb_w)); + rs232b.cts_handler().set("dart", FUNC(z80dart_device::ctsb_w)); + rs232b.dcd_handler().set("dart", FUNC(z80dart_device::dcdb_w)); } ROM_START(ts1) @@ -459,5 +710,5 @@ ROM_END } // anonymous namespace -COMP(1980, ts1, 0, 0, ts1, ts1, falcots_state, empty_init, "Falco Data Products", "TS-1 (v2.13.0)", MACHINE_IS_SKELETON) -COMP(1982, ts2624, 0, 0, ts2624, ts2624, falcots_state, empty_init, "Falco Data Products", "TS-2624", MACHINE_IS_SKELETON) +COMP(1980, ts1, 0, 0, ts1, ts1, falcots_state, empty_init, "Falco Data Products", "TS-1 (v2.13.0)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) +COMP(1982, ts2624, 0, 0, ts2624, ts2624, falcots_state, empty_init, "Falco Data Products", "TS-2624", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS) diff --git a/src/mame/fidelity/card.cpp b/src/mame/fidelity/card.cpp index 85ef5fe7ad451..3d03ae9a34e89 100644 --- a/src/mame/fidelity/card.cpp +++ b/src/mame/fidelity/card.cpp @@ -41,7 +41,7 @@ added. RE notes by Kevin Horton This unit is similar in construction kinda to the chess challengers, however it -has an 8041 which does ALL of the system I/O. The Z80 has NO IO AT ALL other than +has an 8041 which does ALL of the system I/O. The Z80 has NO IO AT ALL other than what is performed through the 8041! The main CPU is a Z80 running at 2.5MHz @@ -61,10 +61,10 @@ Memory Map: 8000-DFFF: unused E000-FFFF: write to TSI chip -NOTE: when the TSI chip is written to, the CPU IS STOPPED. The CPU will run again -when the word is done being spoken. This is because D0-D5 run to the TSI chip directly. +NOTE: when the TSI chip is written to, the CPU IS STOPPED. The CPU will run again +when the word is done being spoken. This is because D0-D5 run to the TSI chip directly. -The TSI chip's ROM is 4K, and is marked 101-32118. The clock is the same as the Chess +The TSI chip's ROM is 4K, and is marked 101-32118. The clock is the same as the Chess Challengers- 470K/100pf which gives a frequency around 25KHz or so. Port Map: @@ -115,7 +115,7 @@ P6.1 - segment B P6.2 - segment F P6.3 - segment G -P7.0 - LED enable (high = LEDs can be lit. low = LEDs will not light) +P7.0 - LED enable (high = LEDs can be lit. low = LEDs will not light) P7.1 - goes through inverter, to pads that are not used P7.2 - segment C P7.3 - segment H @@ -155,7 +155,7 @@ E* * * * *C D The digits of the display are numbered left to right, 0 through 7 and are controlled -by the grids. hi = grid on, hi = segment on. +by the grids. hi = grid on, hi = segment on. A detailed description of the hardware can be found also in the patent 4,373,719. diff --git a/src/mame/fidelity/chesster.cpp b/src/mame/fidelity/chesster.cpp index bafe57d1bd35e..ae6f9b6f671f8 100644 --- a/src/mame/fidelity/chesster.cpp +++ b/src/mame/fidelity/chesster.cpp @@ -62,7 +62,7 @@ class chesster_state : public driver_device protected: virtual void machine_start() override; - virtual void machine_reset() override; + virtual void machine_reset() override { m_dac->write(0x80); } private: // devices/pointers @@ -95,11 +95,6 @@ void chesster_state::machine_start() save_item(NAME(m_select)); } -void chesster_state::machine_reset() -{ - m_dac->write(0x80); -} - /******************************************************************************* diff --git a/src/mame/fidelity/clockdiv.cpp b/src/mame/fidelity/clockdiv.cpp index d6050baf486bf..c2f2e13ef40de 100644 --- a/src/mame/fidelity/clockdiv.cpp +++ b/src/mame/fidelity/clockdiv.cpp @@ -1,13 +1,13 @@ // license:BSD-3-Clause // copyright-holders:hap -/******************************************************************************* +/* Fidelity Electronics 6502 dynamic CPU clock divider Offset-dependent CPU clock divider base class. Used to compensate slow memory chips in chess computer models: SC12, AS12, PC, EAS, EAG. -*******************************************************************************/ +*/ #include "emu.h" #include "clockdiv.h" diff --git a/src/mame/fidelity/csc.cpp b/src/mame/fidelity/csc.cpp index 8d07839fa2fbc..5266844c44ae5 100644 --- a/src/mame/fidelity/csc.cpp +++ b/src/mame/fidelity/csc.cpp @@ -506,7 +506,7 @@ void csc_state::csce_map(address_map &map) map.unmap_value_high(); map(0x0000, 0x0fff).ram(); map(0x1000, 0x1003).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0x1800, 0x1803).w(m_pia[0], FUNC(pia6821_device::write)).r(FUNC(csc_state::pia0_read)); + map(0x1800, 0x1803).rw(FUNC(csc_state::pia0_read), FUNC(csc_state::pia0_write)); map(0x2000, 0x3fff).rom(); map(0xa000, 0xffff).rom(); } @@ -515,7 +515,7 @@ void csc_state::rsc_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x03ff).ram(); - map(0x2000, 0x2003).w(m_pia[0], FUNC(pia6821_device::write)).r(FUNC(csc_state::pia0_read)); + map(0x2000, 0x2003).rw(FUNC(csc_state::pia0_read), FUNC(csc_state::pia0_write)); map(0xf000, 0xffff).rom(); } diff --git a/src/mame/fidelity/eldorado.cpp b/src/mame/fidelity/eldorado.cpp index 12edf1f7b9266..9588b70e0230e 100644 --- a/src/mame/fidelity/eldorado.cpp +++ b/src/mame/fidelity/eldorado.cpp @@ -42,7 +42,6 @@ class eldorado_state : public driver_device m_inputs(*this, "IN.0") { } - // machine configs void eldorado(machine_config &config); protected: @@ -57,15 +56,12 @@ class eldorado_state : public driver_device required_ioport m_inputs; bool m_kp_select = false; - u16 m_inp_mux = 0; - u8 m_led_select = 0; + u8 m_inp_mux = 0; // I/O handlers - void update_display(); void mux_w(u8 data); u8 mux_r(); void control_w(u8 data); - int t0_r(); u8 input_r(); }; @@ -74,7 +70,6 @@ void eldorado_state::machine_start() // register for savestates save_item(NAME(m_kp_select)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } @@ -83,16 +78,11 @@ void eldorado_state::machine_start() I/O *******************************************************************************/ -void eldorado_state::update_display() -{ - m_display->matrix(m_led_select, m_inp_mux); -} - void eldorado_state::mux_w(u8 data) { // D0-D7: input mux, led data m_inp_mux = ~data; - update_display(); + m_display->write_mx(m_inp_mux); } u8 eldorado_state::mux_r() @@ -106,24 +96,17 @@ void eldorado_state::control_w(u8 data) m_dac->write(BIT(~data, 4)); // P25,P26: led select - m_led_select = ~data >> 5 & 3; - update_display(); + m_display->write_my(~data >> 5 & 3); - // P27: keypad select + // P27: input mux highest bit (also goes to T0) m_kp_select = !bool(data & 0x80); } -int eldorado_state::t0_r() -{ - // T0: P27 - return m_kp_select ? 0 : 1; -} - u8 eldorado_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard buttons for (int i = 0; i < 8; i++) if (BIT(m_inp_mux, i)) @@ -168,7 +151,7 @@ void eldorado_state::eldorado(machine_config &config) m_maincpu->p2_out_cb().set(FUNC(eldorado_state::control_w)); m_maincpu->bus_in_cb().set(FUNC(eldorado_state::mux_r)); m_maincpu->bus_out_cb().set(FUNC(eldorado_state::mux_w)); - m_maincpu->t0_in_cb().set(FUNC(eldorado_state::t0_r)); + m_maincpu->t0_in_cb().set(m_maincpu, FUNC(mcs48_cpu_device::p2_r)).bit(7); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); diff --git a/src/mame/fidelity/elite.cpp b/src/mame/fidelity/elite.cpp index b7bca3628a60c..56d7bbd6bcd5c 100644 --- a/src/mame/fidelity/elite.cpp +++ b/src/mame/fidelity/elite.cpp @@ -167,6 +167,12 @@ class elite_state : public fidel_clockdiv_state void ppi_portc_w(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void elite_state::machine_start() { fidel_clockdiv_state::machine_start(); @@ -617,7 +623,7 @@ ROM_START( feasbua ) // model EWC ROM_CONTINUE( 0xd000, 0x0800 ) ROM_CONTINUE( 0xc800, 0x0800 ) ROM_CONTINUE( 0xd800, 0x0800 ) - ROM_LOAD("green", 0xe000, 0x0800, CRC(c7bbfbbe) SHA1(63fe13d0e64d1e5c1ea1b4de13ac3e753797a992) ) // M5L2764K - only 4 bytes different to feasbu (after descramble) + ROM_LOAD("green", 0xe000, 0x0800, CRC(c7bbfbbe) SHA1(63fe13d0e64d1e5c1ea1b4de13ac3e753797a992) ) // M5L2764K - only 4 bytes different from feasbu (after descramble) ROM_CONTINUE( 0xf000, 0x0800 ) ROM_CONTINUE( 0xe800, 0x0800 ) ROM_CONTINUE( 0xf800, 0x0800 ) @@ -685,7 +691,7 @@ ROM_START( feasglaa ) // model EAS-C ROM_CONTINUE( 0x9000, 0x0800 ) ROM_CONTINUE( 0x8800, 0x0800 ) ROM_CONTINUE( 0x9800, 0x0800 ) - ROM_LOAD("black", 0xc000, 0x0800, CRC(3f0b01b6) SHA1(fe8d214f1678e000ba945e2f6dc3438af97c6f33) ) // only 2 bytes different to feasgla + ROM_LOAD("black", 0xc000, 0x0800, CRC(3f0b01b6) SHA1(fe8d214f1678e000ba945e2f6dc3438af97c6f33) ) // only 2 bytes different from feasgla ROM_CONTINUE( 0xd000, 0x0800 ) ROM_CONTINUE( 0xc800, 0x0800 ) ROM_CONTINUE( 0xd800, 0x0800 ) diff --git a/src/mame/fidelity/msc.cpp b/src/mame/fidelity/msc.cpp index 25d19ad45d62d..1aba1a76e75ec 100644 --- a/src/mame/fidelity/msc.cpp +++ b/src/mame/fidelity/msc.cpp @@ -27,12 +27,12 @@ and one for MCS48. A12 is forced high or low to select the bank. #include "emu.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "cpu/z8/z8.h" #include "machine/sensorboard.h" #include "sound/dac.h" #include "video/pwm.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" #include "softlist_dev.h" #include "speaker.h" @@ -55,7 +55,6 @@ class msc_state : public driver_device m_inputs(*this, "IN.0") { } - // machine configs void msc(machine_config &config); protected: @@ -72,18 +71,13 @@ class msc_state : public driver_device u8 m_led_select = 0; u16 m_inp_mux = 0; - // address maps void main_map(address_map &map); // I/O handlers void update_display(); void mux_w(u8 data); void control_w(u8 data); - u8 rom_r(offs_t offset); - - u8 read_inputs(); - u8 input_hi_r(); - u8 input_lo_r(); + u8 input_r(); }; void msc_state::machine_start() @@ -113,18 +107,20 @@ void msc_state::mux_w(u8 data) void msc_state::control_w(u8 data) { - // P37: input mux highest bit + // P34: speaker out + m_dac->write(BIT(~data, 4)); + // P35,P36: led select - m_inp_mux = (m_inp_mux & 0xff) | (data << 1 & 0x100); m_led_select = ~data >> 5 & 3; - update_display(); - // P34: speaker out - m_dac->write(BIT(~data, 4)); + // P37: input mux highest bit, led data + m_inp_mux = (m_inp_mux & 0xff) | (data << 1 & 0x100); + update_display(); } -u8 msc_state::read_inputs() +u8 msc_state::input_r() { + // P30-P33,P04-P07: multiplexed inputs u8 data = 0; // read chessboard sensors @@ -139,18 +135,6 @@ u8 msc_state::read_inputs() return bitswap<8>(~data,0,1,2,3,4,5,6,7); } -u8 msc_state::input_hi_r() -{ - // P04-P07: multiplexed inputs high - return read_inputs() | 0x0f; -} - -u8 msc_state::input_lo_r() -{ - // P30-P33: multiplexed inputs low - return read_inputs() | 0xf0; -} - /******************************************************************************* @@ -191,9 +175,11 @@ void msc_state::msc(machine_config &config) // basic machine hardware Z8601(config, m_maincpu, 8_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &msc_state::main_map); - m_maincpu->p0_in_cb().set(FUNC(msc_state::input_hi_r)); + m_maincpu->p0_in_cb().set(FUNC(msc_state::input_r)).mask(0xf0); + m_maincpu->p0_in_cb().append_constant(0x0f).mask(0x0f); m_maincpu->p2_out_cb().set(FUNC(msc_state::mux_w)); - m_maincpu->p3_in_cb().set(FUNC(msc_state::input_lo_r)); + m_maincpu->p3_in_cb().set(FUNC(msc_state::input_r)).mask(0x0f); + m_maincpu->p3_in_cb().append_constant(0xf0).mask(0xf0); m_maincpu->p3_out_cb().set(FUNC(msc_state::control_w)); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); diff --git a/src/mame/fidelity/sc6.cpp b/src/mame/fidelity/sc6.cpp index 74f05aad47e37..e03b74d544f85 100644 --- a/src/mame/fidelity/sc6.cpp +++ b/src/mame/fidelity/sc6.cpp @@ -5,7 +5,7 @@ Fidelity Sensory Chess Challenger 6 (model SC6) Fidelity Mini Sensory Chess Challenger (model MSC, 1982 version) -Fidelity The Classic (model 6079) +Fidelity The Classic (model CC8/6079) Fidelity Gambit Voice (model 6085) The chess engine is by Ron Nelson. These are all on similar hardware. Several @@ -22,7 +22,7 @@ Known MCU ROM serials: 100-1020B01 ROM contents is confirmed to be identical to 100-1020B02. TODO: -- is The Classic model CC8 a different ROM? and what about model 6079D? +- is The Classic model 6079D a different ROM? ================================================================================ @@ -132,7 +132,6 @@ class sc6_state : public driver_device { } // machine configs - template void cpu_config(T &maincpu); void shared(machine_config &config); void sc6(machine_config &config); void msc(machine_config &config); @@ -198,11 +197,12 @@ void sc6_state::mux_w(u8 data) // P24-P27: 7442 A-D (or 74145) // 7442 0-8: input mux, led data m_inp_mux = data >> 4 & 0xf; - m_display->write_mx(1 << m_inp_mux); + u16 sel = 1 << m_inp_mux; + m_display->write_mx(sel); // 7442 9: speaker out if (m_dac != nullptr) - m_dac->write(BIT(1 << m_inp_mux, 9)); + m_dac->write(BIT(sel, 9)); } void sc6_state::select_w(u8 data) @@ -319,20 +319,16 @@ INPUT_PORTS_END Machine Configs *******************************************************************************/ -template -void sc6_state::cpu_config(T &maincpu) -{ - maincpu.p1_in_cb().set(FUNC(sc6_state::input_r)).mask(0x3f); - maincpu.p1_in_cb().append_constant(0xc0).mask(0xc0); - maincpu.p1_out_cb().set(FUNC(sc6_state::select_w)); - maincpu.p2_out_cb().set(FUNC(sc6_state::mux_w)); - maincpu.t0_in_cb().set(FUNC(sc6_state::input_r)).bit(6); - maincpu.t1_in_cb().set(FUNC(sc6_state::input_r)).bit(7); -} - void sc6_state::shared(machine_config &config) { // basic machine hardware + m_maincpu->p1_in_cb().set(FUNC(sc6_state::input_r)).mask(0x3f); + m_maincpu->p1_in_cb().append_constant(0xc0).mask(0xc0); + m_maincpu->p1_out_cb().set(FUNC(sc6_state::select_w)); + m_maincpu->p2_out_cb().set(FUNC(sc6_state::mux_w)); + m_maincpu->t0_in_cb().set(FUNC(sc6_state::input_r)).bit(6); + m_maincpu->t1_in_cb().set(FUNC(sc6_state::input_r)).bit(7); + 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)); @@ -349,8 +345,6 @@ void sc6_state::sc6(machine_config &config) { I8040(config, m_maincpu, 11_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &sc6_state::sc6_map); - cpu_config(downcast(*m_maincpu)); - shared(config); // video hardware @@ -366,8 +360,6 @@ void sc6_state::msc(machine_config &config) { I8049(config, m_maincpu, 11_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &sc6_state::msc_map); - cpu_config(downcast(*m_maincpu)); - shared(config); config.set_default_layout(layout_fidel_msc_v2); @@ -380,8 +372,6 @@ void sc6_state::msc(machine_config &config) void sc6_state::classic(machine_config &config) { I8050(config, m_maincpu, 6_MHz_XTAL); - cpu_config(downcast(*m_maincpu)); - shared(config); config.set_default_layout(layout_fidel_classic); @@ -425,6 +415,11 @@ ROM_START( classic ) ROM_LOAD("tmp80c50ap-6-9311_100-1020b02.ic1", 0x0000, 0x1000, CRC(ba41b5ba) SHA1(1a5c5b2e990a07b9ff51eecfa952a4b890107797) ) ROM_END +ROM_START( classica ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD("tmp80c50ap-6_9517.ic1", 0x0000, 0x1000, CRC(dfd30755) SHA1(92075c7df9205b9647801487b9bbddcf230dfc91) ) +ROM_END + ROM_START( gambitv ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD("tmp80c50ap-6-9337_100-1020c01.ic1", 0x0000, 0x1000, CRC(dafee386) SHA1(d67914fb2abd73c0068b7e61fc23d211c52d65d9) ) @@ -452,10 +447,11 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1982, fscc6, 0, 0, sc6, sc6, sc6_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger \"6\"", MACHINE_SUPPORTS_SAVE ) -SYST( 1982, miniscc, 0, 0, msc, msc, sc6_state, empty_init, "Fidelity Electronics", "Mini Sensory Chess Challenger (MCS-48 version)", MACHINE_SUPPORTS_SAVE ) // aka "Mini Sensory II" +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1982, fscc6, 0, 0, sc6, sc6, sc6_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger \"6\"", MACHINE_SUPPORTS_SAVE ) +SYST( 1982, miniscc, 0, 0, msc, msc, sc6_state, empty_init, "Fidelity Electronics", "Mini Sensory Chess Challenger (MCS-48 version)", MACHINE_SUPPORTS_SAVE ) // aka "Mini Sensory II" -SYST( 1986, classic, 0, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model 6079)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, classic, 0, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model 6079)", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, classica, classic, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model CC8)", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, gambitv, 0, 0, gambitv, gambitv, sc6_state, empty_init, "Fidelity International", "Gambit Voice", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, gambitv, 0, 0, gambitv, gambitv, sc6_state, empty_init, "Fidelity International", "Gambit Voice", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/fidelity/sc8.cpp b/src/mame/fidelity/sc8.cpp index 50dfdc5b64b0a..017da0632ba71 100644 --- a/src/mame/fidelity/sc8.cpp +++ b/src/mame/fidelity/sc8.cpp @@ -94,19 +94,21 @@ void scc_state::control_w(offs_t offset, u8 data) u8 mask = 1 << (offset & 7); m_led_data = (m_led_data & ~mask) | ((data & 0x80) ? mask : 0); - // d0-d3: led select, input mux (row 9 is speaker out) + // d0-d3: 7442 to led select, input mux // d4: corner led(direct) m_inp_mux = data & 0xf; u16 sel = 1 << m_inp_mux; - m_dac->write(BIT(sel, 9)); m_display->matrix((sel & 0xff) | (data << 4 & 0x100), m_led_data); + + // 7442 9: speaker out + m_dac->write(BIT(sel, 9)); } u8 scc_state::input_r() { + // d0-d7: multiplexed inputs (active low) u8 data = 0; - // d0-d7: multiplexed inputs (active low) // read chessboard sensors if (m_inp_mux < 8) data = m_board->read_file(m_inp_mux); diff --git a/src/mame/fidelity/sc9.cpp b/src/mame/fidelity/sc9.cpp index 4542bd4ad24d1..f1ec5b9644e74 100644 --- a/src/mame/fidelity/sc9.cpp +++ b/src/mame/fidelity/sc9.cpp @@ -102,7 +102,6 @@ class sc9_state : public driver_device void sc9d_map(address_map &map); // I/O handlers - void update_display(); void control_w(u8 data); void led_w(offs_t offset, u8 data); u8 input_r(); @@ -129,21 +128,16 @@ INPUT_CHANGED_MEMBER(sc9_state::sc9c_change_cpu_freq) I/O *******************************************************************************/ -void sc9_state::update_display() -{ - // 8*8 chessboard leds + 1 corner led - m_display->matrix(1 << m_inp_mux, m_led_data); -} - void sc9_state::control_w(u8 data) { // d0-d3: 74245 P0-P3 // 74245 Q0-Q8: input mux, led select m_inp_mux = data & 0xf; - update_display(); + u16 sel = 1 << m_inp_mux; + m_display->write_my(sel); // 74245 Q9: speaker out - m_dac->write(BIT(1 << m_inp_mux, 9)); + m_dac->write(BIT(sel, 9)); // d4,d5: ? // d6,d7: N/C @@ -153,14 +147,14 @@ void sc9_state::led_w(offs_t offset, u8 data) { // a0-a2,d0: led data via NE591N m_led_data = (m_led_data & ~(1 << offset)) | ((data & 1) << offset); - update_display(); + m_display->write_mx(m_led_data); } u8 sc9_state::input_r() { + // d0-d7: multiplexed inputs (active low) u8 data = 0; - // d0-d7: multiplexed inputs (active low) // read chessboard sensors if (m_inp_mux < 8) data = m_board->read_file(m_inp_mux); diff --git a/src/mame/fidelity/vcc.cpp b/src/mame/fidelity/vcc.cpp index b3bedcc816bf4..eaad46376cca5 100644 --- a/src/mame/fidelity/vcc.cpp +++ b/src/mame/fidelity/vcc.cpp @@ -12,21 +12,35 @@ Grandmaster and FCC are verified to be the same PCB + ROMs as UVC. So even thoug they have a large wooden chessboard attached instead of a small plastic one, from MAME's perspective there's nothing to emulate on top of UVC. +TODO: +- add low-pass filters to sound? but when using flt_rc, it does not sound like + recordings from a real VCC, maybe use a netlist or is it overkill? (same goes + for newer Fidelity chess computers with this speech chip) + +BTANB: +- with the English voice ROM, the letter D is barely distinguishable from E, + Fidelity never updated the ROM later, and it sounds fine with other languages + ================================================================================ RE notes by Kevin Horton -The CPU is a Z80 running at 4MHz. The TSI chip runs at around 25KHz, using a -470K / 100pf RC network. This system is very very basic, and is composed of just +The CPU is a Z80 running at 4MHz. The TSI chip runs at around 25KHz, using a +470K / 100pf RC network. This system is very very basic, and is composed of just the Z80, 4 ROMs, the TSI chip, and an 8255. The Z80's interrupt inputs are all pulled to VCC, so no interrupts are used. Reset is connected to a power-on reset circuit and a button on the keypad (marked RE). -The TSI chip connects to a 4K ROM. All of the 'Voiced' Chess Challengers -use this same ROM (three or four). The later chess boards use a slightly different part -number, but the contents are identical. +The TSI chip connects to a 4K ROM. All of the 'Voiced' Chess Challengers +use this same ROM (three or four). The later chess boards use a slightly different +part number, but the contents are identical. + +The speech chip analog out (pin 11) goes to a PNP transistor, followed by two +cascaded low-pass filters (18K+5nf and 18K+20nf), an LM386N amplifier, and a +speaker. Newer Fidelity chess computers with this chip have a similar configuration, +with an additional volume filter before the LM386N. Memory map (VCC): ----------------- @@ -79,26 +93,26 @@ PC.7 - button column D (W) Language jumpers: ----------------- -When PB.6 is pulled low, the language jumpers can be read. There are four. -They connect to the button rows. When enabled, the row(s) will read low if -the jumper is present. English only VCC's do not have the 367 or any pads stuffed. +When PB.6 is pulled low, the language jumpers can be read. There are four. +They connect to the button rows. When enabled, the row(s) will read low if +the jumper is present. English only VCC's do not have the 367 or any pads stuffed. The jumpers are labeled: French, German, Spanish, and special. Language latch: --------------- -There's an unstuffed 7474 on the board that connects to PA.6 and PA.7. It allows -one to latch the state of A12 to the speech ROM. The English version has the chip -missing, and a jumper pulling "A12" to ground. This line is really a negative +There's an unstuffed 7474 on the board that connects to PA.6 and PA.7. It allows +one to latch the state of A12 to the speech ROM. The English version has the chip +missing, and a jumper pulling "A12" to ground. This line is really a negative enable. To make the VCC multi-language, one would install the 74367 (note: it must be a 74367 -or possibly a 74LS367. A 74HC367 would not work since they rely on the input current +or possibly a 74LS367. A 74HC367 would not work since they rely on the input current to keep the inputs pulled up), solder a piggybacked ROM to the existing English speech ROM, and finally install a 7474 dual flipflop. -This way, the game can then detect which secondary language is present, and then it can -automatically select the correct ROM(s). I have to test whether it will do automatic -determination and give you a language option on power up or something. +This way, the game can then detect which secondary language is present, and then +it can automatically select the correct ROM(s). I have to test whether it will do +automatic determination and give you a language option on power up or something. *******************************************************************************/ diff --git a/src/mame/fidelity/vsc.cpp b/src/mame/fidelity/vsc.cpp index fa2db85aea9be..d7cfcdaa623c5 100644 --- a/src/mame/fidelity/vsc.cpp +++ b/src/mame/fidelity/vsc.cpp @@ -7,7 +7,7 @@ Fidelity Voice Sensory Chess Challenger (VSC) RE notes by Kevin Horton The display/button/LED/speech technology is identical to Fidelity CSC. -Only the CPU board was changed. As such, it works the same but is interfaced +Only the CPU board was changed. As such, it works the same but is interfaced to different port chips this time. Hardware: @@ -19,11 +19,11 @@ I/O is composed of an 8255 triple port adaptor, and a Z80A PIO parallel I/O interface. There's the usual TSI S14001A speech synth with its requisite 4K ROM which is the -same as on the other talking chess boards. The TSI chip is running at 26.37KHz. +same as on the other talking chess boards. The TSI chip is running at 26.37KHz. It uses a 470K resistor and a 100pf capacitor. The "perfect" clock would be 1/RC most likely (actually this will be skewed a tad by -duty cycle of the oscillator) which with those parts values gives 21.27KHz. The +duty cycle of the oscillator) which with those parts values gives 21.27KHz. The formula is probably more likely to be 1/1.2RC or so. Rounding out the hardware are three driver chips for the LEDs, a 7404 inverter to @@ -59,13 +59,13 @@ So to enable only the 8255, you'd write/read to 08-0Bh for example To enable only the PIO, you'd write/read to 04-07h for example. writing to 00-03h will enable and write to BOTH chips, and reading 00-03h -will return data from BOTH chips (and cause a bus conflict). The code probably +will return data from BOTH chips (and cause a bus conflict). The code probably never does either of these things. Likewise, writing/reading to 0Ch-0Fh will result in open bus, because neither chip's enable line will be low. -This sequence repeats every 16 addresses. So to recap: +This sequence repeats every 16 addresses. So to recap: 00-03: both chips enabled (probably not used) 04-07: PIO enabled @@ -75,7 +75,7 @@ This sequence repeats every 16 addresses. So to recap: 10-FF: mirrors of 00-0F. Refer to the Sensory Champ. Chess Chall. for explanations of the below -I/O names and labels. It's the same. +I/O names and labels. It's the same. 8255: ----- @@ -128,20 +128,20 @@ PB.7 - TSI ROM A12 line Selection jumpers: ------------------ -These act like another row of buttons. It is composed of two diode locations, -so there's up to 4 possible configurations. My board does not have either diode -stuffed, so this most likely is "English". I suspect it selects which language to use -for the speech synth. Of course you need the other speech ROMs for this to function -properly. +These act like another row of buttons. It is composed of two diode locations, +so there's up to 4 possible configurations. My board does not have either diode +stuffed, so this most likely is "English". I suspect it selects which language +to use for the speech synth. Of course you need the other speech ROMs for this +to function properly. Anyways, the two jumpers are connected to button columns A and B and the common -connects to Z80A PIO PB.5, which basically makes a 10th button row. I would +connects to Z80A PIO PB.5, which basically makes a 10th button row. I would expect that the software reads these once on startup only. Printer: -------- -This is the 1st Fidelity chess computer with a printer port. Many later Fidelity chess -computers also have support for it. Two models were released: +This is the 1st Fidelity chess computer with a printer port. Many later Fidelity +chess computers also have support for it. Two models were released: FP: Challenger Printer - thermal printer, MCU=D8048C243 IFP: Impact Printer - also compatible with C64 apparently. diff --git a/src/mame/fujitsu/fmtowns.cpp b/src/mame/fujitsu/fmtowns.cpp index fa70c5b0bd037..c794ec6b5b174 100644 --- a/src/mame/fujitsu/fmtowns.cpp +++ b/src/mame/fujitsu/fmtowns.cpp @@ -43,7 +43,7 @@ FM Towns II UX10/20/40 | All-in-one | 386SX-16 | 2 MB FM Towns II HG20/40/100 | Desktop | 386DX-20 | 2 MB | 26 MB | 2 | No (HG20), 40 or 80 MB FM Towns II HR20/100/200 | Desktop | 486SX-20 | 4 MB | 28 MB | 2 | No (HR20) 100 or 200 MB FM Towns II UG10/20/40/80 | All-in-one | 386SX-20 | 2 MB | 10 MB | 1 (UG10) or 2 (others) | No (UG10/20), 40 or 80 MB -FM Towns II UR20/40/80 | All-in-one | 486SX-20 | 2 MB | 10 MB | 2 | No (UG20), 40 or 80 MB +FM Towns II UR20/40/80 | All-in-one | 486SX-20 | 2 MB | 10 MB | 2 | No (UR20), 40 or 80 MB FM Towns II ME20/170 | Desktop | 486SX-25 | 2 MB | 66 MB | 2 | No (ME20) or 170 MB FM Towns II MA170/340 | Desktop | 486SX-33 | 4 MB | 100 MB | 2 | 170 or 340 MB FM Towns II MX20/170/340 | Desktop | 486DX2-66 | 4 MB | 100 MB | 2 | No (MX20), 170 or 340 MB diff --git a/src/mame/funtech/supracan.cpp b/src/mame/funtech/supracan.cpp index d9e84252fc28d..14142b4e25740 100644 --- a/src/mame/funtech/supracan.cpp +++ b/src/mame/funtech/supracan.cpp @@ -1,16 +1,16 @@ -// license:LGPL-2.1+ -// copyright-holders:Angelo Salese,Ryan Holtz -/*************************************************************************** +// license: BSD-3-Clause +// copyright-holders: Angelo Salese, Ryan Holtz +/************************************************************************************************** +Super A'Can (c) 1995 Funtech - Funtech Super A'Can - ------------------- +References: +- https://gist.github.com/evadot/66cfdb8891544b41b4c9 +- https://upload.wikimedia.org/wikipedia/commons/a/a6/Super-ACan-motherboard-flat.jpg +- https://github.com/angelosa/hw_docs/blob/main/funtech_superacan/pergame.md - Preliminary driver by Angelo Salese - Improvements by Ryan Holtz - -******************************************************************************* +=================================================================================================== INFO: @@ -49,7 +49,7 @@ - All: Priorities are largely unknown. - C.U.G.: Gameplay backgrounds are broken. - Sango Fighter: Possible missing masking on the upper edges of the screen during gameplay. - - Sango Fighter: Raster effects off by 1 line + - Sango Fighter: Raster effects off by 1 line (btanb) - Sango Fighter: Specifies tiles out of range of video ram?? - Speedy Dragon: Backgrounds are broken (wrong tile bank/region). - Super Taiwanese Baseball League: Does not boot, uses an unemulated DMA type @@ -61,31 +61,22 @@ - All: are ALL the layers ROZ capable?? -DEBUG TRICKS: - - baseball game debug trick: - wpset e90020,1f,w - do pc=5ac40 - ... - do pc=5acd4 - wpclear - bp 0269E4 - [ff7be4] <- 0x269ec - bpclear - -***************************************************************************/ +**************************************************************************************************/ #include "emu.h" + +#include "bus/supracan/rom.h" +#include "bus/supracan/slot.h" #include "cpu/m68000/m68000.h" -#include "cpu/m6502/m6502.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "acan.h" +#include "cpu/m6502/m65c02.h" + #include "emupal.h" #include "screen.h" #include "softlist_dev.h" #include "speaker.h" #include "tilemap.h" +#include "umc6619_sound.h" +#include "umc6650.h" #define LOG_UNKNOWNS (1U << 1) #define LOG_DMA (1U << 2) @@ -105,12 +96,17 @@ DEBUG TRICKS: #define LOG_ALL (LOG_UNKNOWNS | LOG_HFUNKNOWNS | LOG_DMA | LOG_VIDEO | LOG_HFVIDEO | LOG_IRQS | LOG_SOUND | LOG_68K_SOUND | LOG_CONTROLS) #define LOG_DEFAULT (LOG_ALL & ~(LOG_HFVIDEO | LOG_HFUNKNOWNS)) -#define VERBOSE (LOG_UNKNOWNS | LOG_SOUND | LOG_DMA) +#define VERBOSE (LOG_GENERAL | LOG_UNKNOWNS | LOG_DMA | LOG_HFUNKNOWNS) #include "logmacro.h" namespace { +// NOTE: same as sega/segac2.cpp XL2 +static constexpr XTAL U13_CLOCK = XTAL(53'693'175); +// TODO: bump to 4 after conversion of video_r/_w to um6618_map +static constexpr int ROZ_LAYER_NUMBER = 3; + #define DRAW_DEBUG_ROZ (0) #define DRAW_DEBUG_UNK_SPRITE (0) @@ -126,16 +122,16 @@ class supracan_state : public driver_device , m_maincpu(*this, "maincpu") , m_soundcpu(*this, "soundcpu") , m_cart(*this, "cartslot") + , m_lockout(*this, "lockout") , m_internal68(*this, "internal68") - , m_internal68_view(*this, "internal68") - , m_internal68_view_hi(*this, "internal68_hi") - , m_umc6650key(*this, "umc6650key") + , m_main_loview(*this, "main_loview") + , m_main_hiview(*this, "main_hiview") , m_vram(*this, "vram") , m_soundram(*this, "soundram") , m_sound(*this, "acansnd") , m_gfxdecode(*this, "gfxdecode") , m_screen(*this, "screen") - , m_pads(*this, "P%u", 1U) + , m_pad(*this, "P%u", 1U) { } @@ -147,28 +143,20 @@ class supracan_state : public driver_device virtual void video_start() override; private: - void supracan_mem(address_map &map); - void supracan_sound_mem(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); uint16_t _68k_soundram_r(offs_t offset, uint16_t mem_mask = ~0); void _68k_soundram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint8_t _6502_soundmem_r(offs_t offset); void _6502_soundmem_w(offs_t offset, uint8_t data); - void dma_w(int offset, uint16_t data, uint16_t mem_mask, int ch); - void dma_channel0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void dma_channel1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + template void dma_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t sound_r(offs_t offset, uint16_t mem_mask = 0); - void sound_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t video_r(offs_t offset, uint16_t mem_mask = 0); void video_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); - void umc6650_addr_w(uint8_t data); - uint8_t umc6650_data_r(); - void umc6650_data_w(uint8_t data); - uint8_t sound_ram_read(offs_t offset); struct dma_regs_t @@ -191,26 +179,20 @@ class supracan_state : public driver_device required_device m_maincpu; required_device m_soundcpu; - required_device m_cart; + required_device m_cart; + required_device m_lockout; required_region_ptr m_internal68; - memory_view m_internal68_view; - memory_view m_internal68_view_hi; - required_region_ptr m_umc6650key; + memory_view m_main_loview; + memory_view m_main_hiview; required_shared_ptr m_vram; required_shared_ptr m_soundram; - required_device m_sound; + required_device m_sound; required_device m_gfxdecode; required_device m_screen; - required_ioport_array<2> m_pads; - - dma_regs_t m_dma_regs; - sprdma_regs_t m_sprdma_regs; - - uint8_t m_umc6650_addr = 0; - uint8_t m_umc6650_data[0x80]; + required_ioport_array<2> m_pad; uint16_t m_sound_cpu_ctrl = 0; uint8_t m_soundcpu_irq_enable = 0; @@ -222,33 +204,37 @@ class supracan_state : public driver_device uint8_t m_sound_reg_addr = 0; emu_timer *m_video_timer = nullptr; - emu_timer *m_hbl_timer = nullptr; emu_timer *m_line_on_timer = nullptr; emu_timer *m_line_off_timer = nullptr; std::vector m_vram_addr_swapped{}; -#if 0 - uint16_t *m_pram = nullptr; -#endif - uint16_t m_sprite_count = 0; uint32_t m_sprite_base_addr = 0; + uint8_t m_sprite_mono_color = 0; uint8_t m_sprite_flags = 0; + dma_regs_t m_dma_regs; + sprdma_regs_t m_sprdma_regs; + + uint16_t m_video_flags = 0; uint32_t m_tilemap_base_addr[3]{}; int m_tilemap_scrollx[3]{}; int m_tilemap_scrolly[3]{}; - uint16_t m_video_flags = 0; uint16_t m_tilemap_flags[3]{}; uint16_t m_tilemap_mode[3]{}; - uint16_t m_irq_mask = 0; -#if 0 - uint16_t m_hbl_mask = 0; -#endif + uint16_t m_tilemap_tile_mode[3]{}; + uint16_t m_tilemap_linescrollx_addr[3]{}; + uint16_t m_tilemap_lineselect_addr[3]{}; + + uint16_t m_window_control[2]{}; + uint16_t m_window_start_addr[2]{}; + uint16_t m_window_scrollx[2]{}; + uint16_t m_window_scrolly[2]{}; uint32_t m_roz_base_addr = 0; uint16_t m_roz_mode = 0; + uint16_t m_roz_tile_mode = 0; uint32_t m_roz_scrollx = 0; uint32_t m_roz_scrolly = 0; uint16_t m_roz_tile_bank = 0; @@ -260,11 +246,12 @@ class supracan_state : public driver_device uint16_t m_roz_coeffc = 0; uint16_t m_roz_coeffd = 0; int32_t m_roz_changed = 0; - uint16_t m_unk_1d0 = 0; + u8 m_pixel_mode = 0; + u8 m_gfx_mode = 0; uint16_t m_video_regs[256]{}; - tilemap_t *m_tilemap_sizes[4][4]{}; + tilemap_t *m_tilemap_sizes[4][5]{}; bitmap_ind16 m_sprite_final_bitmap; bitmap_ind8 m_sprite_mask_bitmap; bitmap_ind8 m_prio_bitmap; @@ -274,59 +261,62 @@ class supracan_state : public driver_device TILE_GET_INFO_MEMBER(get_tilemap1_tile_info); TILE_GET_INFO_MEMBER(get_tilemap2_tile_info); TILE_GET_INFO_MEMBER(get_roz_tile_info); - void palette_init(palette_device &palette) const; void sound_timer_irq(int state); void sound_dma_irq(int state); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(hbl_callback); - TIMER_CALLBACK_MEMBER(line_on_callback); - TIMER_CALLBACK_MEMBER(line_off_callback); - TIMER_CALLBACK_MEMBER(video_callback); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + TIMER_CALLBACK_MEMBER(frc_timer_cb); + TIMER_CALLBACK_MEMBER(line_on_cb); + TIMER_CALLBACK_MEMBER(line_off_cb); + TIMER_CALLBACK_MEMBER(scanline_cb); int get_tilemap_region(int layer); void get_tilemap_info_common(int layer, tile_data &tileinfo, int count); void get_roz_tilemap_info(int layer, tile_data &tileinfo, int count); int get_tilemap_dimensions(int &xsize, int &ysize, int layer); + void update_tilemap_flags(int layer); void draw_sprite_tile(bitmap_ind16 &dst, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio); void draw_sprite_tile_mask(bitmap_ind8 &dst, const rectangle &cliprect, gfx_element *gfx, int tile, bool xflip, bool yflip, int dstx, int dsty); void draw_sprite_tile_masked(bitmap_ind16 &dst, bitmap_ind8 &mask, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio); void draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bitmap_ind8 &priomap, const rectangle &cliprect); void mark_active_tilemap_all_dirty(int layer); - void draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t* scrollram*/, int transmask); + void draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t *scrollram*/, int transmask); void set_sound_irq(uint8_t bit, uint8_t state); + + void host_um6619_map(address_map &map); + u8 m_irq_mask = 0; + u16 m_frc_control = 0; + u16 m_frc_frequency = 0; + emu_timer *m_frc_timer = nullptr; + void update_frc_state(); }; int supracan_state::get_tilemap_region(int layer) { - // HACK!!! - if (layer == 2) + // TODO: anything that refers to 2bpp region (2) can actually be layer 1bpp selectable too + // From layer mode bit 7? + switch(layer) { - return 2; - } - - if (layer == 3) - { - // roz layer - static const int s_roz_mode_lut[4] = { 4, 2, 1, 0 }; - return s_roz_mode_lut[m_roz_mode & 3]; - } - else - { - // normal layers - if ((m_tilemap_mode[layer] & 0x7000) == 0x7000) - { + case 0: + static const int layer0_mode[8] = { 2, 1, 0, 1, 0, 0, 0, 0 }; + return layer0_mode[m_gfx_mode & 7]; + case 1: + static const int layer1_mode[8] = { 2, 1, 1, 1, 2, 2, 2, 2 }; + return layer1_mode[m_gfx_mode & 7]; + case 2: return 2; - } - return 1; + case 3: + static const int s_roz_mode_lut[4] = { 4, 2, 1, 0 }; + return s_roz_mode_lut[m_roz_mode & 3]; } + // TODO: 4th layer at $f00160 (gfx mode 0 only, ignored for everything else) + throw emu_fatalerror("Error: layer = %d not defined", layer); } void supracan_state::get_tilemap_info_common(int layer, tile_data &tileinfo, int count) { - uint16_t* supracan_vram = m_vram; + uint16_t *vram = m_vram; uint32_t base = m_tilemap_base_addr[layer]; int gfx_mode = (m_tilemap_mode[layer] & 0x7000) >> 12; @@ -335,32 +325,34 @@ void supracan_state::get_tilemap_info_common(int layer, tile_data &tileinfo, int count += base; uint16_t tile_bank = 0; - uint16_t palette_bank = 0; + uint16_t palette_shift = 0; + // TODO: convert this to a static table, verify case 7 switch (gfx_mode) { case 7: tile_bank = 0x1c00; - palette_bank = 0x00; break; - case 6: // gambling lord + // gamblord + case 6: tile_bank = 0x0c00; - palette_bank = 0x00; break; case 4: tile_bank = 0x800; - palette_bank = 0x00; break; case 2: tile_bank = 0x400; - palette_bank = 0x00; + break; + + case 1: + // formduel gameplay (for layer 2 -> 0x1400) + tile_bank = 0x200; break; case 0: tile_bank = 0; - palette_bank = 0x00; break; default: @@ -368,29 +360,41 @@ void supracan_state::get_tilemap_info_common(int layer, tile_data &tileinfo, int break; } + if (region == 0) + tile_bank >>= 1; + + // speedyd and slghtsag hints that text layer color offsets in steps of 4 + if (region == 2) + palette_shift = 2; if (layer == 2) + tile_bank = (0x1000 | (tile_bank << 1)) & 0x1c00; + + u8 palette_base = ((vram[count] & 0xf000) >> 12); + + // speedyd gameplay + if (BIT(m_tilemap_tile_mode[layer], 9)) { - tile_bank = 0x1000; + tileinfo.category = !BIT(palette_base, 3); + palette_base |= 8; } - int tile = (supracan_vram[count] & 0x03ff) + tile_bank; - int flipxy = (supracan_vram[count] & 0x0c00) >> 10; - int palette = ((supracan_vram[count] & 0xf000) >> 12) + palette_bank; + u16 tile = (vram[count] & 0x03ff) + tile_bank; + u8 flipxy = (vram[count] & 0x0c00) >> 10; + u8 palette = palette_base << palette_shift; tileinfo.set(region, tile, palette, TILE_FLIPXY(flipxy)); } -// I wonder how different this really is.. my guess, not at all. +// TODO: merge with normal layers. void supracan_state::get_roz_tilemap_info(int layer, tile_data &tileinfo, int count) { - uint16_t* supracan_vram = m_vram; + uint16_t *vram = m_vram; uint32_t base = m_roz_base_addr; int region = 1; uint16_t tile_bank = 0; - uint16_t palette_bank = 0; region = get_tilemap_region(layer); @@ -425,9 +429,18 @@ void supracan_state::get_roz_tilemap_info(int layer, tile_data &tileinfo, int co count += base; - int tile = (supracan_vram[count] & 0x03ff) + tile_bank; - int flipxy = (supracan_vram[count] & 0x0c00) >> 10; - int palette = ((supracan_vram[count] & 0xf000) >> 12) + palette_bank; + u8 palette_base = ((vram[count] & 0xf000) >> 12); + + // sonevil gameplay + if (BIT(m_roz_tile_mode, 9)) + { + tileinfo.category = !BIT(palette_base, 3); + palette_base |= 8; + } + + u16 tile = (vram[count] & 0x03ff) + tile_bank; + u8 flipxy = (vram[count] & 0x0c00) >> 10; + u8 palette = palette_base; tileinfo.set(region, tile, palette, TILE_FLIPXY(flipxy)); } @@ -469,21 +482,25 @@ void supracan_state::video_start() m_tilemap_sizes[0][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_tilemap_sizes[0][2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); m_tilemap_sizes[0][3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tilemap_sizes[0][4] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 16, 16); m_tilemap_sizes[1][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_tilemap_sizes[1][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_tilemap_sizes[1][2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); m_tilemap_sizes[1][3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tilemap_sizes[1][4] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 16, 16); m_tilemap_sizes[2][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap2_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_tilemap_sizes[2][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap2_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_tilemap_sizes[2][2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap2_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); m_tilemap_sizes[2][3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap2_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tilemap_sizes[2][4] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_tilemap2_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 16, 16); m_tilemap_sizes[3][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_tilemap_sizes[3][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_tilemap_sizes[3][2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); m_tilemap_sizes[3][3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tilemap_sizes[3][4] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(supracan_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 16, 16); } int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) @@ -492,13 +509,25 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) ysize = 32; int select; - if (layer == 3) + if (layer == ROZ_LAYER_NUMBER) select = m_roz_mode & 0x0f00; else select = m_tilemap_flags[layer] & 0x0f00; switch (select) { + // formduel rain layer on game over + // sonevil title screen + case 0x200: + xsize = 16; + ysize = 16; + return 4; + + case 0x400: + xsize = 32; + ysize = 32; + return 0; + case 0x600: xsize = 64; ysize = 32; @@ -515,11 +544,29 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) return 3; default: - LOGMASKED(LOG_HFUNKNOWNS, "Unsupported tilemap size for layer %d: %04x\n", layer, select); + // TODO: setting 0 is already tested by A'Can logo (in bitmap mode) + // select & 0x100 is 16x16 tiles + if (select != 0) + LOGMASKED(LOG_HFUNKNOWNS, "Unsupported tilemap size for layer %d: %04x\n", layer, select); return 0; } } +void supracan_state::update_tilemap_flags(int layer) +{ + const u32 attr = layer == ROZ_LAYER_NUMBER ? m_roz_mode : m_tilemap_flags[layer]; + const u32 flip_x = BIT(attr, 1) ? TILEMAP_FLIPX : 0; + const u32 flip_y = BIT(attr, 0) ? TILEMAP_FLIPY : 0; + + // TODO: we should really track what's the current tilemap paging and update only that + // Obviously we should also NOT mark all dirty, but just subscribe to what's the effective bank. + // is a dynamic mapper even possible with tilemap.h? + for (int i = 0; i < 4; i++) + { + m_tilemap_sizes[layer][i]->set_flip(flip_x | flip_y); + } +} + void supracan_state::draw_sprite_tile(bitmap_ind16 &dst, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio) { @@ -742,28 +789,45 @@ void supracan_state::draw_sprite_tile_masked(bitmap_ind16 &dst, bitmap_ind8 &mas } } +// [0] +// -e-- ---- ---- ---- sprite enable? +// ---h hhh- ---- ---- Y size (not always right) +// ---- ---y yyyy yyyy Y position +// [1] +// bbbb ---- ---- ---- Tile bank +// ---- h--- ---- ---- Horizontal flip +// ---- -v-- ---- ---- Vertical flip +// ---- --mm ---- ---- Masking mode +// ---- ---- ---- -www X size +// [2] +// zzz- ---- ---- ---- X scale +// ---- ???- ---- ---- Unknown, but often written. +// Values include 111 and 110 for the Super A'Can logo, 110 in the Sango Fighter intro, and 101/100 in the Boom Zoo intro. +// ---- ---x xxxx xxxx X position +// [3] +// d--- ---- ---- ---- Direct Sprite (use details from here, not looked up in vram) +// -ooo oooo oooo oooo Sprite address void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bitmap_ind8 &priomap, const rectangle &cliprect) { - uint16_t *supracan_vram = m_vram; - -// [0] -// -e-- ---- ---- ---- sprite enable? -// ---h hhh- ---- ---- Y size (not always right) -// ---- ---y yyyy yyyy Y position -// [1] -// bbbb ---- ---- ---- Tile bank -// ---- h--- ---- ---- Horizontal flip -// ---- -v-- ---- ---- Vertical flip -// ---- --mm ---- ---- Masking mode -// ---- ---- ---- -www X size -// [2] -// zzz- ---- ---- ---- X scale -// ---- ???- ---- ---- Unknown, but often written. -// Values include 111 and 110 for the Super A'Can logo, 110 in the Sango Fighter intro, and 101/100 in the Boom Zoo intro. -// ---- ---x xxxx xxxx X position -// [3] -// d--- ---- ---- ---- Direct Sprite (use details from here, not looked up in vram) -// -ooo oooo oooo oooo Sprite address + uint16_t *vram = m_vram; + + // ysizes are normally setting +1, except on higher ranges where values are higher + // TODO: check on real HW + static const int ysizes_table[16] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, + // 0x9: speedyd intro dash frame + 11, + // 0xa: A'Can logo + 12, + // 0xb/0xc: jttlaugh stage 1-3 (particularly on the web scrolling jump platforms) + 16, + 20, + // 0xd: slghtsag character select + 22, + // 0xe/0xf: , check me + 24, + 26 + }; uint32_t skip_count = 0; uint32_t start_word = (m_sprite_base_addr >> 1) + skip_count * 4; @@ -774,77 +838,75 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi for (int i = start_word; i < end_word; i += 4) { - int x = supracan_vram[i + 2] & 0x01ff; - int y = supracan_vram[i + 0] & 0x01ff; - - int sprite_offset = (supracan_vram[i + 3])<< 1; - - int bank = (supracan_vram[i + 1] & 0xf000) >> 12; - int mask = (supracan_vram[i + 1] & 0x0300) >> 8; - int sprite_xflip = (supracan_vram[i + 1] & 0x0800) >> 11; - int sprite_yflip = (supracan_vram[i + 1] & 0x0400) >> 10; - int prio = (supracan_vram[i + 2] >> 9) & 3; - //int xscale = supracan_vram[i + 2] >> 13; + int x = vram[i + 2] & 0x01ff; + int y = vram[i + 0] & 0x01ff; + + int bank = (vram[i + 1] & 0xf000) >> 12; + int mask = (vram[i + 1] & 0x0300) >> 8; + int sprite_xflip = (vram[i + 1] & 0x0800) >> 11; + int sprite_yflip = (vram[i + 1] & 0x0400) >> 10; + int prio = (vram[i + 2] >> 9) & 3; + const u16 sprite_ptr = vram[i + 3]; + //int xscale = vram[i + 2] >> 13; gfx_element *gfx = m_gfxdecode->gfx(region); // wraparound if (y >= 0x180) y -= 0x200; if (x >= 0x180) x -= 0x200; - if ((supracan_vram[i + 0] & 0x4000)) + if ((vram[i + 0] & 0x4000)) { - #if 0 - printf("%d (unk %02x) (enable %02x) (unk Y2 %02x, %02x) (y pos %02x) (bank %01x) (flip %01x) (unknown %02x) (x size %02x) (xscale %01x) (unk %01x) (xpos %02x) (code %04x)\n", i, - (supracan_vram[i + 0] & 0x8000) >> 15, - (supracan_vram[i + 0] & 0x4000) >> 14, - (supracan_vram[i + 0] & 0x2000) >> 13, - (supracan_vram[i + 0] & 0x1e00) >> 8, - (supracan_vram[i + 0] & 0x01ff), - (supracan_vram[i + 1] & 0xf000) >> 12, - (supracan_vram[i + 1] & 0x0c00) >> 10, - (supracan_vram[i + 1] & 0x03f0) >> 4, - (supracan_vram[i + 1] & 0x000f), - (supracan_vram[i + 2] & 0xf000) >> 12, - (supracan_vram[i + 2] & 0x0e00) >> 8, - (supracan_vram[i + 2] & 0x01ff) >> 0, - (supracan_vram[i + 3] & 0xffff)); - #endif - - if (supracan_vram[i + 3] & 0x8000) + int xsize = 1 << (vram[i + 1] & 7); + int ysize = ysizes_table[(vram[i + 0] & 0x1e00) >> 9]; + + // HACK: sonevil sets 1x1 tiles in game, and expecting to take this path. + // Most likely former condition is wrong, and it just "direct sprite" when latter occurs. + // magipool also wants latter, for the shot markers to work. + if (sprite_ptr & 0x8000 || (xsize == 1 && ysize == 1)) { - uint16_t data = supracan_vram[i + 3]; - int tile = (bank * 0x200) + (data & 0x03ff); + int tile = (bank * 0x200) + (sprite_ptr & 0x03ff); - int palette = (data & 0xf000) >> 12; // this might not be correct, due to the & 0x8000 condition above this would force all single tile sprites to be using palette >= 0x8 only + int palette = (sprite_ptr & 0xf000) >> 12; // this might not be correct, due to the & 0x8000 condition above this would force all single tile sprites to be using palette >= 0x8 only - // printf("sprite data %04x %04x %04x %04x\n", supracan_vram[i+0] , supracan_vram[i+1] , supracan_vram[i+2] ,supracan_vram[i+3] ); + // sonevil expect to flip X/Y thru the sprite pointer + int tile_xflip = sprite_xflip ^ ((sprite_ptr & 0x0800) >> 11); + int tile_yflip = sprite_yflip ^ ((sprite_ptr & 0x0400) >> 10); if (mask > 1) - draw_sprite_tile_mask(maskmap, cliprect, gfx, tile, sprite_xflip, sprite_yflip, x, y); + draw_sprite_tile_mask(maskmap, cliprect, gfx, tile, tile_xflip, tile_yflip, x, y); else if (mask == 1) - draw_sprite_tile_masked(bitmap, maskmap, priomap, cliprect, gfx, tile, palette, sprite_xflip, sprite_yflip, x, y, prio); + draw_sprite_tile_masked(bitmap, maskmap, priomap, cliprect, gfx, tile, palette, tile_xflip, tile_yflip, x, y, prio); else - draw_sprite_tile(bitmap, priomap, cliprect, gfx, tile, palette, sprite_xflip, sprite_yflip, x, y, prio); + draw_sprite_tile(bitmap, priomap, cliprect, gfx, tile, palette, tile_xflip, tile_yflip, x, y, prio); } else { - int xsize = 1 << (supracan_vram[i + 1] & 7); - int ysize = ((supracan_vram[i + 0] & 0x1e00) >> 9) + 1; - // I think the xsize must influence the ysize somehow, there are too many conflicting cases otherwise // there don't appear to be any special markers in the actual looked up tile data to indicate skip / end of list + //if (((vram[i + 0] & 0x1e00) >> 9) == test_target) + //{ + // ysize = test_value; + //} + + for (int ytile = 0; ytile < ysize; ytile++) { for (int xtile = 0; xtile < xsize; xtile++) { - uint16_t data = supracan_vram[(sprite_offset + ytile * xsize + xtile) & VRAM_MASK]; + uint16_t data = vram[((sprite_ptr << 1) + ytile * xsize + xtile) & VRAM_MASK]; int tile = (bank * 0x200) + (data & 0x03ff); int palette = (data & 0xf000) >> 12; int xpos = sprite_xflip ? (x - (xtile + 1) * 8 + xsize * 8) : (x + xtile * 8); int ypos = sprite_yflip ? (y - (ytile + 1) * 8 + ysize * 8) : (y + ytile * 8); + // magipool rolls back at 512 edge for the shot power menu + // TODO: should also control clip inside the functions + // (which should be merged as well) + // TODO: verify ypos, likely same. + xpos &= 0x1ff; + int tile_xflip = sprite_xflip ^ ((data & 0x0800) >> 11); int tile_yflip = sprite_yflip ^ ((data & 0x0400) >> 10); @@ -858,6 +920,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi } } + // TODO: scaling, find places where it occurs #if 0 if (xscale == 0) continue; uint32_t delta = (1 << 17) / xscale; @@ -894,7 +957,7 @@ void supracan_state::mark_active_tilemap_all_dirty(int layer) /* draws tilemap with linescroll OR columnscroll to 16-bit indexed bitmap */ -void supracan_state::draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t* scrollram*/, int transmask) +void supracan_state::draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t *scrollram*/, int transmask) { bitmap_ind16 &srcbitmap = tmap->pixmap(); const int xmask = srcbitmap.width() - 1; @@ -923,6 +986,7 @@ void supracan_state::draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &clipr /* get dest and priority pointers */ uint16_t *dest = &bitmap.pix(sy, sx); + // TODO: somebody ate the priority pointer here ... /* loop over columns */ while (x <= ex) @@ -991,68 +1055,51 @@ void supracan_state::draw_roz_layer(bitmap_ind16 &bitmap, const rectangle &clipr uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - // treat the sprites as frame-buffered and only update the buffer when drawing scanline 0 - this might not be true! - - if (0) - { - if (cliprect.min_y == 0x00) - { - const rectangle &visarea = screen.visible_area(); - - m_sprite_final_bitmap.fill(0x00, visarea); - m_sprite_mask_bitmap.fill(0x00, cliprect); - m_prio_bitmap.fill(0xff, cliprect); - bitmap.fill(0x80, visarea); - - draw_sprites(m_sprite_final_bitmap, m_sprite_mask_bitmap, m_prio_bitmap, visarea); - } - } - else - { - m_sprite_final_bitmap.fill(0x00, cliprect); - m_sprite_mask_bitmap.fill(0x00, cliprect); - m_prio_bitmap.fill(0xff, cliprect); - bitmap.fill(0x80, cliprect); - - draw_sprites(m_sprite_final_bitmap, m_sprite_mask_bitmap, m_prio_bitmap, cliprect); - } + m_sprite_final_bitmap.fill(0x00, cliprect); + m_sprite_mask_bitmap.fill(0x00, cliprect); + m_prio_bitmap.fill(0xff, cliprect); + // Back layer normally fills with 0x00 + // - boomzoo (title) wants 0x00 + // - sangofgt (1st fighter stage) wants 0x00 + // - sonevil (intro) wants 0x00 + // TODO: layer overlay happens from mixing registers (A'Can BIOS sets 0x02 there) + bitmap.fill(0x00, cliprect); + + draw_sprites(m_sprite_final_bitmap, m_sprite_mask_bitmap, m_prio_bitmap, cliprect); // mix screen int xsize = 0, ysize = 0; // int tilemap_num; - int priority = 0; for (int pri = 7; pri >= 0; pri--) { - for (int layer = 3; layer >=0; layer--) + // Wanted like this by speedyd, formduel and magipool at very least + for (int layer = 0; layer < ROZ_LAYER_NUMBER + 1; layer ++) { - // popmessage("%04x\n",m_video_flags); int enabled = 0; + int layer_priority = 0; - if (m_video_flags & 0x04) - if (layer==3) enabled = 1; - - if (m_video_flags & 0x80) - if (layer==0) enabled = 1; - - if (m_video_flags & 0x40) - if (layer==1) enabled = 1; - - if (m_video_flags & 0x20) - if (layer==2) enabled = 1; - - - if (layer==3) - priority = ((m_roz_mode >> 13) & 7); // roz case + // ROZ + if (layer == ROZ_LAYER_NUMBER) + { + enabled = BIT(m_video_flags, 2); + if (!enabled) + continue; + layer_priority = ((m_roz_mode >> 13) & 7); + } else - priority = ((m_tilemap_flags[layer] >> 13) & 7); // normal cases - + { + enabled = BIT(m_video_flags, 7 - layer); + if (!enabled) + continue; + layer_priority = ((m_tilemap_flags[layer] >> 13) & 7); + } - if (priority == pri) + if (layer_priority == pri) { -// tilemap_num = layer; int which_tilemap_size = get_tilemap_dimensions(xsize, ysize, layer); bitmap_ind16 &src_bitmap = m_tilemap_sizes[layer][which_tilemap_size]->pixmap(); + // TODO: per-tile priority, thru ->flagsmap() int gfx_region = get_tilemap_region(layer); int transmask = 0xff; @@ -1065,118 +1112,184 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm case 4: transmask = 0x01; break; } - if (enabled) + if (layer != ROZ_LAYER_NUMBER) { - if (layer != 3) // standard layers, NOT roz + int wrap = (m_tilemap_flags[layer] & 0x20); + + // slghtsag wants a resolution of 12-bits for text and title + int scrollx = m_tilemap_scrollx[layer] & 0xfff; + int scrolly = m_tilemap_scrolly[layer] & 0xfff; + + if (scrollx & 0x800) scrollx -= 0x1000; + if (scrolly & 0x800) scrolly -= 0x1000; + + // global flips also inverts scroll meanings + // cfr. formduel left character and sangofgt 2nd fighter stage. + if (BIT(m_tilemap_flags[layer], 1)) + scrollx ^= ((xsize * 8) - 1); + + if (BIT(m_tilemap_flags[layer], 0)) + scrolly ^= ((ysize * 8) - 1); + + int mosaic_count = (m_tilemap_flags[layer] & 0x001c) >> 2; + int mosaic_mask = 0xffffffff << mosaic_count; + + // yes, it will draw a single line if you specify a cliprect as such (partial updates...) + + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - int wrap = (m_tilemap_flags[layer] & 0x20); + // these will have to change to uint32_t* etc. once alpha blending is supported + uint16_t *screen = &bitmap.pix(y); - int scrollx = m_tilemap_scrollx[layer]; - int scrolly = m_tilemap_scrolly[layer]; + int actualy = y & mosaic_mask; + int realy = actualy + scrolly; - if (scrollx & 0x8000) scrollx -= 0x10000; - if (scrolly & 0x8000) scrolly -= 0x10000; + if (!wrap) + if (scrolly + y < 0 || scrolly + y > ((ysize * 8) - 1)) + continue; - int mosaic_count = (m_tilemap_flags[layer] & 0x001c) >> 2; - int mosaic_mask = 0xffffffff << mosaic_count; + // slghtsag enables lineselect on load game + if (BIT(m_tilemap_tile_mode[layer], 11)) + { + int16_t lineselect = (int16_t)m_vram[((m_tilemap_lineselect_addr[layer] << 1) + y ) & 0xffff]; + realy = (lineselect + scrolly) & ((ysize * 8) - 1); + } - // yes, it will draw a single line if you specify a cliprect as such (partial updates...) + uint16_t *src = &src_bitmap.pix(realy & ((ysize * 8) - 1)); + uint8_t *priop = &m_prio_bitmap.pix(y); + int line_scroll_x = scrollx; - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + // formduel main menu + if (BIT(m_tilemap_tile_mode[layer], 14)) { - // these will have to change to uint32_t* etc. once alpha blending is supported - uint16_t* screen = &bitmap.pix(y); + int16_t linescrollx = (int16_t)m_vram[((m_tilemap_linescrollx_addr[layer] << 1) + y) & 0xffff]; + line_scroll_x += linescrollx; + } - int actualy = y & mosaic_mask; - int realy = actualy + scrolly; + + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + int actualx = x & mosaic_mask; + int realx = actualx + line_scroll_x; if (!wrap) - if (scrolly + y < 0 || scrolly + y > ((ysize * 8) - 1)) + if (line_scroll_x + x < 0 || line_scroll_x + x > ((xsize * 8) - 1)) continue; - uint16_t* src = &src_bitmap.pix(realy & ((ysize * 8) - 1)); - uint8_t* priop = &m_prio_bitmap.pix(y); + uint16_t srcpix = src[realx & ((xsize * 8) - 1)]; - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + if ((srcpix & transmask) != 0 && layer_priority < (priop[x] >> 4)) { - int actualx = x & mosaic_mask; - int realx = actualx + scrollx; - - if (!wrap) - if (scrollx + x < 0 || scrollx + x > ((xsize * 8) - 1)) - continue; - - uint16_t srcpix = src[realx & ((xsize * 8) - 1)]; - - if ((srcpix & transmask) != 0 && priority < (priop[x] >> 4)) - { - screen[x] = srcpix; - priop[x] = (priop[x] & 0x0f) | (priority << 4); - } + screen[x] = srcpix; + priop[x] = (priop[x] & 0x0f) | (layer_priority << 4); } } } - else - { - int wrap = m_roz_mode & 0x20; + } + else + { + int wrap = m_roz_mode & 0x20; - int incxx = m_roz_coeffa; - int incyy = m_roz_coeffd; + int incxx = m_roz_coeffa; + int incyy = m_roz_coeffd; - int incxy = m_roz_coeffc; - int incyx = m_roz_coeffb; + int incxy = m_roz_coeffc; + int incyx = m_roz_coeffb; - int scrollx = m_roz_scrollx; - int scrolly = m_roz_scrolly; + int scrollx = m_roz_scrollx; + int scrolly = m_roz_scrolly; - if (incyx & 0x8000) incyx -= 0x10000; - if (incxy & 0x8000) incxy -= 0x10000; + if (incyx & 0x8000) incyx -= 0x10000; + if (incxy & 0x8000) incxy -= 0x10000; - if (incyy & 0x8000) incyy -= 0x10000; - if (incxx & 0x8000) incxx -= 0x10000; + if (incyy & 0x8000) incyy -= 0x10000; + if (incxx & 0x8000) incxx -= 0x10000; - //popmessage("%04x %04x\n",m_video_flags, m_roz_mode); + //popmessage("%04x %04x\n",m_video_flags, m_roz_mode); - // roz mode.. - //4020 = enabled speedyd - //6c22 = enabled speedyd - //2c22 = enabled speedyd - //4622 = disabled jttlaugh - //2602 = disabled monopoly - //0402 = disabled (sango title) - // or is it always enabled, and only corrupt because we don't clear ram properly? - // (probably not this register?) + // roz mode.. + //4020 = enabled speedyd + //6c22 = enabled speedyd + //2c22 = enabled speedyd + //4622 = disabled jttlaugh + //2602 = disabled monopoly + //0402 = disabled (sango title) + // or is it always enabled, and only corrupt because we don't clear ram properly? + // (probably not this register?) - if (!(m_roz_mode & 0x0200) && (m_roz_mode & 0xf000)) // HACK - Not trusted: Acan Logo, Speedy Dragon Intro, Speed Dragon Bonus stage need it. Monopoly and JTT *don't* causes graphical issues + if (!(m_roz_mode & 0x0200) && (m_roz_mode & 0xf000)) // HACK - Not trusted: Acan Logo, Speedy Dragon Intro, Speed Dragon Bonus stage need it. Monopoly and JTT *don't* causes graphical issues + { + // NOT accurate, causes issues when the attract mode loops and the logo is shown the 2nd time in some games - investigate + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - // NOT accurate, causes issues when the attract mode loops and the logo is shown the 2nd time in some games - investigate - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - rectangle clip(cliprect.min_x, cliprect.max_x, y, y); + rectangle clip(cliprect.min_x, cliprect.max_x, y, y); - scrollx = (m_roz_scrollx); - scrolly = (m_roz_scrolly); - incxx = (m_roz_coeffa); + scrollx = (m_roz_scrollx); + scrolly = (m_roz_scrolly); + incxx = (m_roz_coeffa); - incxx += m_vram[m_roz_unk_base0/2 + y]; + incxx += m_vram[m_roz_unk_base0/2 + y]; - scrollx += m_vram[m_roz_unk_base1/2 + y * 2] << 16; - scrollx += m_vram[m_roz_unk_base1/2 + y * 2 + 1]; + scrollx += m_vram[m_roz_unk_base1/2 + y * 2] << 16; + scrollx += m_vram[m_roz_unk_base1/2 + y * 2 + 1]; - scrolly += m_vram[m_roz_unk_base2/2 + y * 2] << 16; - scrolly += m_vram[m_roz_unk_base2/2 + y * 2 + 1]; + scrolly += m_vram[m_roz_unk_base2/2 + y * 2] << 16; + scrolly += m_vram[m_roz_unk_base2/2 + y * 2 + 1]; - if (incxx & 0x8000) incxx -= 0x10000; + if (incxx & 0x8000) incxx -= 0x10000; - if (m_vram[m_roz_unk_base0/2 + y]) // incxx = 0, no draw? - draw_roz_layer(bitmap, clip, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask); - } - } - else - { - draw_roz_layer(bitmap, cliprect, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask); + if (m_vram[m_roz_unk_base0/2 + y]) // incxx = 0, no draw? + draw_roz_layer(bitmap, clip, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask); } } + else + { + draw_roz_layer(bitmap, cliprect, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask); + } + } + + } + } + + // TODO: secondary window control at $1d8-$1df (no SW sets it up so far) + if (BIT(m_video_flags, 1)) + { + // bit 15: enabled by magipool at circular intro, will show sprites above it if checked with. + int layer_priority = ((m_window_control[0] >> 13) & 3); + if (pri != layer_priority) + continue; + const u8 reverse_clip = BIT(m_window_control[0], 11); + // magipool enables this on title screen + // (for the white "overlay", revealing Funtech copyright progressively) + // TODO: confirm implementation + int window_scrollx = m_window_scrollx[0] & 0x3ff; + // TODO: window_scrolly + + if (window_scrollx & 0x200) + window_scrollx -= 0x400; + + const u8 window_pen = m_window_control[0] & 0xff; + + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + // bit 8 is unset by sangofgt, where it uses only two entries of the table on transitions. + const int ybase = BIT(m_window_control[0], 8) ? (y * 2) : 0; + const u32 clip_base = ((m_window_start_addr[0] << 1) + ybase) & 0xffff; + + const int16_t clip_min_x = (m_vram[clip_base + 0] + window_scrollx); + const int16_t clip_max_x = (m_vram[clip_base + 1] + window_scrollx); + uint8_t *priop = &m_prio_bitmap.pix(y); + + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + if (layer_priority >= (priop[x] >> 4)) + continue; + + if ((x >= clip_min_x && x < clip_max_x) ^ reverse_clip) + { + bitmap.pix(y, x) = window_pen; + priop[x] = (priop[x] & 0x0f) | (layer_priority << 4); + } } } } @@ -1184,13 +1297,13 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm // combine sprites - if (m_video_flags & 0x08) + if (BIT(m_video_flags, 3)) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t* dstp = &bitmap.pix(y); - uint8_t* priop = &m_prio_bitmap.pix(y); - uint16_t* spritep = &m_sprite_final_bitmap.pix(y); + uint16_t *dstp = &bitmap.pix(y); + uint8_t *priop = &m_prio_bitmap.pix(y); + uint16_t *spritep = &m_sprite_final_bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { @@ -1218,7 +1331,7 @@ void supracan_state::sound_dma_irq(int state) set_sound_irq(6, state); } -void supracan_state::dma_w(int offset, uint16_t data, uint16_t mem_mask, int ch) +template void supracan_state::dma_w(offs_t offset, uint16_t data, uint16_t mem_mask) { address_space &mem = m_maincpu->space(AS_PROGRAM); @@ -1252,28 +1365,60 @@ void supracan_state::dma_w(int offset, uint16_t data, uint16_t mem_mask, int ch) LOGMASKED(LOG_DMA, "dma_w: control %d: %04x\n", ch, data); if (data & 0x8800) { -// if (data & 0x2000) -// m_dma_regs.source-=2; LOGMASKED(LOG_DMA, "dma_w: Kicking off a DMA from %08x to %08x, %d bytes (%04x)\n", m_dma_regs.source[ch], m_dma_regs.dest[ch], m_dma_regs.count[ch] + 1, data); + // formduel sets both for gameplay to work + // TODO: verify which one is source and which destination + const bool dest_dec = BIT(data, 10); + const bool src_dec = BIT(data, 9); + + if (dest_dec ^ src_dec) + popmessage("DMA trigger %04x with one increment bit set %04x", data, data & 0x0600); + for (int i = 0; i <= m_dma_regs.count[ch]; i++) { - if (data & 0x1000) + // staiwbbl wants to fill both VRAM and work RAM at startup, + // and expects to transfer word for VRAM, byte for work RAM. + // Not providing this will cause all kinds of video and logic glitches. + // TODO: pinpoint DMA modes here (at least upper bits 14-13 should do) + if (data == 0xa800) + { + if ((m_dma_regs.dest[ch] & 0xfe0000) == 0xf40000) + { + mem.write_word(m_dma_regs.dest[ch], 0); + m_dma_regs.dest[ch] += dest_dec ? -2 : 2; + } + else + { + mem.write_byte(m_dma_regs.dest[ch], mem.read_byte(m_dma_regs.source[ch])); + m_dma_regs.dest[ch] += dest_dec ? -1 : 1; + } + } + else if (data & 0x1000) { mem.write_word(m_dma_regs.dest[ch], mem.read_word(m_dma_regs.source[ch])); - m_dma_regs.dest[ch] += 2; - m_dma_regs.source[ch] += 2; + m_dma_regs.dest[ch] += dest_dec ? -2 : 2; + m_dma_regs.source[ch] += src_dec ? -2 : 2; if (data & 0x0100) + { + // staiwbbl, indirect transfers towards port $f00010-$1f + // TODO: also used by sangofgt + // will glitch on some super moves because it tries to transfer + // multiple times to the VRAM port (normally size is set to 8x2 bytes) if ((m_dma_regs.dest[ch] & 0xf) == 0) m_dma_regs.dest[ch] -= 0x10; + } } else { mem.write_byte(m_dma_regs.dest[ch], mem.read_byte(m_dma_regs.source[ch])); - m_dma_regs.dest[ch]++; - m_dma_regs.source[ch]++; + m_dma_regs.dest[ch] += dest_dec ? -1 : 1; + m_dma_regs.source[ch] += src_dec ? -1 : 1; } } + // TODO: are these DMA cycle steal? + // There's no indication of a DMA status read so far that would indicate burst. + //m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime(m_dma_regs.count[ch] * 2)); } else if (data != 0x0000) // fake DMA, used by C.U.G. { @@ -1287,25 +1432,6 @@ void supracan_state::dma_w(int offset, uint16_t data, uint16_t mem_mask, int ch) } } -void supracan_state::dma_channel0_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - dma_w(offset, data, mem_mask, 0); -} - -void supracan_state::dma_channel1_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - dma_w(offset, data, mem_mask, 1); -} - - -#if 0 -void supracan_state::supracan_pram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - m_pram[offset] &= ~mem_mask; - m_pram[offset] |= data & mem_mask; -} -#endif - // swap address around so that 64x64 tile can be decoded as 8x8 tiles.. void supracan_state::write_swapped_byte(int offset, uint8_t byte) { @@ -1330,37 +1456,30 @@ void supracan_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) m_gfxdecode->gfx(4)->mark_dirty((offset * 2) / 8); } -void supracan_state::umc6650_addr_w(uint8_t data) +void supracan_state::main_map(address_map &map) { - m_umc6650_addr = data & 0x7f; -} + map(0x000000, 0x3fffff).view(m_main_loview); + m_main_loview[0](0x000000, 0x3fffff).r(m_cart, FUNC(superacan_cart_slot_device::rom_r)), + m_main_loview[0](0x000000, 0x000fff).rom().region(m_internal68, 0); + m_main_loview[1](0x000000, 0x3fffff).r(m_cart, FUNC(superacan_cart_slot_device::rom_r)); + map(0xe80000, 0xe8ffff).rw(FUNC(supracan_state::_68k_soundram_r), FUNC(supracan_state::_68k_soundram_w)); + map(0xe90000, 0xe9001f).m(*this, FUNC(supracan_state::host_um6619_map)); + map(0xe90020, 0xe9002f).w(FUNC(supracan_state::dma_w<0>)); + map(0xe90030, 0xe9003f).w(FUNC(supracan_state::dma_w<1>)); -uint8_t supracan_state::umc6650_data_r() -{ - if (m_umc6650_addr >= 0x20 && m_umc6650_addr < 0x2f) - return m_umc6650key[m_umc6650_addr & 0xf]; - return m_umc6650_data[m_umc6650_addr]; -} + map(0xe90b3c, 0xe90b3d).noprw(); // noisy during lockout checks -void supracan_state::umc6650_data_w(uint8_t data) -{ - m_umc6650_data[m_umc6650_addr] = data; -} + map(0xeb0d00, 0xeb0d03).rw(m_lockout, FUNC(umc6650_device::read), FUNC(umc6650_device::write)).umask16(0x00ff); -void supracan_state::supracan_mem(address_map &map) -{ - // 0x000000..0x3fffff is mapped by the cartslot - map(0xe80000, 0xe8ffff).rw(FUNC(supracan_state::_68k_soundram_r), FUNC(supracan_state::_68k_soundram_w)); - map(0xe90000, 0xe9001f).rw(FUNC(supracan_state::sound_r), FUNC(supracan_state::sound_w)); - map(0xe90020, 0xe9002f).w(FUNC(supracan_state::dma_channel0_w)); - map(0xe90030, 0xe9003f).w(FUNC(supracan_state::dma_channel1_w)); - - map(0xeb0d00, 0xeb0d01).rw(FUNC(supracan_state::umc6650_data_r), FUNC(supracan_state::umc6650_data_w)).umask16(0x00ff); - map(0xeb0d02, 0xeb0d03).w(FUNC(supracan_state::umc6650_addr_w)).umask16(0x00ff); + map(0xec0000, 0xecffff).rw(m_cart, FUNC(superacan_cart_slot_device::nvram_r), FUNC(superacan_cart_slot_device::nvram_w)).umask16(0x00ff); map(0xf00000, 0xf001ff).rw(FUNC(supracan_state::video_r), FUNC(supracan_state::video_w)); map(0xf00200, 0xf003ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0xf40000, 0xf5ffff).ram().w(FUNC(supracan_state::vram_w)).share("vram"); + map(0xf80000, 0xfbffff).view(m_main_hiview); + m_main_hiview[0](0xf80000, 0xfbffff).r(m_cart, FUNC(superacan_cart_slot_device::rom_r)); + m_main_hiview[0](0xf80000, 0xf80fff).rom().region(m_internal68, 0); + m_main_hiview[1](0xf80000, 0xfbffff).r(m_cart, FUNC(superacan_cart_slot_device::rom_r)); map(0xfc0000, 0xfcffff).mirror(0x30000).ram(); /* System work ram */ } @@ -1402,6 +1521,10 @@ uint8_t supracan_state::_6502_soundmem_r(offs_t offset) } break; } + case 0x406: + // staiwbbl: pad +5V presence? + // Will flip and pass bits 1-0 to 0x407 writes + return 0x00; case 0x410: data = m_soundcpu_irq_enable; if (!machine().side_effects_disabled()) @@ -1411,13 +1534,17 @@ uint8_t supracan_state::_6502_soundmem_r(offs_t offset) break; case 0x411: data = m_soundcpu_irq_source; - m_soundcpu_irq_source = 0; + // TODO: should really check for further pending irqs before acking if (!machine().side_effects_disabled()) { + m_soundcpu_irq_source = 0; LOGMASKED(LOG_SOUND, "%s: %s: 6502_soundmem_r: Sound IRQ source read + clear: %02x\n", machine().describe_context(), machine().time().to_string(), data); m_soundcpu->set_input_line(0, CLEAR_LINE); } break; + case 0x412: + // NMI acknowledge + break; case 0x420: if (!machine().side_effects_disabled()) { @@ -1469,7 +1596,7 @@ void supracan_state::_6502_soundmem_w(offs_t offset, uint8_t data) { if (BIT(lowered, pad + 0)) { - m_latched_controls[pad] = m_pads[pad]->read(); + m_latched_controls[pad] = m_pad[pad]->read(); } if (BIT(lowered, pad + 2)) { @@ -1484,8 +1611,23 @@ void supracan_state::_6502_soundmem_w(offs_t offset, uint8_t data) } break; } + // written with 0x06 at game startups, prior to enabling sound irqs + // (NMI + master irq enable?) + //case 0x409: + //break; + case 0x40a: + // speedyd/magipool uses this to request main to kickoff a sound DMA. + // gamblord/formduel just sets this just to poll a sound command + // all sets up 0x40c/0x40d as a buffer, and 0x40a to check if the irq is valid + // TODO: staiwbbl writes here from 68k side + // which raises a nopped irq service for now, may just acknowledge instead + m_maincpu->set_input_line(6, HOLD_LINE); + m_soundram[0x40a] = data; + break; case 0x410: m_soundcpu_irq_enable = data; + // gamblord (at least) checks for pending irqs + m_soundcpu->set_input_line(0, (m_soundcpu_irq_enable & m_soundcpu_irq_source) ? ASSERT_LINE : CLEAR_LINE); LOGMASKED(LOG_SOUND | LOG_IRQS, "%s: 6502_soundmem_w: IRQ enable: %02x\n", machine().describe_context(), data); break; case 0x420: @@ -1510,55 +1652,11 @@ void supracan_state::_6502_soundmem_w(offs_t offset, uint8_t data) } } -void supracan_state::supracan_sound_mem(address_map &map) +void supracan_state::sound_map(address_map &map) { map(0x0000, 0xffff).rw(FUNC(supracan_state::_6502_soundmem_r), FUNC(supracan_state::_6502_soundmem_w)).share("soundram"); } -static INPUT_PORTS_START( supracan ) - PORT_START("P1") - PORT_BIT(0x000f, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_PLAYER(1) PORT_NAME("P1 Button R") - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(1) PORT_NAME("P1 Button L") - PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(1) PORT_NAME("P1 Button Y") - PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1) PORT_NAME("P1 Button X") - PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_NAME("P1 Joypad Right") - PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_NAME("P1 Joypad Left") - PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_NAME("P1 Joypad Down") - PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_NAME("P1 Joypad Up") - PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_START1) - PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(1) PORT_NAME("P1 Button B") - PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1) PORT_NAME("P1 Button A") - - PORT_START("P2") - PORT_BIT(0x000f, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_PLAYER(2) PORT_NAME("P2 Button R") - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(2) PORT_NAME("P2 Button L") - PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2) PORT_NAME("P2 Button Y") - PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) PORT_NAME("P2 Button X") - PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_NAME("P2 Joypad Right") - PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_NAME("P2 Joypad Left") - PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_NAME("P2 Joypad Down") - PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_NAME("P2 Joypad Up") - PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_START2) - PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2) PORT_NAME("P2 Button B") - PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) PORT_NAME("P2 Button A") -INPUT_PORTS_END - -void supracan_state::palette_init(palette_device &palette) const -{ - // Used for debugging purposes for now - for (int i = 0; i < 32768; i++) - { - int const r = (i & 0x1f) << 3; - int const g = ((i >> 5) & 0x1f) << 3; - int const b = ((i >> 10) & 0x1f) << 3; - palette.set_pen_color(i, r, g, b); - } -} - void supracan_state::_68k_soundram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { m_soundram[offset * 2 + 1] = data & 0xff; @@ -1583,6 +1681,13 @@ uint16_t supracan_state::_68k_soundram_r(offs_t offset, uint16_t mem_mask) uint16_t data = m_soundram[offset * 2] << 8; data |= m_soundram[offset * 2 + 1]; + // formduel, jttlaugh & speedyd all wants polling in "direct mode" from 68k + if ((offset * 2) == 0x200) + return m_pad[0]->read() ^ 0xffff; + + if ((offset * 2) == 0x202) + return m_pad[1]->read() ^ 0xffff; + if (offset * 2 >= 0x400 && offset * 2 < 0x500) { data = 0; @@ -1600,78 +1705,165 @@ uint16_t supracan_state::_68k_soundram_r(offs_t offset, uint16_t mem_mask) return data; } -uint16_t supracan_state::sound_r(offs_t offset, uint16_t mem_mask) +TIMER_CALLBACK_MEMBER(supracan_state::frc_timer_cb) { - uint16_t data = 0; - - switch (offset) - { - case 0x04/2: - data = (m_soundram[0x40c] << 8) | m_soundram[0x40d]; - LOGMASKED(LOG_SOUND, "%s: sound_r: DMA Request address from 6502, %08x: %04x & %04x\n", machine().describe_context(), 0xe90000 + (offset << 1), data, mem_mask); - break; - - case 0x0c/2: - data = m_soundram[0x40a]; - LOGMASKED(LOG_SOUND, "%s: sound_r: DMA Request flag from 6502, %08x: %04x & %04x\n", machine().describe_context(), 0xe90000 + (offset << 1), data, mem_mask); - machine().debug_break(); - break; - - default: - LOGMASKED(LOG_SOUND | LOG_UNKNOWNS, "%s: sound_r: Unknown register: %08x & %04x\n", machine().describe_context(), 0xe90000 + (offset << 1), mem_mask); - break; - } + m_maincpu->set_input_line(3, HOLD_LINE); - return data; + update_frc_state(); } -void supracan_state::sound_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void supracan_state::update_frc_state() { - switch (offset) - { - case 0x000a/2: /* Sound cpu IRQ request. */ - LOGMASKED(LOG_SOUND, "%s: Sound CPU IRQ request: %04x\n", machine().describe_context(), data); - set_sound_irq(5, 1); - //m_soundcpu->set_input_line(0, ASSERT_LINE); - break; - case 0x001c/2: /* Sound cpu control. Bit 0 tied to sound cpu RESET line, Bit 2 internal ROM lockout? */ + if ((m_frc_control & 0xff00) == 0xa200) { - const uint16_t old = m_sound_cpu_ctrl; - m_sound_cpu_ctrl = data; - const uint16_t changed = old ^ m_sound_cpu_ctrl; - if (BIT(changed, 3) && BIT(data, 3)) - { - m_internal68_view_hi.select(1); - } + const u32 period = ((m_frc_control & 0xff << 16) | (m_frc_frequency)); - if (BIT(changed, 1) && BIT(data, 1)) + // HACK: handle case by case until we resolve the equation + // (particularly with variable frequencies) + switch(m_frc_control & 0xf) { - m_internal68_view.select(1); + // speedyd: sets this up to 0xa0d6 / 0x0000 at boot, then goes 0xa200 0x013a + // - dictates a very slow timer (pinpoint for what); + // - would give massive slowdowns during gameplay if too many fires; + case 0: + m_frc_timer->adjust(attotime::from_hz(1)); + break; + + // magipool: sets 0xa201 / 0x0104 at startup, sometimes flips frequency to 0x0046 + // - causes a crash at boot if too fast; + // - takes roughly 6 seconds for a title screen individual kanji to move right-to-left; + case 1: + m_frc_timer->adjust(m_maincpu->cycles_to_attotime(1024 * period), 0); + break; + + // gamblord: sets 0xa20f normally, plays with frequency register a lot. + // - takes ~13 seconds for title screen to complete animation; + // - takes ~1 second for character screen to switch; + // - during gameplay sometimes switches to 0xa200 / 0xffff; + case 0xf: + m_frc_timer->adjust(m_maincpu->cycles_to_attotime(8192 * period), 0); + break; + + default: + popmessage("Attempt to fire up FRC with %04x %04x", m_frc_control, m_frc_frequency); + break; } + } + else + m_frc_timer->adjust(attotime::never); +} - if (BIT(changed, 0)) - { - if (BIT(m_sound_cpu_ctrl, 0)) +void supracan_state::host_um6619_map(address_map &map) +{ + map(0x04, 0x05).lr8( + NAME([this] (offs_t offset) { + const u8 res = m_soundram[0x40c + offset]; + LOGMASKED(LOG_SOUND, "%s DMA Request address from 6502 [%04x] %02x\n", machine().describe_context(), offset + 0x404, res); + return res; + }) + ); + // TODO: verify $b access + map(0x0a, 0x0b).lw8( + NAME([this] (offs_t offset, u8 data) { + LOGMASKED(LOG_SOUND, "%s Sound CPU IRQ request [%02x]: %02x\n", machine().describe_context(), offset + 0x40a, data); + set_sound_irq(5, 1); + }) + ); + // TODO: verify $d access reads + // noisy in staiwbbl, expects an 0xff value just after clearing $e8040a + // Playing with it makes BGM and samples to be initialized properly in gameplay. + map(0x0c, 0x0d).lr8( + NAME([this] (offs_t offset) { + const u8 res = m_soundram[0x40a]; + LOGMASKED(LOG_SOUND, "%s: DMA Request flag from 6502, [%02x]: %02x\n", machine().describe_context(), offset + 0x40c, res); + return res; + }) + ); + // games tend to write bytes, which implies a smearing mirror living here. + map(0x10, 0x11).lrw8( + NAME([this] (offs_t offset) { + return m_irq_mask; + }), + NAME([this] (offs_t offset, u8 data) { + // bit 7: enabled by slghtsag after BIOS (would otherwise address error) + // other bits tbd (bit 3 doesn't seem irq 3 enable as per speedyd not enabling it) + //logerror("irq mask %02x @ VPOS %d\n", data, m_screen->vpos()); + m_irq_mask = data; + }) + ); + map(0x14, 0x15).lrw16( + NAME([this] (offs_t offset) { + return m_frc_control; + }), + NAME([this] (offs_t offset, u16 data, u16 mem_mask) { + COMBINE_DATA(&m_frc_control); + logerror("FRC control %04x & %04x\n", data, mem_mask); + update_frc_state(); + }) + ); + map(0x16, 0x17).lrw16( + NAME([this] (offs_t offset) { + return m_frc_frequency; + }), + NAME([this] (offs_t offset, u16 data, u16 mem_mask) { + COMBINE_DATA(&m_frc_frequency); + logerror("FRC frequency %04x & %04x\n", data, mem_mask); + update_frc_state(); + }) + ); + map(0x18, 0x19).lr16( + NAME([this] (offs_t offset) { + // formduel uses this to scroll the game over rain layer, in both X & Y directions. + // TODO: details, obviously. + if (!machine().side_effects_disabled()) + logerror("$e90018: RNG read?\n"); + return m_soundcpu->total_cycles() % (0xffff); + }) + ); + /** + * x--- to hiview lockout + * -x-- internal ROM lockout? + * --x- to loview lockout + * ---x sound reset + */ + // TODO: likely 8-bit + map(0x1c, 0x1d).lrw16( + NAME([this] (offs_t offset) { + // BIOS rmw the result, at least in speedyd + return m_sound_cpu_ctrl; + }), + NAME([this] (offs_t offset, u16 data, u16 mem_mask) { + const uint16_t old = m_sound_cpu_ctrl; + COMBINE_DATA(&m_sound_cpu_ctrl); + const uint16_t changed = old ^ m_sound_cpu_ctrl; + if (BIT(changed, 3) && BIT(data, 3)) { - /* Reset and enable the sound cpu */ - m_soundcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - m_soundcpu->reset(); + m_main_hiview.select(1); } - else + + if (BIT(changed, 1) && BIT(data, 1)) { - /* Halt the sound cpu */ - m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_main_loview.select(1); } - } - LOGMASKED(LOG_SOUND, "%s: Sound CPU ctrl write: %04x\n", machine().describe_context(), data); - break; - } - default: - LOGMASKED(LOG_SOUND | LOG_UNKNOWNS, "%s: sound_w: Unknown register: %08x = %04x & %04x\n", machine().describe_context(), 0xe90000 + (offset << 1), data, mem_mask); - break; - } -} + if (BIT(changed, 0)) + { + if (BIT(m_sound_cpu_ctrl, 0)) + { + /* Reset and enable the sound cpu */ + m_soundcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_soundcpu->reset(); + } + else + { + /* Halt the sound cpu */ + m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + } + } + LOGMASKED(LOG_SOUND, "%s: Sound CPU ctrl write: %04x\n", machine().describe_context(), data); + }) + ); +} uint16_t supracan_state::video_r(offs_t offset, uint16_t mem_mask) { @@ -1680,18 +1872,26 @@ uint16_t supracan_state::video_r(offs_t offset, uint16_t mem_mask) switch (offset) { case 0x00/2: // Video IRQ flags + data = m_screen->vpos() >= 240 ? 0x8000 : 0; + // checked by sonevil in vblank routine, assume ODD flag + if (m_screen->frame_number() & 1) + data |= 2; if (!machine().side_effects_disabled()) { LOGMASKED(LOG_HFVIDEO, "read video IRQ flags (%04x)\n", data); + // TODO: should likely ack from the UM6619 bit 7 == 0 not here + // sonevil will flip vblank mask a lot, + // which may explain why it checks the current scanline inside irq service. m_maincpu->set_input_line(7, CLEAR_LINE); } - break; + return data; case 0x02/2: // Current scanline - LOGMASKED(LOG_VIDEO, "read current scanline (%04x)\n", data); - break; + data = m_screen->vpos(); + LOGMASKED(LOG_VIDEO, "read current scanline (%04x / %d)\n", data, data); + return data; case 0x08/2: // Unknown (not video flags!) - gambling lord disagrees, it MUST read back what it wrote because it reads it before turning on/off layers and writes it back - LOGMASKED(LOG_VIDEO, "read unkown 0x08 (%04x)\n", data); - break; + LOGMASKED(LOG_VIDEO, "read video flags [0x08] %04x & %04x\n", m_video_flags, mem_mask); + return m_video_flags; case 0x100/2: if (!machine().side_effects_disabled()) { @@ -1710,6 +1910,8 @@ uint16_t supracan_state::video_r(offs_t offset, uint16_t mem_mask) LOGMASKED(LOG_TILEMAP1, "read tilemap_flags[1] (%04x)\n", data); } break; + case 0x1f0/2: + return m_pixel_mode | m_gfx_mode; default: if (!machine().side_effects_disabled()) { @@ -1721,38 +1923,29 @@ uint16_t supracan_state::video_r(offs_t offset, uint16_t mem_mask) return data; } -TIMER_CALLBACK_MEMBER(supracan_state::hbl_callback) -{ - m_maincpu->set_input_line(3, HOLD_LINE); - - m_hbl_timer->adjust(attotime::never); -} -TIMER_CALLBACK_MEMBER(supracan_state::line_on_callback) +TIMER_CALLBACK_MEMBER(supracan_state::line_on_cb) { m_maincpu->set_input_line(5, HOLD_LINE); m_line_on_timer->adjust(attotime::never); } -TIMER_CALLBACK_MEMBER(supracan_state::line_off_callback) +TIMER_CALLBACK_MEMBER(supracan_state::line_off_cb) { m_maincpu->set_input_line(5, CLEAR_LINE); m_line_on_timer->adjust(attotime::never); } -TIMER_CALLBACK_MEMBER(supracan_state::video_callback) +// TODO: derive from param, merge with line_on/_off stuff +TIMER_CALLBACK_MEMBER(supracan_state::scanline_cb) { int vpos = m_screen->vpos(); - m_video_regs[0] &= ~0x0002; - switch (vpos) { case 0: - m_video_regs[0] &= 0x7fff; - // we really need better management of this mark_active_tilemap_all_dirty(0); mark_active_tilemap_all_dirty(1); @@ -1760,30 +1953,32 @@ TIMER_CALLBACK_MEMBER(supracan_state::video_callback) mark_active_tilemap_all_dirty(3); break; - case 224: // FIXME: Son of Evil is pretty picky about this one, a timing of 240 makes it crash - m_video_regs[0] |= 0x8000; - break; - case 240: - if (m_irq_mask & 1) + if (BIT(m_irq_mask, 7)) { LOGMASKED(LOG_IRQS, "Triggering VBL IRQ\n\n"); m_maincpu->set_input_line(7, HOLD_LINE); + // TODO: ack, from $412? + // staiwbbl requires this for inputs to work + m_soundcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } break; + default: + // Effectively used by sangofgt only for clipping effects + // gamblord, monopoly, magipool also enables this but service is rte for all. + if (vpos < 240 && BIT(m_irq_mask, 4)) + m_maincpu->set_input_line(4, HOLD_LINE); + break; } - m_video_regs[1] = m_screen->vpos() - 16; // for son of evil, wants vblank active around 224 instead... - - m_hbl_timer->adjust(m_screen->time_until_pos(vpos, 320)); - m_video_timer->adjust(m_screen->time_until_pos((vpos + 1) % 256, 0)); + m_video_timer->adjust(m_screen->time_until_pos((vpos + 1) % 262, 0)); } void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) { address_space &mem = m_maincpu->space(AS_PROGRAM); - // if any of this changes we need a partial update (see sango fighters intro) + // if any of this changes we need a partial update (see sangofgt intro) m_screen->update_partial(m_screen->vpos()); COMBINE_DATA(&m_video_regs[offset]); @@ -1845,7 +2040,7 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) { mem.write_word(m_sprdma_regs.dst, 0); m_sprdma_regs.dst += 2 * m_sprdma_regs.dst_inc; - //memset(supracan_vram, 0x00, 0x020000); + //memset(vram, 0x00, 0x020000); } else { @@ -1865,12 +2060,29 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOGMASKED(LOG_VIDEO, "video_flags = %04x\n", data); - m_video_flags = data; + if (data & 0xc00) + popmessage("Interlace enable %04x", data & 0xc00); - rectangle visarea = m_screen->visible_area(); + // TODO: verify if this support midframe switching + if ((data & 0x300) != (m_video_flags & 0x300)) + { + rectangle visarea = m_screen->visible_area(); + const int h320_mode = BIT(data, 8); + // enabled by sangofgt (224 + 16 borders), magipool wants (240) + const int overscan_mode = BIT(data, 9); + + const int htotal = h320_mode ? 455 : 342; + const int divider = h320_mode ? 8 : 10; - visarea.set(0, ((m_video_flags & 0x100) ? 320 : 256) - 1, 8, 232 - 1); - m_screen->configure(348, 256, visarea, m_screen->frame_period().attoseconds()); + const int vdisplay_start = overscan_mode ? 8 : 0; + const int vdisplay_end = overscan_mode ? 232 : 240; + + visarea.set(0, (h320_mode ? 320 : 256) - 1, vdisplay_start, vdisplay_end - 1); + m_screen->configure(htotal, 262, visarea, attotime::from_ticks(htotal * 262, U13_CLOCK / divider).as_attoseconds()); + //m_screen->reset_origin(0, 0); + } + + m_video_flags = data; } break; case 0x0a/2: @@ -1878,6 +2090,7 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) LOGMASKED(LOG_IRQS, "Raster 'line on' IRQ Trigger write? = %04x\n", data); if (data & 0x8000) { + // NOTE: sangofgt draws a garbage line strip at target line, but this happens on real HW as well m_line_on_timer->adjust(m_screen->time_until_pos((data & 0x00ff), 0)); } else @@ -1901,31 +2114,62 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) /* Sprites */ case 0x20/2: m_sprite_base_addr = data << 2; LOGMASKED(LOG_SPRITES, "sprite_base_addr = %04x\n", data); break; case 0x22/2: m_sprite_count = data + 1; LOGMASKED(LOG_SPRITES, "sprite_count = %d\n", data + 1); break; + case 0x24/2: m_sprite_mono_color = data & 0xff; break; case 0x26/2: m_sprite_flags = data; LOGMASKED(LOG_SPRITES, "sprite_flags = %04x\n", data); break; /* Tilemap 0 */ - case 0x100/2: m_tilemap_flags[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_flags[0] = %04x\n", data); break; + case 0x100/2: { + m_tilemap_flags[0] = data; + LOGMASKED(LOG_TILEMAP0, "tilemap_flags[0] = %04x\n", data); + update_tilemap_flags(0); + break; + } + case 0x102/2: m_tilemap_tile_mode[0] = data; break; case 0x104/2: m_tilemap_scrollx[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_scrollx[0] = %04x\n", data); break; case 0x106/2: m_tilemap_scrolly[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_scrolly[0] = %04x\n", data); break; case 0x108/2: m_tilemap_base_addr[0] = data << 1; LOGMASKED(LOG_TILEMAP0, "tilemap_base_addr[0] = %05x\n", data << 2); break; case 0x10a/2: m_tilemap_mode[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_mode[0] = %04x\n", data); break; + case 0x10c/2: m_tilemap_linescrollx_addr[0] = data; break; + case 0x10e/2: m_tilemap_lineselect_addr[0] = data; break; /* Tilemap 1 */ - case 0x120/2: m_tilemap_flags[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_flags[1] = %04x\n", data); break; + case 0x120/2: { + m_tilemap_flags[1] = data; + LOGMASKED(LOG_TILEMAP1, "tilemap_flags[1] = %04x\n", data); + update_tilemap_flags(1); + break; + } + case 0x122/2: m_tilemap_tile_mode[1] = data; break; case 0x124/2: m_tilemap_scrollx[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_scrollx[1] = %04x\n", data); break; case 0x126/2: m_tilemap_scrolly[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_scrolly[1] = %04x\n", data); break; case 0x128/2: m_tilemap_base_addr[1] = data << 1; LOGMASKED(LOG_TILEMAP1, "tilemap_base_addr[1] = %05x\n", data << 2); break; case 0x12a/2: m_tilemap_mode[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_mode[1] = %04x\n", data); break; - - /* Tilemap 2? */ - case 0x140/2: m_tilemap_flags[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_flags[2] = %04x\n", data); break; + case 0x12c/2: m_tilemap_linescrollx_addr[1] = data; break; + case 0x12e/2: m_tilemap_lineselect_addr[1] = data; break; + + /* Tilemap 2 */ + case 0x140/2: { + m_tilemap_flags[2] = data; + LOGMASKED(LOG_TILEMAP2, "tilemap_flags[2] = %04x\n", data); + update_tilemap_flags(2); + break; + } + case 0x142/2: m_tilemap_tile_mode[2] = data; break; case 0x144/2: m_tilemap_scrollx[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_scrollx[2] = %04x\n", data); break; case 0x146/2: m_tilemap_scrolly[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_scrolly[2] = %04x\n", data); break; case 0x148/2: m_tilemap_base_addr[2] = data << 1; LOGMASKED(LOG_TILEMAP2, "tilemap_base_addr[2] = %05x\n", data << 2); break; case 0x14a/2: m_tilemap_mode[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_mode[2] = %04x\n", data); break; + case 0x14c/2: m_tilemap_linescrollx_addr[2] = data; break; + case 0x14e/2: m_tilemap_lineselect_addr[2] = data; break; /* ROZ */ - case 0x180/2: m_roz_mode = data; LOGMASKED(LOG_ROZ, "roz_mode = %04x\n", data); break; + case 0x180/2: { + m_roz_mode = data; + LOGMASKED(LOG_ROZ, "roz_mode = %04x\n", data); + //update_tilemap_flags(ROZ_LAYER_NUMBER); + break; + } + case 0x182/2: m_roz_tile_mode = data; break; case 0x184/2: m_roz_scrollx = (data << 16) | (m_roz_scrollx & 0xffff); m_roz_changed |= 1; LOGMASKED(LOG_ROZ, "roz_scrollx = %08x\n", m_roz_scrollx); break; case 0x186/2: m_roz_scrollx = (data) | (m_roz_scrollx & 0xffff0000); m_roz_changed |= 1; LOGMASKED(LOG_ROZ, "roz_scrollx = %08x\n", m_roz_scrollx); break; case 0x188/2: m_roz_scrolly = (data << 16) | (m_roz_scrolly & 0xffff); m_roz_changed |= 2; LOGMASKED(LOG_ROZ, "roz_scrolly = %08x\n", m_roz_scrolly); break; @@ -1940,17 +2184,24 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) case 0x19a/2: m_roz_unk_base1 = data << 2; LOGMASKED(LOG_ROZ, "roz_unk_base1 = %05x\n", data << 2); break; case 0x19e/2: m_roz_unk_base2 = data << 2; LOGMASKED(LOG_ROZ, "roz_unk_base2 = %05x\n", data << 2); break; - case 0x1d0/2: m_unk_1d0 = data; LOGMASKED(LOG_UNKNOWNS, "unk_1d0 = %04x\n", data); break; - - case 0x1f0/2: // FIXME: this register is mostly not understood - m_irq_mask = data;//(data & 8) ? 0 : 1; -#if 0 - if (!m_irq_mask && !m_hbl_mask) - { - m_maincpu->set_input_line(7, CLEAR_LINE); - } -#endif - LOGMASKED(LOG_IRQS, "irq_mask = %04x\n", data); + // color mixing stuff goes here + case 0x1d0/2: COMBINE_DATA(&m_window_control[0]); break; + case 0x1d2/2: COMBINE_DATA(&m_window_start_addr[0]); break; + case 0x1d4/2: COMBINE_DATA(&m_window_scrollx[0]); break; + case 0x1d6/2: COMBINE_DATA(&m_window_scrolly[0]); break; + case 0x1d8/2: COMBINE_DATA(&m_window_control[1]); break; + case 0x1da/2: COMBINE_DATA(&m_window_start_addr[1]); break; + case 0x1dc/2: COMBINE_DATA(&m_window_scrollx[1]); break; + case 0x1de/2: COMBINE_DATA(&m_window_scrolly[1]); break; + + case 0x1f0/2: + m_pixel_mode = data & 0x18; + m_gfx_mode = data & 0x7; + if (m_pixel_mode & 0x10) + popmessage("Special pixel mode enabled!"); + if (m_gfx_mode >= 5) + popmessage("Reserved GFX mode set %02x", data); + //LOGMASKED(LOG_IRQS, "irq_mask = %04x\n", data); break; default: LOGMASKED(LOG_UNKNOWNS, "video_w: Unknown register: %08x = %04x & %04x\n", 0xf00000 + (offset << 1), data, mem_mask); @@ -1959,19 +2210,37 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) // m_video_regs[offset] = data; } +static INPUT_PORTS_START( supracan ) + PORT_START("P1") + PORT_BIT(0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("P1 Button R") + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("P1 Button L") + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 Button Y") + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Button X") + PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Right") + PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Left") + PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Down") + PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Up") + PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(1) + PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Button B") + PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Button A") -DEVICE_IMAGE_LOAD_MEMBER(supracan_state::cart_load) -{ - uint32_t size = m_cart->common_get_size("rom"); - - if (size > 0x40'0000) - return std::make_pair(image_error::INVALIDLENGTH, "Unsupported cartridge size (must be no larger than 4M)"); - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return std::make_pair(std::error_condition(), std::string()); -} + PORT_START("P2") + PORT_BIT(0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("P2 Button R") + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("P2 Button L") + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Button Y") + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Button X") + PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Right") + PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Left") + PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Down") + PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Up") + PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(2) + PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Button B") + PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Button A") +INPUT_PORTS_END void supracan_state::machine_start() @@ -2008,9 +2277,6 @@ void supracan_state::machine_start() save_item(NAME(m_tilemap_flags)); save_item(NAME(m_tilemap_mode)); save_item(NAME(m_irq_mask)); -#if 0 - save_item(NAME(m_hbl_mask)); -#endif save_item(NAME(m_roz_base_addr)); save_item(NAME(m_roz_mode)); @@ -2025,37 +2291,24 @@ void supracan_state::machine_start() save_item(NAME(m_roz_coeffc)); save_item(NAME(m_roz_coeffd)); save_item(NAME(m_roz_changed)); - save_item(NAME(m_unk_1d0)); + save_item(NAME(m_window_control)); + save_item(NAME(m_window_start_addr)); + save_item(NAME(m_window_scrollx)); + save_item(NAME(m_window_scrolly)); save_item(NAME(m_video_regs)); - save_item(NAME(m_umc6650_addr)); - save_item(NAME(m_umc6650_data)); - - m_video_timer = timer_alloc(FUNC(supracan_state::video_callback), this); - m_hbl_timer = timer_alloc(FUNC(supracan_state::hbl_callback), this); - m_line_on_timer = timer_alloc(FUNC(supracan_state::line_on_callback), this); - m_line_off_timer = timer_alloc(FUNC(supracan_state::line_off_callback), this); - - m_maincpu->space(AS_PROGRAM).install_view(0x000000, 0x3fffff, m_internal68_view); - m_maincpu->space(AS_PROGRAM).install_view(0xf80000, 0xfbffff, m_internal68_view_hi); - if (m_cart->exists()) - { - //m_maincpu->space(AS_PROGRAM).install_read_handler(0x000000, 0x3fffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); - m_internal68_view[0].install_read_handler(0x000000, 0x3fffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); - m_internal68_view[1].install_read_handler(0x000000, 0x3fffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); - m_internal68_view_hi[0].install_read_handler(0xf80000, 0xfbffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); - m_internal68_view_hi[1].install_read_handler(0xf80000, 0xfbffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); - } - m_internal68_view[0].install_rom(0x0000, 0x0fff, m_internal68); - m_internal68_view_hi[0].install_rom(0xf80000, 0xf80fff, m_internal68); + m_video_timer = timer_alloc(FUNC(supracan_state::scanline_cb), this); + m_frc_timer = timer_alloc(FUNC(supracan_state::frc_timer_cb), this); + m_line_on_timer = timer_alloc(FUNC(supracan_state::line_on_cb), this); + m_line_off_timer = timer_alloc(FUNC(supracan_state::line_off_cb), this); } void supracan_state::machine_reset() { - m_internal68_view.select(0); - m_internal68_view_hi.select(0); + m_main_loview.select(0); + m_main_hiview.select(0); m_sprite_count = 0; m_sprite_base_addr = 0; @@ -2078,12 +2331,8 @@ void supracan_state::machine_reset() m_roz_base_addr = 0; m_roz_mode = 0; std::fill(std::begin(m_tilemap_base_addr), std::end(m_tilemap_base_addr), 0); - - m_umc6650_addr = 0; - std::fill(std::begin(m_umc6650_data), std::end(m_umc6650_data), 0); } -/* gfxdecode is retained for reference purposes but not otherwise used by the driver */ static const gfx_layout supracan_gfx8bpp = { 8, 8, @@ -2119,7 +2368,6 @@ static const gfx_layout supracan_gfx2bpp = 8*16 }; - static const uint32_t xtexlayout_xoffset[64] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23, 24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44, 45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 }; @@ -2132,6 +2380,7 @@ static const uint32_t xtexlayout_yoffset[64] = { 0*64,1*64,2*64,3*64,4*64,5*64, 40*64,41*64,42*64,43*64,44*64,45*64,46*64,47*64, 48*64,49*64,50*64,51*64,52*64,53*64,54*64,55*64, 56*64,57*64,58*64,59*64,60*64,61*64,62*64,63*64 }; + static const gfx_layout supracan_gfx1bpp = { 64, 64, @@ -2165,40 +2414,50 @@ static GFXDECODE_START( gfx_supracan ) GFXDECODE_RAM( "vram", 0, supracan_gfx1bpp_alt, 0, 0x80 ) GFXDECODE_END +static void superacan_cart_types(device_slot_interface &device) +{ + device.option_add_internal("std", SUPERACAN_ROM_STD); +} + + void supracan_state::supracan(machine_config &config) { - M68000(config, m_maincpu, XTAL(10'738'635)); /* Correct frequency unknown */ - m_maincpu->set_addrmap(AS_PROGRAM, &supracan_state::supracan_mem); + // M68000P10 + M68000(config, m_maincpu, U13_CLOCK / 6); + m_maincpu->set_addrmap(AS_PROGRAM, &supracan_state::main_map); - M6502(config, m_soundcpu, XTAL(3'579'545)); /* TODO: Verify actual clock */ - m_soundcpu->set_addrmap(AS_PROGRAM, &supracan_state::supracan_sound_mem); + // TODO: Verify type and actual clock + // /4 makes speedyd to fail booting + M65C02(config, m_soundcpu, U13_CLOCK / 6 / 2); + m_soundcpu->set_addrmap(AS_PROGRAM, &supracan_state::sound_map); config.set_perfect_quantum(m_soundcpu); + UMC6650(config, m_lockout, 0); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(XTAL(10'738'635)/2, 348, 0, 256, 256, 0, 240); /* No idea if this is correct */ + m_screen->set_raw(U13_CLOCK / 10, 342, 0, 256, 262, 8, 232); m_screen->set_screen_update(FUNC(supracan_state::screen_update)); m_screen->set_palette("palette"); //m_screen->screen_vblank().set(FUNC(supracan_state::screen_vblank)); - PALETTE(config, "palette", FUNC(supracan_state::palette_init)).set_format(palette_device::xBGR_555, 32768); + PALETTE(config, "palette").set_format(palette_device::xBGR_555, 256); GFXDECODE(config, m_gfxdecode, "palette", gfx_supracan); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ACANSND(config, m_sound, XTAL(3'579'545)); + // TODO: derive and verify from U13_CLOCK + UMC6619_SOUND(config, m_sound, XTAL(3'579'545)); m_sound->ram_read().set(FUNC(supracan_state::sound_ram_read)); m_sound->timer_irq_handler().set(FUNC(supracan_state::sound_timer_irq)); m_sound->dma_irq_handler().set(FUNC(supracan_state::sound_dma_irq)); m_sound->add_route(0, "lspeaker", 1.0); m_sound->add_route(1, "rspeaker", 1.0); - generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "supracan_cart")); - cartslot.set_width(GENERIC_ROM16_WIDTH); - cartslot.set_endian(ENDIANNESS_BIG); - cartslot.set_device_load(FUNC(supracan_state::cart_load)); + // TODO: clock for cart is (again) unconfirmed + SUPERACAN_CART_SLOT(config, m_cart, U13_CLOCK / 6, superacan_cart_types, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("supracan"); } @@ -2208,10 +2467,6 @@ ROM_START( supracan ) // 68k internal ROM (security related) ROM_LOAD16_WORD_SWAP( "internal_68k.bin", 0x0000, 0x1000, CRC(8d575662) SHA1(a8e75633662978d0a885f16a4ed0f898f278a10a) ) - ROM_REGION(0x10, "umc6650key", ROMREGION_ERASEFF) - // 68k internal ROM (security related) - ROM_LOAD( "umc6650.bin", 0x00, 0x10, CRC(0ba78597) SHA1(f94805457976d60b91e8df18f9f49cccec77be78) ) - ROM_REGION(0x2000, "internal6502", ROMREGION_ERASEFF) // 2 additional blocks of ROM(?) can be seen next to the 68k ROM on a die shot from Furrtek ROM_LOAD( "internal_6502_1.bin", 0x0000, 0x1000, NO_DUMP ) @@ -2222,4 +2477,4 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */ -CONS( 1995, supracan, 0, 0, supracan, supracan, supracan_state, empty_init, "Funtech Entertainment", "Super A'Can", MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) +CONS( 1995, supracan, 0, 0, supracan, supracan, supracan_state, empty_init, "Funtech Entertainment", "Super A'Can", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) diff --git a/src/mame/funtech/acan.cpp b/src/mame/funtech/umc6619_sound.cpp similarity index 73% rename from src/mame/funtech/acan.cpp rename to src/mame/funtech/umc6619_sound.cpp index 589f93972d567..4f8c19f3d5104 100644 --- a/src/mame/funtech/acan.cpp +++ b/src/mame/funtech/umc6619_sound.cpp @@ -2,23 +2,25 @@ // copyright-holders:Ryan Holtz, superctr /*************************************************************************** - Super A'Can sound driver + Super A'Can UMC 6619 sound driver Currently has a number of unknown registers and functionality. ****************************************************************************/ #include "emu.h" -#include "acan.h" +#include "umc6619_sound.h" -#define VERBOSE (1) +#define VERBOSE (0) #include "logmacro.h" +#define LIVE_AUDIO_VIEW 0 + // device type definition -DEFINE_DEVICE_TYPE(ACANSND, acan_sound_device, "acansound", "Super A'Can Audio") +DEFINE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device, "umc6619_sound", "UMC UM6619 Sound Engine") -acan_sound_device::acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ACANSND, tag, owner, clock) +umc6619_sound_device::umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, UMC6619_SOUND, tag, owner, clock) , device_sound_interface(mconfig, *this) , m_stream(nullptr) , m_timer(nullptr) @@ -31,11 +33,11 @@ acan_sound_device::acan_sound_device(const machine_config &mconfig, const char * } -void acan_sound_device::device_start() +void umc6619_sound_device::device_start() { m_stream = stream_alloc(0, 2, clock() / 16 / 5); m_mix = std::make_unique((clock() / 16 / 5) * 2); - m_timer = timer_alloc(FUNC(acan_sound_device::channel_irq), this); + m_timer = timer_alloc(FUNC(umc6619_sound_device::channel_irq), this); // register for savestates save_item(NAME(m_active_channels)); @@ -53,21 +55,40 @@ void acan_sound_device::device_start() save_item(STRUCT_MEMBER(m_channels, volume_l)); save_item(STRUCT_MEMBER(m_channels, volume_r)); save_item(STRUCT_MEMBER(m_channels, one_shot)); + save_item(STRUCT_MEMBER(m_channels, unk_upper_05)); save_item(NAME(m_regs)); } -void acan_sound_device::device_reset() +void umc6619_sound_device::device_reset() { m_active_channels = 0; m_dma_channels = 0; std::fill(std::begin(m_regs), std::end(m_regs), 0); + for (auto &channel : m_channels) + { + channel.pitch = 0; + channel.length = 0; + channel.start_addr = 0; + channel.curr_addr = 0; + channel.end_addr = 0; + channel.addr_increment = 0; + channel.frac = 0; + channel.register9 = 0; + std::fill(std::begin(channel.envelope), std::end(channel.envelope), 0); + channel.volume = 0; + channel.volume_l = 0; + channel.volume_r = 0; + channel.one_shot = false; + channel.unk_upper_05 = 0; + } + m_timer->reset(); m_timer_irq_handler(0); m_dma_irq_handler(0); } -TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq) +TIMER_CALLBACK_MEMBER(umc6619_sound_device::channel_irq) { if (m_regs[0x14] & 0x40) { @@ -79,10 +100,45 @@ TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq) } } -void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +std::string umc6619_sound_device::print_audio_state() +{ + std::ostringstream outbuffer; + + util::stream_format(outbuffer, "channel | address | length | pitch | one? | vol | DMA? | (unk09) |\n"); + + for (int i = 0; i < 16; i++) + { + acan_channel &channel = m_channels[i]; + + util::stream_format(outbuffer, "%02d: %01d | %04x (%04x-%04x) | %04x | %04x | %d (%02x)| %02x | %02x | %02x %02x %02x %02x|\n" + , i + , BIT(m_active_channels, i) + , channel.curr_addr + , (channel.start_addr << 6) & 0xffff + , channel.end_addr + , channel.length + , channel.pitch + , channel.one_shot + , channel.unk_upper_05 + , channel.volume + , channel.register9 + , channel.envelope[0] + , channel.envelope[1] + , channel.envelope[2] + , channel.envelope[3] + ); + } + + return outbuffer.str(); +} + +void umc6619_sound_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { std::fill_n(&m_mix[0], outputs[0].samples() * 2, 0); + if (LIVE_AUDIO_VIEW) + popmessage(print_audio_state()); + for (int i = 0; i < 16 && m_active_channels != 0; i++) { if (BIT(m_active_channels, i)) @@ -130,7 +186,7 @@ void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector> 4) & 0x0f; const uint8_t lower = offset & 0x0f; + m_stream->update(); m_regs[offset] = data; switch (upper) @@ -237,6 +295,7 @@ void acan_sound_device::write(offs_t offset, uint8_t data) acan_channel &channel = m_channels[lower]; channel.length = 0x40 << ((data & 0x0e) >> 1); channel.one_shot = BIT(data, 0); + channel.unk_upper_05 = data & 0xf0; LOG("%s: Waveform length and attributes (voice %02x): %02x\n", machine().describe_context(), lower, data); break; } @@ -285,6 +344,10 @@ void acan_sound_device::write(offs_t offset, uint8_t data) break; } + // case 4: + // Normally 0x03 for keyon channels, 0x01 for streaming DMAs + // (staiwbbl, formduel, sangofgt) + default: LOG("Unknown sound register: %02x = %02x\n", offset, data); break; diff --git a/src/mame/funtech/acan.h b/src/mame/funtech/umc6619_sound.h similarity index 78% rename from src/mame/funtech/acan.h rename to src/mame/funtech/umc6619_sound.h index 8828768219ed9..17dff54dc462f 100644 --- a/src/mame/funtech/acan.h +++ b/src/mame/funtech/umc6619_sound.h @@ -6,15 +6,15 @@ **********************************************************************/ -#ifndef MAME_FUNTECH_ACAN_H -#define MAME_FUNTECH_ACAN_H +#ifndef MAME_FUNTECH_UM6619_SOUND_H +#define MAME_FUNTECH_UM6619_SOUND_H #pragma once -class acan_sound_device : public device_t, public device_sound_interface +class umc6619_sound_device : public device_t, public device_sound_interface { public: - acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); auto ram_read() { return m_ram_read.bind(); } auto timer_irq_handler() { return m_timer_irq_handler.bind(); } @@ -49,6 +49,7 @@ class acan_sound_device : public device_t, public device_sound_interface uint8_t volume_l; uint8_t volume_r; bool one_shot; + uint8_t unk_upper_05; }; void keyon_voice(uint8_t voice); @@ -63,8 +64,10 @@ class acan_sound_device : public device_t, public device_sound_interface acan_channel m_channels[16]; uint8_t m_regs[256]; std::unique_ptr m_mix; + + std::string print_audio_state(); }; -DECLARE_DEVICE_TYPE(ACANSND, acan_sound_device) +DECLARE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device) -#endif // MAME_FUNTECH_ACAN_H +#endif // MAME_FUNTECH_UM6619_SOUND_H diff --git a/src/mame/funtech/umc6650.cpp b/src/mame/funtech/umc6650.cpp new file mode 100644 index 0000000000000..c25ba79346e86 --- /dev/null +++ b/src/mame/funtech/umc6650.cpp @@ -0,0 +1,80 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************* + +[Super A'Can] UMC 6650 lockout chip + +Located in every A'Can cartridge + +TODO: +- signal to cart B26 & B27 (from register $09?). +- Does the effective lockout resolution input merges with $1c signal from UMC6619 host space? +- /WR for optional cart save RAM + +**************************************************************************************************/ + +#include "emu.h" +#include "umc6650.h" + +#define VERBOSE (1) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(UMC6650, umc6650_device, "umc6650", "UMC UM6650 lockout chip") + +umc6650_device::umc6650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, UMC6650, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_romkey(*this, "romkey") + , m_space_io_config("io", ENDIANNESS_BIG, 8, 7, 0, address_map_constructor(FUNC(umc6650_device::internal_map), this)) +{ +} + +ROM_START( umc6650 ) + ROM_REGION(0x10, "romkey", ROMREGION_ERASEFF) + // 68k internal ROM (security related) + ROM_LOAD( "umc6650.bin", 0x00, 0x10, CRC(0ba78597) SHA1(f94805457976d60b91e8df18f9f49cccec77be78) ) +ROM_END + +const tiny_rom_entry *umc6650_device::device_rom_region() const +{ + return ROM_NAME( umc6650 ); +} + +device_memory_interface::space_config_vector umc6650_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(AS_IO, &m_space_io_config) + }; +} + +void umc6650_device::device_start() +{ + m_space_io = &space(AS_IO); + save_item(NAME(m_address)); +} + +void umc6650_device::device_reset() +{ + m_address = 0x7f; +} + +u8 umc6650_device::read(offs_t offset) +{ + return offset == 1 ? m_address : m_space_io->read_byte(m_address); +} + +void umc6650_device::write(offs_t offset, u8 data) +{ + if (offset == 1) + m_address = data & 0x7f; + else + m_space_io->write_byte(m_address, data); +} + +void umc6650_device::internal_map(address_map &map) +{ +// map(0x09, 0x09) +// map(0x0c, 0x0c) + map(0x20, 0x2f).rom().region(m_romkey, 0); + map(0x40, 0x5f).ram(); +} diff --git a/src/mame/funtech/umc6650.h b/src/mame/funtech/umc6650.h new file mode 100644 index 0000000000000..e3ae9557e5091 --- /dev/null +++ b/src/mame/funtech/umc6650.h @@ -0,0 +1,33 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_FUNTECH_UMC6650_H +#define MAME_FUNTECH_UMC6650_H + +#pragma once + +class umc6650_device : public device_t, public device_memory_interface +{ +public: + umc6650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + +private: + virtual void device_start() override; + virtual void device_reset() override; + virtual space_config_vector memory_space_config() const override; + virtual const tiny_rom_entry *device_rom_region() const override; + + required_memory_region m_romkey; + address_space_config m_space_io_config; + + void internal_map(address_map &map); + address_space *m_space_io; + u8 m_address; +}; + +DECLARE_DEVICE_TYPE(UMC6650, umc6650_device) + +#endif // MAME_FUNTECH_UMC6650_H diff --git a/src/mame/gaelco/gaelco3d.cpp b/src/mame/gaelco/gaelco3d.cpp index dcc746d7d0034..152fe334885b0 100644 --- a/src/mame/gaelco/gaelco3d.cpp +++ b/src/mame/gaelco/gaelco3d.cpp @@ -1325,7 +1325,7 @@ ROM_END /* Football Power has a small PCB inside the ball controller, very similar to the one found on -Gaelco Football, with two accelerometers and a PIC. +Gaelco Football, with two accelerometers and a PIC. _________________ | ______ | _| / / | diff --git a/src/mame/misc/radikaldarts.cpp b/src/mame/gaelco/radikaldarts.cpp similarity index 100% rename from src/mame/misc/radikaldarts.cpp rename to src/mame/gaelco/radikaldarts.cpp diff --git a/src/mame/galaxian/galaxian.cpp b/src/mame/galaxian/galaxian.cpp index dd6343d28c438..3c9defafcdceb 100644 --- a/src/mame/galaxian/galaxian.cpp +++ b/src/mame/galaxian/galaxian.cpp @@ -1344,7 +1344,7 @@ INPUT_CHANGED_MEMBER(gmgalax_state::game_changed) template -CUSTOM_INPUT_MEMBER(gmgalax_state::port_r) +ioport_value gmgalax_state::port_r() { return (m_selected_game != 0 ? m_glin : m_gmin)[N]->read(); } @@ -6250,7 +6250,7 @@ INPUT_PORTS_END // Coinage Dips are spread across two input ports template -CUSTOM_INPUT_MEMBER(galaxian_state::ckongg_coinage_r) +ioport_value galaxian_state::ckongg_coinage_r() { switch (Mask) { @@ -6656,7 +6656,7 @@ static INPUT_PORTS_START( scobras ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(moonwar_state::dial_r) +ioport_value moonwar_state::dial_r() { // see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic // i.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature diff --git a/src/mame/galaxian/galaxian.h b/src/mame/galaxian/galaxian.h index e2dc7709661e4..ed1f81f67ded5 100644 --- a/src/mame/galaxian/galaxian.h +++ b/src/mame/galaxian/galaxian.h @@ -324,7 +324,7 @@ class galaxian_state : public driver_device void bigkonggx(machine_config &config); void scrammr(machine_config &config); - template CUSTOM_INPUT_MEMBER(ckongg_coinage_r); + template ioport_value ckongg_coinage_r(); template int ckongs_coinage_r(); protected: @@ -494,7 +494,7 @@ class gmgalax_state : public bagmanmc_state void gmgalax(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(game_changed); - template DECLARE_CUSTOM_INPUT_MEMBER(port_r); + template ioport_value port_r(); void init_gmgalax(); @@ -862,7 +862,7 @@ class moonwar_state : public galaxian_state { } - DECLARE_CUSTOM_INPUT_MEMBER(dial_r); + ioport_value dial_r(); void moonwar(machine_config &config); diff --git a/src/mame/galaxian/galaxold.cpp b/src/mame/galaxian/galaxold.cpp index ffc17ed5f6739..4293e7424b43e 100644 --- a/src/mame/galaxian/galaxold.cpp +++ b/src/mame/galaxian/galaxold.cpp @@ -1102,7 +1102,7 @@ INPUT_PORTS_END // Coinage Dips are spread across two input ports template -CUSTOM_INPUT_MEMBER(galaxold_state::dkongjrm_coinage_r) +ioport_value galaxold_state::dkongjrm_coinage_r() { switch (Mask) { diff --git a/src/mame/galaxian/galaxold.h b/src/mame/galaxian/galaxold.h index 6e97488138e72..b0651589ba45e 100644 --- a/src/mame/galaxian/galaxold.h +++ b/src/mame/galaxian/galaxold.h @@ -149,7 +149,7 @@ class galaxold_state : public driver_device uint8_t rescueb_a002_r() { return 0xfc; } template int _4in1_fake_port_r(); template int vpool_lives_r(); - template DECLARE_CUSTOM_INPUT_MEMBER(dkongjrm_coinage_r); + template ioport_value dkongjrm_coinage_r(); void init_bullsdrtg(); void init_ladybugg(); diff --git a/src/mame/galaxian/scramble.h b/src/mame/galaxian/scramble.h index 7bff8cdc56de7..014f9de8baf70 100644 --- a/src/mame/galaxian/scramble.h +++ b/src/mame/galaxian/scramble.h @@ -43,7 +43,7 @@ class scramble_state : public galaxold_state memory_bank_creator m_cavelon_bank_object; - DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_dial_r); + ioport_value darkplnt_dial_r(); uint8_t hncholms_prot_r(); uint8_t scramble_soundram_r(offs_t offset); uint8_t mars_ppi8255_0_r(offs_t offset); diff --git a/src/mame/galaxian/scramble_m.cpp b/src/mame/galaxian/scramble_m.cpp index da39a79e46b05..9f1f847800a26 100644 --- a/src/mame/galaxian/scramble_m.cpp +++ b/src/mame/galaxian/scramble_m.cpp @@ -33,7 +33,7 @@ MACHINE_RESET_MEMBER(scramble_state,explorer) } -CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_dial_r) +ioport_value scramble_state::darkplnt_dial_r() { static const uint8_t remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23, 0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13, diff --git a/src/mame/gamepark/gp32.cpp b/src/mame/gamepark/gp32.cpp index cb1f3a7181896..764d66610d5e3 100644 --- a/src/mame/gamepark/gp32.cpp +++ b/src/mame/gamepark/gp32.cpp @@ -35,7 +35,6 @@ #include "gp32.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "softlist_dev.h" #include "speaker.h" @@ -471,11 +470,11 @@ void gp32_state::s3c240x_check_pending_irq() } m_s3c240x_irq_regs[4] |= (1 << int_type); // INTPND m_s3c240x_irq_regs[5] = int_type; // INTOFFSET - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } else { - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } } @@ -487,7 +486,7 @@ void gp32_state::s3c240x_request_irq(uint32_t int_type) m_s3c240x_irq_regs[0] |= (1 << int_type); // SRCPND m_s3c240x_irq_regs[4] |= (1 << int_type); // INTPND m_s3c240x_irq_regs[5] = int_type; // INTOFFSET - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } else { diff --git a/src/mame/gamepark/gp32.h b/src/mame/gamepark/gp32.h index f78d808ce94dd..d9a4bdfb9ae35 100644 --- a/src/mame/gamepark/gp32.h +++ b/src/mame/gamepark/gp32.h @@ -4,9 +4,12 @@ #ifndef MAME_GAMEPARK_GP32_H #define MAME_GAMEPARK_GP32_H +#pragma once + +#include "machine/nvram.h" #include "machine/smartmed.h" #include "sound/dac.h" -#include "machine/nvram.h" + #include "emupal.h" #include "screen.h" diff --git a/src/mame/gottlieb/gottlieb.cpp b/src/mame/gottlieb/gottlieb.cpp index 1c91d6f679ddd..52a7c7dd240f9 100644 --- a/src/mame/gottlieb/gottlieb.cpp +++ b/src/mame/gottlieb/gottlieb.cpp @@ -277,8 +277,8 @@ class gottlieb_state : public driver_device void init_qbert(); void init_qbertqub(); - template DECLARE_CUSTOM_INPUT_MEMBER(track_delta_r); - DECLARE_CUSTOM_INPUT_MEMBER(stooges_joystick_r); + template ioport_value track_delta_r(); + ioport_value stooges_joystick_r(); protected: virtual void machine_start() override; @@ -665,7 +665,7 @@ uint32_t gottlieb_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm *************************************/ template -CUSTOM_INPUT_MEMBER(gottlieb_state::track_delta_r) +ioport_value gottlieb_state::track_delta_r() { return (N ? m_track_y : m_track_x)->read() - m_track[N]; } @@ -679,7 +679,7 @@ void gottlieb_state::analog_reset_w(u8 data) } -CUSTOM_INPUT_MEMBER(gottlieb_state::stooges_joystick_r) +ioport_value gottlieb_state::stooges_joystick_r() { static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", nullptr }; return (joyport[m_joystick_select & 3] != nullptr) ? ioport(joyport[m_joystick_select & 3])->read() : 0xff; diff --git a/src/mame/handheld/hh_cop400.cpp b/src/mame/handheld/hh_cop400.cpp index b1fe912787dbc..aa1a60e11af89 100644 --- a/src/mame/handheld/hh_cop400.cpp +++ b/src/mame/handheld/hh_cop400.cpp @@ -1115,7 +1115,7 @@ class mbaskb2_state : public hh_cop400_state void mbaskb2(machine_config &config); void msoccer2(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(switch_r); + ioport_value switch_r(); protected: virtual void machine_start() override; @@ -1188,7 +1188,7 @@ u8 mbaskb2_state::sub_read_in() // inputs -CUSTOM_INPUT_MEMBER(mbaskb2_state::switch_r) +ioport_value mbaskb2_state::switch_r() { // The power switch is off-1-2, and the game relies on power-on starting at 1, // otherwise msoccer2 boots up to what looks like a factory test mode. diff --git a/src/mame/handheld/hh_hmcs40.cpp b/src/mame/handheld/hh_hmcs40.cpp index 94ce348f3248a..fc9d8edea04bb 100644 --- a/src/mame/handheld/hh_hmcs40.cpp +++ b/src/mame/handheld/hh_hmcs40.cpp @@ -71,27 +71,29 @@ known chips: @A89 HD38820 1984, Bandai Pair Match (PT-460) (2/2) A34 HD44801 1981, SciSys Mini Chess -> saitek/minichess.cpp - A50 HD44801 1981, CXG Sensor Computachess -> cxg/scptchess.cpp + A50 HD44801 1981, CXG Sensor Computachess -> cxg/computachess.cpp A75 HD44801 1982, Alpha 8201 protection MCU -> alpha/alpha8201.* - *A85 HD44801 1982, SciSys Travel Sensor / Travel Mate / Chesspartner 5000/6000 + A85 HD44801 1982, SciSys Travel Sensor Chess -> saitek/tschess.cpp *A92 HD44801 1982, SciSys Play Bridge Computer B35 HD44801 1983, Alpha 8302 protection MCU (see 8201) B42 HD44801 1983, Alpha 8303 protection MCU (see 8201) *B43 HD44801 1983, Alpha 8304 protection MCU (see 8201) C57 HD44801 1985, Alpha 8505 protection MCU (see 8201) - C89 HD44801 1985, CXG Portachess (1985 version) -> cxg/scptchess.cpp + C89 HD44801 1985, CXG Portachess (1985 version) -> cxg/computachess.cpp *A86 HD44820 1983, Chess King Pocket Micro / Mighty Midget + *B46 HD44820 1984, Chess King Pocket Micro / Mighty Midget *B63 HD44820 1985, CXG Pocket Chess (12 buttons) *A13 HD44840 1982, CXG Computachess II *A14 HD44840 1982, CXG Computachess II / Advanced Portachess + *B29 HD44860 1987, Diamond Bridge Computer (M1011) *B55 HD44860 1987, Saitek Pro Bridge 100 *A04 HD44868 1984, SciSys Rapier - *A07 HD44868 1984, Chess King Pocket Micro Deluxe - *A12 HD44868 1985, SciSys MK 10 / Pocket Chess / Electronic Trio + *A07 HD44868 1984, Chess King Pocket Micro Deluxe / Mephisto Teufelchen + *A12 HD44868 1985, SciSys Travel Mate II / Pocket Chess / MK 10 / Electronic Trio *A14 HD44868 1985, SciSys Kasparov Plus *A16 HD44868 1988, Saitek Pocket Checkers diff --git a/src/mame/handheld/hh_sm510.cpp b/src/mame/handheld/hh_sm510.cpp index 62ce0ed893641..58276765dd9d1 100644 --- a/src/mame/handheld/hh_sm510.cpp +++ b/src/mame/handheld/hh_sm510.cpp @@ -36,7 +36,7 @@ ROM source notes when dumped from another title, but confident it's the same: gnw_mariocmt, gnw_mariocmta, gnw_mariotj, gnw_mbaway, gnw_mmousep, gnw_pinball, gnw_popeyep, gnw_sbuster, gnw_snoopyp, gnw_zelda -******************************************************************************** +================================================================================ Misc Nintendo Game & Watch notes: @@ -121,7 +121,7 @@ The "Game Watch" wristwatches are by Nelsonic, not Nintendo. Bassmate Computer (BM-501) is on identical hardware as G&W Multi Screen, but it's not part of the game series. -******************************************************************************** +================================================================================ Regarding Электроника (Elektronika, translated: Electronics): It is not actually a company. It was a USSR brand name for consumer electronics, diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index ff426cd666c71..ad957b8cd8589 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -12388,8 +12388,8 @@ class wtalker_state : public hh_tms1k_state void wtalker(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(sensor_r) { return m_dial & 1; } - DECLARE_CUSTOM_INPUT_MEMBER(pulse_r) { return (m_pulse > machine().time()) ? 1 : 0; } + ioport_value sensor_r() { return m_dial & 1; } + ioport_value pulse_r() { return (m_pulse > machine().time()) ? 1 : 0; } protected: virtual void machine_start() override; diff --git a/src/mame/handheld/monty.cpp b/src/mame/handheld/monty.cpp index 5b81179e6b7de..6e5065aec0462 100644 --- a/src/mame/handheld/monty.cpp +++ b/src/mame/handheld/monty.cpp @@ -19,7 +19,7 @@ is blue and says Master Monty at the top. Both of these versions are hand-upgra by adding chips and wires to the inside of the game. Hardware notes: -- Z80 @ ~3.58MHz +- Z80, 3.58MT ceramic resonator - 2KB SRAM, 16KB ROM(32KB on mmonty) - 2*16KB ROM sockets for vocabulary expansion - 2*SED1503F, 40*32 LCD screen, beeper @@ -66,7 +66,7 @@ class monty_state : public driver_device private: required_device m_maincpu; required_device_array m_lcd; - required_device m_dac; + required_device m_dac; required_ioport_array<6> m_inputs; u64 m_lcd_data[32] = { }; @@ -233,7 +233,7 @@ INPUT_PORTS_END void monty_state::monty(machine_config &config) { // Basic machine hardware - Z80(config, m_maincpu, 3.579545_MHz_XTAL); // Ceramic resonator labeled 3.58MT + Z80(config, m_maincpu, 3.58_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &monty_state::monty_mem); m_maincpu->set_addrmap(AS_IO, &monty_state::monty_io); m_maincpu->halt_cb().set(FUNC(monty_state::halt_changed)); diff --git a/src/mame/hegenerglaser/modular_tm.cpp b/src/mame/hegenerglaser/modular_tm.cpp index d87ead3d2c7bc..f80068626e0ff 100644 --- a/src/mame/hegenerglaser/modular_tm.cpp +++ b/src/mame/hegenerglaser/modular_tm.cpp @@ -47,7 +47,6 @@ After boot, it copies ROM to RAM, probably to circumvent waitstates on slow ROM. #include "cpu/m68000/m68030.h" #include "machine/nvram.h" -#include "machine/timer.h" // internal artwork #include "mephisto_modular_tm.lh" @@ -61,10 +60,8 @@ class mmtm_state : public driver_device mmtm_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_rom(*this, "maincpu"), - m_mainram(*this, "mainram"), - m_nvram(*this, "nvram", 0x2000, ENDIANNESS_BIG), - m_disable_bootrom(*this, "disable_bootrom") + m_boot_view(*this, "boot_view"), + m_nvram(*this, "nvram", 0x2000, ENDIANNESS_BIG) { } // machine configs @@ -76,17 +73,14 @@ class mmtm_state : public driver_device protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_post_load() override { install_bootrom(m_bootrom_enabled); } private: // devices/pointers required_device m_maincpu; - required_region_ptr m_rom; - required_shared_ptr m_mainram; + memory_view m_boot_view; memory_share_creator m_nvram; - required_device m_disable_bootrom; - bool m_bootrom_enabled = false; + emu_timer *m_boot_timer; // address maps void mmtm_2m_map(address_map &map); @@ -95,8 +89,7 @@ class mmtm_state : public driver_device u8 nvram_r(offs_t offset) { return m_nvram[offset]; } void nvram_w(offs_t offset, u8 data) { m_nvram[offset] = data; } - void install_bootrom(bool enable); - TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); } + TIMER_CALLBACK_MEMBER(disable_bootrom) { m_boot_view.select(1); } }; @@ -107,27 +100,14 @@ class mmtm_state : public driver_device void mmtm_state::machine_start() { - save_item(NAME(m_bootrom_enabled)); + m_boot_timer = timer_alloc(FUNC(mmtm_state::disable_bootrom), this); } void mmtm_state::machine_reset() { // disable bootrom after reset - install_bootrom(true); - m_disable_bootrom->adjust(m_maincpu->cycles_to_attotime(50)); -} - -void mmtm_state::install_bootrom(bool enable) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - program.unmap_readwrite(0, std::max(m_rom.bytes(), m_mainram.bytes()) - 1); - - if (enable) - program.install_rom(0, m_rom.bytes() - 1, m_rom); - else - program.install_ram(0, m_mainram.bytes() - 1, m_mainram); - - m_bootrom_enabled = enable; + m_boot_view.select(0); + m_boot_timer->adjust(m_maincpu->cycles_to_attotime(50)); } INPUT_CHANGED_MEMBER(mmtm_state::change_cpu_freq) @@ -150,7 +130,10 @@ INPUT_CHANGED_MEMBER(mmtm_state::change_cpu_freq) void mmtm_state::mmtm_2m_map(address_map &map) { - map(0x00000000, 0x0003ffff).ram().share("mainram"); + map(0x00000000, 0x0003ffff).view(m_boot_view); + m_boot_view[0](0x00000000, 0x0003ffff).rom().region("maincpu", 0); + m_boot_view[1](0x00000000, 0x0003ffff).ram(); + map(0x80000000, 0x801fffff).ram(); map(0xf0000000, 0xf003ffff).rom().region("maincpu", 0); map(0xfc000000, 0xfc001fff).rw(FUNC(mmtm_state::nvram_r), FUNC(mmtm_state::nvram_w)).umask32(0xffffffff); @@ -167,9 +150,7 @@ void mmtm_state::mmtm_2m_map(address_map &map) void mmtm_state::mmtm_8m_map(address_map &map) { mmtm_2m_map(map); - map(0x80200000, 0x803fffff).ram(); - map(0x80400000, 0x805fffff).ram(); - map(0x80600000, 0x807fffff).ram(); + map(0x80000000, 0x807fffff).ram(); } @@ -217,8 +198,6 @@ void mmtm_state::mmtm_v(machine_config &config) const attotime irq_period = attotime::from_hz(12.288_MHz_XTAL / 0x8000); // through 4060, 375Hz m_maincpu->set_periodic_int(FUNC(mmtm_state::irq3_line_hold), irq_period); - TIMER(config, "disable_bootrom").configure_generic(FUNC(mmtm_state::disable_bootrom)); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); MEPHISTO_SENSORS_BOARD(config, "board"); diff --git a/src/mame/hitachi/bmjr.cpp b/src/mame/hitachi/bmjr.cpp index 0381b19b612af..07af7c4bab8f6 100644 --- a/src/mame/hitachi/bmjr.cpp +++ b/src/mame/hitachi/bmjr.cpp @@ -1,26 +1,32 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -/*************************************************************************** +/************************************************************************************************** - Basic Master Jr (MB-6885) (c) 1982? Hitachi +Basic Master Jr. (MB-6885) (c) 1982? Hitachi - preliminary driver by Angelo Salese +TODO: +- Identify and improve Sound DAC details; +- Keyboard eats inputs if typed relatively fast (verify); +- Add kana mappings to keyboard; +- Timer control (needs SW that bothers with it); +- Downgrade for earlier variants (needs dump first), convert MP-1710 color adapter to expansion + bus device (bmjr specific); +- Floppy adapter MP-1803, thru expansion bus; +- Border color for MP-1710; +- Printer, MP-1041/MP-1045; +- Hookup SW list; - To enter the monitor: MON - To quit: E - - TODO: - - Break key is unemulated (tied with the NMI) - -****************************************************************************/ +**************************************************************************************************/ #include "emu.h" #include "cpu/m6800/m6800.h" #include "imagedev/cassette.h" #include "machine/timer.h" -#include "sound/beep.h" +#include "sound/dac.h" + #include "emupal.h" #include "screen.h" +#include "softlist_dev.h" #include "speaker.h" @@ -32,74 +38,109 @@ class bmjr_state : public driver_device bmjr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_cass(*this, "cassette") - , m_beep(*this, "beeper") - , m_p_wram(*this, "wram") + , m_cassette(*this, "cassette") + , m_dac(*this, "dac") + , m_work_ram(*this, "work_ram") + , m_basic_view(*this, "basic_view") + , m_printer_view(*this, "printer_view") + , m_monitor_view(*this, "monitor_view") , m_p_chargen(*this, "chargen") , m_io_keyboard(*this, "KEY%d", 0U) { } void bmjr(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(break_key_pressed); + static constexpr feature_type unemulated_features() { return feature::PRINTER; } +protected: + virtual void video_start() override; + virtual void video_reset() override; + + virtual void machine_start() override; + virtual void machine_reset() override; private: + void main_map(address_map &map); + + required_device m_maincpu; + required_device m_cassette; + required_device m_dac; + required_shared_ptr m_work_ram; + memory_view m_basic_view; + memory_view m_printer_view; + memory_view m_monitor_view; + required_region_ptr m_p_chargen; + required_ioport_array<16> m_io_keyboard; + + bool m_tape_switch = 0; + u8 m_screen_reverse = 0U; + u8 m_key_select = 0U; + u8 m_nmi_enable = 0U; + u16 m_casscnt = 0U; + bool m_cassold = 0, m_cassbit = 0; + u8 m_bank_mode = 0U; + + u8 bank_mode_r(); + void bank_mode_w(u8 data); u8 key_r(); void key_w(u8 data); - u8 ff_r(); - u8 unk_r(); + u8 timer_r(); u8 tape_r(); void tape_w(u8 data); u8 tape_stop_r(); u8 tape_start_r(); - void xor_display_w(u8 data); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void mem_map(address_map &map); - bool m_tape_switch = 0; - u8 m_xor_display = 0U; - u8 m_key_mux = 0U; - u16 m_casscnt = 0U; - bool m_cassold = 0, m_cassbit = 0; TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); - virtual void machine_start() override; - virtual void machine_reset() override; - required_device m_maincpu; - required_device m_cass; - required_device m_beep; - required_shared_ptr m_p_wram; - required_region_ptr m_p_chargen; - required_ioport_array<16> m_io_keyboard; + + std::unique_ptr m_color_ram; + u8 m_color_mode = 0U; + u8 m_tile_latch = 0U; + u8 m_screen_mode = 0U; + void mp1710_map(address_map &map); + void screen_mode_w(u8 data); + void screen_reverse_w(u8 data); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; +void bmjr_state::video_start() +{ + m_color_ram = std::make_unique(0x300); + save_item(NAME(m_screen_mode)); + save_item(NAME(m_screen_reverse)); + save_item(NAME(m_color_mode)); + save_item(NAME(m_tile_latch)); + save_pointer(NAME(m_color_ram), 0x300); +} +void bmjr_state::video_reset() +{ + m_tile_latch = 0x07; + m_screen_reverse = 0; + m_screen_mode = 0; +} u32 bmjr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - u8 fg=4; - u16 sy=0,ma=0x100; - u8 const inv = (m_xor_display) ? 0xff : 0; + const u8 fg_shift = m_screen_reverse ? 4 : 0; + const u8 bg_shift = m_screen_reverse ? 0 : 4; + const u16 screen_bank_offset = 0x900 + ((m_screen_mode & 0xf) << 9); - for(u8 y = 0; y < 24; y++ ) + // TODO: convert to scanline based renderer + for(int y = cliprect.min_y; y <= cliprect.max_y; y++ ) { - for (u8 ra = 0; ra < 8; ra++) + for (int x = cliprect.min_x; x <= cliprect.max_x; x+= 8) { - u16 *p = &bitmap.pix(sy++); - - for (u16 x = ma; x < ma + 32; x++) + const u16 tile_offset = (x >> 3) + ((y >> 3) * 32); + const u16 tile = m_work_ram[0x100 + tile_offset] << 3; + const u8 gfx_data = BIT(m_screen_mode, 7) ? m_work_ram[screen_bank_offset + (x >> 3) + (y * 32)] : m_p_chargen[tile | (y & 7)]; + const u8 attr = BIT(m_color_mode, 0) ? m_color_ram[tile_offset] : 0x07; + const u8 fg_color = (attr >> fg_shift) & 7; + const u8 bg_color = (attr >> bg_shift) & 7; + + for (int xi = 0; xi < 8; xi++) { - u8 const chr = m_p_wram[x]; - u8 const gfx = m_p_chargen[(chr<<3) | ra] ^ inv; - - /* Display a scanline of a character */ - *p++ = BIT(gfx, 7) ? fg : 0; - *p++ = BIT(gfx, 6) ? fg : 0; - *p++ = BIT(gfx, 5) ? fg : 0; - *p++ = BIT(gfx, 4) ? fg : 0; - *p++ = BIT(gfx, 3) ? fg : 0; - *p++ = BIT(gfx, 2) ? fg : 0; - *p++ = BIT(gfx, 1) ? fg : 0; - *p++ = BIT(gfx, 0) ? fg : 0; + const u8 pen = BIT(gfx_data, 7 - xi) ? fg_color : bg_color; + bitmap.pix(y, x + xi) = pen; } } - ma+=32; } return 0; @@ -107,32 +148,32 @@ u32 bmjr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const u8 bmjr_state::key_r() { - return m_io_keyboard[m_key_mux]->read() | ioport("KEYMOD")->read(); + return (m_io_keyboard[m_key_select]->read() & 0xf) | ioport("KEYMOD")->read(); } void bmjr_state::key_w(u8 data) { - m_key_mux = data & 0xf; + m_key_select = data & 0xf; -// if(data & 0xf0) -// printf("%02x",data & 0xf0); + m_nmi_enable = BIT(data, 7); + if (!m_nmi_enable) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } - -u8 bmjr_state::ff_r() +/* + * x--- ---- checked in irq routine + * 1--- ---- routes to 1 second timer at $000c (TIME 3) + * 0--- ---- routes to $000a-$000b (TIME 1/TIME 2), likely enabled thru $efd0 bit 4 high + */ +u8 bmjr_state::timer_r() { return 0xff; } -u8 bmjr_state::unk_r() -{ - return 0x30; -} - TIMER_DEVICE_CALLBACK_MEMBER( bmjr_state::kansas_r ) { /* cassette - turn pulses into a bit */ - bool cass_ws = (m_cass->input() > +0.04) ? 1 : 0; + bool cass_ws = (m_cassette->input() > +0.04) ? 1 : 0; m_casscnt++; if (cass_ws != m_cassold) @@ -141,8 +182,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( bmjr_state::kansas_r ) m_cassbit = (m_casscnt < 12) ? 1 : 0; m_casscnt = 0; } - else - if (m_casscnt > 32) + else if (m_casscnt > 32) { m_casscnt = 32; m_cassbit = 0; @@ -151,7 +191,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( bmjr_state::kansas_r ) u8 bmjr_state::tape_r() { - //m_cass->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE); + //m_cassette->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE); return m_cassbit ? 0xff : 0x00; } @@ -160,152 +200,210 @@ void bmjr_state::tape_w(u8 data) { if(!m_tape_switch) { - m_beep->set_state(!BIT(data, 7)); + m_dac->write((data >> 1) & 0x1f); } else { - //m_cass->change_state(CASSETTE_RECORD,CASSETTE_MASK_UISTATE); - m_cass->output(BIT(data, 0) ? -1.0 : +1.0); + //m_cassette->change_state(CASSETTE_RECORD,CASSETTE_MASK_UISTATE); + m_cassette->output(BIT(data, 0) ? -1.0 : +1.0); } } u8 bmjr_state::tape_stop_r() { m_tape_switch = 0; - //m_cass->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE); - m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); + //m_cassette->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE); + m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); return 0x01; } u8 bmjr_state::tape_start_r() { m_tape_switch = 1; - m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR); + m_cassette->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR); return 0x01; } -void bmjr_state::xor_display_w(u8 data) +u8 bmjr_state::bank_mode_r() +{ + return m_bank_mode; +} + +/* + * ---x ---- timer enable? + * ---- -x-- maps $f000-$ffff to work RAM + * ---- --x- maps $e000-$edff to work RAM + * ---- ---x maps $b000-$dfff to work RAM + */ +void bmjr_state::bank_mode_w(u8 data) +{ + logerror("bank_mode_w %02x\n", data); + m_bank_mode = data; + if (BIT(data, 0)) + m_basic_view.disable(); + else + m_basic_view.select(0); + + if (BIT(data, 1)) + m_printer_view.disable(); + else + m_printer_view.select(0); + + if (BIT(data, 2)) + m_monitor_view.disable(); + else + m_monitor_view.select(0); +} + +void bmjr_state::screen_reverse_w(u8 data) +{ + m_screen_reverse = BIT(data, 7); +} + +/* + * x--- ---- enable bitmap mode + * -?-- ---- + * ---- xxxx bank base for bitmap mode + */ +void bmjr_state::screen_mode_w(u8 data) +{ + m_screen_mode = data; +} + +void bmjr_state::mp1710_map(address_map &map) { - m_xor_display = data; + map(0x00, 0x00).lrw8( + NAME([this] (offs_t offset) { return m_tile_latch; }), + NAME([this] (offs_t offset, u8 data) { m_tile_latch = data; }) + ); + //map(0x01, 0x01) border color? + map(0x02, 0x02).lrw8( + NAME([this] (offs_t offset) { return m_color_mode; }), + NAME([this] (offs_t offset, u8 data) { m_color_mode = data; }) + ); } -void bmjr_state::mem_map(address_map &map) +void bmjr_state::main_map(address_map &map) { map.unmap_value_high(); - //0x0100, 0x03ff basic vram - //0x0900, 0x20ff vram, modes 0x40 / 0xc0 - //0x2100, 0x38ff vram, modes 0x44 / 0xcc - map(0x0000, 0xafff).ram().share("wram"); - map(0xb000, 0xdfff).rom(); - map(0xe000, 0xe7ff).rom(); -// map(0xe890, 0xe890) W MP-1710 tile color -// map(0xe891, 0xe891) W MP-1710 background color -// map(0xe892, 0xe892) W MP-1710 monochrome / color setting + map(0x0000, 0xffff).ram().share("work_ram"); + // overlay for MP-1710 tile latches + map(0x0100, 0x03ff).lrw8( + NAME([this] (offs_t offset) { return m_work_ram[offset + 0x100]; }), + NAME([this] (offs_t offset, u8 data) { + m_work_ram[offset + 0x100] = data; + m_color_ram[offset] = m_tile_latch; + }) + ); + map(0xb000, 0xdfff).view(m_basic_view); + m_basic_view[0](0xb000, 0xdfff).rom().region("basic", 0); + map(0xe000, 0xefff).view(m_printer_view); + m_printer_view[0](0xe000, 0xe7ff).rom().region("printer", 0); + // 0xe800-0xedff expansion I/O +// map(0xe800, 0xe803) 6820 or 6821 PIA + m_printer_view[0](0xe890, 0xe89f).m(*this, FUNC(bmjr_state::mp1710_map)); + // 0xee00-0xefff system I/O (ignored by printer view enabled) map(0xee00, 0xee00).r(FUNC(bmjr_state::tape_stop_r)); //R stop tape map(0xee20, 0xee20).r(FUNC(bmjr_state::tape_start_r)); //R start tape - map(0xee40, 0xee40).w(FUNC(bmjr_state::xor_display_w)); //W Picture reverse + map(0xee40, 0xee40).w(FUNC(bmjr_state::screen_reverse_w)); //W Picture reverse map(0xee80, 0xee80).rw(FUNC(bmjr_state::tape_r), FUNC(bmjr_state::tape_w));//RW tape input / output map(0xeec0, 0xeec0).rw(FUNC(bmjr_state::key_r), FUNC(bmjr_state::key_w));//RW keyboard - map(0xef00, 0xef00).r(FUNC(bmjr_state::ff_r)); //R timer - map(0xef40, 0xef40).r(FUNC(bmjr_state::ff_r)); //R unknown - map(0xef80, 0xef80).r(FUNC(bmjr_state::unk_r)); //R unknown -// map(0xefe0, 0xefe0) W screen mode - map(0xf000, 0xffff).rom(); + map(0xef00, 0xef00).r(FUNC(bmjr_state::timer_r)); + map(0xef80, 0xef80).portr("BREAK"); + map(0xefd0, 0xefd0).rw(FUNC(bmjr_state::bank_mode_r), FUNC(bmjr_state::bank_mode_w)); + map(0xefe0, 0xefe0).w(FUNC(bmjr_state::screen_mode_w)); + map(0xf000, 0xffff).view(m_monitor_view); + m_monitor_view[0](0xf000, 0xffff).rom().region("monitor", 0); +} + +INPUT_CHANGED_MEMBER(bmjr_state::break_key_pressed) +{ + if (newval && m_nmi_enable) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } -/* Input ports */ static INPUT_PORTS_START( bmjr ) PORT_START("KEY0") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_START("KEY1") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("2 \"") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2 \"") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') PORT_START("KEY2") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_START("KEY3") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_START("KEY4") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_START("KEY5") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("6 &") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 &") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') PORT_START("KEY6") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("7 \'") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 \'") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') PORT_START("KEY7") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') PORT_START("KEY8") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("9 )") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9 )") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') PORT_START("KEY9") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_START("KEY10") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_UNUSED ) - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(": *") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("@ Up") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('@') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("- =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + // NOTE: works on kana / shift only + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("_") PORT_CHAR('_') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(": *") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"@ \u2191") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('@') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("- =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') PORT_START("KEY11") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("[ Down") PORT_CODE(KEYCODE_OPENBRACE) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('[') - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("^ Right") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('^') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"[ \u2193") PORT_CODE(KEYCODE_OPENBRACE) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('[') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"^ \u2192") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('^') PORT_START("KEY12") - PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_UNUSED) - PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(u8"¥ / Left") PORT_CODE(KEYCODE_4_PAD) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"¥ \u2190") PORT_CODE(KEYCODE_4_PAD) PORT_START("KEY13") - PORT_DIPNAME( 0x01, 0x01, "D" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEY14") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -314,10 +412,14 @@ static INPUT_PORTS_START( bmjr ) PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEYMOD") /* Note: you should press Normal to return from a Kana state and vice-versa */ - PORT_BIT(0x10,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(DEF_STR( Normal )) PORT_CODE(KEYCODE_LCONTROL) - PORT_BIT(0x20,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT(0x40,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Kana Shift") PORT_CODE(KEYCODE_LALT) - PORT_BIT(0x80,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("Kana") PORT_CODE(KEYCODE_RCONTROL) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(DEF_STR( Normal )) PORT_CODE(KEYCODE_LCONTROL) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Kana Shift") PORT_CODE(KEYCODE_LALT) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Kana") PORT_CODE(KEYCODE_RCONTROL) + + PORT_START("BREAK") + PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // TODO: read by timer irq service + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CHANGED_MEMBER(DEVICE_SELF, bmjr_state, break_key_pressed, 0) INPUT_PORTS_END static const gfx_layout bmjr_charlayout = @@ -326,8 +428,8 @@ static const gfx_layout bmjr_charlayout = RGN_FRAC(1,1), 1, { 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + { STEP8(0, 1) }, + { STEP8(0, 8) }, 8*8 }; @@ -338,68 +440,79 @@ GFXDECODE_END void bmjr_state::machine_start() { save_item(NAME(m_tape_switch)); - save_item(NAME(m_xor_display)); - save_item(NAME(m_key_mux)); + save_item(NAME(m_key_select)); save_item(NAME(m_casscnt)); save_item(NAME(m_cassold)); save_item(NAME(m_cassbit)); + save_item(NAME(m_nmi_enable)); + save_item(NAME(m_bank_mode)); } void bmjr_state::machine_reset() { - m_beep->set_state(0); + //m_beep->set_state(0); m_tape_switch = 0; - m_xor_display = 0; - m_key_mux = 0; - m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); + m_key_select = 0; + m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); + m_bank_mode = 0; + m_basic_view.select(0); + m_printer_view.select(0); + m_monitor_view.select(0); + m_maincpu->reset(); } void bmjr_state::bmjr(machine_config &config) { - /* basic machine hardware */ // 750khz gets the cassette sound close to a normal kansas city 300 baud - M6800(config, m_maincpu, 750'000); //XTAL(4'000'000)/4); //unknown clock / divider - m_maincpu->set_addrmap(AS_PROGRAM, &bmjr_state::mem_map); + M6800(config, m_maincpu, 754'560); // TODO: HD46800, derive from actual clock / divider + m_maincpu->set_addrmap(AS_PROGRAM, &bmjr_state::main_map); + // NOTE: checked by using TIME commands, which implies a separate thread than the actual timer control m_maincpu->set_vblank_int("screen", FUNC(bmjr_state::irq0_line_hold)); - /* video hardware */ + // TRQ237/TRQ359 + CASSETTE(config, m_cassette); + m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); + m_cassette->set_interface("bmjr_cass"); + + TIMER(config, "kansas_r").configure_periodic(FUNC(bmjr_state::kansas_r), attotime::from_hz(40000)); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(50); + screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ - screen.set_size(256, 192); - screen.set_visarea_full(); + screen.set_size(320, 262); + screen.set_visarea(0, 256 - 1, 0, 192 - 1); screen.set_screen_update(FUNC(bmjr_state::screen_update)); screen.set_palette("palette"); PALETTE(config, "palette", palette_device::BRG_3BIT); GFXDECODE(config, "gfxdecode", "palette", gfx_bmjr); - /* Audio */ SPEAKER(config, "mono").front_center(); - BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); // guesswork + // TODO: unknown DAC type, likely connected to discrete circuitry. + DAC_5BIT_BINARY_WEIGHTED(config, m_dac).add_route(ALL_OUTPUTS, "mono", 0.25); - /* Devices */ - CASSETTE(config, m_cass); - m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); - TIMER(config, "kansas_r").configure_periodic(FUNC(bmjr_state::kansas_r), attotime::from_hz(40000)); + SOFTWARE_LIST(config, "cass_list").set_original("bmjr_cass"); } /* ROM definition */ ROM_START( bmjr ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "bas.rom", 0xb000, 0x3000, BAD_DUMP CRC(2318e04e) SHA1(cdb3535663090f5bcaba20b1dbf1f34724ef6a5f)) //12k ROMs doesn't exist ... - ROM_LOAD( "mon.rom", 0xf000, 0x1000, CRC(776cfa3a) SHA1(be747bc40fdca66b040e0f792b05fcd43a1565ce)) - ROM_LOAD( "prt.rom", 0xe000, 0x0800, CRC(b9aea867) SHA1(b8dd5348790d76961b6bdef41cfea371fdbcd93d)) + ROM_REGION( 0x3000, "basic", ROMREGION_ERASEFF ) + ROM_LOAD( "bas.rom", 0x0000, 0x3000, BAD_DUMP CRC(2318e04e) SHA1(cdb3535663090f5bcaba20b1dbf1f34724ef6a5f)) // needs splitting in three halves + + ROM_REGION( 0x1000, "monitor", ROMREGION_ERASEFF ) + ROM_LOAD( "mon.rom", 0x0000, 0x1000, CRC(776cfa3a) SHA1(be747bc40fdca66b040e0f792b05fcd43a1565ce)) + + ROM_REGION( 0x800, "printer", ROMREGION_ERASEFF ) + ROM_LOAD( "prt.rom", 0x000, 0x800, CRC(b9aea867) SHA1(b8dd5348790d76961b6bdef41cfea371fdbcd93d)) ROM_REGION( 0x800, "chargen", 0 ) - ROM_LOAD( "font.rom", 0x0000, 0x0800, BAD_DUMP CRC(258c6fd7) SHA1(d7c7dd57d6fc3b3d44f14c32182717a48e24587f)) //taken from a JP emulator + ROM_LOAD( "font.rom", 0x0000, 0x0800, BAD_DUMP CRC(258c6fd7) SHA1(d7c7dd57d6fc3b3d44f14c32182717a48e24587f)) // taken from a JP emulator ROM_END } // anonymous namespace -/* Driver */ - - -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1982, bmjr, 0, 0, bmjr, bmjr, bmjr_state, empty_init, "Hitachi", "Basic Master Jr", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +// 1979 Basic Master MB-6880 (retroactively Level 1) +// 1979 Basic Master Level 2 MB-6880L2 +// 1980 Basic Master Level 2 II MB-6881 +COMP( 1981, bmjr, 0, 0, bmjr, bmjr, bmjr_state, empty_init, "Hitachi", "Basic Master Jr. (MB-6885)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/hitachi/bml3.cpp b/src/mame/hitachi/bml3.cpp index 4fbfc8831bdd3..12c0d2df9414d 100644 --- a/src/mame/hitachi/bml3.cpp +++ b/src/mame/hitachi/bml3.cpp @@ -1,20 +1,35 @@ -// license:GPL-2.0+ -// copyright-holders:Angelo Salese, Jonathan Edwards, Christopher Edwards,Robbbert -/************************************************************************************** - - Basic Master Level 3 (MB-689x) (c) 1980 Hitachi - - Driver by Angelo Salese, Jonathan Edwards and Christopher Edwards - - TODO: - - implement sound as a bml3bus slot device - - account for hardware differences between MB-6890, MB-6891 and MB-6892 - (e.g. custom font support on the MB-6892) - -**************************************************************************************/ +// license: GPL-2.0+ +// copyright-holders: Angelo Salese, Jonathan Edwards, Christopher Edwards, Robbbert +/************************************************************************************************** + +Basic Master Level 3 (MB-689x) "Peach" (c) 1980 Hitachi +ベーシックマスターレベル3 + +References: +- http://s-sasaji.ddo.jp/bml3mk5/tech.htm +- https://www.leadedsolder.com/2023/05/09/hitachi-basic-master-level-iii-mark-ii-cleaning-pickup.html +- https://github.com/bml3mk5/EmuB-6892/blob/master/src/docs/spec.txt + +TODO: +- keyboard break NMI (as per bmjr); +- Move keyboard timer logic as 6845 hsync callback; +- Cassette relay doesn't work properly, issuing a LOAD won't autostart a load; +- Cassette baud rate bump (can switch from 600 to 1200 bauds thru $ffd7); +- implement sound as a bus slot device; +- implement RAM expansion as bus slots (RAM3 at 0x8000-0xbfff, RAM4 at 0xc000-0xefff); +- bml3mk5: BANK REG $ffe8 (applies EMS for the RAM expansion?); +- soft reset will hang the machine; +- Hitachi MB-S1 support (bumps memory map, adds an extra I/O layer); + +**************************************************************************************************/ #include "emu.h" +#include "bus/bml3/bml3bus.h" +#include "bus/bml3/kanji.h" +#include "bus/bml3/mp1802.h" +#include "bus/bml3/mp1805.h" +#include "bus/bml3/rtc.h" #include "cpu/m6809/m6809.h" #include "imagedev/cassette.h" #include "machine/6821pia.h" @@ -24,15 +39,10 @@ #include "sound/spkrdev.h" #include "sound/ymopn.h" #include "video/mc6845.h" -#include "emupal.h" - -#include "bus/bml3/bml3bus.h" -#include "bus/bml3/bml3mp1802.h" -#include "bus/bml3/bml3mp1805.h" -#include "bus/bml3/bml3kanji.h" -#include "bus/bml3/bml3rtc.h" +#include "emupal.h" #include "screen.h" +#include "softlist_dev.h" #include "speaker.h" @@ -79,10 +89,10 @@ class bml3_state : public driver_device bml3_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_p_chargen(*this, "chargen") , m_bml3bus(*this, "bml3bus") + , m_p_chargen(*this, "chargen") , m_crtc(*this, "crtc") - , m_cass(*this, "cassette") + , m_cassette(*this, "cassette") , m_speaker(*this, "speaker") , m_ym2203(*this, "ym2203") , m_acia(*this, "acia") @@ -94,37 +104,59 @@ class bml3_state : public driver_device , m_bankf(*this, "bankf") , m_bankg(*this, "bankg") , m_io_keyboard(*this, "X%u", 0U) - { } + { } - void bml3mk2(machine_config &config); - void bml3mk5(machine_config &config); void bml3(machine_config &config); - void bml3_common(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(nmi_button); +protected: + virtual void main_map(address_map &map); + virtual void system_io(address_map &map); + + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; + required_device m_bml3bus; + virtual u8 get_attr_mask() { return 0x1f; } + virtual u8 get_ig_mode(u8 attr) { return 0; } + virtual u8 get_ig_dots(u8 tile, u8 ra, u8 xi) { return 0; } private: - void bml3_mem(address_map &map); - void bml3mk2_mem(address_map &map); - void bml3mk5_mem(address_map &map); + required_region_ptr m_p_chargen; + required_device m_crtc; + required_device m_cassette; + required_device m_speaker; + optional_device m_ym2203; + required_device m_acia; + required_device m_palette; + memory_view m_rom_view; + //memory_view m_bank4; + memory_view m_banka; + memory_view m_bankc; + memory_view m_banke; + memory_view m_bankf; + memory_view m_bankg; + required_ioport_array<4> m_io_keyboard; + uint8_t mc6845_r(offs_t offset); void mc6845_w(offs_t offset, u8 data); - uint8_t keyboard_r(); - void keyboard_w(u8 data); - void hres_reg_w(u8 data); - void vres_reg_w(u8 data); + uint8_t kb_sel_r(); + void kb_sel_w(u8 data); + void mode_sel_w(u8 data); + void interlace_sel_w(u8 data); uint8_t vram_r(offs_t offset); void vram_w(offs_t offset, u8 data); [[maybe_unused]] uint8_t psg_latch_r(); [[maybe_unused]] void psg_latch_w(u8 data); - uint8_t vram_attr_r(); - void vram_attr_w(u8 data); - uint8_t beep_r(); - void beep_w(u8 data); + uint8_t c_reg_sel_r(); + void c_reg_sel_w(u8 data); + uint8_t music_sel_r(); + void music_sel_w(u8 data); void piaA_w(uint8_t data); - uint8_t keyb_nmi_r(); - void firq_mask_w(u8 data); - uint8_t firq_status_r(); - void relay_w(u8 data); + uint8_t kbnmi_r(); + void time_mask_w(u8 data); + uint8_t timer_r(); + void remote_w(u8 data); void acia_rts_w(int state); void acia_irq_w(int state); @@ -154,34 +186,166 @@ class bml3_state : public driver_device bool m_cassbit = 0; bool m_cassold = 0; u8 m_cass_data[4]{}; - virtual void machine_reset() override; - virtual void machine_start() override; - void m6845_change_clock(u8 setting); + void crtc_change_clock(); u8 m_crtc_index = 0U; std::unique_ptr m_vram; std::unique_ptr m_aram; u8 m_firq_mask = 0U; u8 m_firq_status = 0U; u8 m_nmi = 0U; - required_device m_maincpu; - required_region_ptr m_p_chargen; - required_device m_bml3bus; - required_device m_crtc; - required_device m_cass; - required_device m_speaker; - optional_device m_ym2203; - required_device m_acia; - required_device m_palette; - memory_view m_rom_view; - //memory_view m_bank4; - memory_view m_banka; - memory_view m_bankc; - memory_view m_banke; - memory_view m_bankf; - memory_view m_bankg; - required_ioport_array<4> m_io_keyboard; }; +class bml3mk2_state : public bml3_state +{ +public: + bml3mk2_state(const machine_config &mconfig, device_type type, const char *tag) + : bml3_state(mconfig, type, tag) + { } + + void bml3mk2(machine_config &config); +}; + +class bml3mk5_state : public bml3mk2_state +{ +public: + bml3mk5_state(const machine_config &mconfig, device_type type, const char *tag) + : bml3mk2_state(mconfig, type, tag) + , m_ig_view(*this, "ig_view") + , m_gfxdecode(*this, "gfxdecode") + { } + + void bml3mk5(machine_config &config); +protected: + virtual void main_map(address_map &map) override; + virtual void system_io(address_map &map) override; + + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual u8 get_attr_mask() override { return 0x3f; } + virtual u8 get_ig_mode(u8 attr) override { return BIT(attr, 5); } + // NOTE: if IG attribute is enabled then the rest of attribute byte is ignored (no reverse etc.). + // TODO: if IGMODREG is 1 then the resulting tile will be a white square + virtual u8 get_ig_dots(u8 tile, u8 ra, u8 xi) override { + u16 base_offset = tile << 3; + u8 res = 0; + for (int i = 0; i < 3; i++) + { + if (BIT(m_ig_ram[base_offset + ra + i * 0x800], xi)) + res |= 1 << i; + } + return res; + } +private: + memory_view m_ig_view; + required_device m_gfxdecode; + std::unique_ptr m_ig_ram; + void ig_ram_w(offs_t offset, u8 data); + + u8 m_igen = 0; +}; + +MC6845_UPDATE_ROW( bml3_state::crtc_update_row ) +{ + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + // The MB-6890 has a 5-bit colour RAM region. The meaning of the bits are: + // 0: blue + // 1: red + // 2: green + // 3: reverse/inverse video + // 4: graphic (not character) + + u8 const interlace = (m_crtc_vreg[8] & 3) ? 1 : 0; + bool const lowres = BIT(m_hres_reg, 6); + u8 const bgcolor = m_hres_reg & 7; + + if (interlace) + { + ra >>= 1; + if (y > 0x191) return; + } + + for(u8 x=0; x> ra/2 & 0x11) * 0xf; + } + else + { + dots[0] = dots[1] = rawbits; + } + } + else + { + // character mode + int const tile = rawbits & 0x7f; + int const tile_bank = BIT(rawbits, 7); + if (interlace) + { + dots[0] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)]; + dots[1] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)|tile_bank]; + } + else + { + dots[0] = dots[1] = m_p_chargen[(tile<<4)|(ra<<1)|tile_bank]; + } + } + + for(u8 hf=0;hf<=interlace;hf++) + { + for(u8 xi=0;xi<8;xi++) + { + u8 pen; + if(reverse) + pen = (dots[hf] >> (7-xi) & 1) ? bgcolor : color; + else + pen = (dots[hf] >> (7-xi) & 1) ? color : bgcolor; + + bitmap.pix(y, x*8+xi) = palette[pen]; + // when the mc6845 device gains full interlace&video support, replace the line above with the line below + // bitmap.pix(y*(interlace+1)+hf, x*8+xi) = palette[pen]; + } + } + } +} + + u8 bml3_state::mc6845_r(offs_t offset) { if (offset) @@ -204,7 +368,7 @@ void bml3_state::mc6845_w(offs_t offset, u8 data) } } -u8 bml3_state::keyboard_r() +u8 bml3_state::kb_sel_r() { m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); u8 ret = m_keyb_scancode; @@ -213,7 +377,8 @@ u8 bml3_state::keyboard_r() return ret; } -void bml3_state::keyboard_w(u8 data) +// KB SEL - Keyboard mode register, interrupt control, keyboard LEDs +void bml3_state::kb_sel_w(u8 data) { m_keyb_katakana_led_on = BIT(data, 0); m_keyb_hiragana_led_on = BIT(data, 1); @@ -223,52 +388,43 @@ void bml3_state::keyboard_w(u8 data) m_keyb_nmi_disabled = !BIT(data, 7); } -void bml3_state::m6845_change_clock(u8 setting) +void bml3_state::crtc_change_clock() { - int m6845_clock = CPU_CLOCK.value(); // CRTC and MPU are synchronous by default - - switch(setting & 0x88) - { - case 0x00: m6845_clock = C40_CLOCK.value(); break; //320 x 200 - case 0x08: m6845_clock = C40_CLOCK.value(); break; //320 x 200, interlace - case 0x80: m6845_clock = C80_CLOCK.value(); break; //640 x 200 - case 0x88: m6845_clock = C80_CLOCK.value(); break; //640 x 200, interlace - } - - m_crtc->set_unscaled_clock(m6845_clock); + const u8 width80 = BIT(m_hres_reg, 7); + const u8 interlace = BIT(m_vres_reg, 3); + // CRTC and MPU are synchronous by default + int clock = (width80 ? C80_CLOCK : C40_CLOCK).value() << interlace; + m_crtc->set_unscaled_clock(clock); } -void bml3_state::hres_reg_w(u8 data) +/* + * MODE_SEL - Graphics mode select + * cfr. see service manual p.43 + * x--- ---- "W" bit: 0 = 40 columns, 1 = 80 columns + * -x-- ---- "HR" bit: 0 = high resolution, 1 = normal + * --x- ---- "C" bit - ACIA mode: 0 = cassette, 1 = RS-232C + * ---- -RGB Background colour + */ +void bml3_state::mode_sel_w(u8 data) { - // MODE SEL register (see service manual p.43). - /* - x--- ---- "W" bit: 0 = 40 columns, 1 = 80 columns - -x-- ---- "HR" bit: 0 = high resolution, 1 = normal - --x- ---- "C" bit - ACIA mode: 0 = cassette, 1 = RS-232C - ---- -RGB Background colour - */ - m_hres_reg = data; - m6845_change_clock((m_hres_reg & 0x80) | (m_vres_reg & 0x08)); + crtc_change_clock(); } -void bml3_state::vres_reg_w(u8 data) +// INTERLACE_SEL - Interlaced video mode +void bml3_state::interlace_sel_w(u8 data) { - // The MB-6890 had an interlaced video mode which was used for displaying Japanese (Hiragana and Katakana) text (8x16 character glyph bitmaps). - /* - ---- x--- Interlace select: 0 = non-interlace, 1 = interlace - */ m_vres_reg = data; - m6845_change_clock((m_hres_reg & 0x80) | (m_vres_reg & 0x08)); + crtc_change_clock(); } u8 bml3_state::vram_r(offs_t offset) { // Bit 7 masks reading back to the latch - if (!BIT(m_attr_latch, 7)) + if (!BIT(m_attr_latch, 7) && !machine().side_effects_disabled()) m_attr_latch = m_aram[offset]; return m_vram[offset]; @@ -278,7 +434,9 @@ void bml3_state::vram_w(offs_t offset, u8 data) { m_vram[offset] = data; // color ram is 5-bit - m_aram[offset] = m_attr_latch & 0x1F; + // NOTE: will break hiwriter with this, "write enable" only on reads!? + //if (!BIT(m_attr_latch, 7)) + m_aram[offset] = m_attr_latch & get_attr_mask(); } u8 bml3_state::psg_latch_r() @@ -305,49 +463,56 @@ void bml3_state::ym2203_w(u8 data) m_ym2203->write(dev_offs, data); } -u8 bml3_state::vram_attr_r() +/* + * C-REG-SELECT register + * Reads from a VRAM address copy the corresponding 'colour RAM' address to the + * low-order 5 bits of this register as a side-effect + */ +u8 bml3_state::c_reg_sel_r() { - // C-REG-SELECT register - // Reads from a VRAM address copy the corresponding 'colour RAM' address to the low-order 5 bits of this register as a side-effect - // (unless MK bit indicates 'prohibit write') return m_attr_latch; } -void bml3_state::vram_attr_w(u8 data) +/* + * C_REG_SEL - Attribute register (character/video mode and colours) + * Writes to a VRAM address copy the low-order 5 bits of this register to the corresponding 'colour RAM' address as a side-effect + * x--- ---- "MK" bit: 0 = enable write, 1 = prohibit write + * ---x ---- "GC" bit: 0 = character, 1 = graphic + * ---- x--- "RV" bit: 0 = normal, 1 - reverse + * ---- -RGB Foreground colour + * + */ +void bml3_state::c_reg_sel_w(u8 data) { - // C-REG-SELECT register - // Writes to a VRAM address copy the low-order 5 bits of this register to the corresponding 'colour RAM' address as a side-effect - /* - x--- ---- "MK" bit: 0 = enable write, 1 = prohibit write - ---x ---- "GC" bit: 0 = character, 1 = graphic - ---- x--- "RV" bit: 0 = normal, 1 - reverse - ---- -RGB Foreground colour - */ m_attr_latch = data; } -u8 bml3_state::beep_r() +u8 bml3_state::music_sel_r() { return -1; // BEEP status read? } -void bml3_state::beep_w(u8 data) +// MUSIC SEL - Music select: toggle audio output level when rising +void bml3_state::music_sel_w(u8 data) { m_speaker->level_w(BIT(data, 7)); } -void bml3_state::relay_w(u8 data) +// REMOTE - Remote relay control for cassette - bit 7 +void bml3_state::remote_w(u8 data) { - m_cass->change_state( - BIT(data,7) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); + m_cassette->change_state( + BIT(data, 7) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); } -u8 bml3_state::keyb_nmi_r() +// KBNMI - Keyboard "Break" key non-maskable interrupt +u8 bml3_state::kbnmi_r() { return m_nmi; // bit 7 used to signal a BREAK key pressure } -void bml3_state::firq_mask_w(u8 data) +// TIME_MASK - Prohibit timer IRQ +void bml3_state::time_mask_w(u8 data) { m_firq_mask = data & 0x80; if(m_firq_mask) @@ -357,58 +522,25 @@ void bml3_state::firq_mask_w(u8 data) } } -u8 bml3_state::firq_status_r() +// TIMER - System timer enable +u8 bml3_state::timer_r() { u8 res = m_firq_status << 7; - m_firq_status = 0; - m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); + if (!machine().side_effects_disabled()) + { + m_firq_status = 0; + m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); + } return res; } -void bml3_state::bml3_mem(address_map &map) +void bml3_state::main_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x03ff).ram(); map(0x0400, 0x43ff).rw(FUNC(bml3_state::vram_r), FUNC(bml3_state::vram_w)); map(0x4400, 0x7fff).ram(); - map(0xff40, 0xff46).noprw(); // lots of unknown reads and writes - map(0xffc0, 0xffc3).rw("pia", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xffc4, 0xffc5).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); - map(0xffc6, 0xffc7).rw(FUNC(bml3_state::mc6845_r), FUNC(bml3_state::mc6845_w)); - // KBNMI - Keyboard "Break" key non-maskable interrupt - map(0xffc8, 0xffc8).r(FUNC(bml3_state::keyb_nmi_r)); // keyboard nmi - // DIPSW - DIP switches on system mainboard - map(0xffc9, 0xffc9).portr("DSW"); - // TIMER - System timer enable - map(0xffca, 0xffca).r(FUNC(bml3_state::firq_status_r)); // timer irq - // LPFLG - Light pen interrupt -// map(0xffcb, 0xffcb) - // MODE_SEL - Graphics mode select - map(0xffd0, 0xffd0).w(FUNC(bml3_state::hres_reg_w)); - // TRACE - Trace counter -// map(0xffd1, 0xffd1) - // REMOTE - Remote relay control for cassette - bit 7 - map(0xffd2, 0xffd2).w(FUNC(bml3_state::relay_w)); - // MUSIC_SEL - Music select: toggle audio output level when rising - map(0xffd3, 0xffd3).rw(FUNC(bml3_state::beep_r), FUNC(bml3_state::beep_w)); - // TIME_MASK - Prohibit timer IRQ - map(0xffd4, 0xffd4).w(FUNC(bml3_state::firq_mask_w)); - // LPENBL - Light pen operation enable - map(0xffd5, 0xffd5).noprw(); - // INTERLACE_SEL - Interlaced video mode (manual has "INTERACE SEL"!) - map(0xffd6, 0xffd6).w(FUNC(bml3_state::vres_reg_w)); -// map(0xffd7, 0xffd7) baud select - // C_REG_SEL - Attribute register (character/video mode and colours) - map(0xffd8, 0xffd8).rw(FUNC(bml3_state::vram_attr_r), FUNC(bml3_state::vram_attr_w)); - // KB - Keyboard mode register, interrupt control, keyboard LEDs - map(0xffe0, 0xffe0).rw(FUNC(bml3_state::keyboard_r), FUNC(bml3_state::keyboard_w)); -// map(0xffe8, 0xffe8) bank register -// map(0xffe9, 0xffe9) IG mode register -// map(0xffea, 0xffea) IG enable register - map(0x8000, 0xffff).view(m_rom_view); - m_rom_view[0](0xa000, 0xfeff).rom().region("maincpu", 0xa000); - m_rom_view[0](0xfff0, 0xffff).rom().region("maincpu", 0xfff0); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).view(m_banka); m_banka[0](0xa000, 0xbfff).readonly().share("rama"); @@ -425,6 +557,36 @@ void bml3_state::bml3_mem(address_map &map) map(0xfff0, 0xffff).view(m_bankg); m_bankg[0](0xfff0, 0xffff).readonly().share("ramg"); map(0xfff0, 0xffff).writeonly().share("ramg"); + map(0x8000, 0xffff).view(m_rom_view); + m_rom_view[0](0xa000, 0xfeff).rom().region("maincpu", 0xa000); + m_rom_view[0](0xfff0, 0xffff).rom().region("maincpu", 0xfff0); + map(0xff00, 0xffef).m(*this, FUNC(bml3_state::system_io)); +} + +// Relative to $ffxx block +void bml3_state::system_io(address_map &map) +{ + map(0x0040, 0x0046).noprw(); // RS-232C + map(0x00c0, 0x00c3).rw("pia", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x00c4, 0x00c5).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); + map(0x00c6, 0x00c7).rw(FUNC(bml3_state::mc6845_r), FUNC(bml3_state::mc6845_w)); + map(0x00c8, 0x00c8).r(FUNC(bml3_state::kbnmi_r)); + map(0x00c9, 0x00c9).portr("DIPSW"); + map(0x00ca, 0x00ca).r(FUNC(bml3_state::timer_r)); +// map(0x00cb, 0x00cb) LPFLG - Light pen interrupt + map(0x00d0, 0x00d0).w(FUNC(bml3_state::mode_sel_w)); +// map(0x00d1, 0x00d1) TRACE - Trace counter + map(0x00d2, 0x00d2).w(FUNC(bml3_state::remote_w)); + map(0x00d3, 0x00d3).rw(FUNC(bml3_state::music_sel_r), FUNC(bml3_state::music_sel_w)); + map(0x00d4, 0x00d4).w(FUNC(bml3_state::time_mask_w)); + map(0x00d5, 0x00d5).noprw(); // L/P ENBL - Light pen operation enable + map(0x00d6, 0x00d6).w(FUNC(bml3_state::interlace_sel_w)); +// map(0x00d7, 0x00d7) BANK SEL - baud select + map(0x00d8, 0x00d8).rw(FUNC(bml3_state::c_reg_sel_r), FUNC(bml3_state::c_reg_sel_w)); + map(0x00e0, 0x00e0).rw(FUNC(bml3_state::kb_sel_r), FUNC(bml3_state::kb_sel_w)); +// map(0x00e8, 0x00e8) bank register +// map(0x00e9, 0x00e9) IG mode register +// map(0x00ea, 0x00ea) IG enable register #if 0 map(0xff00, 0xff00).rw(FUNC(bml3_state::ym2203_r), FUNC(bml3_state::ym2203_w)); @@ -432,52 +594,79 @@ void bml3_state::bml3_mem(address_map &map) #endif } -void bml3_state::bml3mk2_mem(address_map &map) +void bml3mk5_state::ig_ram_w(offs_t offset, u8 data) { - bml3_mem(map); - // TODO: anything to add here? - + for (int i = 0; i < 3; i++) + { + if (BIT(m_igen, i)) + m_ig_ram[offset + 0x800 * i] = data; + } + m_gfxdecode->gfx(0)->mark_dirty(offset >> 3); } -void bml3_state::bml3mk5_mem(address_map &map) +void bml3mk5_state::main_map(address_map &map) { - bml3_mem(map); - // TODO: anything to add here? + bml3_state::main_map(map); + map(0xa000, 0xa7ff).view(m_ig_view); + m_ig_view[0](0xa000, 0xa7ff).writeonly().w(FUNC(bml3mk5_state::ig_ram_w)); +} +void bml3mk5_state::system_io(address_map &map) +{ + bml3_state::system_io(map); + // IGMODREG + map(0x00e9, 0x00e9).lw8( + NAME([this] (u8 data) { + if (BIT(data, 0)) + m_ig_view.select(0); + else + m_ig_view.disable(); + }) + ); + // IGENREG + map(0x00ea, 0x00ea).lw8( + NAME([this] (u8 data) { + m_igen = data & 7; + }) + ); } -/* Input ports */ +INPUT_CHANGED_MEMBER(bml3_state::nmi_button) +{ + // TODO: supposed to actually raise an NMI, just like earlier Basic Master LV1/2 + m_nmi = newval ? 0x80 : 0; +} static INPUT_PORTS_START( bml3 ) // DIP switches (service manual p.88) // Note the NEWON command reboots with a soft override for the DIP switch - PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x01, "BASIC/terminal mode") - PORT_DIPSETTING(0x00, "Terminal mode") - PORT_DIPSETTING(0x01, "BASIC mode") - PORT_DIPNAME( 0x02, 0x02, "Interlaced video") - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPSETTING(0x02, DEF_STR( On )) + PORT_START("DIPSW") + PORT_DIPNAME( 0x01, 0x01, "BASIC/terminal mode") PORT_DIPLOCATION("SW:!1") + PORT_DIPSETTING(0x00, "Terminal mode") + PORT_DIPSETTING(0x01, "BASIC mode") + PORT_DIPNAME( 0x02, 0x02, "Interlaced video") PORT_DIPLOCATION("SW:!2") + PORT_DIPSETTING(0x00, DEF_STR( Off ) ) + PORT_DIPSETTING(0x02, DEF_STR( On )) // This is overridden by the 'Mode' toggle button - PORT_DIPNAME( 0x04, 0x04, "40-/80-column") - PORT_DIPSETTING(0x00, "40 chars/line") - PORT_DIPSETTING(0x04, "80 chars/line") - PORT_DIPNAME( 0x08, 0x00, "Video resolution") - PORT_DIPSETTING(0x00, "High") - PORT_DIPSETTING(0x08, "Low") - PORT_DIPNAME( 0x10, 0x00, "Show PF key content") - PORT_DIPSETTING(0x00, DEF_STR ( Off ) ) - PORT_DIPSETTING(0x10, DEF_STR ( On )) - PORT_DIPNAME( 0x20, 0x00, "Terminal duplex") - PORT_DIPSETTING(0x00, "Full duplex") - PORT_DIPSETTING(0x20, "Half duplex") - PORT_DIPNAME( 0x40, 0x00, "Terminal bits") - PORT_DIPSETTING(0x00, "8 bits/char") - PORT_DIPSETTING(0x40, "7 bits/char") - PORT_DIPNAME( 0x80, 0x00, "Hiragana->Katakana") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "40-/80-column") PORT_DIPLOCATION("SW:!3") + PORT_DIPSETTING(0x00, "40 chars/line") + PORT_DIPSETTING(0x04, "80 chars/line") + PORT_DIPNAME( 0x08, 0x00, "Video resolution") PORT_DIPLOCATION("SW:!4") + PORT_DIPSETTING(0x00, "High") + PORT_DIPSETTING(0x08, "Low") + PORT_DIPNAME( 0x10, 0x00, "Show PF key content") PORT_DIPLOCATION("SW:!5") + PORT_DIPSETTING(0x00, DEF_STR ( Off ) ) + PORT_DIPSETTING(0x10, DEF_STR ( On )) + PORT_DIPNAME( 0x20, 0x00, "Terminal duplex") PORT_DIPLOCATION("SW:!6") + PORT_DIPSETTING(0x00, "Full duplex") + PORT_DIPSETTING(0x20, "Half duplex") + PORT_DIPNAME( 0x40, 0x00, "Terminal bits") PORT_DIPLOCATION("SW:!7") + PORT_DIPSETTING(0x00, "8 bits/char") + PORT_DIPSETTING(0x40, "7 bits/char") + PORT_DIPNAME( 0x80, 0x00, "Hiragana->Katakana") PORT_DIPLOCATION("SW:!8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // TODO: also model the CS jumper block? @@ -586,96 +775,15 @@ static INPUT_PORTS_START( bml3 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_CHANGED_MEMBER(DEVICE_SELF, bml3_state, nmi_button, 0) INPUT_PORTS_END -INPUT_CHANGED_MEMBER(bml3_state::nmi_button) -{ - m_nmi = newval ? 0x80 : 0; -} - -MC6845_UPDATE_ROW( bml3_state::crtc_update_row ) -{ - rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - // The MB-6890 has a 5-bit colour RAM region. The meaning of the bits are: - // 0: blue - // 1: red - // 2: green - // 3: reverse/inverse video - // 4: graphic (not character) - - u8 const interlace = (m_crtc_vreg[8] & 3) ? 1 : 0; - bool const lowres = BIT(m_hres_reg, 6); - u8 const bgcolor = m_hres_reg & 7; - - if (interlace) - { - ra >>= 1; - if (y > 0x191) return; - } - - for(u8 x=0; x> ra/2 & 0x11) * 0xf; - } - else - { - dots[0] = dots[1] = rawbits; - } - } - else - { - // character mode - int const tile = rawbits & 0x7f; - int const tile_bank = BIT(rawbits, 7); - if (interlace) - { - dots[0] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)]; - dots[1] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)|tile_bank]; - } - else - { - dots[0] = dots[1] = m_p_chargen[(tile<<4)|(ra<<1)|tile_bank]; - } - } - - for(u8 hf=0;hf<=interlace;hf++) - { - for(u8 xi=0;xi<8;xi++) - { - u8 pen; - if(reverse) - pen = (dots[hf] >> (7-xi) & 1) ? bgcolor : color; - else - pen = (dots[hf] >> (7-xi) & 1) ? color : bgcolor; - - bitmap.pix(y, x*8+xi) = palette[pen]; - // when the mc6845 device gains full interlace&video support, replace the line above with the line below - // bitmap.pix(y*(interlace+1)+hf, x*8+xi) = palette[pen]; - } - } - } -} - +static INPUT_PORTS_START( bml3mk5 ) + PORT_INCLUDE( bml3 ) + // No dipswitches on Mark 5 + PORT_MODIFY("DIPSW") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) + // TODO: add MODE front panel button here, in place of dipswitch + // On regular bml3 there's an extra button that xor content, that is directly routed here + PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback) { @@ -730,7 +838,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::kansas_r ) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - u8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + u8 cass_ws = (m_cassette->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -740,13 +848,6 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::kansas_r ) } } -#if 0 -INTERRUPT_GEN_MEMBER(bml3_state::irq) -{ - m_maincpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); -} -#endif - INTERRUPT_GEN_MEMBER(bml3_state::timer_firq) { @@ -762,6 +863,9 @@ void bml3_state::machine_start() m_vram = make_unique_clear(0x4000); m_aram = make_unique_clear(0x4000); + // TODO: this setup is goofy, and bound to fail if things changes downstream. + // Should really overlay the ROM region, not the view itself. + // Additionally each slot has separate ROM KIL and EXROM KIL signal controls ... m_bml3bus->map_exrom(m_rom_view[0]); m_bml3bus->map_io(m_maincpu->space(AS_PROGRAM)); @@ -819,6 +923,27 @@ void bml3_state::machine_reset() m_cassold = 0; m_nmi = 0; m_kbt = 0; + + // NOTE: bml3 do not bother with CRTC on soft resets (which is physically tied to front panel). + //m_hres_reg = 0; + //m_vres_reg = 0; + //crtc_change_clock(); +} + +void bml3mk5_state::machine_start() +{ + bml3_state::machine_start(); + m_ig_ram = make_unique_clear(0x800 * 3); + m_gfxdecode->gfx(0)->set_source_and_total(m_ig_ram.get(), 0x100); + + save_pointer(NAME(m_ig_ram), 0x800 * 3); +} + +void bml3mk5_state::machine_reset() +{ + bml3_state::machine_reset(); + m_ig_view.disable(); + m_igen = 0; } void bml3_state::piaA_w(uint8_t data) @@ -894,44 +1019,44 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::kansas_w ) } if (m_cassbit) - m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz + m_cassette->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else - m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz + m_cassette->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } +// Debugging only +static const gfx_layout ig_charlayout = +{ + 8, 8, + 0x100, + 3, + { 0x1000*8, 0x800*8, 0 }, + { STEP8(0, 1) }, + { STEP8(0, 8) }, + 8*8 +}; + +static GFXDECODE_START( gfx_bml3mk5 ) + GFXDECODE_ENTRY( nullptr, 0, ig_charlayout, 0, 1 ) +GFXDECODE_END + + static void bml3_cards(device_slot_interface &device) { - device.option_add("bml3mp1802", BML3BUS_MP1802); // MP-1802 Floppy Controller Card - device.option_add("bml3mp1805", BML3BUS_MP1805); // MP-1805 Floppy Controller Card - device.option_add("bml3kanji", BML3BUS_KANJI); - device.option_add("bml3rtc", BML3BUS_RTC); + device.option_add("mp1802", BML3BUS_MP1802); + device.option_add("mp1805", BML3BUS_MP1805); + device.option_add("kanji", BML3BUS_KANJI); + device.option_add("rtc", BML3BUS_RTC); } - -void bml3_state::bml3_common(machine_config &config) +void bml3_state::bml3(machine_config &config) { /* basic machine hardware */ MC6809(config, m_maincpu, CPU_EXT_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &bml3_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(bml3_state::timer_firq)); // m_maincpu->set_periodic_int(FUNC(bml3_state::firq), attotime::fromhz(45)); - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2400)); /* Service manual specifies "Raster return period" as 2.4 ms (p.64), although the total vertical non-displaying time seems to be 4 ms. */ - screen.set_size(640, 400); - screen.set_visarea(0, 320-1, 0, 200-1); - screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); - PALETTE(config, m_palette, palette_device::BRG_3BIT); - - /* Devices */ - // CRTC clock should be synchronous with the CPU clock. - HD6845S(config, m_crtc, CPU_CLOCK); // HD46505SP - m_crtc->set_screen("screen"); - m_crtc->set_show_border_area(false); - m_crtc->set_char_width(8); - m_crtc->set_update_row_callback(FUNC(bml3_state::crtc_update_row)); - // fire once per scan of an individual key // According to the service manual (p.65), the keyboard timer is driven by the horizontal video sync clock. TIMER(config, "keyboard_timer").configure_periodic(FUNC(bml3_state::keyboard_callback), attotime::from_hz(H_CLOCK/2)); @@ -946,19 +1071,34 @@ void bml3_state::bml3_common(machine_config &config) m_acia->rts_handler().set(FUNC(bml3_state::acia_rts_w)); m_acia->irq_handler().set(FUNC(bml3_state::acia_irq_w)); - /* Audio */ - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - clock_device &acia_clock(CLOCK(config, "acia_clock", 9'600)); // 600 baud x 16(divider) = 9600 acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc)); acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc)); - CASSETTE(config, m_cass); - m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED); - m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); + CASSETTE(config, m_cassette); + m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED); + m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); + m_cassette->set_interface("bml3_cass"); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + // Service manual specifies "Raster return period" as 2.4 ms (p.64), + // although the total vertical non-displaying time seems to be 4 ms. + // NOTE: D80_CLOCK x 2 as per MAME interlace limitation + screen.set_raw(D80_CLOCK * 2, 1024, 0, 640 - 1, 518, 0, 400 - 1); + screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); + PALETTE(config, m_palette, palette_device::BRG_3BIT); + + /* Devices */ + // CRTC clock should be synchronous with the CPU clock. + HD6845S(config, m_crtc, CPU_CLOCK); // HD46505SP + m_crtc->set_screen("screen"); + m_crtc->set_show_border_area(false); + m_crtc->set_char_width(8); + m_crtc->set_update_row_callback(FUNC(bml3_state::crtc_update_row)); + + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - /* slot devices */ BML3BUS(config, m_bml3bus, 0); m_bml3bus->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); m_bml3bus->irq_callback().set_inputline(m_maincpu, M6809_IRQ_LINE); @@ -968,18 +1108,15 @@ void bml3_state::bml3_common(machine_config &config) Or use MP-1802 (5.25" DS/DD). Note it isn't feasible to use both, as they each place boot ROM at F800. */ + // TODO: find actual defaults for each variant (should be no option for at least base model) BML3BUS_SLOT(config, "sl1", m_bml3bus, bml3_cards, nullptr); - BML3BUS_SLOT(config, "sl2", m_bml3bus, bml3_cards, "bml3rtc"); + BML3BUS_SLOT(config, "sl2", m_bml3bus, bml3_cards, "rtc"); BML3BUS_SLOT(config, "sl3", m_bml3bus, bml3_cards, nullptr); BML3BUS_SLOT(config, "sl4", m_bml3bus, bml3_cards, nullptr); BML3BUS_SLOT(config, "sl5", m_bml3bus, bml3_cards, nullptr); - BML3BUS_SLOT(config, "sl6", m_bml3bus, bml3_cards, "bml3kanji"); -} + BML3BUS_SLOT(config, "sl6", m_bml3bus, bml3_cards, "kanji"); -void bml3_state::bml3(machine_config &config) -{ - bml3_common(config); - m_maincpu->set_addrmap(AS_PROGRAM, &bml3_state::bml3_mem); + SOFTWARE_LIST(config, "cass_list").set_original("bml3_cass"); #if 0 // TODO: slot device for sound card @@ -993,24 +1130,20 @@ void bml3_state::bml3(machine_config &config) #endif } -void bml3_state::bml3mk2(machine_config &config) +void bml3mk2_state::bml3mk2(machine_config &config) { - bml3_common(config); - m_maincpu->set_addrmap(AS_PROGRAM, &bml3_state::bml3mk2_mem); - - // TODO: anything to add here? + bml3_state::bml3(config); + // TODO: override bus defaults } -void bml3_state::bml3mk5(machine_config &config) +void bml3mk5_state::bml3mk5(machine_config &config) { - bml3_common(config); - m_maincpu->set_addrmap(AS_PROGRAM, &bml3_state::bml3mk5_mem); - - // TODO: anything to add here? + bml3mk2_state::bml3mk2(config); + // TODO: override bus defaults + GFXDECODE(config, "gfxdecode", "palette", gfx_bml3mk5); } - /* ROM definition */ // floppy-drive slot devices expect "maincpu" is sized 0x10000. ROM_START( bml3 ) @@ -1054,9 +1187,6 @@ ROM_END } // anonymous namespace -/* Driver */ - -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1980, bml3, 0, 0, bml3, bml3, bml3_state, empty_init, "Hitachi", "MB-6890 Basic Master Level 3", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -COMP( 1982, bml3mk2, bml3, 0, bml3mk2, bml3, bml3_state, empty_init, "Hitachi", "MB-6891 Basic Master Level 3 Mark 2", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -COMP( 1983, bml3mk5, bml3, 0, bml3mk5, bml3, bml3_state, empty_init, "Hitachi", "MB-6892 Basic Master Level 3 Mark 5", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1980, bml3, 0, 0, bml3, bml3, bml3_state, empty_init, "Hitachi", "Basic Master Level 3 (MB-6890)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1982, bml3mk2, bml3, 0, bml3mk2, bml3, bml3mk2_state, empty_init, "Hitachi", "Basic Master Level 3 Mark II (MB-6891)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1983, bml3mk5, bml3, 0, bml3mk5, bml3mk5, bml3mk5_state, empty_init, "Hitachi", "Basic Master Level 3 Mark 5 (MB-6892)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/hp/hp98x6.cpp b/src/mame/hp/hp98x6.cpp index c1f04569d50cb..0408bcd7befda 100644 --- a/src/mame/hp/hp98x6.cpp +++ b/src/mame/hp/hp98x6.cpp @@ -185,7 +185,7 @@ void hp98x6_base_state::machine_start() space->install_ram(0x1000000 - m_ram->size(), 0xffffff, m_ram->pointer()); - for (auto& finder : m_rom_drawers) { + for (auto &finder : m_rom_drawers) { finder->install_handlers(space); } } @@ -241,7 +241,7 @@ void hp98x6_base_state::hp98x6_base(machine_config &config, unsigned dot_clock, IEEE488_SLOT(config, "ieee_rem", 0, remote488_devices, nullptr); // Optional ROM slots - for (auto& finder : m_rom_drawers) { + for (auto &finder : m_rom_drawers) { HP98X6_OPTROM(config, finder); } @@ -2069,8 +2069,8 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP(1982, hp9816a, 0, 0, hp9816, hp9816, hp9816_state,empty_init, "Hewlett-Packard", "HP 9816A", 0) -COMP(1981, hp9826a, 0, 0, hp9826, hp9826_36,hp9826_state,empty_init,"Hewlett-Packard","HP 9826A", 0) -COMP(1981, hp9836a, 0, 0, hp9836, hp9836, hp9836_state,empty_init, "Hewlett-Packard", "HP 9836A", 0) -COMP(1983, hp9836c, 0, 0, hp9836c,hp9836, hp9836c_state,empty_init,"Hewlett-Packard", "HP 9836C", 0) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP(1982, hp9816a, 0, 0, hp9816, hp9816, hp9816_state,empty_init, "Hewlett-Packard", "HP 9816A", 0) +COMP(1981, hp9826a, 0, 0, hp9826, hp9826_36,hp9826_state,empty_init, "Hewlett-Packard", "HP 9826A", 0) +COMP(1981, hp9836a, 0, 0, hp9836, hp9836, hp9836_state,empty_init, "Hewlett-Packard", "HP 9836A", 0) +COMP(1983, hp9836c, 0, 0, hp9836c,hp9836, hp9836c_state,empty_init,"Hewlett-Packard", "HP 9836C", 0) diff --git a/src/mame/hp/hp98x6_optrom.cpp b/src/mame/hp/hp98x6_optrom.cpp index 6bc6ac0638561..7d11aa2bbbe8e 100644 --- a/src/mame/hp/hp98x6_optrom.cpp +++ b/src/mame/hp/hp98x6_optrom.cpp @@ -16,18 +16,21 @@ #define VERBOSE 0 #include "logmacro.h" -DEFINE_DEVICE_TYPE(HP98X6_OPTROM, hp98x6_optrom_device, "hp98x6_optrom", "HP98x6 optional ROM") +namespace { struct optrom_region { offs_t m_start; const char *m_tag; }; -constexpr std::array region_tab = - {{ - { 0x100000, "rom100000" }, - { 0x80000, "rom80000" } - }}; +constexpr std::array region_tab = {{ + { 0x100000, "rom100000" }, + { 0x080000, "rom80000" } +}}; + +} // anonymous namespace + +DEFINE_DEVICE_TYPE(HP98X6_OPTROM, hp98x6_optrom_device, "hp98x6_optrom", "HP98x6 optional ROM") // +--------------------+ // |hp98x6_optrom_device| @@ -52,7 +55,7 @@ void hp98x6_optrom_device::install_handlers(address_space *space_r) { m_space_r = space_r; - for (const struct optrom_region& reg : region_tab) { + for (const struct optrom_region ® : region_tab) { uint8_t *ptr = get_software_region(reg.m_tag); if (ptr != nullptr) { auto len = get_software_region_length(reg.m_tag); @@ -80,7 +83,7 @@ void hp98x6_optrom_device::call_unload() { LOG("hp98x6_optrom: call_unload\n"); if (m_space_r != nullptr) { - for (const struct optrom_region& reg : region_tab) { + for (const struct optrom_region ® : region_tab) { auto len = get_software_region_length(reg.m_tag); if (len != 0) { m_space_r->unmap_read(reg.m_start , reg.m_start + len - 1); diff --git a/src/mame/hp/jornada.cpp b/src/mame/hp/jornada.cpp index a58dadb6406f1..04ab3e06f7ea4 100644 --- a/src/mame/hp/jornada.cpp +++ b/src/mame/hp/jornada.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/m950x0.h" #include "machine/sa1110.h" #include "machine/sa1111.h" diff --git a/src/mame/husky/hunter2.cpp b/src/mame/husky/hunter2.cpp index 7a1f26b294f45..c8d3275cf1fc2 100644 --- a/src/mame/husky/hunter2.cpp +++ b/src/mame/husky/hunter2.cpp @@ -32,7 +32,7 @@ #include "emu.h" #include "bus/rs232/rs232.h" -#include "cpu/z80/z80.h" +#include "cpu/z80/nsc800.h" #include "machine/mm58274c.h" #include "machine/nsc810.h" #include "machine/ram.h" diff --git a/src/mame/husky/husky.cpp b/src/mame/husky/husky.cpp index 5859e75ea027c..4591483cb0f36 100644 --- a/src/mame/husky/husky.cpp +++ b/src/mame/husky/husky.cpp @@ -19,7 +19,7 @@ ****************************************************************************/ #include "emu.h" -#include "cpu/z80/z80.h" +#include "cpu/z80/nsc800.h" #include "machine/mm58274c.h" #include "machine/nsc810.h" #include "machine/ram.h" diff --git a/src/mame/ibm/thinkpad8xx.cpp b/src/mame/ibm/thinkpad8xx.cpp new file mode 100644 index 0000000000000..97b9f24edee64 --- /dev/null +++ b/src/mame/ibm/thinkpad8xx.cpp @@ -0,0 +1,103 @@ +// license:BSD-3-Clause +// copyright-holders: +/*********************************************************************************************************** +Skeleton driver for IBM ThinkPad Power Series. +The IBM ThinkPad Power Series (800/820/821/822/823/850/851/860) is a laptop series from the ThinkPad line +that was manufactured by IBM. It is based on the PowerPC architecture. +All of the PowerPC ThinkPads could run Windows NT 3.51 and 4.0, AIX 4.1.x, and Solaris Desktop 2.5.1 +PowerPC Edition. It is also possible to run certain PowerPC versions of Linux on the 800 Series. +830 and 850 models can also run OS/2 Warp PowerPC Edition. + +This has no chance of running until MAME's PowerPC CPU core supports little Endian mode and motherboards +wired for little Endian operating systems. + +Hardware for the 850 model: +-SCSI hard disk and SCSI CD-ROM drive (with a NCR 53C810 PCI-SCSI I/O Processor). +-Two PC Card expansion slots (with a Ricoh RF53C366L PC Card interface controller and a + MAX780 Dual-Slot PCMCIA Analog Power Controller). +-Video: + -IBM 85G7815 (by Seiko/Epson). + -Western Digital WD90C24A SVGA LCD controller. + -Two Hitachi HM51S4260 262144 x 16bit DRAM (1MB of video display memory). + -10.4" 640×480 or 800×600 screen. +-Video capture: + -Brooktree Bt812 NTSC/PAL to RGB/YCrCb Decoder. + -Two Hitachi HM530281 high speed 331776 x 8bit Frame buffer DRAM. + -ASCII V7310AS (アスキー, Asukii) Video Capture Device. +-Crystal CS4231 16bit stereo codec for audio. +-Two DRAM DIMMs slots. +-Hitachi H8/338 (HD6473388) for main board supervision. +-CPU: + -IBM PowerPC 603e @ 100MHz (PPCI603eFC100BPQ). + -Two 32k x 36bits IBM043614 burst SRAM (256k L2 cache total). + -IDT71216 240K (16K x 15bit) cache-tag RAM. + -33.333 MHz xtal (tripled for 100MHz system clock). +-Dallas DS1585S RTC. +-Intel S82378ZB PCIset. +-National Semiconductor DP87322VF (SuperI/O III, Floppy Disk Controller with Dual UARTs, + Enhanced Parallel Port, and IDE Interface). +-Motorola XPC105ARX66CD (PowerPC PCI Bridge/Memory Controller). +-Other ICs: S-MOS 85G7814, S-MOS 85G2680 + +More info: http://oldcomputer.info/portables/tp850/ibm_ppc_thinkpad_redbook.pdf + +***********************************************************************************************************/ + +#include "emu.h" +#include "cpu/h8/h8325.h" +#include "cpu/powerpc/ppc.h" +#include "softlist_dev.h" +#include "speaker.h" + + +namespace { + +class thinkpad8xx_state : public driver_device +{ +public: + thinkpad8xx_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + + void thinkpad850(machine_config &config); + +private: + required_device m_maincpu; +}; + + +static INPUT_PORTS_START(thinkpad8xx) +INPUT_PORTS_END + +void thinkpad8xx_state::thinkpad850(machine_config &config) +{ + PPC603(config, m_maincpu, 33.333_MHz_XTAL * 3); // IBM PPCI603eFC100BPQ + + // All BIOS ROM chip lines are routed through the S-MOS 85G7814 + + H8325(config, "mcu", XTAL(10'000'000)); // Actually an H8/338 (HD6473388: 48k-byte ROM; 2k-byte RAM), unknown clock + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + SOFTWARE_LIST(config, "thinkpad8xx").set_original("thinkpad8xx"); +} + + +ROM_START(thinkpad850) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_SYSTEM_BIOS( 0, "91g1671", "v1.01 (91G1671, 09-10-1996)" ) + ROMX_LOAD( "91g1671_ibm_dakota_v101_mbm29f040a.u21", 0x00000, 0x80000, CRC(5210dbd6) SHA1(8e0bbbe130e6fdb06ef307bb5addbcb993a8a41f), ROM_BIOS(0) ) // Needed for installing Windows NT + ROM_SYSTEM_BIOS( 1, "91g0610", "v1.00 (91G0610, 07-03-1995)" ) + ROMX_LOAD( "91g0610_ibm_dakota_v100_mbm29f040a.u21", 0x00000, 0x80000, CRC(169a79c4) SHA1(da74a2f346b732add62d08ca5f34f192cae5d033), ROM_BIOS(1) ) + + ROM_REGION(0xe000, "mcu", 0) + ROM_LOAD( "hd6473388.u15", 0x0000, 0xe000, NO_DUMP ) +ROM_END + +} // anonymous namespace + +// YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS +COMP( 1996, thinkpad850, 0, 0, thinkpad850, thinkpad8xx, thinkpad8xx_state, empty_init, "IBM", "ThinkPad 850", MACHINE_IS_SKELETON ) diff --git a/src/mame/ice/lethalj.cpp b/src/mame/ice/lethalj.cpp index eb57c49fc95cd..20651e18e9f6a 100644 --- a/src/mame/ice/lethalj.cpp +++ b/src/mame/ice/lethalj.cpp @@ -199,7 +199,7 @@ Pin #11(+) | | R | * *************************************/ -CUSTOM_INPUT_MEMBER(lethalj_state::cclownz_paddle) +ioport_value lethalj_state::cclownz_paddle() { int value = m_paddle->read(); return ((value << 4) & 0xf00) | (value & 0x00f); @@ -755,7 +755,7 @@ void lethalj_state::gameroom(machine_config &config) m_maincpu->set_pixels_per_clock(1); m_maincpu->set_scanline_ind16_callback(FUNC(lethalj_state::scanline_update)); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/ice/lethalj.h b/src/mame/ice/lethalj.h index 6cae2b57b4787..8c3999b024d73 100644 --- a/src/mame/ice/lethalj.h +++ b/src/mame/ice/lethalj.h @@ -40,7 +40,7 @@ class lethalj_state : public driver_device void init_ripribit(); void init_cclownz(); - DECLARE_CUSTOM_INPUT_MEMBER(cclownz_paddle); + ioport_value cclownz_paddle(); private: void ripribit_control_w(uint16_t data); diff --git a/src/mame/igs/cabaret.cpp b/src/mame/igs/cabaret.cpp index 5f4c62615195d..5f6128c95b065 100644 --- a/src/mame/igs/cabaret.cpp +++ b/src/mame/igs/cabaret.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Mirko Buffoni, David Haywood +// copyright-holders: Mirko Buffoni, David Haywood + /*************************************************************************** Cabaret (AMT) @@ -11,10 +12,13 @@ Driver by Mirko Buffoni, David Haywood - DSW3 is read, not sure where it's used - Keyboard is mapped through test mode, but some bits are unknown, and hopper is not emulated -- Map Leds and Coin counters +- Map LEDs and coin counters - Remove patches after finding why there are so many pitfalls. Maybe the game expects to read inputs via an external device and expects certain timings +- Trojan out internal ROMs for kungfua and double8l +- kungfua and double8l have 5 banks of 8 DIP switches (sheets available for + double8l) Press F1+F2 during reset to see 'pork*ish' test mode :P @@ -24,9 +28,11 @@ are the same of IGS. AMT may be previous IGS name. ***************************************************************************/ #include "emu.h" + #include "cpu/z180/z180.h" #include "machine/i8255.h" #include "sound/ymopl.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -40,52 +46,62 @@ class cabaret_state : public driver_device public: cabaret_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") , m_fg_tile_ram(*this, "fg_tile_ram") , m_fg_color_ram(*this, "fg_color_ram") , m_bg_scroll(*this, "bg_scroll") , m_bg_tile_ram(*this, "bg_tile_ram") - , m_maincpu(*this, "maincpu") - , m_gfxdecode(*this, "gfxdecode") - , m_palette(*this, "palette") , m_led(*this, "led6") { } - void bg_scroll_w(offs_t offset, uint8_t data); - void bg_tile_w(offs_t offset, uint8_t data); - void fg_tile_w(offs_t offset, uint8_t data); - void fg_color_w(offs_t offset, uint8_t data); - void nmi_and_coins_w(uint8_t data); - void ppi2_b_w(uint8_t data); - void ppi2_c_w(uint8_t data); - void show_out(); - void init_cabaret(); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - uint32_t screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(cabaret_interrupt); void cabaret(machine_config &config); - void cabaret_map(address_map &map); - void cabaret_portmap(address_map &map); + + void init_cabaret(); + void init_double8l(); + void init_kungfua(); protected: virtual void machine_start() override { m_led.resolve(); } virtual void machine_reset() override; virtual void video_start() override; +private: + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_shared_ptr m_fg_tile_ram; required_shared_ptr m_fg_color_ram; required_shared_ptr m_bg_scroll; required_shared_ptr m_bg_tile_ram; + + output_finder<> m_led; + tilemap_t *m_bg_tilemap = nullptr; tilemap_t *m_fg_tilemap = nullptr; - int m_nmi_enable = 0; + + uint8_t m_nmi_enable = 0; uint8_t m_out[3]{}; - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - output_finder<> m_led; -}; + void bg_scroll_w(offs_t offset, uint8_t data); + void bg_tile_w(offs_t offset, uint8_t data); + void fg_tile_w(offs_t offset, uint8_t data); + void fg_color_w(offs_t offset, uint8_t data); + void nmi_and_coins_w(uint8_t data); + void ppi2_b_w(uint8_t data); + void ppi2_c_w(uint8_t data); + void show_out(); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(interrupt_cb); + + void program_map(address_map &map); + void port_map(address_map &map); +}; /*************************************************************************** @@ -93,8 +109,6 @@ class cabaret_state : public driver_device ***************************************************************************/ - - void cabaret_state::bg_scroll_w(offs_t offset, uint8_t data) { m_bg_scroll[offset] = data; @@ -109,14 +123,14 @@ void cabaret_state::bg_tile_w(offs_t offset, uint8_t data) TILE_GET_INFO_MEMBER(cabaret_state::get_bg_tile_info) { - int code = m_bg_tile_ram[tile_index]; + int const code = m_bg_tile_ram[tile_index]; tileinfo.set(1, code & 0xff, 0, 0); } TILE_GET_INFO_MEMBER(cabaret_state::get_fg_tile_info) { - int code = m_fg_tile_ram[tile_index] | (m_fg_color_ram[tile_index] << 8); - int tile = code & 0x1fff; + int const code = m_fg_tile_ram[tile_index] | (m_fg_color_ram[tile_index] << 8); + int const tile = code & 0x1fff; tileinfo.set(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); } @@ -134,14 +148,14 @@ void cabaret_state::fg_color_w(offs_t offset, uint8_t data) void cabaret_state::video_start() { - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabaret_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabaret_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabaret_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabaret_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_fg_tilemap->set_transparent_pen(0); m_bg_tilemap->set_scroll_cols(64); } -uint32_t cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cabaret_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -169,18 +183,18 @@ void cabaret_state::nmi_and_coins_w(uint8_t data) { if ((m_nmi_enable ^ data) & (~0xdd)) { - logerror("PC %06X: nmi_and_coins = %02x\n",m_maincpu->pc(),data); -// popmessage("%02x",data); + logerror("%s: nmi_and_coins = %02x\n", machine().describe_context(), data); + //popmessage("%02x", data); } - machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin_a - machine().bookkeeping().coin_counter_w(1, data & 0x04); // coin_c - machine().bookkeeping().coin_counter_w(2, data & 0x08); // key in - machine().bookkeeping().coin_counter_w(3, data & 0x10); // coin m_out mech + machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin_a + machine().bookkeeping().coin_counter_w(1, data & 0x04); // coin_c + machine().bookkeeping().coin_counter_w(2, data & 0x08); // key in + machine().bookkeeping().coin_counter_w(3, data & 0x10); // coin m_out mech - m_led = BIT(data, 6); // led for coin m_out / hopper active + m_led = BIT(data, 6); // LED for coin m_out / hopper active - m_nmi_enable = data; // data & 0x80 // nmi enable? + m_nmi_enable = data; // data & 0x80 // NMI enable? m_out[0] = data; show_out(); @@ -200,13 +214,13 @@ void cabaret_state::ppi2_c_w(uint8_t data) -void cabaret_state::cabaret_map(address_map &map) +void cabaret_state::program_map(address_map &map) { map(0x00000, 0x0efff).rom(); map(0x0f000, 0x0ffff).ram(); } -void cabaret_state::cabaret_portmap(address_map &map) +void cabaret_state::port_map(address_map &map) { map(0x0000, 0x003f).ram(); // Z180 internal regs @@ -214,20 +228,20 @@ void cabaret_state::cabaret_portmap(address_map &map) map(0x0090, 0x0093).rw("ppi2", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x00a0, 0x00a3).rw("ppi3", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x00b0, 0x00b0).portr("DSW3"); /* DSW3 */ + map(0x00b0, 0x00b0).portr("DSW3"); map(0x00e0, 0x00e1).w("ymsnd", FUNC(ym2413_device::write)); - map(0x2000, 0x27ff).ram().w(FUNC(cabaret_state::fg_tile_w)).share("fg_tile_ram"); - map(0x2800, 0x2fff).ram().w(FUNC(cabaret_state::fg_color_w)).share("fg_color_ram"); + map(0x2000, 0x27ff).ram().w(FUNC(cabaret_state::fg_tile_w)).share(m_fg_tile_ram); + map(0x2800, 0x2fff).ram().w(FUNC(cabaret_state::fg_color_w)).share(m_fg_color_ram); map(0x3000, 0x37ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x3800, 0x3fff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); - map(0x1000, 0x103f).ram().w(FUNC(cabaret_state::bg_scroll_w)).share("bg_scroll"); + map(0x1000, 0x103f).ram().w(FUNC(cabaret_state::bg_scroll_w)).share(m_bg_scroll); - map(0x1800, 0x19ff).ram().w(FUNC(cabaret_state::bg_tile_w)).share("bg_tile_ram"); - map(0x8000, 0xffff).rom().region("gfx3", 0); + map(0x1800, 0x19ff).ram().w(FUNC(cabaret_state::bg_tile_w)).share(m_bg_tile_ram); + map(0x8000, 0xffff).rom().region("bgmaps", 0); } @@ -346,8 +360,8 @@ static const gfx_layout layout_8x32x6i = }; static GFXDECODE_START( gfx_cabaret ) - GFXDECODE_ENTRY( "gfx1", 0x00000, layout_8x8x6, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x00000, layout_8x32x6i, 0, 16 ) + GFXDECODE_ENTRY( "fgtiles", 0x00000, layout_8x8x6, 0, 16 ) + GFXDECODE_ENTRY( "bgtiles", 0x00000, layout_8x32x6i, 0, 16 ) GFXDECODE_END @@ -359,10 +373,10 @@ GFXDECODE_END void cabaret_state::machine_reset() { - m_nmi_enable = 0; + m_nmi_enable = 0; } -INTERRUPT_GEN_MEMBER(cabaret_state::cabaret_interrupt) +INTERRUPT_GEN_MEMBER(cabaret_state::interrupt_cb) { if (m_nmi_enable & 0x80) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); @@ -370,11 +384,11 @@ INTERRUPT_GEN_MEMBER(cabaret_state::cabaret_interrupt) void cabaret_state::cabaret(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware Z80180(config, m_maincpu, XTAL(12'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &cabaret_state::cabaret_map); - m_maincpu->set_addrmap(AS_IO, &cabaret_state::cabaret_portmap); - m_maincpu->set_vblank_int("screen", FUNC(cabaret_state::cabaret_interrupt)); + m_maincpu->set_addrmap(AS_PROGRAM, &cabaret_state::program_map); + m_maincpu->set_addrmap(AS_IO, &cabaret_state::port_map); + m_maincpu->set_vblank_int("screen", FUNC(cabaret_state::interrupt_cb)); i8255_device &ppi1(I8255(config, "ppi1")); ppi1.in_pa_callback().set_ioport("BUTTONS2"); @@ -392,19 +406,19 @@ void cabaret_state::cabaret(machine_config &config) ppi3.in_pb_callback().set_ioport("DSW1"); ppi3.in_pc_callback().set_ioport("DSW2"); - /* 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(512, 256); screen.set_visarea_full(); - screen.set_screen_update(FUNC(cabaret_state::screen_update_cabaret)); + screen.set_screen_update(FUNC(cabaret_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_cabaret); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x800); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); YM2413(config, "ymsnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -414,13 +428,13 @@ void cabaret_state::init_cabaret() { uint8_t *rom = memregion("maincpu")->base(); - /* decrypt the program ROM */ + // decrypt the program ROM for (int i = 0; i < 0xf000; i++) { if ((i & 0x2206) == 0x2002) rom[i] ^= 0x01; } - /* Patch pitfalls */ + // Patch pitfalls rom[0x1012] = rom[0x1013] = 0; rom[0x13b8] = 0x18; @@ -432,25 +446,139 @@ void cabaret_state::init_cabaret() rom[0xc6c4] = 0x18; } +void cabaret_state::init_double8l() +{ + uint8_t *rom = memregion("maincpu")->base(); + + // TODO: verify if/when the internal ROM gets dumped + for (int i = 0x4000; i < 0x10000; i++) + if ((i & 0x3206) == 0x2002) + rom[i] = rom[i] ^ 0x01; +} + +void cabaret_state::init_kungfua() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0x4000; i < 0x10000; i++) + { + rom[i] = rom[i] ^ 0x01; + } +} + + ROM_START( cabaret ) - ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for code */ - ROM_LOAD( "cg-8v204.u97", 0x0000, 0x10000, CRC(44cebf77) SHA1(e3f4e4abf41388f0eed50cf9a0fd0b14aa2f8b93) ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "cg-8v204.u97", 0x00000, 0x10000, CRC(44cebf77) SHA1(e3f4e4abf41388f0eed50cf9a0fd0b14aa2f8b93) ) - ROM_REGION( 0x60000, "gfx1", 0 ) + ROM_REGION( 0x60000, "fgtiles", 0 ) ROM_LOAD( "cg-4.u43", 0x40000, 0x20000, CRC(e509f50a) SHA1(7e68ca54642c92cdb348d5cf9466065938d0e027) ) ROM_LOAD( "cg-5.u44", 0x20000, 0x20000, CRC(e2cbf489) SHA1(3a15ed7efd5696656e6d55b54ec0ff779bdb0d98) ) ROM_LOAD( "cg-6.u45", 0x00000, 0x20000, CRC(4f2fced7) SHA1(b954856ffdc97fbc99fd3ec087376fbf466d2d5a) ) - ROM_REGION( 0xc000, "gfx2", 0 ) + ROM_REGION( 0xc000, "bgtiles", 0 ) ROM_LOAD( "cg-1.u40", 0x8000, 0x4000, CRC(7dee8b1f) SHA1(80dbdf6aab9b02cc000956b7894023552428e6a1) ) ROM_LOAD( "cg-2.u41", 0x0000, 0x4000, CRC(ce8dea39) SHA1(b30d1678a7b98cd821d2ce7383a83cb7c9f31b5f) ) ROM_LOAD( "cg-3.u42", 0x4000, 0x4000, CRC(7e1f821f) SHA1(b709d49f9d1890fe3b8ca7f90affc0017a0ad95e) ) - ROM_REGION( 0x8000, "gfx3", 0 ) - ROM_LOAD( "cg-7.u98", 0x0000, 0x8000, CRC(b93ae6f8) SHA1(accb87045c278d5d79fff65bb763aa6e8025a945) ) /* background maps, read by the CPU */ + ROM_REGION( 0x8000, "bgmaps", 0 ) + ROM_LOAD( "cg-7.u98", 0x0000, 0x8000, CRC(b93ae6f8) SHA1(accb87045c278d5d79fff65bb763aa6e8025a945) ) // background maps, read by the CPU +ROM_END + +// custom CPU package DB8LN CPUV1.0 1991 (almost surely Z180 based). +ROM_START( double8l ) + ROM_REGION( 0x10000, "maincpu", 0 ) + // contains leftover x86 code at 0-3fff + ROM_LOAD( "db8ln_cpuv1.0_1991.u80", 0x00000, 0x04000, NO_DUMP ) + ROM_LOAD( "u97", 0x00000, 0x10000, CRC(84686a43) SHA1(9e41c725a4fe9c674979c8437715e5c3197e4aa2) ) // 27C512, didn't have an original sticker + + ROM_REGION( 0x60000, "fgtiles", 0 ) // all Intel 27C010A + ROM_LOAD( "d8ln_cgf4.u43", 0x40000, 0x20000, CRC(d16b724d) SHA1(37ad925b07ef64d28670a8937ef6edfb00708d59) ) + ROM_LOAD( "d8ln_cgf5.u44", 0x20000, 0x20000, CRC(7c4aa36f) SHA1(0d1fe127a300b3341b0f15c6bdaeffde1564b204) ) + ROM_LOAD( "d8ln_cgf6.u45", 0x00000, 0x20000, CRC(759a8b81) SHA1(9b885d0eab72c7257005f1da21269ce490888640) ) + + ROM_REGION( 0xc000, "bgtiles", 0 ) + ROM_LOAD( "d8ln_cgf1.u40", 0x8000, 0x4000, CRC(969bb2e9) SHA1(5aecce965f558a11ec117ab5ccb82b841de6051f) ) // Microchip 27C128 + ROM_LOAD( "d8ln_cgf2.u41", 0x0000, 0x4000, CRC(bf6ef240) SHA1(a79e16ba259f03c0479e87a647a3a6a2ce0a1aac) ) // Microchip 27C128 + ROM_LOAD( "d8ln_cgf3.u42", 0x4000, 0x4000, CRC(f432f709) SHA1(a203c01358b42f6b8639ce45afa70a86afdc79cf) ) // Intel 27128A + + ROM_REGION( 0x8000, "bgmaps", 0 ) + ROM_LOAD( "d8ln_cgf7.u98", 0x0000, 0x8000, CRC(5268ae60) SHA1(9e5d819fc5a5623cc3e81384ba542391c59ab7f1) ) // 27C256, background maps, read by the CPU + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "dm74s287.u38", 0x000, 0x100, CRC(935d8c14) SHA1(04e90b01ef1e3485d3bfcf9473a18b7afea25d1d) ) + + ROM_REGION( 0x600, "plds", ROMREGION_ERASE00 ) + ROM_LOAD( "ami18cv8.u46", 0x000, 0x155, NO_DUMP ) + ROM_LOAD( "pal16l8an.u47", 0x200, 0x104, NO_DUMP ) + ROM_LOAD( "ami18cv8.u48", 0x400, 0x155, NO_DUMP ) +ROM_END + +/* + +Cherry master looking board + +Big chip with no markings at U80 stickered KUNG FU + V1.0 + 1992 + +Board silkscreend on top PCB NO.0013-B + +.45 27010 stickered 6 +.44 27010 stickered 5 +.43 27010 stickered 4 +.42 27128 stickered 3 +.41 27128 stickered 2 +.40 27128 stickered 1 +.98 27256 stickered 7 couldn't read chip, but board was silkscreened 27c256 +.97 27512 stickered ? looked like Japanese writing +.38 74s287 +.46 18cv8 <--- same checksum as .48 +.47 pal16l8a <--- checksum was 0 +.48 18cv8 <--- same checksum as .46 + +unknown 24 pin chip @ u29 +open 24 pin socket @ u54 +12 MHz crystal + +5 x DSW8 +3 x NEC D8255AC + +*/ + +ROM_START( kungfua ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) + // u97 contains leftover x86 code at 0-3fff (compiled with Borland Turbo-C). + // You can rename the rom to kungfu.exe and run it (DOS MZ executable)! + // The rest is Z80 code, so the CPU at u80 is probably a variant with internal ROM. + ROM_LOAD( "kungfu-internal.u80", 0x00000, 0x04000, NO_DUMP ) + ROM_LOAD( "kungfu.u97", 0x00000, 0x10000, CRC(5c8e16de) SHA1(4af3795753d6e08f528b861d3a771c782e173556) ) + + ROM_REGION( 0x60000, "fgtiles", 0 ) + ROM_LOAD( "kungfu-4.u43", 0x40000, 0x20000, CRC(df4afedb) SHA1(56ab18c46a199653c284417a8e9edc9f32374318) ) + ROM_LOAD( "kungfu-5.u44", 0x20000, 0x20000, CRC(25c9c98e) SHA1(2d3a399d8d53ee5cb8106d2b35d1ab1778439f81) ) + ROM_LOAD( "kungfu-6.u45", 0x00000, 0x20000, CRC(f1ec5f0d) SHA1(0aa888e13312ed5d98953c81f03a61c6175c7fec) ) + + ROM_REGION( 0xc000, "bgtiles", ROMREGION_ERASE00 ) + ROM_LOAD( "kungfu-1.u40", 0x8000, 0x4000, CRC(abaada6b) SHA1(a6b910db7451e8ca737f43f32dfc8fc5ecf865f4) ) + ROM_LOAD( "kungfu-2.u41", 0x0000, 0x4000, CRC(927b3060) SHA1(a780ea5aaee04287cc9533c2d258dc18f8426530) ) + ROM_LOAD( "kungfu-3.u42", 0x4000, 0x4000, CRC(bbf78e03) SHA1(06fee093e75e2611d00c076c2e0a681938fa8b74) ) + + ROM_REGION( 0x8000, "bgmaps", 0 ) + ROM_LOAD( "kungfu-7.u98", 0x0000, 0x8000, CRC(1d3f0c79) SHA1(0a33798b69fbdc0fb7c47c51f5759e42acd2c608) ) // background maps, read by the CPU + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "kungfu.u38", 0x000, 0x100, CRC(2074f729) SHA1(eb9a60dec57a029ae6d3fc53aa7bc78e8ac34392) ) + + ROM_REGION( 0x1000, "plds", 0 ) // TODO: convert with jedutil + ROM_LOAD( "kungfu.u46", 0x000, 0xde1, CRC(5d4aacaf) SHA1(733546ce0585c40833e1c34504c33219a2bea0a9) ) + ROM_LOAD( "kungfu.u47", 0x000, 0xaee, CRC(5c7e25b5) SHA1(7d37e4abfe1256bd9cb168e0f02e651118dfb304) ) + ROM_LOAD( "kungfu.u48", 0x000, 0xde1, CRC(5d4aacaf) SHA1(733546ce0585c40833e1c34504c33219a2bea0a9) ) ROM_END } // anonymous namespace -GAME( 1992, cabaret, 0, cabaret, cabaret, cabaret_state, init_cabaret, ROT0, "AMT Co. Ltd.", "Cabaret Show", MACHINE_NOT_WORKING ) +GAME( 1992, cabaret, 0, cabaret, cabaret, cabaret_state, init_cabaret, ROT0, "AMT Co. Ltd.", "Cabaret Show", MACHINE_NOT_WORKING ) +GAME( 1992, double8l, 0, cabaret, cabaret, cabaret_state, init_double8l, ROT0, "AMT Co. Ltd.", "Double 8 Line", MACHINE_NOT_WORKING ) // missing internal ROM dump +GAME( 1992, kungfua, kungfu, cabaret, cabaret, cabaret_state, init_kungfua, ROT0, "IGS", "Kung Fu Fighters (IGS, v100)", MACHINE_NOT_WORKING ) // missing internal ROM dump diff --git a/src/mame/igs/funtech.cpp b/src/mame/igs/funtech.cpp index 52f7b709bfc82..704dc57de4a84 100644 --- a/src/mame/igs/funtech.cpp +++ b/src/mame/igs/funtech.cpp @@ -670,7 +670,7 @@ void fun_tech_corp_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index b0bf90cdfe3b9..496e346815e1f 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -523,6 +523,7 @@ class wingco_state : public goldstar_state void init_lucky8a(); void init_lucky8f(); void init_lucky8l(); + void init_lucky8m(); void init_magoddsc(); void init_flaming7(); void init_flam7_tw(); @@ -582,6 +583,7 @@ class cb3_state : public goldstar_state void init_cb3c(); void init_cb3e(); void init_cb3f(); + void init_cb3g(); void init_cherrys(); void init_chrygld(); void init_chry10(); @@ -7541,7 +7543,7 @@ static INPUT_PORTS_START( unkch_controls ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* Trips "call attendant" state if activated while credited - something to do with hopper out? */ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) @@ -11223,7 +11225,7 @@ void unkch_state::unkch(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); /* payout hardware */ - TICKET_DISPENSER(config, m_ticket_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_ticket_dispenser, attotime::from_msec(200)); } void unkch_state::rolling(machine_config &config) @@ -12115,6 +12117,36 @@ ROM_START( cb3f ) // original Wing W4 PCB + subboard with Z80, ROM, RAM and encr ROM_LOAD( "dm74s288.d12", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) ROM_END + + // original Wing W4 PCB + Dyna D9005 subboard with Z80, ROM, RAM and Dyna DP 1200-5 custom. GFX ROMs are identical to many other sets. +ROM_START( cb3g ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "cb3-s4.ic5", 0x00000, 0x10000, CRC(ad0fa0b7) SHA1(29b43e764ca2712406b37d24d942c90992ea46e1) ) // encrypted, on subboard + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "cb3-5.7h", 0x00000, 0x08000, CRC(83650a94) SHA1(e79420ab559d3f74013708767ca3f238fd333fb7) ) + ROM_LOAD( "cb3-6.8h", 0x08000, 0x08000, CRC(2f46a3f5) SHA1(3e6022ee8f84039e48f41aea5e68ee28aabdc556) ) + ROM_LOAD( "cb3-7.10h", 0x10000, 0x08000, CRC(dcf97517) SHA1(0a29696e0464c8878c499b1786a17080fd088a72) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "cb3-1.1h", 0x00000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) ) + ROM_LOAD( "cb3-2.3h", 0x02000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) ) + ROM_LOAD( "cb3-3.4h", 0x04000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) ) + ROM_LOAD( "cb3-4.5h", 0x06000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) ) + + // all the PROMs weren't dumped for this set, marking bad as precaution + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD_NIB_LOW( "n82s129.13g", 0x0000, 0x0100, BAD_DUMP CRC(59ac98e4) SHA1(5fc0f1a48c49c956cdb8826e20663dc57a9175e4) ) // 1st bank colors, low 4 bits. + ROM_LOAD_NIB_HIGH( "n82s129.14g", 0x0000, 0x0100, BAD_DUMP CRC(0d8f35bd) SHA1(0c2a0145cdaaf9beabdce241731a36b0c65f18a2) ) // 1st bank colors, high 4 bits. + ROM_LOAD( "dm74s288.13d", 0x0080, 0x0020, BAD_DUMP CRC(77a85e21) SHA1(3b41e0ab7cc55c5d78914d23e8289383f5bd5654) ) // 2nd bank colors + + ROM_REGION( 0x100, "unkprom", 0 ) + ROM_LOAD( "82s129.f3", 0x0000, 0x0100, BAD_DUMP CRC(1d668d4a) SHA1(459117f78323ea264d3a29f1da2889bbabe9e4be) ) + + ROM_REGION( 0x20, "unkprom2", 0 ) + ROM_LOAD( "dm74s288.d12", 0x0000, 0x0020, BAD_DUMP CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) +ROM_END + /* Cherry Gold I (bootleg) It runs in CB3e similar hardware... @@ -14454,6 +14486,38 @@ ROM_START( lucky8l ) ROM_LOAD( "w4.d12", 0x0000, 0x0117, CRC(41b55fb0) SHA1(f31a31dc2c0789d08957785e8c8f804690133450) ) // GAL16V8D ROM_END +// original Wing PCB with a small riser board for CPU, logic and 2 8-DIP banks. GFX ROMs are identical to many other sets. +ROM_START( lucky8m ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "28r.b12", 0x0000, 0x4000, CRC(9d7bc7f8) SHA1(93c0297dbe1579b6326d43d743d2b95264e7e0aa) ) + ROM_LOAD( "29r.b14", 0x4000, 0x4000, CRC(7b2b0c0c) SHA1(1acb20be5fbfdf6813f8a5257f9bd771b37504ea) ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "eagle-5.h7", 0x00000, 0x8000, CRC(59026af3) SHA1(3d7f7e78968ca26275635aeaa0e994468a3da575) ) + ROM_LOAD( "eagle-6.h8", 0x08000, 0x8000, CRC(67a073c1) SHA1(36194d57d0dc0601fa1fdf2e6806f11b2ea6da36) ) + ROM_LOAD( "eagle-7.h10", 0x10000, 0x8000, CRC(c415b9d0) SHA1(fd558fe8a116c33bbd712a639224d041447a45c1) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "eagle-1.h1", 0x0000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) ) + ROM_LOAD( "eagle-2.h3", 0x2000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) ) + ROM_LOAD( "eagle-3.h4", 0x4000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) ) + ROM_LOAD( "eagle-4.h5", 0x6000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) ) + + // all the PROMs weren't dumped for this set, marking bad as precaution + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "d12", 0x0000, 0x0100, BAD_DUMP CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) ) + ROM_LOAD( "prom4", 0x0100, 0x0100, BAD_DUMP CRC(526cf9d3) SHA1(eb779d70f2507d0f26d225ac8f5de8f2243599ca) ) + + ROM_REGION( 0x20, "proms2", 0 ) + ROM_LOAD( "d13", 0x0000, 0x0020, BAD_DUMP CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) ) + + ROM_REGION( 0x100, "unkprom", 0 ) + ROM_LOAD( "g14", 0x0000, 0x0100, BAD_DUMP CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) ) + + ROM_REGION( 0x20, "unkprom2", 0 ) + ROM_LOAD( "g13", 0x0000, 0x0020, BAD_DUMP CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) +ROM_END + ROM_START( animalw ) // according to the dumper: runs on the same HW as lucky8 but at the two 8255 has some shorts ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "rom8.bin", 0x0000, 0x8000, CRC(8826e4e7) SHA1(70cff8c5ce75ab0f568e8cdf39ef9165b73fa2c0) ) @@ -21256,6 +21320,44 @@ void wingco_state::init_lucky8l() m_palette->update(); } +void wingco_state::init_lucky8m() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x8000; i++) + { + m_decrypted_opcodes[i] = rom[i]; + + // only the opcodes in the first 0x400 bytes and over 0x6200 are encrypted + if (i < 0x400 || (i >= 0x6200 && i < 0x6400) || i >= 0x7c00) + { + uint8_t x = rom[i]; + + switch(i & 0x1e) + { + case 0x00: x = bitswap<8>(x ^ 0x72, 5, 3, 7, 2, 6, 4, 0, 1); break; + case 0x02: x = bitswap<8>(x ^ 0x14, 0, 2, 1, 6, 4, 3, 5, 7); break; + case 0x04: x = bitswap<8>(x ^ 0x7e, 5, 6, 7, 4, 3, 2, 0, 1); break; + case 0x06: x = bitswap<8>(x ^ 0x5c, 0, 6, 1, 4, 3, 2, 5, 7); break; + case 0x08: x = bitswap<8>(x ^ 0xd9, 7, 4, 1, 6, 3, 2, 5, 0); break; + case 0x0a: x = bitswap<8>(x ^ 0x02, 1, 6, 7, 4, 3, 2, 0, 5); break; + case 0x0c: x = bitswap<8>(x ^ 0xd9, 7, 4, 1, 6, 3, 2, 5, 0); break; + case 0x0e: x = bitswap<8>(x ^ 0x02, 1, 6, 7, 4, 3, 2, 0, 5); break; + case 0x10: x = bitswap<8>(x ^ 0x50, 7, 3, 5, 2, 6, 4, 1, 0); break; + case 0x12: x = bitswap<8>(x ^ 0x14, 7, 2, 5, 6, 4, 3, 1, 0); break; + case 0x14: x = bitswap<8>(x ^ 0x5c, 7, 6, 5, 4, 3, 2, 1, 0); break; + case 0x16: x = bitswap<8>(x ^ 0x5c, 7, 6, 5, 4, 3, 2, 1, 0); break; + case 0x18: x = bitswap<8>(x ^ 0xd9, 7, 4, 1, 6, 3, 2, 5, 0); break; + case 0x1a: x = bitswap<8>(x ^ 0x02, 1, 6, 7, 4, 3, 2, 0, 5); break; + case 0x1c: x = bitswap<8>(x ^ 0xd9, 7, 4, 1, 6, 3, 2, 5, 0); break; + case 0x1e: x = bitswap<8>(x ^ 0x02, 1, 6, 7, 4, 3, 2, 0, 5); break; + } + + m_decrypted_opcodes[i] = x; + } + } +} + void wingco_state::init_nd8lines() { uint8_t *rom = memregion("maincpu")->base(); @@ -21723,6 +21825,18 @@ void cb3_state::init_cb3f() rom[i] = cb3f_decrypt(rom[i], i); } +void cb3_state::init_cb3g() +{ + uint8_t *rom = memregion("maincpu")->base(); + + std::vector buffer(0x10000); + + memcpy(&buffer[0], rom, 0x10000); + + for (int i = 0; i < 0x10000; i++) + rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 13, 12, 14, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; +} + /* todo: remove these patches! */ void unkch_state::init_unkch1() { @@ -22079,6 +22193,7 @@ GAME( 199?, cb3c, ncb3, cb3c, chrygld, cb3_state, init_cb3c GAMEL( 199?, cb3d, ncb3, ncb3, ncb3, cb3_state, empty_init, ROT0, "bootleg", "Cherry Bonus III (set 3)", 0, layout_cherryb3 ) GAMEL( 199?, cb3e, ncb3, cb3e, chrygld, cb3_state, init_cb3e, ROT0, "bootleg", "Cherry Bonus III (set 4, encrypted bootleg)", 0, layout_chrygld ) GAMEL( 199?, cb3f, ncb3, ncb3, ncb3, cb3_state, init_cb3f, ROT0, "bootleg (Cleco)", "Cherry Bonus III (set 5, encrypted bootleg)", MACHINE_NOT_WORKING, layout_chrygld ) // partially decrypted, stops at 'call attendant' +GAMEL( 199?, cb3g, ncb3, ncb3, ncb3, cb3_state, init_cb3g, ROT0, "Dyna", "Cherry Bonus III (ver.1.40, set 6)", 0, layout_cherryb3 ) GAMEL( 199?, chryglda, ncb3, cb3e, chrygld, cb3_state, init_cb3e, ROT0, "bootleg", "Cherry Gold I (set 2, encrypted bootleg)", 0, layout_chrygld ) // Runs in CB3e hardware. GAME( 1994, chryangla, ncb3, chryangla,ncb3, cb3_state, init_chryangl, ROT0, "bootleg (G.C.I.)", "Cherry Angel (encrypted, W-4 hardware)", MACHINE_NOT_WORKING ) // DYNA CB3 V1.40 string, decrypted but only test screens work @@ -22165,6 +22280,7 @@ GAMEL( 1989, lucky8i, lucky8, lucky8, lucky8, wingco_state, empty_ini GAMEL( 199?, lucky8j, lucky8, lucky8, lucky8, wingco_state, empty_init, ROT0, "", "New Lucky 8 Lines Crown Turbo (Hack)", MACHINE_NOT_WORKING, layout_lucky8 ) // 2 control sets... GAMEL( 1989, lucky8k, lucky8, lucky8k, lucky8, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "New Lucky 8 Lines (set 10, W-4, encrypted NEC D315-5136)", 0, layout_lucky8 ) // 2 control sets... GAMEL( 1989, lucky8l, lucky8, lucky8, lucky8, wingco_state, init_lucky8l, ROT0, "Wing Co., Ltd.", "New Lucky 8 Lines (set 11, W-4)", MACHINE_WRONG_COLORS, layout_lucky8 ) // uses a strange mix of PLDs and PROMs for colors +GAMEL( 1989, lucky8m, lucky8, lucky8f, lucky8, wingco_state, init_lucky8m, ROT0, "Wing Co., Ltd.", "New Lucky 8 Lines (set 12, W-4, encrypted)", 0, layout_lucky8 ) GAMEL( 198?, ns8lines, 0, lucky8, lucky8b, wingco_state, empty_init, ROT0, "", "New Lucky 8 Lines / New Super 8 Lines (W-4)", 0, layout_lucky8p1 ) // only 1 control set... GAMEL( 1985, ns8linesa, ns8lines, lucky8, lucky8b, wingco_state, empty_init, ROT0, "Yamate (bootleg)", "New Lucky 8 Lines / New Super 8 Lines (W-4, Lucky97 HW)", 0, layout_lucky8p1 ) // only 1 control set... GAMEL( 198?, ns8linew, ns8lines, lucky8, ns8linew, wingco_state, empty_init, ROT0, "", "New Lucky 8 Lines / New Super 8 Lines (F-5, Witch Bonus)", 0, layout_lucky8 ) // 2 control sets... diff --git a/src/mame/igs/igs011.cpp b/src/mame/igs/igs011.cpp index a80e0a33da91a..2c92fbad94762 100644 --- a/src/mame/igs/igs011.cpp +++ b/src/mame/igs/igs011.cpp @@ -35,6 +35,7 @@ Year + Game PCB Sound Chips 96 Virtua Bowling V101XCM NO-0101-1 ICS2115 IGS011 IGS003e IGS012 96 Virtua Bowling V101HJS NO-0101-? ICS2115 IGS011 IGS003e?IGS012 96 Long Hu Bang II V185H NO-0115 M6295 YM2413 IGS011 8255 +96 Te Yi Gong Neng NO-0127-2 M6295 YM2413 IGS011 IGS003A 96 Wanli Changcheng ? 96 Xingyun Man Guan ? 98 Mj Nenrikishu SP V250J NO-0115-5 M6295 YM2413 IGS011 8255 @@ -128,10 +129,12 @@ class igs011_state : public driver_device void init_vbowlj(); void init_vbowlhk(); void init_ryukobou(); + void init_tygn(); void igs011_base(machine_config &config); void drgnwrld(machine_config &config); void nkishusp(machine_config &config); + void tygn(machine_config &config); void wlcc(machine_config &config); void vbowl(machine_config &config); void vbowlhk(machine_config &config); @@ -285,6 +288,7 @@ class igs011_state : public driver_device void vbowlhk_decrypt(); void dbc_decrypt(); void ryukobou_decrypt(); + void tygn_decrypt(); void lhb2_gfx_decrypt(); void vbowl_gfx_decrypt(); void drgnwrld_gfx_decrypt(); @@ -295,6 +299,7 @@ class igs011_state : public driver_device void lhb_mem(address_map &map); void lhb2_mem(address_map &map); void nkishusp_mem(address_map &map); + void tygn_mem(address_map &map); void vbowl_mem(address_map &map); void vbowlhk_mem(address_map &map); void wlcc_mem(address_map &map); @@ -907,6 +912,39 @@ void igs011_state::nkishusp_decrypt() } +void igs011_state::tygn_decrypt() +{ + int rom_size = 0x80000; + u16 *src = (u16 *) (m_maincpu_region->base()); + std::vector result_data(rom_size / 2); + + for (int i = 0; i < rom_size / 2; i++) + { + u16 x = src[i]; + + int j = bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 0, 2, 9, 5, 12, 14, 11, 8, 6, 3, 4, 16, 15, 13, 10, 7, 1); + + if ((j & 0x0280 / 2) || ((j & 0x0024 / 2) == 0x24 / 2)) + x ^= 0x0004; + + if (j & 0x4000 / 2) + { + if ((((j & 0x100 / 2) == 0x000 / 2) ^ ((j & 0x128 / 2) == 0x028 / 2)) || ((j & 0x108 / 2) == 0x100 / 2)) + x ^= 0x0020; + } + else + x ^= 0x0020; + + if (!(j & 0x8000 / 2) && (j & 0x2000 / 2)) + x ^= 0x0008; + + result_data[j] = x; + } + + memcpy(src, &result_data[0], rom_size); +} + + void igs011_state::vbowl_decrypt() { u16 *src = (u16 *) (m_maincpu_region->base()); @@ -2451,6 +2489,38 @@ void igs011_state::init_lhb2() */ } +void igs011_state::init_tygn() +{ + tygn_decrypt(); + + lhb2_gfx_decrypt(); + + // PROTECTION CHECKS (similar to nkishusp) + + u16 *rom = (u16 *) m_maincpu_region->base(); + + rom[0x036d8/2] = 0x6042; // 0036d8: 660E bne $36e8 (ROM test) + + //TODO: are the following patches needed? in that case the ones after the blank line should be adapted to the tygn offsets + //rom[0x1c6a0/2] = 0x6034; // 01c6a0: 6734 beq $1c6d6 + //rom[0x2412a/2] = 0x6036; // 02412a: 6736 beq $24162 + //rom[0x26de6/2] = 0x6038; // 026de6: 6e38 bgt $26e20 (system error) + //rom[0x2da36/2] = 0x6036; // 02da36: 6736 beq $2da6e + + //rom[0x2ff20/2] = 0x6036; // 02ff20: 6736 beq $2ff58 + //rom[0x3151c/2] = 0x6036; // 03151c: 6736 beq $31554 + //rom[0x33dfc/2] = 0x6036; // 033dfc: 6736 beq $33e34 + //rom[0x3460e/2] = 0x6038; // 03460e: 6e38 bgt $34648 (system error) + //rom[0x3f09e/2] = 0x6034; // 03f09e: 6734 beq $3f0d4 + //rom[0x406a8/2] = 0x6036; // 0406a8: 6736 beq $406e0 + //rom[0x4376a/2] = 0x6034; // 04376a: 6734 beq $437a0 + //rom[0x462d6/2] = 0x6034; // 0462d6: 6734 beq $4630c + //rom[0x471ec/2] = 0x6036; // 0471ec: 6e36 bgt $47224 (system error) + //rom[0x49c46/2] = 0x6000; // 049c46: 6700 0444 beq $4a08c + //rom[0x4a2b6/2] = 0x6036; // 04a2b6: 6736 beq $4a2ee + //rom[0x4c67a/2] = 0x6038; // 04c67a: 6e38 bgt $4c6b4 (system error) +} + void igs011_state::init_vbowl() { u16 *rom = (u16 *) m_maincpu_region->base(); @@ -2820,6 +2890,14 @@ void igs011_state::nkishusp_mem(address_map &map) map(0xa88000, 0xa88001).r(FUNC(igs011_state::igs_dips_r<3>)); } +void igs011_state::tygn_mem(address_map &map) +{ + nkishusp_mem(map); + + map(0x208000, 0x208001).nopr(); // TODO + map(0x208002, 0x208003).rw(FUNC(igs011_state::drgnwrld_igs003_r), FUNC(igs011_state::lhb2_igs003_w)); +} + u16 igs011_state::vbowl_unk_r() { @@ -3469,6 +3547,86 @@ static INPUT_PORTS_START( nkishusp ) INPUT_PORTS_END +// basically same game as lhb2 and nkishusp but with joystick controls +static INPUT_PORTS_START( tygn ) + PORT_START("DSW1") + PORT_DIPNAME( 0x07, 0x07, "Pay Out (%)" ) PORT_DIPLOCATION("DSW1:1,2,3") + PORT_DIPSETTING( 0x07, "50" ) + PORT_DIPSETTING( 0x06, "54" ) + PORT_DIPSETTING( 0x05, "58" ) + PORT_DIPSETTING( 0x04, "62" ) + PORT_DIPSETTING( 0x03, "66" ) + PORT_DIPSETTING( 0x02, "70" ) + PORT_DIPSETTING( 0x01, "74" ) + PORT_DIPSETTING( 0x00, "78" ) + PORT_DIPNAME( 0x08, 0x08, "Minimum Bet" ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x08, "1" ) + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:5,6") + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPUNKNOWN( 0x80, 0x80 ) PORT_DIPLOCATION("DSW1:8") + + PORT_START("DSW2") // not shown in test mode + PORT_DIPUNKNOWN( 0x01, 0x01 ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPUNKNOWN( 0x02, 0x02 ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPUNKNOWN( 0x04, 0x04 ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPUNKNOWN( 0x08, 0x08 ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPUNKNOWN( 0x10, 0x10 ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPUNKNOWN( 0x20, 0x20 ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPUNKNOWN( 0x40, 0x40 ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPUNKNOWN( 0x80, 0x80 ) PORT_DIPLOCATION("DSW2:8") + + PORT_START("DSW3") // only 2 out of 4 DIP banks phisically present + PORT_DIPNAME( 0xff, 0xff, DEF_STR( Unused ) ) + + PORT_START("COIN") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // stats + 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_GAMBLE_PAYOUT ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) // ok + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // ok + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // ok + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // ok + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // ok + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // selects input test in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) // selects image test in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) // selects audio test in test mode + + PORT_START("IN1") // probably unused + 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") // probably unused + 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 + + static INPUT_PORTS_START( wlcc ) PORT_START("DSW1") PORT_DIPUNKNOWN( 0x01, 0x01 ) @@ -4176,6 +4334,13 @@ void igs011_state::nkishusp(machine_config &config) } +void igs011_state::tygn(machine_config &config) +{ + nkishusp(config); + m_maincpu->set_addrmap(AS_PROGRAM, &igs011_state::tygn_mem); +} + + void igs011_state::sound_irq(int state) { // m_maincpu->set_input_line(3, state); @@ -4805,6 +4970,63 @@ ROM_START( nkishusp ) ROM_LOAD( "sp.u38", 0x00000, 0x80000, CRC(d80e28e2) SHA1(c03441686e770227db6a2a41922fbb4284710571) ) ROM_END +/********************************************************************************* + +Te Yi Gong Neng, IGS 1996 + +This is the joystick version of LHB2 + +PCB Layout +---------- + +IGS PCB NO- 0127-2 +|-----------------------------------------| +|UPC1242 U3587 K668 S0503.U42| +| 3.579545MHz | +| SW1 | +| M0502.U3 SW2 | +| SW3 | +| SW4 | +| 6164 | +|J | +|A M0501.U7 PAL 6164 | +|M PAL | +|M PAL | +|A PAL IGS011 | +| PAL | +| | +| 68000 22MHz KM428C256 | +| 27C4096.U13 | +| T518B IGS003A 6164 KM428C256 | +| SW5 BATTERY 6164 | +|-----------------------------------------| +Notes: + 68000 - Clock 7.33333MHz [22/3] + K668 - Oki M6295 clone. Clock 1.047619048MHz [22/21] + U3587 - This is a YM2412 clone. Clock input 3.579545MHz + SW1/2/3/4 - 8-Position DIP Switch. SW3 and SW4 not populated + SW5 - Reset / NVRAM Clear + 6164 - 8kBx8-bit SRAM + KM428C256 - Dual-Port Video RAM with 256kBx8-bit DRAM and 512x8 SAM (Serial Access Memory). + This is the same type of RAM used on Midway T-Unit hardware but 2X larger. + +*********************************************************************************/ + +ROM_START( tygn ) // GFX ROMs same as lhb2 and nkishusp, sound ROM same as lhb2 + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "27c4096.u13", 0x00000, 0x80000, CRC(25b1de1e) SHA1(7c3d0458b30db614e551fdf0db3f93fa44fcb758) ) + + ROM_REGION( 0x800000, "blitter", ROMREGION_ERASEFF ) + ROM_LOAD( "m0501.u7", 0x000000, 0x200000, CRC(1c952bd6) SHA1(a6b6f1cdfb29647e81c032ffe59c94f1a10ceaf8) ) + + ROM_REGION( 0x200000, "blitter_hi", ROMREGION_ERASEFF ) // high order bit of graphics (5th bit) + ROM_LOAD( "m0502.u3", 0x00000, 0x80000, CRC(5d73ae99) SHA1(7283aa3d6b15ceb95db80756892be46eb997ef15) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "s0502.u42", 0x00000, 0x80000, CRC(c9609c9c) SHA1(f036e682b792033409966e84292a69275eaa05e5) ) +ROM_END + + /*************************************************************************** Virtua Bowling by IGS @@ -4912,7 +5134,7 @@ ROM_START( xymg ) ROM_CONTINUE( 0x00000, 0x80000 ) // 1ST+2ND IDENTICAL ROM_END -} // Anonymous namespace +} // anonymous namespace /*************************************************************************** @@ -4935,6 +5157,7 @@ GAME( 1995, lhbv33c, lhb, lhb, lhb, igs011_state, i GAME( 1995, dbc, lhb, lhb, lhb, igs011_state, init_dbc, ROT0, "IGS", "Daai Baan Sing (Hong Kong, V027H)", MACHINE_SUPPORTS_SAVE ) GAME( 1995, ryukobou, lhb, lhb, lhb, igs011_state, init_ryukobou, ROT0, "IGS / Alta", "Mahjong Ryukobou (Japan, V030J)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, lhb2, 0, lhb2, lhb2, igs011_state, init_lhb2, ROT0, "IGS", "Lung Fu Bong II (Hong Kong, V185H)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, tygn, lhb2, tygn, tygn, igs011_state, init_tygn, ROT0, "IGS", "Te Yi Gong Neng (China, V632C)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // needs correct IGS003 routines GAME( 1996, xymg, 0, xymg, xymg, igs011_state, init_xymg, ROT0, "IGS", "Xingyun Man Guan (China, V651C)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, wlcc, xymg, wlcc, wlcc, igs011_state, init_wlcc, ROT0, "IGS", "Wanli Changcheng (China, V638C)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, vbowl, 0, vbowl, vbowl, igs011_state, init_vbowl, ROT0, "IGS", "Virtua Bowling (World, V101XCM)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index e27ac1e597311..b84ee29890f79 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -52,15 +52,17 @@ To Do: #include "emu.h" +#include "igs017_igs031.h" +#include "igs022.h" +#include "mahjong.h" + #include "cpu/m68000/m68000.h" #include "cpu/z180/z180.h" #include "machine/i8255.h" -#include "igs022.h" #include "machine/ticket.h" #include "machine/timer.h" #include "sound/okim6295.h" #include "sound/ymopl.h" -#include "igs017_igs031.h" #include "emupal.h" #include "screen.h" @@ -3065,6 +3067,8 @@ static INPUT_PORTS_START( genius6 ) INPUT_PORTS_END static INPUT_PORTS_START( lhzb2 ) + PORT_INCLUDE(igs_mahjong_matrix) + PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) @@ -3114,7 +3118,7 @@ static INPUT_PORTS_START( lhzb2 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3122,56 +3126,6 @@ static INPUT_PORTS_START( lhzb2 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - 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("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - 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("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( lhzb2a ) @@ -3179,7 +3133,7 @@ static INPUT_PORTS_START( lhzb2a ) PORT_MODIFY("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) @@ -3238,7 +3192,7 @@ static INPUT_PORTS_START( mgcs ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - // Joystick mode: the top 2 bits of COINS (i8255 port A) and JOY (i8255 port B) are read and combined with the bottom 4 bits read from port C (see code at $1c83a) + // Joystick mode: the top 2 bits of COINS (port A) and JOY (port B) are read and combined with the bottom 4 bits read from port C (see code at $1c83a) PORT_START("JOY") // Joystick mode: @@ -3246,12 +3200,12 @@ static INPUT_PORTS_START( mgcs ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // take tile or throw (as N in mahjong keyboard) - // i8255 port C input is 4 bits + // Port C input is 4 bits PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) @@ -3365,7 +3319,7 @@ static INPUT_PORTS_START( sdmg2 ) PORT_DIPSETTING( 0x00, "Tile" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -3582,7 +3536,7 @@ static INPUT_PORTS_START( sdmg2p ) 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_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch, TODO: verify + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch, TODO: verify INPUT_PORTS_END static INPUT_PORTS_START( mgdh ) @@ -3636,7 +3590,7 @@ static INPUT_PORTS_START( mgdh ) PORT_DIPSETTING( 0x00, "10" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3766,7 +3720,7 @@ static INPUT_PORTS_START( slqz2 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3886,7 +3840,7 @@ static INPUT_PORTS_START( tjsb ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -3980,7 +3934,7 @@ static INPUT_PORTS_START( spkrform ) PORT_START("BUTTONS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin 1 (impulse prevents coin error in gambling mode) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin 2 "" - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // payout PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Return To Gambling (From Formosa). Then Bet, Hold 1..5") // To switch back to poker from Formosa, start the sequence pressing this key (memory $f4a3 holds the sequence number) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // book @@ -4060,7 +4014,7 @@ static INPUT_PORTS_START( tarzan ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // Service PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Book PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // Coin/Key in (coin error in coin mode) @@ -4185,7 +4139,7 @@ static INPUT_PORTS_START( starzan ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test @@ -4283,7 +4237,7 @@ static INPUT_PORTS_START( happyskl ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test @@ -4390,7 +4344,6 @@ void igs017_state::base_machine_oki(machine_config &config, const XTAL &xtal_oki m_screen->set_palette("igs017_igs031:palette"); IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); // sound SPEAKER(config, "mono").front_center(); @@ -4423,9 +4376,9 @@ void igs017_state::iqblocka(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::iqblocka_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); // protection IGS_BITSWAP(config, m_igs_bitswap, 0); @@ -4480,10 +4433,10 @@ void igs017_state::tarzan(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::tarzan_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set(FUNC(igs017_state::tarzan_keys_joy_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set(FUNC(igs017_state::tarzan_keys_joy_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4513,11 +4466,11 @@ void igs017_state::starzan(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::starzan_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4547,11 +4500,11 @@ void igs017_state::happyskl(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::happyskl_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // video m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); @@ -4572,11 +4525,11 @@ void igs017_state::cpoker2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::cpoker2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_INCDEC(config, m_igs_incdec, 0); @@ -4602,11 +4555,11 @@ void igs017_state::tjsb(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::tjsb_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4633,11 +4586,11 @@ void igs017_state::spkrform(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::spkrform_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4673,11 +4626,11 @@ void igs017_state::mgcs(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::mgcs_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set(FUNC(igs017_state::mgcs_keys_joy_r)); - m_ppi->in_pc_callback().set_ioport("JOY"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set(FUNC(igs017_state::mgcs_keys_joy_r)); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4707,11 +4660,11 @@ void igs017_state::lhzb2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::lhzb2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("DSW1"); - m_ppi->in_pc_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW2"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4746,7 +4699,7 @@ void igs017_state::lhzb2a(machine_config &config) // ppi8255 not used for i/o (just video enable)? - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4779,11 +4732,11 @@ void igs017_state::slqz2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::slqz2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("DSW1"); - m_ppi->in_pc_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW2"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4808,11 +4761,11 @@ void igs017_state::sdmg2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::sdmg2_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); // DSW3 is read but unused (it's not populated on the PCB) - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_INCDEC(config, m_igs_incdec, 0); @@ -4843,9 +4796,9 @@ void igs017_state::mgdha(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::mgdha_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); } void igs017_state::mgdh(machine_config &config) @@ -4869,11 +4822,11 @@ void igs017_state::sdmg2p(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::sdmg2p_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); // there are 3 DIP banks on PCB but only two are shown in test mode + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); // there are 3 DIP banks on PCB but only two are shown in test mode - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); IGS_STRING(config, m_igs_string, 0); } diff --git a/src/mame/igs/igs017_igs031.cpp b/src/mame/igs/igs017_igs031.cpp index 5869737b4aebc..a64308a616177 100644 --- a/src/mame/igs/igs017_igs031.cpp +++ b/src/mame/igs/igs017_igs031.cpp @@ -22,7 +22,7 @@ void igs017_igs031_device::map(address_map &map) map(0x1800, 0x1bff).ram().w(FUNC(igs017_igs031_device::palram_w)).share("palram"); map(0x1c00, 0x1fff).ram(); - map(0x2010, 0x2013).r(FUNC(igs017_igs031_device::i8255_r)); + map(0x2010, 0x2012).r(FUNC(igs017_igs031_device::input_port_r)); map(0x2012, 0x2012).w(FUNC(igs017_igs031_device::video_disable_w)); map(0x2014, 0x2014).w(FUNC(igs017_igs031_device::nmi_enable_w)); @@ -32,13 +32,9 @@ void igs017_igs031_device::map(address_map &map) map(0x6000, 0x7fff).ram().w(FUNC(igs017_igs031_device::bg_w)).share("bg_videoram"); } -u8 igs017_igs031_device::i8255_r(offs_t offset) +u8 igs017_igs031_device::input_port_r(offs_t offset) { - if (m_i8255) - return m_i8255->read(offset); - - logerror("igs017_igs031_device::i8255_r(%02x) with no 8255 device\n", offset); - return 0; + return m_input_port_cb[offset](); } @@ -68,11 +64,11 @@ igs017_igs031_device::igs017_igs031_device(const machine_config &mconfig, const , device_memory_interface(mconfig, *this) , m_palette_scramble_cb(*this, FUNC(igs017_igs031_device::palette_callback_straight)) , m_space_config("igs017_igs031", ENDIANNESS_BIG, 8,15, 0, address_map_constructor(FUNC(igs017_igs031_device::map), this)) + , m_input_port_cb(*this, 0xff) , m_spriteram(*this, "spriteram") , m_fg_videoram(*this, "fg_videoram") , m_bg_videoram(*this, "bg_videoram") , m_palram(*this, "palram") - , m_i8255(*this, finder_base::DUMMY_TAG) , m_palette(*this, "palette") , m_revbits(false) { @@ -509,15 +505,9 @@ void igs017_igs031_device::sdwx_gfx_decrypt() std::vector result_data(rom_size); for (int i = 0; i < rom_size; i++) - result_data[i] = src[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 8, 7, 6, 10, 9, 5, 4, 3, 2, 1, 0)]; + result_data[i] = src[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 7, 8, 6, 10, 9, 5, 4, 3, 2, 1, 0)]; - for (int i = 0; i < rom_size; i += 0x200) - { - memcpy(src + i + 0x000, &result_data[i + 0x000], 0x80); - memcpy(src + i + 0x080, &result_data[i + 0x100], 0x80); - memcpy(src + i + 0x100, &result_data[i + 0x080], 0x80); - memcpy(src + i + 0x180, &result_data[i + 0x180], 0x80); - } + memcpy(src, result_data.data(), rom_size); } diff --git a/src/mame/igs/igs017_igs031.h b/src/mame/igs/igs017_igs031.h index d0bd3c86815f7..2083e1829a728 100644 --- a/src/mame/igs/igs017_igs031.h +++ b/src/mame/igs/igs017_igs031.h @@ -5,7 +5,6 @@ #pragma once -#include "machine/i8255.h" #include "emupal.h" #include "tilemap.h" @@ -20,28 +19,33 @@ class igs017_igs031_device : igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - template void set_i8255_tag(T &&tag) { m_i8255.set_tag(std::forward(tag)); } + auto in_pa_callback() { return m_input_port_cb[0].bind(); } + auto in_pb_callback() { return m_input_port_cb[1].bind(); } + auto in_pc_callback() { return m_input_port_cb[2].bind(); } template void set_palette_scramble_cb(T &&... args) { m_palette_scramble_cb.set(std::forward(args)...); } - void set_text_reverse_bits() + void set_text_reverse_bits(bool revbits) { - m_revbits = true; + m_revbits = revbits; } - u16 palette_callback_straight(u16 bgr) const; - - void map(address_map &map); - u8 read(offs_t offset); void write(offs_t offset, u8 data); bool get_nmi_enable() { return m_nmi_enable; } bool get_irq_enable() { return m_irq_enable; } +private: + u16 palette_callback_straight(u16 bgr) const; + + void map(address_map &map); + void palram_w(offs_t offset, u8 data); - u8 i8255_r(offs_t offset); + u8 input_port_r(offs_t offset); void video_disable_w(u8 data); + void nmi_enable_w(u8 data); + void irq_enable_w(u8 data); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -53,9 +57,9 @@ class igs017_igs031_device : void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int offsx, int offsy, int dimx, int dimy, int flipx, int flipy, u32 color, u32 addr); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); int debug_viewer(bitmap_ind16 &bitmap, const rectangle &cliprect); + +public: u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void nmi_enable_w(u8 data); - void irq_enable_w(u8 data); virtual void video_start(); void lhzb2_decrypt_tiles(); @@ -71,7 +75,6 @@ class igs017_igs031_device : void starzan_decrypt_sprites(size_t max_size, size_t flip_size); void tjsb_decrypt_sprites(); - protected: virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; @@ -86,11 +89,12 @@ class igs017_igs031_device : address_space_config m_space_config; + devcb_read8::array<3> m_input_port_cb; + required_shared_ptr m_spriteram; required_shared_ptr m_fg_videoram; required_shared_ptr m_bg_videoram; required_shared_ptr m_palram; - optional_device m_i8255; required_device m_palette; // the gfx roms were often hooked up with the bits backwards, allow us to handle it here to save doing it in every driver. diff --git a/src/mame/igs/igs027a.cpp b/src/mame/igs/igs027a.cpp new file mode 100644 index 0000000000000..87115b6458871 --- /dev/null +++ b/src/mame/igs/igs027a.cpp @@ -0,0 +1,202 @@ +// license:BSD-3-Clause +// copyright-holders:XingXing, Vas Crabb + +#include "emu.h" +#include "igs027a.h" + +#include "cpu/arm7/arm7core.h" + + +namespace { + +constexpr u32 IN_PORT_MASK = 0x000f'ffff; // 20-bit input port +constexpr u8 OUT_PORT_MASK = 0x1f; // 5-bit output port + +} // anonymous namespace + + +DEFINE_DEVICE_TYPE(IGS027A, igs027a_cpu_device, "igs027a", "IGS 027A ARM CPU (little)") + + +igs027a_cpu_device::igs027a_cpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : + arm7_cpu_device( + mconfig, + IGS027A, + tag, + owner, + clock, + 4, + ARCHFLAG_T, + ENDIANNESS_LITTLE, + address_map_constructor(FUNC(igs027a_cpu_device::onboard_peripherals), this)), + m_in_port_cb(*this, IN_PORT_MASK), + m_out_port_cb(*this), + m_irq_timers{ nullptr, nullptr }, + m_irq_enable(0xff), + m_irq_pending(0xff) +{ +} + +igs027a_cpu_device::~igs027a_cpu_device() +{ +} + + +void igs027a_cpu_device::device_resolve_objects() +{ + m_ext_fiq = 0; + m_ext_irq = 0; +} + +void igs027a_cpu_device::device_start() +{ + arm7_cpu_device::device_start(); + + m_irq_timers[0] = timer_alloc(FUNC(igs027a_cpu_device::timer_irq<0>), this); + m_irq_timers[1] = timer_alloc(FUNC(igs027a_cpu_device::timer_irq<1>), this); + + save_item(NAME(m_ext_fiq)); + save_item(NAME(m_ext_irq)); + save_item(NAME(m_fiq_enable)); + save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_pending)); +} + +void igs027a_cpu_device::device_reset() +{ + arm7_cpu_device::device_reset(); + + if (!BIT(m_fiq_enable, 0)) + machine().scheduler().synchronize(timer_expired_delegate(FUNC(igs027a_cpu_device::check_fiq), this)); + m_fiq_enable = 0x01; // superkds and fearless never write to 0x4000'0014 but expect FIQ to be triggered + m_irq_enable = 0xff; + m_irq_pending = 0xff; + + set_irq(0); +} + + +void igs027a_cpu_device::execute_set_input(int irqline, int state) +{ + switch (irqline) + { + case ARM7_IRQ_LINE: + if (state && !m_ext_irq && !BIT(m_irq_enable, 3)) + { + m_irq_pending &= ~(u8(1) << 3); + set_irq(1); + } + m_ext_irq = state ? 1 : 0; + break; + + case ARM7_FIRQ_LINE: + if (state && !m_ext_fiq && BIT(m_fiq_enable, 0)) + { + set_fiq(1); + set_fiq(0); // hacky - depends on ARM7 core checking interrupts outside execute loop; how is this actually acknowledged? + } + m_ext_fiq = state ? 1 : 0; + break; + + default: + arm7_cpu_device::execute_set_input(irqline, state); + } +} + + +void igs027a_cpu_device::onboard_peripherals(address_map &map) +{ + map(0x0000'0000, 0x0000'3fff).rom().region(DEVICE_SELF, 0); + + map(0x1000'0000, 0x1000'03ff).ram(); // onboard RAM? + + map(0x4000'000c, 0x4000'000f).r(FUNC(igs027a_cpu_device::in_port_r)); + map(0x4000'0014, 0x4000'0017).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::fiq_enable_w)); // sets bit 0 before waiting on FIRQ, maybe it's an enable here? + map(0x4000'0018, 0x4000'001b).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::out_port_w)); + + map(0x7000'0100, 0x7000'0107).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::timer_rate_w)); + map(0x7000'0200, 0x7000'0203).umask32(0x0000'00ff).rw(FUNC(igs027a_cpu_device::irq_pending_r), FUNC(igs027a_cpu_device::irq_enable_w)); + + map(0xf000'0008, 0xf000'000b).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::bus_sizing_w)); +} + + +u32 igs027a_cpu_device::in_port_r() +{ + return + 0xff80'0000 | // unused bits? + ((m_in_port_cb(0, IN_PORT_MASK) & IN_PORT_MASK) << 3) | // 20-bit input port + 0x0000'0007; // TODO: FIRQ, IRQ and UART Rx pins +} + +void igs027a_cpu_device::out_port_w(u8 data) +{ + // 5-bit output port + m_out_port_cb(0, data & OUT_PORT_MASK, OUT_PORT_MASK); +} + +void igs027a_cpu_device::timer_rate_w(offs_t offset, u8 data) +{ + // TODO: determine how timer intervals are derived from clocks + if (data) + { + constexpr u32 TIMER_DIVISOR = 4263; + auto const period = attotime::from_ticks(TIMER_DIVISOR * (data + 1), clock()); + m_irq_timers[offset]->adjust(period, 0, period); + } + else + { + m_irq_timers[offset]->adjust(attotime::never, 0, attotime::never); + } +} + +u8 igs027a_cpu_device::irq_pending_r() +{ + u8 const result = m_irq_pending; + if (!machine().side_effects_disabled()) + { + m_irq_pending = 0xff; + set_irq(0); + } + return result; +} + +void igs027a_cpu_device::fiq_enable_w(u8 data) +{ + if (BIT(~m_fiq_enable & data, 0)) + machine().scheduler().synchronize(timer_expired_delegate(FUNC(igs027a_cpu_device::check_fiq), this)); + else if (BIT(m_fiq_enable & ~data, 0)) + set_fiq(0); + m_fiq_enable = data; +} + +void igs027a_cpu_device::irq_enable_w(u8 data) +{ + m_irq_enable = data; +} + + +void igs027a_cpu_device::bus_sizing_w(u8 data) +{ + logerror("Bus sizing configuration: 0x%02x\n", data); +} + + +template +TIMER_CALLBACK_MEMBER(igs027a_cpu_device::timer_irq) +{ + if (!BIT(m_irq_enable, N)) + { + m_irq_pending &= ~(u8(1) << N); + set_irq(1); + } +} + +TIMER_CALLBACK_MEMBER(igs027a_cpu_device::check_fiq) +{ + if (m_ext_fiq && BIT(m_fiq_enable, 0)) + { + set_fiq(1); + set_fiq(0); // hacky - depends on ARM7 core checking interrupts outside execute loop; how is this actually acknowledged? + } +} diff --git a/src/mame/igs/igs027a.h b/src/mame/igs/igs027a.h new file mode 100644 index 0000000000000..7699ca768e439 --- /dev/null +++ b/src/mame/igs/igs027a.h @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders:XingXing, Vas Crabb +#ifndef MAME_IGS_IGS027A_H +#define MAME_IGS_IGS027A_H + +#pragma once + +#include "cpu/arm7/arm7.h" + + +class igs027a_cpu_device : public arm7_cpu_device +{ +public: + igs027a_cpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + virtual ~igs027a_cpu_device(); + + static constexpr feature_type imperfect_features() { return feature::TIMING; } + + auto in_port() { return m_in_port_cb.bind(); } + auto out_port() { return m_out_port_cb.bind(); } + +protected: + virtual void device_resolve_objects() override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + virtual void execute_set_input(int irqline, int state) override; + +private: + void onboard_peripherals(address_map &map) ATTR_COLD; + + u32 in_port_r(); + void out_port_w(u8 data); + void timer_rate_w(offs_t offset, u8 data); + u8 irq_pending_r(); + void fiq_enable_w(u8 data); + void irq_enable_w(u8 data); + + void bus_sizing_w(u8 data); + + template TIMER_CALLBACK_MEMBER(timer_irq); + TIMER_CALLBACK_MEMBER(check_fiq); + + devcb_read32 m_in_port_cb; + devcb_write8 m_out_port_cb; + + emu_timer *m_irq_timers[2]; + + u8 m_ext_fiq; + u8 m_ext_irq; + u8 m_fiq_enable; + u8 m_irq_enable; + u8 m_irq_pending; +}; + + +DECLARE_DEVICE_TYPE(IGS027A, igs027a_cpu_device) + +#endif // MAME_IGS_IGS027A_H diff --git a/src/mame/igs/igs_fear.cpp b/src/mame/igs/igs_fear.cpp index ee8a7d2e4e72d..97cf3b2470392 100644 --- a/src/mame/igs/igs_fear.cpp +++ b/src/mame/igs/igs_fear.cpp @@ -7,24 +7,25 @@ #include "emu.h" +#include "igs027a.h" #include "pgmcrypt.h" +#include "xamcu.h" -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" -#include "cpu/xa/xa.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "machine/v3021.h" -#include "sound/ics2115.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include + #define LOG_DEBUG (1U << 1) -#define VERBOSE (0) +//#define VERBOSE (LOG_DEBUG) #include "logmacro.h" + namespace { class igs_fear_state : public driver_device @@ -32,150 +33,90 @@ class igs_fear_state : public driver_device public: igs_fear_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_external_rom(*this, "user1"), + m_gfxrom(*this, "gfx1"), + m_sram(*this, "sram"), + m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_xa(*this, "xa"), - m_sram(*this, "sram"), - m_ics(*this, "ics"), m_screen(*this, "screen"), - m_videoram(*this, "videoram"), m_palette(*this, "palette"), - m_gfxrom(*this, "gfx1"), m_ticket(*this, "ticket"), m_io_dsw(*this, "DSW%u", 1U), m_io_trackball(*this, "AN%u", 0) { } - void igs_fear(machine_config &config); + void igs_fear(machine_config &config) ATTR_COLD; + void igs_fear_xor(machine_config &config) ATTR_COLD; - void init_igs_fear(); - void init_igs_icescape(); - void init_igs_superkds(); + void init_igs_fear() ATTR_COLD; + void init_igs_icescape() ATTR_COLD; + void init_igs_superkds() ATTR_COLD; protected: - virtual void video_start() override; - - virtual void machine_start() override; - virtual void machine_reset() override; + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; private: - void main_map(address_map &map); + void main_map(address_map &map) ATTR_COLD; + void main_xor_map(address_map &map) ATTR_COLD; - void sound_irq(int state); void vblank_irq(int state); void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int xpos, int ypos, int height, int width, int palette, int flipx, int romoffset); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 igs027_gpio_r(offs_t offset, u32 mem_mask); - void igs027_gpio_w(offs_t offset, u32 data, u32 mem_mask); + u32 external_rom_r(offs_t offset); - TIMER_CALLBACK_MEMBER(igs027_timer0); - TIMER_CALLBACK_MEMBER(igs027_timer1); + void xor_table_w(offs_t offset, u8 data); - void igs027_periph_init(void); - void igs027_trigger_irq(int num); - u32 igs027_periph_r(offs_t offset, u32 mem_mask); - void igs027_periph_w(offs_t offset, u32 data, u32 mem_mask); + u32 igs027_gpio_r(); + void igs027_gpio_w(u8 data); u32 xa_r(offs_t offset, u32 mem_mask); - void xa_w(offs_t offset, u32 data, u32 mem_mask); void cpld_w(offs_t offset, u32 data, u32 mem_mask); - u8 mcu_p0_r(); - u8 mcu_p1_r(); - u8 mcu_p2_r(); - u8 mcu_p3_r(); - void mcu_p0_w(uint8_t data); - void mcu_p1_w(uint8_t data); - void mcu_p2_w(uint8_t data); - void mcu_p3_w(uint8_t data); + required_region_ptr m_external_rom; + required_region_ptr m_gfxrom; + required_shared_ptr m_sram; + required_shared_ptr m_videoram; - u16 xa_wait_r(offs_t offset); + required_device m_maincpu; + required_device m_xa; + required_device m_screen; + required_device m_palette; - u8 m_port2_latch; - u8 m_port0_latch; + required_device m_ticket; - u32 m_gpio_o; - u32 m_irq_enable; - u32 m_irq_pending; + required_ioport_array<2> m_io_dsw; + optional_ioport_array<2> m_io_trackball; - u32 m_xa_cmd; - u32 m_xa_ret0; - u32 m_xa_ret1; - u8 m_num_params; + u32 m_xor_table[0x100]; - u8 m_port0_dat; - u8 m_port1_dat; - u8 m_port2_dat; - u8 m_port3_dat; + u8 m_gpio_o; int m_trackball_cnt; int m_trackball_axis[2], m_trackball_axis_pre[2], m_trackball_axis_diff[2]; - - emu_timer *m_timer0; - emu_timer *m_timer1; - - // devices - required_device m_maincpu; - required_device m_xa; - required_shared_ptr m_sram; - required_device m_ics; - required_device m_screen; - required_shared_ptr m_videoram; - required_device m_palette; - required_region_ptr m_gfxrom; - - required_device m_ticket; - required_ioport_array<2> m_io_dsw; - optional_ioport_array<2> m_io_trackball; }; void igs_fear_state::video_start() { - igs027_periph_init(); } void igs_fear_state::machine_start() { - save_item(NAME(m_port2_latch)); - save_item(NAME(m_port0_latch)); + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); + + save_item(NAME(m_xor_table)); save_item(NAME(m_gpio_o)); - save_item(NAME(m_irq_enable)); - save_item(NAME(m_irq_pending)); - - save_item(NAME(m_xa_cmd)); - save_item(NAME(m_xa_ret0)); - save_item(NAME(m_xa_ret1)); - save_item(NAME(m_num_params)); - - save_item(NAME(m_port0_dat)); - save_item(NAME(m_port1_dat)); - save_item(NAME(m_port2_dat)); - save_item(NAME(m_port3_dat)); } void igs_fear_state::machine_reset() { - m_port2_latch = 0; - m_port0_latch = 0; - - m_gpio_o = 0; - m_irq_enable = 0; - m_irq_pending = 0; - - m_xa_cmd = 0; - m_xa_ret0 = 0; - m_xa_ret1 = 0; - m_num_params = 0; - - m_port0_dat = 0; - m_port1_dat = 0; - m_port2_dat = 0; - m_port3_dat = 0; - } void igs_fear_state::draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int xpos, int ypos, int height, int width, int palette, int flipx, int romoffset) @@ -238,24 +179,32 @@ u32 igs_fear_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c void igs_fear_state::main_map(address_map &map) { - map(0x00000000, 0x00003fff).rom(); /* Internal ROM */ - map(0x08000000, 0x0807ffff).rom().region("user1", 0);/* Game ROM */ + map(0x08000000, 0x0807ffff).rom().region("user1", 0); // Game ROM map(0x10000000, 0x100003ff).ram().share("iram"); - map(0x18000000, 0x1800ffff).ram().share("sram"); - map(0x40000000, 0x400003ff).rw(FUNC(igs_fear_state::igs027_gpio_r), FUNC(igs_fear_state::igs027_gpio_w)); - map(0x50000000, 0x500003ff).ram().share("xortab"); - map(0x70000000, 0x700003ff).rw(FUNC(igs_fear_state::igs027_periph_r), FUNC(igs_fear_state::igs027_periph_w)); - + map(0x18000000, 0x1800ffff).ram().share(m_sram); map(0x28000000, 0x28000003).rw("rtc", FUNC(v3021_device::read), FUNC(v3021_device::write)); - map(0x38000000, 0x38001fff).ram().share("videoram"); + + map(0x38000000, 0x38001fff).ram().share(m_videoram); map(0x38004000, 0x38007fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x38008500, 0x380085ff).rw(FUNC(igs_fear_state::xa_r), FUNC(igs_fear_state::xa_w)); + map(0x38008500, 0x38008503).umask32(0x0000ffff).w(m_xa, FUNC(igs_xa_mcu_ics_sound_device::cmd_w)); + map(0x38008500, 0x380085ff).r(FUNC(igs_fear_state::xa_r)); + + map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_fear_state::xor_table_w)); + map(0x58000000, 0x58000003).portr("IN0"); map(0x58100000, 0x58100003).portr("IN1"); + map(0x68000000, 0x6800000f).w(FUNC(igs_fear_state::cpld_w)); +} + +void igs_fear_state::main_xor_map(address_map &map) +{ + main_map(map); + map(0x08000000, 0x0807ffff).r(FUNC(igs_fear_state::external_rom_r)); // Game ROM } + static INPUT_PORTS_START( fear ) PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -316,61 +265,61 @@ INPUT_PORTS_START( superkds ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x03, 0x01, "Scene" ) PORT_DIPLOCATION("SW1:1,2") + PORT_DIPNAME( 0x03, 0x01, "Scene" ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, "Volcano" ) PORT_DIPSETTING( 0x02, "Jungle" ) PORT_DIPSETTING( 0x01, "Ice Field" ) PORT_DIPSETTING( 0x00, "Ice Field (duplicate)" ) - PORT_DIPNAME( 0x04, 0x00, "Ticket" ) PORT_DIPLOCATION("SW1:3") - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Ticket Dispenser" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0xf8, 0x00, "Ticket Table" ) PORT_DIPLOCATION("SW1:4,5,6,7,8") - PORT_DIPSETTING( 0xf8, "Table1" ) - PORT_DIPSETTING( 0xf0, "Table2" ) - PORT_DIPSETTING( 0xe8, "Table3" ) - PORT_DIPSETTING( 0xe0, "Table4" ) - PORT_DIPSETTING( 0xd8, "Table5" ) - PORT_DIPSETTING( 0xd0, "Table6" ) - PORT_DIPSETTING( 0xc8, "Table7" ) - PORT_DIPSETTING( 0xc0, "Table8" ) - PORT_DIPSETTING( 0xb8, "Table9" ) - PORT_DIPSETTING( 0xb0, "Table10" ) - PORT_DIPSETTING( 0xa8, "Table11" ) - PORT_DIPSETTING( 0xa0, "Table12" ) - PORT_DIPSETTING( 0x98, "Table13" ) - PORT_DIPSETTING( 0x90, "Table14" ) - PORT_DIPSETTING( 0x88, "Table15" ) - PORT_DIPSETTING( 0x80, "Table16" ) - PORT_DIPSETTING( 0x78, "Table17" ) - PORT_DIPSETTING( 0x70, "Table18" ) - PORT_DIPSETTING( 0x68, "Table19" ) - PORT_DIPSETTING( 0x60, "Table20" ) - PORT_DIPSETTING( 0x58, "Table21" ) - PORT_DIPSETTING( 0x50, "Table22" ) - PORT_DIPSETTING( 0x48, "Table23" ) - PORT_DIPSETTING( 0x40, "Table24" ) - PORT_DIPSETTING( 0x38, "Table25" ) - PORT_DIPSETTING( 0x30, "Table26" ) - PORT_DIPSETTING( 0x28, "Table27" ) - PORT_DIPSETTING( 0x20, "Table28" ) - PORT_DIPSETTING( 0x18, "Table29" ) - PORT_DIPSETTING( 0x10, "Table30" ) - PORT_DIPSETTING( 0x08, "Table31" ) - PORT_DIPSETTING( 0x00, "Table32" ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0xf8, 0x00, "Ticket Payout Table" ) PORT_DIPLOCATION("SW1:4,5,6,7,8") + PORT_DIPSETTING( 0xf8, "3 2 2 1 1 0 0 0" ) + PORT_DIPSETTING( 0xf0, "3 2 2 2 1 1 1 1" ) + PORT_DIPSETTING( 0xe8, "3 2 2 2 2 2 2 2" ) + PORT_DIPSETTING( 0xe0, "3 3 3 3 3 3 3 3" ) + PORT_DIPSETTING( 0xd8, "6 5 4 3 2 1 0 0" ) + PORT_DIPSETTING( 0xd0, "6 5 4 3 3 2 1 1" ) + PORT_DIPSETTING( 0xc8, "6 5 4 4 3 3 2 2" ) + PORT_DIPSETTING( 0xc0, "6 5 5 4 4 3 3 3" ) + PORT_DIPSETTING( 0xb8, "9 7 6 5 3 2 1 0" ) + PORT_DIPSETTING( 0xb0, "9 7 6 5 4 3 2 1" ) + PORT_DIPSETTING( 0xa8, "9 8 7 6 5 4 3 2" ) + PORT_DIPSETTING( 0xa0, "9 8 7 6 5 4 3 3" ) + PORT_DIPSETTING( 0x98, "12 10 8 6 5 3 1 0" ) + PORT_DIPSETTING( 0x90, "12 10 8 7 5 4 2 1" ) + PORT_DIPSETTING( 0x88, "12 10 9 7 6 4 3 2" ) + PORT_DIPSETTING( 0x80, "12 10 9 8 6 5 4 3" ) + PORT_DIPSETTING( 0x78, "20 17 14 11 8 5 2 0" ) + PORT_DIPSETTING( 0x70, "20 17 14 11 9 6 3 1" ) + PORT_DIPSETTING( 0x68, "20 17 14 12 9 7 4 2" ) + PORT_DIPSETTING( 0x60, "20 17 15 12 10 7 5 3" ) + PORT_DIPSETTING( 0x58, "30 25 21 17 12 8 4 0" ) + PORT_DIPSETTING( 0x50, "30 25 21 17 13 9 5 1" ) + PORT_DIPSETTING( 0x48, "30 26 22 18 14 10 6 2" ) + PORT_DIPSETTING( 0x40, "30 26 22 18 14 10 6 3" ) + PORT_DIPSETTING( 0x38, "40 34 28 22 17 11 5 0" ) + PORT_DIPSETTING( 0x30, "40 34 28 23 17 12 6 1" ) + PORT_DIPSETTING( 0x28, "40 34 29 23 18 12 7 2" ) + PORT_DIPSETTING( 0x20, "40 34 29 24 18 13 8 3" ) + PORT_DIPSETTING( 0x18, "50 42 35 28 21 14 7 0" ) + PORT_DIPSETTING( 0x10, "50 43 36 29 22 15 8 1" ) + PORT_DIPSETTING( 0x08, "50 43 36 29 22 15 8 2" ) + PORT_DIPSETTING( 0x00, "50 43 36 29 23 16 9 3" ) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Free Play" ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x06, 0x06, "Coin/Credit" ) PORT_DIPLOCATION("SW2:2,3") - PORT_DIPSETTING( 0x06, "1" ) - PORT_DIPSETTING( 0x04, "2" ) - PORT_DIPSETTING( 0x02, "3" ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPNAME( 0x08, 0x08, "Demo BGM" ) PORT_DIPLOCATION("SW2:4") - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Free_Play) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x06, 0x06, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW2:2,3") + PORT_DIPSETTING( 0x00, DEF_STR(4C_1C) ) + PORT_DIPSETTING( 0x02, DEF_STR(3C_1C) ) + PORT_DIPSETTING( 0x04, DEF_STR(2C_1C) ) + PORT_DIPSETTING( 0x06, DEF_STR(1C_1C) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x70, 0x00, "Slave" ) PORT_DIPLOCATION("SW2:5,6,7") + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x70, 0x00, "Slave ID" ) PORT_DIPLOCATION("SW2:5,6,7") PORT_DIPSETTING( 0x70, "0" ) PORT_DIPSETTING( 0x60, "1" ) PORT_DIPSETTING( 0x50, "2" ) @@ -379,9 +328,9 @@ INPUT_PORTS_START( superkds ) PORT_DIPSETTING( 0x20, "5" ) PORT_DIPSETTING( 0x10, "6" ) PORT_DIPSETTING( 0x00, "Single" ) - PORT_DIPNAME( 0x80, 0x00, "Language" ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, "Chinese" ) - PORT_DIPSETTING( 0x00, "English" ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR(Language) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR(Chinese) ) + PORT_DIPSETTING( 0x00, DEF_STR(English) ) PORT_START("AN0") PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(20) @@ -390,122 +339,35 @@ INPUT_PORTS_START( superkds ) PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(20) INPUT_PORTS_END -void igs_fear_state::sound_irq(int state) -{ - LOGMASKED(LOG_DEBUG, "sound irq\n"); - if (state) - m_xa->set_input_line(XA_EXT_IRQ2, ASSERT_LINE); -} - void igs_fear_state::vblank_irq(int state) { - if (state) - if (m_screen->frame_number() & 1) - m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, (state && m_screen->frame_number() & 1) ? 1 : 0); } -u32 igs_fear_state::igs027_gpio_r(offs_t offset, u32 mem_mask) -{ - u32 data = ~u32(0); - switch (offset * 4) - { - case 0xc: - { - u8 ret = 0xff; - if (!BIT(m_gpio_o, 0)) ret &= m_io_dsw[0]->read(); - if (!BIT(m_gpio_o, 1)) ret &= m_io_dsw[1]->read(); - data = 0x2000 | (u32(ret) << 3); - } - break; - - default: - LOGMASKED(LOG_DEBUG, "%s: unhandled igs027_gpio_r %04x (%08x)\n", machine().describe_context(), offset * 4, mem_mask); - break; - } - return data; -} - -void igs_fear_state::igs027_gpio_w(offs_t offset, u32 data, u32 mem_mask) +u32 igs_fear_state::external_rom_r(offs_t offset) { - switch (offset * 4) - { - case 0x18: - m_gpio_o = data; - break; - - default: - LOGMASKED(LOG_DEBUG, "%s: unhandled igs027_gpio_w %04x %08x (%08x)\n", machine().describe_context(), offset * 4, data, mem_mask); - break; - } + return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; } -void igs_fear_state::igs027_periph_init() -{ - m_irq_enable = 0xff; - m_irq_pending = 0xff; - m_timer0 = timer_alloc(FUNC(igs_fear_state::igs027_timer0), this); - m_timer1 = timer_alloc(FUNC(igs_fear_state::igs027_timer1), this); -} -void igs_fear_state::igs027_trigger_irq(int num) +void igs_fear_state::xor_table_w(offs_t offset, u8 data) { - if (!BIT(m_irq_enable, num)) - { - m_irq_pending &= ~(u32(1) << num); - m_maincpu->pulse_input_line(ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); - } + m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); } -TIMER_CALLBACK_MEMBER(igs_fear_state::igs027_timer0) -{ - igs027_trigger_irq(0); -} -TIMER_CALLBACK_MEMBER(igs_fear_state::igs027_timer1) +u32 igs_fear_state::igs027_gpio_r() { - igs027_trigger_irq(1); + u8 dsw = 0xff; + if (!BIT(m_gpio_o, 0)) dsw &= m_io_dsw[0]->read(); + if (!BIT(m_gpio_o, 1)) dsw &= m_io_dsw[1]->read(); + return 0x00400 | dsw; } -void igs_fear_state::igs027_periph_w(offs_t offset, u32 data, u32 mem_mask) +void igs_fear_state::igs027_gpio_w(u8 data) { - switch (offset * 4) - { - case 0x100: - // TODO: verify the timer interval - m_timer0->adjust(attotime::from_hz(data / 2), 0, attotime::from_hz(data / 2)); - break; - - case 0x104: - m_timer1->adjust(attotime::from_hz(data / 2), 0, attotime::from_hz(data / 2)); - break; - - case 0x200: - m_irq_enable = data; - break; - - default: - LOGMASKED(LOG_DEBUG, "%s: unhandled igs027_periph_w %04x %08x (%08x)\n", machine().describe_context(), offset * 4, data, mem_mask); - break; - } -} - -u32 igs_fear_state::igs027_periph_r(offs_t offset, u32 mem_mask) -{ - u32 data = ~u32(0); - switch (offset * 4) - { - case 0x200: - data = m_irq_pending; - m_irq_pending = 0xff; - break; - - default: - LOGMASKED(LOG_DEBUG, "%s: unhandled igs027_periph_r %04x (%08x)\n", machine().describe_context(), offset * 4, mem_mask); - break; - - } - return data; + m_gpio_o = data; } // TODO: trackball support in XA @@ -517,9 +379,9 @@ u32 igs_fear_state::xa_r(offs_t offset, u32 mem_mask) { case 0: { - data = m_xa_ret0; + data = m_xa->response_low_r(); // TODO: This should be remove when we implement serial trackball support in XA - if (m_xa_cmd == 0xa301) + if (m_xa->cmd_r() == 0xa301) { switch (m_trackball_cnt++) { @@ -557,37 +419,12 @@ u32 igs_fear_state::xa_r(offs_t offset, u32 mem_mask) break; } case 0x80: - data = m_xa_ret1 << 16; + data = u32(m_xa->response_high_r()) << 16; break; } return data; } -void igs_fear_state::xa_w(offs_t offset, u32 data, u32 mem_mask) -{ - m_xa_cmd = data; - - if (offset == 0) - { - m_num_params--; - - if (m_num_params <= 0) - { - LOGMASKED(LOG_DEBUG, "---------------m_xa_cmd is %02x size %02x\n", (data & 0xff00)>>8, data & 0xff); - m_num_params = data & 0xff; - } - else - { - LOGMASKED(LOG_DEBUG, "-------------------------- param %04x\n", data & 0xffff); - } - m_xa->set_input_line(XA_EXT_IRQ0, ASSERT_LINE); - } - else - { - LOGMASKED(LOG_DEBUG, "%s: unhandled xa_w %04x %08x (%08x)\n", machine().describe_context(), offset * 4, data, mem_mask); - } -} - void igs_fear_state::cpld_w(offs_t offset, u32 data, u32 mem_mask) { switch (offset * 4) @@ -602,126 +439,13 @@ void igs_fear_state::cpld_w(offs_t offset, u32 data, u32 mem_mask) } } -u8 igs_fear_state::mcu_p0_r() -{ - u8 ret = m_port0_latch; - LOGMASKED(LOG_DEBUG, "%s: COMMAND READ LOWER mcu_p0_r() returning %02x with port3 as %02x\n", machine().describe_context(), ret, m_port3_dat); - return ret; -} - -u8 igs_fear_state::mcu_p1_r() -{ - LOGMASKED(LOG_DEBUG, "%s: mcu_p1_r()\n", machine().describe_context()); - return m_port1_dat; // superkds XA will end up failing returning port1 dat for now, but not attempt to play any sounds otherwise? -} - -u8 igs_fear_state::mcu_p2_r() -{ - u8 ret = m_port2_latch; - LOGMASKED(LOG_DEBUG, "%s: COMMAND READ mcu_p2_r() returning %02x with port3 as %02x\n", machine().describe_context(), ret, m_port3_dat); - return m_port2_latch; -} - -u8 igs_fear_state::mcu_p3_r() -{ - LOGMASKED(LOG_DEBUG, "%s: mcu_p3_r()\n", machine().describe_context()); - return m_port3_dat; -} - -static int posedge(uint32_t oldval, uint32_t val, int bit) -{ - return (!BIT(oldval, bit)) && (BIT(val, bit)); -} - -static int negedge(uint32_t oldval, uint32_t val, int bit) -{ - return (BIT(oldval, bit)) && (!BIT(val, bit)); -} - -void igs_fear_state::mcu_p0_w(uint8_t data) -{ - LOGMASKED(LOG_DEBUG, "%s: mcu_p0_w() %02x with port 3 as %02x and port 1 as %02x\n", machine().describe_context(), data, m_port3_dat, m_port1_dat); - m_port0_dat = data; -} - -void igs_fear_state::mcu_p1_w(uint8_t data) -{ - u8 olddata = m_port1_dat; - LOGMASKED(LOG_DEBUG, "%s: mcu_p1_w() %02x\n", machine().describe_context(), data); - m_port1_dat = data; - - if (posedge(olddata, m_port1_dat, 3)) - { - igs027_trigger_irq(3); - } -} - -void igs_fear_state::mcu_p2_w(uint8_t data) -{ - m_port2_dat = data; - LOGMASKED(LOG_DEBUG, "%s: mcu_p2_w() %02x with port 3 as %02x\n", machine().describe_context(), data, m_port3_dat); -} - -void igs_fear_state::mcu_p3_w(uint8_t data) -{ - u8 oldport3 = m_port3_dat; - m_port3_dat = data; - LOGMASKED(LOG_DEBUG, "%s: mcu_p3_w() %02x - do latches oldport3 %02x newport3 %02x\n", machine().describe_context(), data, oldport3, m_port3_dat); - - // high->low transition on bit 0x80 must read into latches! - if (negedge(oldport3, m_port3_dat, 7)) - { - if (!BIT(m_port3_dat, 4)) - { - m_port0_latch = m_ics->read(m_port1_dat & 7); - LOGMASKED(LOG_DEBUG, "read from ics [%d] = [%02x]\n", m_port1_dat & 7, m_port0_latch); - } - else if (!BIT(m_port3_dat, 5)) - { - LOGMASKED(LOG_DEBUG, "read command [%d] = [%04x]\n", m_port1_dat & 7, m_xa_cmd); - m_port2_latch = (m_xa_cmd & 0xff00) >> 8; - m_port0_latch = m_xa_cmd & 0x00ff; - } - } - - if (negedge(oldport3, m_port3_dat, 6)) - { - if (!BIT(m_port3_dat, 4)) - { - LOGMASKED(LOG_DEBUG, "write to ics [%d] = [%02x]\n", m_port1_dat & 7, m_port0_dat); - m_ics->write(m_port1_dat & 7, m_port0_dat); - } - else if (!BIT(m_port3_dat, 5)) - { - uint32_t dat = (m_port2_dat << 8) | m_port0_dat; - LOGMASKED(LOG_DEBUG, "write command [%d] = [%04x]\n", m_port1_dat & 7, dat); - switch (m_port1_dat & 7) - { - case 1: - m_xa_ret1 = dat; - break; - case 2: - m_xa_ret0 = dat; - break; - } - } - } -} void igs_fear_state::igs_fear(machine_config &config) { - ARM7(config, m_maincpu, 50000000/2); + IGS027A(config, m_maincpu, 50'000'000/2); m_maincpu->set_addrmap(AS_PROGRAM, &igs_fear_state::main_map); - - MX10EXA(config, m_xa, 50000000/3); // MX10EXAQC (Philips 80C51 XA) - m_xa->port_in_cb<0>().set(FUNC(igs_fear_state::mcu_p0_r)); - m_xa->port_in_cb<1>().set(FUNC(igs_fear_state::mcu_p1_r)); - m_xa->port_in_cb<2>().set(FUNC(igs_fear_state::mcu_p2_r)); - m_xa->port_in_cb<3>().set(FUNC(igs_fear_state::mcu_p3_r)); - m_xa->port_out_cb<0>().set(FUNC(igs_fear_state::mcu_p0_w)); - m_xa->port_out_cb<1>().set(FUNC(igs_fear_state::mcu_p1_w)); - m_xa->port_out_cb<2>().set(FUNC(igs_fear_state::mcu_p2_w)); - m_xa->port_out_cb<3>().set(FUNC(igs_fear_state::mcu_p3_w)); + m_maincpu->in_port().set(FUNC(igs_fear_state::igs027_gpio_r)); + m_maincpu->out_port().set(FUNC(igs_fear_state::igs027_gpio_w)); config.set_maximum_quantum(attotime::from_hz(600)); @@ -740,14 +464,18 @@ void igs_fear_state::igs_fear(machine_config &config) V3021(config, "rtc"); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* sound hardware */ - SPEAKER(config, "mono").front_center(); + IGS_XA_ICS_SOUND(config, m_xa, 50'000'000/3); + m_xa->irq().set_inputline(m_maincpu, arm7_cpu_device::ARM7_IRQ_LINE); +} + +void igs_fear_state::igs_fear_xor(machine_config &config) +{ + igs_fear(config); - ICS2115(config, m_ics, 33.8688_MHz_XTAL); // TODO : Correct? - m_ics->irq().set(FUNC(igs_fear_state::sound_irq)); - m_ics->add_route(ALL_OUTPUTS, "mono", 5.0); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_fear_state::main_xor_map); } @@ -758,7 +486,7 @@ ROM_START( fearless ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "fearlessp_v-101us.u37", 0x000000, 0x80000, CRC(2522873c) SHA1(8db709877311b6d2796353fc9a44a820937e35c2) ) - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked 07, not read protected + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked 07, not read protected ROM_LOAD( "fearlessp_07.u33", 0x000000, 0x10000, CRC(7dae4900) SHA1(bbf7ba7c9e95ff2ffeb1dc0fc7ccedd4da274d01) ) ROM_REGION( 0x3000000, "gfx1", 0 ) // FIXED BITS (0xxxxxxx) (graphics are 7bpp) @@ -769,7 +497,7 @@ ROM_START( fearless ) ROM_LOAD32_WORD( "fearlessp_u18_cg-2l.u18", 0x2000000, 0x800000, CRC(07623d66) SHA1(041d5e44917bc16caa720ea98bdc0a4f5fb4b8e0) ) ROM_LOAD32_WORD( "fearlessp_u17_cg-2h.u17", 0x2000002, 0x800000, CRC(756fe1f2) SHA1(48ee81c5fa4808406b57b2521b836db3ff5a7fa9) ) - ROM_REGION( 0x800000, "ics", 0 ) + ROM_REGION( 0x800000, "xa:ics", 0 ) ROM_LOAD( "fearlessp_u25_music0.u25", 0x000000, 0x400000, CRC(a015b9b1) SHA1(7b129c59acd523dec82e58a75d873bbc5341fb28) ) ROM_LOAD( "fearlessp_u26_music1.u26", 0x400000, 0x400000, CRC(9d5f18da) SHA1(42e5224c1af0898cc2e02b2e051ea8b629d5fb6d) ) ROM_END @@ -781,7 +509,7 @@ ROM_START( superkds ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "superkids_s019cn.u37", 0x000000, 0x80000, CRC(1a7f17dd) SHA1(ba20c0f521bff2f5ae2103ea49bd413b0e6459ba) ) - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked 07, not read protected + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked 07, not read protected ROM_LOAD( "superkids_mx10exa.u33", 0x000000, 0x10000, CRC(8baf5ba2) SHA1(2f8c2c48e756264e593bce7c09260e50d5cac827) ) // sticker marked G6 ROM_REGION( 0x2000000, "gfx1", 0 ) // FIXED BITS (0xxxxxxx) (graphics are 7bpp) @@ -790,7 +518,7 @@ ROM_START( superkds ) ROM_LOAD32_WORD( "superkids_cg-1l.u14", 0x1000000, 0x800000, CRC(57081c96) SHA1(886ac14ad1c9ce8c7a67bbfc6c00e7c75be634dc) ) ROM_LOAD32_WORD( "superkids_cg-1h.u13", 0x1000002, 0x800000, CRC(cd1e41ef) SHA1(a40bcbd97fa3e742e8f9c7b7c7d8879175bf10ee) ) - ROM_REGION( 0x800000, "ics", 0 ) + ROM_REGION( 0x800000, "xa:ics", 0 ) ROM_LOAD( "superkids_music0.u25", 0x000000, 0x400000, CRC(d7c37216) SHA1(ffcf7f1bf3093eb34ad0ae2cc89062de45b9d420) ) ROM_LOAD( "superkids_music1.u26", 0x400000, 0x400000, CRC(5f080dbf) SHA1(f02330db3336f6606aae9f5a9eca819701caa3bf) ) ROM_END @@ -803,7 +531,7 @@ ROM_START( icescape ) // IGS PCB-0433-16-GK (same PCB as Fearless Pinocchio) - H ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "icescape_v-104fa.u37", 0x000000, 0x80000, CRC(e3552726) SHA1(bac34ac4fce1519c1bc8020064090e77b5c2a629) ) // TMS27C240 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked O7 + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked O7 ROM_LOAD( "o7.u33", 0x00000, 0x10000, NO_DUMP ) ROM_REGION( 0x2000000, "gfx1", 0 ) // FIXED BITS (0xxxxxxx) (graphics are 7bpp) @@ -813,7 +541,7 @@ ROM_START( icescape ) // IGS PCB-0433-16-GK (same PCB as Fearless Pinocchio) - H ROM_LOAD32_WORD( "icescape_fa_cg_u13.u13", 0x1000002, 0x800000, NO_DUMP ) // u17 and u18 not populated - ROM_REGION( 0x400000, "ics", 0 ) + ROM_REGION( 0x400000, "xa:ics", 0 ) ROM_LOAD( "icescape_fa_sp_u25.u25", 0x000000, 0x200000, CRC(a01febd6) SHA1(6abe8b700c5725909939421e2493940421fc823f) ) // M27C160 ROM_LOAD( "icescape_fa_sp_u26.u26", 0x200000, 0x200000, CRC(35085613) SHA1(bdc6ecf5ee6fd095a56e33e8ce893fe05bcb426c) ) // M27C160 ROM_END @@ -835,6 +563,6 @@ void igs_fear_state::init_igs_icescape() } // anonymous namespace -GAME( 2005, superkds, 0, igs_fear, superkds, igs_fear_state, init_igs_superkds, ROT0, "IGS (Golden Dragon Amusement license)", "Super Kids / Jiu Nan Xiao Yingxiong (S019CN)", 0 ) -GAME( 2006, fearless, 0, igs_fear, fear, igs_fear_state, init_igs_fear, ROT0, "IGS (American Alpha license)", "Fearless Pinocchio (V101US)", 0 ) -GAME( 2006, icescape, 0, igs_fear, fear, igs_fear_state, init_igs_icescape, ROT0, "IGS", "Icescape (V104FA)", MACHINE_IS_SKELETON ) // IGS FOR V104FA 2006-11-02 +GAME( 2005, superkds, 0, igs_fear_xor, superkds, igs_fear_state, init_igs_superkds, ROT0, "IGS (Golden Dragon Amusement license)", "Super Kids / Jiu Nan Xiao Yingxiong (S019CN)", MACHINE_NODEVICE_LAN ) +GAME( 2006, fearless, 0, igs_fear_xor, fear, igs_fear_state, init_igs_fear, ROT0, "IGS (American Alpha license)", "Fearless Pinocchio (V101US)", 0 ) +GAME( 2006, icescape, 0, igs_fear, fear, igs_fear_state, init_igs_icescape, ROT0, "IGS", "Icescape (V104FA)", MACHINE_IS_SKELETON ) // IGS FOR V104FA 2006-11-02 diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 395b596777928..0fd5e8bf76d6e 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -1,8 +1,8 @@ // license:BSD-3-Clause -// copyright-holders: Xing Xing, David Haywood +// copyright-holders: XingXing, David Haywood /* IGS ARM7 (IGS027A) based Mahjong / Gambling platform(s) - Driver by Xing Xing + Driver by XingXing These games use the IGS027A processor. @@ -15,18 +15,23 @@ To emulate these games the Internal ROM will need dumping There are at least 20 other games on this and similar platforms. + Hold service on boot to access input test and sond test when implemented. + + TODO: + * I/O for remaining games + * Coin lockout (zhongguo displays a coin error on unexpected coins) */ #include "emu.h" #include "igs017_igs031.h" +#include "igs027a.h" +#include "mahjong.h" #include "pgmcrypt.h" -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" - #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "sound/okim6295.h" @@ -34,6 +39,15 @@ #include "screen.h" #include "speaker.h" +#include "endianness.h" + +#include + +#include "jking02.lh" +#include "oceanpar.lh" +#include "tripslot.lh" + + namespace { class igs_m027_state : public driver_device @@ -41,130 +55,214 @@ class igs_m027_state : public driver_device public: igs_m027_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_igs_mainram(*this, "igs_mainram"), + m_external_rom(*this, "user1"), m_maincpu(*this, "maincpu"), - m_ppi(*this, "ppi8255"), + m_ppi(*this, "ppi%u", 1U), m_igs017_igs031(*this, "igs017_igs031"), m_screen(*this, "screen"), m_oki(*this, "oki"), - m_portb(*this, "PORTB"), - m_portc(*this, "PORTC"), - m_dsw1(*this, "DSW1"), - m_dsw2(*this, "DSW2"), - m_dsw3(*this, "DSW3") + m_okibank(*this, "okibank%u", 0U), + m_hopper(*this, "hopper"), + m_ticket(*this, "ticket"), + m_io_kbd(*this, "KEY%u", 0U), + m_io_dsw(*this, "DSW%u", 1U), + m_io_misc(*this, "MISC"), + m_out_lamps(*this, "lamp%u", 1U) { } - void igs_mahjong(machine_config &config); - - void init_sdwx(); - void init_chessc2(); - void init_lhzb4(); - void init_mgfx(); - void init_lhzb3(); - void init_gonefsh2(); - void init_sddz(); - void init_zhongguo(); - void init_klxyj(); - void init_slqz3(); - void init_fruitpar(); - void init_oceanpar(); - void init_amazonia(); - void init_amazoni2(); - void init_qlgs(); - void init_mgzz(); - void init_mgcs3(); - void init_jking02(); - void init_lhdmg(); - void init_lthy(); - void init_luckycrs(); - void init_olympic5(); + ioport_value kbd_ioport_r(); + + template void counter_w(int state); + + template void m027_noppi(machine_config &config) ATTR_COLD; + template void m027_1ppi(machine_config &config) ATTR_COLD; + template void m027_2ppis(machine_config &config) ATTR_COLD; + void slqz3(machine_config &config) ATTR_COLD; + void jking02(machine_config &config) ATTR_COLD; + void qlgs(machine_config &config) ATTR_COLD; + void lhdmg(machine_config &config) ATTR_COLD; + void cjddz(machine_config &config) ATTR_COLD; + void lhzb4(machine_config &config) ATTR_COLD; + void lthy(machine_config &config) ATTR_COLD; + void zhongguo(machine_config &config) ATTR_COLD; + void mgzz(machine_config &config) ATTR_COLD; + void oceanpar(machine_config &config) ATTR_COLD; + void tripslot(machine_config &config) ATTR_COLD; + void extradrw(machine_config &config) ATTR_COLD; + void chessc2(machine_config &config) ATTR_COLD; + + void init_sdwx() ATTR_COLD; + void init_lhzb4() ATTR_COLD; + void init_gonefsh2() ATTR_COLD; + void init_cjddz() ATTR_COLD; + void init_zhongguo() ATTR_COLD; + void init_klxyj() ATTR_COLD; + void init_slqz3() ATTR_COLD; + void init_fruitpar() ATTR_COLD; + void init_oceanpar() ATTR_COLD; + void init_amazonia() ATTR_COLD; + void init_amazoni2() ATTR_COLD; + void init_qlgs() ATTR_COLD; + void init_mgzz() ATTR_COLD; + void init_mgcs3() ATTR_COLD; + void init_jking02() ATTR_COLD; + void init_lhdmg() ATTR_COLD; + void init_lthy() ATTR_COLD; + void init_luckycrs() ATTR_COLD; + void init_olympic5() ATTR_COLD; + void init_tripslot() ATTR_COLD; + void init_extradrw() ATTR_COLD; + void init_chessc2() ATTR_COLD; protected: - virtual void machine_start() override; - virtual void video_start() override; + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; private: - optional_shared_ptr m_igs_mainram; - required_device m_maincpu; - optional_device m_ppi; + required_region_ptr m_external_rom; + + required_device m_maincpu; + optional_device_array m_ppi; required_device m_igs017_igs031; required_device m_screen; required_device m_oki; - required_ioport m_portb; - required_ioport m_portc; - required_ioport m_dsw1; - required_ioport m_dsw2; - required_ioport m_dsw3; - - u32 unk_r(); - u32 unk2_r(); - void unk2_w(u32 data); + optional_memory_bank_array<2> m_okibank; + optional_device m_hopper; + optional_device m_ticket; + + optional_ioport_array<5> m_io_kbd; + optional_ioport_array<3> m_io_dsw; + optional_ioport m_io_misc; + + output_finder<16> m_out_lamps; - void dsw_io_select_w(u32 data); + u32 m_xor_table[0x100]; + u8 m_io_select[2]; - u8 ppi_porta_r(); - u8 ppi_portb_r(); - u8 ppi_portc_r(); + template u8 dsw_r(); + template u8 kbd_r(); + + template void io_select_w(u8 data); + + u32 external_rom_r(offs_t offset); + + void xor_table_w(offs_t offset, u8 data); + + template void lamps_w(u8 data); + void mahjong_output_w(u8 data); + void jking02_output_w(u8 data); + void oceanpar_output_w(u8 data); + void tripslot_misc_w(u8 data); + void tripslot_okibank_low_w(u8 data); + void oki_128k_bank_w(u8 data); + + u32 slqz3_gpio_r(); + u32 lhdmg_gpio_r(); + void unk2_w(u32 data); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - void pgm_create_dummy_internal_arm_region(); - void igs_mahjong_map(address_map &map); + void pgm_create_dummy_internal_arm_region() ATTR_COLD; + + template void m027_noppi_map(address_map &map) ATTR_COLD; + template void m027_1ppi_map(address_map &map) ATTR_COLD; + template void m027_2ppis_map(address_map &map) ATTR_COLD; + void cjddz_map(address_map &map) ATTR_COLD; + void tripslot_map(address_map &map) ATTR_COLD; - u32 m_dsw_io_select; - u32 m_unk2_write_count; + void oki_128k_map(address_map &map) ATTR_COLD; }; -void igs_m027_state::video_start() +void igs_m027_state::machine_start() { - m_igs017_igs031->video_start(); + m_out_lamps.resolve(); + + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); + std::fill(std::begin(m_io_select), std::end(m_io_select), 0xff); + + auto *const region = memregion("oki"); + for (auto &bank : m_okibank) + { + if (region && bank) + bank->configure_entries(0, region->bytes() / 0x20000, region->base(), 0x20000); + } + + save_item(NAME(m_xor_table)); + save_item(NAME(m_io_select)); } -void igs_m027_state::machine_start() +void igs_m027_state::video_start() { - m_dsw_io_select = 0; - m_unk2_write_count = 0; - - save_item(NAME(m_dsw_io_select)); - save_item(NAME(m_unk2_write_count)); + m_igs017_igs031->video_start(); } + /*************************************************************************** Memory Maps ***************************************************************************/ -void igs_m027_state::igs_mahjong_map(address_map &map) +template +void igs_m027_state::m027_noppi_map(address_map &map) { - map(0x00000000, 0x00003fff).rom(); // Internal ROM - map(0x08000000, 0x0807ffff).rom().region("user1", 0); // Game ROM - map(0x10000000, 0x100003ff).ram().share("igs_mainram"); // main RAM for ASIC? - map(0x18000000, 0x18007fff).ram(); + if (Xor) + map(0x0800'0000, 0x0807'ffff).r(FUNC(igs_m027_state::external_rom_r)); // Game ROM + else + map(0x0800'0000, 0x0807'ffff).rom().region("user1", 0); // Game ROM - map(0x38000000, 0x38007fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x1800'0000, 0x1800'7fff).ram().mirror(0x0000f'8000).share("nvram"); - map(0x38008000, 0x38008003).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x000000ff); + map(0x3800'0000, 0x3800'7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x3800'8000, 0x3800'8003).umask32(0x0000'00ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x38009000, 0x38009003).r(FUNC(igs_m027_state::unk_r)); + map(0x5000'0000, 0x5000'03ff).umask32(0x0000'00ff).w(FUNC(igs_m027_state::xor_table_w)); // uploads XOR table to external ROM here +} - map(0x40000008, 0x4000000b).w(FUNC(igs_m027_state::unk2_w)); - map(0x4000000c, 0x4000000f).r(FUNC(igs_m027_state::unk2_r)); - map(0x40000018, 0x4000001b).w(FUNC(igs_m027_state::dsw_io_select_w)); +template +void igs_m027_state::m027_1ppi_map(address_map &map) +{ + m027_noppi_map(map); - map(0x70000200, 0x70000203).ram(); //?????????????? - map(0x50000000, 0x500003ff).nopw(); // uploads XOR table to external ROM here - map(0xf0000000, 0xf000000f).nopw(); // magic registers + map(0x3800'9000, 0x3800'9003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); } +template +void igs_m027_state::m027_2ppis_map(address_map &map) +{ + m027_1ppi_map(map); + + map(0x3800'a000, 0x3800'a003).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); +} + +void igs_m027_state::cjddz_map(address_map &map) +{ + m027_1ppi_map(map); + + map(0x3800'b000, 0x3800'b003).umask32(0x0000'00ff).w(FUNC(igs_m027_state::oki_128k_bank_w)); +} + +void igs_m027_state::tripslot_map(address_map &map) +{ + m027_1ppi_map(map); + + map(0x3800'c000, 0x3800'c003).umask32(0x0000'00ff).w(FUNC(igs_m027_state::tripslot_misc_w)); +} + +void igs_m027_state::oki_128k_map(address_map &map) +{ + map(0x00000, 0x1ffff).bankr(m_okibank[0]); + map(0x20000, 0x3ffff).bankr(m_okibank[1]); +} + + /*************************************************************************** Input Ports ***************************************************************************/ -static INPUT_PORTS_START( base ) - +INPUT_PORTS_START( base ) PORT_START("DSW1") PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) @@ -248,52 +346,1044 @@ static INPUT_PORTS_START( base ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -static INPUT_PORTS_START( jking02 ) - PORT_INCLUDE(base) +INPUT_PORTS_START( mahjong_test ) + PORT_START("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) PORT_NAME("Hopper Switch") // 哈巴 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Clear") // 清除 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // 投币 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 TODO: default assignment clashes with mahjong I + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END - PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x01, 0x00, "DSW2" ) // can cause a coin error (sets different inputs?) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_START( mahjong_kbd ) + PORT_INCLUDE(mahjong_test) + PORT_INCLUDE(igs_mahjong_matrix) +INPUT_PORTS_END - PORT_MODIFY("DSW3") - PORT_DIPNAME( 0x02, 0x00, "Show Odds" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) +INPUT_PORTS_START( mahjong_kbd_joy ) + PORT_INCLUDE(mahjong_kbd) + + PORT_MODIFY("TEST") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // also functions as BET + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +INPUT_PORTS_START( three_reel ) + PORT_START("PORTB") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Call Attendant") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PLAYER") + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0x00700, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Ticket") // TICKET + PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // TKSW + PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC + PORT_BIT( 0xf0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +INPUT_PORTS_START( slqz3_dip_switches ) + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 + PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) + PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x01, DEF_STR(1C_3C) ) + PORT_DIPSETTING( 0x00, DEF_STR(1C_5C) ) + PORT_DIPNAME( 0x0c, 0x0c, "Key-In Rate" ) PORT_DIPLOCATION("SW1:3,4") // 开分比率 + PORT_DIPSETTING( 0x0c, "10" ) + PORT_DIPSETTING( 0x08, "20" ) + PORT_DIPSETTING( 0x04, "50" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x10, 0x10, "Credit Limit" ) PORT_DIPLOCATION("SW1:5") // 进分上限 + PORT_DIPSETTING( 0x10, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x20, 0x20, "Credit Mode" ) PORT_DIPLOCATION("SW1:6") // 进分方式 (sets coin input function) + PORT_DIPSETTING( 0x20, "Coin Acceptor" ) // 投币 (uses coin A rate) + PORT_DIPSETTING( 0x00, "Key-In" ) // 开分 (uses key-in rate) + PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW1:7") // 退分方式 + PORT_DIPSETTING( 0x40, "Return Coins" ) // 退币 (uses hopper to pay out credits) + PORT_DIPSETTING( 0x00, "Key-Out" ) // 洗分 (just clears credits) + PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:8") // 示范音乐 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x80, DEF_STR(On) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Double Up Jackpot" ) PORT_DIPLOCATION("SW2:1,2") // 比倍爆机 + PORT_DIPSETTING( 0x03, "500" ) + PORT_DIPSETTING( 0x02, "1000" ) + PORT_DIPSETTING( 0x01, "1500" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW2:3,4") // 最小押注 (all settings show 1 in service mode and function identically) + PORT_DIPSETTING( 0x0c, "1" ) + PORT_DIPSETTING( 0x08, "1" ) + PORT_DIPSETTING( 0x04, "1" ) + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPNAME( 0x10, 0x10, "Double Up Game" ) PORT_DIPLOCATION("SW2:5") // 比倍游戏 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x10, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x20, 0x20, "Double Up/Continue Play" ) PORT_DIPLOCATION("SW2:6") // 比倍续玩 + PORT_DIPSETTING( 0x20, "Double Up" ) // 比倍 + PORT_DIPSETTING( 0x00, "Continue Play" ) // 续玩 + PORT_DIPNAME( 0x40, 0x40, "Number Type" ) PORT_DIPLOCATION("SW2:7") // 数字型态 (affects credit and bet display) + PORT_DIPSETTING( 0x40, "Numbers" ) // 数字 (text and digits) + PORT_DIPSETTING( 0x00, "Blocks" ) // 方块 (pigs for credit, apples for bet, mahjong tong tiles for numbers) + PORT_DIPNAME( 0x80, 0x80, "Hidden Function" ) PORT_DIPLOCATION("SW2:8") // 隐分功能 (hides credits and bets, game plays normally) + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 +INPUT_PORTS_END + +INPUT_PORTS_START( jking02 ) + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "ID Number") PORT_DIPLOCATION("SW1:1,2,3,4,5") + PORT_DIPSETTING( 0x1f, "1" ) + PORT_DIPSETTING( 0x1e, "2" ) + PORT_DIPSETTING( 0x1d, "3" ) + PORT_DIPSETTING( 0x1c, "4" ) + PORT_DIPSETTING( 0x1b, "5" ) + PORT_DIPSETTING( 0x1a, "6" ) + PORT_DIPSETTING( 0x19, "7" ) + PORT_DIPSETTING( 0x18, "8" ) + PORT_DIPSETTING( 0x17, "9" ) + PORT_DIPSETTING( 0x16, "10" ) + PORT_DIPSETTING( 0x15, "11" ) + PORT_DIPSETTING( 0x14, "12" ) + PORT_DIPSETTING( 0x13, "13" ) + PORT_DIPSETTING( 0x12, "14" ) + PORT_DIPSETTING( 0x11, "15" ) + PORT_DIPSETTING( 0x10, "16" ) + PORT_DIPSETTING( 0x0f, "17" ) + PORT_DIPSETTING( 0x0e, "18" ) + PORT_DIPSETTING( 0x0d, "19" ) + PORT_DIPSETTING( 0x0c, "20" ) + PORT_DIPSETTING( 0x0b, "20" ) // 20 is maximum no. - all other settings are the same + PORT_DIPSETTING( 0x0a, "20" ) + PORT_DIPSETTING( 0x09, "20" ) + PORT_DIPSETTING( 0x08, "20" ) + PORT_DIPSETTING( 0x07, "20" ) + PORT_DIPSETTING( 0x06, "20" ) + PORT_DIPSETTING( 0x05, "20" ) + PORT_DIPSETTING( 0x04, "20" ) + PORT_DIPSETTING( 0x03, "20" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "20" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPNAME( 0x80, 0x80, "PC Board Mode" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, "Single" ) + PORT_DIPSETTING( 0x00, "Linking" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Wiring Diagram" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, "36+10" ) + PORT_DIPSETTING( 0x00, "28-pin" ) + PORT_DIPNAME( 0x02, 0x00, "Odds Table" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x02, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x08, 0x00, "Back Color" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, "Black" ) + PORT_DIPSETTING( 0x00, "Color" ) + PORT_DIPNAME( 0x10, 0x10, "Password" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x20, 0x20, "Double-Up Game" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x40, 0x40, "Auto Stop" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x80, 0x80, "Payout Mode" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR(Normal) ) + PORT_DIPSETTING( 0x00, "Auto" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Score Box" ) PORT_DIPLOCATION("SW3:1,2") + PORT_DIPSETTING( 0x03, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPSETTING( 0x01, "10 Times" ) + PORT_DIPSETTING( 0x00, "10 Times" ) + PORT_DIPNAME( 0x04, 0x04, "Play Score" ) PORT_DIPLOCATION("SW3:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Show Title" ) + PORT_DIPNAME( 0x08, 0x00, "Show Title" ) PORT_DIPLOCATION("SW3:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x30, 0x20, "Background Type" ) - PORT_DIPSETTING( 0x20, "Jungle Style" ) - PORT_DIPSETTING( 0x10, "Casino Style" ) - PORT_DIPSETTING( 0x00, "Casino Style (duplicate 1)" ) - PORT_DIPSETTING( 0x30, "Casino Style (duplicate 2)" ) + PORT_DIPNAME( 0x30, 0x20, "Symbols" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPSETTING( 0x30, "Fruit" ) // slot machine symbols + PORT_DIPSETTING( 0x20, "Legend" ) // characters from Journey to the West + PORT_DIPSETTING( 0x10, "Both" ) // seems to do the same thing as "Fruit" + PORT_DIPSETTING( 0x00, "Both" ) // seems to do the same thing as "Fruit" + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) - PORT_MODIFY("PORTB") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // shows dipswitches - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // maybe service coin? + PORT_START("PORTB") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // shows DIP switch settings + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // also provides access to game setup (coinage, etc.) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 4 / Double Up") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // also provides access to game setup (coinage, etc.) + PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // shows DIP switch settings + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 2 / Big") + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Play") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 1 / Take Score") + + PORT_START("PLAYER") + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 4 / Start") + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 2 / Double Up") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 1 / Take Score") + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Play") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0ff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xe0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END - PORT_MODIFY("PORTC") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // maybe bet? +INPUT_PORTS_START( slqz3 ) + PORT_INCLUDE(mahjong_test) + PORT_INCLUDE(slqz3_dip_switches) + + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) // 功能 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // 押注 + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) // 开始 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) // 摸/舍 +INPUT_PORTS_END - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) // maybe start? +INPUT_PORTS_START( qlgs ) + PORT_INCLUDE(igs_mahjong_matrix) + + PORT_START("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 測試 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 査帳 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Clear") // 清除 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // 投幣 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // 功能 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // 押注 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // 摸捨 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 開始 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // 投幣 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Hopper Switch") // 哈巴 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + + PORT_START("PLAYER") + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_TILT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Hopper Switch") // 哈巴 + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0ff80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Clear") // 清除 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退幣 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No." ) PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副機编號 + PORT_DIPSETTING( 0x1f, "1" ) + PORT_DIPSETTING( 0x1e, "2" ) + PORT_DIPSETTING( 0x1d, "3" ) + PORT_DIPSETTING( 0x1c, "4" ) + PORT_DIPSETTING( 0x1b, "5" ) + PORT_DIPSETTING( 0x1a, "6" ) + PORT_DIPSETTING( 0x19, "7" ) + PORT_DIPSETTING( 0x18, "8" ) + PORT_DIPSETTING( 0x17, "9" ) + PORT_DIPSETTING( 0x16, "10" ) + PORT_DIPSETTING( 0x15, "11" ) + PORT_DIPSETTING( 0x14, "12" ) + PORT_DIPSETTING( 0x13, "13" ) + PORT_DIPSETTING( 0x12, "14" ) + PORT_DIPSETTING( 0x11, "15" ) + PORT_DIPSETTING( 0x10, "16" ) + PORT_DIPSETTING( 0x0f, "17" ) + PORT_DIPSETTING( 0x0e, "18" ) + PORT_DIPSETTING( 0x0d, "19" ) + PORT_DIPSETTING( 0x0c, "20" ) + PORT_DIPSETTING( 0x0b, "20" ) // 20 is maximum no. - all other settings are the same + PORT_DIPSETTING( 0x0a, "20" ) + PORT_DIPSETTING( 0x09, "20" ) + PORT_DIPSETTING( 0x08, "20" ) + PORT_DIPSETTING( 0x07, "20" ) + PORT_DIPSETTING( 0x06, "20" ) + PORT_DIPSETTING( 0x05, "20" ) + PORT_DIPSETTING( 0x04, "20" ) + PORT_DIPSETTING( 0x03, "20" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "20" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作方式 + PORT_DIPSETTING( 0x01, "Mahjong" ) // 麻將 + PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖桿 + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:2") // 示範音樂 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x02, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x04, 0x00, "Link Mode" ) PORT_DIPLOCATION("SW2:3") // 連線模式 + PORT_DIPSETTING( 0x00, "Offline Version" ) // 離線版 + PORT_DIPSETTING( 0x04, "Online Version" ) // 連線版 + PORT_DIPNAME( 0x08, 0x08, "Show Title" ) PORT_DIPLOCATION("SW2:4") // 機種名 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 (game title not shown) + PORT_DIPSETTING( 0x08, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) INPUT_PORTS_END -static INPUT_PORTS_START( qlgs ) - PORT_INCLUDE(base) +INPUT_PORTS_START( lhdmg ) + PORT_INCLUDE(mahjong_kbd) + PORT_INCLUDE(slqz3_dip_switches) + + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 +INPUT_PORTS_END + +INPUT_PORTS_START( lhzb3 ) + PORT_INCLUDE(lhdmg) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x04, 0x04, "Show Title" ) PORT_DIPLOCATION("SW2:3") // 机种名称 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 (game title not shown) + PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) // not shown in test mode +INPUT_PORTS_END + +INPUT_PORTS_START( lhzb4 ) + PORT_INCLUDE( igs_mahjong_matrix ) + + PORT_START("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // S3 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // S2 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // S1 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 开始 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 投币 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + + PORT_START("PLAYER") + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PPIB") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // called JAMMA + PORT_DIPSETTING( 0x00, "Mahjong" ) // called Keyboard + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) // remaining DIP switches not shown in test mode + 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" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( lthy ) + PORT_INCLUDE(mahjong_kbd_joy) + + PORT_MODIFY("TEST") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No." ) PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机编号 + PORT_DIPSETTING( 0x1f, "1" ) + PORT_DIPSETTING( 0x1e, "2" ) + PORT_DIPSETTING( 0x1d, "3" ) + PORT_DIPSETTING( 0x1c, "4" ) + PORT_DIPSETTING( 0x1b, "5" ) + PORT_DIPSETTING( 0x1a, "6" ) + PORT_DIPSETTING( 0x19, "7" ) + PORT_DIPSETTING( 0x18, "8" ) + PORT_DIPSETTING( 0x17, "9" ) + PORT_DIPSETTING( 0x16, "10" ) + PORT_DIPSETTING( 0x15, "11" ) + PORT_DIPSETTING( 0x14, "12" ) + PORT_DIPSETTING( 0x13, "13" ) + PORT_DIPSETTING( 0x12, "14" ) + PORT_DIPSETTING( 0x11, "15" ) + PORT_DIPSETTING( 0x10, "16" ) + PORT_DIPSETTING( 0x0f, "17" ) + PORT_DIPSETTING( 0x0e, "18" ) + PORT_DIPSETTING( 0x0d, "19" ) + PORT_DIPSETTING( 0x0c, "20" ) + PORT_DIPSETTING( 0x0b, "20" ) // 20 is maximum no. - all other settings are the same + PORT_DIPSETTING( 0x0a, "20" ) + PORT_DIPSETTING( 0x09, "20" ) + PORT_DIPSETTING( 0x08, "20" ) + PORT_DIPSETTING( 0x07, "20" ) + PORT_DIPSETTING( 0x06, "20" ) + PORT_DIPSETTING( 0x05, "20" ) + PORT_DIPSETTING( 0x04, "20" ) + PORT_DIPSETTING( 0x03, "20" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "20" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作模式 + PORT_DIPSETTING( 0x01, "Mahjong" ) // 按键 + PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 揺杆 + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:2") // 示范音乐 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x02, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x04, 0x04, "Show Title" ) PORT_DIPLOCATION("SW2:3") // 机种名称 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 (game title not shown) + PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x08, 0x00, "Link Feature" ) PORT_DIPLOCATION("SW2:4") // 连线功能 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 关 + PORT_DIPSETTING( 0x08, DEF_STR(On) ) // 开 + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( zhongguo ) + PORT_INCLUDE(mahjong_kbd_joy) + + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 + PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) + PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x01, DEF_STR(1C_3C) ) + PORT_DIPSETTING( 0x00, DEF_STR(1C_5C) ) + PORT_DIPNAME( 0x0c, 0x0c, "Key-In Rate" ) PORT_DIPLOCATION("SW1:3,4") // 开分比率 + PORT_DIPSETTING( 0x0c, "10" ) + PORT_DIPSETTING( 0x08, "20" ) + PORT_DIPSETTING( 0x04, "50" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x10, 0x10, "Credit Limit" ) PORT_DIPLOCATION("SW1:5") // 进分上限 + PORT_DIPSETTING( 0x10, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x20, 0x20, "Credit Mode" ) PORT_DIPLOCATION("SW1:6") // 进分上方式 (sets coin input function) + PORT_DIPSETTING( 0x20, "Coin Acceptor" ) // 投币 (uses coin A rate) + PORT_DIPSETTING( 0x00, "Key-In" ) // 开分 (uses key-in rate) + PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW1:7") // 退分上方式 + PORT_DIPSETTING( 0x40, "Return Coins" ) // 退币 (uses hopper to pay out credits) + PORT_DIPSETTING( 0x00, "Key-Out" ) // 洗分 (just clears credits) + PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:8") // 示范音乐 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x80, DEF_STR(On) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作模式 + PORT_DIPSETTING( 0x01, "Mahjong" ) // 按键 + PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖杆 + PORT_DIPNAME( 0x06, 0x06, "Card Display" ) PORT_DIPLOCATION("SW2:2,3") // 扑克画面 + PORT_DIPSETTING( 0x06, "Small Cards" ) // 小扑克 + PORT_DIPSETTING( 0x04, "Cards" ) // 扑克 + PORT_DIPSETTING( 0x02, "Alternate" ) // 変异 (numbers with coloured dot patterns for suits) + PORT_DIPSETTING( 0x00, "Small Cards" ) // 小扑克 + PORT_DIPNAME( 0x08, 0x08, "Double Up Jackpot" ) PORT_DIPLOCATION("SW2:4") // 比倍爆机 + PORT_DIPSETTING( 0x08, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x10, 0x10, "Double Up Function" ) PORT_DIPLOCATION("SW2:5") // 比倍功能 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x10, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x20, 0x20, "Double Up/Continue Play" ) PORT_DIPLOCATION("SW2:6") // 比倍续玩 + PORT_DIPSETTING( 0x20, "Double Up" ) // 比倍 + PORT_DIPSETTING( 0x00, "Continue Play" ) // 续玩 + PORT_DIPNAME( 0x40, 0x40, "Credit Display" ) PORT_DIPLOCATION("SW2:7") // 萤屏计分 + PORT_DIPSETTING( 0x40, "Numbers" ) // 数字 (text and digits) + PORT_DIPSETTING( 0x00, "Circle Tiles" ) // 筒子 (pigs for credits, apples for bet, mahjong tong tiles for numbers) + PORT_DIPNAME( 0x80, 0x80, "Hidden Function" ) PORT_DIPLOCATION("SW2:8") // 隐分功能 (hides credits and bets, game plays normally) + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 +INPUT_PORTS_END + +INPUT_PORTS_START( mgzz ) + PORT_INCLUDE(mahjong_kbd_joy) + + // TODO: missing HP input shown in test mode for joystick mode + + PORT_MODIFY("KEY4") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // TODO: default assignment clashes with mahjong I, using it hangs waiting for hopper to respond + + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Allow_Continue) ) PORT_DIPLOCATION("SW1:1") // 續玩遊戲 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x01, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x02, 0x02, "Control Panel" ) PORT_DIPLOCATION("SW1:2") // 操作方式 + PORT_DIPSETTING( 0x02, "Mahjong" ) // 按鍵 (called "MAHJONG" in input test) + PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖桿 (called "JAMMA" in input test) + PORT_DIPNAME( 0x04, 0x04, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:3") // 示範音樂 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x18, 0x18, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:4,5") // 投币比率 + PORT_DIPSETTING( 0x00, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x08, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x10, DEF_STR(1C_5C) ) + PORT_DIPSETTING( 0x18, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x60, 0x60, "Key-In Rate" ) PORT_DIPLOCATION("SW1:6,7") // 开分比率 + PORT_DIPSETTING( 0x60, "50" ) + PORT_DIPSETTING( 0x40, "100" ) + PORT_DIPSETTING( 0x20, "200" ) + PORT_DIPSETTING( 0x00, "500" ) + PORT_DIPNAME( 0x80, 0x80, "Credit Limit" ) PORT_DIPLOCATION("SW1:8") // 进分上限 + PORT_DIPSETTING( 0x80, "5000" ) + PORT_DIPSETTING( 0x00, "10000" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") // 最小押注 + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "30" ) + PORT_DIPSETTING( 0x00, "50" ) + PORT_DIPNAME( 0x04, 0x04, "Continue Immediately" ) PORT_DIPLOCATION("SW2:3") // 直接續玩 + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) // remaining DIP switches not shown in test mode + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( mgzza ) + PORT_INCLUDE(mgzz) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x04, 0x00, "Link Mode" ) - PORT_DIPSETTING( 0x04, "Linked" ) - PORT_DIPSETTING( 0x00, "Standalone" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) // not shown in test mode +INPUT_PORTS_END + +INPUT_PORTS_START( mgcs3 ) + PORT_INCLUDE(igs_mahjong_matrix) + + PORT_START("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 査帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // S3 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // S2 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // S1 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 开始 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // 投币 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + + PORT_START("PLAYER") + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PPIB") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") // 示范音乐 + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + 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" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 配线方式 + PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 娱乐 + PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻将 + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( cjddz ) + PORT_INCLUDE(igs_mahjong_matrix) + + PORT_START("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 査帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // S3 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // S2 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // S1 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 开始 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) // 投币 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + + PORT_START("PLAYER") + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PPIB") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") // 示范音乐 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x01, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x02, 0x02, "Control Panel" ) PORT_DIPLOCATION("SW1:2") // 配线方式 + PORT_DIPSETTING( 0x02, DEF_STR(Joystick) ) // 娱乐 + PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻将 + PORT_DIPNAME( 0x04, 0x04, DEF_STR(Allow_Continue) ) PORT_DIPLOCATION("SW1:3") // 续玩游戏 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x08, 0x08, "Alarm Sound" ) PORT_DIPLOCATION("SW1:4") // 报警音效 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x08, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x10, 0x10, "Auto Pass" ) PORT_DIPLOCATION("SW1:5") // 自动PASS + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x10, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( oceanpara ) + PORT_INCLUDE(three_reel) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x01, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Non-Stop" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x04, 0x04, "Record Password" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x04, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Odds Table" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x08, DEF_STR(Yes) ) + PORT_DIPNAME( 0x10, 0x10, "Auto Take" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x20, 0x20, "Double-Up Game" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x20, DEF_STR(On) ) + PORT_DIPNAME( 0xc0, 0xc0, "Double-Up Game Type" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "Poker 1" ) + PORT_DIPSETTING( 0x80, "Poker 2" ) + PORT_DIPSETTING( 0x40, "Symbol" ) + PORT_DIPSETTING( 0x00, "Symbol" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Chance Level" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR(Low) ) + PORT_DIPSETTING( 0x00, DEF_STR(High) ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( oceanpar ) + PORT_INCLUDE(oceanpara) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x06, 0x06, "Score Box" ) PORT_DIPLOCATION("SW2:2,3") + PORT_DIPSETTING( 0x06, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPSETTING( 0x02, "10 Times" ) + PORT_DIPSETTING( 0x00, "10 Times" ) + PORT_DIPNAME( 0x08, 0x08, "Play Score" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) +INPUT_PORTS_END + +INPUT_PORTS_START( fruitpara ) + PORT_INCLUDE(oceanpara) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x02, 0x02, "Score Box" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "Play Score" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) +INPUT_PORTS_END + +INPUT_PORTS_START( tripslot ) + PORT_START("PORTB") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) // shows DIP switch settings + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) // also provides access to game setup (coinage, etc.) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Stop Reel 4 / Take Score") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) // also provides access to game setup (coinage, etc.) + PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) // shows DIP switch settings + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Stop Reel 2 / Double Up") + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP5 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Stop Reel 5 / Bet") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Start / Stop All Reels") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_NAME("Stop Reel 1 / Big") + + PORT_START("PLAYER") + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Start / Stop All Reels") + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Stop Reel 1 / Big") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Stop Reel 2 / Double Up") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Stop Reel 4 / Take Score") + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_SLOT_STOP5 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_NAME("Stop Reel 5 / Bet") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0x0ff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) + PORT_BIT( 0xe0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PPIB") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin 1 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // key-in + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // coin 2 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<3>) // coin 2 + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<4>) // hopper + + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin 1 + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<4>) // key-out + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + + PORT_START("MISC") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + // bit 5 does something as well + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Language) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR(English) ) + PORT_DIPSETTING( 0x00, DEF_STR(Spanish) ) + PORT_DIPNAME( 0x02, 0x02, "Wiring Diagram" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, "36+10" ) + PORT_DIPSETTING( 0x00, "28-pin" ) + 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" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( chessc2 ) + // preliminary - game seems to lack an input test and settings are locked out with password + + PORT_START("PORTB") + PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PLAYER") + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0xfff00, 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" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) INPUT_PORTS_END -static INPUT_PORTS_START( amazonia ) +INPUT_PORTS_START( amazonia ) PORT_INCLUDE(base) PORT_MODIFY("DSW1") @@ -370,71 +1460,182 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_state::interrupt) int scanline = param; if (scanline == 240 && m_igs017_igs031->get_irq_enable()) - m_maincpu->pulse_input_line(ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); // source? + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); // source? if (scanline == 0 && m_igs017_igs031->get_nmi_enable()) - m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); // vbl? + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); // vbl? +} + + +template +u8 igs_m027_state::dsw_r() +{ + u8 data = 0xff; + + for (int i = First; i < m_io_dsw.size(); i++) + if (!BIT(m_io_select[Select], i - First)) + data &= m_io_dsw[i].read_safe(0xff); + + return data; +} + +template +u8 igs_m027_state::kbd_r() +{ + u8 data = 0xff; + + for (int i = 0; i < 5; i++) + if (!BIT(m_io_select[Select], i + S)) + data &= m_io_kbd[i].read_safe(0xff); + + return (data << R) | (data >> (8 - R)); +} + + +template +void igs_m027_state::io_select_w(u8 data) +{ + m_io_select[Select] = data; +} + + +u32 igs_m027_state::external_rom_r(offs_t offset) +{ + return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; } -u8 igs_m027_state::ppi_porta_r() + +void igs_m027_state::xor_table_w(offs_t offset, u8 data) { - logerror("%s: ppi_porta_r\n", machine().describe_context()); - return 0xff; + m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); } -u8 igs_m027_state::ppi_portb_r() + +// I/O? maybe serial? + +template +void igs_m027_state::lamps_w(u8 data) { - logerror("%s: ppi_portb_r\n", machine().describe_context()); - return m_portb->read(); + // active high outputs + // +------+-------------------------------+-------------------------------+---------------+ + // | lamp | jking02 | tripslot | oceanpar | + // | +---------------+---------------+---------------+---------------+ | + // | | 36+10 | 28-Pin | 36+10 | 28-Pin | | + // +------+---------------+---------------+---------------+---------------+---------------+ + // | 1 | stop 4/start | | start | | start | + // | 2 | stop 3/small | | stop 3/small | | stop 2/small | + // | 3 | bet | | stop 5/bet | | bet | + // | 4 | stop 1/take | | stop 4/take | | stop 3/take | + // | 5 | stop 2/double | | stop 2/double | | stop 1/double | + // | 6 | stop all/big | | stop 1/big | | stop all/big | + // | 7 | | | | | | + // | 8 | | | | | | + // | 9 | | bet | | stop 5/bet | | + // | 10 | | start | | start | | + // | 11 | | | | | | + // | 12 | | stop 1/take | | stop 1/big | | + // | 13 | | stop 2/big | | stop 2/double | | + // | 14 | | stop 4/double | | stop 4/take | | + // | 15 | | stop 3/small | | stop 3/small | | + // | 16 | | | | | | + // +------+---------------+---------------+---------------+---------------+---------------+ + for (unsigned i = 0; 8 > i; ++i) + m_out_lamps[Start + i] = BIT(data, i); } -u8 igs_m027_state::ppi_portc_r() +void igs_m027_state::mahjong_output_w(u8 data) { - logerror("%s: ppi_portc_r\n", machine().describe_context()); - return m_portc->read(); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per coin accepted or key-in + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // one pulse per coin paid out by key-out + if (m_hopper) + m_hopper->motor_w(BIT(data, 2)); + m_oki->set_rom_bank(data >> 6); } +void igs_m027_state::jking02_output_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per coin 1 accepted (36+10) + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per key-in accepted (36+10) + machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); // one pulse per coin 2 accepted (36+10) + machine().bookkeeping().coin_counter_w(3, BIT(data, 4)); // one pulse per key-out (36+10) + machine().bookkeeping().coin_counter_w(4, BIT(data, 5)); // one pulse per coin accepted (28-pin) + machine().bookkeeping().coin_counter_w(5, BIT(data, 6)); // one pulse per key-out (28-pin) + // no key-in counter for 28-pin wiring diagram? +} -void igs_m027_state::dsw_io_select_w(u32 data) +void igs_m027_state::oceanpar_output_w(u8 data) { - m_dsw_io_select = data; + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per COINA accepted + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per KEYIN accepted + machine().bookkeeping().coin_counter_w(1, BIT(data, 2)); // one pulse per COINC accepted + machine().bookkeeping().coin_counter_w(3, BIT(data, 6)); // one pulse per KEYOUT + m_hopper->motor_w(BIT(data, 7)); } +void igs_m027_state::tripslot_misc_w(u8 data) +{ + m_io_misc->write(data); + m_io_select[0] = (BIT(data, 5) << 2) | (m_io_select[0] & 0x03); + m_oki->set_rom_bank(m_io_select[0]); +} -// IO? maybe serial? +void igs_m027_state::tripslot_okibank_low_w(u8 data) +{ + m_io_select[0] = (m_io_select[0] & 0x04) | (data & 0x03); + m_oki->set_rom_bank(m_io_select[0]); +} -void igs_m027_state::unk2_w(u32 data) +void igs_m027_state::oki_128k_bank_w(u8 data) { - logerror("%s: unk2_w %08x\n", machine().describe_context(), data); - m_unk2_write_count++; + for (int i = 0; i < m_okibank.size(); i++) + { + if (m_okibank[i]) + m_okibank[i]->set_entry(BIT(data, i * 4, 4)); + } } -u32 igs_m027_state::unk2_r() +u32 igs_m027_state::slqz3_gpio_r() { - logerror("%s: unk2_r\n", machine().describe_context()); + logerror("%s: slqz3_gpio_r\n", machine().describe_context()); // slqz3 boot check - if (m_unk2_write_count & 1) - return 0xffffffff; + if (m_io_select[1] & 1) + return 0xfffff; else - return 0xffffffef; + return 0xffffd; } -u32 igs_m027_state::unk_r() +u32 igs_m027_state::lhdmg_gpio_r() { - // this is accessed as a byte, lower 2 bytes are read? - // slqz3 reads test switch in here? writes to the address look like key matrix? - logerror("%s: unk_r\n", machine().describe_context()); - return 0xffffffff; + logerror("%s: lhdmg_gpio_r\n", machine().describe_context()); + + if (m_io_select[1] & 1) + return 0xfffff; + else + return 0xfffff ^ 0x80000; +} + + +ioport_value igs_m027_state::kbd_ioport_r() +{ + return kbd_r<0, 0, 0>(); +} + +template +void igs_m027_state::counter_w(int state) +{ + machine().bookkeeping().coin_counter_w(N, state); } -void igs_m027_state::igs_mahjong(machine_config &config) +template +void igs_m027_state::m027_noppi(machine_config &config) { - ARM7(config, m_maincpu, 22000000); // Jungle King 2002 has a 22Mhz Xtal, what about the others? - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::igs_mahjong_map); + IGS027A(config, m_maincpu, 22'000'000); // Jungle King 2002 has a 22Mhz Xtal, what about the others? + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::m027_noppi_map); + m_maincpu->out_port().set(FUNC(igs_m027_state::io_select_w<1>)); -// NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -446,21 +1647,214 @@ void igs_m027_state::igs_mahjong(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027_state::interrupt), "screen", 0, 1); - I8255A(config, m_ppi); - m_ppi->in_pa_callback().set(FUNC(igs_m027_state::ppi_porta_r)); - m_ppi->in_pb_callback().set(FUNC(igs_m027_state::ppi_portb_r)); - m_ppi->in_pc_callback().set(FUNC(igs_m027_state::ppi_portc_r)); - - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_text_reverse_bits(); - m_igs017_igs031->set_i8255_tag("ppi8255"); + m_igs017_igs031->set_text_reverse_bits(true); + m_igs017_igs031->in_pa_callback().set(NAME((&igs_m027_state::dsw_r<1, 0>))); + m_igs017_igs031->in_pb_callback().set_ioport("PORTB"); + m_igs017_igs031->in_pc_callback().set_ioport("PORTC"); // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); } +template +void igs_m027_state::m027_1ppi(machine_config &config) +{ + m027_noppi(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::m027_1ppi_map); + + I8255A(config, m_ppi[0]); + m_ppi[0]->tri_pa_callback().set_constant(0x00); + m_ppi[0]->tri_pb_callback().set_constant(0x00); + m_ppi[0]->tri_pc_callback().set_constant(0x00); +} + +template +void igs_m027_state::m027_2ppis(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::m027_2ppis_map); + + I8255A(config, m_ppi[1]); + m_ppi[0]->tri_pa_callback().set_constant(0x00); + m_ppi[0]->tri_pb_callback().set_constant(0x00); + m_ppi[0]->tri_pc_callback().set_constant(0x00); +} + +void igs_m027_state::slqz3(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set(FUNC(igs_m027_state::slqz3_gpio_r)); // what lives here? + + m_ppi[0]->in_pa_callback().set_ioport("TEST"); + m_ppi[0]->in_pb_callback().set_ioport("JOY"); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_constant(0xff); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::qlgs(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append(m_oki, FUNC(okim6295_device::set_rom_bank)).rshift(3); + + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::io_select_w<0>)); + + m_igs017_igs031->in_pb_callback().set_ioport("TEST"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); +} + +void igs_m027_state::lhdmg(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set(FUNC(igs_m027_state::lhdmg_gpio_r)); + + m_ppi[0]->in_pa_callback().set_ioport("TEST"); + m_ppi[0]->out_pb_callback().set(FUNC(igs_m027_state::io_select_w<0>)); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set(NAME((&igs_m027_state::kbd_r<0, 3, 0>))); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::cjddz(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::cjddz_map); + m_maincpu->in_port().set_ioport("PLAYER"); + + m_oki->set_addrmap(0, &igs_m027_state::oki_128k_map); + + //m_ppi[0]->out_pa_callback().set(...); + m_ppi[0]->out_pb_callback().set_ioport("PPIB"); + m_ppi[0]->out_pc_callback().set_ioport("PPIC"); + m_ppi[0]->out_pc_callback().append(FUNC(igs_m027_state::io_select_w<0>)).mask(0x1f); + + m_igs017_igs031->in_pb_callback().set_ioport("TEST"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::lhzb4(machine_config &config) +{ + cjddz(config); + + m_oki->set_clock(2'000'000); +} + +void igs_m027_state::lthy(machine_config &config) +{ + m027_1ppi(config); + + m_ppi[0]->in_pa_callback().set_ioport("TEST"); + m_ppi[0]->in_pb_callback().set(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); +} + +void igs_m027_state::zhongguo(machine_config &config) +{ + lthy(config); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::jking02(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + + m_ppi[0]->out_pa_callback().set(FUNC(igs_m027_state::lamps_w<8>)); + m_ppi[0]->out_pb_callback().set(FUNC(igs_m027_state::jking02_output_w)); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); +} + +void igs_m027_state::mgzz(machine_config &config) +{ + m027_1ppi(config); + + m_ppi[0]->out_pa_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + m_ppi[0]->in_pb_callback().set_ioport("TEST"); + m_ppi[0]->in_pc_callback().set(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::oceanpar(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append(m_oki, FUNC(okim6295_device::set_rom_bank)).rshift(3); + + m_ppi[0]->out_pa_callback().set(m_ticket, FUNC(ticket_dispenser_device::motor_w)).bit(7); + m_ppi[0]->out_pb_callback().set(FUNC(igs_m027_state::oceanpar_output_w)); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); +} + +void igs_m027_state::tripslot(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::tripslot_map); + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append(FUNC(igs_m027_state::tripslot_okibank_low_w)).rshift(3); + + m_ppi[0]->out_pa_callback().set(FUNC(igs_m027_state::lamps_w<8>)); + m_ppi[0]->out_pb_callback().set_ioport("PPIB"); + m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::extradrw(machine_config &config) +{ + m027_2ppis(config); + + //m_ppi[0]->in_pa_callback().set(...); + //m_ppi[0]->in_pb_callback().set(...); + //m_ppi[0]->out_pc_callback().set(...); + + //m_ppi[1]->out_pa_callback().set(...); + //m_ppi[1]->out_pb_callback().set(...); + //m_ppi[1]->in_pc_callback().set(...); +} + +void igs_m027_state::chessc2(machine_config &config) +{ + m027_noppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); +} + + /*************************************************************************** ROMs Loading @@ -469,7 +1863,7 @@ void igs_m027_state::igs_mahjong(machine_config &config) /*************************************************************************** -Mahjong Shuang Long Qiang Zhu 3 +双龙抢珠Ⅲ (Shuāng Lóng Qiǎng Zhū III) IGS, 1999 PCB Layout @@ -501,13 +1895,13 @@ IGS PCB-0239-11-EE ROM_START( slqz3 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "slqz3_027a.bin", 0x00000, 0x4000, CRC(abb8ef8b) SHA1(b8912fe38dc2ff3b1a718e9fe3c76eae30aad7dc) ) // unknown sticker + ROM_LOAD( "s11_027a.bin", 0x00000, 0x4000, CRC(abb8ef8b) SHA1(b8912fe38dc2ff3b1a718e9fe3c76eae30aad7dc) ) ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "u29", 0x000000, 0x200000, CRC(215fed1e) SHA1(c85d8695e0be1044ac206118c3fc0ddc7063aaf6) ) // 11xxxxxxxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "u9", 0x000000, 0x080000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) + ROM_LOAD( "u9", 0x000000, 0x080000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "u18", 0x000000, 0x400000, CRC(81428f18) SHA1(9fb19c8a79cc3443642f4b044e04735df2cb45be) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -550,31 +1944,31 @@ IGS PCB-0331-02-FG ***************************************************************************/ -ROM_START( fruitpar ) +ROM_START( oceanpar ) // IGS PCB-0331-02-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) + ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "fruit_paradise_v214.u23", 0x00000, 0x80000, CRC(e37bc4e0) SHA1(f5580e6007dc60f32efd3b3e7e64c5ee446ede8a) ) + ROM_LOAD( "ocean_paradise_v105us.u23", 0x00000, 0x80000, CRC(e6eb66c3) SHA1(f6c1e31ccddc8ebb8218f52b5c0d97f0797b2e84) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar ROM_END -ROM_START( oceanpar ) // IGS PCB-0331-02-FG +ROM_START( oceanpara ) // IGS PCB-0331-01-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "oceanpar_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "ocean_paradise_v105us.u23", 0x00000, 0x80000, CRC(e6eb66c3) SHA1(f6c1e31ccddc8ebb8218f52b5c0d97f0797b2e84) ) + ROM_LOAD( "ocean_paradise_v101us.u23", 0x00000, 0x80000, CRC(4f2bf87a) SHA1(559c8728632336ba84f455ac22b6e514967c644b) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) @@ -586,29 +1980,66 @@ ROM_START( oceanpar ) // IGS PCB-0331-02-FG ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar ROM_END -ROM_START( oceanpara ) // IGS PCB-0331-01-FG +ROM_START( fruitpar ) // IGS PCB-0331-02-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "oceanpara_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "ocean_paradise_v101us.u23", 0x00000, 0x80000, CRC(4f2bf87a) SHA1(559c8728632336ba84f455ac22b6e514967c644b) ) + ROM_LOAD( "fruit_paradise_v214.u23", 0x00000, 0x80000, CRC(e37bc4e0) SHA1(f5580e6007dc60f32efd3b3e7e64c5ee446ede8a) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) +ROM_END + +ROM_START( fruitpara ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) + + ROM_REGION32_LE( 0x80000, "user1", ROMREGION_ERASEFF ) + ROM_LOAD( "f paradise v-206us.u23", 0x00000, 0x80000, CRC(ee2fa627) SHA1(6e964213e17d7db021ec63c7a1af08f863483369) ) + + ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) +ROM_END + +ROM_START( tripslot ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "v21_027a.bin", 0x00000, 0x4000, CRC(debf0400) SHA1(b359f7d0549005682780d70060a8fc9a4b4b777e) ) // V21 sticker + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "tripleslot_v-200ve.u23", 0x000000, 0x80000, CRC(c1a1ff26) SHA1(866b5cb04069d8dfedda06f7e2fd21b9a03d4b5a) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "tripleslot_text.u12", 0x000000, 0x80000, CRC(c2537d18) SHA1(172cccfb69b814c670f3c1673ccece6eab866fe1) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "tripleslot_ani_cg.u13", 0x000000, 0x400000, CRC(83fc100e) SHA1(8a03e2cb9876a0f61364ad9214ac2a74ceaf7f5e) ) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "tripleslot_sp.u37", 0x00000, 0x200000, CRC(98b9cafd) SHA1(3bf3971f0d9520c98fc6b1c2e77ab9c178d21c62) ) ROM_END // supposedly a reskin of fruitpar / oceanpar, runs on a slightly different PCB (type not readable, seems same as amazonkp) ROM_START( luckycrs ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "luckycrs_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered V21 + // note, despite the sticker still being V21 this is NOT the same as tripslot, XOR table needs to be different at least + ROM_LOAD( "v21_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered V21 ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "luckycross_v-106sa.u23", 0x00000, 0x80000, CRC(5716de00) SHA1(ff68fa93c6801c78f910452c08c5a9c1a089261d) ) // 27C4002 @@ -697,7 +2128,7 @@ Sound Processor ( U6295 ) ROM_START( amazoni2 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "sdwx_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "p9_igs027a", 0x00000, 0x4000, NO_DUMP ) // stamped P9 ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "27c4096_akii_b-202br.u23", 0x000000, 0x80000, CRC(7147b43c) SHA1(29a4a20867595650918c4ab892ddb71440bd3f4b) ) @@ -734,7 +2165,7 @@ ROM_END ROM_START( olympic5 ) // PCB type not readable, layout almost identical to PCB-0367-05-FG-1 ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "olympic5_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered O2 + ROM_LOAD( "o2_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered O2 ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "olympic_5_v-112us.u23", 0x00000, 0x80000, CRC(27743107) SHA1(ddb8fc3645b0d8f8b7348c180951ca212b3a2c03) ) // MX27C4096 @@ -753,7 +2184,7 @@ ROM_END ROM_START( olympic5a ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "olympic5_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered O2 + ROM_LOAD( "o2_igs027a", 0x00000, 0x4000, NO_DUMP ) // stickered O2? ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "olympic_5_v-107us.u23", 0x00000, 0x80000, CRC(3bcd4dd9) SHA1(08e49d9a5045e52a7eb60113f0c7ed25b30474c2) ) // MX27C4096 @@ -777,7 +2208,7 @@ ROM_END ROM_START( sdwx ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "sdwx_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "sdwx_igs027a", 0x00000, 0x4000, NO_DUMP ) // unknown sticker ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "prg.u16", 0x000000, 0x80000, CRC(c94ef6a8) SHA1(69f2f356e05206b0866a9020253d9a112b56316c) ) @@ -795,7 +2226,7 @@ ROM_END ROM_START( klxyj ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "klxyj_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "klxyj_igs027a", 0x00000, 0x4000, NO_DUMP ) // unknown sticker ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "klxyj_104.u16", 0x000000, 0x80000, CRC(8cb9bdc2) SHA1(5a13d0ff6488a938617a9ea89e7cf607539a1f49) ) @@ -817,29 +2248,30 @@ ROM_END // samples at u14 +// 龙虎争霸Ⅲ (Lóng Hǔ Zhēngbà III) ROM_START( lhzb3 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "lhzb3_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "b6_igs027a", 0x00000, 0x4000, CRC(75645f8c) SHA1(738fba64a906f4f10e78e332ad30b8da9dc86b21) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "lhzb3_104.u9", 0x000000, 0x80000, CRC(70d61846) SHA1(662b59702ef6f26129de6b16346786df92f99097) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "lhzb3_text.u17", 0x000000, 0x80000,CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) + ROM_LOAD( "lhzb3_text.u17", 0x000000, 0x80000,CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "m2401.u18", 0x000000, 0x400000, CRC(81428f18) SHA1(9fb19c8a79cc3443642f4b044e04735df2cb45be) ) - ROM_REGION( 0x200000, "unknown", 0 ) + ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "s2402.u14", 0x00000, 0x100000, CRC(56083fe2) SHA1(62afd651809bf5e639bfda6e5579dbf4b903b664) ) ROM_END /********************************************************************************* -Long Hu Da Man Guan, IGS 1999 -Long Hu Da Man Guan Plus, IGS 1999 +龙虎大满贯 (Lóng Hǔ Dà Mǎnguàn), IGS 1999 +龙虎大满贯 (Lóng Hǔ Dà Mǎnguàn Plus), IGS 1999 Both boards are identical and use the same mask ROMs, only with changed program EPROM. @@ -883,13 +2315,13 @@ IGS PCB NO-0240-03 ROM_START( lhdmg ) // appears to be a different edition of lhzb3 and lthy (GFX and sound ROM match) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "b6_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "b6_igs027a", 0x00000, 0x4000, CRC(75645f8c) SHA1(738fba64a906f4f10e78e332ad30b8da9dc86b21) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "lhdmg_prg.u9", 0x000000, 0x80000, CRC(3b3a77ac) SHA1(c1c40e02d04dc701aa65b7e255b9a928cbecdb8d) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "m2403.u17", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) + ROM_LOAD( "m2403.u17", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "m2401.u18", 0x000000, 0x400000, CRC(81428f18) SHA1(9fb19c8a79cc3443642f4b044e04735df2cb45be) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -901,13 +2333,13 @@ ROM_END ROM_START( lhdmgp ) // appears to be a different edition of lhzb3 and lthy (GFX and sound ROM match) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "b4_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "b4_igs027a", 0x00000, 0x4000, CRC(6fd48959) SHA1(75cb6fc6ea3c36805d1a61536e2f2476942c0c49) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "lhdmg_plus_prg.u9", 0x000000, 0x80000, CRC(77dd7855) SHA1(f04995ee34ef9245dcf3d66fcf111fa377394f92) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "m2403.u17", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) + ROM_LOAD( "m2403.u17", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "m2401.u18", 0x000000, 0x400000, CRC(81428f18) SHA1(9fb19c8a79cc3443642f4b044e04735df2cb45be) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -919,7 +2351,7 @@ ROM_END /* -Zhong Guo Chu Da D +中国锄大D (Zhōngguó Chú Dà D) IGS, 2000 PCB Layout @@ -951,7 +2383,7 @@ IGS PCB NO-0267 W24257 - Winbond 32kx8 SRAM (SOJ28) Custom ICs - IGS027A - ARM7/9? based CPU (QFP120, labelled 'J8') - IGS033 - likely GFX processor. Appears to be linked to the 3.6V battery. However, + IGS031 - likely GFX processor. Appears to be linked to the 3.6V battery. However, the battery was dead and the PCB still works, so maybe the battery is not used? (QFP208) ROMs - P2600.U10 - 27C4096 EPROM, Main program @@ -965,13 +2397,13 @@ IGS PCB NO-0267 ROM_START( zhongguo ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "zhongguo_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "j8_igs027a", 0x00000, 0x4000, CRC(95c51462) SHA1(818aad8ac25355950ba00438d0eecf58f0a17d8a) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "p2600.u10", 0x000000, 0x80000, CRC(9ad34135) SHA1(54717753d1296efe49946369fd4a27181f19dbc0) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "t2604.u9", 0x000000, 0x80000, CRC(5401a52d) SHA1(05b47a4b39939c1d5904e3fbd5cc56d6ee9b7953) ) + ROM_LOAD( "t2604.u9", 0x000000, 0x80000, CRC(5401a52d) SHA1(05b47a4b39939c1d5904e3fbd5cc56d6ee9b7953) ) ROM_REGION( 0x480000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "m2601.u17", 0x000000, 0x400000, CRC(89736e3f) SHA1(6a22e2eb10d2c740cf21640c43a8caf4c72d3be7) ) @@ -983,16 +2415,17 @@ ROM_END -ROM_START( mgfx ) +// 满贯至尊 (Mǎnguàn Zhìzūn) +ROM_START( mgzz ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "mgfx_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "f1_027a.bin", 0x00000, 0x4000, CRC(4b270edb) SHA1(3b4821f7cb785056809c121e6508348df123bfa1) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "mgfx_101.u10", 0x000000, 0x80000, CRC(897c88a1) SHA1(0f7a7808b9503ff28ad32c0b8e071cb24cff59b1) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "mgfx_text.u9", 0x000000, 0x80000, CRC(e41e7768) SHA1(3d0add7c75c23533309e799fd8853c815e6f811c) ) + ROM_LOAD( "mgfx_text.u9", 0x000000, 0x80000, CRC(e41e7768) SHA1(3d0add7c75c23533309e799fd8853c815e6f811c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "mgfx_ani.u17", 0x000000, 0x400000, CRC(9fc75f4d) SHA1(acb600739dcf252a5210e28ec96d749573061b27) ) @@ -1002,7 +2435,8 @@ ROM_START( mgfx ) ROM_END -ROM_START( mgzz ) // IGS PCB 0295-00 (IGS027A, M6295, IGS031, 8255, Battery) +// 满贯至尊 (Mǎnguàn Zhìzūn) +ROM_START( mgzza ) // IGS PCB 0295-00 (IGS027A, M6295, IGS031, 8255, Battery) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU ROM_LOAD( "f1_027a.bin", 0x00000, 0x4000, CRC(4b270edb) SHA1(3b4821f7cb785056809c121e6508348df123bfa1) ) @@ -1011,7 +2445,7 @@ ROM_START( mgzz ) // IGS PCB 0295-00 (IGS027A, M6295, IGS031, 8255, Battery) ROM_LOAD( "v-100cn.u10", 0x000000, 0x80000, CRC(278964f7) SHA1(75e48e3124d038f16f93fe3c1f63dd1568f0c018) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "text.u9", 0x000000, 0x80000, CRC(10792638) SHA1(ae5d93659140252da332a3dd03cb188ddf79ad5a) ) + ROM_LOAD( "text.u9", 0x000000, 0x80000, CRC(10792638) SHA1(ae5d93659140252da332a3dd03cb188ddf79ad5a) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "cg.u17", 0x000000, 0x400000, CRC(1643fa78) SHA1(4c08b62d3dd7171a9ad3182634f66befa82cb581) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -1020,9 +2454,10 @@ ROM_START( mgzz ) // IGS PCB 0295-00 (IGS027A, M6295, IGS031, 8255, Battery) ROM_LOAD( "sp.u14", 0x00000, 0x80000, CRC(f037952e) SHA1(0fa83e164937c9e8245861da7fd11f225525918d) ) ROM_END + /********************************************************************************* -Long Teng Hu Yue, IGS 1999 +龙腾虎跃 (Lóng Téng Hǔ Yuè), IGS 1999 PCB Layout ---------- @@ -1059,13 +2494,13 @@ IGS PCB-0227-03 ROM_START( lthy ) // appears to be a different edition of lhzb3 (GFX and sound ROM match) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "d6_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "d6_igs027a", 0x00000, 0x4000, CRC(b29ee32b) SHA1(aa5f1f8ed8d61dd328c4c28a7bba700935526d26) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "27c4096.u10", 0x000000, 0x80000, CRC(bd04f2e9) SHA1(3d5a2101c7214a37f159e0d17f3e66a9b6ab94ff) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "27c4096.u9", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) + ROM_LOAD( "27c4096.u9", 0x000000, 0x80000, CRC(a82398a9) SHA1(4d2987f57096b7f24ce6571ed3be6dcb33bce88d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "m2401.u17", 0x000000, 0x400000, CRC(81428f18) SHA1(9fb19c8a79cc3443642f4b044e04735df2cb45be) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -1141,7 +2576,7 @@ IGS 0027 - Custom programmed ARM9 ROM_START( gonefsh2 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "gonefsh2_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "gonefsh2_igs027a", 0x00000, 0x4000, NO_DUMP ) // unknown sticker ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "gfii_v-904uso.u12", 0x000000, 0x80000, CRC(ef0f6735) SHA1(0add92599b0989f3e50dc64e32ce234b4bd87d33) ) @@ -1214,7 +2649,7 @@ V3021 - Micro Electronic Ultra Low Power 1-Bit 32kHz RTC (Real Time Clock) SW4 - Toggle switch JP11 - 4 Pin header (HD4-156) -IGS 025 - Custom programmed A8B1723(?) +IGS 025 - Custom programmed A8B1723(?) - stickered S1 IGS 0027 - Custom programmed ARM9 */ @@ -1222,7 +2657,7 @@ IGS 0027 - Custom programmed ARM9 ROM_START( chessc2 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "chessc2_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "c8_027a.bin", 0x00000, 0x4000, CRC(0ef83d8b) SHA1(31ee4bf95561cdccf4262463545839bcde9ce087) ) // stickered C8 ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "ccii_v-707uso.u12", 0x000000, 0x80000, CRC(5937b67b) SHA1(967b3adf6f5bf92d63ec460d595e473898a78372) ) @@ -1243,10 +2678,11 @@ ROM_END // cg at u28 // samples at u4 (or u5?) -ROM_START( sddz ) +// 超级斗地主 (Chāojí Dòu Dìzhǔ) +ROM_START( cjddz ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "sddz_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "cjddz_igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) // unknown sticker ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "ddz_218cn.u17", 0x000000, 0x80000, CRC(3cfe38d5) SHA1(9c7f82ecffbc22879583519d5f753bb35e973ee3) ) @@ -1257,14 +2693,17 @@ ROM_START( sddz ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) - ROM_REGION( 0x200000, "samples", 0 ) // samples, but not OKI? possibly ICS? + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "ddz_sp.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END +// 龙虎争霸4 (Lóng Hǔ Zhēngbà 4) ROM_START( lhzb4 ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "lhzb4_igs027a", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "lhzb4_igs027a", 0x00000, 0x4000, CRC(de12c918) SHA1(87c1cf92a95565d78c6fe7629c19729f5fb5c2a5) ) // unknown sticker ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "lhzb4_104.u17", 0x000000, 0x80000, CRC(6f349bbb) SHA1(54cf895889ef0f208637ba732ede696ca3603ee0) ) @@ -1275,11 +2714,13 @@ ROM_START( lhzb4 ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "a05501.u28", 0x000000, 0x400000, CRC(f78b3714) SHA1(c73d8e50b04126bc4f91783384713624ed133ee2) ) - ROM_REGION( 0x200000, "samples", 0 ) // samples, but not OKI? possibly ICS? + // OKI, sample tables are every 0x20000 starting at 0x140000 + ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "w05502.u5", 0x00000, 0x200000, CRC(467f677e) SHA1(63927c0d606176c0e22db89ea3a9777ed702abbd) ) ROM_END -// Que Long Gao Shou (Master on Mahjong Dragon) (IGS, 1999) - PCB-0489-17-FM-1 (IGS027A, M6295, IGS031, 8255, Battery) +// 雀龙高手 (Què Lóng Gāoshǒu) (IGS, 1999) +// PCB-0489-17-FM-1 (IGS027A, M6295, IGS031, 8255, Battery) ROM_START( qlgs ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU @@ -1298,6 +2739,8 @@ ROM_START( qlgs ) ROM_LOAD( "sp_u5.u5", 0x00000, 0x200000, CRC(6049b892) SHA1(f87285a288bd3fd169080045f70ff15181661582) ) // 11xxxxxxxxxxxxxxxxxxx = 0x00 ROM_END + +// 满贯财神3 (Mǎnguàn Cáishén 3) // PCB-0489-15-FM-1 (IGS027A, M6295, IGS031, 8255, Battery) - same PCB as qlgs ROM_START( mgcs3 ) ROM_REGION( 0x04000, "maincpu", 0 ) @@ -1320,17 +2763,20 @@ ROM_END ROM_START( extradrw ) // IGS PCB 0326-05-DV-1 ROM_REGION( 0x04000, "maincpu", 0 ) // Internal rom of IGS027A ARM based MCU - ROM_LOAD( "extradrw_igs027a", 0x00000, 0x4000, NO_DUMP ) // has a 'E1' sticker + ROM_LOAD( "e1_027a.bin", 0x00000, 0x4000, CRC(ebbf4922) SHA1(d2d196756317523db650bfe9e4bf2aa243e87a00) ) // has a 'E1' sticker - ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg? - ROM_LOAD( "u21", 0x00000, 0x80000, CRC(c1641b14) SHA1(bd2525a5b38d4d8a39e99e43ef62e1d2fd3c044d) ) // 1ST AND 2ND HALF IDENTICAL, label not readable, suspected bad dump (doesn't decrypt with usual methods) + ROM_REGION32_LE( 0x80000, "user1", ROMREGION_ERASEFF ) // external ARM data / prg + // has been seen on boards with an unlabeled chip that is double the size, with data doubled up (CRC(c1641b14) SHA1(bd2525a5b38d4d8a39e99e43ef62e1d2fd3c044d)) + ROM_LOAD( "extradraw_v100ve.u21", 0x00000, 0x40000, CRC(d83c1975) SHA1(c38bc41e5b5560dc02421fe1770359d9259b5e93) ) + ROM_RELOAD( 0x40000, 0x40000 ) - ROM_REGION( 0x280000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "u12", 0x000000, 0x200000, CRC(642247fb) SHA1(69c01c3551551120a3786522b28a80621a0d5082) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF, label not readable - ROM_LOAD16_WORD_SWAP( "igs m3001.u4", 0x000000, 0x080000, CRC(d161f8f7) SHA1(4b495197895fd805979c5d5c5a4b7f07a68f4171) ) // label barely readable + ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD( "igs_m3004.u4", 0x000000, 0x080000, CRC(d161f8f7) SHA1(4b495197895fd805979c5d5c5a4b7f07a68f4171) ) - ROM_REGION( 0x100000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "u3", 0x000000, 0x80000, CRC(97227767) SHA1(c6a1916c0df1aceafbd488ecace5794390058c49) ) // FIXED BITS (xxxxxxx0xxxxxxxx), label not readable + ROM_REGION( 0x180000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "igs_m3001.u12", 0x000000, 0x100000, CRC(642247fb) SHA1(69c01c3551551120a3786522b28a80621a0d5082) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE(0x100000) + ROM_LOAD( "h2_and_cg.u3", 0x100000, 0x080000, CRC(97227767) SHA1(c6a1916c0df1aceafbd488ecace5794390058c49) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "igs s3002.u18", 0x00000, 0x200000, CRC(48601c32) SHA1(8ef3bad80931f4b1badf0598463e15508602f104) ) // BADADDR --xxxxxxxxxxxxxxxxxxx @@ -1339,13 +2785,13 @@ ROM_END void igs_m027_state::pgm_create_dummy_internal_arm_region() { - u16 *temp16 = (u16 *)memregion("maincpu")->base(); + auto const temp16 = util::little_endian_cast(reinterpret_cast(memregion("maincpu")->base())); // fill with RX 14 for (int i = 0; i < 0x4000 / 2; i += 2) { temp16[i] = 0xff1e; - temp16[ i +1] = 0xe12f; + temp16[i + 1] = 0xe12f; } @@ -1374,39 +2820,18 @@ void igs_m027_state::init_klxyj() pgm_create_dummy_internal_arm_region(); } -void igs_m027_state::init_chessc2() -{ - chessc2_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); -} - void igs_m027_state::init_lhzb4() { lhzb4_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); -} - -void igs_m027_state::init_mgfx() -{ - mgfx_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); -} - -void igs_m027_state::init_lhzb3() -{ - lhzb3_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } -void igs_m027_state::init_sddz() +void igs_m027_state::init_cjddz() { - sddz_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); + cjddz_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } void igs_m027_state::init_gonefsh2() @@ -1419,15 +2844,13 @@ void igs_m027_state::init_gonefsh2() void igs_m027_state::init_zhongguo() { zhongguo_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); + m_igs017_igs031->set_text_reverse_bits(false); } void igs_m027_state::init_slqz3() { slqz3_decrypt(machine()); - //m_igs017_igs031->slqz3_decrypt_tiles(); // none of the existing functions are correct for this - // sprite gfx not encrypted + m_igs017_igs031->set_text_reverse_bits(false); } void igs_m027_state::init_fruitpar() @@ -1440,8 +2863,8 @@ void igs_m027_state::init_fruitpar() void igs_m027_state::init_oceanpar() { oceanpar_decrypt(machine()); - //m_igs017_igs031->sdwx_gfx_decrypt(); - pgm_create_dummy_internal_arm_region(); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } void igs_m027_state::init_amazonia() @@ -1465,17 +2888,17 @@ void igs_m027_state::init_qlgs() m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } + void igs_m027_state::init_mgzz() { mgzz_decrypt(machine()); - m_igs017_igs031->sdwx_gfx_decrypt(); // wrong? - m_igs017_igs031->tarzan_decrypt_sprites(0, 0); + m_igs017_igs031->set_text_reverse_bits(false); } void igs_m027_state::init_mgcs3() { mgcs3_decrypt(machine()); - m_igs017_igs031->sdwx_gfx_decrypt(); // wrong? + m_igs017_igs031->sdwx_gfx_decrypt(); m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } @@ -1490,8 +2913,7 @@ void igs_m027_state::init_jking02() void igs_m027_state::init_lthy() { lthy_decrypt(machine()); - //qlgs_gfx_decrypt(machine()); - pgm_create_dummy_internal_arm_region(); + m_igs017_igs031->set_text_reverse_bits(false); } void igs_m027_state::init_luckycrs() @@ -1510,9 +2932,34 @@ void igs_m027_state::init_olympic5() void igs_m027_state::init_lhdmg() { - //lhdmg_decrypt(machine()); - //qlgs_gfx_decrypt(machine()); - pgm_create_dummy_internal_arm_region(); + lhdmg_decrypt(machine()); + m_igs017_igs031->set_text_reverse_bits(false); +} + +void igs_m027_state::init_tripslot() +{ + tripslot_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); +} + +void igs_m027_state::init_extradrw() +{ + extradrw_decrypt(machine()); + m_igs017_igs031->set_text_reverse_bits(false); +} + +void igs_m027_state::init_chessc2() +{ + chessc2_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); + + // bypass IGS025 'version' check + m_external_rom[0x207d8/4] ^= 0x00000100; + // bypass external ROM checksum + u32 *ROM2 = &memregion("maincpu")->as_u32(); + ROM2[(0x168/4)] ^= 0x10000000; } } // anonymous namespace @@ -1524,30 +2971,38 @@ void igs_m027_state::init_lhdmg() ***************************************************************************/ -GAME( 1999, slqz3, 0, igs_mahjong, base, igs_m027_state, init_slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_IS_SKELETON ) -GAME( 1999, qlgs, 0, igs_mahjong, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gao Shou", MACHINE_IS_SKELETON ) -GAME( 1999, amazonia, 0, igs_mahjong, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_IS_SKELETON ) -GAME( 1999, amazonkp, amazonia, igs_mahjong, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_IS_SKELETON ) -GAME( 1999, fruitpar, 0, igs_mahjong, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_IS_SKELETON ) -GAME( 1999, oceanpar, 0, igs_mahjong, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_IS_SKELETON ) // 1999 copyright in ROM -GAME( 1999, oceanpara, oceanpar, igs_mahjong, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_IS_SKELETON ) // 1999 copyright in ROM -GAME( 1999, lthy, 0, igs_mahjong, base, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_IS_SKELETON ) -GAME( 1999, lhdmg, 0, igs_mahjong, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Man Guan", MACHINE_IS_SKELETON ) -GAME( 1999, lhdmgp, lhdmg, igs_mahjong, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Man Guan Plus", MACHINE_IS_SKELETON ) -GAME( 200?, luckycrs, 0, igs_mahjong, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_IS_SKELETON ) -GAME( 2002, sdwx, 0, igs_mahjong, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_IS_SKELETON ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?) -GAME( 200?, jking02, 0, igs_mahjong, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_IS_SKELETON ) -GAME( 2005, olympic5, 0, igs_mahjong, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_IS_SKELETON ) // IGS FOR V112US 2005 02 14 -GAME( 2003, olympic5a, olympic5, igs_mahjong, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_IS_SKELETON ) // IGS FOR V107US 2003 10 2 -GAME( 2003, amazoni2, 0, igs_mahjong, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_IS_SKELETON ) -GAME( 200?, sddz, 0, igs_mahjong, base, igs_m027_state, init_sddz, ROT0, "IGS", "Super Dou Di Zhu", MACHINE_IS_SKELETON ) -GAME( 2000, zhongguo, 0, igs_mahjong, base, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhong Guo Chu Da D", MACHINE_IS_SKELETON ) -GAME( 200?, lhzb3, 0, igs_mahjong, base, igs_m027_state, init_lhzb3, ROT0, "IGS", "Long Hu Zhengba III", MACHINE_IS_SKELETON ) // 龙虎争霸Ⅲ -GAME( 2004, lhzb4, 0, igs_mahjong, base, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", MACHINE_IS_SKELETON ) // 龙虎争霸4 -GAME( 200?, klxyj, 0, igs_mahjong, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_IS_SKELETON ) -GAME( 2000, mgfx, 0, igs_mahjong, base, igs_m027_state, init_mgfx, ROT0, "IGS", "Man Guan Fu Xing", MACHINE_IS_SKELETON ) -GAME( 200?, gonefsh2, 0, igs_mahjong, base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_IS_SKELETON ) -GAME( 2002, chessc2, 0, igs_mahjong, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_IS_SKELETON ) -GAME( 200?, extradrw, 0, igs_mahjong, base, igs_m027_state, init_qlgs, ROT0, "IGS", "Extra Draw", MACHINE_IS_SKELETON ) -GAME( 2003, mgzz, 0, igs_mahjong, base, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V100CN)", MACHINE_IS_SKELETON ) -GAME( 2007, mgcs3, 0, igs_mahjong, base, igs_m027_state, init_mgcs3, ROT0, "IGS", "Man Guan Caishen 3 (V101CN)", MACHINE_IS_SKELETON ) +// Complete dumps +GAME( 1999, slqz3, 0, slqz3, slqz3, igs_m027_state, init_slqz3, ROT0, "IGS", "Shuang Long Qiang Zhu 3 (China, VS107C)", 0 ) +GAME( 1999, qlgs, 0, qlgs, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gaoshou", MACHINE_NODEVICE_LAN ) +GAME( 1999, lhdmg, 0, lhdmg, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan", 0 ) +GAME( 1999, lhdmgp, lhdmg, lhdmg, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan Plus", 0 ) +GAME( 1999, lhzb3, 0, lhdmg, lhzb3, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Zhengba III", 0 ) +GAME( 2004, lhzb4, 0, lhzb4, lhzb4, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", 0 ) +GAME( 1999, lthy, 0, lthy, lthy, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_NODEVICE_LAN ) +GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D", 0 ) +GAMEL( 200?, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) +GAME( 2003, mgzz, 0, mgzz, mgzz, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 ) +GAME( 2003, mgzza, mgzz, mgzz, mgzza, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 ) +GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 ) +GAMEL( 1999, oceanpar, 0, oceanpar, oceanpar, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", 0, layout_oceanpar ) // 1999 copyright in ROM +GAMEL( 1999, oceanpara, oceanpar, oceanpar, oceanpara,igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", 0, layout_oceanpar ) // 1999 copyright in ROM +GAMEL( 1999, fruitpar, 0, oceanpar, oceanpar, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", 0, layout_oceanpar ) +GAMEL( 1999, fruitpara, fruitpar, oceanpar, fruitpara,igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", 0, layout_oceanpar ) +GAME( 200?, cjddz, 0, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu", 0 ) +GAMEL( 2007, tripslot, 0, tripslot, tripslot, igs_m027_state, init_tripslot, ROT0, "IGS", "Triple Slot (V200VE)", 0, layout_tripslot ) // 2007 date in internal ROM at least, could be later, default settings password is all 'start 1' +// this has a 2nd 8255 +GAME( 2001, extradrw, 0, extradrw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw (V100VE)", MACHINE_NOT_WORKING ) +// these have an IGS025 protection device instead of the 8255 +GAME( 2002, chessc2, 0, chessc2, chessc2, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) + +// Incomplete dumps +GAME( 1999, amazonia, 0, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) +GAME( 1999, amazonkp, amazonia, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING ) +GAME( 2005, olympic5, 0, m027_1ppi, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_NOT_WORKING ) // IGS FOR V112US 2005 02 14 +GAME( 2003, olympic5a, olympic5, m027_1ppi, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_NOT_WORKING ) // IGS FOR V107US 2003 10 2 +GAME( 200?, luckycrs, 0, m027_1ppi, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_NOT_WORKING ) +GAME( 2003, amazoni2, 0, m027_1ppi, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING ) +GAME( 2002, sdwx, 0, m027_1ppi, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?) +GAME( 200?, klxyj, 0, m027_1ppi, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_NOT_WORKING ) +// these have an IGS025 protection device instead of the 8255 +GAME( 200?, gonefsh2, 0, m027_noppi,base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/igs_m027_link.cpp b/src/mame/igs/igs_m027_link.cpp index c356054e52685..1c51357b47353 100644 --- a/src/mame/igs/igs_m027_link.cpp +++ b/src/mame/igs/igs_m027_link.cpp @@ -3,11 +3,17 @@ /* IGS ARM7 (IGS027A) based mahjong / gambling platform(s) with link support -Keeping them separate from igs_m027.cpp for now. +Keeping them separate from igs_m027.cpp and igs017.cpp for now. + +Linking has been verified to work fine on real hardware for both games. + +The two dumped extension games are really similar to mgdh in igs017.cpp code-wise, +you can get them to the wait link screen just by implementing the mgdh's IGS MUX +stuff. ********************************************************************************* -Manguan Caishen, HOST PCB (IGS 1999) +Manguan Caishen 2, HOST PCB (IGS 1999) Cai Jin Shen Long, HOST PCB (IGS 1999) These boards are housed in a metal box. @@ -27,7 +33,7 @@ The PCB has a 62-way connector on it but it not accessible to the outside of the PCB Layout ---------- -IGS PCB 0219-04 (Manguan Caishen, HOST) +IGS PCB 0219-04 (Manguan Caishen 2, HOST) IGS PCB 0219-1 (Cai Jin Shen Long, HOST) |------------------------------------------------------------------| |DIN5 DB9 DB25 | @@ -50,7 +56,7 @@ IGS PCB 0219-1 (Cai Jin Shen Long, HOST) |---------------------------------------| |-----------------| |----| Notes: * - On Cai Jin Shen Long, the V3021 and 32.768kHz crystal are replaced with a ST M48T08 NVRAM (the battery is dead and holds no data). -EPROM.U13 - Manguan Caishen - labelled 'V206CMMBOX' +EPROM.U13 - Manguan Caishen 2 - labelled 'V206CMMBOX' - Cai Jin Shen Long - labelled 'V-106CSM' T518B - Reset IC JP10/11 - 2 pins (each) that get tied together when the key switches on the side of the metal box are locked @@ -58,16 +64,16 @@ EPROM.U13 - Manguan Caishen - labelled 'V206CMMBOX' 62256 - 32kx8-bit SRAM SW1 - 8-position DIP Switch V3021 - NVRAM Battery Supervisor IC - IGS025 - Manguan Caishen - labelled 'S8' + IGS025 - Manguan Caishen 2 - labelled 'S8' - Cai Jin Shen Long - labelled 'S2' - IGS027A - Manguan Caishen - labelled 'Y7' + IGS027A - Manguan Caishen 2 - labelled 'Y7' - Cai Jin Shen Long - labelled 'S2' ********************************************************************************* ********************************************************************************* -Manguan Caishen (Link Version, Extension), IGS 1999 +Manguan Caishen 2 (Link Version, Extension), IGS 1999 Cai Jin Shen Long (Link Version, Extension), IGS 1999 These boards connect to the HOST board running the same game. @@ -119,7 +125,6 @@ IGS PCB 0199-03 (both games same PCB#) #include "pgmcrypt.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "cpu/m68000/m68000.h" #include "machine/nvram.h" #include "machine/timer.h" @@ -157,7 +162,11 @@ class extension_state : public driver_device m_screen(*this, "screen") { } - void extension(machine_config &config); + void cjsll(machine_config &config); + void mgcs2l(machine_config &config); + + void init_cjsll(); + void init_mgcs2l(); protected: virtual void video_start() override; @@ -167,7 +176,12 @@ class extension_state : public driver_device required_device m_igs017_igs031; required_device m_screen; - void extension_map(address_map &map); + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + + void cjsll_map(address_map &map); + void mgcs2l_map(address_map &map); + + void decrypt(); }; @@ -180,12 +194,51 @@ void extension_state::video_start() void host_state::host_map(address_map &map) { map(0x00000000, 0x00003fff).rom(); // Internal ROM - map(0x08000000, 0x0800ffff).rom().region("user1", 0); // Game ROM + map(0x08000000, 0x0800ffff).rom().region("user1", 0); // Game ROM (does it really map here? it appears to be connected indirectly via the 025) + + // TODO: IGS025? + //map(0x28007000, 0x28007000).w(m_igs_mux, FUNC(igs_mux_device::address_w)); + //map(0x28007001, 0x28007001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); } -void extension_state::extension_map(address_map &map) +void extension_state::cjsll_map(address_map &map) { map(0x000000, 0x07ffff).rom(); + map(0x600000, 0x603fff).ram(); + + // TODO: IGS025? + //map(0x876000, 0x876001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + //map(0x876002, 0x876003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); + + map(0xa00000, 0xa0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); + + //map(0xa12001, 0xa12001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void extension_state::mgcs2l_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x600000, 0x603fff).ram(); + + // TODO: IGS025? + //map(0x893000, 0x893001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + //map(0x893002, 0x893003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); + + map(0xa00000, 0xa0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); + + //map(0xa12001, 0xa12001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + + +TIMER_DEVICE_CALLBACK_MEMBER(extension_state::interrupt) +{ + int const scanline = param; + + if (scanline == 240 && m_igs017_igs031->get_irq_enable()) + m_maincpu->set_input_line(1, HOLD_LINE); + + if (scanline == 0 && m_igs017_igs031->get_nmi_enable()) + m_maincpu->set_input_line(3, HOLD_LINE); } @@ -274,10 +327,12 @@ void host_state::host(machine_config &config) IGS025(config, "igs025", 0); } -void extension_state::extension(machine_config &config) +void extension_state::cjsll(machine_config &config) { M68000(config, m_maincpu, 22_MHz_XTAL / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &extension_state::extension_map); + m_maincpu->set_addrmap(AS_PROGRAM, &extension_state::cjsll_map); + + TIMER(config, "scantimer").configure_scanline(FUNC(extension_state::interrupt), "screen", 0, 1); // NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -292,19 +347,25 @@ void extension_state::extension(machine_config &config) IGS025(config, "igs025", 0); IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_text_reverse_bits(); - m_igs017_igs031->set_i8255_tag("ppi8255"); + m_igs017_igs031->set_text_reverse_bits(true); SPEAKER(config, "mono").front_center(); OKIM6295(config, "oki", 22_MHz_XTAL / 22, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); } +void extension_state::mgcs2l(machine_config &config) +{ + cjsll(config), + + m_maincpu->set_addrmap(AS_PROGRAM, &extension_state::mgcs2l_map); +} + -ROM_START( mgcsh ) +ROM_START( mgcs2h ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "y7_027a.bin", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "y7_027a.bin", 0x00000, 0x4000, CRC(3e726eeb) SHA1(41b4e5f8a9d35b82b1a62029b34c1e19e188a3bc) ) ROM_REGION32_LE( 0x10000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "v206cmmbox.u13", 0x00000, 0x10000, CRC(2bfdeeeb) SHA1(c92f8994f75e0eefb4dbf25daa0d62ad72a7ddfa) ) @@ -313,13 +374,13 @@ ROM_END ROM_START( cjslh ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "s2_027a.bin", 0x00000, 0x4000, NO_DUMP ) + ROM_LOAD( "s2_027a.bin", 0x00000, 0x4000, CRC(6be397fd) SHA1(ccd2469995a0b90800e891c39f4b3eaa033783ec) ) ROM_REGION32_LE( 0x10000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "v-106csm.u13", 0x00000, 0x10000, CRC(5b3f3446) SHA1(1d5b9523ac7f221eb7cc2e5db90cc859c640cc18) ) ROM_END -ROM_START( mgcsl ) +ROM_START( mgcs2l ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "p2000.u19", 0x00000, 0x80000, CRC(05a065e8) SHA1(5302fcb272c1561380bce57d840ddb5cc45b9497) ) @@ -347,13 +408,92 @@ ROM_START( cjsll ) ROM_LOAD( "s2002.u22", 0x00000, 0x80000, CRC(9070c8ee) SHA1(43852ae1891b4d6c00a6fbe6a822e49d9e97ee97) ) ROM_END + +// TODO: reduce this monstrosity. Still some imperfections? +void extension_state::decrypt() +{ + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + + for (int i = 0; i < rom_size / 2; i++) + { + u16 x = rom[i]; + + switch (i & 0x5000 / 2) + { + case 0x0000 / 2: + if (!(i & 0x0300 / 2)) + { + if (!(i & 0x0002 / 2)) + x ^= 0x0001; + else + if (!(i & 0x0020 / 2)) + x ^= 0x0001; + } + else + if ((i & 0x0022 / 2) == (0x0022 / 2)) + x ^= 0x0001; + break; + case 0x1000 / 2: + if (i & 0x300 / 2) + { + if ((i & 0x0022 / 2) == (0x0022 / 2)) + x ^= 0x0001; + } + else + { + if ((i & 0x0022 / 2) != (0x0022 / 2)) + x ^= 0x0001; + } + break; + case 0x4000 / 2: + case 0x5000 / 2: if ((i & 0x0022 / 2) == (0x0022 / 2)) x ^= 0x0001; break; + } + + switch (i & 0x6000 / 2) + { + case 0x0000 / 2: if ((i & 0x280 / 2) == (0x280 / 2)) x ^= 0x0800; break; + case 0x2000 / 2: if ((!(i & 0x800 / 2)) && ((i & 0x2c0 / 2) == (0x2c0 / 2))) x ^= 0x0800; break; + case 0x4000 / 2: x ^= 0x0800; break; + case 0x6000 / 2: if ((!(i & 0x800 / 2)) && (i & 0x40 / 2)) x ^= 0x0800; break; + } + + if (i & 0x60000 / 2) + x ^= 0x0100; + + rom[i] = x; + } + + // TODO: tiles are scrambled in a different way from what's already supported, sprites to be verified +} + +void extension_state::init_cjsll() +{ + decrypt(); + + u16 * const rom = (u16 *)memregion("maincpu")->base(); + + // game id check + rom[0x3a994 / 2] = 0x4e71; +} + +void extension_state::init_mgcs2l() +{ + decrypt(); + + u16 * const rom = (u16 *)memregion("maincpu")->base(); + + // game id check + rom[0x3a48e / 2] = 0x4e71; +} + } // anonymous namespace // hosts -GAME( 1999, mgcsh, 0, host, host, host_state, empty_init, ROT0, "IGS", "Manguan Caishen (link version, host)", MACHINE_IS_SKELETON ) -GAME( 1999, cjslh, 0, host, host, host_state, empty_init, ROT0, "IGS", "Cai Jin Shen Long (link version, host)", MACHINE_IS_SKELETON ) +GAME( 1999, mgcs2h, 0, host, host, host_state, empty_init, ROT0, "IGS", "Manguan Caishen 2 (link version, host)", MACHINE_IS_SKELETON ) +GAME( 1999, cjslh, 0, host, host, host_state, empty_init, ROT0, "IGS", "Cai Jin Shen Long (link version, host)", MACHINE_IS_SKELETON ) // extensions -GAME( 1999, mgcsl, 0, extension, extension, extension_state, empty_init, ROT0, "IGS", "Manguan Caishen (link version, extension)", MACHINE_IS_SKELETON ) -GAME( 1999, cjsll, 0, extension, extension, extension_state, empty_init, ROT0, "IGS", "Cai Jin Shen Long (link version, extension)", MACHINE_IS_SKELETON ) +GAME( 1999, mgcs2l, 0, mgcs2l, extension, extension_state, init_mgcs2l, ROT0, "IGS", "Manguan Caishen 2 (link version, extension, S110CN)", MACHINE_IS_SKELETON ) +GAME( 1999, cjsll, 0, cjsll, extension, extension_state, init_cjsll, ROT0, "IGS", "Cai Jin Shen Long (link version, extension, S111CN)", MACHINE_IS_SKELETON ) diff --git a/src/mame/igs/igs_m027xa.cpp b/src/mame/igs/igs_m027xa.cpp index 70dc972ec9c48..a9355bce5755e 100644 --- a/src/mame/igs/igs_m027xa.cpp +++ b/src/mame/igs/igs_m027xa.cpp @@ -6,22 +6,34 @@ IGS ARM7 (IGS027A) based Mahjong / Gambling platform(s) with XA sub-cpu These games use the IGS027A processor. +Triple Fever (V105US) (tripfevb) hangs after paying out tickets, with the MCU +apparently attempting serial communication with something. + */ #include "emu.h" #include "igs017_igs031.h" +#include "igs027a.h" #include "pgmcrypt.h" - -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" -#include "cpu/xa/xa.h" +#include "xamcu.h" #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" +#include "sound/okim6295.h" + #include "screen.h" +#include "speaker.h" + +#include "crzybugs.lh" +#include "tripfev.lh" + +#define LOG_DEBUG (1U << 1) +//#define VERBOSE (LOG_DEBUG) +#include "logmacro.h" namespace { @@ -30,15 +42,21 @@ class igs_m027xa_state : public driver_device public: igs_m027xa_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_igs_mainram(*this, "igs_mainram"), m_maincpu(*this, "maincpu"), m_xa(*this, "xa"), m_ppi(*this, "ppi8255"), m_igs017_igs031(*this, "igs017_igs031"), - m_screen(*this, "screen") + m_oki(*this, "oki"), + m_screen(*this, "screen"), + m_ticket(*this, "ticket"), + m_external_rom(*this, "user1"), + m_io_test(*this, "TEST%u", 0U), + m_io_dsw(*this, "DSW%u", 1U), + m_out_lamps(*this, "lamp%u", 1U) { } void igs_mahjong_xa(machine_config &config); + void igs_mahjong_xa_xor(machine_config &config); void init_crzybugs(); void init_crzybugsj(); @@ -48,35 +66,69 @@ class igs_m027xa_state : public driver_device protected: virtual void machine_start() override; + virtual void machine_reset() override; virtual void video_start() override; private: - optional_shared_ptr m_igs_mainram; - required_device m_maincpu; - required_device m_xa; + required_device m_maincpu; + required_device m_xa; required_device m_ppi; required_device m_igs017_igs031; + required_device m_oki; required_device m_screen; + optional_device m_ticket; + required_region_ptr m_external_rom; + + optional_ioport_array<3> m_io_test; + optional_ioport_array<3> m_io_dsw; + + output_finder<8> m_out_lamps; + + u32 m_xor_table[0x100]; + u8 m_io_select[2]; + + bool m_irq_from_igs031; TIMER_DEVICE_CALLBACK_MEMBER(interrupt); void pgm_create_dummy_internal_arm_region(); - void igs_mahjong_map(address_map &map); + void main_map(address_map &map); + void main_xor_map(address_map &map); - void igs_70000100_w(u32 data); - u32 m_igs_70000100 = 0; + u32 external_rom_r(offs_t offset); - u32 rnd_r() - { - return machine().rand(); - } + void xor_table_w(offs_t offset, u8 data); + + u16 xa_r(offs_t offset, u16 mem_mask); + void xa_w(offs_t offset, u16 data, u16 mem_mask); + + void output_w(u8 data); + void lamps_w(u8 data); + + void xa_irq(int state); + + u32 gpio_r(); + void oki_bank_w(offs_t offset, u8 data); + template u8 dsw_r(); + template void io_select_w(u8 data); }; +void igs_m027xa_state::machine_reset() +{ + m_irq_from_igs031 = false; +} void igs_m027xa_state::machine_start() { - save_item(NAME(m_igs_70000100)); + m_out_lamps.resolve(); + + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); + + save_item(NAME(m_xor_table)); + save_item(NAME(m_io_select)); + + save_item(NAME(m_irq_from_igs031)); } void igs_m027xa_state::video_start() @@ -84,68 +136,317 @@ void igs_m027xa_state::video_start() m_igs017_igs031->video_start(); } -void igs_m027xa_state::igs_70000100_w(u32 data) -{ - m_igs_70000100 = data; -} - - /*************************************************************************** Memory Maps ***************************************************************************/ -void igs_m027xa_state::igs_mahjong_map(address_map &map) +void igs_m027xa_state::main_map(address_map &map) { - map(0x00000000, 0x00003fff).rom(); // Internal ROM map(0x08000000, 0x0807ffff).rom().region("user1", 0); // Game ROM - map(0x10000000, 0x100003ff).ram().share("igs_mainram"); // main RAM for ASIC? - map(0x18000000, 0x18007fff).ram(); + + map(0x18000000, 0x18007fff).ram().mirror(0xf8000).share("nvram"); map(0x38000000, 0x38007fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); - map(0x4000000c, 0x4000000f).r(FUNC(igs_m027xa_state::rnd_r)); + map(0x38008000, 0x38008003).umask32(0x000000ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x38009000, 0x38009003).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x3800c000, 0x3800c003).umask32(0x000000ff).w(FUNC(igs_m027xa_state::oki_bank_w)); - map(0x58000000, 0x580000ff).ram(); // XA? + map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_m027xa_state::xor_table_w)); - map(0x70000100, 0x70000103).w(FUNC(igs_m027xa_state::igs_70000100_w)); + map(0x58000000, 0x58000003).umask32(0x0000ffff).r(m_xa, FUNC(igs_xa_mcu_subcpu_device::response_r)); + map(0x58000000, 0x58000003).w(m_xa, FUNC(igs_xa_mcu_subcpu_device::cmd_w)); +} + +void igs_m027xa_state::main_xor_map(address_map &map) +{ + main_map(map); - map(0x70000200, 0x70000203).ram(); //?????????????? - map(0x50000000, 0x500003ff).nopw(); // uploads XOR table to external ROM here - map(0xf0000000, 0xf000000f).nopw(); // magic registers + map(0x08000000, 0x0807ffff).r(FUNC(igs_m027xa_state::external_rom_r)); // Game ROM } -static INPUT_PORTS_START( base ) + +INPUT_PORTS_START( base ) PORT_START("TEST0") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("TEST1") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC PORT_START("TEST2") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x001ff, IP_ACTIVE_LOW, IPT_UNUSED ) // IGS031 interrupt in bit 8 - see gpio_r + PORT_BIT( 0x00200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("xa", igs_xa_mcu_subcpu_device, irq_r) + PORT_BIT( 0xffc00, IP_ACTIVE_LOW, IPT_UNUSED ) + + 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" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( crzybugs ) + PORT_INCLUDE(base) + + PORT_MODIFY("TEST0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") + + PORT_MODIFY("TEST1") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Stop All Reels") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Ticket") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + + PORT_MODIFY("TEST2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x01, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Non Stop" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x04, 0x04, "Password" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x04, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Odds Table" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x08, DEF_STR(Yes) ) + PORT_DIPNAME( 0x10, 0x10, "Double Up Game" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x10, DEF_STR(On) ) + PORT_DIPNAME( 0x60, 0x60, "Symbol" ) PORT_DIPLOCATION("SW1:6,7") + PORT_DIPSETTING( 0x00, "Both" ) + PORT_DIPSETTING( 0x20, "Both (duplicate)" ) + PORT_DIPSETTING( 0x40, "Fruit" ) + PORT_DIPSETTING( 0x60, "Bug" ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Score Box" ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x00, "10X" ) + PORT_DIPSETTING( 0x01, "10X (duplicate)" ) + PORT_DIPSETTING( 0x02, DEF_STR(Yes) ) + PORT_DIPSETTING( 0x03, DEF_STR(No) ) + PORT_DIPNAME( 0x04, 0x04, "Play Score" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Hand Count" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x30, 0x30, "Hold Pair" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x30, DEF_STR(Off) ) + PORT_DIPSETTING( 0x20, "Regular" ) + PORT_DIPSETTING( 0x10, "Georgia" ) + PORT_DIPSETTING( 0x00, "Georgia (duplicate)" ) + PORT_DIPNAME( 0x40, 0x40, "Auto Hold" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) INPUT_PORTS_END +INPUT_PORTS_START( tripfev ) + PORT_INCLUDE(base) + + PORT_MODIFY("TEST0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP5 ) PORT_NAME("Stop Reel 5 / Play") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Big") + + PORT_MODIFY("TEST1") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Stop All Reels") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Ticket") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + + PORT_MODIFY("TEST2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_NAME("Stop Reel 4 / Take Score") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Double Up") + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x01, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Non Stop" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x04, 0x04, "Password" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Odds Table" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x08, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x30, 0x30, "Score Box" ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x00, "10X" ) + PORT_DIPSETTING( 0x10, "10X (duplicate)" ) + PORT_DIPSETTING( 0x20, DEF_STR(Yes) ) + PORT_DIPSETTING( 0x30, DEF_STR(No) ) + PORT_DIPNAME( 0x40, 0x40, "Play Score" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x40, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x80, 0x80, "Auto Take" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Hand Count" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x06, 0x06, "Hold Pair" ) PORT_DIPLOCATION("SW2:2,3") + PORT_DIPSETTING( 0x06, DEF_STR(Off) ) + PORT_DIPSETTING( 0x04, "Regular" ) + PORT_DIPSETTING( 0x02, "Georgia" ) + PORT_DIPSETTING( 0x00, "Georgia (duplicate)" ) + PORT_DIPNAME( 0x08, 0x08, "Auto Ticket" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) +INPUT_PORTS_END + + +void igs_m027xa_state::output_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per COINA accepted + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per key-in accepted + machine().bookkeeping().coin_counter_w(1, BIT(data, 2)); // one pulse per COINC accepted + // bits 3 and 4 have something to do with counting credits paid out by ticket and key-out + if (m_ticket) + m_ticket->motor_w(BIT(data, 6)); +} + +void igs_m027xa_state::lamps_w(u8 data) +{ + // active high outputs + // +------+----------------+----------------+ + // | lamp | crzybugs | tripfev | + // +------+----------------+----------------+ + // | 1 | start/stop all | start/stop all | + // | 2 | stop 2/small | stop 3/small | + // | 3 | bet | stop 5/play | + // | 4 | stop 3/take | stop 4/take | + // | 5 | stop 1/double | stop 2/double | + // | 6 | big | stop 1/big | + // | 7 | | | + // | 8 | | | + // +------+----------------+----------------+ + for (unsigned i = 0; 8 > i; ++i) + m_out_lamps[i] = BIT(data, i); +} + + +u32 igs_m027xa_state::gpio_r() +{ + u32 ret = m_io_test[2].read_safe(0xfffff); + if (m_irq_from_igs031 && m_igs017_igs031->get_irq_enable()) + ret &= ~(u32(1) << 8); + return ret; +} + +void igs_m027xa_state::oki_bank_w(offs_t offset, u8 data) +{ + m_oki->set_rom_bank(data & 7); +} + +template +u8 igs_m027xa_state::dsw_r() +{ + u8 data = 0xff; + + for (int i = First; i < m_io_dsw.size(); i++) + if (!BIT(m_io_select[Select], i - First)) + data &= m_io_dsw[i].read_safe(0xff); + return data; +} + +template +void igs_m027xa_state::io_select_w(u8 data) +{ + m_io_select[Select] = data; +} + + +void igs_m027xa_state::xa_irq(int state) +{ + if (state) + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); // TODO: when is the IRQ line cleared? +} + +u32 igs_m027xa_state::external_rom_r(offs_t offset) +{ + return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; +} + + +void igs_m027xa_state::xor_table_w(offs_t offset, u8 data) +{ + m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); +} + + + TIMER_DEVICE_CALLBACK_MEMBER(igs_m027xa_state::interrupt) { int scanline = param; - if (scanline == 240 && m_igs017_igs031->get_irq_enable()) - m_maincpu->pulse_input_line(ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); // source? (can the XA trigger this?) - - if (scanline == 0 && m_igs017_igs031->get_nmi_enable()) - m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); // vbl? + switch (scanline) + { + case 0: + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); // vbl? + m_irq_from_igs031 = false; + break; + case 240: + if (m_igs017_igs031->get_irq_enable()) + { + m_irq_from_igs031 = true; + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); // TODO: when is the IRQ line cleared? + } + break; + } } void igs_m027xa_state::igs_mahjong_xa(machine_config &config) { - ARM7(config, m_maincpu, 22000000); // Crazy Bugs has a 22Mhz Xtal, what about the others? - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::igs_mahjong_map); + IGS027A(config, m_maincpu, 22'000'000); // Crazy Bugs has a 22MHz crystal, what about the others? + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::main_map); + m_maincpu->in_port().set(FUNC(igs_m027xa_state::gpio_r)); + m_maincpu->out_port().set(FUNC(igs_m027xa_state::io_select_w<1>)); -// NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MX10EXA(config, m_xa, 10000000); // MX10EXAQC (Philips 80C51 XA) unknown frequency + IGS_XA_SUBCPU(config, m_xa, 10'000'000); // MX10EXAQC (Philips 80C51 XA) unknown frequency + m_xa->irq().set(FUNC(igs_m027xa_state::xa_irq)); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -157,17 +458,32 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027xa_state::interrupt), "screen", 0, 1); + // crzybugs: PPI port A = input, port B = output, port C = output I8255A(config, m_ppi); - m_ppi->in_pa_callback().set_ioport("TEST0"); - m_ppi->in_pb_callback().set_ioport("TEST1"); - m_ppi->in_pc_callback().set_ioport("TEST2"); + m_ppi->tri_pa_callback().set_constant(0x00); + m_ppi->tri_pb_callback().set_constant(0x00); + m_ppi->tri_pc_callback().set_constant(0x00); + m_ppi->out_pb_callback().set(FUNC(igs_m027xa_state::output_w)); + m_ppi->out_pc_callback().set(FUNC(igs_m027xa_state::lamps_w)); IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_text_reverse_bits(); - m_igs017_igs031->set_i8255_tag("ppi8255"); + m_igs017_igs031->set_text_reverse_bits(true); + m_igs017_igs031->in_pa_callback().set(NAME((&igs_m027xa_state::dsw_r<1, 0>))); + m_igs017_igs031->in_pb_callback().set_ioport("TEST0"); + m_igs017_igs031->in_pc_callback().set_ioport("TEST1"); + + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); // sound hardware - // OK6295 + SPEAKER(config, "mono").front_center(); + OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void igs_m027xa_state::igs_mahjong_xa_xor(machine_config &config) +{ + igs_mahjong_xa(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::main_xor_map); } // prg at u34 @@ -183,18 +499,17 @@ ROM_START( haunthig ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "hauntedhouse_ver-109us.u34", 0x000000, 0x80000, CRC(300fed78) SHA1(afa4c8855cd780c57d4f92ea6131ed4e77063268) ) - ROM_REGION( 0x10000, "xa", 0 ) + ROM_REGION( 0x10000, "xa:mcu", 0 ) ROM_LOAD( "hauntedhouse.u17", 0x000000, 0x10000, BAD_DUMP CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // not dumped for this set ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "haunted-h_text.u15", 0x000000, 0x80000, CRC(c23f48c8) SHA1(0cb1b6c61611a081ae4a3c0be51812045ff632fe) ) - // are these PGM-like sprites? ROM_REGION( 0x800000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "haunted-h_cg.u32", 0x000000, 0x400000, BAD_DUMP CRC(e0ea10e6) SHA1(e81be78fea93e72d4b1f4c0b58560bda46cf7948) ) // not dumped for this set, FIXED BITS (xxxxxxx0xxxxxxxx) ROM_LOAD( "haunted-h_ext.u12", 0x400000, 0x400000, BAD_DUMP CRC(662eb883) SHA1(831ebe29e1e7a8b2c2fff7fbc608975771c3486c) ) // not dumped for this set, FIXED BITS (xxxxxxxx0xxxxxxx) - ROM_REGION( 0x200000, "samples", 0 ) // Oki M6295 samples, missing sample table, bad? + ROM_REGION( 0x200000, "oki", 0 ) // Oki M6295 samples ROM_LOAD( "haunted-h_sp.u3", 0x00000, 0x200000, BAD_DUMP CRC(fe3fcddf) SHA1(ac57ab6d4e4883747c093bd19d0025cf6588cb2c) ) // not dumped for this set ROM_REGION( 0x500, "plds", ROMREGION_ERASE00 ) @@ -205,24 +520,23 @@ ROM_END ROM_START( haunthiga ) // IGS PCB-0575-04-HU - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 2x 8-dip banks ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "haunthig_igs027a", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'H2' + ROM_LOAD( "h2_igs027a", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'H2' ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "hauntedhouse_ver-101us.u34", 0x000000, 0x80000, CRC(4bf045d4) SHA1(78c848fd69961df8d9b75f92ad57c3534fbf08db) ) - ROM_REGION( 0x10000, "xa", 0 ) + ROM_REGION( 0x10000, "xa:mcu", 0 ) ROM_LOAD( "hauntedhouse.u17", 0x000000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // MX10EXAQC (80C51 XA based MCU) marked J9, not read protected? ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "haunted-h_text.u15", 0x000000, 0x80000, CRC(c23f48c8) SHA1(0cb1b6c61611a081ae4a3c0be51812045ff632fe) ) - // are these PGM-like sprites? ROM_REGION( 0x800000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "haunted-h_cg.u32", 0x000000, 0x400000, CRC(e0ea10e6) SHA1(e81be78fea93e72d4b1f4c0b58560bda46cf7948) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_LOAD( "haunted-h_ext.u12", 0x400000, 0x400000, CRC(662eb883) SHA1(831ebe29e1e7a8b2c2fff7fbc608975771c3486c) ) // FIXED BITS (xxxxxxxx0xxxxxxx) - ROM_REGION( 0x200000, "samples", 0 ) // Oki M6295 samples, missing sample table, bad? - ROM_LOAD( "haunted-h_sp.u3", 0x00000, 0x200000, BAD_DUMP CRC(fe3fcddf) SHA1(ac57ab6d4e4883747c093bd19d0025cf6588cb2c) ) + ROM_REGION( 0x200000, "oki", 0 ) // Oki M6295 samples + ROM_LOAD( "haunted-h_sp.u3", 0x00000, 0x200000, CRC(fe3fcddf) SHA1(ac57ab6d4e4883747c093bd19d0025cf6588cb2c) ) ROM_REGION( 0x500, "plds", ROMREGION_ERASE00 ) ROM_LOAD( "hu_u38a.u38", 0x000, 0x117, NO_DUMP ) // ATF16V8B, protected @@ -237,18 +551,17 @@ ROM_START( crzybugs ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Ok ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-204us.u23", 0x000000, 0x80000, CRC(d1232462) SHA1(685a292f39bf57a80d6ef31289cf9f673ba06dd4) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) - // are these PGM-like sprites? ROM_REGION( 0x200000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "crazy_bugs_cg.u19", 0x000000, 0x200000, CRC(9d53ad47) SHA1(46690a37acf8bd88c7fbe973db2faf5ef0cff805) ) // FIXED BITS (xxxxxxx0xxxxxxxx) // u18 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "crazybugs_sp.u15", 0x000000, 0x200000, CRC(591b315b) SHA1(fda1816d83e202170dba4afc6e7898b706a76087) ) // M27C160 ROM_END @@ -260,18 +573,17 @@ ROM_START( crzybugsa ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-202us.u23", 0x000000, 0x80000, CRC(210da1e6) SHA1(c726497bebd25d6a9053e331b4c26acc7e2db0b2) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) // M27C4002 - // are these PGM-like sprites? ROM_REGION( 0x200000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "crazy_bugs_cg.u19", 0x000000, 0x200000, CRC(9d53ad47) SHA1(46690a37acf8bd88c7fbe973db2faf5ef0cff805) ) // M27C160, FIXED BITS (xxxxxxx0xxxxxxxx) // u18 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "crazy_bugs_sp.u15", 0x000000, 0x200000, CRC(591b315b) SHA1(fda1816d83e202170dba4afc6e7898b706a76087) ) // M27C160 ROM_END @@ -283,18 +595,17 @@ ROM_START( crzybugsb ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-202us.u23", 0x000000, 0x80000, CRC(129e36e9) SHA1(53f20bc3792249de8ef276f84283baa9abd30acd) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, BAD_DUMP CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) // not dumped for this set - // are these PGM-like sprites? ROM_REGION( 0x200000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "crazy_bugs_cg.u19", 0x000000, 0x200000, BAD_DUMP CRC(9d53ad47) SHA1(46690a37acf8bd88c7fbe973db2faf5ef0cff805) ) // not dumped for this set, FIXED BITS (xxxxxxx0xxxxxxxx) // u18 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "crazy_bugs_sp.u15", 0x000000, 0x200000, BAD_DUMP CRC(591b315b) SHA1(fda1816d83e202170dba4afc6e7898b706a76087) ) // not dumped for this set ROM_END @@ -306,19 +617,18 @@ ROM_START( crzybugsj ) // IGS PCB-0575-04-HU - Has IGS027A, MX10EXAQC, IGS031, O ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-103jp.u34", 0x000000, 0x200000, CRC(1e35ed79) SHA1(0e4f8b706cdfcaf2aacdc40eec422df9d865b311) ) - ROM_REGION( 0x10000, "xa", 0 ) + ROM_REGION( 0x10000, "xa:mcu", 0 ) ROM_LOAD( "e9.u17", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // MX10EXAQC (80C51 XA based MCU) marked E9, same as haunthig ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "crazy_bugs_text_u15.u15", 0x000000, 0x80000, CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) // u14 not populated - // are these PGM-like sprites? ROM_REGION( 0x200000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "crazy_bugs_ani-cg-u32.u32", 0x000000, 0x200000, CRC(9d53ad47) SHA1(46690a37acf8bd88c7fbe973db2faf5ef0cff805) ) // FIXED BITS (xxxxxxx0xxxxxxxx) // u12 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "crazy_bugs_sp_u3.u3", 0x000000, 0x200000, CRC(b15974a1) SHA1(82509902bbb33a2120d815e7879b9b8591a29976) ) ROM_REGION( 0x500, "plds", ROMREGION_ERASE00 ) @@ -326,16 +636,60 @@ ROM_START( crzybugsj ) // IGS PCB-0575-04-HU - Has IGS027A, MX10EXAQC, IGS031, O ROM_LOAD( "hu_u39.u39", 0x200, 0x2dd, CRC(75f58b46) SHA1(7cb136a41899ddd50c95a67ca6353ce5d8d92149) ) // AT22V10 ROM_END -ROM_START( tripfev ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 3x 8-DIP banks +ROM_START( tripfev ) // IGS PCB-0575-02-HU PCB + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "w1_igs027a.u42", 0x00000, 0x4000, CRC(a40ec1f8) SHA1(f6f7005d61522934758fd0a98bf383c6076b6afe) ) // sticker marked 'W1' + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v108.u34", 0x000000, 0x80000, CRC(f0ad18ed) SHA1(95239e7b9925f12008051140afb74d47a5da4a3a) ) // 27C4096 + + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked P7 + ROM_LOAD( "p7.u17", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // MX10EXAQC (80C51 XA based MCU) marked P7, but same as haunthig, crzybugsj + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "triple_fever_text.u15", 0x000000, 0x80000, CRC(522a1030) SHA1(9a7a5ba9b26bceb0d251be6139c10e4655fc19ec) ) // M27C4002 + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "triple_fever_cg.u32", 0x000000, 0x400000, CRC(cd45bbf2) SHA1(7f1cf270245bbe4604de2cacade279ab13584dbd) ) // M27C322, FIXED BITS (xxxxxxx0xxxxxxxx) + // u18 not populated + + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples + ROM_LOAD( "triplef_sp.u3", 0x000000, 0x200000, CRC(98b9cafd) SHA1(3bf3971f0d9520c98fc6b1c2e77ab9c178d21c62) ) // M27C160 +ROM_END + +ROM_START( tripfeva ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 3x 8-DIP banks ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "w1.u37", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'W1' + ROM_LOAD( "w1_igs027a.u37", 0x00000, 0x4000, CRC(a40ec1f8) SHA1(f6f7005d61522934758fd0a98bf383c6076b6afe) ) // sticker marked 'W1' ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "triple_fever_u23_v107_us.u23", 0x000000, 0x80000, CRC(aa56d888) SHA1(0b8b2765079259b76ea803289841d867c33c8cb2) ) // 27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked P7 - ROM_LOAD( "p7.u27", 0x00000, 0x10000, NO_DUMP ) + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked P7 + ROM_LOAD( "p7.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // MX10EXAQC (80C51 XA based MCU) marked P7, but same as haunthig, crzybugsj + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "triple_fever_u10_text.u10", 0x000000, 0x80000, CRC(522a1030) SHA1(9a7a5ba9b26bceb0d251be6139c10e4655fc19ec) ) // M27C4002 + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "triple_fever_u19_cg.u19", 0x000000, 0x400000, CRC(cd45bbf2) SHA1(7f1cf270245bbe4604de2cacade279ab13584dbd) ) // M27C322, FIXED BITS (xxxxxxx0xxxxxxxx) + // u18 not populated + + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples + ROM_LOAD( "triplef_sp_u15.u15", 0x000000, 0x200000, CRC(98b9cafd) SHA1(3bf3971f0d9520c98fc6b1c2e77ab9c178d21c62) ) // M27C160 +ROM_END + +ROM_START( tripfevb ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 3x 8-DIP banks + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "w1_igs027a.u37", 0x00000, 0x4000, CRC(a40ec1f8) SHA1(f6f7005d61522934758fd0a98bf383c6076b6afe) ) // sticker marked 'W1' + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "u23 27c4096.bin", 0x000000, 0x80000, CRC(f870edda) SHA1(30d1c2d4c575749adbbf28b64eca1f35bcf7dfca) ) // 27C4096, unreadable label + + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked P7 + ROM_LOAD( "p7.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) // MX10EXAQC (80C51 XA based MCU) marked P7, but same as haunthig, crzybugsj ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "triple_fever_u10_text.u10", 0x000000, 0x80000, CRC(522a1030) SHA1(9a7a5ba9b26bceb0d251be6139c10e4655fc19ec) ) // M27C4002 @@ -344,19 +698,19 @@ ROM_START( tripfev ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Oki ROM_LOAD( "triple_fever_u19_cg.u19", 0x000000, 0x400000, CRC(cd45bbf2) SHA1(7f1cf270245bbe4604de2cacade279ab13584dbd) ) // M27C322, FIXED BITS (xxxxxxx0xxxxxxxx) // u18 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "triplef_sp_u15.u15", 0x000000, 0x200000, CRC(98b9cafd) SHA1(3bf3971f0d9520c98fc6b1c2e77ab9c178d21c62) ) // M27C160 ROM_END ROM_START( wldfruit ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 3x 8-DIP banks ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU - ROM_LOAD( "w1.u37", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'W1' + ROM_LOAD( "w1.u37", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'W1?' (same label, but not the same as tripfev? or an error) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "wild_fruit_v-208us.u23", 0x000000, 0x80000, CRC(d43398f1) SHA1(ecc4bd5cb6da16b35c63b843cf7beec1ab84ed9d) ) // M27C4002 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 + ROM_REGION( 0x10000, "xa:mcu", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) @@ -366,7 +720,7 @@ ROM_START( wldfruit ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Ok ROM_LOAD( "wild_fruit_cg.u19", 0x000000, 0x400000, CRC(119686a8) SHA1(22583c1a1018cfdd20f0ef696d91fa1f6e01ab00) ) // M27C322, FIXED BITS (xxxxxxx0xxxxxxxx) // u18 not populated - ROM_REGION( 0x200000, "samples", 0 ) // plain Oki M6295 samples + ROM_REGION( 0x200000, "oki", 0 ) // plain Oki M6295 samples ROM_LOAD( "wild_fruit_sp.u15", 0x000000, 0x200000, CRC(9da3e9dd) SHA1(7e447492713549e6be362d4aca6d223dad20771a) ) // M27C160 ROM_END @@ -379,7 +733,7 @@ void igs_m027xa_state::pgm_create_dummy_internal_arm_region() for (int i = 0; i < 0x4000 / 2; i += 2) { temp16[i] = 0xff1e; - temp16[ i +1] = 0xe12f; + temp16[i +1] = 0xe12f; } @@ -419,8 +773,8 @@ void igs_m027xa_state::init_crzybugsj() void igs_m027xa_state::init_tripfev() { tripfev_decrypt(machine()); - //qlgs_gfx_decrypt(machine()); - pgm_create_dummy_internal_arm_region(); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } void igs_m027xa_state::init_wldfruit() @@ -432,13 +786,19 @@ void igs_m027xa_state::init_wldfruit() } // anonymous namespace -// These use the MX10EXAQC (80c51XA from Philips) and maybe don't belong in here +// These use the MX10EXAQC (80c51XA from Philips) // the PCBs are closer to igs_fear.cpp in terms of layout -GAME( 2008, haunthig, 0, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_IS_SKELETON ) // IGS FOR V109US 2008 10 14 -GAME( 2006, haunthiga, haunthig, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_IS_SKELETON ) // IGS FOR V101US 2006 08 23 -GAME( 2009, crzybugs, 0, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", MACHINE_IS_SKELETON ) // IGS FOR V204US 2009 5 19 -GAME( 2006, crzybugsa, crzybugs, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", MACHINE_IS_SKELETON ) // IGS FOR V100US 2006 3 29 but also V202US string -GAME( 2005, crzybugsb, crzybugs, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", MACHINE_IS_SKELETON ) // FOR V100US 2005 7 20 but also V200US string -GAME( 2007, crzybugsj, crzybugs, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", MACHINE_IS_SKELETON ) // IGS FOR V101JP 2007 06 08 -GAME( 2006, tripfev, 0, igs_mahjong_xa, base, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", MACHINE_IS_SKELETON ) // IGS FOR V107US 2006 09 07 -GAME( 200?, wldfruit, 0, igs_mahjong_xa, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_IS_SKELETON ) // IGS-----97----V208US +GAME( 2008, haunthig, 0, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_NOT_WORKING ) // IGS FOR V109US 2008 10 14 +GAME( 2006, haunthiga, haunthig, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_NOT_WORKING ) // IGS FOR V101US 2006 08 23 + +GAMEL( 2009, crzybugs, 0, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", 0, layout_crzybugs ) // IGS FOR V204US 2009 5 19 +GAMEL( 2006, crzybugsa, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", 0, layout_crzybugs ) // IGS FOR V100US 2006 3 29 but also V202US string +GAMEL( 2005, crzybugsb, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", 0, layout_crzybugs ) // FOR V100US 2005 7 20 but also V200US string + +GAME( 2007, crzybugsj, crzybugs, igs_mahjong_xa, crzybugs, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", MACHINE_NOT_WORKING ) // IGS FOR V101JP 2007 06 08 + +GAMEL( 2006, tripfev, 0, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V108US)", 0, layout_tripfev ) +GAMEL( 2006, tripfeva, tripfev, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", 0, layout_tripfev ) // IGS FOR V107US 2006 09 07 +GAMEL( 2006, tripfevb, tripfev, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V105US)", MACHINE_NOT_WORKING, layout_tripfev ) + +GAME( 200?, wldfruit, 0, igs_mahjong_xa, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_NOT_WORKING ) // IGS-----97----V208US diff --git a/src/mame/igs/igs_m036.cpp b/src/mame/igs/igs_m036.cpp index 2bea1ec523f54..dcf9bd9fd1e8e 100644 --- a/src/mame/igs/igs_m036.cpp +++ b/src/mame/igs/igs_m036.cpp @@ -63,7 +63,6 @@ check more info and photo from cjdh2.zip!!! #include "igs036crypt.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "sound/okim6295.h" #include "sound/tt5665.h" diff --git a/src/mame/igs/igspoker.cpp b/src/mame/igs/igspoker.cpp index cc6c9a89249ac..f522338ef10c6 100644 --- a/src/mame/igs/igspoker.cpp +++ b/src/mame/igs/igspoker.cpp @@ -125,7 +125,6 @@ class igspoker_state : public driver_device void init_cpoker300us(); void init_igs_ncs2(); void init_cpokerpk(); - void init_kungfua(); int hopper_r(); @@ -2964,76 +2963,7 @@ void igspoker_state::init_pktet346() rom[0xbb0c] = 0xc3; } -/* - -Cherry master looking board - -Big chip with no markings at U80 stickered KUNG FU - V1.0 - 1992 - -Board silkscreend on top PCB NO.0013-B - -.45 27010 stickered 6 -.44 27010 stickered 5 -.43 27010 stickered 4 -.42 27128 stickered 3 -.41 27128 stickered 2 -.40 27128 stickered 1 -.98 27256 stickered 7 couldn't read chip, but board was silkscreened 27c256 -.97 27512 stickered ? looked like Japanese writing -.38 74s287 -.46 18cv8 <--- same checksum as .48 -.47 pal16l8a <--- checksum was 0 -.48 18cv8 <--- same checksum as .46 - -unknown 24 pin chip @ u29 -open 24 pin socket @ u54 -12 MHz crystal - -5 x DSW8 -3 x NEC D8255AC - -*/ - -ROM_START( kungfua ) - ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) - // u97 contains leftover x86 code at 0-3fff (compiled with Borland Turbo-C). - // You can rename the rom to kungfu.exe and run it (DOS MZ executable)! - // The rest is Z80 code, so the CPU at u80 is probably a variant with internal ROM. - ROM_LOAD( "kungfu-internal.u80", 0x00000, 0x04000, NO_DUMP ) - ROM_LOAD( "kungfu.u97", 0x00000, 0x10000, CRC(5c8e16de) SHA1(4af3795753d6e08f528b861d3a771c782e173556) ) - ROM_LOAD( "kungfu-7.u98", 0x10000, 0x08000, CRC(1d3f0c79) SHA1(0a33798b69fbdc0fb7c47c51f5759e42acd2c608) ) - - ROM_REGION( 0x60000, "gfx1", 0 ) - ROM_LOAD( "kungfu-4.u43", 0x00000, 0x20000, CRC(df4afedb) SHA1(56ab18c46a199653c284417a8e9edc9f32374318) ) - ROM_LOAD( "kungfu-5.u44", 0x20000, 0x20000, CRC(25c9c98e) SHA1(2d3a399d8d53ee5cb8106d2b35d1ab1778439f81) ) - ROM_LOAD( "kungfu-6.u45", 0x40000, 0x20000, CRC(f1ec5f0d) SHA1(0aa888e13312ed5d98953c81f03a61c6175c7fec) ) - - ROM_REGION( 0x30000, "gfx2", ROMREGION_ERASE00 ) - ROM_LOAD( "kungfu-1.u40", 0x00000, 0x4000, CRC(abaada6b) SHA1(a6b910db7451e8ca737f43f32dfc8fc5ecf865f4) ) - ROM_LOAD( "kungfu-2.u41", 0x10000, 0x4000, CRC(927b3060) SHA1(a780ea5aaee04287cc9533c2d258dc18f8426530) ) - ROM_LOAD( "kungfu-3.u42", 0x20000, 0x4000, CRC(bbf78e03) SHA1(06fee093e75e2611d00c076c2e0a681938fa8b74) ) - - ROM_REGION( 0x1000, "plds", 0 ) - ROM_LOAD( "kungfu.u38", 0x000, 0x100, CRC(2074f729) SHA1(eb9a60dec57a029ae6d3fc53aa7bc78e8ac34392) ) - ROM_LOAD( "kungfu.u46", 0x000, 0xde1, CRC(5d4aacaf) SHA1(733546ce0585c40833e1c34504c33219a2bea0a9) ) - ROM_LOAD( "kungfu.u47", 0x000, 0xaee, CRC(5c7e25b5) SHA1(7d37e4abfe1256bd9cb168e0f02e651118dfb304) ) - ROM_LOAD( "kungfu.u48", 0x000, 0xde1, CRC(5d4aacaf) SHA1(733546ce0585c40833e1c34504c33219a2bea0a9) ) -ROM_END - -void igspoker_state::init_kungfua() -{ - uint8_t *rom = memregion("maincpu")->base(); - - for (int A = 0x4000; A < 0x10000; A++) - { - rom[A] = rom[A] ^ 0x01; - } - memset( &rom[0xf000], 0, 0x1000); -} - -} // Anonymous namespace +} // anonymous namespace GAMEL( 1993?,cpoker, 0, igspoker, cpoker, igspoker_state, init_cpoker, ROT0, "IGS", "Champion Poker (v220I)", 0, layout_igspoker ) @@ -3068,5 +2998,3 @@ GAMEL( 1998, stellecu, 0, number10, number10, igspoker_state, empty_in GAMEL( 1993?,pktet346, 0, pktetris, pktet346, igspoker_state, init_pktet346, ROT0, "IGS", "PK Tetris (v346I)", 0, layout_igspoker ) GAMEL( 199?, igstet341, pktet346, pktetris, igstet341,igspoker_state, init_tet341, ROT0, "IGS", "Tetris (v341R)", 0, layout_igspoker ) GAMEL( 199?, igstet342, pktet346, pktetris, igstet341,igspoker_state, init_tet341, ROT0, "IGS", "Tetris (v342R)", 0, layout_igspoker ) - -GAMEL( 1992, kungfua, kungfu, igspoker, cpoker, igspoker_state, init_kungfua, ROT0, "IGS", "Kung Fu Fighters (IGS, v100)", MACHINE_NOT_WORKING, layout_igspoker ) // missing internal ROM dump diff --git a/src/mame/igs/mahjong.cpp b/src/mame/igs/mahjong.cpp new file mode 100644 index 0000000000000..5806819f530ba --- /dev/null +++ b/src/mame/igs/mahjong.cpp @@ -0,0 +1,57 @@ +// license:BSD-3-Clause +// copyright-holders:Luca Elia +#include "emu.h" +#include "mahjong.h" + + +INPUT_PORTS_START( igs_mahjong_matrix ) + PORT_START("KEY0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) + 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("KEY3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) + 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("KEY4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END diff --git a/src/mame/igs/mahjong.h b/src/mame/igs/mahjong.h new file mode 100644 index 0000000000000..57631161a2bf3 --- /dev/null +++ b/src/mame/igs/mahjong.h @@ -0,0 +1,8 @@ +// license:BSD-3-Clause +// copyright-holders:Luca Elia +#ifndef MAME_IGS_MAHJONG_H +#define MAME_IGS_MAHJONG_H + +INPUT_PORTS_EXTERN(igs_mahjong_matrix); + +#endif // MAME_IGS_MAHJONG_H diff --git a/src/mame/igs/pgm.h b/src/mame/igs/pgm.h index 61666039d24f1..8a445f3a1159c 100644 --- a/src/mame/igs/pgm.h +++ b/src/mame/igs/pgm.h @@ -11,7 +11,6 @@ #include "pgmcrypt.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" diff --git a/src/mame/igs/pgm2.cpp b/src/mame/igs/pgm2.cpp index 6202560f62499..6346e7c570d5b 100644 --- a/src/mame/igs/pgm2.cpp +++ b/src/mame/igs/pgm2.cpp @@ -683,8 +683,8 @@ INPUT_PORTS_END void pgm2_state::irq(int state) { // logerror("irq\n"); - if (state == ASSERT_LINE) m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); - else m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + if (state == ASSERT_LINE) m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); + else m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } void pgm2_state::machine_start() @@ -1444,10 +1444,6 @@ void pgm2_state::init_ddpdojt() } // currently we don't know how to derive address/data xor values from real keys, so we need both -static const kov3_module_key kov3_104_key = { { 0x40,0xac,0x30,0x00,0x47,0x49,0x00,0x00 } ,{ 0xeb,0x7d,0x8d,0x90,0x2c,0xf4,0x09,0x82 }, 0x18ec71, 0xb89d }; // fake zero-key -static const kov3_module_key kov3_102_key = { { 0x49,0xac,0xb0,0xec,0x47,0x49,0x95,0x38 } ,{ 0x09,0xbd,0xf1,0x31,0xe6,0xf0,0x65,0x2b }, 0x021d37, 0x81d0 }; -static const kov3_module_key kov3_101_key = { { 0xc1,0x2c,0xc1,0xe5,0x3c,0xc1,0x59,0x9e } ,{ 0xf2,0xb2,0xf0,0x89,0x37,0xf2,0xc7,0x0b }, 0, 0xffff }; // real xor values is unknown -static const kov3_module_key kov3_100_key = { { 0x40,0xac,0x30,0x00,0x47,0x49,0x00,0x00 } ,{ 0x96,0xf0,0x91,0xe1,0xb3,0xf1,0xef,0x90 }, 0x3e8aa8, 0xc530 }; // fake zero-key void pgm2_state::init_kov3() { @@ -1472,24 +1468,40 @@ void pgm2_state::decrypt_kov3_module(u32 addrxor, u16 dataxor) void pgm2_state::init_kov3_104() { + static const kov3_module_key kov3_104_key = { + { 0x40,0xac,0x30,0x00,0x47,0x49,0x00,0x00 }, + { 0xeb,0x7d,0x8d,0x90,0x2c,0xf4,0x09,0x82 }, + 0x18ec71, 0xb89d }; // fake zero-key module_key = &kov3_104_key; init_kov3(); } void pgm2_state::init_kov3_102() { + static const kov3_module_key kov3_102_key = { + { 0x49,0xac,0xb0,0xec,0x47,0x49,0x95,0x38 }, + { 0x09,0xbd,0xf1,0x31,0xe6,0xf0,0x65,0x2b }, + 0x021d37, 0x81d0 }; module_key = &kov3_102_key; init_kov3(); } void pgm2_state::init_kov3_101() { + static const kov3_module_key kov3_101_key = { + { 0xc1,0x2c,0xc1,0xe5,0x3c,0xc1,0x59,0x9e }, + { 0xf2,0xb2,0xf0,0x89,0x37,0xf2,0xc7,0x0b }, + 0, 0xffff }; // real xor values is unknown module_key = &kov3_101_key; init_kov3(); } void pgm2_state::init_kov3_100() { + static const kov3_module_key kov3_100_key = { + { 0x40,0xac,0x30,0x00,0x47,0x49,0x00,0x00 }, + { 0x96,0xf0,0x91,0xe1,0xb3,0xf1,0xef,0x90 }, + 0x3e8aa8, 0xc530 }; // fake zero-key module_key = &kov3_100_key; init_kov3(); } diff --git a/src/mame/igs/pgm2.h b/src/mame/igs/pgm2.h index 484aa30a0a83c..0e8ed984f08ae 100644 --- a/src/mame/igs/pgm2.h +++ b/src/mame/igs/pgm2.h @@ -5,26 +5,20 @@ #pragma once -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" -#include "sound/ymz770.h" #include "igs036crypt.h" -#include "screen.h" -#include "speaker.h" +#include "pgm2_memcard.h" + +#include "cpu/arm7/arm7.h" +#include "machine/atmel_arm_aic.h" #include "machine/nvram.h" #include "machine/timer.h" -#include "machine/atmel_arm_aic.h" -#include "pgm2_memcard.h" +#include "sound/ymz770.h" + #include "emupal.h" +#include "screen.h" +#include "speaker.h" #include "tilemap.h" -struct kov3_module_key -{ - u8 key[8]; - u8 sum[8]; - u32 addr_xor; // 22bit - u16 data_xor; -}; class pgm2_state : public driver_device { @@ -75,7 +69,22 @@ class pgm2_state : public driver_device void pgm2_module_rom_map(address_map &map); void pgm2_ram_rom_map(address_map &map); void pgm2_rom_map(address_map &map); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + virtual void device_post_load() override; + private: + struct kov3_module_key + { + u8 key[8]; + u8 sum[8]; + u32 addr_xor; // 22bit + u16 data_xor; + }; + u32 unk_startup_r(); u32 rtc_r(); u32 mcu_r(offs_t offset); @@ -109,11 +118,6 @@ class pgm2_state : public driver_device void encryption_do_w(u32 data); void sprite_encryption_w(offs_t offset, u32 data, u32 mem_mask = ~0); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - virtual void device_post_load() override; - TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); diff --git a/src/mame/igs/pgm3.cpp b/src/mame/igs/pgm3.cpp index 8e0be99b226cc..7653cbbcb3c8f 100644 --- a/src/mame/igs/pgm3.cpp +++ b/src/mame/igs/pgm3.cpp @@ -48,7 +48,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/igs/pgmcrypt.cpp b/src/mame/igs/pgmcrypt.cpp index 861d026c39339..bf753b1b8202f 100644 --- a/src/mame/igs/pgmcrypt.cpp +++ b/src/mame/igs/pgmcrypt.cpp @@ -291,25 +291,6 @@ void pgm_dfront_decrypt(running_machine &machine) } -static const uint8_t ddp2_tab[256] = { - 0x2a, 0x4a, 0x39, 0x98, 0xac, 0x39, 0xb2, 0x55, 0x72, 0xf3, 0x7b, 0x3c, 0xee, 0x94, 0x6e, 0xd5, - 0xcd, 0xbc, 0x9a, 0xd0, 0x45, 0x7d, 0x49, 0x68, 0xb1, 0x61, 0x54, 0xef, 0xa2, 0x84, 0x29, 0x20, - 0x32, 0x52, 0x82, 0x04, 0x38, 0x69, 0x9f, 0x24, 0x46, 0xf4, 0x3f, 0xc2, 0xf1, 0x25, 0xac, 0x2d, - 0xdf, 0x2d, 0xb4, 0x51, 0xc7, 0xb5, 0xe5, 0x88, 0xbd, 0x3b, 0x5a, 0x25, 0x5b, 0xc7, 0xae, 0x5f, - 0x43, 0xcf, 0x89, 0xd9, 0xe2, 0x63, 0xc6, 0x76, 0x21, 0x2b, 0x77, 0xc0, 0x27, 0x98, 0xfd, 0x09, - 0xe1, 0x8c, 0x26, 0x2e, 0x92, 0x99, 0xbc, 0xbe, 0x0e, 0xba, 0xbf, 0x70, 0xe7, 0xb7, 0xe9, 0x37, - 0x5c, 0xd1, 0x5e, 0xad, 0x22, 0x17, 0xc5, 0x67, 0x9d, 0xc6, 0xfb, 0x53, 0xc7, 0x4d, 0x32, 0xb4, - 0xf2, 0x43, 0x53, 0x7c, 0x01, 0xfe, 0xd2, 0x91, 0x40, 0x85, 0xa3, 0xe8, 0xdf, 0xdb, 0xff, 0x6c, - 0x64, 0x15, 0xcd, 0x8e, 0x07, 0x82, 0x78, 0x8d, 0x4e, 0x2d, 0x66, 0x8a, 0x62, 0x6f, 0xd3, 0x6a, - 0xae, 0x16, 0x44, 0x1e, 0xed, 0xc4, 0x12, 0x7a, 0xbe, 0x05, 0x06, 0xce, 0x9b, 0x8a, 0xf7, 0xf8, - 0x74, 0x23, 0x73, 0x74, 0xb8, 0x13, 0xc2, 0x42, 0xea, 0xf9, 0x7f, 0xa9, 0xaf, 0x56, 0xd6, 0xb3, - 0xb7, 0xc4, 0x47, 0x31, 0x67, 0xaa, 0x58, 0x8b, 0x47, 0x1b, 0xf5, 0x75, 0x95, 0x8f, 0xf0, 0x3a, - 0x85, 0x76, 0x59, 0x24, 0x0c, 0xd7, 0x00, 0xb3, 0xdc, 0xfc, 0x65, 0x34, 0xde, 0xfa, 0xd8, 0xc3, - 0xc3, 0x5e, 0xe3, 0x9e, 0x02, 0x28, 0x50, 0x81, 0x95, 0x2f, 0xe4, 0xb5, 0xa0, 0x4d, 0xa1, 0x36, - 0x9d, 0x18, 0x6d, 0x79, 0x19, 0x3b, 0x1d, 0xb8, 0xe1, 0xcc, 0x61, 0x1a, 0xe2, 0x31, 0x4c, 0x3f, - 0xdc, 0xca, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x2f, 0x2d, 0x2a, 0xec, 0x1f -}; - void pgm_ddp2_decrypt(running_machine &machine) { auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); @@ -329,32 +310,10 @@ void pgm_ddp2_decrypt(running_machine &machine) IGS27_CRYPT7_ALT IGS27_CRYPT8_ALT - x ^= ddp2_tab[(i>> 1) & 0xff] << 8; - src[i] = x; } } - -static const uint8_t mm_tab[256] = { - 0xd0, 0x45, 0xbc, 0x84, 0x93, 0x60, 0x7d, 0x49, 0x68, 0xb1, 0x54, 0xa2, 0x05, 0x29, 0x41, 0x20, - 0x04, 0x08, 0x52, 0x25, 0x89, 0xf4, 0x69, 0x9f, 0x24, 0x46, 0x3d, 0xf1, 0xf9, 0xab, 0xa6, 0x2d, - 0x18, 0x19, 0x6d, 0x33, 0x79, 0x23, 0x3b, 0x1d, 0xe0, 0xb8, 0x61, 0x1a, 0xe1, 0x4c, 0x5d, 0x3f, - 0x5e, 0x02, 0xe3, 0x4d, 0x9e, 0x80, 0x28, 0x50, 0xa0, 0x81, 0xe4, 0xa5, 0x97, 0xa1, 0x86, 0x36, - 0x1e, 0xed, 0x16, 0x8a, 0x44, 0x06, 0x64, 0x12, 0x9a, 0x7e, 0xce, 0x9b, 0xef, 0xf7, 0x3e, 0xf8, - 0x15, 0x07, 0xcb, 0x6f, 0x8e, 0x3c, 0x82, 0x70, 0x62, 0x8d, 0x66, 0x7a, 0x4e, 0xd3, 0xb6, 0x6a, - 0x51, 0xa7, 0x2c, 0xc7, 0xa4, 0x0b, 0xb5, 0xe5, 0x88, 0xbd, 0x5a, 0x5b, 0x1b, 0xae, 0xe6, 0x5f, - 0x2e, 0x92, 0x8c, 0xb7, 0x96, 0xba, 0x99, 0xbb, 0xbe, 0x0e, 0xbf, 0xe7, 0x2f, 0xe9, 0x30, 0x37, - 0x98, 0xac, 0x4a, 0x94, 0x38, 0xf3, 0x39, 0xb2, 0x55, 0x72, 0x7b, 0xee, 0xdd, 0x6e, 0x11, 0xd5, - 0x26, 0xa8, 0x71, 0xd6, 0x74, 0x7f, 0x13, 0xc2, 0x56, 0xea, 0xa9, 0xaf, 0xc3, 0x42, 0x03, 0xb3, - 0xc4, 0x6b, 0x47, 0xf0, 0x31, 0xf5, 0xaa, 0x58, 0x8f, 0x48, 0x75, 0x95, 0x35, 0x8b, 0x57, 0x3a, - 0x73, 0x0c, 0x59, 0xd8, 0x14, 0x65, 0xd7, 0x00, 0xfa, 0xdc, 0x34, 0xde, 0xc0, 0xb0, 0x87, 0xc1, - 0xc8, 0xcd, 0xd4, 0x2a, 0xda, 0xe8, 0xd2, 0x83, 0x0d, 0xca, 0xf2, 0x0f, 0xeb, 0xec, 0x9c, 0x1f, - 0xad, 0x22, 0xd1, 0x4b, 0x5c, 0xf6, 0x17, 0xc5, 0x67, 0x9d, 0xfb, 0xc9, 0xcc, 0x32, 0x1c, 0xb4, - 0xd9, 0xe2, 0xcf, 0x90, 0xb9, 0x2b, 0x63, 0xc6, 0x76, 0x21, 0x77, 0x27, 0xfc, 0xfd, 0x0a, 0x09, - 0x7c, 0x01, 0x43, 0xdb, 0x53, 0x85, 0xfe, 0x78, 0x91, 0x40, 0xa3, 0xdf, 0x4f, 0xff, 0x10, 0x6c -}; - void pgm_mm_decrypt(running_machine &machine) // and dw2001 { auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); @@ -374,30 +333,11 @@ void pgm_mm_decrypt(running_machine &machine) // and dw2001 IGS27_CRYPT7 IGS27_CRYPT8_ALT - x ^= mm_tab[(i>> 1) & 0xff] << 8; - src[i] = x; } } -static const uint8_t kov2_tab[256] = { - 0x11, 0x4a, 0x38, 0x98, 0xac, 0x39, 0xb2, 0x55, 0x72, 0xf3, 0x7b, 0x3c, 0xee, 0x94, 0x6e, 0xd5, - 0x41, 0xbc, 0x93, 0xd0, 0x45, 0x7d, 0x49, 0x68, 0xb1, 0x60, 0x54, 0xef, 0xa2, 0x84, 0x29, 0x20, - 0xa6, 0x52, 0x89, 0x04, 0x08, 0x69, 0x9f, 0x24, 0x46, 0xf4, 0x3d, 0xc3, 0xf1, 0x25, 0xab, 0x2d, - 0xe6, 0x2c, 0xa4, 0x51, 0xa7, 0xb5, 0xe5, 0x88, 0xbd, 0x0b, 0x5a, 0x35, 0x5b, 0xc7, 0xae, 0x5f, - 0x0a, 0xcf, 0xb9, 0xd9, 0xe2, 0x63, 0xc6, 0x76, 0x21, 0x2b, 0x77, 0xc0, 0x27, 0x90, 0xfd, 0x09, - 0x30, 0x8c, 0x96, 0x2e, 0x92, 0x99, 0xbb, 0xbe, 0x0e, 0xba, 0xbf, 0x80, 0xe7, 0xb7, 0xe9, 0x37, - 0x1c, 0xd1, 0x5c, 0xad, 0x22, 0x17, 0xc5, 0x67, 0x9d, 0xf6, 0xfb, 0x23, 0xc9, 0x4b, 0x32, 0xb4, - 0x10, 0x43, 0x53, 0x7c, 0x01, 0xfe, 0x78, 0x91, 0x40, 0x85, 0xa3, 0xe8, 0xdf, 0xdb, 0xff, 0x6c, - 0xb6, 0x15, 0xcb, 0x8e, 0x07, 0x82, 0x70, 0x8d, 0x4e, 0xdd, 0x66, 0x7a, 0x62, 0x6f, 0xd3, 0x6a, - 0x3e, 0x16, 0x44, 0x1e, 0xed, 0x64, 0x12, 0x9a, 0x7e, 0x05, 0x06, 0xce, 0x9b, 0x8a, 0xf7, 0xf8, - 0x03, 0x26, 0x71, 0x74, 0xa8, 0x13, 0xc2, 0x42, 0xea, 0xf9, 0x7f, 0xa9, 0xaf, 0x56, 0xd6, 0xb3, - 0x57, 0xc4, 0x47, 0x31, 0x6b, 0xaa, 0x58, 0x8b, 0x48, 0x1b, 0xf5, 0x75, 0x95, 0x8f, 0xf0, 0x3a, - 0x87, 0x73, 0x59, 0x14, 0x0c, 0xd7, 0x00, 0xb0, 0xdc, 0xfc, 0x65, 0x34, 0xde, 0xfa, 0xd8, 0xc1, - 0x86, 0x5e, 0xe3, 0x9e, 0x02, 0x28, 0x50, 0x81, 0x97, 0x2f, 0xe4, 0xa5, 0xa0, 0x4d, 0xa1, 0x36, - 0x5d, 0x18, 0x6d, 0x79, 0x19, 0x3b, 0x1d, 0xb8, 0xe1, 0xcc, 0x61, 0x1a, 0xe0, 0x33, 0x4c, 0x3f, - 0x9c, 0xc8, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x0f, 0x0d, 0x2a, 0xec, 0x1f -}; + void pgm_kov2_decrypt(running_machine &machine) { @@ -418,31 +358,10 @@ void pgm_kov2_decrypt(running_machine &machine) IGS27_CRYPT7_ALT IGS27_CRYPT8_ALT - x ^= kov2_tab[(i >> 1) & 0xff] << 8; - src[i] = x; } } -static const uint8_t kov2p_tab[256] = { - 0x44, 0x47, 0xb8, 0x28, 0x03, 0xa2, 0x21, 0xbc, 0x17, 0x32, 0x4e, 0xe2, 0xdf, 0x69, 0x35, 0xc7, - 0xa2, 0x06, 0xec, 0x36, 0xd2, 0x44, 0x12, 0x6a, 0x8d, 0x51, 0x6b, 0x20, 0x69, 0x01, 0xca, 0xf0, - 0x71, 0xc4, 0x34, 0xdc, 0x6b, 0xd6, 0x42, 0x2a, 0x5d, 0xb5, 0xc7, 0x6f, 0x4f, 0xd8, 0xb3, 0xed, - 0x51, 0x9e, 0x37, 0x1e, 0xc0, 0x85, 0x2a, 0x91, 0xc6, 0x9c, 0xac, 0xf5, 0x20, 0x3b, 0x09, 0x74, - 0x24, 0xf1, 0xe0, 0x42, 0x02, 0xbe, 0x84, 0x75, 0x4a, 0x82, 0xa2, 0x17, 0xae, 0xb6, 0x24, 0x79, - 0x0a, 0x5a, 0x56, 0xcb, 0xa1, 0x2e, 0x47, 0xea, 0xa9, 0x25, 0x73, 0x79, 0x0b, 0x17, 0x9e, 0x33, - 0x64, 0xb6, 0x03, 0x7f, 0x4f, 0xc3, 0xae, 0x45, 0xe6, 0x82, 0x27, 0x01, 0x86, 0x6b, 0x50, 0x16, - 0xd3, 0x22, 0x90, 0x64, 0xfc, 0xa9, 0x31, 0x1c, 0x41, 0xd5, 0x07, 0xd3, 0xb2, 0xfe, 0x53, 0xd6, - 0x39, 0xfb, 0xe6, 0xbe, 0xda, 0x4d, 0x8a, 0x44, 0x3a, 0x9b, 0x9d, 0x56, 0x5e, 0x5f, 0xff, 0x6a, - 0xb6, 0xde, 0x2f, 0x12, 0x5a, 0x5d, 0xb0, 0xd0, 0x93, 0x92, 0xb2, 0x2c, 0x9d, 0x59, 0xee, 0x05, - 0xab, 0xa8, 0xd2, 0x25, 0x2c, 0xc5, 0xde, 0x18, 0x4d, 0xb6, 0x4e, 0x3d, 0xbf, 0xfa, 0xf9, 0x1d, - 0xba, 0x76, 0x79, 0xfc, 0x42, 0xb2, 0x8c, 0xae, 0xa9, 0x45, 0xba, 0xac, 0x55, 0x8e, 0x38, 0x67, - 0xc3, 0xa5, 0x0d, 0xdc, 0xcc, 0x91, 0x73, 0x69, 0x27, 0xbc, 0x80, 0xdf, 0x30, 0xa4, 0x05, 0xd8, - 0xe7, 0xd2, 0xb7, 0x4b, 0x3c, 0x10, 0x8c, 0x5d, 0x8a, 0xd7, 0x68, 0x7a, 0x61, 0x07, 0xf9, 0xa5, - 0x88, 0xda, 0xdf, 0x0c, 0x42, 0x1b, 0x11, 0xe0, 0xd1, 0x93, 0x7c, 0x63, 0x39, 0xc5, 0xed, 0x43, - 0x46, 0xdb, 0x30, 0x26, 0xd0, 0xdf, 0x7a, 0x86, 0x3e, 0x2e, 0x04, 0xbf, 0x49, 0x2a, 0xf9, 0x66 -}; - void pgm_kov2p_decrypt(running_machine &machine) { auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); @@ -462,8 +381,6 @@ void pgm_kov2p_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8_ALT - x ^= kov2p_tab[(i >> 1) & 0xff] << 8; - src[i] = x; } } @@ -1034,34 +951,15 @@ void hauntedh_decrypt(running_machine &machine) } -static const uint8_t chessc2_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x38, 0x32, 0x52, 0x44, 0x34, 0x30, 0x32, 0x31, 0x32, 0x31, 0x31, - 0x28, 0xca, 0x9c, 0xad, 0xbb, 0x2d, 0xf0, 0x41, 0x6e, 0xce, 0xad, 0x73, 0xae, 0x1c, 0xd1, 0x14, - 0x6f, 0x9a, 0x75, 0x18, 0xa8, 0x91, 0x68, 0xe4, 0x09, 0xf4, 0x0f, 0xd7, 0xff, 0x93, 0x7d, 0x1b, - 0xeb, 0x84, 0xce, 0xad, 0x9e, 0xcf, 0xc9, 0xab, 0x18, 0x59, 0xb6, 0xde, 0x82, 0x13, 0x7c, 0x88, - 0x69, 0x63, 0xff, 0x6f, 0x3c, 0xd2, 0xb9, 0x29, 0x09, 0xf8, 0x97, 0xaa, 0x74, 0xa5, 0x16, 0x0d, - 0xf9, 0x51, 0x9e, 0x9f, 0x63, 0xc6, 0x1e, 0x32, 0x8c, 0x0c, 0xe9, 0xa0, 0x56, 0x95, 0xd1, 0x9d, - 0xea, 0xa9, 0x82, 0xc3, 0x30, 0x15, 0x21, 0xd8, 0x8f, 0x10, 0x25, 0x61, 0xe6, 0x6d, 0x75, 0x6d, - 0xcb, 0x08, 0xc3, 0x9b, 0x03, 0x6a, 0x28, 0x6d, 0x42, 0xbf, 0x00, 0xd2, 0x24, 0xfa, 0x08, 0xee, - 0x6b, 0x46, 0xb7, 0x2c, 0x7b, 0xb0, 0xda, 0x86, 0x13, 0x14, 0x73, 0x14, 0x4d, 0x45, 0xd3, 0xd4, - 0xd9, 0x80, 0xf5, 0xb8, 0x76, 0x13, 0x1e, 0xf6, 0xb1, 0x4a, 0xb3, 0x8b, 0xe2, 0x9a, 0x5a, 0x11, - 0x64, 0x11, 0x55, 0xc3, 0x14, 0xfd, 0x1b, 0xce, 0x0c, 0xdc, 0x38, 0xda, 0xa1, 0x84, 0x66, 0xd9, - 0x9b, 0x93, 0xed, 0x0f, 0xb4, 0x19, 0x38, 0x62, 0x53, 0x85, 0xb9, 0xe5, 0x89, 0xcd, 0xfe, 0x9e, - 0x4d, 0xe2, 0x14, 0x9f, 0xf4, 0x53, 0x1c, 0x46, 0xf4, 0x40, 0x2c, 0xcc, 0xda, 0x82, 0x69, 0x15, - 0x88, 0x18, 0x62, 0xb7, 0xb4, 0xd5, 0xaf, 0x4b, 0x9e, 0x48, 0xca, 0xf4, 0x11, 0xec, 0x2d, 0x2c, - 0x9d, 0x91, 0xad, 0xda, 0x13, 0x0a, 0x16, 0x86, 0x41, 0x18, 0x08, 0x01, 0xef, 0x97, 0x11, 0x1f, - 0x1a, 0xe7, 0x0c, 0xc9, 0x6d, 0x9d, 0xb9, 0x49, 0x0b, 0x6b, 0x9e, 0xd4, 0x72, 0x4d, 0x1d, 0x59 -}; - void chessc2_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT @@ -1072,9 +970,7 @@ void chessc2_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= chessc2_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -1125,34 +1021,15 @@ void klxyj_decrypt(running_machine &machine) } } -static const uint8_t zhongguo_tab[0x100] = { - 0x68, 0x56, 0xc2, 0x54, 0xa2, 0x8c, 0x7b, 0x4f, 0x37, 0xac, 0x60, 0xf8, 0x24, 0xdf, 0x3e, 0x6b, - 0xe2, 0x89, 0x3d, 0xf3, 0x31, 0x83, 0x4a, 0x65, 0x27, 0x98, 0xc5, 0xbf, 0x78, 0x3e, 0x6c, 0x02, - 0x07, 0x96, 0x88, 0x4d, 0xae, 0xa6, 0x56, 0x3a, 0x4a, 0xd5, 0xb8, 0x7e, 0x0b, 0xa7, 0x1d, 0xbc, - 0xfa, 0xba, 0xad, 0xa9, 0xcb, 0x02, 0xba, 0x66, 0xe5, 0x41, 0x63, 0x1a, 0xb0, 0xca, 0x8a, 0xcf, - 0x1e, 0x76, 0xf9, 0x8f, 0x7c, 0xe7, 0xd0, 0xc0, 0x7b, 0xfc, 0x32, 0xbc, 0x7a, 0x95, 0x2f, 0xb4, - 0x16, 0x88, 0xf5, 0xc6, 0xf4, 0xe3, 0x33, 0x5d, 0xce, 0x65, 0xce, 0xca, 0xbc, 0x37, 0xc8, 0x20, - 0xc5, 0xef, 0x6d, 0x55, 0xa6, 0xc7, 0xbf, 0x96, 0xe1, 0x1a, 0x24, 0xea, 0x09, 0x20, 0x4e, 0x0b, - 0x4d, 0xeb, 0x6b, 0x82, 0x44, 0xa1, 0x8f, 0x01, 0xf8, 0xfb, 0x5e, 0x05, 0x35, 0xff, 0xfe, 0xac, - 0x13, 0xf9, 0x3c, 0xd4, 0xc1, 0xc0, 0xfd, 0x76, 0x95, 0x27, 0xe7, 0x41, 0x52, 0xc1, 0x51, 0x7a, - 0xb8, 0xda, 0x69, 0x13, 0x52, 0xb3, 0xa4, 0x0b, 0x7b, 0xfd, 0x6b, 0x05, 0xb2, 0x98, 0x04, 0x2c, - 0x20, 0x8c, 0xbe, 0x46, 0x68, 0x48, 0x60, 0x17, 0xae, 0x1b, 0xd4, 0xf8, 0xea, 0xf1, 0x10, 0xb8, - 0x6f, 0x4f, 0x45, 0xb3, 0xb6, 0x90, 0x4c, 0x31, 0x70, 0x61, 0x4d, 0x02, 0xcc, 0x7b, 0xb1, 0x57, - 0x06, 0xa0, 0x4b, 0xe2, 0x31, 0xd9, 0xc2, 0x31, 0x45, 0xee, 0x42, 0x48, 0x6b, 0x26, 0x63, 0x7e, - 0x89, 0x40, 0x59, 0x9a, 0x09, 0xb1, 0x5e, 0x2d, 0xef, 0x20, 0x5c, 0x32, 0x1b, 0x20, 0xdf, 0xe5, - 0xda, 0x2d, 0x3b, 0xe1, 0xb4, 0xe9, 0xfa, 0x7d, 0x71, 0x97, 0x88, 0x68, 0x6d, 0xd8, 0x22, 0x82, - 0x1e, 0xa6, 0xfc, 0xfe, 0xe3, 0x8e, 0xb1, 0xb7, 0x0f, 0x32, 0xf1, 0xcf, 0x36, 0xfe, 0x65, 0x8e -}; - void zhongguo_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT @@ -1163,9 +1040,7 @@ void zhongguo_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= zhongguo_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -1217,34 +1092,15 @@ void gonefsh2_decrypt(running_machine &machine) } } -static const uint8_t sddz_tab[0x100] = { - 0xd7, 0x5f, 0xc8, 0x5b, 0xbf, 0xfa, 0x61, 0x0c, 0xdd, 0xab, 0xc3, 0x26, 0x3b, 0xd8, 0xbc, 0x1e, - 0xa6, 0x4b, 0xcf, 0xdc, 0x12, 0x61, 0x70, 0xd2, 0x76, 0xef, 0x44, 0xe8, 0x9a, 0x65, 0xf5, 0x13, - 0xb3, 0x1e, 0xcd, 0x00, 0xdf, 0x30, 0xa7, 0x9d, 0xb7, 0x49, 0xdf, 0xf6, 0xa7, 0x0b, 0x1a, 0x58, - 0x2a, 0xea, 0x0e, 0x92, 0x39, 0x96, 0x25, 0x5d, 0x1b, 0xda, 0x27, 0x63, 0x4f, 0xe0, 0xda, 0x04, - 0x7e, 0x10, 0x16, 0xbc, 0xff, 0x52, 0x73, 0x4a, 0x82, 0xd4, 0xba, 0xd8, 0x13, 0xb3, 0xe9, 0xfd, - 0x9a, 0x6c, 0x6c, 0xd6, 0xef, 0x63, 0x9d, 0xa2, 0xf6, 0x26, 0x94, 0x55, 0x25, 0x93, 0x21, 0x26, - 0x2a, 0xbf, 0x4b, 0xc8, 0x22, 0x18, 0x2d, 0x5d, 0xb6, 0x02, 0xba, 0x70, 0xcd, 0xae, 0xd5, 0xed, - 0x5f, 0x48, 0xca, 0xd5, 0x3d, 0x41, 0xd0, 0xee, 0xd7, 0xd9, 0xba, 0x01, 0x6c, 0x34, 0x58, 0x33, - 0xde, 0x44, 0x6d, 0xee, 0x95, 0x5c, 0x0f, 0x97, 0x98, 0xdc, 0xf0, 0x76, 0xc5, 0x73, 0x46, 0x51, - 0x1c, 0xe5, 0xe0, 0xda, 0x4b, 0x38, 0xb6, 0x08, 0x20, 0xfd, 0xa2, 0xbc, 0x0e, 0xcc, 0xa9, 0xac, - 0x84, 0xb8, 0x42, 0x5c, 0x5b, 0x14, 0x4f, 0xc3, 0xb0, 0x2b, 0xbd, 0x68, 0x42, 0xbc, 0x9c, 0x01, - 0x7e, 0xec, 0xd6, 0x3b, 0x20, 0x10, 0x07, 0x78, 0xdf, 0x18, 0xa5, 0xa2, 0x15, 0xa2, 0x7a, 0xa0, - 0x7c, 0xf1, 0xcb, 0x1a, 0x7d, 0x69, 0x47, 0xe9, 0xd9, 0xf6, 0xf7, 0x78, 0x41, 0x8f, 0x0f, 0x24, - 0xed, 0xb5, 0x04, 0x39, 0x09, 0xf0, 0x7b, 0x06, 0x14, 0xb4, 0xc1, 0xe2, 0xc5, 0xa0, 0x2d, 0x75, - 0xb9, 0xb7, 0xa8, 0x81, 0x03, 0x13, 0xce, 0x0e, 0x47, 0x45, 0x0f, 0xfe, 0xe5, 0x24, 0xf7, 0x77, - 0x4c, 0x87, 0xd2, 0x04, 0xe9, 0xc1, 0xea, 0x7b, 0xbe, 0x58, 0x4f, 0x35, 0x27, 0xfc, 0xf1, 0x11 -}; - -void sddz_decrypt(running_machine &machine) +void cjddz_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1_ALT; IGS27_CRYPT2_ALT @@ -1255,130 +1111,21 @@ void sddz_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= sddz_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } -static const uint8_t lhzb3_tab[0x100] = { - 0x13, 0x45, 0x21, 0xa1, 0x69, 0x9a, 0x05, 0xda, 0x7d, 0x10, 0xda, 0x7f, 0x34, 0x9f, 0xf3, 0x64, - 0x35, 0xf9, 0x16, 0x1c, 0xd4, 0x60, 0x02, 0xf3, 0x42, 0xc7, 0x42, 0x29, 0xf3, 0x2c, 0x31, 0x71, - 0x50, 0x35, 0x4e, 0xaa, 0x9f, 0x09, 0xc3, 0xdd, 0x2f, 0x72, 0x30, 0x77, 0xc7, 0x30, 0xbc, 0xc8, - 0x51, 0xa0, 0x5e, 0xbb, 0xc3, 0x8e, 0x69, 0xd7, 0x4f, 0x57, 0x56, 0x77, 0xcb, 0x43, 0xd6, 0x46, - 0x62, 0x21, 0x18, 0xfd, 0x7d, 0x24, 0x58, 0x61, 0xec, 0xfe, 0xa9, 0x77, 0x59, 0x3b, 0x03, 0x0a, - 0xef, 0xdf, 0x90, 0x60, 0x46, 0x43, 0x33, 0x38, 0x92, 0x2d, 0x5a, 0x08, 0x0d, 0x2f, 0x05, 0x75, - 0x3e, 0x60, 0x87, 0x22, 0xb7, 0xbf, 0xd6, 0xf9, 0x17, 0x86, 0xea, 0x02, 0xbe, 0x23, 0xba, 0xd3, - 0xdd, 0x0d, 0x3e, 0x8c, 0x65, 0xa0, 0xf8, 0xd8, 0x2f, 0x35, 0xc6, 0x26, 0x6c, 0x81, 0xe6, 0x29, - 0x50, 0x30, 0x4a, 0x8e, 0xfa, 0xc2, 0x1e, 0xfd, 0xa7, 0xa5, 0x98, 0x53, 0x18, 0x94, 0xff, 0x1d, - 0x41, 0x2f, 0xff, 0x58, 0x33, 0xdc, 0x2b, 0x67, 0x4b, 0xdd, 0xd3, 0x56, 0x9c, 0xb2, 0x09, 0x4e, - 0x9b, 0xb1, 0xee, 0x58, 0x0a, 0xe4, 0x42, 0x56, 0x26, 0x23, 0x2c, 0x3f, 0x14, 0x73, 0x46, 0x9a, - 0xa1, 0x42, 0x17, 0x12, 0xdb, 0xa2, 0xdd, 0x5d, 0x0c, 0xec, 0xdc, 0xf7, 0xc1, 0x76, 0xe0, 0x24, - 0x65, 0xef, 0x41, 0x83, 0x35, 0x38, 0x78, 0x0e, 0x65, 0x82, 0xe3, 0x55, 0x90, 0xa8, 0xd5, 0xf7, - 0x66, 0xcf, 0xe2, 0x61, 0x91, 0x3c, 0x69, 0xcb, 0xe7, 0x75, 0x62, 0x6f, 0xd7, 0x9b, 0x69, 0x0c, - 0x0d, 0x07, 0x0c, 0x9c, 0x68, 0x24, 0x51, 0x51, 0x1f, 0x8d, 0x8b, 0xd6, 0x2e, 0x67, 0x5f, 0xc3, - 0x07, 0x00, 0x12, 0x61, 0x77, 0xa8, 0x15, 0xa1, 0xd6, 0xd0, 0xd3, 0x57, 0x73, 0x62, 0xb9, 0xbb -}; - -void lhzb3_decrypt(running_machine &machine) -{ - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; - - for (int i = 0; i < rom_size / 2; i++) - { - uint16_t x = src[i]; - - IGS27_CRYPT1 - IGS27_CRYPT2_ALT - // IGS27_CRYPT3 - IGS27_CRYPT4 - IGS27_CRYPT5 - IGS27_CRYPT6_ALT - IGS27_CRYPT7 - IGS27_CRYPT8 - - x ^= lhzb3_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; - } -} - -static const uint8_t mgfx_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x38, 0x33, 0x52, 0x44, 0x34, 0x30, 0x32, 0x31, 0x32, 0x31, 0x32, - 0x82, 0x6b, 0xca, 0xbe, 0x9b, 0x9f, 0xc3, 0xa5, 0x8f, 0x2a, 0x9f, 0x0e, 0x26, 0x28, 0x4a, 0x9d, - 0xa2, 0x57, 0xfc, 0x43, 0xf3, 0x34, 0x05, 0x72, 0x1e, 0x59, 0xd9, 0xa0, 0xe7, 0x16, 0x5b, 0xff, - 0xc6, 0x4f, 0x6e, 0x7a, 0x09, 0x96, 0xba, 0xf3, 0x46, 0x89, 0xbb, 0xbc, 0x04, 0x6d, 0x11, 0x54, - 0xa9, 0x0b, 0x03, 0x63, 0xa6, 0xcb, 0x54, 0xf7, 0xe2, 0x0f, 0x4b, 0x01, 0x65, 0xd3, 0xfd, 0x0b, - 0x46, 0x82, 0xde, 0x3c, 0xd7, 0x1b, 0x87, 0x8e, 0x0e, 0x84, 0xca, 0x4d, 0x37, 0x2e, 0xf4, 0xd4, - 0xd8, 0xeb, 0x61, 0x84, 0xe5, 0x0c, 0x46, 0x05, 0x25, 0xbf, 0xbb, 0xc0, 0xe4, 0xa7, 0x07, 0x9d, - 0xda, 0xbd, 0x31, 0xfa, 0x5b, 0x66, 0xc3, 0xec, 0xc1, 0xd5, 0xe1, 0xb9, 0x17, 0xa4, 0x8b, 0x96, - 0x07, 0xae, 0x2f, 0x9d, 0x06, 0x30, 0x73, 0x12, 0xbe, 0x1f, 0x40, 0xd7, 0xbb, 0xcc, 0x12, 0x2d, - 0x5a, 0xb6, 0x7f, 0xad, 0xef, 0xb0, 0x06, 0x86, 0x36, 0x34, 0x1a, 0xf8, 0xfc, 0x06, 0x6f, 0x11, - 0x0e, 0x0c, 0x84, 0xa7, 0x62, 0x6d, 0x71, 0x97, 0x84, 0xe9, 0xf3, 0x3c, 0x44, 0x79, 0xb5, 0x32, - 0x9e, 0x27, 0xe1, 0x4c, 0xea, 0x30, 0xe7, 0xd4, 0x45, 0x57, 0x8d, 0x02, 0x3e, 0x8c, 0x38, 0xbf, - 0xc5, 0xbe, 0x79, 0x9b, 0x51, 0xfd, 0xdb, 0x0b, 0x51, 0xd5, 0xec, 0xe8, 0xd6, 0xe6, 0x89, 0x26, - 0x7e, 0xc8, 0x6f, 0xd1, 0xa4, 0x1e, 0xff, 0x4d, 0xc5, 0xf8, 0x51, 0xce, 0x36, 0x6f, 0x7d, 0x16, - 0x04, 0x7b, 0x26, 0x6f, 0x2c, 0x18, 0x47, 0xe8, 0xfc, 0x99, 0x42, 0xd3, 0xc9, 0x4c, 0x26, 0x7f, - 0xd2, 0x4f, 0x40, 0x32, 0x74, 0xb2, 0xe6, 0x6b, 0x90, 0xcf, 0x7f, 0x56, 0x3a, 0xe5, 0xd7, 0x8f -}; - -void mgfx_decrypt(running_machine &machine) -{ - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; - - for (int i = 0; i < rom_size / 2; i++) - { - uint16_t x = src[i]; - - IGS27_CRYPT1_ALT - // IGS27_CRYPT2 - IGS27_CRYPT3_ALT2 - IGS27_CRYPT4 - // IGS27_CRYPT5 - IGS27_CRYPT6_ALT - IGS27_CRYPT7 - IGS27_CRYPT8 - - x ^= mgfx_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; - } -} // IGS FOR V000CN 2004 12 01 - -static const uint8_t lhzb4_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x31, 0x36, 0x39, 0x52, 0x44, 0x32, 0x30, 0x34, 0x30, 0x37, 0x33, 0x30, - 0x87, 0xa5, 0x22, 0x6e, 0x2f, 0x89, 0xc6, 0x3b, 0xf3, 0x4d, 0x29, 0xd5, 0x46, 0x17, 0x9c, 0x38, - 0xc2, 0xe4, 0x16, 0x4b, 0x36, 0xfd, 0xe0, 0x7f, 0xf2, 0xbe, 0x83, 0xa6, 0x52, 0x87, 0xf2, 0x11, - 0x88, 0x03, 0xf4, 0xee, 0xaf, 0x98, 0xd5, 0xe0, 0x0e, 0x2f, 0x4d, 0xdf, 0xa9, 0x26, 0xb1, 0x53, - 0x0e, 0x92, 0x58, 0x6c, 0x5e, 0xb9, 0x50, 0xc5, 0x99, 0xcf, 0x42, 0x39, 0x2f, 0xf1, 0xa3, 0x04, - 0xc5, 0x60, 0x1d, 0x1e, 0x44, 0xff, 0x3d, 0xd5, 0x28, 0x0e, 0x5d, 0xa9, 0x08, 0x29, 0xd4, 0x6c, - 0x61, 0x7c, 0x5d, 0x9b, 0xa7, 0x48, 0xc5, 0xf7, 0x8e, 0x9b, 0xd9, 0x67, 0x95, 0x4b, 0x8f, 0x12, - 0xd4, 0x35, 0x74, 0xb8, 0x07, 0xb4, 0x55, 0x52, 0xdc, 0x64, 0x32, 0xea, 0x7a, 0x18, 0x5f, 0xbc, - 0x52, 0x19, 0xfc, 0x8e, 0x2a, 0xa2, 0x98, 0x4d, 0x66, 0x99, 0x21, 0xe9, 0x9a, 0x8e, 0x0f, 0x72, - 0x4d, 0xf9, 0xd1, 0x74, 0x10, 0xb0, 0x77, 0x8f, 0xc0, 0xa7, 0xa2, 0x5b, 0x17, 0xed, 0xa9, 0x7b, - 0x7a, 0xe3, 0x0d, 0xff, 0xfe, 0xbe, 0x1f, 0xff, 0xbb, 0x40, 0xf0, 0x76, 0x56, 0xb2, 0x79, 0x5d, - 0xc9, 0x26, 0x0c, 0x08, 0x76, 0xeb, 0xfa, 0xc5, 0x6c, 0x51, 0x86, 0xb2, 0xf9, 0x9e, 0x0a, 0xdf, - 0x70, 0x50, 0x68, 0xa5, 0x3c, 0x96, 0xb4, 0x46, 0x25, 0x09, 0x1f, 0xc6, 0xe2, 0xaf, 0x26, 0x09, - 0xe0, 0x32, 0xfd, 0x2e, 0x52, 0x5d, 0x36, 0x2b, 0x79, 0xd8, 0xb6, 0xa9, 0x35, 0x24, 0xda, 0x22, - 0xcd, 0xda, 0xe5, 0x39, 0xfb, 0x20, 0xad, 0x59, 0x3c, 0x6c, 0x86, 0x92, 0x56, 0x7d, 0x6f, 0xb0, - 0x29, 0x96, 0x7c, 0x9d, 0xbb, 0xfd, 0x83, 0xf9, 0x7f, 0xb5, 0x0a, 0xf8, 0xe6, 0x77, 0x71, 0x7b -}; - void lhzb4_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 // IGS27_CRYPT2 @@ -1389,9 +1136,7 @@ void lhzb4_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8_ALT - x ^= lhzb4_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -1399,34 +1144,15 @@ void lhzb4_decrypt(running_machine &machine) ////////////////////////////////////////////////////////////////////// -static const uint8_t superkds_tab[256] = { - 0x49, 0x47, 0x53, 0x30, 0x32, 0x30, 0x32, 0x52, 0x44, 0x32, 0x30, 0x35, 0x30, 0x31, 0x30, 0x33, - 0x0a, 0x68, 0x3c, 0x24, 0x56, 0x67, 0xed, 0xe3, 0x3a, 0x99, 0x20, 0x24, 0x09, 0x4d, 0x0c, 0xb6, - 0x0d, 0xbb, 0xe0, 0xe4, 0x93, 0x79, 0x6c, 0x10, 0x3b, 0x3b, 0x10, 0x91, 0x7e, 0xcf, 0xe5, 0xc9, - 0x80, 0x58, 0x2b, 0x8b, 0x18, 0xca, 0xf3, 0xac, 0x1d, 0xa6, 0x0d, 0xe7, 0xf4, 0xf7, 0x34, 0xf6, - 0x57, 0x8d, 0x79, 0xef, 0x67, 0x79, 0xed, 0xdc, 0xf5, 0xca, 0x92, 0x9e, 0x0d, 0x86, 0x84, 0x04, - 0xc5, 0xeb, 0x64, 0x27, 0x44, 0xe7, 0x05, 0x09, 0x15, 0xd5, 0x5a, 0x6d, 0xae, 0x7a, 0xa0, 0xf9, - 0x3c, 0x40, 0xc8, 0x8b, 0xb1, 0xb1, 0x27, 0xd8, 0x10, 0x37, 0x61, 0x4b, 0xf8, 0x12, 0x92, 0x1d, - 0x70, 0x9a, 0xbf, 0xb0, 0xf2, 0xb7, 0x7d, 0x32, 0xba, 0x9e, 0xe0, 0x6f, 0x4f, 0xce, 0xa6, 0xf6, - 0x53, 0x4a, 0xa5, 0x70, 0x88, 0x18, 0x72, 0x3c, 0x24, 0xfa, 0x53, 0x50, 0x57, 0x6b, 0x67, 0x4c, - 0x19, 0xdd, 0x14, 0xdf, 0x39, 0x32, 0xb1, 0x5f, 0xa2, 0x79, 0x75, 0xa4, 0xf1, 0xea, 0xa0, 0x25, - 0x35, 0x24, 0xe8, 0x56, 0x05, 0xa5, 0x26, 0x41, 0xc8, 0x8a, 0x41, 0x63, 0x41, 0x89, 0x5b, 0xc9, - 0x59, 0x2c, 0x3b, 0x6c, 0x31, 0x50, 0xfb, 0xc9, 0x68, 0xdd, 0xf2, 0xc4, 0xa9, 0xc7, 0xe4, 0xbf, - 0x79, 0x46, 0x69, 0xf6, 0x3f, 0x51, 0x9b, 0x1e, 0x95, 0x61, 0x04, 0x3e, 0xce, 0x64, 0xc6, 0xcd, - 0xc8, 0xff, 0x0c, 0x0d, 0xf3, 0x08, 0xb1, 0xa7, 0xa2, 0x44, 0x30, 0x88, 0x92, 0x5d, 0xcc, 0xfb, - 0xb8, 0x27, 0x00, 0x07, 0x4f, 0x14, 0x29, 0x0b, 0x22, 0xf5, 0x72, 0x98, 0x17, 0xf3, 0x00, 0x8f, - 0xfd, 0xcd, 0x60, 0x7c, 0x97, 0x54, 0x2d, 0x32, 0xe9, 0x24, 0x05, 0xa7, 0xc1, 0xa4, 0xaf, 0x11 -}; - void superkds_decrypt(running_machine &machine) { - auto const src = util::little_endian_cast(reinterpret_cast(machine.root_device().memregion("user1")->base())); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT @@ -1437,21 +1163,19 @@ void superkds_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= superkds_tab[(i >> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } void fearless_decrypt(running_machine &machine) { - auto const src = util::little_endian_cast(reinterpret_cast(machine.root_device().memregion("user1")->base())); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 // IGS27_CRYPT2 @@ -1462,9 +1186,7 @@ void fearless_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= superkds_tab[(i >> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -1516,34 +1238,15 @@ void pgm_decrypt_pgm3in1(running_machine &machine) // IGS MAHJONG CHINA VS107C -static const uint8_t slqz3_tab[0x100] = { - 0xef, 0xdf, 0x90, 0x60, 0x46, 0x43, 0x33, 0x38, 0x92, 0x2d, 0x5a, 0x08, 0x0d, 0x2f, 0x05, 0x75, - 0xa1, 0x42, 0x17, 0x12, 0xdb, 0xa2, 0xdd, 0x5d, 0x0c, 0xec, 0xdc, 0xf7, 0xc1, 0x76, 0xe0, 0x24, - 0x65, 0xef, 0x41, 0x83, 0x35, 0x38, 0x78, 0x0e, 0x65, 0x82, 0xe3, 0x55, 0x90, 0xa8, 0xd5, 0xf7, - 0x66, 0xcf, 0xe2, 0x61, 0x91, 0x3c, 0x69, 0xcb, 0xe7, 0x75, 0x62, 0x6f, 0xd7, 0x9b, 0x69, 0x0c, - 0x0d, 0x07, 0x0c, 0x9c, 0x68, 0x24, 0x51, 0x51, 0x1f, 0x8d, 0x8b, 0xd6, 0x2e, 0x67, 0x5f, 0xc3, - 0x13, 0x45, 0x21, 0xa1, 0x69, 0x9a, 0x05, 0xda, 0x7d, 0x10, 0xda, 0x7f, 0x34, 0x9f, 0xf3, 0x64, - 0x35, 0xf9, 0x16, 0x1c, 0xd4, 0x60, 0x02, 0xf3, 0x42, 0xc7, 0x42, 0x29, 0xf3, 0x2c, 0x31, 0x71, - 0x50, 0x35, 0x4e, 0xaa, 0x9f, 0x09, 0xc3, 0xdd, 0x2f, 0x72, 0x30, 0x77, 0xc7, 0x30, 0xbc, 0xc8, - 0x51, 0xa0, 0x5e, 0xbb, 0xc3, 0x8e, 0x69, 0xd7, 0x4f, 0x57, 0x56, 0x77, 0xcb, 0x43, 0xd6, 0x46, - 0x62, 0x21, 0x18, 0xfd, 0x7d, 0x24, 0x58, 0x61, 0xec, 0xfe, 0xa9, 0x77, 0x59, 0x3b, 0x03, 0x0a, - 0x07, 0x00, 0x12, 0x61, 0x77, 0xa8, 0x15, 0xa1, 0xd6, 0xd0, 0xd3, 0x57, 0x73, 0x62, 0xb9, 0xbb, - 0x3e, 0x60, 0x87, 0x22, 0xb7, 0xbf, 0xd6, 0xf9, 0x17, 0x86, 0xea, 0x02, 0xbe, 0x23, 0xba, 0xd3, - 0xdd, 0x0d, 0x3e, 0x8c, 0x65, 0xa0, 0xf8, 0xd8, 0x2f, 0x35, 0xc6, 0x26, 0x6c, 0x81, 0xe6, 0x29, - 0x50, 0x30, 0x4a, 0x8e, 0xfa, 0xc2, 0x1e, 0xfd, 0xa7, 0xa5, 0x98, 0x53, 0x18, 0x94, 0xff, 0x1d, - 0x41, 0x2f, 0xff, 0x58, 0x33, 0xdc, 0x2b, 0x67, 0x4b, 0xdd, 0xd3, 0x56, 0x9c, 0xb2, 0x09, 0x4e, - 0x9b, 0xb1, 0xee, 0x58, 0x0a, 0xe4, 0x42, 0x56, 0x26, 0x23, 0x2c, 0x3f, 0x14, 0x73, 0x46, 0x9a -}; - void slqz3_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x200000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; // not 100% verified IGS27_CRYPT1 @@ -1555,43 +1258,22 @@ void slqz3_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= slqz3_tab[(i/2) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } //IGS COPYRIGHT 1999.99.99 // V214US -static const uint8_t fruitpar_tab[0x100] = { - 0xe9, 0x0b, 0x95, 0x7e, 0x0d, 0x7d, 0x5c, 0x1e, 0x81, 0x0e, 0xa6, 0xd4, 0x8e, 0x90, 0xd8, 0x54, - 0x27, 0x65, 0x51, 0x08, 0x1c, 0xa0, 0x3b, 0x51, 0x83, 0x60, 0x93, 0x02, 0x64, 0x69, 0x77, 0x1a, - 0xa4, 0x03, 0xb0, 0xc2, 0x34, 0x18, 0x80, 0x87, 0x7a, 0x88, 0xad, 0xd9, 0xff, 0xd0, 0xce, 0xc4, - 0x5b, 0xdc, 0xd5, 0xed, 0x5e, 0x29, 0xdd, 0xcf, 0x80, 0x1f, 0x36, 0x38, 0x8b, 0xae, 0xae, 0xfe, - 0x87, 0x27, 0x22, 0x07, 0xe6, 0x5d, 0x46, 0x79, 0xf1, 0xfc, 0xb1, 0x3d, 0x72, 0x29, 0x2c, 0xba, - 0xa3, 0x5b, 0x3c, 0xcf, 0x57, 0x79, 0xed, 0x12, 0x67, 0x34, 0xe1, 0x48, 0x5f, 0xa7, 0x9a, 0x24, - 0x6a, 0x2e, 0x04, 0x44, 0x7b, 0x84, 0x46, 0x6a, 0xbd, 0x20, 0xca, 0xf7, 0x3e, 0xd1, 0x8b, 0xad, - 0xd7, 0x98, 0x9e, 0xa6, 0x5e, 0xc6, 0x04, 0x90, 0x0f, 0x57, 0xae, 0x2b, 0x38, 0x8d, 0xd2, 0x04, - 0x25, 0xd1, 0x6d, 0x73, 0x4b, 0xc6, 0x19, 0xd3, 0xb8, 0xae, 0x11, 0x01, 0xba, 0x02, 0x82, 0x17, - 0xcf, 0x4d, 0x14, 0x6a, 0xcd, 0x4a, 0xb9, 0xc1, 0x52, 0x3e, 0xb5, 0xd8, 0x6f, 0x98, 0xee, 0x16, - 0x90, 0xc6, 0x76, 0x8a, 0xaf, 0x5a, 0x56, 0x2b, 0xb9, 0x5e, 0x9e, 0x51, 0x40, 0xf4, 0xaa, 0x6e, - 0x63, 0x32, 0xb6, 0x12, 0xfb, 0x3c, 0xa5, 0x1f, 0x07, 0xa3, 0x0d, 0x49, 0x5a, 0xfe, 0x88, 0xd1, - 0x83, 0xc7, 0x37, 0x82, 0xfd, 0x78, 0x97, 0xec, 0x98, 0xe6, 0x88, 0xe0, 0x27, 0xde, 0x9a, 0x2c, - 0x6b, 0xfd, 0x9b, 0x98, 0x40, 0xd5, 0x5f, 0x20, 0x06, 0x3e, 0xcf, 0x74, 0x52, 0xf9, 0x35, 0xae, - 0xd6, 0x8c, 0xc7, 0x53, 0x8e, 0x59, 0x71, 0x8c, 0x2d, 0x00, 0xe7, 0xa5, 0xc7, 0xf8, 0xeb, 0xc7, - 0xbf, 0x68, 0xdc, 0xf2, 0xf4, 0x4c, 0x80, 0x3e, 0x27, 0xc5, 0x13, 0x52, 0xb0, 0xc0, 0x90, 0x25 -}; - void fruitpar_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); // not 100% verified for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2 @@ -1599,44 +1281,23 @@ void fruitpar_decrypt(running_machine &machine) IGS27_CRYPT4_ALT IGS27_CRYPT5 IGS27_CRYPT6 - IGS27_CRYPT7 + IGS27_CRYPT7_ALT IGS27_CRYPT8 - x ^= fruitpar_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } -static const uint8_t oceanpar_tab[0x100] = { - 0xad, 0xe8, 0xf9, 0xf2, 0x2e, 0x20, 0x6c, 0x06, 0xfe, 0xed, 0x42, 0xaf, 0x60, 0x33, 0x7e, 0xa4, - 0x6d, 0xac, 0x09, 0x5e, 0xc0, 0x8f, 0xfb, 0xd4, 0x61, 0x61, 0x29, 0x75, 0xf4, 0x1b, 0xef, 0x67, - 0x23, 0x7d, 0x3f, 0xff, 0x48, 0xb2, 0xea, 0x81, 0x5f, 0x25, 0x2e, 0x19, 0x2c, 0xa3, 0x81, 0x19, - 0xa8, 0xb2, 0x9d, 0x75, 0xb2, 0x30, 0xcc, 0x7c, 0xf4, 0x30, 0x76, 0xd9, 0x12, 0x11, 0xe8, 0xc9, - 0x1a, 0xe0, 0x67, 0x9e, 0x28, 0xf0, 0x75, 0x75, 0x59, 0xb8, 0x62, 0x34, 0xf3, 0xed, 0x17, 0xc6, - 0xd2, 0xe0, 0x1e, 0x9a, 0x15, 0x1a, 0xf6, 0x5a, 0x0a, 0x35, 0x96, 0xe9, 0x58, 0xfd, 0x40, 0xa0, - 0x6b, 0xc8, 0x88, 0xc8, 0x25, 0x13, 0xa4, 0x5b, 0xc2, 0x5e, 0xf5, 0xf7, 0x0c, 0x49, 0xd7, 0x24, - 0xc1, 0xf0, 0xa6, 0xc7, 0x42, 0x83, 0x11, 0xe6, 0x7d, 0x2a, 0xa2, 0x9e, 0x1c, 0x18, 0x8e, 0x62, - 0xef, 0xee, 0xbb, 0x75, 0x97, 0x52, 0x10, 0xab, 0x74, 0xd0, 0x00, 0x5c, 0xd1, 0xf0, 0x59, 0xa9, - 0x4f, 0x99, 0x4a, 0xf3, 0x8f, 0xa6, 0xb4, 0x98, 0x23, 0xc6, 0xb2, 0xf0, 0xb7, 0x99, 0x6b, 0x88, - 0x7c, 0x08, 0x17, 0x9d, 0xd6, 0xe5, 0x50, 0xdc, 0x46, 0xc5, 0x9b, 0x59, 0x99, 0x19, 0x36, 0xcd, - 0x52, 0x93, 0x24, 0x15, 0x55, 0xb8, 0x77, 0xe7, 0xd6, 0xc2, 0xde, 0xd6, 0x82, 0xb8, 0x6e, 0x89, - 0xec, 0xd1, 0xb5, 0x38, 0x3a, 0x05, 0xfd, 0x68, 0x10, 0xf5, 0xdd, 0xe7, 0xbc, 0xfd, 0x06, 0x0a, - 0xa4, 0x97, 0x4c, 0x26, 0xed, 0xf3, 0xf3, 0x4d, 0x6d, 0xd4, 0x3c, 0x4a, 0xd3, 0xae, 0x30, 0xdf, - 0x15, 0xfe, 0xac, 0x3d, 0x1b, 0xe9, 0xae, 0xc5, 0xa9, 0x18, 0xdf, 0xfe, 0x92, 0xd3, 0x60, 0xd7, - 0x1b, 0x5c, 0xd9, 0x1e, 0xad, 0x8e, 0xc0, 0x40, 0xc0, 0xb7, 0xe7, 0x42, 0x04, 0xb2, 0x49, 0x00 -}; - void oceanpar_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); // not 100% verified for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1_ALT IGS27_CRYPT2_ALT @@ -1645,11 +1306,9 @@ void oceanpar_decrypt(running_machine &machine) IGS27_CRYPT5_ALT IGS27_CRYPT6 IGS27_CRYPT7_ALT - IGS27_CRYPT8_ALT - - x ^= oceanpar_tab[(i>> 1) & 0xff] << 8; + IGS27_CRYPT8 - src[i] = x; + src[i] ^= x; } } @@ -1764,103 +1423,55 @@ void pgm_dwpc_decrypt(running_machine &machine) IGS27_CRYPT7_ALT IGS27_CRYPT8 - x ^= mm_tab[(i>> 1) & 0xff] << 8; - src[i] = x; } } // IGS FOR V100CN 2007 04 18 in the ROM - -static const uint8_t mgcs3_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x32, 0x30, 0x37, 0x52, 0x44, 0x32, 0x30, 0x35, 0x30, 0x38, 0x30, 0x32, // IGS0207RD2050802 - 0x04, 0x12, 0x46, 0xbb, 0x23, 0x66, 0xae, 0x39, 0x71, 0x44, 0x17, 0xe1, 0x0b, 0xa7, 0x41, 0x7b, - 0xb3, 0xa2, 0x38, 0xe9, 0xb7, 0x39, 0xe8, 0x2b, 0x22, 0x82, 0xe4, 0x93, 0x22, 0xfc, 0x73, 0x44, - 0xb9, 0x30, 0xdc, 0xf1, 0xa8, 0x86, 0xf4, 0xd4, 0x98, 0x6a, 0xe5, 0xed, 0x8b, 0x9f, 0x40, 0x7d, - 0x83, 0xe3, 0x46, 0xc2, 0x71, 0xc4, 0x73, 0xf4, 0x60, 0xc2, 0x4c, 0x80, 0xe2, 0xa6, 0x6b, 0x83, - 0xbb, 0x22, 0xc8, 0x8a, 0xcd, 0xaa, 0x49, 0x89, 0x43, 0x92, 0x8d, 0x19, 0x02, 0x69, 0xf5, 0xf6, - 0x4c, 0x94, 0xf5, 0xb8, 0xb7, 0x2f, 0x99, 0xd2, 0x4d, 0x20, 0x5b, 0xc8, 0x05, 0x7d, 0x23, 0xb5, - 0x62, 0x21, 0x9f, 0xfc, 0x69, 0x89, 0xc6, 0x4e, 0xc9, 0xf4, 0xa8, 0xdd, 0x46, 0xbb, 0x78, 0xde, - 0x67, 0xee, 0xdc, 0x45, 0x60, 0x30, 0x73, 0xbc, 0x42, 0xd5, 0xa8, 0xe5, 0x61, 0x3a, 0xb6, 0xd1, - 0x06, 0x64, 0xfc, 0xc1, 0x56, 0xdc, 0x83, 0x1c, 0x82, 0xc9, 0xcd, 0xb0, 0x31, 0x4f, 0xe0, 0x2d, - 0x2a, 0x28, 0x93, 0xdf, 0x46, 0x82, 0x19, 0xab, 0x96, 0x18, 0xcb, 0x4d, 0xd0, 0x93, 0x3a, 0xd1, - 0xff, 0x23, 0x75, 0x4f, 0x6b, 0x59, 0x97, 0xea, 0xc6, 0x48, 0x95, 0x0b, 0x9a, 0xdd, 0x46, 0xdb, - 0xef, 0x7b, 0xb4, 0xff, 0x40, 0xda, 0xa2, 0x98, 0xa0, 0x21, 0x5d, 0x79, 0x29, 0x42, 0xc8, 0xab, - 0xa5, 0x97, 0xa2, 0x1f, 0x80, 0xba, 0x1b, 0xb2, 0xee, 0xaa, 0x97, 0x66, 0x58, 0x1b, 0xc2, 0xdf, - 0x0d, 0x1d, 0xd4, 0x1d, 0x26, 0xf2, 0x26, 0x78, 0xba, 0x29, 0xf6, 0xe1, 0x43, 0xff, 0x77, 0x58, - 0x50, 0xf6, 0x1c, 0xa8, 0x6d, 0xb7, 0x26, 0x6a, 0x50, 0x25, 0x6c, 0x39, 0x45, 0xc3, 0x6b, 0x32 -}; - void mgcs3_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; - // TODO: probably needs work IGS27_CRYPT1 IGS27_CRYPT2 IGS27_CRYPT3_ALT2 IGS27_CRYPT4 - IGS27_CRYPT5 + IGS27_CRYPT5_ALT IGS27_CRYPT6 IGS27_CRYPT7_ALT IGS27_CRYPT8 - x ^= mgcs3_tab[(i >> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } -// IGS FOR V100CN 02-12-12 in the ROM - -static const uint8_t mgzz_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x38, 0x33, 0x52, 0x44, 0x34, 0x30, 0x32, 0x31, 0x32, 0x31, 0x32, // IGS0083RD4021212 - 0x82, 0x6b, 0xca, 0xbe, 0x9b, 0x9f, 0xc3, 0xa5, 0x8f, 0x2a, 0x9f, 0x0e, 0x26, 0x28, 0x4a, 0x9d, - 0xa2, 0x57, 0xfc, 0x43, 0xf3, 0x34, 0x05, 0x72, 0x1e, 0x59, 0xd9, 0xa0, 0xe7, 0x16, 0x5b, 0xff, - 0xc6, 0x4f, 0x6e, 0x7a, 0x09, 0x96, 0xba, 0xf3, 0x46, 0x89, 0xbb, 0xbc, 0x04, 0x6d, 0x11, 0x54, - 0xa9, 0x0b, 0x03, 0x63, 0xa6, 0xcb, 0x54, 0xf7, 0xe2, 0x0f, 0x4b, 0x01, 0x65, 0xd3, 0xfd, 0x0b, - 0x46, 0x82, 0xde, 0x3c, 0xd7, 0x1b, 0x87, 0x8e, 0x0e, 0x84, 0xca, 0x4d, 0x37, 0x2e, 0xf4, 0xd4, - 0xd8, 0xeb, 0x61, 0x84, 0xe5, 0x0c, 0x46, 0x05, 0x25, 0xbf, 0xbb, 0xc0, 0xe4, 0xa7, 0x07, 0x9d, - 0xda, 0xbd, 0x31, 0xfa, 0x5b, 0x66, 0xc3, 0xec, 0xc1, 0xd5, 0xe1, 0xb9, 0x17, 0xa4, 0x8b, 0x96, - 0x07, 0xae, 0x2f, 0x9d, 0x06, 0x30, 0x73, 0x12, 0xbe, 0x1f, 0x40, 0xd7, 0xbb, 0xcc, 0x12, 0x2d, - 0x5a, 0xb6, 0x7f, 0xad, 0xef, 0xb0, 0x06, 0x86, 0x36, 0x34, 0x1a, 0xf8, 0xfc, 0x06, 0x6f, 0x11, - 0x0e, 0x0c, 0x84, 0xa7, 0x62, 0x6d, 0x71, 0x97, 0x84, 0xe9, 0xf3, 0x3c, 0x44, 0x79, 0xb5, 0x32, - 0x9e, 0x27, 0xe1, 0x4c, 0xea, 0x30, 0xe7, 0xd4, 0x45, 0x57, 0x8d, 0x02, 0x3e, 0x8c, 0x38, 0xbf, - 0xc5, 0xbe, 0x79, 0x9b, 0x51, 0xfd, 0xdb, 0x0b, 0x51, 0xd5, 0xec, 0xe8, 0xd6, 0xe6, 0x89, 0x26, - 0x7e, 0xc8, 0x6f, 0xd1, 0xa4, 0x1e, 0xff, 0x4d, 0xc5, 0xf8, 0x51, 0xce, 0x36, 0x6f, 0x7d, 0x16, - 0x04, 0x7b, 0x26, 0x6f, 0x2c, 0x18, 0x47, 0xe8, 0xfc, 0x99, 0x42, 0xd3, 0xc9, 0x4c, 0x26, 0x7f, - 0xd2, 0x4f, 0x40, 0x32, 0x74, 0xb2, 0xe6, 0x6b, 0x90, 0xcf, 0x7f, 0x56, 0x3a, 0xe5, 0xd7, 0x8f -}; - +// IGS0083RD4021212 void mgzz_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - int x = src[i]; + int x = 0; - // TODO: probably needs work IGS27_CRYPT1_ALT IGS27_CRYPT2 IGS27_CRYPT3_ALT2 IGS27_CRYPT4 - IGS27_CRYPT5_ALT + IGS27_CRYPT5 IGS27_CRYPT6_ALT IGS27_CRYPT7 IGS27_CRYPT8 - x ^= mgzz_tab[(i >> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -1912,35 +1523,15 @@ void crzybugsj_decrypt(running_machine &machine) } // IGS MAHJONG S500CN - -static const uint8_t qlgs_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x39, 0x38, 0x52, 0x44, 0x34, 0x30, 0x36, 0x30, 0x38, 0x32, 0x38, // IGS0098RD4060828 - 0x64, 0x8d, 0x4a, 0x0c, 0xd4, 0x50, 0xd6, 0xea, 0x9e, 0x5a, 0xd6, 0x31, 0xef, 0x59, 0xbf, 0x13, - 0x09, 0x4b, 0x27, 0x4e, 0x20, 0x0b, 0xbb, 0x5d, 0x79, 0x1b, 0x7e, 0xde, 0xc6, 0xb3, 0x44, 0x43, - 0xbb, 0x0b, 0x6e, 0xbd, 0xf6, 0xe6, 0xe7, 0x65, 0x0e, 0x5f, 0x5f, 0xad, 0xf9, 0xf8, 0xc7, 0x06, - 0xa3, 0xe0, 0x0d, 0xd3, 0xcc, 0x85, 0x19, 0x8e, 0x23, 0x5a, 0x08, 0x39, 0xa1, 0xea, 0xa8, 0x08, - 0x27, 0x1e, 0x34, 0x4d, 0x5b, 0xcb, 0x51, 0xa3, 0xc0, 0x7f, 0x48, 0x5f, 0x14, 0x8d, 0x86, 0x33, - 0xee, 0x56, 0x51, 0x24, 0x98, 0xdb, 0xcd, 0xaf, 0x2b, 0x80, 0x2e, 0x38, 0xe9, 0x23, 0x3f, 0xb3, - 0xdf, 0x5d, 0x14, 0x95, 0xbc, 0x17, 0x0b, 0xfd, 0xec, 0x51, 0x0a, 0x1f, 0xf8, 0x2f, 0xf3, 0xf1, - 0x22, 0x45, 0x6b, 0x1a, 0x3c, 0x24, 0xcd, 0x17, 0xc9, 0x25, 0x69, 0xb0, 0x57, 0x75, 0x01, 0x9a, - 0x1c, 0x61, 0x86, 0x6e, 0xd0, 0xe3, 0x0f, 0xca, 0xca, 0x6e, 0x1a, 0xc5, 0x5e, 0xf7, 0x08, 0x98, - 0x75, 0x44, 0xd3, 0x8b, 0x6e, 0x79, 0x11, 0x1e, 0x35, 0xe0, 0x2e, 0x7a, 0xa2, 0xf8, 0xe6, 0x17, - 0x15, 0xc1, 0x01, 0xae, 0x4f, 0x47, 0x53, 0x61, 0x92, 0x6d, 0xf3, 0x29, 0xfc, 0xfc, 0xbb, 0x81, - 0x21, 0xec, 0x00, 0x51, 0xe8, 0xf1, 0x93, 0x1d, 0xa8, 0x49, 0xf8, 0x6e, 0x83, 0xc5, 0xe5, 0x81, - 0x02, 0x16, 0xff, 0x2e, 0xf1, 0x5a, 0xd0, 0x1c, 0x7d, 0xe7, 0x0c, 0x23, 0x8d, 0x57, 0x05, 0x02, - 0x5e, 0xd4, 0x6b, 0x42, 0x61, 0xa5, 0x49, 0x6a, 0x59, 0xfa, 0x3d, 0x64, 0xb1, 0xf4, 0xf8, 0x2f, - 0x1b, 0xf8, 0xf6, 0xc7, 0x6f, 0x35, 0x7e, 0x52, 0xc3, 0x74, 0xdc, 0x8c, 0xc6, 0x20, 0xde, 0x74 -}; - void qlgs_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; // may need corrected IGS27_CRYPT1_ALT @@ -1952,40 +1543,20 @@ void qlgs_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= qlgs_tab[(i >> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } -static const uint8_t jking02_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x30, 0x34, 0x52, 0x44, 0x34, 0x30, 0x31, 0x30, 0x39, 0x32, 0x31, // IGS0004RD4010921 - 0xa5, 0x04, 0x3d, 0x57, 0xe3, 0x8d, 0x44, 0xf3, 0x50, 0x21, 0x8a, 0xe5, 0x75, 0x22, 0x3a, 0xb3, - 0xd5, 0x76, 0x66, 0x07, 0x89, 0xd4, 0xb8, 0x96, 0x20, 0x4e, 0x77, 0x53, 0xb5, 0x20, 0xbd, 0xd6, - 0x52, 0xb8, 0xf7, 0x07, 0x85, 0x05, 0x9d, 0x0f, 0x41, 0x04, 0x33, 0x80, 0xf7, 0x89, 0x81, 0xc3, - 0xf5, 0x4b, 0x0e, 0xc2, 0xfe, 0x33, 0xe3, 0xd7, 0x2b, 0xe6, 0x7e, 0xf5, 0x02, 0x91, 0x14, 0x15, - 0xd4, 0xf4, 0x0c, 0xe4, 0x5c, 0xb2, 0xb8, 0xab, 0x95, 0xd7, 0x56, 0x7e, 0xdc, 0xaa, 0x47, 0xa9, - 0x47, 0xb6, 0x8e, 0x57, 0x44, 0x13, 0x8c, 0x84, 0x76, 0xfa, 0xfa, 0x26, 0xcc, 0x89, 0x27, 0x97, - 0xe3, 0xd2, 0x74, 0x46, 0x9f, 0x2b, 0x0d, 0x9f, 0x04, 0xb1, 0xe9, 0x37, 0x5a, 0x1e, 0x05, 0x3c, - 0x82, 0xce, 0xdc, 0x1d, 0x92, 0x0c, 0x2a, 0x75, 0xb8, 0xa1, 0xe3, 0x3e, 0x4d, 0x9f, 0x6e, 0x33, - 0x38, 0x6a, 0x26, 0x85, 0x86, 0x08, 0x13, 0xc3, 0x47, 0xab, 0xe5, 0x04, 0xab, 0x7d, 0x32, 0x56, - 0x5e, 0xab, 0xf1, 0x6b, 0x21, 0xb4, 0x37, 0x82, 0xa9, 0xf4, 0x30, 0x94, 0xbc, 0x6c, 0x61, 0xc1, - 0x8a, 0xd3, 0x1c, 0xfa, 0x49, 0xe3, 0x44, 0xef, 0x15, 0xdd, 0x42, 0x3b, 0x07, 0x5e, 0x48, 0xce, - 0x94, 0x66, 0xc5, 0x9b, 0x27, 0xa6, 0x29, 0x84, 0x02, 0x0a, 0xdb, 0x82, 0x52, 0x87, 0x77, 0x19, - 0x91, 0x26, 0x4c, 0xfb, 0x21, 0x51, 0x16, 0xfb, 0x26, 0x5e, 0xf8, 0x35, 0xa5, 0x5a, 0xbd, 0x7c, - 0xda, 0x17, 0x50, 0x04, 0xde, 0x78, 0x79, 0x51, 0x7a, 0xfc, 0xda, 0x5f, 0x46, 0x89, 0x29, 0x13, - 0x06, 0x7b, 0xaf, 0xe2, 0x46, 0xed, 0x02, 0xc0, 0x33, 0x46, 0xff, 0x4b, 0xbd, 0x08, 0x0a, 0x38 -}; - +// IGS0004RD4010921 void jking02_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; // probably needs work... IGS27_CRYPT1 @@ -1997,9 +1568,7 @@ void jking02_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= jking02_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -2094,35 +1663,15 @@ void olympic5_decrypt(running_machine &machine) } - -static const uint8_t crzybugs_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x31, 0x38, 0x36, 0x52, 0x44, 0x34, 0x30, 0x34, 0x30, 0x39, 0x31, 0x30, // IGS0186RD040910 - 0xa4, 0x16, 0xa0, 0x3c, 0x4e, 0xd6, 0x43, 0x3f, 0xcb, 0xf2, 0xb4, 0x36, 0xd4, 0x13, 0x81, 0x30, - 0x71, 0x69, 0xb9, 0x44, 0xeb, 0x86, 0x7a, 0x95, 0xf4, 0x7a, 0xb5, 0x8c, 0x15, 0x35, 0x45, 0x52, - 0x59, 0x19, 0x30, 0x8c, 0x38, 0xde, 0x3c, 0x5b, 0xc6, 0xab, 0xb6, 0x93, 0x1c, 0x72, 0x7e, 0x3a, - 0x07, 0x8d, 0x57, 0x44, 0xf0, 0x97, 0x6e, 0x8d, 0x0b, 0x8c, 0x28, 0x18, 0xc4, 0x23, 0x30, 0x86, - 0x66, 0x6c, 0xc1, 0xda, 0x0e, 0xa6, 0x31, 0x6c, 0xd0, 0x63, 0xbf, 0x2a, 0x27, 0xdf, 0x9e, 0x17, - 0xa2, 0x9d, 0x41, 0xfd, 0xcd, 0x43, 0xe9, 0x75, 0x5e, 0xb8, 0x6d, 0x1a, 0xa1, 0x7b, 0x49, 0x0a, - 0x25, 0x47, 0xea, 0x9d, 0xa8, 0xe5, 0x39, 0x69, 0x40, 0x51, 0x66, 0x76, 0xcc, 0x10, 0xf6, 0xbe, - 0x9a, 0xd1, 0x10, 0xe9, 0x5a, 0x43, 0x04, 0x47, 0x43, 0x36, 0x1c, 0x0d, 0x84, 0xf5, 0xa8, 0xd4, - 0xed, 0xe2, 0x44, 0x4f, 0xde, 0x53, 0x6d, 0x4c, 0x70, 0xad, 0x44, 0xee, 0xe3, 0xbf, 0xa1, 0x29, - 0x48, 0x61, 0x5b, 0x7e, 0x6f, 0x4e, 0xd6, 0xf8, 0x13, 0x3e, 0xcf, 0x68, 0x44, 0x47, 0x64, 0xdd, - 0x16, 0x76, 0x67, 0x66, 0x88, 0xa9, 0xe4, 0x0b, 0xb7, 0xb0, 0xf0, 0x09, 0x44, 0xa4, 0xb5, 0x4e, - 0x02, 0x86, 0xbb, 0x35, 0xe4, 0x1c, 0x78, 0x83, 0x27, 0x09, 0x1b, 0xa2, 0xbb, 0x2b, 0x96, 0x1c, - 0xf8, 0x3a, 0xea, 0x5b, 0x7e, 0x9e, 0xb7, 0x9f, 0x6d, 0x90, 0x03, 0x40, 0xc7, 0x75, 0x4a, 0x26, - 0x22, 0x77, 0xc7, 0x86, 0x92, 0x66, 0x02, 0xdf, 0xd5, 0xce, 0x9a, 0x34, 0xc1, 0x58, 0x55, 0x8b, - 0xeb, 0x66, 0x65, 0xa6, 0x99, 0xea, 0xfd, 0x00, 0xea, 0x88, 0x14, 0x0c, 0x44, 0xec, 0x79, 0xa9 -}; - void crzybugs_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT @@ -2133,9 +1682,7 @@ void crzybugs_decrypt(running_machine &machine) IGS27_CRYPT7 IGS27_CRYPT8 - x ^= crzybugs_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -2161,13 +1708,13 @@ static const uint8_t icescape_tab[0x100] = { void icescape_decrypt(running_machine &machine) { - auto const src = util::little_endian_cast(reinterpret_cast(machine.root_device().memregion("user1")->base())); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT // $18ed0 @@ -2180,52 +1727,31 @@ void icescape_decrypt(running_machine &machine) x ^= icescape_tab[(i>> 1) & 0xff] << 8; - src[i] = x; + src[i] ^= x; } } -static const uint8_t tripfev_tab[0x100] = { - 0x49, 0x47, 0x53, 0x30, 0x32, 0x31, 0x35, 0x52, 0x44, 0x34, 0x30, 0x35, 0x30, 0x36, 0x32, 0x30, // IGS0213RD4050620 - 0xc2, 0x79, 0xb0, 0xbf, 0xc7, 0xe0, 0x48, 0x2b, 0x40, 0x7c, 0x02, 0x52, 0xfb, 0xf2, 0xec, 0xfa, - 0xa3, 0xfe, 0xd0, 0xf8, 0x8b, 0xb5, 0x9e, 0x8b, 0xba, 0xf9, 0x17, 0xfb, 0x37, 0x3d, 0xbc, 0x72, - 0x96, 0x7b, 0xf6, 0x1b, 0xc3, 0x72, 0x86, 0x79, 0x0e, 0x25, 0x30, 0x09, 0x77, 0x90, 0xa3, 0x1b, - 0x3c, 0xad, 0xac, 0xee, 0xa1, 0xa8, 0x9c, 0x0b, 0xff, 0x5e, 0xf7, 0xe4, 0x10, 0x1b, 0x5e, 0xac, - 0x79, 0x95, 0xbf, 0x79, 0x99, 0x24, 0xbb, 0x98, 0x91, 0x44, 0x57, 0x31, 0x94, 0x4d, 0xe7, 0x1c, - 0x70, 0x71, 0x38, 0x02, 0x5d, 0xf6, 0xfd, 0xb8, 0x06, 0xb5, 0x7c, 0xd8, 0xd6, 0xd4, 0x79, 0xa1, - 0x84, 0xc0, 0x63, 0x11, 0xe2, 0x6e, 0xbd, 0x41, 0xe2, 0xd2, 0xd0, 0x01, 0xe9, 0x9f, 0x8f, 0xb4, - 0x58, 0x41, 0xca, 0x6d, 0x58, 0x19, 0x97, 0x4a, 0xe7, 0xf8, 0xfe, 0x11, 0x20, 0xde, 0xe4, 0x0a, - 0xcf, 0xf4, 0x3a, 0x1c, 0x35, 0xc7, 0x66, 0x2b, 0x18, 0xc7, 0xf1, 0xb1, 0x0f, 0xff, 0x73, 0x9b, - 0x0c, 0x17, 0xbc, 0x66, 0x2a, 0x87, 0x44, 0x7a, 0xb9, 0x1d, 0xd5, 0xc6, 0x87, 0xb2, 0x77, 0x9e, - 0x71, 0x28, 0x9c, 0xd1, 0x2b, 0xa8, 0x8d, 0x0e, 0x4c, 0x1a, 0x14, 0x79, 0x9d, 0xe5, 0x6b, 0x89, - 0xa3, 0xe9, 0x65, 0x25, 0x6a, 0xb9, 0xdb, 0xff, 0x94, 0x1d, 0x59, 0x30, 0xa3, 0xc8, 0x0a, 0x15, - 0x83, 0x56, 0xe1, 0x69, 0x5b, 0x89, 0x09, 0xa3, 0x95, 0xc5, 0x90, 0x92, 0x2c, 0xc9, 0x4f, 0x37, - 0x35, 0xb0, 0x1c, 0xe3, 0xb1, 0x27, 0x34, 0x91, 0x91, 0xf0, 0xe2, 0x86, 0x0b, 0x98, 0x75, 0x27, - 0x1c, 0x74, 0x61, 0x1a, 0x5e, 0xe2, 0xb4, 0xa1, 0x0c, 0xbe, 0xbc, 0x33, 0x53, 0x23, 0xf7, 0x5c -}; - void tripfev_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2 // IGS27_CRYPT3 IGS27_CRYPT4_ALT // $2fc0 IGS27_CRYPT5_ALT // $35da0 - IGS27_CRYPT6_ALT + IGS27_CRYPT6 IGS27_CRYPT7_ALT // $2b0 IGS27_CRYPT8 // $1100 - x ^= tripfev_tab[(i>> 1) & 0xff] << 8; - - src[i] = x; + src[i] ^= x; } } @@ -2275,34 +1801,16 @@ void wldfruit_decrypt(running_machine &machine) } -static const uint8_t lthy_tab[0x100] = { // IGS MAHJONG CHINA S104CN - 0x08, 0xb1, 0x64, 0x36, 0x90, 0xfa, 0x88, 0xbf, 0xca, 0xd6, 0xcf, 0x87, 0x5b, 0x88, 0xf7, 0xc6, - 0x32, 0xfe, 0x7d, 0xcc, 0xc2, 0x3d, 0xfb, 0x0c, 0x81, 0x0c, 0xc2, 0x6c, 0xa0, 0xe0, 0xb3, 0xcc, - 0x0d, 0x08, 0x63, 0xd5, 0xa7, 0x19, 0x6f, 0x03, 0xc1, 0x9c, 0x1c, 0xf6, 0xd9, 0xf7, 0x33, 0xf5, - 0x9a, 0x99, 0x1c, 0xc3, 0x0f, 0x6a, 0x3a, 0xa7, 0x29, 0x71, 0x86, 0xb6, 0x75, 0xc8, 0x6e, 0x64, - 0x16, 0xbd, 0xf0, 0x4a, 0x09, 0x4a, 0xf3, 0x39, 0x9a, 0xb7, 0xe5, 0x81, 0x21, 0x8e, 0x9b, 0x7b, - 0x02, 0xbf, 0x65, 0x5d, 0xe4, 0x14, 0x71, 0x3f, 0x31, 0xd8, 0x62, 0x68, 0xcf, 0xc3, 0x31, 0xdf, - 0x1c, 0x2a, 0x43, 0x2e, 0x2f, 0x64, 0xcc, 0x79, 0x4e, 0x7f, 0x63, 0xc0, 0xab, 0x24, 0xe6, 0x71, - 0x64, 0xc8, 0x91, 0x31, 0xba, 0x15, 0x5a, 0xec, 0x90, 0x98, 0x8f, 0x1b, 0x26, 0xab, 0xb2, 0x55, - 0x17, 0xa5, 0x95, 0x19, 0x91, 0x41, 0xb2, 0xda, 0xd5, 0x4d, 0xcd, 0x4c, 0xef, 0x94, 0xcd, 0xee, - 0xb6, 0x0c, 0xd6, 0xd8, 0x06, 0x44, 0xac, 0xc7, 0x3d, 0x09, 0x44, 0x66, 0xf4, 0x58, 0xac, 0xdf, - 0xff, 0x88, 0x1d, 0xa2, 0xa7, 0xb8, 0x5e, 0x75, 0x27, 0x77, 0x5b, 0xbd, 0x64, 0xb3, 0x06, 0x0b, - 0xf1, 0xe4, 0x6f, 0xea, 0x43, 0x79, 0x1f, 0xe8, 0x31, 0x82, 0xb9, 0xe2, 0xaf, 0xa0, 0xd4, 0x95, - 0xcc, 0x2a, 0x13, 0x62, 0xe9, 0xa1, 0x86, 0x61, 0x3b, 0x56, 0x46, 0xaa, 0x84, 0x5a, 0x4b, 0xe0, - 0x0d, 0xa6, 0x91, 0xfe, 0xe8, 0x8c, 0x6b, 0x66, 0x64, 0x5d, 0x27, 0x27, 0xd0, 0x5c, 0xe4, 0x8e, - 0x75, 0xe3, 0xaf, 0xf1, 0xce, 0xd4, 0xe5, 0xb7, 0x0a, 0x43, 0xc5, 0xac, 0xc5, 0x61, 0x54, 0x84, - 0x02, 0xac, 0x76, 0xad, 0x6c, 0x55, 0x49, 0x59, 0xce, 0xf1, 0xc5, 0xcc, 0xd0, 0x64, 0x93, 0xe3 -}; - +// IGS MAHJONG CHINA S104CN void lthy_decrypt(running_machine &machine) { - auto const src = reinterpret_cast(machine.root_device().memregion("user1")->base()); - - int const rom_size = 0x80000; + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); for (int i = 0; i < rom_size / 2; i++) { - uint16_t x = src[i]; + uint16_t x = 0; IGS27_CRYPT1 IGS27_CRYPT2_ALT // correct-85a8 @@ -2313,8 +1821,79 @@ void lthy_decrypt(running_machine &machine) IGS27_CRYPT7 // ? IGS27_CRYPT8 // correct 12c0 - x ^= lthy_tab[(i>> 1) & 0xff] << 8; + src[i] ^= x; + } +} - src[i] = x; + +void lhdmg_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1 + IGS27_CRYPT2_ALT + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5 + IGS27_CRYPT6_ALT + IGS27_CRYPT7 + IGS27_CRYPT8 + + src[i] ^= x; + } +} + + +void tripslot_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1 + IGS27_CRYPT2 + IGS27_CRYPT3 + IGS27_CRYPT4_ALT + IGS27_CRYPT5 + IGS27_CRYPT6 + IGS27_CRYPT7 + IGS27_CRYPT8 + + src[i] ^= x; + } +} + + +void extradrw_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1 + IGS27_CRYPT2_ALT + IGS27_CRYPT3_ALT2 + IGS27_CRYPT4 + IGS27_CRYPT5 + IGS27_CRYPT6 + IGS27_CRYPT7 + IGS27_CRYPT8_ALT + + x |= (x << 8); + src[i] ^= x; } } diff --git a/src/mame/igs/pgmcrypt.h b/src/mame/igs/pgmcrypt.h index 944510fb7aade..9bf366b4e35b0 100644 --- a/src/mame/igs/pgmcrypt.h +++ b/src/mame/igs/pgmcrypt.h @@ -1,6 +1,11 @@ // license:BSD-3-Clause // copyright-holders: David Haywood, ElSemi // IGS 027 Encryptions +#ifndef MAME_IGS_PGMCRYPT_H +#define MAME_IGS_PGMCRYPT_H + +#pragma once + void pgm_kov_decrypt(running_machine &machine); void pgm_kovsh_decrypt(running_machine &machine); @@ -29,9 +34,7 @@ void chessc2_decrypt(running_machine &machine); void klxyj_decrypt(running_machine &machine); void zhongguo_decrypt(running_machine &machine); void gonefsh2_decrypt(running_machine &machine); -void sddz_decrypt(running_machine &machine); -void lhzb3_decrypt(running_machine &machine); -void mgfx_decrypt(running_machine &machine); +void cjddz_decrypt(running_machine &machine); void lhzb4_decrypt(running_machine &machine); void fearless_decrypt(running_machine &machine); void superkds_decrypt(running_machine &machine); @@ -53,3 +56,8 @@ void icescape_decrypt(running_machine &machine); void tripfev_decrypt(running_machine &machine); void wldfruit_decrypt(running_machine &machine); void lthy_decrypt(running_machine &machine); +void lhdmg_decrypt(running_machine &machine); +void tripslot_decrypt(running_machine &machine); +void extradrw_decrypt(running_machine &machine); + +#endif // MAME_IGS_PGMCRYPT_H diff --git a/src/mame/igs/pgmprot_igs027a_type2.cpp b/src/mame/igs/pgmprot_igs027a_type2.cpp index fbdf66d5caa11..f8acb3c03444a 100644 --- a/src/mame/igs/pgmprot_igs027a_type2.cpp +++ b/src/mame/igs/pgmprot_igs027a_type2.cpp @@ -47,7 +47,7 @@ u32 pgm_arm_type2_state::arm7_latch_arm_r(offs_t offset, u32 mem_mask) { if (!machine().side_effects_disabled()) - m_prot->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE ); // guess + m_prot->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, CLEAR_LINE); // guess LOGPROT("%s ARM7: Latch read: %08x (%08x)\n", machine().describe_context(), m_kov2_latchdata_68k_w, mem_mask); return m_kov2_latchdata_68k_w; @@ -83,7 +83,7 @@ void pgm_arm_type2_state::arm7_latch_68k_w(offs_t offset, u16 data, u16 mem_mask LOGPROT("%s M68K: Latch write: %04x (%04x)\n", machine().describe_context(), data & 0x0000ffff, mem_mask); COMBINE_DATA(&m_kov2_latchdata_68k_w); - m_prot->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE ); // guess + m_prot->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, ASSERT_LINE); // guess } u16 pgm_arm_type2_state::arm7_ram_r(offs_t offset, u16 mem_mask) @@ -113,16 +113,25 @@ void pgm_arm_type2_state::kov2_mem(address_map &map) map(0xd10000, 0xd10001).rw(FUNC(pgm_arm_type2_state::arm7_latch_68k_r), FUNC(pgm_arm_type2_state::arm7_latch_68k_w)); /* ARM7 Latch */ } +u32 pgm_arm_type2_state::external_rom_r(offs_t offset) +{ + return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; +} + +void pgm_arm_type2_state::xor_table_w(offs_t offset, u8 data) +{ + m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); +} void pgm_arm_type2_state::_55857F_arm7_map(address_map &map) { map(0x00000000, 0x00003fff).rom(); - map(0x08000000, 0x083fffff).rom().region("user1", 0); + map(0x08000000, 0x083fffff).rom().r(FUNC(pgm_arm_type2_state::external_rom_r)); map(0x10000000, 0x100003ff).ram(); map(0x18000000, 0x1800ffff).ram().share("arm_ram"); map(0x38000000, 0x38000003).rw(FUNC(pgm_arm_type2_state::arm7_latch_arm_r), FUNC(pgm_arm_type2_state::arm7_latch_arm_w)); /* 68k Latch */ map(0x48000000, 0x4800ffff).rw(FUNC(pgm_arm_type2_state::arm7_shareram_r), FUNC(pgm_arm_type2_state::arm7_shareram_w)).share("arm7_shareram"); - map(0x50000000, 0x500003ff).ram(); + map(0x50000000, 0x500003ff).ram().umask32(0x000000ff).w(FUNC(pgm_arm_type2_state::xor_table_w)); } /******* ARM 55857F *******/ @@ -150,9 +159,11 @@ void pgm_arm_type2_state::kov2_latch_init() { m_kov2_latchdata_68k_w = 0; m_kov2_latchdata_arm_w = 0; + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); save_item(NAME(m_kov2_latchdata_68k_w)); save_item(NAME(m_kov2_latchdata_arm_w)); + save_item(NAME(m_xor_table)); } void pgm_arm_type2_state::kov2_arm_region_w(offs_t offset, u32 data, u32 mem_mask) @@ -225,7 +236,7 @@ u32 pgm_arm_type2_state::ddp2_speedup_r(address_space &space) if (pc == 0x080109b4) { /* if we've hit the loop where this is read and both values are 0 then the only way out is an interrupt */ - int r4 = (m_prot->state_int(ARM7_R4)); + int r4 = (m_prot->state_int(arm7_cpu_device::ARM7_R4)); r4 += 0xe; if (r4 == 0x18002f9e) diff --git a/src/mame/igs/pgmprot_igs027a_type2.h b/src/mame/igs/pgmprot_igs027a_type2.h index 204688b7e6359..2e9c69338a47b 100644 --- a/src/mame/igs/pgmprot_igs027a_type2.h +++ b/src/mame/igs/pgmprot_igs027a_type2.h @@ -4,12 +4,15 @@ class pgm_arm_type2_state : public pgm_state { public: - pgm_arm_type2_state(const machine_config &mconfig, device_type type, const char *tag) - : pgm_state(mconfig, type, tag), - m_arm_ram(*this, "arm_ram"), - m_arm7_shareram(*this, "arm7_shareram"), - m_prot(*this, "prot") { + pgm_arm_type2_state(const machine_config &mconfig, device_type type, const char *tag) : + pgm_state(mconfig, type, tag), + m_arm_ram(*this, "arm_ram"), + m_arm7_shareram(*this, "arm7_shareram"), + m_prot(*this, "prot"), + m_external_rom(*this, "user1") + { } + void init_kov2(); void init_kov2p(); void init_martmast(); @@ -30,7 +33,12 @@ class pgm_arm_type2_state : public pgm_state required_shared_ptr m_arm7_shareram; optional_device m_prot; + required_region_ptr m_external_rom; + + u32 m_xor_table[0x100]; + u32 external_rom_r(offs_t offset); + void xor_table_w(offs_t offset, u8 data); u32 arm7_latch_arm_r(offs_t offset, u32 mem_mask = ~0); void arm7_latch_arm_w(offs_t offset, u32 data, u32 mem_mask = ~0); u32 arm7_shareram_r(offs_t offset, u32 mem_mask = ~0); diff --git a/src/mame/igs/pgmprot_igs027a_type3.cpp b/src/mame/igs/pgmprot_igs027a_type3.cpp index 13d3f85db5ede..4bcfc025e9550 100644 --- a/src/mame/igs/pgmprot_igs027a_type3.cpp +++ b/src/mame/igs/pgmprot_igs027a_type3.cpp @@ -98,7 +98,7 @@ u16 pgm_arm_type3_state::svg_68k_nmi_r() void pgm_arm_type3_state::svg_68k_nmi_w(u16 data) { - m_prot->pulse_input_line(ARM7_FIRQ_LINE, m_prot->minimum_quantum_time()); + m_prot->pulse_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_prot->minimum_quantum_time()); } void pgm_arm_type3_state::svg_latch_68k_w(offs_t offset, u16 data, u16 mem_mask) diff --git a/src/mame/igs/spoker.cpp b/src/mame/igs/spoker.cpp index e8a4da614331e..a3af2c58cd3a4 100644 --- a/src/mame/igs/spoker.cpp +++ b/src/mame/igs/spoker.cpp @@ -28,6 +28,7 @@ - Verify LEDs and coin counters (should be ok) - 3super8 randomly crashes - 3super8 doesn't have the 8x32 tilemap, change the video emulation accordingly + - jinhulu2 stops at "system is connecting". Some type of link feature? ***************************************************************************/ @@ -130,6 +131,7 @@ class spokeru_state : public spoker_state using spoker_state::spoker_state; void spokeru(machine_config &config); + void init_spokeru(); protected: @@ -137,13 +139,30 @@ class spokeru_state : public spoker_state void portmap(address_map &map); -private: void coins_w(uint8_t data); void nmi_video_leds_w(uint8_t data); +private: void program_map(address_map &map); }; +class jinhulu2_state : public spokeru_state +{ +public: + jinhulu2_state(const machine_config &mconfig, device_type type, const char *tag) : + spokeru_state(mconfig, type, tag) + { } + + void jinhulu2(machine_config &config); + + void init_jinhulu2(); + +private: + void nmi_w(uint8_t data); + + void portmap(address_map &map); +}; + class jb_state : public spokeru_state { public: @@ -171,6 +190,7 @@ class jb_state : public spokeru_state void portmap(address_map &map); }; + /*************************************************************************** Video Hardware ***************************************************************************/ @@ -386,6 +406,19 @@ void spokeru_state::nmi_video_leds_w(uint8_t data) show_out(machine(), m_out); } +void jinhulu2_state::nmi_w(uint8_t data) +{ + if (data & 0xef) + logerror("nmi_w: %02x\n", data & 0xef); + + if (((m_nmi_ack & 0x10) == 0) && data & 0x10) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + + m_nmi_ack = data & 0x10; // NMI acknowledge, 0 -> 1 + + // TODO: bit 5 is set often +} + void spoker_state::leds_w(uint8_t data) { m_leds[0] = BIT(data, 0); // stop_1 @@ -494,6 +527,24 @@ void spokeru_state::portmap(address_map &map) map(0x7800, 0x7fff).ram().w(FUNC(spokeru_state::fg_color_w)).share(m_fg_color_ram); } +void jinhulu2_state::portmap(address_map &map) +{ + map(0x0000, 0x003f).ram(); // Z180 internal regs + map(0x2000, 0x20ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0x3000, 0x30ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); + // TODO: the following reads may be hooked to the wrong inputs + map(0x4000, 0x4000).portr("DSW1"); + map(0x4001, 0x4001).portr("DSW2"); + map(0x4002, 0x4002).portr("DSW3"); + map(0x5001, 0x5001).portr("SERVICE"); + //map(0x5030, 0x5030).w(FUNC()); // TODO: almost surely same protections as seen in igspoker.cpp and igs011.cpp. Probably the IGS003 + //map(0x5031, 0x5031).r(FUNC()); // TODO: " + map(0x5031, 0x5031).w(FUNC(jinhulu2_state::nmi_w)); + //map(0x????, 0x????).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x7000, 0x77ff).ram().w(FUNC(jinhulu2_state::fg_tile_w)).share(m_fg_tile_ram); + map(0x7800, 0x7fff).ram().w(FUNC(jinhulu2_state::fg_color_w)).share(m_fg_color_ram); +} + void jb_state::portmap(address_map &map) { spokeru_state::portmap(map); @@ -503,7 +554,7 @@ void jb_state::portmap(address_map &map) map(0x6800, 0x69ff).ram().w(FUNC(jb_state::reel_ram_w<0>)).share(m_reel_ram[0]); map(0x6a00, 0x6bff).ram().w(FUNC(jb_state::reel_ram_w<1>)).share(m_reel_ram[1]); map(0x6c00, 0x6dff).ram().w(FUNC(jb_state::reel_ram_w<2>)).share(m_reel_ram[2]); - map(0x6e00, 0x6fff).nopw(); // hardware seems to support a 4th reel, unused by the dump game (only writes 0xff) + map(0x6e00, 0x6fff).nopw(); // hardware seems to support a 4th reel, unused by the dumped game (only writes 0xff) map(0x8000, 0xffff).rom().region("maincpu", 0x10000); } @@ -986,12 +1037,27 @@ static GFXDECODE_START( gfx_3super8 ) GFXDECODE_ENTRY( "gfx2", 0x00000, layout_8x32x6, 0, 16 ) GFXDECODE_END +// TODO: probably correct but to be verified once it passes the connection check +static const gfx_layout layout_8x8x4 = +{ + 8, 8, + RGN_FRAC(1, 1), + 4, + { STEP4(24, -8) }, + { STEP8(0, 1) }, + { STEP8(0, 8*4) }, + 8*8*4 +}; + +static GFXDECODE_START( gfx_jinhulu2 ) + GFXDECODE_ENTRY( "tiles", 0, layout_8x8x4, 0, 16 ) +GFXDECODE_END + static GFXDECODE_START( gfx_jb ) GFXDECODE_ENTRY( "gfx1", 0x00000, layout_8x8x6, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0x00000, layout_8x32x6, 0, 16 ) GFXDECODE_END - /*************************************************************************** Machine Start & Reset ***************************************************************************/ @@ -1072,6 +1138,16 @@ void spokeru_state::spokeru(machine_config &config) } +void jinhulu2_state::jinhulu2(machine_config &config) +{ + spokeru(config); + + m_maincpu->set_addrmap(AS_IO, &jinhulu2_state::portmap); + + m_gfxdecode->set_info(gfx_jinhulu2); +} + + void jb_state::jb(machine_config &config) { spokeru(config); @@ -1388,6 +1464,61 @@ ROM_START( 3super8 ) ROM_LOAD( "sound.bin", 0x00000, 0x40000, BAD_DUMP CRC(230b31c3) SHA1(38c107325d3a4e9781912078b1317dc9ba3e1ced) ) ROM_END +/********************************************************************************* + +Jin Hu Lu 2, IGS (year unknown, board dead/rotten, battery leaked EXTENSIVELY and killed it) +This is a Poker game. +Board is a mix of through-hole and surface mounted parts (lots of logic is SMD). +Some chips have year 1999 so this is 1999 or later. + +PCB Layout +---------- + +IGS PCB No- 0202 - : +|--------------------------------------------| +|SW4 BATTERY 12MHz Z180 | +| | +|1 | +|8 T518B PRG.U40| +|W PAL | +|A PAL 6264 | +|Y 2149C PAL | +| PAL SKT | +| IGS-003C | +| | +|1 | +|0 IGS002 | +|W | +|A IGS001A | +|Y VOL 6264 6264 | +| UPC1242 M6295 27C4002.U39| +|7805 SP_U12.U12 SW1 SW2 SW3 | +|--------------------------------------------| +Notes: + 2149C - Might be an 8255 PPI. Definitely not a YM2149 ;-) + Z180 - Zilog Z8018008PSC Z180 MPU. Chip rated at 8MHz so clock input likely to be 6MHz [12/2] + IGS003C - In a socket but marked on PCB as 'ASIC3' (which is unusual) so could be a custom chip and not a ROM? + IGS001/2 - Custom IGS Chip (QFP80) + 6264 - 8kBx8-bit SRAM + SKT - Empty socket, missing PAL maybe? + M6295 - Oki Sound Chip. Clock input possibly 1.000MHz [12/12] + T518B - Reset Chip + SW1/2/3 - 8-Position DIP Switch + SP_U12.U12 - OKI Samples. Board printed '27C020' but actual chip is Intel FLASH P28F001 + +*********************************************************************************/ + +ROM_START( jinhulu2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "prg.u40", 0x00000, 0x10000, CRC(e7974ae0) SHA1(1240fabeb79bb820ba371b378ad51660170c6cd0) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "27c4002.u39", 0x00000, 0x40000, CRC(b933ec01) SHA1(72b541579551114f7c8649c2e9a839ef4128fc14) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x40000 ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "sp_u12.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END /*************************************************************************** Driver Init @@ -1406,6 +1537,32 @@ void spokeru_state::init_spokeru() } } +void jinhulu2_state::init_jinhulu2() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int a = 0; a < 0xf000; a++) + { + rom[a] ^= 0x01; + if ((a & 0x0282) == 0x0282) rom[a] ^= 0x01; + if ((a & 0x0940) == 0x0940) rom[a] ^= 0x02; + } + + const int rom_size = memregion("tiles")->bytes(); + u8 * const gfxrom = memregion("tiles")->base(); + std::unique_ptr tmp = std::make_unique(rom_size); + + // address lines swap + memcpy(tmp.get(), gfxrom, rom_size); + for (int i = 0; i < rom_size; i++) + { + // TODO: may need some higher bits swapped, too. To be verified once it passes the connection check + int addr = bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 6, 11, 8, 9, 10, 7, 12, 5, 4, 3, 2, 1, 0); + gfxrom[i] = tmp[addr]; + } + +} + void spoker_state::init_spk116it() { uint8_t *rom = memregion("maincpu")->base(); @@ -1488,17 +1645,18 @@ void spoker_state::init_3super8() Game Drivers ***************************************************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk203us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode -GAME( 1996, spk201ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode -GAME( 1996, spk200ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk102ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk100, spk306us, spoker, spk114it, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) //roms are badly dumped -GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk203us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode +GAME( 1996, spk201ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode +GAME( 1996, spk200ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk102ua, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk100, spk306us, spoker, spk114it, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) //roms are badly dumped +GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, jinhulu2, 0, jinhulu2, spoker, jinhulu2_state, init_jinhulu2, ROT0, "IGS", "Jin Hu Lu 2 (v412GS)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs decryption diff --git a/src/mame/igs/xamcu.cpp b/src/mame/igs/xamcu.cpp new file mode 100644 index 0000000000000..e2cba05230b0a --- /dev/null +++ b/src/mame/igs/xamcu.cpp @@ -0,0 +1,314 @@ +// license:BSD-3-Clause +// copyright-holders:XingXing, Vas Crabb + +#include "emu.h" +#include "xamcu.h" + +#include "speaker.h" + +//#define VERBOSE 1 +#include "logmacro.h" + + +DEFINE_DEVICE_TYPE(IGS_XA_ICS_SOUND, igs_xa_mcu_ics_sound_device, "igs_xa_ics_sound", "IGS MX10EXAQC-based ICS2115 sound system") +DEFINE_DEVICE_TYPE(IGS_XA_SUBCPU, igs_xa_mcu_subcpu_device, "igs_xa_subcpu", "IGS MX10EXAQC sub-CPU") + + +igs_xa_mcu_device_base::igs_xa_mcu_device_base( + machine_config const &mconfig, + device_type type, + char const *tag, + device_t *owner, + u32 clock) : + device_t(mconfig, type, tag, owner, clock), + m_mcu(*this, "mcu"), + m_irq_cb(*this), + m_command(0), + m_num_params(0), + m_port_dat{ 0, 0, 0, 0 }, + m_port0_latch(0), + m_port2_latch(0), + m_irq(0) +{ +} + +igs_xa_mcu_device_base::~igs_xa_mcu_device_base() +{ +} + + +void igs_xa_mcu_device_base::device_add_mconfig(machine_config &config) +{ + MX10EXA(config, m_mcu, DERIVED_CLOCK(1, 1)); // MX10EXAQC (Philips 80C51XA) + m_mcu->port_in_cb<0>().set(FUNC(igs_xa_mcu_device_base::mcu_p0_r)); + m_mcu->port_in_cb<1>().set(FUNC(igs_xa_mcu_device_base::mcu_p1_r)); + m_mcu->port_in_cb<2>().set(FUNC(igs_xa_mcu_device_base::mcu_p2_r)); + m_mcu->port_in_cb<3>().set(FUNC(igs_xa_mcu_device_base::mcu_p3_r)); + m_mcu->port_out_cb<0>().set(FUNC(igs_xa_mcu_device_base::mcu_p0_w)); + m_mcu->port_out_cb<1>().set(FUNC(igs_xa_mcu_device_base::mcu_p1_w)); + m_mcu->port_out_cb<2>().set(FUNC(igs_xa_mcu_device_base::mcu_p2_w)); + m_mcu->port_out_cb<3>().set(FUNC(igs_xa_mcu_device_base::mcu_p3_w)); +} + +void igs_xa_mcu_device_base::device_start() +{ + save_item(NAME(m_command)); + save_item(NAME(m_num_params)); + save_item(NAME(m_port_dat)); + save_item(NAME(m_port0_latch)); + save_item(NAME(m_port2_latch)); + save_item(NAME(m_irq)); +} + +void igs_xa_mcu_device_base::device_reset() +{ + m_command = 0; + m_num_params = 0; +} + + +inline void igs_xa_mcu_device_base::set_irq(int state) +{ + if (bool(m_irq) != bool(state)) + { + m_irq = state; + m_irq_cb(state); + } +} + + +u8 igs_xa_mcu_device_base::mcu_p0_r() +{ + LOG("%s: COMMAND READ LOWER mcu_p0_r() returning %02x with port3 as %02x\n", machine().describe_context(), m_port0_latch, m_port_dat[3]); + return m_port0_latch; +} + +u8 igs_xa_mcu_device_base::mcu_p1_r() +{ + LOG("%s: mcu_p1_r()\n", machine().describe_context()); + return m_port_dat[1]; // superkds XA will end up failing returning port1 dat for now, but not attempt to play any sounds otherwise? +} + +u8 igs_xa_mcu_device_base::mcu_p2_r() +{ + LOG("%s: COMMAND READ mcu_p2_r() returning %02x with port3 as %02x\n", machine().describe_context(), m_port2_latch, m_port_dat[3]); + return m_port2_latch; +} + +u8 igs_xa_mcu_device_base::mcu_p3_r() +{ + LOG("%s: mcu_p3_r()\n", machine().describe_context()); + return m_port_dat[3]; +} + + +void igs_xa_mcu_device_base::mcu_p0_w(u8 data) +{ + LOG("%s: mcu_p0_w() %02x with port 3 as %02x and port 1 as %02x\n", machine().describe_context(), data, m_port_dat[3], m_port_dat[1]); + m_port_dat[0] = data; +} + +void igs_xa_mcu_device_base::mcu_p1_w(u8 data) +{ + LOG("%s: mcu_p1_w() %02x\n", machine().describe_context(), data); + m_port_dat[1] = data; +} + +void igs_xa_mcu_device_base::mcu_p2_w(u8 data) +{ + LOG("%s: mcu_p2_w() %02x with port 3 as %02x\n", machine().describe_context(), data, m_port_dat[3]); + m_port_dat[2] = data; +} + +void igs_xa_mcu_device_base::mcu_p3_w(u8 data) +{ + LOG("%s: mcu_p3_w() %02x - do latches oldport3 %02x newport3 %02x\n", machine().describe_context(), data, m_port_dat[3], data); + m_port_dat[3] = data; +} + + +TIMER_CALLBACK_MEMBER(igs_xa_mcu_device_base::do_cmd_w) +{ + m_command = u16(u32(param)); + + m_num_params--; + if (m_num_params <= 0) + { + LOG("command is %02x size %02x\n", m_command >> 8, m_command & 0x00ff); + m_num_params = m_command & 0x00ff; + } + else + { + LOG("param %04x\n", m_command); + } + m_mcu->pulse_input_line(XA_EXT_IRQ0, m_mcu->minimum_quantum_time()); +} + + + +igs_xa_mcu_ics_sound_device::igs_xa_mcu_ics_sound_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + u32 clock) : + igs_xa_mcu_device_base(mconfig, IGS_XA_ICS_SOUND, tag, owner, clock), + m_ics(*this, "ics"), + m_response{ 0, 0 } +{ +} + +igs_xa_mcu_ics_sound_device::~igs_xa_mcu_ics_sound_device() +{ +} + + +void igs_xa_mcu_ics_sound_device::cmd_w(u16 data) +{ + machine().scheduler().synchronize(timer_expired_delegate(FUNC(igs_xa_mcu_ics_sound_device::do_cmd_w), this), s32(u32(data))); +} + + +void igs_xa_mcu_ics_sound_device::device_add_mconfig(machine_config &config) +{ + igs_xa_mcu_device_base::device_add_mconfig(config); + + m_mcu->port_out_cb<1>().set(FUNC(igs_xa_mcu_ics_sound_device::mcu_p1_w)); + m_mcu->port_out_cb<3>().set(FUNC(igs_xa_mcu_ics_sound_device::mcu_p3_w)); + + SPEAKER(config, "mono").front_center(); + + ICS2115(config, m_ics, 33.8688_MHz_XTAL); // TODO: Correct? + m_ics->irq().set_inputline(m_mcu, XA_EXT_IRQ2); + m_ics->add_route(ALL_OUTPUTS, "mono", 5.0); +} + +void igs_xa_mcu_ics_sound_device::device_start() +{ + igs_xa_mcu_device_base::device_start(); + + save_item(NAME(m_response)); +} + + +void igs_xa_mcu_ics_sound_device::mcu_p1_w(u8 data) +{ + igs_xa_mcu_device_base::mcu_p1_w(data); + + set_irq(BIT(data, 3)); +} + +void igs_xa_mcu_ics_sound_device::mcu_p3_w(u8 data) +{ + u8 const falling = m_port_dat[3] & ~data; + igs_xa_mcu_device_base::mcu_p3_w(data); + + // high->low transition on bit 0x80 must read into latches! + if (BIT(falling, 7)) + { + if (!BIT(data, 4)) + { + m_port0_latch = m_ics->read(m_port_dat[1] & 7); + LOG("read from ics [%d] = [%02x]\n", m_port_dat[1] & 7, m_port0_latch); + } + else if (!BIT(data, 5)) + { + LOG("read command [%d] = [%04x]\n", m_port_dat[1] & 7, m_command); + m_port2_latch = m_command >> 8; + m_port0_latch = m_command & 0x00ff; + } + } + + if (BIT(falling, 6)) + { + if (!BIT(data, 4)) + { + LOG("write to ics [%d] = [%02x]\n", m_port_dat[1] & 7, m_port_dat[0]); + m_ics->write(m_port_dat[1] & 7, m_port_dat[0]); + } + else if (!BIT(data, 5)) + { + u16 const dat = (u16(m_port_dat[2]) << 8) | m_port_dat[0]; + LOG("write response [%d] = [%04x]\n", m_port_dat[1] & 7, dat); + switch (m_port_dat[1] & 7) + { + case 1: + m_response[1] = dat; + break; + case 2: + m_response[0] = dat; + break; + } + } + } +} + + + +igs_xa_mcu_subcpu_device::igs_xa_mcu_subcpu_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + u32 clock) : + igs_xa_mcu_device_base(mconfig, IGS_XA_SUBCPU, tag, owner, clock), + m_response(0) +{ +} + +igs_xa_mcu_subcpu_device::~igs_xa_mcu_subcpu_device() +{ +} + + +void igs_xa_mcu_subcpu_device::cmd_w(offs_t offset, u16 data) +{ + if (!BIT(offset, 0)) + { + machine().scheduler().synchronize(timer_expired_delegate(FUNC(igs_xa_mcu_subcpu_device::do_cmd_w), this), s32(u32(data))); + } + else + { + LOG("%s: lower IRQ %08x\n", machine().describe_context(), data); + set_irq(0); + } +} + + +void igs_xa_mcu_subcpu_device::device_add_mconfig(machine_config &config) +{ + igs_xa_mcu_device_base::device_add_mconfig(config); + + m_mcu->port_out_cb<3>().set(FUNC(igs_xa_mcu_subcpu_device::mcu_p3_w)); +} + +void igs_xa_mcu_subcpu_device::device_start() +{ + igs_xa_mcu_device_base::device_start(); + + save_item(NAME(m_response)); +} + + +void igs_xa_mcu_subcpu_device::mcu_p3_w(u8 data) +{ + u8 const rising = ~m_port_dat[3] & data; + u8 const falling = m_port_dat[3] & ~data; + igs_xa_mcu_device_base::mcu_p3_w(data); + + if (BIT(rising, 5)) + set_irq(1); + + // high->low transition on bit 0x80 must read into latches! + if (BIT(falling, 7)) + { + LOG("read command [%d] = [%04x]\n", m_port_dat[1] & 7, m_command); + m_port2_latch = m_command >> 8; + m_port0_latch = m_command & 0x00ff; + } + + if (BIT(falling, 6)) + { + u16 const dat = (u16(m_port_dat[2]) << 8) | m_port_dat[0]; + LOG("write response [%d] = [%04x]\n", m_port_dat[1] & 7, dat); + m_response = dat; + } +} diff --git a/src/mame/igs/xamcu.h b/src/mame/igs/xamcu.h new file mode 100644 index 0000000000000..c581bff0f241f --- /dev/null +++ b/src/mame/igs/xamcu.h @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders:XingXing, Vas Crabb +#ifndef MAME_IGS_XAMCU_H +#define MAME_IGS_XAMCU_H + +#pragma once + +#include "cpu/xa/xa.h" +#include "sound/ics2115.h" + + +class igs_xa_mcu_device_base : public device_t +{ +public: + virtual ~igs_xa_mcu_device_base(); + + auto irq() { return m_irq_cb.bind(); } + + int irq_r() const { return m_irq; } + +protected: + igs_xa_mcu_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + void set_irq(int state); + + u8 mcu_p0_r(); + u8 mcu_p1_r(); + u8 mcu_p2_r(); + u8 mcu_p3_r(); + + void mcu_p0_w(u8 data); + void mcu_p1_w(u8 data); + void mcu_p2_w(u8 data); + void mcu_p3_w(u8 data); + + TIMER_CALLBACK_MEMBER(do_cmd_w); + + required_device m_mcu; + + devcb_write_line m_irq_cb; + + u16 m_command; + s16 m_num_params; + + u8 m_port_dat[4]; + u8 m_port0_latch; + u8 m_port2_latch; + + u8 m_irq; +}; + + +class igs_xa_mcu_ics_sound_device : public igs_xa_mcu_device_base +{ +public: + igs_xa_mcu_ics_sound_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + virtual ~igs_xa_mcu_ics_sound_device(); + + void cmd_w(u16 data); + u16 response_low_r() { return m_response[0]; } + u16 response_high_r() { return m_response[1]; } + + u16 cmd_r() const { return m_command; } // hack for HLE'ing unimplemented functionality + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + + void mcu_p1_w(u8 data); + void mcu_p3_w(u8 data); + + required_device m_ics; + + u16 m_response[2]; +}; + + +class igs_xa_mcu_subcpu_device : public igs_xa_mcu_device_base +{ +public: + igs_xa_mcu_subcpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + virtual ~igs_xa_mcu_subcpu_device(); + + void set_disable() { m_mcu.lookup()->set_disable(); } // for systems where the microcontroller has not been dumped + + void cmd_w(offs_t offset, u16 data); + u16 response_r() { return m_response; } + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + + void mcu_p3_w(u8 data); + + u16 m_response; +}; + + +DECLARE_DEVICE_TYPE(IGS_XA_ICS_SOUND, igs_xa_mcu_ics_sound_device) +DECLARE_DEVICE_TYPE(IGS_XA_SUBCPU, igs_xa_mcu_subcpu_device) + +#endif // MAME_IGS_XAMCU_H diff --git a/src/mame/igt/peplus.cpp b/src/mame/igt/peplus.cpp index 3fa0a3018c84a..94dd46d68c5c3 100644 --- a/src/mame/igt/peplus.cpp +++ b/src/mame/igt/peplus.cpp @@ -266,7 +266,7 @@ class peplus_state : public driver_device void init_pepluss64(); void init_peplussbw(); - template DECLARE_CUSTOM_INPUT_MEMBER(input_r); + template ioport_value input_r(); protected: virtual void machine_start() override; @@ -1085,7 +1085,7 @@ void peplus_state::main_iomap(address_map &map) *************************/ template -CUSTOM_INPUT_MEMBER(peplus_state::input_r) +ioport_value peplus_state::input_r() { uint8_t inp_ret = 0x00; uint8_t inp_read = m_inp_bank[N]->read(); diff --git a/src/mame/irem/olibochu.cpp b/src/mame/irem/olibochu.cpp index dcaf8350dcc52..e04a9015ba552 100644 --- a/src/mame/irem/olibochu.cpp +++ b/src/mame/irem/olibochu.cpp @@ -1,18 +1,30 @@ // license:BSD-3-Clause // copyright-holders:Nicola Salmoria -/*************************************************************************** +/******************************************************************************* Oli-Boo-Chu (USA) / Punching Kid (パンチングキッド) (Japan) There's also an English language flyer for Ali-Boo-Chu driver by Nicola Salmoria +NOTES: +- Irem M47 hardware? (according to PCB, this is all we have) +- Doesn't seem related to later Irem designs (M52, etc.) +- PCB (Punching Kid): https://youtu.be/ImUpedYnfME +- PCB (Oli Boo Chu): https://youtu.be/nPzBmCDtHO0 +- Punching Kid has a POST with zeroes across the screen, Oli Boo Chu shows nothing. + Punching Kid also doesn't play a sound when Boo drops food. The "CHU HAS FOOD" + sample isn't played in either version (no write to sound_command...) + TODO: -- accurate video timing, irq timing -- HC55516 should actually be HC55536 -- verify HC55536 clock, I don't think it's from master XTAL, maybe R/C osc -- is the "Chu has food" sample ever played? Nothing is written to soundcmd when - a Chu eats a Boo dropping +- verify video timing, PCB video reference does imply a 62.5Hz refresh rate +- accurate IRQ timing +- does it have Z80 waitstates? +- HC55516 should actually be an HC55536, the "OLI IS OUT", sound is also muffled + compared to known PCB footage. +- verify HC55536 clock, I don't think it's from master XTAL, maybe R/C osc. +- Diagnostics outputs? See flip_screen_w for an explanation. +- Verify the PROM color resistances, seems to be standard. -------------- @@ -54,7 +66,7 @@ VIDEO M-47B-A: 2114 OBC14 OBC13 -***************************************************************************/ +*******************************************************************************/ #include "emu.h" @@ -69,31 +81,38 @@ VIDEO M-47B-A: #include "screen.h" #include "speaker.h" #include "tilemap.h" +#include "video/resnet.h" + namespace { class olibochu_state : public driver_device { public: - olibochu_state(const machine_config &mconfig, device_type type, const char *tag) : + olibochu_state(machine_config const &mconfig, device_type type, char const *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_screen(*this, "screen"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), - m_spriteram(*this, "spriteram%u", 0), - m_soundlatch(*this, "soundlatch%u", 0), + m_spriteram(*this, "spriteram%u", 0U), + m_soundlatch(*this, "soundlatch%u", 0U), + m_ay8910(*this, "ay8910"), m_cvsd(*this, "cvsd"), + m_cvsd_clock(*this, "cvsd_clock"), m_samplerom(*this, "samples") { } void olibochu(machine_config &config); + // port handlers DECLARE_INPUT_CHANGED_MEMBER(palette_changed) { adjust_palette(); } protected: + // initialization virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; @@ -102,64 +121,76 @@ class olibochu_state : public driver_device // devices, memory pointers required_device m_maincpu; required_device m_audiocpu; + required_device m_screen; required_device m_gfxdecode; required_device m_palette; required_shared_ptr m_videoram; required_shared_ptr m_colorram; required_shared_ptr_array m_spriteram; required_device_array m_soundlatch; + required_device m_ay8910; required_device m_cvsd; + required_device m_cvsd_clock; required_region_ptr m_samplerom; + // internal state tilemap_t *m_bg_tilemap = nullptr; - u16 m_soundcmd = 0; - u8 m_sample_latch = 0; - u16 m_sample_address = 0; + u16 m_sound_command = 0U; + u8 m_sample_latch = 0U; + u16 m_sample_address = 0U; // video-related void videoram_w(offs_t offset, u8 data); void colorram_w(offs_t offset, u8 data); - void flipscreen_w(u8 data); + void flip_screen_w(u8 data); TILE_GET_INFO_MEMBER(get_bg_tile_info); void palette(palette_device &palette) const; void adjust_palette(); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, rectangle const &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, rectangle const &cliprect); - // misc + // sound-related void sound_command_w(offs_t offset, u8 data); void sample_latch_w(u8 data); void sample_start_w(u8 data); u8 soundlatch_r(); void cvsd_tick(int state); + // address maps void main_map(address_map &map); void sound_map(address_map &map); }; void olibochu_state::machine_start() { - save_item(NAME(m_soundcmd)); + save_item(NAME(m_sound_command)); save_item(NAME(m_sample_latch)); save_item(NAME(m_sample_address)); } void olibochu_state::machine_reset() { - m_soundcmd = 0; + m_sound_command = 0; adjust_palette(); } - -/*************************************************************************** +/******************************************************************************* Video -***************************************************************************/ +*******************************************************************************/ void olibochu_state::palette(palette_device &palette) const { - const u8 *color_prom = memregion("proms")->base(); + u8 const *prom = memregion("proms")->base(); + static int constexpr resistances[3] = { 1000, 470, 220 }; + + // compute the color output resistor weights + double rweights[3], gweights[3], bweights[2]; + compute_resistor_weights(0, 255, -1.0, + 3, &resistances[0], rweights, 0, 0, + 3, &resistances[0], gweights, 0, 0, + 2, &resistances[1], bweights, 0, 0); // create a lookup table for the palette for (int i = 0; i < 0x20; i++) @@ -167,21 +198,21 @@ void olibochu_state::palette(palette_device &palette) const int bit0, bit1, bit2; // red component - bit0 = BIT(color_prom[i], 0); - bit1 = BIT(color_prom[i], 1); - bit2 = BIT(color_prom[i], 2); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + bit0 = BIT(prom[i], 0); + bit1 = BIT(prom[i], 1); + bit2 = BIT(prom[i], 2); + u8 const r = combine_weights(rweights, bit0, bit1, bit2); // green component - bit0 = BIT(color_prom[i], 3); - bit1 = BIT(color_prom[i], 4); - bit2 = BIT(color_prom[i], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + bit0 = BIT(prom[i], 3); + bit1 = BIT(prom[i], 4); + bit2 = BIT(prom[i], 5); + u8 const g = combine_weights(gweights, bit0, bit1, bit2); // blue component - bit0 = BIT(color_prom[i], 6); - bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + bit0 = BIT(prom[i], 6); + bit1 = BIT(prom[i], 7); + u8 const b = combine_weights(bweights, bit0, bit1); palette.set_indirect_color(i, rgb_t(r, g, b)); } @@ -189,13 +220,13 @@ void olibochu_state::palette(palette_device &palette) const void olibochu_state::adjust_palette() { - int bank = (ioport("CONF")->read() & 1) ? 0x10 : 0; - const u8 *color_prom = memregion("proms")->base() + 0x20; + int const bank = (ioport("CONF")->read() & 1) ? 0x10 : 0; + u8 const *prom = memregion("proms")->base() + 0x20; for (int i = 0; i < 0x100; i++) { - m_palette->set_pen_indirect(i, (color_prom[i] & 0xf) | bank); - m_palette->set_pen_indirect(i + 0x100, (color_prom[i + 0x100] & 0xf) | bank); + m_palette->set_pen_indirect(i, (prom[i] & 0xf) | bank); + m_palette->set_pen_indirect(i + 0x100, (prom[i + 0x100] & 0xf) | bank); } } @@ -211,21 +242,26 @@ void olibochu_state::colorram_w(offs_t offset, u8 data) m_bg_tilemap->mark_tile_dirty(offset); } -void olibochu_state::flipscreen_w(u8 data) +void olibochu_state::flip_screen_w(u8 data) { - flip_screen_set(data & 0x80); + // TODO: output latch *maybe*, diagnostics related? - // other bits are used, but unknown + // Q0-6 off on cold boot, Q1 on at POST, Q4-5 on after POST, + // Q4 off at title screen, Q5 off/on at stage/intermission + // start, Q6 on at intermission, Q6 off after intermission, + // Q1/Q5 on after warm boot, and Q7 is obviously flip screen + flip_screen_set(BIT(data, 7)); } TILE_GET_INFO_MEMBER(olibochu_state::get_bg_tile_info) { - int attr = m_colorram[tile_index]; - int code = m_videoram[tile_index] | ((attr & 0x20) << 3); - int color = (attr & 0x1f) | 0x20; - int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); + u8 const attr = m_colorram[tile_index]; + bool const bank = BIT(attr, 5); + u16 const code = m_videoram[tile_index] | (bank << 8); + u8 const color = (attr & 0x1f) | 0x20; + int const flags = TILE_FLIPYX(attr >> 6 & 3); - tileinfo.category = BIT(attr, 5); + tileinfo.category = bank; tileinfo.set(0, code, color, flags); } @@ -235,58 +271,43 @@ void olibochu_state::video_start() m_bg_tilemap->set_transparent_pen(0); } -void olibochu_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void olibochu_state::draw_sprites(bitmap_ind16 &bitmap, rectangle const &cliprect) { - // 8x8 sprites - for (int offs = m_spriteram[0].bytes() - 4; offs >= 0; offs -= 4) + // fill limit of 16 sprites with first half split into pairs? + // game never initializes the latter half of the second bank + for (int bank = 0; bank < 2; bank++) { - const u8 *src = &m_spriteram[0][offs]; - int code = src[0]; - int attr = src[1]; - int color = attr & 0x3f; - int flipx = attr & 0x40; - int flipy = attr & 0x80; - int sy = src[2]; - int sx = src[3]; - - if (flip_screen()) + for (int offs = m_spriteram[bank].bytes() - 4; offs >= 0; offs -= 4) { - sx = 248 - sx; - sy = 248 - sy; - flipx = !flipx; - flipy = !flipy; + u8 const *src = &m_spriteram[bank][offs]; + u8 const code = src[0]; + u8 const attr = src[1]; + u8 const color = attr & 0x3f; + bool flipx = BIT(attr, 6); + bool flipy = BIT(attr, 7); + int ypos = src[2]; + int xpos = src[3]; + + if (bank == 1) // fix wrap + ypos = ((ypos + 8) & 0xff) - 8; + + if (flip_screen()) + { + xpos = (bank ? 240 : 248) - xpos; + ypos = (bank ? 240 : 248) - ypos; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(bank)->transpen(bitmap, cliprect, code, color, flipx, flipy, xpos, ypos, 0); } - - m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0); - } - - // 16x16 sprites - for (int offs = m_spriteram[1].bytes() - 4; offs >= 0; offs -= 4) - { - const u8 *src = &m_spriteram[1][offs]; - int code = src[0]; - int attr = src[1]; - int color = attr & 0x3f; - int flipx = attr & 0x40; - int flipy = attr & 0x80; - int sy = ((src[2] + 8) & 0xff) - 8; - int sx = src[3]; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0); } } u32 olibochu_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_CATEGORY(0)); draw_sprites(bitmap, cliprect); @@ -298,42 +319,47 @@ u32 olibochu_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c TIMER_DEVICE_CALLBACK_MEMBER(olibochu_state::scanline) { - int scanline = param; + int const scanline = param; - if (scanline == 248) // vblank irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 - RST 10h + if (scanline == 248) // VBLANK + { + m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, HOLD_LINE, 0xd7); // Z80 - RST 10h + m_audiocpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); + } - if (scanline == 128) // periodic irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - RST 08h + if (scanline == 128) // periodic + { + m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, HOLD_LINE, 0xcf); // Z80 - RST 08h + m_audiocpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); + } } - -/*************************************************************************** +/******************************************************************************* Sound -***************************************************************************/ +*******************************************************************************/ void olibochu_state::sound_command_w(offs_t offset, u8 data) { - u16 prev_lo = m_soundcmd & 0x003f; + u16 const prev_lo = m_sound_command & 0x003f; if (offset == 0) - m_soundcmd = (m_soundcmd & 0x00ff) | data << 8; + m_sound_command = (m_sound_command & 0x00ff) | data << 8; else - m_soundcmd = (m_soundcmd & 0xff00) | data; + m_sound_command = (m_sound_command & 0xff00) | data; u8 c; - u16 hi = m_soundcmd & 0xffc0; - u16 lo = m_soundcmd & 0x003f; + u16 const hi = m_sound_command & 0xffc0; + u16 const lo = m_sound_command & 0x003f; - // soundcmd low bits (edge-triggered) = soundlatch d4-d7 + // sound command low bits (edge-triggered) = soundlatch d4-d7 if (lo && lo != prev_lo) { c = count_leading_zeros_32(lo) - 26; m_soundlatch[1]->write(c & 0xf); } - // soundcmd high bits = soundlatch d0-d3 - for (c = 0; c < 16 && !BIT(hi, c); c++) { ; } + // sound command high bits = soundlatch d0-d3 + for (c = 0; c < 16 && !BIT(hi, c); c++) { } m_soundlatch[0]->write((16 - c) & 0xf); } @@ -344,7 +370,7 @@ void olibochu_state::sample_latch_w(u8 data) void olibochu_state::sample_start_w(u8 data) { - if (data & 0x80) + if (BIT(data, 7)) { // start sample m_soundlatch[1]->clear_w(); @@ -369,10 +395,9 @@ void olibochu_state::cvsd_tick(int state) } - -/*************************************************************************** +/******************************************************************************* Address Maps -***************************************************************************/ +*******************************************************************************/ void olibochu_state::main_map(address_map &map) { @@ -380,7 +405,7 @@ void olibochu_state::main_map(address_map &map) map(0x8000, 0x83ff).ram().w(FUNC(olibochu_state::videoram_w)).share(m_videoram); map(0x8400, 0x87ff).ram().w(FUNC(olibochu_state::colorram_w)).share(m_colorram); map(0x9000, 0x901f).writeonly().share(m_spriteram[1]); - map(0x9020, 0x903f).nopw(); // discard? + map(0x9020, 0x903f).nopw(); // discard (see above) map(0x9800, 0x983f).writeonly().share(m_spriteram[0]); map(0xa000, 0xa000).portr("IN0"); map(0xa001, 0xa001).portr("IN1"); @@ -389,7 +414,7 @@ void olibochu_state::main_map(address_map &map) map(0xa004, 0xa004).portr("DSW1"); map(0xa005, 0xa005).portr("DSW2"); map(0xa800, 0xa801).w(FUNC(olibochu_state::sound_command_w)); - map(0xa802, 0xa802).w(FUNC(olibochu_state::flipscreen_w)); + map(0xa802, 0xa802).w(FUNC(olibochu_state::flip_screen_w)); map(0xf000, 0xffff).ram(); } @@ -398,16 +423,15 @@ void olibochu_state::sound_map(address_map &map) map(0x0000, 0x1fff).rom(); map(0x6000, 0x63ff).ram(); map(0x7000, 0x7000).r(FUNC(olibochu_state::soundlatch_r)); - map(0x7000, 0x7001).w("aysnd", FUNC(ay8910_device::address_data_w)); + map(0x7000, 0x7001).w(m_ay8910, FUNC(ay8910_device::address_data_w)); map(0x7004, 0x7004).w(FUNC(olibochu_state::sample_latch_w)); map(0x7006, 0x7006).w(FUNC(olibochu_state::sample_start_w)); } - -/*************************************************************************** +/******************************************************************************* Input Ports -***************************************************************************/ +*******************************************************************************/ static INPUT_PORTS_START( olibochu ) PORT_START("IN0") @@ -422,9 +446,9 @@ static INPUT_PORTS_START( olibochu ) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -432,16 +456,16 @@ static INPUT_PORTS_START( olibochu ) PORT_START("IN2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) 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("DSW0") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:1,2") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:1,2") PORT_DIPSETTING( 0x00, "2" ) PORT_DIPSETTING( 0x03, "3" ) PORT_DIPSETTING( 0x02, "4" ) @@ -453,22 +477,22 @@ static INPUT_PORTS_START( olibochu ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "DSW1:5" ) PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "DSW1:6" ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) ) PORT_DIPNAME( 0x80, 0x80, "Cross Hatch Pattern" ) PORT_DIPLOCATION("DSW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW1") // works in service mode, but PCB only has 2 dipsw banks and this port is never read in game + PORT_START("DSW1") // works in service mode, but PCB only has 2 DIPSW banks and this port is never read in game PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW2") // Freeze: press P1 start to stop, P2 start to continue - PORT_DIPNAME( 0x01, 0x01, "Freeze (Cheat)") PORT_DIPLOCATION("DSW3:1") + PORT_DIPNAME( 0x01, 0x01, "Freeze (Cheat)") PORT_DIPLOCATION("DSW3:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:2,3,4") + PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:2,3,4") PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) @@ -478,11 +502,11 @@ static INPUT_PORTS_START( olibochu ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 1C_5C ) ) PORT_SERVICE_DIPLOC( 0x10, IP_ACTIVE_LOW, "DSW3:5" ) - PORT_DIPNAME( 0x20, 0x20, "Invincibility (Cheat)" ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPNAME( 0x20, 0x20, "Invincibility (Cheat)" ) PORT_DIPLOCATION("DSW3:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // Level Select: enable to select round at game start (turn off to start game) - PORT_DIPNAME( 0x40, 0x40, "Level Select (Cheat)") PORT_DIPLOCATION("DSW3:7") + PORT_DIPNAME( 0x40, 0x40, "Level Select (Cheat)") PORT_DIPLOCATION("DSW3:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW3:8" ) @@ -503,68 +527,63 @@ static INPUT_PORTS_START( punchkid ) INPUT_PORTS_END - -/*************************************************************************** +/******************************************************************************* GFX Layouts -***************************************************************************/ +*******************************************************************************/ -static const gfx_layout charlayout = +static gfx_layout const gfx_8x8 = { - 8,8, - RGN_FRAC(1,2), + 8, 8, + RGN_FRAC(1, 2), 2, - { RGN_FRAC(1,2), 0 }, - { 7, 6, 5, 4, 3, 2, 1, 0 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 + { RGN_FRAC(1, 2), RGN_FRAC(0, 2) }, + { STEP8(7, -1) }, + { STEP8(0, 8) }, + 8 * 8 }; -static const gfx_layout spritelayout = +static gfx_layout const gfx_16x16 = { - 16,16, - RGN_FRAC(1,2), + 16, 16, + RGN_FRAC(1, 2), 2, - { RGN_FRAC(1,2), 0 }, - { 7, 6, 5, 4, 3, 2, 1, 0, - 16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 + { RGN_FRAC(1, 2), RGN_FRAC(0, 2) }, + { STEP8(7, -1), STEP8(128 + 7, -1) }, + { STEP16(0, 8) }, + 32 * 8 }; static GFXDECODE_START( gfx_olibochu ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 256, 64 ) + GFXDECODE_ENTRY( "gfx8x8", 0, gfx_8x8, 0, 64 ) + GFXDECODE_ENTRY( "gfx16x16", 0, gfx_16x16, 256, 64 ) GFXDECODE_END - -/*************************************************************************** +/******************************************************************************* Machine Configs -***************************************************************************/ +*******************************************************************************/ void olibochu_state::olibochu(machine_config &config) { // basic machine hardware - Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); + XTAL constexpr MASTER_CLOCK = 18.432_MHz_XTAL; + + Z80(config, m_maincpu, MASTER_CLOCK / 3 / 2); m_maincpu->set_addrmap(AS_PROGRAM, &olibochu_state::main_map); - TIMER(config, "scantimer").configure_scanline(FUNC(olibochu_state::scanline), "screen", 0, 1); - Z80(config, m_audiocpu, 18.432_MHz_XTAL / 6); + Z80(config, m_audiocpu, MASTER_CLOCK / 3 / 2); m_audiocpu->set_addrmap(AS_PROGRAM, &olibochu_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(olibochu_state::irq0_line_hold), attotime::from_hz(120)); // 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(32*8, 32*8); - screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1); - screen.set_screen_update(FUNC(olibochu_state::screen_update)); - screen.set_palette(m_palette); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MASTER_CLOCK / 3, 384, 0, 256, 256, 8, 248); + m_screen->set_screen_update(FUNC(olibochu_state::screen_update)); + m_screen->set_palette(m_palette); + + TIMER(config, "scanline").configure_scanline(FUNC(olibochu_state::scanline), m_screen, 0, 1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_olibochu); - PALETTE(config, m_palette, FUNC(olibochu_state::palette), 256*2, 32); + PALETTE(config, m_palette, FUNC(olibochu_state::palette), 256 * 2, 32); // sound hardware SPEAKER(config, "mono").front_center(); @@ -572,22 +591,21 @@ void olibochu_state::olibochu(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); - AY8910(config, "aysnd", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); + AY8910(config, m_ay8910, MASTER_CLOCK / 3 / 2 / 2).add_route(ALL_OUTPUTS, "mono", 0.5); HC55516(config, m_cvsd, 0).add_route(ALL_OUTPUTS, "mono", 0.5); - clock_device &cvsd_clock(CLOCK(config, "cvsd_clock", 16000)); - cvsd_clock.signal_handler().set(FUNC(olibochu_state::cvsd_tick)); - cvsd_clock.signal_handler().append(m_cvsd, FUNC(hc55516_device::mclock_w)); + CLOCK(config, m_cvsd_clock, 16000); + m_cvsd_clock->signal_handler().set(FUNC(olibochu_state::cvsd_tick)); + m_cvsd_clock->signal_handler().append(m_cvsd, FUNC(hc55516_device::mclock_w)); } - -/*************************************************************************** +/******************************************************************************* ROM Definitions -***************************************************************************/ +*******************************************************************************/ ROM_START( olibochu ) - ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "obc_1b.n3", 0x0000, 0x1000, CRC(bf17f4f4) SHA1(1075456f4b70a68548e0e1b6271fd4b845a77ce4) ) ROM_LOAD( "obc_2b.m3", 0x1000, 0x1000, CRC(63833b0d) SHA1(0135c449c92470241d03a87709c739209139d660) ) ROM_LOAD( "obc_3b.k3", 0x2000, 0x1000, CRC(a4038e8b) SHA1(d7dce830239c8975ac135b213a99eec0c20ec3e2) ) @@ -597,7 +615,7 @@ ROM_START( olibochu ) ROM_LOAD( "obc_7c.e3", 0x6000, 0x1000, CRC(89c26fb4) SHA1(ebc51e40612af894b20bd7fc3a5179cd35aaac9b) ) ROM_LOAD( "obc_8b.d3", 0x7000, 0x1000, CRC(af19e5a5) SHA1(5a55bbee5b2f20e2988171a310c8293dabbd9a72) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "obc_17.j4", 0x0000, 0x1000, CRC(57f07402) SHA1(a763a835ac512c69b4351c1ec72b0a64e46203aa) ) ROM_LOAD( "obc_18.l4", 0x1000, 0x1000, CRC(0a903e9c) SHA1(d893c2f5373f748d8bebf3673b15014f4a8d4b5c) ) @@ -605,11 +623,11 @@ ROM_START( olibochu ) ROM_LOAD( "obc_15.k1", 0x0000, 0x1000, CRC(fb5dd281) SHA1(fba947ae7b619c2559b5af69ef02acfb15733f0d) ) ROM_LOAD( "obc_16.m1", 0x1000, 0x1000, CRC(c07614a5) SHA1(d13d271a324f99d008429c16193c4504e5894493) ) - ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_REGION( 0x2000, "gfx8x8", 0 ) ROM_LOAD( "obc_13.n6", 0x0000, 0x1000, CRC(b4fcf9af) SHA1(b360daa0670160dca61512823c98bc37ad99b9cf) ) ROM_LOAD( "obc_14.n4", 0x1000, 0x1000, CRC(af54407e) SHA1(1883928b721e03e452fd0c626c403dc374b02ed7) ) - ROM_REGION( 0x4000, "gfx2", 0 ) + ROM_REGION( 0x4000, "gfx16x16", 0 ) ROM_LOAD( "obc_9.a6", 0x0000, 0x1000, CRC(fa69e16e) SHA1(5a493a0a108b3e496884d1f499f3445d4e241ecd) ) ROM_LOAD( "obc_10.a2", 0x1000, 0x1000, CRC(10359f84) SHA1(df55f06fd98233d0efbc30e3e24bf9b8cab1a5cc) ) ROM_LOAD( "obc_11.a4", 0x2000, 0x1000, CRC(1d968f5f) SHA1(4acf78d865ca36355bb15dc1d476f5e97a5d91b7) ) @@ -622,7 +640,7 @@ ROM_START( olibochu ) ROM_END ROM_START( punchkid ) - ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "pka_1.n3", 0x0000, 0x1000, CRC(18f1fa10) SHA1(cc586d9502c7c1e922570400063a0f2277cf6b3c) ) ROM_LOAD( "pka_2.m3", 0x1000, 0x1000, CRC(7766d9be) SHA1(bd7c3b4499f9dd6eb4b2c4a8e4e8fe4851b67b74) ) ROM_LOAD( "pka_3.k3", 0x2000, 0x1000, CRC(bb90e21b) SHA1(ae58c05058197943ecfa0612163da5cc38f99fd2) ) @@ -632,7 +650,7 @@ ROM_START( punchkid ) ROM_LOAD( "pka_7.e3", 0x6000, 0x1000, CRC(c689e057) SHA1(9b94fac8d1608412f8900aa9ddf56be12bdb847a) ) ROM_LOAD( "pka_8.d3", 0x7000, 0x1000, CRC(61c118e0) SHA1(9c0f17283b42e6d4622b83a08ac2ac59913be50f) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "pka_17.j4", 0x0000, 0x1000, CRC(57f07402) SHA1(a763a835ac512c69b4351c1ec72b0a64e46203aa) ) ROM_LOAD( "pka_18.l4", 0x1000, 0x1000, CRC(0a903e9c) SHA1(d893c2f5373f748d8bebf3673b15014f4a8d4b5c) ) @@ -640,11 +658,11 @@ ROM_START( punchkid ) ROM_LOAD( "pka_15.k1", 0x0000, 0x1000, CRC(fb5dd281) SHA1(fba947ae7b619c2559b5af69ef02acfb15733f0d) ) ROM_LOAD( "pka_16.m1", 0x1000, 0x1000, CRC(c07614a5) SHA1(d13d271a324f99d008429c16193c4504e5894493) ) - ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_REGION( 0x2000, "gfx8x8", 0 ) ROM_LOAD( "pka_13.n6", 0x0000, 0x1000, CRC(388f2bfd) SHA1(939cf2dcb21965106aa2fcdcd3abcee5e4071770) ) ROM_LOAD( "pka_14.n4", 0x1000, 0x1000, CRC(b5bf456f) SHA1(5db9af314d74cef8a3405162c4ba99204b79ae5a) ) - ROM_REGION( 0x4000, "gfx2", 0 ) + ROM_REGION( 0x4000, "gfx16x16", 0 ) ROM_LOAD( "pka_9.a6", 0x0000, 0x1000, CRC(fa69e16e) SHA1(5a493a0a108b3e496884d1f499f3445d4e241ecd) ) ROM_LOAD( "pka_10.a2", 0x1000, 0x1000, CRC(10359f84) SHA1(df55f06fd98233d0efbc30e3e24bf9b8cab1a5cc) ) ROM_LOAD( "pka_11.a4", 0x2000, 0x1000, CRC(1d968f5f) SHA1(4acf78d865ca36355bb15dc1d476f5e97a5d91b7) ) @@ -659,11 +677,10 @@ ROM_END } // anonymous namespace - -/*************************************************************************** +/******************************************************************************* Drivers -***************************************************************************/ +*******************************************************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT SCREEN COMPANY, FULLNAME, FLAGS -GAME( 1981, olibochu, 0, olibochu, olibochu, olibochu_state, empty_init, ROT270, "Irem (GDI license)", "Oli-Boo-Chu (USA)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, punchkid, olibochu, olibochu, punchkid, olibochu_state, empty_init, ROT270, "Irem", "Punching Kid (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT SCREEN COMPANY FULLNAME FLAGS +GAME( 1981, olibochu, 0, olibochu, olibochu, olibochu_state, empty_init, ROT270, "Irem (GDI license)", "Oli-Boo-Chu (USA)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, punchkid, olibochu, olibochu, punchkid, olibochu_state, empty_init, ROT270, "Irem", "Punching Kid (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/irem/redalert_v.cpp b/src/mame/irem/redalert_v.cpp index edf03a5938562..68ed322155990 100644 --- a/src/mame/irem/redalert_v.cpp +++ b/src/mame/irem/redalert_v.cpp @@ -239,7 +239,7 @@ VIDEO_START_MEMBER(redalert_state,demoneye) { VIDEO_START_CALL_MEMBER( redalert ); - save_pointer(NAME(m_demoneye_bitmap_reg), 4); + save_item(NAME(m_demoneye_bitmap_reg)); save_item(NAME(m_demoneye_bitmap_yoffs)); } diff --git a/src/mame/itech/capbowl.cpp b/src/mame/itech/capbowl.cpp index b666e1cfbd151..31b2718ab23c1 100644 --- a/src/mame/itech/capbowl.cpp +++ b/src/mame/itech/capbowl.cpp @@ -584,7 +584,7 @@ void capbowl_base_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -604,7 +604,7 @@ void capbowl_base_state::base(machine_config &config) ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(8'000'000) / 2)); ymsnd.irq_handler().set_inputline(m_audiocpu, M6809_FIRQ_LINE); - ymsnd.port_a_read_callback().set("ticket", FUNC(ticket_dispenser_device::line_r)).lshift(7); + ymsnd.port_a_read_callback().set("ticket", FUNC(ticket_dispenser_device::line_r)).invert().lshift(7); ymsnd.port_b_write_callback().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7); // Also a status LED. See memory map above ymsnd.add_route(0, "speaker", 0.07); ymsnd.add_route(1, "speaker", 0.07); diff --git a/src/mame/itech/itech32.cpp b/src/mame/itech/itech32.cpp index 24ea102e505d7..7e9f78e0d5523 100644 --- a/src/mame/itech/itech32.cpp +++ b/src/mame/itech/itech32.cpp @@ -1775,7 +1775,7 @@ void itech32_state::base_devices(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_IRQ0); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/itech/itech8.cpp b/src/mame/itech/itech8.cpp index a520136364cdc..73c4b30e472b4 100644 --- a/src/mame/itech/itech8.cpp +++ b/src/mame/itech/itech8.cpp @@ -1166,7 +1166,7 @@ INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(itech8_state::gtg_mux) +ioport_value itech8_state::gtg_mux() { return m_p1->read() & m_p2->read(); } @@ -1721,7 +1721,7 @@ void itech8_state::itech8_core_devices(machine_config &config) { NVRAM(config, m_nvram, nvram_device::DEFAULT_RANDOM); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -1795,7 +1795,7 @@ void itech8_state::itech8_sound_ym3812(machine_config &config) m_soundcpu->set_addrmap(AS_PROGRAM, &itech8_state::sound3812_map); pia6821_device &pia(PIA6821(config, "pia")); - pia.readpb_handler().set("ticket", FUNC(ticket_dispenser_device::line_r)); + pia.readpb_handler().set("ticket", FUNC(ticket_dispenser_device::line_r)).invert(); pia.writepa_handler().set(FUNC(itech8_state::pia_porta_out)); pia.writepb_handler().set(FUNC(itech8_state::pia_portb_out)); diff --git a/src/mame/itech/itech8.h b/src/mame/itech/itech8.h index 0801344fd3a42..2d38fc34f5006 100644 --- a/src/mame/itech/itech8.h +++ b/src/mame/itech/itech8.h @@ -57,7 +57,7 @@ class itech8_state : public driver_device void init_hstennis(); int special_r(); - DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux); + ioport_value gtg_mux(); protected: static constexpr u32 VRAM_SIZE = 0x40000; diff --git a/src/mame/jaleco/bnstars.cpp b/src/mame/jaleco/bnstars.cpp index 8c0d68ac5457c..80bcb4e3fcb62 100644 --- a/src/mame/jaleco/bnstars.cpp +++ b/src/mame/jaleco/bnstars.cpp @@ -128,7 +128,7 @@ class ms32_bnstars_state : public ms32_base_state void init_bnstars(); - template DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r); + template ioport_value mahjong_ctrl_r(); private: @@ -436,7 +436,7 @@ template void ms32_bnstars_state::palette_ram_w(offs_t offset, u16 da } template -CUSTOM_INPUT_MEMBER(ms32_bnstars_state::mahjong_ctrl_r) +ioport_value ms32_bnstars_state::mahjong_ctrl_r() { required_ioport_array<4> &keys = (P == 0) ? m_p1_keys : m_p2_keys; // different routing than other ms32.cpp mahjong games, using 0x2080 as mask diff --git a/src/mame/jaleco/cischeat.cpp b/src/mame/jaleco/cischeat.cpp index 6ab604cd0f9b2..b66199a62fb97 100644 --- a/src/mame/jaleco/cischeat.cpp +++ b/src/mame/jaleco/cischeat.cpp @@ -835,7 +835,7 @@ void captflag_state::motor_move(int side, uint16_t data) } template -CUSTOM_INPUT_MEMBER(captflag_state::motor_pos_r) +ioport_value captflag_state::motor_pos_r() { const uint8_t pos[4] = {1,0,2,3}; // -> 2,3,1,0 offsets -> 0123 return ~pos[m_motor_pos[N]]; @@ -1668,19 +1668,19 @@ INPUT_PORTS_END Arm Champs II **************************************************************************/ -CUSTOM_INPUT_MEMBER(armchamp2_state::left_sensor_r) +ioport_value armchamp2_state::left_sensor_r() { int arm_x = ioport("ARM")->read(); return (arm_x < 0x40); } -CUSTOM_INPUT_MEMBER(armchamp2_state::right_sensor_r) +ioport_value armchamp2_state::right_sensor_r() { int arm_x = ioport("ARM")->read(); return (arm_x > 0xc0); } -CUSTOM_INPUT_MEMBER(armchamp2_state::center_sensor_r) +ioport_value armchamp2_state::center_sensor_r() { int arm_x = ioport("ARM")->read(); return ((arm_x > 0x60) && (arm_x < 0xa0)); @@ -2369,7 +2369,7 @@ void captflag_state::captflag(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &captflag_state::captflag_map); TIMER(config, "scantimer").configure_scanline(FUNC(captflag_state::captflag_scanline), "screen", 0, 1); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000)); WATCHDOG_TIMER(config, m_watchdog); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/jaleco/cischeat.h b/src/mame/jaleco/cischeat.h index 98bdaf8788add..f1b0741656081 100644 --- a/src/mame/jaleco/cischeat.h +++ b/src/mame/jaleco/cischeat.h @@ -183,9 +183,9 @@ class armchamp2_state : public cischeat_state void armchmp2(machine_config &config); void armchmp2_map(address_map &map); TIMER_DEVICE_CALLBACK_MEMBER(armchamp2_scanline); - DECLARE_CUSTOM_INPUT_MEMBER(left_sensor_r); - DECLARE_CUSTOM_INPUT_MEMBER(right_sensor_r); - DECLARE_CUSTOM_INPUT_MEMBER(center_sensor_r); + ioport_value left_sensor_r(); + ioport_value right_sensor_r(); + ioport_value center_sensor_r(); private: u16 m_arm_motor_command; @@ -232,7 +232,7 @@ class captflag_state : public cischeat_state void captflag(machine_config &config); template int motor_busy_r(); - template DECLARE_CUSTOM_INPUT_MEMBER(motor_pos_r); + template ioport_value motor_pos_r(); void init_captflag(); void init_vscaptfl(); diff --git a/src/mame/jaleco/ddayjlc.cpp b/src/mame/jaleco/ddayjlc.cpp index c83441ba516c5..54f6074ce4f26 100644 --- a/src/mame/jaleco/ddayjlc.cpp +++ b/src/mame/jaleco/ddayjlc.cpp @@ -90,7 +90,7 @@ class ddayjlc_state : public driver_device void ddayjlc(machine_config &config); void init_ddayjlc(); - DECLARE_CUSTOM_INPUT_MEMBER(prot_r); + ioport_value prot_r(); protected: virtual void machine_start() override; @@ -282,7 +282,7 @@ static const uint8_t prot_data[0x10] = 0x03, 0x01, 0x00, 0x03 }; -CUSTOM_INPUT_MEMBER(ddayjlc_state::prot_r) +ioport_value ddayjlc_state::prot_r() { return prot_data[m_prot_addr]; } diff --git a/src/mame/jaleco/exerion.cpp b/src/mame/jaleco/exerion.cpp index 6cda724cc7d65..5eab6b80d4c5c 100644 --- a/src/mame/jaleco/exerion.cpp +++ b/src/mame/jaleco/exerion.cpp @@ -168,7 +168,7 @@ class exerion_state : public driver_device void init_exerionb(); void init_irion(); - DECLARE_CUSTOM_INPUT_MEMBER(controls_r); + ioport_value controls_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); protected: @@ -628,7 +628,7 @@ uint32_t exerion_state::screen_update(screen_device &screen, bitmap_ind16 &bitma *************************************/ // Players inputs are muxed at 0xa000 -CUSTOM_INPUT_MEMBER(exerion_state::controls_r) +ioport_value exerion_state::controls_r() { return m_inputs[m_cocktail_flip]->read() & 0x3f; } diff --git a/src/mame/jaleco/homerun.cpp b/src/mame/jaleco/homerun.cpp index ac031dce84177..40bf5bf299a32 100644 --- a/src/mame/jaleco/homerun.cpp +++ b/src/mame/jaleco/homerun.cpp @@ -147,7 +147,7 @@ class homerun_state : public driver_device int sprite0_r(); int homerun_d7756_busy_r(); - DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_hopper_status_r); + ioport_value ganjaja_hopper_status_r(); protected: virtual void machine_start() override; @@ -409,7 +409,7 @@ int homerun_state::homerun_d7756_busy_r() return m_samples->playing(0) ? 0 : 1; } -CUSTOM_INPUT_MEMBER(homerun_state::ganjaja_hopper_status_r) +ioport_value homerun_state::ganjaja_hopper_status_r() { // gives hopper error if not 0 return 0; diff --git a/src/mame/jaleco/megasys1.cpp b/src/mame/jaleco/megasys1.cpp index c37587aa5117d..670ce1bd1919f 100644 --- a/src/mame/jaleco/megasys1.cpp +++ b/src/mame/jaleco/megasys1.cpp @@ -693,13 +693,13 @@ u8 megasys1_state::oki_status_r() return m_oki[Chip]->read(); } -void megasys1_typea_state::p47b_adpcm_w(offs_t offset, u8 data) +void megasys1_typea_state::p47bl_adpcm_w(offs_t offset, u8 data) { // bit 6 is always set - m_p47b_adpcm[offset]->reset_w(BIT(data, 7)); - m_p47b_adpcm[offset]->data_w(data & 0x0f); - m_p47b_adpcm[offset]->vclk_w(1); - m_p47b_adpcm[offset]->vclk_w(0); + m_p47bl_adpcm[offset]->reset_w(BIT(data, 7)); + m_p47bl_adpcm[offset]->data_w(data & 0x0f); + m_p47bl_adpcm[offset]->vclk_w(1); + m_p47bl_adpcm[offset]->vclk_w(0); } /*************************************************************************** @@ -731,7 +731,7 @@ void megasys1_typea_state::kickoffb_sound_map(address_map &map) map(0x0e0000, 0x0fffff).ram(); } -void megasys1_typea_state::p47b_sound_map(address_map &map) +void megasys1_typea_state::p47bl_sound_map(address_map &map) { map(0x000000, 0x01ffff).rom(); map(0x040000, 0x040001).r(m_soundlatch[0], FUNC(generic_latch_16_device::read)); @@ -743,15 +743,15 @@ void megasys1_typea_state::p47b_sound_map(address_map &map) map(0x0e0000, 0x0fffff).ram(); } -void megasys1_typea_state::p47b_extracpu_prg_map(address_map &map) // TODO +void megasys1_typea_state::p47bl_extracpu_prg_map(address_map &map) // TODO { map(0x0000, 0xffff).rom().nopw(); } -void megasys1_typea_state::p47b_extracpu_io_map(address_map &map) +void megasys1_typea_state::p47bl_extracpu_io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x01).w(FUNC(megasys1_typea_state::p47b_adpcm_w)); + map(0x00, 0x01).w(FUNC(megasys1_typea_state::p47bl_adpcm_w)); map(0x01, 0x01).r("soundlatch3", FUNC(generic_latch_8_device::read)); } @@ -1995,11 +1995,11 @@ void megasys1_typea_state::system_A_kickoffb(machine_config &config) ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.80); } -void megasys1_typea_state::system_A_p47b(machine_config &config) +void megasys1_typea_state::system_A_p47bl(machine_config &config) { system_A_kickoffb(config); m_audiocpu->set_clock(7.2_MHz_XTAL); - m_audiocpu->set_addrmap(AS_PROGRAM, &megasys1_typea_state::p47b_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &megasys1_typea_state::p47bl_sound_map); config.device_remove("oki1"); @@ -2008,21 +2008,21 @@ void megasys1_typea_state::system_A_p47b(machine_config &config) // probably for driving the OKI M5205 z80_device &extracpu(Z80(config, "extracpu", 7.2_MHz_XTAL / 2)); // divisor not verified extracpu.set_periodic_int(FUNC(megasys1_state::irq0_line_hold), attotime::from_hz(8000)); - extracpu.set_addrmap(AS_PROGRAM, &megasys1_typea_state::p47b_extracpu_prg_map); - extracpu.set_addrmap(AS_IO, &megasys1_typea_state::p47b_extracpu_io_map); + extracpu.set_addrmap(AS_PROGRAM, &megasys1_typea_state::p47bl_extracpu_prg_map); + extracpu.set_addrmap(AS_IO, &megasys1_typea_state::p47bl_extracpu_io_map); GENERIC_LATCH_8(config, "soundlatch3"); // OKI M5205 - MSM5205(config, m_p47b_adpcm[0], 384000); - m_p47b_adpcm[0]->set_prescaler_selector(msm5205_device::SEX_4B); - m_p47b_adpcm[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_p47b_adpcm[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); - - MSM5205(config, m_p47b_adpcm[1], 384000); - m_p47b_adpcm[1]->set_prescaler_selector(msm5205_device::SEX_4B); - m_p47b_adpcm[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_p47b_adpcm[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + MSM5205(config, m_p47bl_adpcm[0], 384000); + m_p47bl_adpcm[0]->set_prescaler_selector(msm5205_device::SEX_4B); + m_p47bl_adpcm[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_p47bl_adpcm[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + + MSM5205(config, m_p47bl_adpcm[1], 384000); + m_p47bl_adpcm[1]->set_prescaler_selector(msm5205_device::SEX_4B); + m_p47bl_adpcm[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_p47bl_adpcm[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); } void megasys1_bc_iosim_state::system_B(machine_config &config) @@ -4035,6 +4035,43 @@ ROM_START( p47 ) ROM_LOAD( "p-47.14m", 0x0000, 0x0200, CRC(1d877538) SHA1(a5be0dc65dcfc36fbba10d1fddbe155e24b6122f) ) ROM_END +// on original PCB with original ROMs. Has Freedom instead of Phantom. +ROM_START( p47a ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU Code */ + ROM_LOAD16_BYTE( "jaleco_export_p-47_3.rom2", 0x000000, 0x020000, CRC(022e58b8) SHA1(87db59e409977358d9a7b689f2d69bef056328d9) ) + ROM_LOAD16_BYTE( "jaleco_export_p-47_1.rom1", 0x000001, 0x020000, CRC(ed926bd8) SHA1(5cf3e7b9b23667eaa8ebcff0803a7b881c7b83cf) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound CPU Code */ + ROM_LOAD16_BYTE( "jaleco_p-47_9.rom8", 0x000000, 0x010000, CRC(ffcf318e) SHA1(c675968c931a7e8e00ae83e49e8cef3fd193da57) ) + ROM_LOAD16_BYTE( "jaleco_p-47_19.rom7", 0x000001, 0x010000, CRC(adb8c12e) SHA1(31590b037133f81a52779dbd4f2b5ac5b59198ae) ) + + ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */ + ROM_LOAD( "hn62312ap_c42.rom4", 0x000000, 0x040000, CRC(8a75e0c3) SHA1(1d550fd24bc05d4636ba7206247efe65c681494f) ) + ROM_LOAD( "jaleco_p-47_7.rom3", 0x040000, 0x010000, CRC(f3b1850a) SHA1(d12c61f647aaad53d745ba66d50d22cdf8065c00) ) + + ROM_REGION( 0x080000, "scroll1", 0 ) /* Scroll 1 */ + ROM_LOAD( "jaleco_p-47_23.rom5", 0x000000, 0x020000, CRC(6e9bc864) SHA1(f56ea2dd638a8f6952796535eb549ddd55573bcf) ) + ROM_RELOAD( 0x020000, 0x020000 ) /* why? */ + ROM_LOAD( "jaleco_p-47_12.rom6", 0x040000, 0x020000, CRC(5268395f) SHA1(de0cba1e7a7d4acc27467d1b553e8f39bea7282e) ) + + ROM_REGION( 0x020000, "scroll2", 0 ) /* Scroll 2 */ + ROM_LOAD( "jaleco_p-47_16.rom12", 0x000000, 0x010000, CRC(30e44375) SHA1(62a4bb217b6aad5fd4760a0f4999cb63559549a5) ) // "freedom" instead of "phantom" in the logo + + ROM_REGION( 0x080000, "sprites", 0 ) /* Sprites */ + ROM_LOAD( "hn62312ap_c45.rom11", 0x000000, 0x040000, CRC(a239baf4) SHA1(127e9ae02a87b3074300ebda68f00ed1a6e51dfb) ) + ROM_LOAD( "jaleco_p-47_26.rom13", 0x040000, 0x020000, CRC(4d07581a) SHA1(768693e1fcb822b8284ba14c9a5c3d6b00f73383) ) + ROM_RELOAD( 0x060000, 0x020000 ) /* why? */ + + ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */ + ROM_LOAD( "hn62312ap_c44.rom9", 0x000000, 0x040000, CRC(a5f6da1f) SHA1(a876bd4f966e45e702879a834fc9344bea85d3fa) ) + + ROM_REGION( 0x040000, "oki2", 0 ) /* Samples */ + ROM_LOAD( "hn62312ap_c43.rom10", 0x000000, 0x040000, CRC(9149286b) SHA1(f6c66c5cd50b72c4d401a263c65a8d4ef8cf9221) ) + + ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM (N82S131N compatible type BPROM) */ + ROM_LOAD( "p-47.14m", 0x0000, 0x0200, CRC(1d877538) SHA1(a5be0dc65dcfc36fbba10d1fddbe155e24b6122f) ) +ROM_END + /* The Japanese version of P-47 can be found in 2 different ROM board configurations: @@ -4160,7 +4197,7 @@ ROM_START( p47je ) ROM_LOAD( "p-47.14m", 0x0000, 0x0200, CRC(1d877538) SHA1(a5be0dc65dcfc36fbba10d1fddbe155e24b6122f) ) ROM_END -ROM_START( p47b ) // very similar to original hardware but for the sound system (a YM2203 with a Y3014B DAC with unpopulated spaces for another pair + an OKI M5205) and an extra Z80 +ROM_START( p47bl ) // very similar to original hardware but for the sound system (a YM2203 with a Y3014B DAC with unpopulated spaces for another pair + an OKI M5205) and an extra Z80 ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU Code, identical to p47 set but with smaller ROMs */ ROM_LOAD16_BYTE( "12.bin", 0x000000, 0x010000, CRC(cc81abd8) SHA1(223d205ee5120d16b997b0788fcb81c0de52da04) ) ROM_LOAD16_BYTE( "13.bin", 0x020000, 0x010000, CRC(f3ea8a3e) SHA1(b2ea6661f7a3653ac6d92e07176546a41178eaff) ) @@ -5222,9 +5259,10 @@ GAME( 1988, makaiden, lomakai, system_Z, lomakai, megasys1_typez_st // Type A GAME( 1988, p47, 0, system_A, p47, megasys1_typea_state, empty_init, ROT0, "Jaleco", "P-47 - The Phantom Fighter (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, p47a, p47, system_A, p47, megasys1_typea_state, empty_init, ROT0, "Jaleco", "P-47 - The Freedom Fighter (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, p47j, p47, system_A, p47, megasys1_typea_state, empty_init, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, p47je, p47, system_A, p47, megasys1_typea_state, empty_init, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan, Export)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, p47b, p47, system_A_p47b, p47, megasys1_typea_state, empty_init, ROT0, "bootleg","P-47 - The Freedom Fighter (World, bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, p47bl, p47, system_A_p47bl, p47, megasys1_typea_state, empty_init, ROT0, "bootleg","P-47 - The Freedom Fighter (World, bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, kickoff, 0, system_A, kickoff, megasys1_typea_state, empty_init, ROT0, "Jaleco", "Kick Off - Jaleco Cup (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, kickoffb, kickoff, system_A_kickoffb, kickoff, megasys1_typea_state, empty_init, ROT0, "bootleg (Comodo)", "Kick Off - World Cup (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // OKI needs to be checked GAME( 1988, tshingen, 0, system_A_d65006, tshingen, megasys1_typea_state, empty_init, ROT0, "Jaleco", "Shingen Samurai-Fighter (Japan, English)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/jaleco/megasys1.h b/src/mame/jaleco/megasys1.h index 90a6cabe250d5..f14c8b2f4eb65 100644 --- a/src/mame/jaleco/megasys1.h +++ b/src/mame/jaleco/megasys1.h @@ -155,7 +155,7 @@ class megasys1_typea_state : public megasys1_state public: megasys1_typea_state(const machine_config &mconfig, device_type type, const char *tag) : megasys1_state(mconfig, type, tag), - m_p47b_adpcm(*this, "msm%u", 1U), + m_p47bl_adpcm(*this, "msm%u", 1U), m_gatearray(*this, "gatearray") { } @@ -164,7 +164,7 @@ class megasys1_typea_state : public megasys1_state void system_A_gs88000_soldam(machine_config &config); void system_A_iganinju(machine_config &config); void system_A_kickoffb(machine_config &config); - void system_A_p47b(machine_config &config); + void system_A_p47bl(machine_config &config); void system_A_d65006(machine_config &config); void system_A_d65006_iganinju(machine_config &config); void system_A_gs88000(machine_config &config); @@ -180,17 +180,17 @@ class megasys1_typea_state : public megasys1_state virtual void machine_reset() override; void kickoffb_sound_map(address_map &map); - void p47b_sound_map(address_map &map); - void p47b_extracpu_prg_map(address_map &map); - void p47b_extracpu_io_map(address_map &map); + void p47bl_sound_map(address_map &map); + void p47bl_extracpu_prg_map(address_map &map); + void p47bl_extracpu_io_map(address_map &map); void megasys1A_map(address_map &map); void megasys1A_sound_map(address_map &map); - void p47b_adpcm_w(offs_t offset, u8 data); + void p47bl_adpcm_w(offs_t offset, u8 data); private: - optional_device_array m_p47b_adpcm; + optional_device_array m_p47bl_adpcm; optional_device m_gatearray; TIMER_DEVICE_CALLBACK_MEMBER(megasys1A_iganinju_scanline); diff --git a/src/mame/jaleco/ms32.cpp b/src/mame/jaleco/ms32.cpp index 4968db6b2ae5d..5d057dcd66a30 100644 --- a/src/mame/jaleco/ms32.cpp +++ b/src/mame/jaleco/ms32.cpp @@ -482,7 +482,7 @@ Notes from Charles MacDonald /********** READ INPUTS **********/ -CUSTOM_INPUT_MEMBER(ms32_state::mahjong_ctrl_r) +ioport_value ms32_state::mahjong_ctrl_r() { u32 mj_input; diff --git a/src/mame/jaleco/ms32.h b/src/mame/jaleco/ms32.h index 843a4cee6191f..d58bf35d7e5b5 100644 --- a/src/mame/jaleco/ms32.h +++ b/src/mame/jaleco/ms32.h @@ -93,7 +93,7 @@ class ms32_state : public ms32_base_state void init_bnstars(); void init_ss92046_01(); - DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r); + ioport_value mahjong_ctrl_r(); protected: required_device m_sysctrl; diff --git a/src/mame/jaleco/tetrisp2.cpp b/src/mame/jaleco/tetrisp2.cpp index a95dd7c18defb..cf80808357a48 100644 --- a/src/mame/jaleco/tetrisp2.cpp +++ b/src/mame/jaleco/tetrisp2.cpp @@ -230,7 +230,7 @@ void rocknms_state::rocknms_main2sub_w(offs_t offset, u16 data, u16 mem_mask) m_rocknms_main2sub = (data ^ 0xffff); } -CUSTOM_INPUT_MEMBER(rocknms_state::rocknms_main2sub_status_r) +ioport_value rocknms_state::rocknms_main2sub_status_r() { return m_rocknms_sub2main & 0x0003; } diff --git a/src/mame/jaleco/tetrisp2.h b/src/mame/jaleco/tetrisp2.h index 2b58f47b4f1a1..da0c9f785db94 100644 --- a/src/mame/jaleco/tetrisp2.h +++ b/src/mame/jaleco/tetrisp2.h @@ -162,7 +162,7 @@ class rocknms_state : public tetrisp2_state void rocknms(machine_config &config); void init_rocknms(); - DECLARE_CUSTOM_INPUT_MEMBER(rocknms_main2sub_status_r); + ioport_value rocknms_main2sub_status_r(); private: required_device m_subcpu; diff --git a/src/mame/kaneko/suprnova.cpp b/src/mame/kaneko/suprnova.cpp index 59abba6a3aee7..9a128f26500b0 100644 --- a/src/mame/kaneko/suprnova.cpp +++ b/src/mame/kaneko/suprnova.cpp @@ -497,7 +497,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(skns_state::irq) **********************************************************************************/ template -CUSTOM_INPUT_MEMBER(skns_state::paddle_r) +ioport_value skns_state::paddle_r() { return m_paddle[P]->read(); } diff --git a/src/mame/kaneko/suprnova.h b/src/mame/kaneko/suprnova.h index 7fc21a26c300d..df8f4ecd67bb1 100644 --- a/src/mame/kaneko/suprnova.h +++ b/src/mame/kaneko/suprnova.h @@ -66,7 +66,7 @@ class skns_state : public driver_device void init_galpani4(); void init_ryouran(); - template DECLARE_CUSTOM_INPUT_MEMBER(paddle_r); + template ioport_value paddle_r(); private: struct hit_t diff --git a/src/mame/kaypro/kaypro_m.cpp b/src/mame/kaypro/kaypro_m.cpp index 2bda040f82fc6..dfc11add8b62a 100644 --- a/src/mame/kaypro/kaypro_m.cpp +++ b/src/mame/kaypro/kaypro_m.cpp @@ -300,27 +300,31 @@ QUICKLOAD_LOAD_MEMBER(kaypro_state::quickload_cb) address_space& prog_space = m_maincpu->space(AS_PROGRAM); - /* Avoid loading a program if CP/M-80 is not in memory */ + // Avoid loading a program if CP/M-80 is not in memory if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); + // Check for sufficient RAM based on position of CPM + const int mem_avail = 256 * prog_space.read_byte(7) + prog_space.read_byte(6) - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); - /* Load image to the TPA (Transient Program Area) */ + // Load image to the TPA (Transient Program Area) u16 quickload_size = image.length(); for (u16 i = 0; i < quickload_size; i++) { u8 data; if (image.fread(&data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - prog_space.write_byte(i+0x100, data); + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + prog_space.write_byte(i + 0x100, data); } - prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); // clear out command tail + // clear out command tail + prog_space.write_byte(0x80, 0); + prog_space.write_byte(0x81, 0); - m_maincpu->set_pc(0x100); // start program - m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 300); // put the stack a bit before BDOS + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); // put the stack a bit before BDOS + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } diff --git a/src/mame/konami/crimfght.cpp b/src/mame/konami/crimfght.cpp index 27f7c620d0c87..c8bbe188a9057 100644 --- a/src/mame/konami/crimfght.cpp +++ b/src/mame/konami/crimfght.cpp @@ -47,7 +47,7 @@ class crimfght_state : public driver_device m_rombank(*this, "rombank") { } - DECLARE_CUSTOM_INPUT_MEMBER(system_r); + ioport_value system_r(); void crimfght(machine_config &config); private: @@ -414,7 +414,7 @@ void crimfght_state::banking_callback(uint8_t data) m_init = BIT(data, 7); } -CUSTOM_INPUT_MEMBER( crimfght_state::system_r ) +ioport_value crimfght_state::system_r() { uint8_t data = 0; diff --git a/src/mame/konami/k001006.cpp b/src/mame/konami/k001006.cpp index f64d82083aa28..2d372354958ed 100644 --- a/src/mame/konami/k001006.cpp +++ b/src/mame/konami/k001006.cpp @@ -38,9 +38,9 @@ void k001006_device::device_start() preprocess_texture_data(m_texrom.get(), m_gfxrom, 0x800000); - save_pointer(NAME(m_pal_ram), 0x800*sizeof(uint16_t)); - save_pointer(NAME(m_unknown_ram), 0x1000*sizeof(uint16_t)); - save_pointer(NAME(m_palette), 0x800*sizeof(uint32_t)); + save_pointer(NAME(m_pal_ram), 0x800); + save_pointer(NAME(m_unknown_ram), 0x1000); + save_pointer(NAME(m_palette), 0x800); save_item(NAME(m_device_sel)); save_item(NAME(m_addr)); } diff --git a/src/mame/konami/k052109.cpp b/src/mame/konami/k052109.cpp index e4bffba9251ff..e45e9e264d934 100644 --- a/src/mame/konami/k052109.cpp +++ b/src/mame/konami/k052109.cpp @@ -73,16 +73,16 @@ address lines), and then reading it from the 051962. 180c-1833: A y scroll 1a00-1bff: A x scroll 1c00 : Maps the three 8kB RAM chips to memory addresses. - ------xx select the configuration from this table - RAM0 RAM1 RAM2 - 00 A~B 6~7 8~9 Reset state - 01 8~9 4~5 6~7 - 10 6~7 2~3 4~5 - 11 4~5 0~1 2~3 TMNT setting - ---xxx-- affects how RAMs are accessed - -x------ - 0 = replace bits 5:4 of color attribute by bits 1:0 - 1 = do not alter color attribute (gradius3,xmen) + ------xx select the configuration from this table + RAM0 RAM1 RAM2 + 00 A~B 6~7 8~9 Reset state + 01 8~9 4~5 6~7 + 10 6~7 2~3 4~5 + 11 4~5 0~1 2~3 TMNT setting + ---xxx-- affects how RAMs are accessed + -x------ + 0 = replace bits 5:4 of color attribute by bits 1:0 + 1 = do not alter color attribute (gradius3,xmen) 1c80 : row/column scroll control ------xx layer A row scroll 00 = disabled @@ -516,11 +516,11 @@ void k052109_device::tilemap_update( ) #if 0 popmessage("%x %x %x %x", - m_charrombank[0], - m_charrombank[1], - m_charrombank[2], - m_charrombank[3]); - // popmessage("%x",m_addrmap); + m_charrombank[0], + m_charrombank[1], + m_charrombank[2], + m_charrombank[3]); + //popmessage("%x",m_addrmap); #endif // note: this chip can do both per-column and per-row scroll in the same time, currently not emulated. diff --git a/src/mame/konami/konamigs.cpp b/src/mame/konami/konamigs.cpp index 49ce4bafb0f99..acc77078d70ff 100644 --- a/src/mame/konami/konamigs.cpp +++ b/src/mame/konami/konamigs.cpp @@ -129,21 +129,21 @@ class gsan_state : public driver_device void fill_quad(u16 cmd, u16 *data); void draw_line(u16 cmd, u16 *data); - int m_dbmode; - bool m_fg16bit; - bool m_bg16bit; - bool m_rend16bit; - bool m_width1024; - bool m_rsae; - bool m_vbkem; - s16 m_xo; - s16 m_yo; - s16 m_uxmin; - s16 m_uxmax; - s16 m_uymin; - s16 m_uymax; - s16 m_sxmax; - s16 m_symax; + int m_dbmode = 0; + bool m_fg16bit = false; + bool m_bg16bit = false; + bool m_rend16bit = false; + bool m_width1024 = false; + bool m_rsae = false; + bool m_vbkem = false; + s16 m_xo = 0; + s16 m_yo = 0; + s16 m_uxmin = 0; + s16 m_uxmax = 0; + s16 m_uymin = 0; + s16 m_uymax = 0; + s16 m_sxmax = 0; + s16 m_symax = 0; u32 get_rend_offset() { @@ -272,7 +272,7 @@ void gsan_state::portc_w(u64 data) */ m_portc_data = data; - machine().bookkeeping().coin_counter_w(0, ~data & 8); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 3)); } void gsan_state::portc_medal_w(u64 data) { @@ -284,10 +284,10 @@ void gsan_state::portc_medal_w(u64 data) */ m_portc_data = data; - m_hopper->motor_w(data & 0x80); - machine().bookkeeping().coin_counter_w(0, data & 4); - machine().bookkeeping().coin_counter_w(1, data & 2); - machine().bookkeeping().coin_counter_w(2, data & 1); + m_hopper->motor_w(BIT(~data, 7)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); + machine().bookkeeping().coin_counter_w(2, BIT(data, 0)); } u64 gsan_state::porte_r() { @@ -315,9 +315,9 @@ void gsan_state::porte_medal_w(u64 data) */ m_porte_data = data; - machine().bookkeeping().coin_lockout_w(0, data & 4); - machine().bookkeeping().coin_lockout_w(1, data & 2); - machine().bookkeeping().coin_lockout_w(2, data & 1); + machine().bookkeeping().coin_lockout_w(0, BIT(data, 2)); + machine().bookkeeping().coin_lockout_w(1, BIT(data, 1)); + machine().bookkeeping().coin_lockout_w(2, BIT(data, 0)); } @@ -1081,7 +1081,7 @@ void gsan_state::gs_medal(machine_config &config) m_screen->set_raw(XTAL(36'000'000) / 5, 457, 0, 320, 262, 0, 240); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); } void gsan_state::init_gsan() diff --git a/src/mame/konami/konamigv.cpp b/src/mame/konami/konamigv.cpp index 0c45f80684452..0f9c0609c7ad3 100644 --- a/src/mame/konami/konamigv.cpp +++ b/src/mame/konami/konamigv.cpp @@ -342,7 +342,7 @@ class tokimeki_state : public konamigv_state uint16_t tokimeki_serial_r(); void tokimeki_serial_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - DECLARE_CUSTOM_INPUT_MEMBER(tokimeki_device_check_r); + ioport_value tokimeki_device_check_r(); void tokimeki_device_check_w(int state); private: @@ -1122,7 +1122,7 @@ void tokimeki_state::tmoshsp_init() m_printer_is_manual_layout = true; } -CUSTOM_INPUT_MEMBER(tokimeki_state::tokimeki_device_check_r) +ioport_value tokimeki_state::tokimeki_device_check_r() { return BIT(m_device_val, 15); } diff --git a/src/mame/konami/konamigx.cpp b/src/mame/konami/konamigx.cpp index 9a3f903524e26..16c73ef883960 100644 --- a/src/mame/konami/konamigx.cpp +++ b/src/mame/konami/konamigx.cpp @@ -450,7 +450,7 @@ void konamigx_state::esc_w(address_space &space, uint32_t data) /**********************************************************************************/ /* EEPROM handlers */ -CUSTOM_INPUT_MEMBER(konamigx_state::gx_rdport1_3_r) +ioport_value konamigx_state::gx_rdport1_3_r() { return (m_gx_rdport1_3 >> 1); } diff --git a/src/mame/konami/konamigx.h b/src/mame/konami/konamigx.h index c1482d111990d..889f68066b242 100644 --- a/src/mame/konami/konamigx.h +++ b/src/mame/konami/konamigx.h @@ -85,7 +85,7 @@ class konamigx_state : public driver_device void konamigx_t4_psacmap_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); void vblank_irq_ack_w(int state); void hblank_irq_ack_w(int state); - DECLARE_CUSTOM_INPUT_MEMBER(gx_rdport1_3_r); + ioport_value gx_rdport1_3_r(); void init_konamigx(); TILE_GET_INFO_MEMBER(get_gx_psac_tile_info); TILE_GET_INFO_MEMBER(get_gx_psac3_tile_info); diff --git a/src/mame/konami/konmedal.cpp b/src/mame/konami/konmedal.cpp index df505156dfcf6..1f2b2a84d1118 100644 --- a/src/mame/konami/konmedal.cpp +++ b/src/mame/konami/konmedal.cpp @@ -832,7 +832,7 @@ void konmedal_state::tsukande(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); @@ -875,7 +875,7 @@ void konmedal_state::ddboy(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); @@ -1019,7 +1019,7 @@ void konmedal_state::shuriboy(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::shuriboy_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // everything not verified, just a placeholder diff --git a/src/mame/konami/konmedal68k.cpp b/src/mame/konami/konmedal68k.cpp index 217fe15ba5da2..86a307a6d2af7 100644 --- a/src/mame/konami/konmedal68k.cpp +++ b/src/mame/konami/konmedal68k.cpp @@ -21,16 +21,18 @@ ***************************************************************************/ #include "emu.h" +#include "k054156_k054157_k056832.h" +#include "k055555.h" +#include "konami_helper.h" + #include "cpu/m68000/m68000.h" #include "machine/eepromser.h" #include "machine/gen_latch.h" #include "machine/nvram.h" -#include "machine/timer.h" #include "machine/ticket.h" +#include "machine/timer.h" #include "sound/ymz280b.h" -#include "k054156_k054157_k056832.h" -#include "k055555.h" -#include "konami_helper.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -640,7 +642,7 @@ void konmedal68k_state::kzaurus(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &konmedal68k_state::kzaurus_main); TIMER(config, "scantimer").configure_scanline(FUNC(konmedal68k_state::scanline), "screen", 0, 1); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/konami/ksys573.cpp b/src/mame/konami/ksys573.cpp index 04835287a4c19..6bc5191b8e16e 100644 --- a/src/mame/konami/ksys573.cpp +++ b/src/mame/konami/ksys573.cpp @@ -767,7 +767,7 @@ class ddr_state : public ksys573_state void dsem(machine_config &config); void dsem2(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER( gn845pwbb_read ); + ioport_value gn845pwbb_read(); void init_ddr(); @@ -1425,7 +1425,7 @@ void ddr_state::gn845pwbb_clk_w( int offset, int data ) m_stage_state[ offset ].state, m_stage_state[ offset ].DO, m_stage_state[ offset ].shift, m_stage_state[ offset ].bit, m_stage_mask ); } -CUSTOM_INPUT_MEMBER( ddr_state::gn845pwbb_read ) +ioport_value ddr_state::gn845pwbb_read() { return m_stage->read() & m_stage_mask; } diff --git a/src/mame/konami/piratesh.cpp b/src/mame/konami/piratesh.cpp index 8eb9c253f2572..c9661e8e197d7 100644 --- a/src/mame/konami/piratesh.cpp +++ b/src/mame/konami/piratesh.cpp @@ -70,8 +70,8 @@ class piratesh_state : public driver_device void piratesh(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(helm_r); - DECLARE_CUSTOM_INPUT_MEMBER(battery_r); + ioport_value helm_r(); + ioport_value battery_r(); protected: virtual void machine_start() override; @@ -443,7 +443,7 @@ void piratesh_state::k054539_nmi_gen(int state) m_sound_intck = state; } -CUSTOM_INPUT_MEMBER(piratesh_state::helm_r) +ioport_value piratesh_state::helm_r() { // Appears to be a quadrature encoder uint8_t xa, xb; @@ -455,7 +455,7 @@ CUSTOM_INPUT_MEMBER(piratesh_state::helm_r) return (xb << 1) | xa; } -CUSTOM_INPUT_MEMBER(piratesh_state::battery_r) +ioport_value piratesh_state::battery_r() { // .x MB3790 /ALARM1 // x. MB3790 /ALARM2 @@ -610,8 +610,8 @@ void piratesh_state::piratesh(machine_config &config) K053252(config, m_k053252, XTAL(32'000'000)/4); m_k053252->set_offsets(40, 16); // TODO - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, "hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); + HOPPER(config, "hopper", attotime::from_msec(200)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/konami/qdrmfgp.cpp b/src/mame/konami/qdrmfgp.cpp index 0acc8c9d4b1e2..300b3f3fb564d 100644 --- a/src/mame/konami/qdrmfgp.cpp +++ b/src/mame/konami/qdrmfgp.cpp @@ -58,7 +58,7 @@ class qdrmfgp_state : public driver_device void qdrmfgp(machine_config &config); void qdrmfgp2(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(battery_sensor_r); + ioport_value battery_sensor_r(); protected: virtual void machine_reset() override; @@ -178,7 +178,7 @@ uint16_t qdrmfgp_state::inputs_r() return m_control & 0x0080 ? m_inputs_port->read() : m_dsw_port->read(); } -CUSTOM_INPUT_MEMBER(qdrmfgp_state::battery_sensor_r) +ioport_value qdrmfgp_state::battery_sensor_r() { /* bit 0-1 battery power sensor: 3=good, 2=low, other=bad */ return 0x0003; diff --git a/src/mame/konami/quickpick5.cpp b/src/mame/konami/quickpick5.cpp index 502c7548a04ad..fa2f174723bbb 100644 --- a/src/mame/konami/quickpick5.cpp +++ b/src/mame/konami/quickpick5.cpp @@ -22,16 +22,18 @@ ***************************************************************************/ #include "emu.h" -#include "cpu/z80/z80.h" -#include "machine/eepromser.h" -#include "sound/k051649.h" -#include "sound/okim6295.h" #include "k053244_k053245.h" #include "konami_helper.h" + +#include "cpu/z80/z80.h" +#include "machine/eepromser.h" #include "machine/k053252.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "machine/timer.h" +#include "sound/k051649.h" +#include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -384,7 +386,7 @@ static INPUT_PORTS_START( quickpick5 ) PORT_START("IN1") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE1) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW) PORT_BIT(0xd0, IP_ACTIVE_LOW, IPT_UNUSED) @@ -495,7 +497,7 @@ INPUT_PORTS_END // 3 4 2-3 2-4 3-4 Start static INPUT_PORTS_START( waijockey ) PORT_START("IN1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) // * B16 PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1) PORT_NAME("Medal") @@ -587,7 +589,7 @@ void quickpick5_state::quickpick5(machine_config &config) Z80(config, m_maincpu, XTAL(32'000'000)/4); // z84c0008pec 8mhz part, 32Mhz xtal verified on PCB, divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &quickpick5_state::quickpick5_main); TIMER(config, "scantimer").configure_scanline(FUNC(quickpick5_state::scanline), "screen", 0, 1); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(32'000'000)/4); /* K053252, xtal verified, divider not verified */ m_k053252->int1_ack().set(FUNC(quickpick5_state::vbl_ack_w)); diff --git a/src/mame/konami/tgtpanic.cpp b/src/mame/konami/tgtpanic.cpp index 167e9d3b47f7c..9839b49ea2cb2 100644 --- a/src/mame/konami/tgtpanic.cpp +++ b/src/mame/konami/tgtpanic.cpp @@ -1,15 +1,23 @@ // license:BSD-3-Clause // copyright-holders:Philip Bennett -/*************************************************************************** +/******************************************************************************* - Konami Target Panic (cabinet test PCB) +Konami Target Panic (cabinet test PCB) +It takes a while to boot up, just hold INS for a bit to fast forward. - driver by Phil Bennett +driver by Phil Bennett - TODO: Determine correct clock frequencies, fix 'stuck' inputs in - test mode +Hardware notes: +- PCB label: KONAMI PWB402613 +- Z84C0008PEC Z80 CPU, 4.0MHz ceramic resonator +- 32KB ROM (M27C256B), 64KB RAM (MB8464C-70L) +- simple bitmap video, no sound -***************************************************************************/ +TODO: +- Determine correct IRQ and video timing, for some reason inputs may behave + erratically in test mode with different IRQ timing + +*******************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" @@ -21,14 +29,18 @@ namespace { class tgtpanic_state : public driver_device { public: - tgtpanic_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tgtpanic_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), - m_ram(*this, "ram") { } + m_ram(*this, "ram") + { } void tgtpanic(machine_config &config); +protected: + virtual void machine_start() override; + private: required_device m_maincpu; required_device m_screen; @@ -37,21 +49,19 @@ class tgtpanic_state : public driver_device uint8_t m_color = 0; - void color_w(uint8_t data); - - virtual void machine_start() override; + void color_w(uint8_t data) { m_color = data; } uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void io_map(address_map &map); void prg_map(address_map &map); }; - void tgtpanic_state::machine_start() { save_item(NAME(m_color)); } + /************************************* * * Video hardware @@ -74,29 +84,18 @@ uint32_t tgtpanic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm uint32_t const y = (offs & 0x7f) << 1; uint32_t const x = (offs >> 7) << 2; - /* I'm guessing the hardware doubles lines */ - bitmap.pix(y + 0, x + 0) = colors[val & 3]; - bitmap.pix(y + 1, x + 0) = colors[val & 3]; - val >>= 2; - bitmap.pix(y + 0, x + 1) = colors[val & 3]; - bitmap.pix(y + 1, x + 1) = colors[val & 3]; - val >>= 2; - bitmap.pix(y + 0, x + 2) = colors[val & 3]; - bitmap.pix(y + 1, x + 2) = colors[val & 3]; - val >>= 2; - bitmap.pix(y + 0, x + 3) = colors[val & 3]; - bitmap.pix(y + 1, x + 3) = colors[val & 3]; + for (int i = 0; i < 4; i++) + { + // I'm guessing the hardware doubles lines + bitmap.pix(y + 0, x + i) = colors[val & 3]; + bitmap.pix(y + 1, x + i) = colors[val & 3]; + val >>= 2; + } } return 0; } -void tgtpanic_state::color_w(uint8_t data) -{ - m_screen->update_partial(m_screen->vpos()); - m_color = data; -} - /************************************* * @@ -107,7 +106,7 @@ void tgtpanic_state::color_w(uint8_t data) void tgtpanic_state::prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).ram().share("ram"); + map(0x8000, 0xbfff).ram().share(m_ram); } void tgtpanic_state::io_map(address_map &map) @@ -155,27 +154,29 @@ INPUT_PORTS_END void tgtpanic_state::tgtpanic(machine_config &config) { - /* basic machine hardware */ - Z80(config,m_maincpu, XTAL(4'000'000)); + // basic machine hardware + Z80(config,m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &tgtpanic_state::prg_map); m_maincpu->set_addrmap(AS_IO, &tgtpanic_state::io_map); - m_maincpu->set_periodic_int(FUNC(tgtpanic_state::irq0_line_hold), attotime::from_hz(20)); /* Unverified */ - /* video hardware */ + const attotime irq_period = attotime::from_hz(300); // Unverified + m_maincpu->set_periodic_int(FUNC(tgtpanic_state::irq0_line_hold), irq_period); + + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); /* Unverified */ - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* Unverified */ + m_screen->set_refresh_hz(60); // Unverified + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // Unverified m_screen->set_size(256, 256); m_screen->set_visarea(0, 192 - 1, 0, 192 - 1); m_screen->set_screen_update(FUNC(tgtpanic_state::screen_update)); } - /************************************* - * - * ROM definition - * - *************************************/ +/************************************* +* +* ROM definition +* +*************************************/ ROM_START( tgtpanic ) ROM_REGION( 0x10000, "maincpu", 0 ) diff --git a/src/mame/konami/viper.cpp b/src/mame/konami/viper.cpp index e4c9771e86aec..727a203bff886 100644 --- a/src/mame/konami/viper.cpp +++ b/src/mame/konami/viper.cpp @@ -82,9 +82,9 @@ ds2430. - Voodoo 3 has issues with LOD minimums, cfr. mocapglf where card check don't display a bar near the percentage; - - convert i2c to be a real i2c-complaint device; + - convert i2c to be a real i2c-compliant device; - hookup adc0838, reads from i2c; - - convert epic to be a device, make it input_merger/irq_callback complaint; + - convert epic to be a device, make it input_merger/irq_callback compliant; - (more intermediate steps for proper PCI conversions here) - jpark3: attract mode demo play acts weird, the dinosaur gets submerged and camera doesn't really know what to do, CPU core bug? diff --git a/src/mame/kontron/kdt6.cpp b/src/mame/kontron/kdt6.cpp index 8b738cae4a5b8..675a36f7e25c5 100644 --- a/src/mame/kontron/kdt6.cpp +++ b/src/mame/kontron/kdt6.cpp @@ -589,7 +589,7 @@ void kdt6_state::machine_start() save_item(NAME(m_status0)); save_item(NAME(m_status1)); save_item(NAME(m_status2)); - save_pointer(NAME(m_mapper), 16); + save_item(NAME(m_mapper)); save_item(NAME(m_video_address)); } diff --git a/src/mame/layout/crzybugs.lay b/src/mame/layout/crzybugs.lay new file mode 100644 index 0000000000000..0b689db8c543b --- /dev/null +++ b/src/mame/layout/crzybugs.lay @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cxg_enterprise.lay b/src/mame/layout/cxg_enterprise.lay index 460f4a4b1ab83..2706df047be47 100644 --- a/src/mame/layout/cxg_enterprise.lay +++ b/src/mame/layout/cxg_enterprise.lay @@ -437,7 +437,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_granada.lay b/src/mame/layout/cxg_granada.lay new file mode 100644 index 0000000000000..45b67c64d1131 --- /dev/null +++ b/src/mame/layout/cxg_granada.lay @@ -0,0 +1,458 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cxg_professor.lay b/src/mame/layout/cxg_professor.lay index 6af59fa5de03b..5762ea4dadb86 100644 --- a/src/mame/layout/cxg_professor.lay +++ b/src/mame/layout/cxg_professor.lay @@ -420,7 +420,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_royal.lay b/src/mame/layout/cxg_royal.lay new file mode 100644 index 0000000000000..3c84bbe556aad --- /dev/null +++ b/src/mame/layout/cxg_royal.lay @@ -0,0 +1,510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cxg_scptchess.lay b/src/mame/layout/cxg_scptchess.lay index d93d571e433c7..56b2ffaa52b75 100644 --- a/src/mame/layout/cxg_scptchess.lay +++ b/src/mame/layout/cxg_scptchess.lay @@ -41,7 +41,7 @@ authors:hap - + @@ -333,22 +333,22 @@ authors:hap - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -363,7 +363,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_scptchessa.lay b/src/mame/layout/cxg_scptchessa.lay index 4287783e8aaa0..7107cab77bdb0 100644 --- a/src/mame/layout/cxg_scptchessa.lay +++ b/src/mame/layout/cxg_scptchessa.lay @@ -41,7 +41,7 @@ authors:hap - + @@ -333,22 +333,22 @@ authors:hap - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -363,7 +363,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_senterprise.lay b/src/mame/layout/cxg_senterprise.lay index ee4d43194c846..37dfd8ccaa1bd 100644 --- a/src/mame/layout/cxg_senterprise.lay +++ b/src/mame/layout/cxg_senterprise.lay @@ -462,7 +462,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_senterprisec.lay b/src/mame/layout/cxg_senterprisec.lay index b7a21fbe19ae6..d5a3a66445e8f 100644 --- a/src/mame/layout/cxg_senterprisec.lay +++ b/src/mame/layout/cxg_senterprisec.lay @@ -508,7 +508,7 @@ authors:hap - + diff --git a/src/mame/layout/cxg_supra.lay b/src/mame/layout/cxg_supra.lay new file mode 100644 index 0000000000000..b01178422d76a --- /dev/null +++ b/src/mame/layout/cxg_supra.lay @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_intchess.lay b/src/mame/layout/intchess.lay similarity index 100% rename from src/mame/layout/saitek_intchess.lay rename to src/mame/layout/intchess.lay diff --git a/src/mame/layout/jking02.lay b/src/mame/layout/jking02.lay new file mode 100644 index 0000000000000..276fa22abd5d7 --- /dev/null +++ b/src/mame/layout/jking02.lay @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/kn5000.lay b/src/mame/layout/kn5000.lay index baa7e436f5004..4f9de1e8d10d7 100644 --- a/src/mame/layout/kn5000.lay +++ b/src/mame/layout/kn5000.lay @@ -6,15 +6,15 @@ license:CC0-1.0 - - + - ]]> - + ]]> + @@ -407,7 +407,7 @@ license:CC0-1.0 - + diff --git a/src/mame/layout/marywu.lay b/src/mame/layout/marywu.lay index c729e26d2a9c4..bff0eadade519 100644 --- a/src/mame/layout/marywu.lay +++ b/src/mame/layout/marywu.lay @@ -11,13 +11,13 @@ license:CC0-1.0 - + - + - + diff --git a/src/mame/layout/msx_turbor.lay b/src/mame/layout/msx_turbor.lay new file mode 100644 index 0000000000000..6f66af755e649 --- /dev/null +++ b/src/mame/layout/msx_turbor.lay @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mu2000.lay b/src/mame/layout/mu2000.lay index db1876d2c039e..82c6cd5f8ec97 100644 --- a/src/mame/layout/mu2000.lay +++ b/src/mame/layout/mu2000.lay @@ -1,7 +1,7 @@ @@ -22,6 +22,30 @@ authors:hap + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,28 +55,271 @@ authors:hap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - - - - - + + - - - - + + + + + + + + + diff --git a/src/mame/layout/novag_diablo68k.lay b/src/mame/layout/novag_diablo68.lay similarity index 100% rename from src/mame/layout/novag_diablo68k.lay rename to src/mame/layout/novag_diablo68.lay diff --git a/src/mame/layout/novag_scorpio68k.lay b/src/mame/layout/novag_scorpio68.lay similarity index 97% rename from src/mame/layout/novag_scorpio68k.lay rename to src/mame/layout/novag_scorpio68.lay index 67e75428e5681..a5692b2876e40 100644 --- a/src/mame/layout/novag_scorpio68k.lay +++ b/src/mame/layout/novag_scorpio68.lay @@ -504,23 +504,23 @@ authors:hap - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/oceanpar.lay b/src/mame/layout/oceanpar.lay new file mode 100644 index 0000000000000..4a3a23b781afb --- /dev/null +++ b/src/mame/layout/oceanpar.lay @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_companion3.lay b/src/mame/layout/saitek_companion3.lay index dae0f4d87d97e..88ecbb8e39fe0 100644 --- a/src/mame/layout/saitek_companion3.lay +++ b/src/mame/layout/saitek_companion3.lay @@ -12,23 +12,23 @@ authors:hap - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -293,7 +293,7 @@ authors:hap - + @@ -308,26 +308,26 @@ authors:hap - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_expchess.lay b/src/mame/layout/saitek_expchess.lay index b2f329a3d65d2..6ee786435a0c2 100644 --- a/src/mame/layout/saitek_expchess.lay +++ b/src/mame/layout/saitek_expchess.lay @@ -8,7 +8,6 @@ authors:hap - @@ -43,38 +42,6 @@ authors:hap - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -337,6 +304,32 @@ authors:hap + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -387,8 +380,16 @@ authors:hap + + + + + + + + - + @@ -396,18 +397,18 @@ authors:hap - - - - - - - - - - - - + + + + + + + + + + + + @@ -458,8 +459,8 @@ authors:hap - - + + diff --git a/src/mame/layout/saitek_tschess.lay b/src/mame/layout/saitek_tschess.lay new file mode 100644 index 0000000000000..8dc069c75d837 --- /dev/null +++ b/src/mame/layout/saitek_tschess.lay @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/tripfev.lay b/src/mame/layout/tripfev.lay new file mode 100644 index 0000000000000..1feaedd9f1321 --- /dev/null +++ b/src/mame/layout/tripfev.lay @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/tripslot.lay b/src/mame/layout/tripslot.lay new file mode 100644 index 0000000000000..95f5933ca1429 --- /dev/null +++ b/src/mame/layout/tripslot.lay @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/zoomer.lay b/src/mame/layout/zoomer.lay new file mode 100644 index 0000000000000..52118a8414762 --- /dev/null +++ b/src/mame/layout/zoomer.lay @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/leapfrog/leapster_explorer.cpp b/src/mame/leapfrog/leapster_explorer.cpp index d6cedf6c7236e..4f312a7a26e6d 100644 --- a/src/mame/leapfrog/leapster_explorer.cpp +++ b/src/mame/leapfrog/leapster_explorer.cpp @@ -15,7 +15,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0a2a0d4e70d51..b150b87513e0a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1399,6 +1399,56 @@ rcasino1 // (c) 1984 Dyna Electronics (D-2608208A1-1, Lar rcasinoo // (c) 1984 Dyna Electronics (D-2608208A1-1, Smaller Board) rcasino2 // (c) 1984 Dyna Electronics +@source:astrocorp/astrcorp.cpp +astoneag // (c) 2005 Astro Corp. +cptshark // (c) 2006 Astro Corp. +dinodino // (c) 2005 Astro Corp. +gostopac // (c) 2004 Astro Corp. +hacher // (c) 2005 bootleg (Gametron) +hapfarm // (c) 2008 Astro Corp. +luckycoin // (c) 2002 Astro Corp. +magibomb // (c) 2001? Astro Corp. +magibomba // (c) 2002 Astro Corp. +magibombb // (c) 2002 Astro Corp. +magibombc // (c) 2001 Astro Corp. +magibombd // (c) 2005 Astro Corp. +magibombe // (c) 2001? Astro Corp. +magibombf // (c) 2002 Astro Corp. +magibombg // (c) 2004 Astro Corp. +magibombh // (c) 2001? Astro Corp. +magibombi // (c) 2001? Astro Corp. +magibombj // (c) 2005 Astro Corp. +monkeyl // (c) 2005 Astro Corp. +monkeyla // (c) 2004 Astro Corp. +showhanc // (c) 2000 Astro Corp. +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. +wwitch // (c) 2005 Astro Corp. +zoo // (c) 2004 Astro Corp. + +@source:astrocorp/astropc.cpp +blackbd // +blackbda // +blackbdb // +dslayrr // +dslayrra // +hawaii // +hwparty // +oligam // +rasce // + +@source:astrocorp/hummer.cpp +jackvent +pengprty + @source:atari/a2600.cpp a2600 // Atari 2600 a2600p // Atari 2600 PAL @@ -15034,6 +15084,7 @@ jxzh // (c) 1996 BMC koftball // (c) 1995 BMC @source:bmc/popobear.cpp +magkengo // (c) 2005 Herb Home popobear // (c) 2000 BMC @source:bondwell/bw12.cpp @@ -16078,6 +16129,9 @@ sk10 // @source:casio/sx1000.cpp sx1010 // Casio SX1010 +@source:casio/zoomer.cpp +zoomer // 1993 Casio/Tandy + @source:cave/cavepc.cpp deathsm2 // @@ -16337,10 +16391,11 @@ multy // (c) 1987 Deta trebol // (c) 1985 Regama @source:cirsa/neptunp2.cpp -bg_barmy // -bg_ddb // -bg_max // -bg_maxa // +bg_barmy // (c) 1997 Cirsa / Unidesa / B Gaming Technology +bg_dbells // (c) 2000 Cirsa / Unidesa / B Gaming Technology +bg_ddb // (c) 1999 Cirsa / Unidesa / B Gaming Technology +bg_max // (c) 2000 Cirsa / Unidesa / B Gaming Technology +bg_maxa // (c) 2000 Cirsa / Unidesa / B Gaming Technology ccorsario // (c) 2002 Cirsa / Unidesa ccorsarioa // (c) 2002 Cirsa / Unidesa charles // (c) 2002? Cirsa / Unidesa / Europea @@ -16601,6 +16656,11 @@ sgalaxyb @source:cxg/professor.cpp scprof +@source:cxg/royal.cpp +granada +sroyal +supra + @source:cxg/senterprise.cpp senterp senterpc @@ -16970,6 +17030,7 @@ destiny // (c) 1983 dietgo // MAY (c) 1993 dietgoe // MAY (c) 1993 dietgoea // MAY (c) 1993 +dietgoeb // MAY (c) 1993 dietgoj // MAY (c) 1993 dietgou // MAY (c) 1993 @@ -16986,6 +17047,7 @@ wexpressb2 // bootleg wexpressb3 // bootleg @source:dataeast/ffantasy_ms.cpp +automatm // drgninjam // ffantasym // secretagm // @@ -17531,6 +17593,7 @@ realbrkk // "600" Billiard Academy Real Break 1998 (Korea realbrko // "600" Billiard Academy Real Break 1998 (Europe) @source:dynax/royalmah.cpp +akamj // bootleg cafebrk // "528" Mahjong Cafe Break (C) 1999 Nakanihon / Dynax cafedoll // "76" (c) 1993 Dynax cafedollg // "76" (c) 1993 Dynax @@ -17546,7 +17609,7 @@ janoh // (c) 1984 Toaplan janoha // (c) 1984 Toaplan janptr96 // "503" (c) 1996 Dynax janptrsp // "511" (c) 1997 Dynax -janputer // (c) 1982 Taito +janputer // bootleg jansou // (c) 1985 Dyna jansoua // (c) 1985 Dyna janyoup2 // Falcon bootleg @@ -17832,6 +17895,7 @@ gcpinbal // (c) 1994 Excellent System pwrflip // (c) 1994 Excellent System @source:excellent/lastbank.cpp +fever13 // (c) 1995 Excellent System lastbank // (c) 1994 Excellent System @source:excellent/witch.cpp @@ -18112,6 +18176,7 @@ fscc12a // @source:fidelity/sc6.cpp classic +classica fscc6 gambitv miniscc @@ -18445,19 +18510,22 @@ mastboyoa // (c) 1987 - No Ref on the PCB mastboyob mastboyoc +@source:gaelco/radikaldarts.cpp +radikaldrt // (c) 2011? Gaelco Darts + @source:gaelco/rollext.cpp rollext // (c) 1999 - Ref 991015 @source:gaelco/splash.cpp -funystrp // not a gaelco game but on similar hw to splash +funystrp // not a Gaelco game but on similar hw to splash paintlad // (c) 1992 - ver 1.3 -puckpepl // not a gaelco game but on similar hw to splash -rebus // not a gaelco game but on similar hw to splash -roldfrog // not a gaelco game but based on splash code -roldfroga // not a gaelco game but based on splash code +puckpepl // not a Gaelco game but on similar hw to splash +rebus // not a Gaelco game but on similar hw to splash +roldfrog // not a Gaelco game but based on splash code +roldfroga // not a Gaelco game but based on splash code splash // (c) 1992 - Ref 922804 splash10 // (c) 1992 - Ref 922804 -ringball // not a gaelco game but based on splash code +ringball // not a Gaelco game but based on splash code @source:gaelco/splash_ms.cpp splashms @@ -19905,6 +19973,9 @@ rtpc020 // IBM RT PC Model 020 rtpc025 // IBM RT PC Model 025 rtpca25 // IBM RT PC Model A25 +@source:ibm/thinkpad8xx.cpp +thinkpad850 // IBM Thinkpad 850 + @source:ice/chexx.cpp chexx83 // 1983 ICE faceoffh // 1983 SoftLogic / Entertainment Enterprises @@ -19951,6 +20022,8 @@ zoofari // (c) 2006 ICE/Play Mechanix @source:igs/cabaret.cpp cabaret // (c) 1992 AMT +double8l // (c) 1992 AMT +kungfua // (c) 1992 IGS @source:igs/dunhuang.cpp dunhuang // (c) 1995 @@ -19981,6 +20054,7 @@ cb3c // (c) 199? Dyna Electronics cb3d // (c) 199? Dyna Electronics cb3e // 199? bootleg cb3f // 199? bootleg +cb3g // (c) 199? Dyna Electronics cherry96 // bootleg chry10 // bootleg chryangl // (c) 199? Dyna Electronics @@ -20068,6 +20142,7 @@ lucky8i // 199?, Eagle, licensed by Wing lucky8j // 199?, hack lucky8k // (c) 1989 Wing. With CPU NEC D315-5136 lucky8l // (c) 1989 Wing Co. Ltd +lucky8m // (c) 1989 Wing Co. Ltd luckybar // unknown luckylad // (c) 1985 Wing Co. Ltd magodds // 198? (c) Micro Manufacturing Ltd. @@ -20180,6 +20255,7 @@ lhb2 // (c) 1996 lhbv33c // (c) 1995 nkishusp // (c) 1998 ryukobou // (c) 1995 +tygn // (c) 1996 vbowl // (c) 1996 vbowlhk // (c) 1996 vbowlj // (c) 1996 @@ -20222,8 +20298,10 @@ amazoni2 // (c) 2002 amazonia // (c) 1999 amazonkp // (c) 1999 chessc2 // (c) 200? +cjddz // (c) 200? extradrw // (c) 200? -fruitpar // (c) 200? +fruitpar // (c) 1999 +fruitpara // (c) 1999 gonefsh2 // (c) 200? jking02 // (c) 200? klxyj // (c) 200? @@ -20234,14 +20312,14 @@ lhzb4 // (c) 200? lthy // (c) 1999 luckycrs // (c) 200? mgcs3 // (c) 200? -mgfx // (c) 200? mgzz // (c) 2003 +mgzza // (c) 2003 oceanpar // oceanpara // olympic5 // (c) 2005 olympic5a // (c) 2003 +tripslot // (c) 2007 qlgs // (c) 1999 -sddz // (c) 200? sdwx // (c) 2002 slqz3 // (c) 1999 zhongguo // (c) 2000 @@ -20249,8 +20327,8 @@ zhongguo // (c) 2000 @source:igs/igs_m027_link.cpp cjslh cjsll -mgcsh -mgcsl +mgcs2h +mgcs2l @source:igs/igs_m027xa.cpp crzybugs // (c) 2009 @@ -20260,6 +20338,8 @@ crzybugsj // (c) 2007 haunthig // (c) 2008 haunthiga // (c) 2006 tripfev // (c) 2006 +tripfeva // (c) 2006 +tripfevb // (c) 2006 wldfruit // (c) 200? @source:igs/igs_m036.cpp @@ -20297,7 +20377,6 @@ igs_ncs // (c) 198? IGS igs_ncs2 // (c) 2000 IGS igstet341 // (c) 199? IGS igstet342 // (c) 199? IGS -kungfua // (c) 1992 IGS number10 // (c) IGS (Board labeled Playmark Srl) numbr10l // (c) IGS (Board labeled Playmark Srl) pktet346 // (c) 199? IGS @@ -20500,6 +20579,7 @@ kov3hd101 @source:igs/spoker.cpp 3super8 // unknown jbell // (c) 1997 IGS +jinhulu2 // (c) 1995 IGS spk100 // (c) 1996 IGS spk102ua // (c) 1996 IGS spk114it // (c) 199? IGS @@ -21810,7 +21890,8 @@ lordofkbp // bootleg makaiden // (c) 1988 (Japan) monkelf // bootleg p47 // (c) 1988 -p47b // bootleg +p47a // (c) 1988 +p47bl // bootleg p47j // (c) 1988 (Japan) p47je // (c) 1988 (Japan, Export) peekaboo // (c) 1993 @@ -25077,14 +25158,14 @@ jr100u // jr200 // jr200u // +@source:matsushita/kn5000.cpp +kn5000 // (c) 199? Technics SX-KN5000 PCM Keyboard + @source:matsushita/myb3k.cpp myb3k // jb3000 // stepone // -@source:matsushita/kn5000.cpp -kn5000 // (c) 199? Technics SX-KN5000 PCM Keyboard - @source:mattel/aquarius.cpp aquarius // 1983 Aquarius (NTSC) aquariusp // 1983 Aquarius (PAL) @@ -27416,6 +27497,7 @@ jspecter // (c) 1979 Jatre jspecter2 // (c) 1979 Jatre laser // (c) 1980 Leisure Time Electronics Inc. lrescue // LR (c) 1979 Taito +lrescueabl // Artic bootleg lrescuem // Model Racing bootleg set 1 lrescuem2 // Model Racing bootleg set 2 lupin3 // LP (c) 1980 Taito @@ -28685,6 +28767,7 @@ draw88pkr // 1988, BTE, Inc. @source:misc/amuzy.cpp amhbattl +boobood docchift mmhammer shpchamp @@ -28884,51 +28967,6 @@ as_wwc // as_wwd // as_wwe // -@source:misc/astrcorp.cpp -astoneag // (c) 2005 Astro Corp. -cptshark // (c) 2006 Astro Corp. -dinodino // (c) 2005 Astro Corp. -gostopac // (c) 2004 Astro Corp. -hacher // (c) 2005 bootleg (Gametron) -hapfarm // (c) 2008 Astro Corp. -luckycoin // (c) 2002 Astro Corp. -magibomb // (c) 2001? Astro Corp. -magibomba // (c) 2002 Astro Corp. -magibombb // (c) 2002 Astro Corp. -magibombc // (c) 2001 Astro Corp. -magibombd // (c) 2005 Astro Corp. -magibombe // (c) 2001? Astro Corp. -magibombf // (c) 2002 Astro Corp. -magibombg // (c) 2004 Astro Corp. -magibombh // (c) 2001? Astro Corp. -magibombi // (c) 2001? Astro Corp. -magibombj // (c) 2005 Astro Corp. -monkeyl // (c) 2005 Astro Corp. -monkeyla // (c) 2004 Astro Corp. -showhanc // (c) 2000 Astro Corp. -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. -wwitch // (c) 2005 Astro Corp. -zoo // (c) 2004 Astro Corp. - -@source:misc/astropc.cpp -blackbd // -blackbda // -blackbdb // -dslayrr // -dslayrra // -hawaii // -oligam // -rasce // - @source:misc/atronic.cpp 3wishrd // Three Wishes Red abigchs // Big Cheese @@ -29129,9 +29167,11 @@ castfpt // Fortune Pot castrev // Revolution @source:misc/cb2001.cpp -cb2001 // (c) 2001 Dyna Electronics +cb2001 // (c) 2000 Dyna Electronics +cb5 // (c) 1997 Dyna Electronics ndongmul2 // (c) 1999 Dyna Electronics -scherrym // (c) 2001? Dyna Electronics +scherrymp // (c) 1997 Dyna Electronics +scherrymp10u // (c) 1997 Dyna Electronics @source:misc/chameleonrx1.cpp chamrx1 // 2003 @@ -29230,6 +29270,7 @@ cowtippa // @source:misc/crazybal.cpp crazybal // EGS +crazybala // EGS @source:misc/cromptons.cpp ffruits // @@ -30559,6 +30600,7 @@ zoomaniaa @source:misc/hitpoker.cpp hitpoker // (c) 1997 +reelmtp // (c) 1999 @source:misc/hobbyplay.cpp unkhpslt // @@ -31668,9 +31710,6 @@ quizoa // (c) 1985 Seoul Coin Corp. quizpun // (c) 1989 Space Computer System of Korea quizpun2 // (c) 1989 Space Computer System of Korea -@source:misc/radikaldarts.cpp -radikaldrt // (c) 2011? Gaelco Darts - @source:misc/rawthrillspc.cpp doodlejmp // (c) 2013 ICE / Raw Thrills / Lima Sky fnf // (c) 2004 Raw Thrills @@ -32434,6 +32473,9 @@ mekd4 // 1980 Motorola Evaluation Kit @source:motorola/mekd5.cpp mekd5 // 1980 Motorola Evaluation Kit +@source:motorola/mex68kecb.cpp +mex68kecb // (c) 1981 Motorola + @source:motorola/mvme162.cpp mvme162 // (c) 1993 Motorola @@ -32729,8 +32771,6 @@ expert3t // expertac // expertdx // fsa1fx // 1988 MSX2+ Japan -fsa1gt // -fsa1st // fsa1wsx // 1989 MSX2+ Japan fsa1wx // 1988 MSX2+ Japan fsa1wxa // 1988 MSX2+ Japan @@ -32740,6 +32780,10 @@ phc35j // 1989 MSX2+ Japan phc70fd // 1988 MSX2+ Japan phc70fd2 // 1988 MSX2+ Japan +@source:msx/msxtr.cpp +fsa1gt // +fsa1st // + @source:msx/pengadvb.cpp pengadvb // (c) 1988 Screen pengadvb2 // (c) 1988 Comet @@ -34557,6 +34601,7 @@ sudopptv techni4 timetp36 timetp7 +tvmjfc vdogdeme vdogdemo vfootbal @@ -35097,6 +35142,7 @@ constjr @source:novag/diablo.cpp diablo68 diablo68a +diablo68b scorpio68 @source:novag/diamond.cpp @@ -35672,7 +35718,7 @@ pcd3nsl // Siemens-Nixdorf PCD-3Nsl pcd3nsx // Siemens-Nixdorf PCD-3Nsx php3239 // Philips P3239 ppm3333p // DTK Computer PPM-3333P -pt319a // Pint PT-319A motherboard (386sx) +pt319a // Pine PT-319A motherboard (386sx) scamp386sx // motherboards using the SCAMPSX chipset (386sx) scsxaio // Peacock 386sx Ver. 2.0 motherboard SCsxAIO (386sx) sh386sx20 // Shuttle 386SX REV 2.0A motherboard (386sx) @@ -35912,6 +35958,9 @@ calchase // (c) 1999 The Game Room eggsplc // (c) 2002 The Game Room hostinv // (c) 1998 The Game Room +@source:pc/champ2.cpp +champ2 // (c) 1993 US Games + @source:pc/compc.cpp compc10 // 1984 Commodore PC-10, PC-20 and PC-30 pc10iii // 1987 Commodore PC-10 III @@ -35939,6 +35988,9 @@ europc // 1988 Schneider Euro PC (CGA or Hercules) europc2 // 1989 Schneider Euro PC II euroxt // Schneider Euro XT +@source:pc/filetto.cpp +filetto // (c) 1990 Novamatic + @source:pc/fruitpc.cpp fruitpc // ??? @@ -36089,10 +36141,6 @@ so30h // SOYO 30H motherboard (486) so4saw2 // SOYO SY-4SAW2 motherboard (486) zito4dps // ZIDA Tomato board 4DPS (486) -@source:pc/pcxt.cpp -filetto // (c) 1990 Novamatic -tetriskr // (c) 1988? bootleg - @source:pc/poisk1.cpp poisk1 // @@ -36136,6 +36184,9 @@ t1000tx // 1987 Tandy 1000 TX @source:pc/teradrive.cpp teradrive +@source:pc/tetriskr.cpp +tetriskr // (c) 1988? bootleg + @source:pc/tosh1000.cpp tosh1000 @@ -37029,6 +37080,7 @@ sport2k // @source:pinball/micropin.cpp pentacup // pentacup2 // +pentacupt // @source:pinball/missamer.cpp missamer // (c) 1984 Sirmo @@ -38959,6 +39011,9 @@ tstar432b tatrain tatraina +@source:saitek/tschess.cpp +tschess + @source:saitek/turbo16k.cpp compan3 conquist @@ -39275,20 +39330,21 @@ ssf2mdb twinktmb @source:sega/megadriv_rad.cpp -rad_sf2 // (c)2004 Radica -rad_sf2uk // (c)2004 Radica +dgunl3227 +mdtvp1j +msi_sf2 +ra145 rad_gen1 // (c)2004 Radica rad_gen2 // (c)2004 Radica rad_md1 rad_md1uk rad_md2uk -rad_ssoc // (c)2004 Radica +rad_orun +rad_sf2 // (c)2004 Radica +rad_sf2uk // (c)2004 Radica rad_sonic rad_sonicuk -rad_orun -msi_sf2 -dgunl3227 -ra145 +rad_ssoc // (c)2004 Radica @source:sega/megadriv_sunmix.cpp sbubsm // (c) 1996 Sun Mixing @@ -39695,6 +39751,7 @@ mushi2eo // 2005.?? Mushiking The King Of Beetles II / II mushik2e // 2005.?? Mushiking The King Of Beetles II / III / III+ (Ver. 2.001) (World) mushik2k // 2006.?? Mushiking The King Of Beetles II / III / III+ (Ver. 1.000-) (Korea) mushik4e // 2007.?? Mushiking The King Of Beetles IV / V / VI (World) +mushik4t // 2007.?? Mushiking The King Of Beetles IV / V / VI (Taiwan) mvsc2 // 2000.03 Marvel Vs. Capcom 2 New Age of Heroes (Export, Korea) (Rev A) mvsc2u // 2000.03 Marvel Vs. Capcom 2 New Age of Heroes (USA) (Rev A) naomi // 1998.?? Naomi BIOS @@ -41879,6 +41936,7 @@ boo1000 @source:skeleton/boramz80.cpp pkboram tpkboram +tpkborama @source:skeleton/bpmmicro.cpp bp1200 // (c) 1991 BP Microsystems @@ -42014,6 +42072,11 @@ dsb46 // @source:skeleton/dual68.cpp dual68 // +@source:skeleton/dyna_d0404.cpp +cm2005 +cm2005a +cm2005b + @source:skeleton/e100.cpp e100 // @@ -42179,6 +42242,7 @@ kkcount @source:skeleton/koto_zevio.cpp dbzonep // +dbzscout @source:skeleton/kron.cpp kron180 // 1995 Kron Ltd, Ukraine @@ -42315,6 +42379,9 @@ p8000_16 // @source:skeleton/palestra.cpp palestra +@source:skeleton/pap2.cpp +pap2 + @source:skeleton/pcksurfer.cpp pcksurfer // (c) 2006 Datawind @@ -42462,6 +42529,9 @@ systec // @source:skeleton/systel1.cpp systel100 // +@source:skeleton/syvg.cpp +luckyvl + @source:skeleton/tavernie.cpp cpu09 // ivg09 // @@ -42563,6 +42633,9 @@ xor100 // @source:skeleton/zeebo_qualcomm_adreno130.cpp zeebo +@source:skeleton/zfirenze.cpp +zfirenze // (c) 1995 Zanussi / Necta + @source:skeleton/zms8085.cpp zephyr // @@ -42572,6 +42645,10 @@ zorba // @source:skeleton/zt8802.cpp zt8802 // (c) 19?? Olympia? +@source:skeleton/zvenezia.cpp +zunknecta // (c) 1992 Zanussi / Necta +zvenezia // (c) 1995 Zanussi / Necta + @source:slicer/slicer.cpp slicer // 1983 Slicer Computers @@ -42764,6 +42841,7 @@ nws1580 // Sony NEWS NWS-1580 @source:sony/news_r3k.cpp nws3260 // Sony NEWS NWS-3260 nws3410 // Sony NEWS NWS-3410 +nws3720 // Sony NEWS NWS-3720 @source:sony/news_r4k.cpp nws5000x // Sony NEWS NWS-5000X @@ -43082,6 +43160,9 @@ sun4_60 // sun4_65 // sun4_75 // +@source:sun/ultra45.cpp +ultra45 // + @source:suna/go2000.cpp go2000 // (c) 2000 SA @@ -45094,6 +45175,9 @@ mcg85 // mk14 // mk14vdu // +@source:trainer/ms68k.cpp +ms68k // Marion Systems MS68K + @source:trainer/thaler.cpp ct65 // 1982 Thaler CT-65 mps65 // 1984 Thaler MPS-65 @@ -45305,6 +45389,7 @@ jak_ths wrlshunt // Wireless: Hunting Video Game System @source:tvgames/generalplus_gpl16250_spi.cpp +anpanbd bkrankp prailpls @@ -45384,6 +45469,7 @@ zone3d ablkickb abltenni // comil // +ddr33v decathln decathlna doraglob // (c) 2007 VTech @@ -45604,6 +45690,8 @@ abl4play lexitvsprt my1stddr // (c) 2006 Konami shtscore +teleshi +teleship trkfldch // (c) 2007 Konami @source:tvgames/tvgame.cpp @@ -45672,6 +45760,7 @@ rad_ssxp // taikodp // taitons1 // taitons2 // +tak_daig tak_geig // tcarnavi // tomcpin // @@ -45973,6 +46062,9 @@ orionzms // @source:ussr/partner.cpp partner // +@source:ussr/pk32.cpp +pk32 // (c) 1991 Elektronika, USSR + @source:ussr/pk8000.cpp hobby // pk8002 // @@ -46576,6 +46668,7 @@ mu80 // 1994 MU-80 @source:yamaha/ymmu90.cpp mu90 // 1996 MU-90 +mu90b // 2005 MU-90B @source:yamaha/ymmu100.cpp mu100 // 1997 MU-100 diff --git a/src/mame/matsushita/kn5000.cpp b/src/mame/matsushita/kn5000.cpp index 2ed7180a0dabf..1bcd481dea7be 100644 --- a/src/mame/matsushita/kn5000.cpp +++ b/src/mame/matsushita/kn5000.cpp @@ -2,7 +2,7 @@ // copyright-holders:Felipe Sanches /****************************************************************************** - Technics SX-KN5000 music keyboard driver + Technics SX-KN5000 music keyboard driver ******************************************************************************/ @@ -18,15 +18,15 @@ class mn89304_vga_device : public svga_device { public: - // construction/destruction - mn89304_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // construction/destruction + mn89304_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual void device_reset() override; + virtual void device_reset() override; - virtual void palette_update() override; - virtual void recompute_params() override; - virtual uint16_t offset() override; + virtual void palette_update() override; + virtual void recompute_params() override; + virtual uint16_t offset() override; }; DEFINE_DEVICE_TYPE(MN89304_VGA, mn89304_vga_device, "mn89304_vga", "MN89304 VGA") @@ -35,51 +35,51 @@ DEFINE_DEVICE_TYPE(MN89304_VGA, mn89304_vga_device, "mn89304_vga", "MN89304 VGA" mn89304_vga_device::mn89304_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, MN89304_VGA, tag, owner, clock) { - // ... + // ... } void mn89304_vga_device::device_reset() { - svga_device::device_reset(); - svga.rgb8_en = 1; + svga_device::device_reset(); + svga.rgb8_en = 1; } // sets up mode 0, by default it will throw 155 Hz, assume divided by 3 void mn89304_vga_device::recompute_params() { - u8 xtal_select = (vga.miscellaneous_output & 0x0c) >> 2; - int xtal; - - switch(xtal_select & 3) - { - case 0: xtal = XTAL(25'174'800).value() / 3; break; - case 1: xtal = XTAL(28'636'363).value() / 3; break; - case 2: - default: - throw emu_fatalerror("MN89304: setup ext. clock select"); - } - - recompute_params_clock(1, xtal); + u8 xtal_select = (vga.miscellaneous_output & 0x0c) >> 2; + int xtal; + + switch(xtal_select & 3) + { + case 0: xtal = XTAL(25'174'800).value() / 3; break; + case 1: xtal = XTAL(28'636'363).value() / 3; break; + case 2: + default: + throw emu_fatalerror("MN89304: setup ext. clock select"); + } + + recompute_params_clock(1, xtal); } void mn89304_vga_device::palette_update() { - // 4bpp RAMDAC - for (int i = 0; i < 256; i++) - { - set_pen_color( - i, - pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 0]), - pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 1]), - pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 2]) - ); - } + // 4bpp RAMDAC + for (int i = 0; i < 256; i++) + { + set_pen_color( + i, + pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 0]), + pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 1]), + pal4bit(vga.dac.color[3*(i & vga.dac.mask) + 2]) + ); + } } uint16_t mn89304_vga_device::offset() { - return svga_device::offset() << 3; + return svga_device::offset() << 3; } @@ -152,7 +152,7 @@ void kn5000_state::maincpu_mem(address_map &map) map(0x300000, 0x3fffff).rom().region("custom_data", 0); // 8MBit FLASH ROM @ IC19 (CS5) map(0x400000, 0x7fffff).rom().region("rhythm_data", 0); // 32MBit ROM @ IC14 (A22=1 and CS5) map(0x800000, 0x82ffff).rom().region("subprogram", 0); // not sure yet in which chip this is stored, but I suspect it should be IC19 -// map(0xc00000, 0xdfffff).mirror(0x200000).rom().region("table_data", 0); //2 * 8MBit ROMs @ IC1, IC3 (CS2) +// map(0xc00000, 0xdfffff).mirror(0x200000).rom().region("table_data", 0); //2 * 8MBit ROMs @ IC1, IC3 (CS2) map(0xe00000, 0xffffff).mask(0x1fffff).rom().region("program", 0); //2 * 8MBit FLASH ROMs @ IC4, IC6 } @@ -554,13 +554,12 @@ void kn5000_state::cpanel_leds_w(offs_t offset, uint8_t data) break; case 0xc3: - // FIXME: bits 2 and 3 used twice m_CPL_LED[25] = BIT(data, 0); // D125 - VARIATION & MSA 1 m_CPL_LED[26] = BIT(data, 1); // D126 - VARIATION & MSA 2 m_CPL_LED[27] = BIT(data, 2); // D127 - VARIATION & MSA 3 m_CPL_LED[28] = BIT(data, 3); // D128 - VARIATION & MSA 4 - m_CPL_LED[29] = BIT(data, 2); // D129 - MUSIC STYLE ARRANGER - m_CPL_LED[30] = BIT(data, 3); // D130 - AUTO PLAY CHORD + m_CPL_LED[29] = BIT(data, 4); // D129 - MUSIC STYLE ARRANGER + m_CPL_LED[30] = BIT(data, 5); // D130 - AUTO PLAY CHORD break; case 0xc4: @@ -575,7 +574,6 @@ void kn5000_state::cpanel_leds_w(offs_t offset, uint8_t data) break; case 0xc8: - // I'm not sure yet about this one... m_CPL_LED[49] = BIT(data, 0); // D149 - OTHER PARTS/TR break; @@ -688,10 +686,10 @@ void kn5000_state::kn5000(machine_config &config) // bit 6 = (input) COM.MAC // bit 7 = (input) COM.MIDI // TODO: m_maincpu->portz_read().set([this] { - // TODO: return ioport("COM_SELECT")->read() | (m_sstat << 2); + // TODO: return ioport("COM_SELECT")->read() | (m_sstat << 2); // TODO: }); // TODO: m_maincpu->portz_write().set([this] (u8 data) { - // TODO: m_mstat = data & 3; + // TODO: m_mstat = data & 3; // TODO: }); @@ -720,10 +718,10 @@ void kn5000_state::kn5000(machine_config &config) // bit 3 (not used) // bit 4 = (input) MSTAT1 // TODO: m_subcpu->portd_read().set([this] { - // TODO: return (BIT(m_mstat, 0) << 2) | (BIT(m_mstat, 1) << 4); + // TODO: return (BIT(m_mstat, 0) << 2) | (BIT(m_mstat, 1) << 4); // TODO: }); // TODO: m_subcpu->portd_write().set([this] (u8 data) { - // TODO: m_sstat = data & 3; + // TODO: m_sstat = data & 3; // TODO: }); diff --git a/src/mame/mattel/pixtermu.cpp b/src/mame/mattel/pixtermu.cpp index 2e969ea13c9e4..39ae3ff248963 100644 --- a/src/mame/mattel/pixtermu.cpp +++ b/src/mame/mattel/pixtermu.cpp @@ -47,7 +47,6 @@ #include "bus/generic/carts.h" #include "bus/generic/slot.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "softlist_dev.h" diff --git a/src/mame/midw8080/8080bw.cpp b/src/mame/midw8080/8080bw.cpp index 52432706bd656..db6240ddbad08 100644 --- a/src/mame/midw8080/8080bw.cpp +++ b/src/mame/midw8080/8080bw.cpp @@ -237,7 +237,7 @@ MACHINE_START_MEMBER(_8080bw_state,extra_8080bw) /* */ /*******************************************************/ -CUSTOM_INPUT_MEMBER(invaders_clone_state::sicv_in2_control_r) +ioport_value invaders_clone_state::sicv_in2_control_r() { return m_player_controls[is_cabinet_cocktail() ? 1 : 0]->read() | ioport("P2GATE")->read(); } @@ -404,12 +404,12 @@ INPUT_PORTS_END /* */ /*******************************************************/ -CUSTOM_INPUT_MEMBER(invaders_clone_state::invadpt2_in1_control_r) +ioport_value invaders_clone_state::invadpt2_in1_control_r() { return m_player_controls[0]->read() | (m_player_controls[1]->read() & ~m_cabinet_type->read()); } -CUSTOM_INPUT_MEMBER(invaders_clone_state::invadpt2_in2_control_r) +ioport_value invaders_clone_state::invadpt2_in2_control_r() { return m_player_controls[1]->read() | (m_player_controls[0]->read() & ~m_cabinet_type->read()); } @@ -1504,7 +1504,7 @@ INPUT_PORTS_END /* */ /*******************************************************/ -CUSTOM_INPUT_MEMBER(rollingc_state::game_select_r) +ioport_value rollingc_state::game_select_r() { // need the joystick left/right inputs to show in two places return bitswap<2>(m_player_controls[0]->read(), 1, 2); @@ -5158,6 +5158,27 @@ ROM_START( lrescuem2 ) ROM_LOAD( "cv02-7643.1c", 0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) ROM_END +// still shows Taito copyright, but on Artic PCB +ROM_START( lrescueabl ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "2708_1.1", 0x0000, 0x0400, CRC(e3796dec) SHA1(454558672f6959b8efe7d52e26796ad8c0b0da6c) ) + ROM_LOAD( "2708_2.2", 0x0400, 0x0400, CRC(8067c036) SHA1(a9dd756c44ee80d5e6d646f1f48e9341297751cf) ) + ROM_LOAD( "2708_3.3", 0x0800, 0x0400, CRC(90179fee) SHA1(35059f7399229b8d9588d34f79073fa4d3301614) ) + ROM_LOAD( "2708_4.4", 0x0c00, 0x0400, CRC(1d197d87) SHA1(21e049f9c2a0fe1c0403d9d1a2dc695c4ee764f9) ) + ROM_LOAD( "2708_5.5", 0x1000, 0x0400, CRC(4326d338) SHA1(ac31645bdf292f28dfcfcb9d5e158e5df7a6f95d) ) + ROM_LOAD( "2708_6.6", 0x1400, 0x0400, CRC(3b272372) SHA1(39b807c810d093d7a34b102eec16f3d9baeb21f1) ) + ROM_LOAD( "2708_7.7", 0x1800, 0x0400, CRC(06fc1ecc) SHA1(b5b04b32f3bd122329d0282628db197b0c39c8cb) ) + ROM_LOAD( "2708_8.8", 0x1c00, 0x0400, CRC(b3a3f24e) SHA1(c084e7d891c76b9f6949490d48288df0da8c2af7) ) + ROM_LOAD( "2708_9.9", 0x4000, 0x0400, CRC(3398798f) SHA1(d7dd9e65a1048df8edd217f4206b19cd01f143f4) ) + ROM_LOAD( "2708_10.10", 0x4400, 0x0400, CRC(37c5bfc6) SHA1(b0aec85e6f979cdf7a3a985830c8530302804837) ) + ROM_LOAD( "2708_11.11", 0x4800, 0x0400, CRC(1b7a5644) SHA1(d26530ea11ada86f7c99b11d6faf4416a8f5a9eb) ) + ROM_LOAD( "2708_12.12", 0x4c00, 0x0400, CRC(c342b907) SHA1(327da029420c4eedabc2a0534199a008a3f341b8) ) + + ROM_REGION( 0x0800, "proms", 0 ) // not dumped for this set, but present + ROM_LOAD( "cv01-7643.2c", 0x0000, 0x0400, BAD_DUMP CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) ) + ROM_LOAD( "cv02-7643.1c", 0x0400, 0x0400, BAD_DUMP CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) +ROM_END + /* Cosmo @@ -6003,6 +6024,7 @@ GAME( 1979, grescue, lrescue, lrescue, lrescue, _8080bw_state, empty_i GAME( 1980, mlander, lrescue, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "bootleg (Leisure Time Electronics)", "Moon Lander (bootleg of Lunar Rescue)", MACHINE_SUPPORTS_SAVE ) GAME( 1979, lrescuem, lrescue, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "bootleg (Model Racing)", "Lunar Rescue (Model Racing bootleg, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1979, lrescuem2, lrescue, lrescuem2, lrescue, _8080bw_state, empty_init, ROT270, "bootleg (Model Racing)", "Lunar Rescue (Model Racing bootleg, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) +GAME( 1979, lrescueabl, lrescue, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "bootleg (Artic)", "Lunar Rescue (Artic bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1979, desterth, lrescue, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "bootleg", "Destination Earth (bootleg of Lunar Rescue)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAMEL(1980, escmars, lrescue, escmars, lrescue, _8080bw_state, empty_init, ROT270, "bootleg", "Escape from Mars (bootleg of Lunar Rescue)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_escmars ) GAMEL(1980, resclunar, lrescue, escmars, lrescue, _8080bw_state, empty_init, ROT270, "bootleg (Niemer S.A.)", "Rescate Lunar (Spanish bootleg of Lunar Rescue)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_escmars ) diff --git a/src/mame/midw8080/8080bw.h b/src/mame/midw8080/8080bw.h index 2a528f58a4325..c6668170eebcc 100644 --- a/src/mame/midw8080/8080bw.h +++ b/src/mame/midw8080/8080bw.h @@ -32,9 +32,9 @@ class invaders_clone_state : public invaders_state { public: - DECLARE_CUSTOM_INPUT_MEMBER(sicv_in2_control_r); - DECLARE_CUSTOM_INPUT_MEMBER(invadpt2_in1_control_r); - DECLARE_CUSTOM_INPUT_MEMBER(invadpt2_in2_control_r); + ioport_value sicv_in2_control_r(); + ioport_value invadpt2_in1_control_r(); + ioport_value invadpt2_in2_control_r(); protected: invaders_clone_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -404,7 +404,7 @@ class rollingc_state : public _8080bw_state // TODO: untangle the invadpt2 sound void rollingc(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(game_select_r); + ioport_value game_select_r(); protected: virtual void machine_start() override; diff --git a/src/mame/midw8080/mw8080bw.cpp b/src/mame/midw8080/mw8080bw.cpp index 74f68144431c6..9f089a2d1c8a0 100644 --- a/src/mame/midw8080/mw8080bw.cpp +++ b/src/mame/midw8080/mw8080bw.cpp @@ -414,7 +414,7 @@ void seawolf_state::periscope_lamp_w(u8 data) } -CUSTOM_INPUT_MEMBER(seawolf_state::erase_input_r) +ioport_value seawolf_state::erase_input_r() { return m_erase_sw->read() & m_erase_dip->read(); } @@ -654,13 +654,13 @@ uint8_t mw8080bw_state::tornbase_get_cabinet_type() } -CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_left_input_r) +ioport_value mw8080bw_state::tornbase_hit_left_input_r() { return ioport(TORNBASE_L_HIT_PORT_TAG)->read(); } -CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_right_input_r) +ioport_value mw8080bw_state::tornbase_hit_right_input_r() { uint32_t ret; @@ -681,7 +681,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_right_input_r) } -CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_left_input_r) +ioport_value mw8080bw_state::tornbase_pitch_left_input_r() { uint32_t ret; @@ -702,13 +702,13 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_left_input_r) } -CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_right_input_r) +ioport_value mw8080bw_state::tornbase_pitch_right_input_r() { return ioport(TORNBASE_L_PITCH_PORT_TAG)->read(); } -CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_score_input_r) +ioport_value mw8080bw_state::tornbase_score_input_r() { return ioport(TORNBASE_SCORE_SW_PORT_TAG)->read() & ioport(TORNBASE_SCORE_DIP_PORT_TAG)->read(); @@ -1303,13 +1303,13 @@ void desertgu_state::machine_start() } -CUSTOM_INPUT_MEMBER(desertgu_state::gun_input_r) +ioport_value desertgu_state::gun_input_r() { return m_gun_port[m_controller_select]->read(); } -CUSTOM_INPUT_MEMBER(desertgu_state::dip_sw_0_1_r) +ioport_value desertgu_state::dip_sw_0_1_r() { return m_dip_sw_0_1[m_controller_select]->read(); } @@ -1413,7 +1413,7 @@ void desertgu_state::desertgu(machine_config &config) #define DPLAY_CAB_TYPE_COCKTAIL (1) -CUSTOM_INPUT_MEMBER(dplay_state::dplay_pitch_left_input_r) +ioport_value dplay_state::dplay_pitch_left_input_r() { uint32_t ret; @@ -1426,7 +1426,7 @@ CUSTOM_INPUT_MEMBER(dplay_state::dplay_pitch_left_input_r) } -CUSTOM_INPUT_MEMBER(dplay_state::dplay_pitch_right_input_r) +ioport_value dplay_state::dplay_pitch_right_input_r() { return m_l_pitch->read(); } @@ -1779,7 +1779,7 @@ void clowns_state::machine_start() } -CUSTOM_INPUT_MEMBER(clowns_state::controller_r) +ioport_value clowns_state::controller_r() { return m_controllers[m_controller_select]->read(); } @@ -2572,7 +2572,7 @@ void invaders_state::machine_start() -CUSTOM_INPUT_MEMBER(invaders_state::invaders_sw6_sw7_r) +ioport_value invaders_state::invaders_sw6_sw7_r() { // upright PCB : switches visible // cocktail PCB: HI @@ -2584,7 +2584,7 @@ CUSTOM_INPUT_MEMBER(invaders_state::invaders_sw6_sw7_r) } -CUSTOM_INPUT_MEMBER(invaders_state::invaders_sw5_r) +ioport_value invaders_state::invaders_sw5_r() { // upright PCB : switch visible // cocktail PCB: HI @@ -2596,7 +2596,7 @@ CUSTOM_INPUT_MEMBER(invaders_state::invaders_sw5_r) } -CUSTOM_INPUT_MEMBER(invaders_state::invaders_in0_control_r) +ioport_value invaders_state::invaders_in0_control_r() { // upright PCB : P1 controls // cocktail PCB: HI @@ -2608,13 +2608,13 @@ CUSTOM_INPUT_MEMBER(invaders_state::invaders_in0_control_r) } -CUSTOM_INPUT_MEMBER(invaders_state::invaders_in1_control_r) +ioport_value invaders_state::invaders_in1_control_r() { return m_player_controls[0]->read(); } -CUSTOM_INPUT_MEMBER(invaders_state::invaders_in2_control_r) +ioport_value invaders_state::invaders_in2_control_r() { // upright PCB : P1 controls // cocktail PCB: P2 controls @@ -2739,7 +2739,7 @@ void invaders_state::invaders(machine_config &config) #define BLUESHRK_COIN_INPUT_PORT_TAG ("COIN") -CUSTOM_INPUT_MEMBER(mw8080bw_state::blueshrk_coin_input_r) +ioport_value mw8080bw_state::blueshrk_coin_input_r() { uint32_t ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read(); diff --git a/src/mame/midw8080/mw8080bw.h b/src/mame/midw8080/mw8080bw.h index 12f54526f16ca..0f87196d4e358 100644 --- a/src/mame/midw8080/mw8080bw.h +++ b/src/mame/midw8080/mw8080bw.h @@ -67,12 +67,12 @@ class mw8080bw_state : public driver_device DECLARE_INPUT_CHANGED_MEMBER(direct_coin_count); - DECLARE_CUSTOM_INPUT_MEMBER(tornbase_hit_left_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(tornbase_hit_right_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(tornbase_pitch_left_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(tornbase_pitch_right_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(tornbase_score_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(blueshrk_coin_input_r); + ioport_value tornbase_hit_left_input_r(); + ioport_value tornbase_hit_right_input_r(); + ioport_value tornbase_pitch_left_input_r(); + ioport_value tornbase_pitch_right_input_r(); + ioport_value tornbase_score_input_r(); + ioport_value blueshrk_coin_input_r(); IRQ_CALLBACK_MEMBER(interrupt_vector); @@ -165,7 +165,7 @@ class seawolf_state : public mw8080bw_state void seawolf(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(erase_input_r); + ioport_value erase_input_r(); protected: virtual void machine_start() override; @@ -250,8 +250,8 @@ class desertgu_state : public mw8080bw_state void desertgu(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(gun_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(dip_sw_0_1_r); + ioport_value gun_input_r(); + ioport_value dip_sw_0_1_r(); protected: virtual void machine_start() override; @@ -282,8 +282,8 @@ class dplay_state : public mw8080bw_state void dplay(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(dplay_pitch_left_input_r); - DECLARE_CUSTOM_INPUT_MEMBER(dplay_pitch_right_input_r); + ioport_value dplay_pitch_left_input_r(); + ioport_value dplay_pitch_right_input_r(); private: void io_map(address_map &map); @@ -306,7 +306,7 @@ class clowns_state : public mw8080bw_state void clowns(machine_config &config); void spacwalk(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(controller_r); + ioport_value controller_r(); protected: virtual void machine_start() override; @@ -388,11 +388,11 @@ class invaders_state : public mw8080bw_state void invaders(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(invaders_sw6_sw7_r); - DECLARE_CUSTOM_INPUT_MEMBER(invaders_sw5_r); - DECLARE_CUSTOM_INPUT_MEMBER(invaders_in0_control_r); - DECLARE_CUSTOM_INPUT_MEMBER(invaders_in1_control_r); - DECLARE_CUSTOM_INPUT_MEMBER(invaders_in2_control_r); + ioport_value invaders_sw6_sw7_r(); + ioport_value invaders_sw5_r(); + ioport_value invaders_in0_control_r(); + ioport_value invaders_in1_control_r(); + ioport_value invaders_in2_control_r(); protected: void machine_start() override; diff --git a/src/mame/midway/astrocde.cpp b/src/mame/midway/astrocde.cpp index 7c8e1ed800d7a..f7aba5be292b6 100644 --- a/src/mame/midway/astrocde.cpp +++ b/src/mame/midway/astrocde.cpp @@ -249,7 +249,7 @@ void astrocde_state::sparkle_w(int state) * *************************************/ -CUSTOM_INPUT_MEMBER(ebases_state::trackball_r) +ioport_value ebases_state::trackball_r() { return (m_trackball[m_input_select]->read() - m_trackball_last) & 0xff; } @@ -301,7 +301,7 @@ void demndrgn_state::input_select_w(int state) m_input_select = state; } -CUSTOM_INPUT_MEMBER(demndrgn_state::trackball_r) +ioport_value demndrgn_state::trackball_r() { return (m_trackball[m_input_select]->read() - m_trackball_last) & 0xff; } diff --git a/src/mame/midway/astrocde.h b/src/mame/midway/astrocde.h index a312e8ce096f6..f7068cd049c5d 100644 --- a/src/mame/midway/astrocde.h +++ b/src/mame/midway/astrocde.h @@ -215,7 +215,7 @@ class ebases_state : public astrocde_state { } void ebases(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(trackball_r); + ioport_value trackball_r(); protected: virtual void machine_start() override; @@ -240,7 +240,7 @@ class demndrgn_state : public astrocde_state { } void demndrgn(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(trackball_r); + ioport_value trackball_r(); protected: virtual void machine_start() override; diff --git a/src/mame/midway/atlantis.cpp b/src/mame/midway/atlantis.cpp index 49af22b22cc48..48f9ab84e1232 100644 --- a/src/mame/midway/atlantis.cpp +++ b/src/mame/midway/atlantis.cpp @@ -188,7 +188,7 @@ class atlantis_state : public driver_device void duart_irq_callback(int state); - DECLARE_CUSTOM_INPUT_MEMBER(port_mod_r); + ioport_value port_mod_r(); uint16_t port_ctrl_r(offs_t offset); void port_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t m_port_data = 0; diff --git a/src/mame/midway/balsente.h b/src/mame/midway/balsente.h index 2f91137dd6fcf..c2e0ceff1c088 100644 --- a/src/mame/midway/balsente.h +++ b/src/mame/midway/balsente.h @@ -68,7 +68,7 @@ class balsente_state : public driver_device void st1002(machine_config &config); void spiker(machine_config &config); void triviamb(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(nstocker_bits_r); + ioport_value nstocker_bits_r(); void init_otwalls(); void init_triviaes(); void init_triviaes2(); diff --git a/src/mame/midway/balsente_m.cpp b/src/mame/midway/balsente_m.cpp index f4cbed317fe23..ae3d2e9db87f7 100644 --- a/src/mame/midway/balsente_m.cpp +++ b/src/mame/midway/balsente_m.cpp @@ -360,7 +360,7 @@ void balsente_state::teamht_multiplex_select_w(offs_t offset, uint8_t data) * *************************************/ -CUSTOM_INPUT_MEMBER(balsente_state::nstocker_bits_r) +ioport_value balsente_state::nstocker_bits_r() { return m_nstocker_bits; } diff --git a/src/mame/midway/midvunit.cpp b/src/mame/midway/midvunit.cpp index 56f95dd161a18..b07a327aa4596 100644 --- a/src/mame/midway/midvunit.cpp +++ b/src/mame/midway/midvunit.cpp @@ -504,7 +504,7 @@ void midvunit_state::wheel_board_w(uint32_t data) } -DECLARE_CUSTOM_INPUT_MEMBER(crusnusa_state::motion_r) +ioport_value crusnusa_state::motion_r() { uint8_t const status = m_motion->read(); for (uint8_t bit = 0; bit < 8; bit++) diff --git a/src/mame/midway/midvunit.h b/src/mame/midway/midvunit.h index 843d1ff5de463..65f93ee5acd41 100644 --- a/src/mame/midway/midvunit.h +++ b/src/mame/midway/midvunit.h @@ -203,7 +203,7 @@ class crusnusa_state : public midvunit_state void init_crusnu21(); void init_crusnusa(); - DECLARE_CUSTOM_INPUT_MEMBER(motion_r); + ioport_value motion_r(); protected: void init_crusnusa_common(offs_t speedup); diff --git a/src/mame/midway/midyunit.cpp b/src/mame/midway/midyunit.cpp index 1aec0219ca2cf..f42255aa2984a 100644 --- a/src/mame/midway/midyunit.cpp +++ b/src/mame/midway/midyunit.cpp @@ -162,7 +162,7 @@ int midzunit_state::narc_talkback_strobe_r() } -CUSTOM_INPUT_MEMBER(midzunit_state::narc_talkback_data_r) +ioport_value midzunit_state::narc_talkback_data_r() { return m_narc_sound->read() & 0xff; } diff --git a/src/mame/midway/midyunit.h b/src/mame/midway/midyunit.h index 43db0d5d5d221..f8a429c04a3d3 100644 --- a/src/mame/midway/midyunit.h +++ b/src/mame/midway/midyunit.h @@ -132,7 +132,7 @@ class midzunit_state : public midyunit_base_state void init_narc(); int narc_talkback_strobe_r(); - DECLARE_CUSTOM_INPUT_MEMBER(narc_talkback_data_r); + ioport_value narc_talkback_data_r(); protected: virtual void machine_reset() override; diff --git a/src/mame/midway/midzeus.cpp b/src/mame/midway/midzeus.cpp index 8cc955d972d2c..9145de24fd171 100644 --- a/src/mame/midway/midzeus.cpp +++ b/src/mame/midway/midzeus.cpp @@ -140,7 +140,7 @@ class crusnexo_state : public midzeus2_state void crusnexo(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(keypad_r); + ioport_value keypad_r(); protected: virtual void machine_start() override @@ -186,7 +186,7 @@ class thegrid_state : public midzeus2_state void thegrid(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(custom_49way_r); + ioport_value custom_49way_r(); private: uint32_t trackball_r(offs_t offset); @@ -668,7 +668,7 @@ void midzeus_state::tms32032_control_w(offs_t offset, uint32_t data, uint32_t me * *************************************/ -CUSTOM_INPUT_MEMBER(thegrid_state::custom_49way_r) +ioport_value thegrid_state::custom_49way_r() { static const uint8_t translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 }; return (translate49[m_io_49way_y->read() >> 4] << 4) | translate49[m_io_49way_x->read() >> 4]; @@ -682,7 +682,7 @@ void crusnexo_state::keypad_select_w(offs_t offset, uint32_t data) } -CUSTOM_INPUT_MEMBER(crusnexo_state::keypad_r) +ioport_value crusnexo_state::keypad_r() { uint32_t bits = m_io_keypad->read(); uint8_t select = m_keypad_select; diff --git a/src/mame/midway/mw18w.cpp b/src/mame/midway/mw18w.cpp index ca5b0454f2095..228270f9f19df 100644 --- a/src/mame/midway/mw18w.cpp +++ b/src/mame/midway/mw18w.cpp @@ -37,7 +37,7 @@ class mw18w_state : public driver_device void mw18w(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(mw18w_sensors_r); + ioport_value mw18w_sensors_r(); private: void mw18w_sound0_w(uint8_t data); @@ -165,7 +165,7 @@ void mw18w_state::mw18w_irq0_clear_w(uint8_t data) m_maincpu->set_input_line(0, CLEAR_LINE); } -CUSTOM_INPUT_MEMBER(mw18w_state::mw18w_sensors_r) +ioport_value mw18w_state::mw18w_sensors_r() { // d7: off road // d6: in dock area diff --git a/src/mame/midway/seattle.cpp b/src/mame/midway/seattle.cpp index fb7f59dc871fa..b0f7121e8620b 100644 --- a/src/mame/midway/seattle.cpp +++ b/src/mame/midway/seattle.cpp @@ -330,9 +330,9 @@ class seattle_state : public driver_device void init_mace(); void init_blitz99(); - DECLARE_CUSTOM_INPUT_MEMBER(blitz_49way_r); - DECLARE_CUSTOM_INPUT_MEMBER(i40_r); - DECLARE_CUSTOM_INPUT_MEMBER(gearshift_r); + ioport_value blitz_49way_r(); + ioport_value i40_r(); + ioport_value gearshift_r(); protected: virtual void machine_start() override; @@ -770,7 +770,7 @@ const uint8_t seattle_state::translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x /************************************* * 2 player 49 Way Joystick on Blitz *************************************/ -CUSTOM_INPUT_MEMBER(seattle_state::blitz_49way_r) +ioport_value seattle_state::blitz_49way_r() { return (translate49[m_io_49way_y[1]->read() >> 4] << 12) | (translate49[m_io_49way_x[1]->read() >> 4] << 8) | (translate49[m_io_49way_y[0]->read() >> 4] << 4) | (translate49[m_io_49way_x[0]->read() >> 4] << 0); @@ -786,7 +786,7 @@ void seattle_state::i40_w(uint32_t data) m_i40_data = data; } -CUSTOM_INPUT_MEMBER(seattle_state::i40_r) +ioport_value seattle_state::i40_r() { if (m_io_dips->read() & 0x100) { // 8 way joysticks @@ -844,7 +844,7 @@ CUSTOM_INPUT_MEMBER(seattle_state::i40_r) * Gearshift (calspeed) * *************************************/ -DECLARE_CUSTOM_INPUT_MEMBER(seattle_state::gearshift_r) +ioport_value seattle_state::gearshift_r() { // Check for gear change and save gear selection uint32_t gear = m_io_gearshift->read(); diff --git a/src/mame/midway/vegas.cpp b/src/mame/midway/vegas.cpp index f452379f97fdd..9ce517e0fc377 100644 --- a/src/mame/midway/vegas.cpp +++ b/src/mame/midway/vegas.cpp @@ -380,11 +380,11 @@ class vegas_state : public driver_device void init_sf2049(); void init_sf2049se(); - DECLARE_CUSTOM_INPUT_MEMBER(i40_r); - DECLARE_CUSTOM_INPUT_MEMBER(gauntleg_p12_r); - DECLARE_CUSTOM_INPUT_MEMBER(gauntleg_p34_r); - DECLARE_CUSTOM_INPUT_MEMBER(keypad_r); - DECLARE_CUSTOM_INPUT_MEMBER(gearshift_r); + ioport_value i40_r(); + ioport_value gauntleg_p12_r(); + ioport_value gauntleg_p34_r(); + ioport_value keypad_r(); + ioport_value gearshift_r(); protected: virtual void machine_start() override; @@ -1062,7 +1062,7 @@ void vegas_state::i40_w(uint32_t data) m_i40_data = data; } -CUSTOM_INPUT_MEMBER(vegas_state::i40_r) +ioport_value vegas_state::i40_r() { if (m_io_dips->read() & 0x100) { // 8 way joysticks @@ -1117,7 +1117,7 @@ CUSTOM_INPUT_MEMBER(vegas_state::i40_r) /************************************* * Gauntlet Player 1 & 2 control read *************************************/ -CUSTOM_INPUT_MEMBER(vegas_state::gauntleg_p12_r) +ioport_value vegas_state::gauntleg_p12_r() { if (m_io_dips->read() & 0x2000) { // 8 way joysticks @@ -1133,7 +1133,7 @@ CUSTOM_INPUT_MEMBER(vegas_state::gauntleg_p12_r) /************************************* * Gauntlet Player 3 & 4 control read *************************************/ -CUSTOM_INPUT_MEMBER(vegas_state::gauntleg_p34_r) +ioport_value vegas_state::gauntleg_p34_r() { if (m_io_dips->read() & 0x2000) { // 8 way joysticks @@ -1182,7 +1182,7 @@ void vegas_state::wheel_board_w(uint32_t data) } } -CUSTOM_INPUT_MEMBER(vegas_state::keypad_r) +ioport_value vegas_state::keypad_r() { int row_sel; for (row_sel=0; row_sel<4; row_sel++) @@ -1204,7 +1204,7 @@ CUSTOM_INPUT_MEMBER(vegas_state::keypad_r) * Gearshift * *************************************/ -DECLARE_CUSTOM_INPUT_MEMBER(vegas_state::gearshift_r) +ioport_value vegas_state::gearshift_r() { // Check for gear change and save gear selection uint32_t gear = m_io_gearshift->read(); diff --git a/src/mame/midway/williams.cpp b/src/mame/midway/williams.cpp index 2b9a1754e85f7..f9dd551f10c60 100644 --- a/src/mame/midway/williams.cpp +++ b/src/mame/midway/williams.cpp @@ -1385,7 +1385,7 @@ INPUT_PORTS_END template -CUSTOM_INPUT_MEMBER(tshoot_state::gun_r) +ioport_value tshoot_state::gun_r() { int data = m_gun[P]->read(); return (data & 0x3f) ^ ((data & 0x3f) >> 1); @@ -1777,10 +1777,10 @@ void williams_state::lottofun(machine_config &config) williams_b1(config); // pia - m_pia[0]->writepb_handler().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7); + m_pia[0]->writepb_handler().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7).invert(); m_pia[0]->ca2_handler().set([this](int state) { machine().bookkeeping().coin_lockout_global_w(state); }); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(70), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(70)); } diff --git a/src/mame/midway/williams.h b/src/mame/midway/williams.h index fc6609eb0f3c8..80fdfda2d34cd 100644 --- a/src/mame/midway/williams.h +++ b/src/mame/midway/williams.h @@ -203,8 +203,8 @@ class conquest_state : public williams_state m_dial(*this, "DIAL") { } - DECLARE_CUSTOM_INPUT_MEMBER(dial0_r) { return m_dial->read() & 3; } - DECLARE_CUSTOM_INPUT_MEMBER(dial1_r) { return m_dial->read() >> 2 & 3; } + ioport_value dial0_r() { return m_dial->read() & 3; } + ioport_value dial1_r() { return m_dial->read() >> 2 & 3; } private: required_ioport m_dial; @@ -366,7 +366,7 @@ class tshoot_state : public williams2_state void tshoot(machine_config &config); - template DECLARE_CUSTOM_INPUT_MEMBER(gun_r); + template ioport_value gun_r(); private: virtual void machine_start() override; diff --git a/src/mame/midway/wmg.cpp b/src/mame/midway/wmg.cpp index 7fa02c999d359..43baeccf5f29c 100644 --- a/src/mame/midway/wmg.cpp +++ b/src/mame/midway/wmg.cpp @@ -97,7 +97,7 @@ class wmg_state : public williams_state void wmg(machine_config &config); - template DECLARE_CUSTOM_INPUT_MEMBER(wmg_mux_r); + template ioport_value wmg_mux_r(); protected: virtual void machine_start() override; @@ -442,7 +442,7 @@ void wmg_state::wmg_port_select_w(int state) } template -CUSTOM_INPUT_MEMBER(wmg_state::wmg_mux_r) +ioport_value wmg_state::wmg_mux_r() { if (N == 0) { diff --git a/src/mame/misc/39in1.cpp b/src/mame/misc/39in1.cpp index da0b1f90e94c0..8afb5a3f9fd0d 100644 --- a/src/mame/misc/39in1.cpp +++ b/src/mame/misc/39in1.cpp @@ -45,7 +45,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/eepromser.h" #include "machine/pxa255.h" diff --git a/src/mame/misc/3do_m.cpp b/src/mame/misc/3do_m.cpp index 1a3d63a80a317..16f50a08eead4 100644 --- a/src/mame/misc/3do_m.cpp +++ b/src/mame/misc/3do_m.cpp @@ -62,7 +62,7 @@ Expansion bus stuff: #include "emu.h" #include "3do.h" -#include "cpu/arm7/arm7core.h" +#include "cpu/arm7/arm7.h" #include "debugger.h" #include "screen.h" @@ -121,7 +121,7 @@ void _3do_state::m_request_fiq(uint32_t irq_req, uint8_t type) if((m_clio.irq0 & m_clio.irq0_enable) || (m_clio.irq1 & m_clio.irq1_enable)) { //printf("Go irq %08x & %08x %08x & %08x\n",m_clio.irq0, m_clio.irq0_enable, m_clio.irq1, m_clio.irq1_enable); - m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); } } diff --git a/src/mame/misc/amusco.cpp b/src/mame/misc/amusco.cpp index 3b29e01c5fcf6..e63b7af6beb8d 100644 --- a/src/mame/misc/amusco.cpp +++ b/src/mame/misc/amusco.cpp @@ -280,7 +280,7 @@ void amusco_state::output_b_w(uint8_t data) m_lamps[6] = BIT(data, 2); // Lamp 6 (Start/Draw) m_lamps[7] = BIT(data, 1); // Lamp 7 (Unknown) - m_pit->write_gate0(!BIT(data, 4)); + m_pit->write_gate0(BIT(~data, 4)); // logerror("Writing %02Xh to PPI output B\n", data); } @@ -300,8 +300,8 @@ void amusco_state::output_c_w(uint8_t data) if (!data) return; - machine().bookkeeping().coin_counter_w(0, !BIT(data, 1)); - m_hopper->motor_w(BIT(data, 4)); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 1)); + m_hopper->motor_w(BIT(~data, 4)); // logerror("Writing %02Xh to PPI output C\n", data); } @@ -574,7 +574,7 @@ void amusco_state::amusco(machine_config &config) i8155b.in_pc_callback().set(m_rtc, FUNC(msm5832_device::data_r)); i8155b.out_pc_callback().set(m_rtc, FUNC(msm5832_device::data_w)); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(30), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(30)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/misc/amuzy.cpp b/src/mame/misc/amuzy.cpp index 792bf90698991..37495ec2ccf3e 100644 --- a/src/mame/misc/amuzy.cpp +++ b/src/mame/misc/amuzy.cpp @@ -160,7 +160,7 @@ class amuzy_state : public driver_device void amuzy(machine_config &config); private: - required_device m_maincpu; + required_device m_maincpu; required_device m_screen; required_device m_palette; required_device m_oki; @@ -230,6 +230,8 @@ void amuzy_state::amuzy(machine_config &config) { H83007(config, m_maincpu, 20_MHz_XTAL); // 20 MHz rated part, 20 MHz oscillator module is present m_maincpu->set_addrmap(AS_PROGRAM, &amuzy_state::amuzy_map); + m_maincpu->read_port7().set_ioport("IN0"); + m_maincpu->read_portb().set_ioport("IN1"); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // screen parameters are completely made up @@ -253,67 +255,143 @@ void amuzy_state::amuzy(machine_config &config) } static INPUT_PORTS_START( amuzy ) + PORT_START("IN0") + PORT_DIPNAME( 0x01, 0x01, "IN0" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN1") + // boobood PC=1756 xor.b #h'f8, r4l (-> active high for bits 0-2, hopper related?) + PORT_DIPNAME( 0x01, 0x00, "IN1" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END ROM_START( mmhammer ) - ROM_REGION(0x80000, "maincpu", 0) + ROM_REGION(0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "s29al004d70tfi01.u1", 0x000000, 0x080000, CRC(f6aa7880) SHA1(c3dfdc5250875c365c7146b6fe6288d1605d17e5) ) - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "s29al016d70tfi01.u2", 0x000000, 0x200000, CRC(beb65917) SHA1(835a0ceef2fdfee2730d88e04a4a131575048979) ) - ROM_LOAD( "s29al016d70tfi01.u3", 0x200000, 0x200000, CRC(cedb6c55) SHA1(c2981b2547468723da6f5416a81b937b293576fc) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "s29al016d70tfi01.u3", 0x000000, 0x200000, CRC(cedb6c55) SHA1(c2981b2547468723da6f5416a81b937b293576fc) ) ROM_END ROM_START( docchift ) ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD16_WORD_SWAP( "s29al004d70tfi01.u1", 0x000000, 0x080000, CRC(b69d97f6) SHA1(8ecb6300d435200cf694f6f0d6a847d60354dbae) ) - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "s29al016d70tfi01.u2", 0x000000, 0x200000, CRC(044f004b) SHA1(c9f8797fcd5f67831311e4fea2621d7337c74fa2) ) - ROM_LOAD( "s29al016d70tfi01.u3", 0x200000, 0x200000, CRC(fb668dbd) SHA1(49514b0c886578f065e47d9c7a5453e09622ba55) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "s29al016d70tfi01.u3", 0x000000, 0x200000, CRC(fb668dbd) SHA1(49514b0c886578f065e47d9c7a5453e09622ba55) ) ROM_END ROM_START( amhbattl ) ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD16_WORD_SWAP( "s29al004d70tfi01.u1", 0x000000, 0x080000, CRC(b24f7bf4) SHA1(254e814c26a1430d6fecc68e07e7ee2cdab77f21) ) - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "s29al016d70tfi01.u2", 0x000000, 0x200000, CRC(cb1fd823) SHA1(f425a37ca425315f294366298146c3f6547a28c0) ) - ROM_LOAD( "s29al016d70tfi01.u3", 0x200000, 0x200000, CRC(f5bfb1e8) SHA1(e36be311782e4bcbd00a8bc93473f23e5c39c67a) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "s29al016d70tfi01.u3", 0x000000, 0x200000, CRC(f5bfb1e8) SHA1(e36be311782e4bcbd00a8bc93473f23e5c39c67a) ) ROM_END ROM_START( shpchamp ) // HA9022-0 ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD16_WORD_SWAP( "s29al004.u1", 0x000000, 0x080000, CRC(194dc931) SHA1(eae05e6627d09daa4b71154f665237348bf0947c) ) // 11xxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "s29al016.u2", 0x000000, 0x200000, CRC(677cf07b) SHA1(f30892aa18da14c2077e8847a295112616b06386) ) - ROM_LOAD( "s29al016.u3", 0x200000, 0x200000, CRC(d218c777) SHA1(7cb09925419864ec784f31802b10e9649eba3e58) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "s29al016.u3", 0x000000, 0x200000, CRC(d218c777) SHA1(7cb09925419864ec784f31802b10e9649eba3e58) ) ROM_END ROM_START( zenponta ) // HA9020-0 ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD16_WORD_SWAP( "29f400.u1", 0x000000, 0x080000, CRC(1debce88) SHA1(035cb45da6c44fa54756282401003c60b44174eb) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "29f016.u2", 0x000000, 0x200000, CRC(0ae3354b) SHA1(05c22650ab8c60ad09d30ca83c0d3c628f4be622) ) - ROM_LOAD( "29lv160.u3", 0x200000, 0x200000, CRC(76ed6b4a) SHA1(5b3523353771d91c0382b8c2440cae795a8207ed) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "29lv160.u3", 0x000000, 0x200000, CRC(76ed6b4a) SHA1(5b3523353771d91c0382b8c2440cae795a8207ed) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 ROM_END ROM_START( wwdash ) ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD16_WORD_SWAP( "s29al004d70tfi01.u1", 0x000000, 0x080000, CRC(b8984518) SHA1(23f8f2988a44bf0f0a14c39363f97f8e1b12cf62) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION(0x400000, "gfx", 0) + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) ROM_LOAD( "s29al016d70tfi01.u2", 0x000000, 0x200000, CRC(c02c4fed) SHA1(e3fd56621fc7ca4558f3044a1b13b6b58dd4c368) ) - ROM_LOAD( "s29al016d70tfi01.u3", 0x200000, 0x200000, CRC(cd66dc10) SHA1(76051b248882f7b5c0adfd0ae62283a16d440523) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "s29al016d70tfi01.u3", 0x000000, 0x200000, CRC(cd66dc10) SHA1(76051b248882f7b5c0adfd0ae62283a16d440523) ) +ROM_END + +ROM_START( boobood ) // ブーブードンパッチ, HA9019-0 + ROM_REGION(0x80000, "maincpu", 0) + ROM_LOAD16_WORD_SWAP( "29f400.u1", 0x000000, 0x080000, CRC(79411d05) SHA1(31727db741aa14224e60d7baa817081ba272c8cf) ) // 11xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION(0x1000000, "oki", ROMREGION_ERASEFF ) + ROM_LOAD( "29f016a.u2", 0x000000, 0x200000, CRC(edf8d7e2) SHA1(aee4d70dfd0fcb0d766365722b8712bb3a63efb4) ) + + ROM_REGION(0x200000, "gfx", 0 ) + ROM_LOAD( "29lv160.u3", 0x000000, 0x200000, CRC(684523f0) SHA1(ca96918abde4ec63f33d82cf30b121f2ac05f68d) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF ROM_END } // anonymous namespace -GAME( 2005, zenponta, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Zenigata Ponta", MACHINE_NOT_WORKING ) -GAME( 2006, amhbattl, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Acchi Muite Hoi Battle", MACHINE_NOT_WORKING ) -GAME( 2007, docchift, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Docchi Fighter", MACHINE_NOT_WORKING ) -GAME( 2007, wwdash, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Wan Wan Dash", MACHINE_NOT_WORKING ) -GAME( 2008, mmhammer, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Mogu Mogu Hammer", MACHINE_NOT_WORKING ) -GAME( 2008, shpchamp, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Shippe Champion", MACHINE_NOT_WORKING ) +GAME( 2005, boobood, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Boo Boo Donpatchi (Japan)", MACHINE_NOT_WORKING ) +GAME( 2005, zenponta, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Zenigata Ponta (Japan)", MACHINE_NOT_WORKING ) +GAME( 2006, amhbattl, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Acchi Muite Hoi Battle (Japan)", MACHINE_NOT_WORKING ) +GAME( 2007, docchift, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Docchi Fighter (Japan)", MACHINE_NOT_WORKING ) +GAME( 2007, wwdash, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Wan Wan Dash (Japan)", MACHINE_NOT_WORKING ) +GAME( 2008, mmhammer, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Mogu Mogu Hammer (Japan)", MACHINE_NOT_WORKING ) +GAME( 2008, shpchamp, 0, amuzy, amuzy, amuzy_state, empty_init, ROT0, "Amuzy Corporation", "Shippe Champion (Japan)", MACHINE_NOT_WORKING ) diff --git a/src/mame/misc/babysuprem.cpp b/src/mame/misc/babysuprem.cpp index e81e92f8c58e0..04924ffaa5107 100644 --- a/src/mame/misc/babysuprem.cpp +++ b/src/mame/misc/babysuprem.cpp @@ -183,9 +183,9 @@ void bsuprem_state::bsuprem(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper_5, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_hopper_25, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_hopper_100, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper_5, attotime::from_msec(50)); + HOPPER(config, m_hopper_25, attotime::from_msec(50)); + HOPPER(config, m_hopper_100, attotime::from_msec(50)); // Sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/belatra.cpp b/src/mame/misc/belatra.cpp index 9939959fd0e3c..a446c8857ce52 100644 --- a/src/mame/misc/belatra.cpp +++ b/src/mame/misc/belatra.cpp @@ -46,7 +46,6 @@ Viking's Fun Mill #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/acorn_vidc.h" #include "machine/arm_iomd.h" diff --git a/src/mame/misc/calomega.cpp b/src/mame/misc/calomega.cpp index 265bf736932fd..77c99dcf019ac 100644 --- a/src/mame/misc/calomega.cpp +++ b/src/mame/misc/calomega.cpp @@ -4648,7 +4648,7 @@ void calomega_state::sys903(machine_config &config) TIMER(config, "timer_0").configure_periodic(FUNC(calomega_state::timer_0), attotime::from_hz(550*2)); // (time*2) - Each timer pulse -> half period - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(50)); } @@ -4726,7 +4726,7 @@ void calomega_state::sys903kb(machine_config &config) TIMER(config, "timer_0").configure_periodic(FUNC(calomega_state::timer_0), attotime::from_hz(550*2)); // (time*2) - Each timer pulse -> half period - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(50)); } diff --git a/src/mame/misc/cb2001.cpp b/src/mame/misc/cb2001.cpp index 57307f8a7b059..be5e8ac8660be 100644 --- a/src/mame/misc/cb2001.cpp +++ b/src/mame/misc/cb2001.cpp @@ -83,7 +83,11 @@ class cb2001_state : public driver_device { } void cb2001(machine_config &config); + void cb5(machine_config &config); void ndongmul2(machine_config &config); + void scherrymp(machine_config &config); + + void init_smaller_proms(); protected: virtual void machine_start() override; @@ -116,6 +120,7 @@ class cb2001_state : public driver_device INTERRUPT_GEN_MEMBER(vblank_irq); uint8_t irq_ack_r(); void io_map(address_map &map); + void cb5_io_map(address_map &map); void program_map(address_map &map); }; @@ -449,7 +454,7 @@ void cb2001_state::vidctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) if (ACCESSING_BITS_8_15) // video control? { LOGVIDEOREGS("vidctrl_w %04x %04x\n", data, mem_mask); - m_videobank = (data & 0x0c00) >> 10; + m_videobank = (data & 0x1c00) >> 10; } else // something else m_other1 = data & 0x00ff; @@ -495,7 +500,7 @@ TILE_GET_INFO_MEMBER(cb2001_state::get_reel_tile_info) code &= 0xff; - int const reel_bank = (m_other2 & 0x0c) << 8; + int const reel_bank = (m_other2 & 0x1c) << 8; int const colour = 0; //= (out_c & 0x7) + 8; @@ -576,6 +581,23 @@ void cb2001_state::io_map(address_map &map) map(0x32, 0x33).w(FUNC(cb2001_state::vidctrl2_w)); } +void cb2001_state::cb5_io_map(address_map &map) +{ + map.unmap_value_high(); + map(0x0000, 0x0000).r(FUNC(cb2001_state::irq_ack_r)); + map(0x0000, 0x0001).w(FUNC(cb2001_state::vidctrl_w)); + map(0x0002, 0x0003).w(FUNC(cb2001_state::vidctrl2_w)); + // this one has the main PCB hw mapped in the 0xb800 - 0xbfff area + map(0xb800, 0xb803).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xb810, 0xb813).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xb820, 0xb823).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xb830, 0xb830).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0xb840, 0xb840).w("aysnd", FUNC(ay8910_device::address_w)); + // map(0xb850, 0xb850).w // TODO: probably lamps + // map(0xb860, 0xb860).w // TODO: probably lamps + // map(0xb870, 0xb870).w // TODO: leftover from the SN76489 days? +} + static INPUT_PORTS_START( cb2001 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -736,6 +758,391 @@ static INPUT_PORTS_START( cb2001 ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END +static INPUT_PORTS_START( scherrymp ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Big") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop 1 / D-UP") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All / Take") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3 / Small / Info") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start") + + 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_COIN2 ) PORT_IMPULSE(2) // Coin B + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_IMPULSE(2) // Coin D + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) // Coin C + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) // Coin A + + 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_GAMBLE_KEYOUT ) PORT_NAME("Key Out / Attendant") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats") + + PORT_START("DSW1-2") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:3") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "Reel Speed" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x0000, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( High ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0700, 0x0000, "Main Game Pay Rate" ) PORT_DIPLOCATION("DSW2:1,2,3") + PORT_DIPSETTING( 0x0700, "55%" ) + PORT_DIPSETTING( 0x0600, "60%" ) + PORT_DIPSETTING( 0x0500, "65%" ) + PORT_DIPSETTING( 0x0400, "70%" ) + PORT_DIPSETTING( 0x0300, "75%" ) + PORT_DIPSETTING( 0x0200, "80%" ) + PORT_DIPSETTING( 0x0100, "85%" ) + PORT_DIPSETTING( 0x0000, "90%" ) + PORT_DIPNAME( 0x0800, 0x0000, "Double Up Game Pay Rate" ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPSETTING( 0x0800, "80%" ) + PORT_DIPSETTING( 0x0000, "90%" ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "Maximum Bet" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x0000, "10" ) + PORT_DIPSETTING( 0x2000, "20" ) + PORT_DIPNAME( 0x4000, 0x0000, "Minimum Bet" ) PORT_DIPLOCATION("DSW2:7") // fixed at 1 in the service screen but shows 8 or 16 during attract + PORT_DIPSETTING( 0x4000, "8" ) + PORT_DIPSETTING( 0x0000, "16" ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW5") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW6") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + // test mode shows a 7th bank and it's read, but it wasn't populated on the dumped PCB. Leaving it here until the controls are done. + PORT_START("DSW7") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW7:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( cb5 ) + 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_GAMBLE_SERVICE ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW5") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + static INPUT_PORTS_START( ndongmul2 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -989,7 +1396,6 @@ GFXDECODE_END void cb2001_state::palette_init(palette_device &palette) const { uint8_t const *const proms = memregion("proms")->base(); - int const length = memregion("proms")->bytes(); for (int i = 0; i < 0x200; i++) { @@ -999,14 +1405,7 @@ void cb2001_state::palette_init(palette_device &palette) const int const r = ((dat >> 6) & 0x1f) << 3; int const g = ((dat >> 11) & 0x1f) << 3; - if (length == 0x400) // are the cb2001 PROMs dumped incorrectly? - { - if (!(i & 0x20)) palette.set_pen_color((i & 0x1f) | ((i & ~0x3f) >> 1), rgb_t(r, g, b)); - } - else - { - palette.set_pen_color(i, rgb_t(r, g, b)); - } + if (!(i & 0x20)) palette.set_pen_color((i & 0x1f) | ((i & ~0x3f) >> 1), rgb_t(r, g, b)); } } @@ -1042,13 +1441,36 @@ void cb2001_state::cb2001(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); } -void cb2001_state::ndongmul2(machine_config &config) +void cb2001_state::cb5(machine_config &config) +{ + cb2001(config); + + m_maincpu->set_addrmap(AS_IO, &cb2001_state::cb5_io_map); + m_maincpu->p0_in_cb().set_ioport("DSW5"); + + i8255_device &ppi1(I8255A(config, "ppi8255_1")); + ppi1.in_pa_callback().set_ioport("IN2"); + ppi1.in_pb_callback().set_ioport("IN3"); + ppi1.in_pc_callback().set_ioport("DSW1"); + + i8255_device &ppi2(I8255A(config, "ppi8255_2")); + ppi2.in_pa_callback().set_ioport("DSW2"); + + subdevice("aysnd")->port_b_read_callback().set_ioport("DSW3"); +} + +void cb2001_state::scherrymp(machine_config &config) { cb2001(config); m_maincpu->set_clock(24_MHz_XTAL); m_maincpu->p0_in_cb().set_ioport("DSW6"); m_maincpu->p2_in_cb().set_ioport("DSW7"); +} + +void cb2001_state::ndongmul2(machine_config &config) +{ + scherrymp(config); I80C51(config, "mcu", 12_MHz_XTAL).set_disable(); // Actually an AT89C51, currently undumped so disabled } @@ -1066,17 +1488,41 @@ ROM_START( cb2001 ) // DYNA D9702 PCB; DYNA CO1 V1.1I in bookkeeping screen ROM_LOAD( "am27s29.11b", 0x200, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) ) ROM_END -ROM_START( scherrym ) // DYNA D9702 PCB; DYNA PLUS V1.6 in bookkeeping screen +ROM_START( scherrymp ) // DYNA D9702 PCB; DYNA PLUS V1.6 in bookkeeping screen ROM_REGION16_LE( 0x040000, "boot_prg", 0 ) - ROM_LOAD16_WORD( "f11.bin", 0x000000, 0x40000, CRC(8967f58d) SHA1(eb01a16b7d108f5fbe5de8f611b4f77869aedbf1) ) + ROM_LOAD16_WORD( "supercherrymaster_v1.6d.11f", 0x000000, 0x40000, CRC(8967f58d) SHA1(eb01a16b7d108f5fbe5de8f611b4f77869aedbf1) ) - ROM_REGION( 0x080000, "gfx", ROMREGION_ERASEFF ) - // this board uses an unmarked MASK ROM at 12c, 12a is unpopulated. Size unknown. The bootleg PCB uses an mx29f1610ml, so possibly the same or compatible - ROM_LOAD( "gfx.12c", 0x000000, 0x80000, NO_DUMP ) + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD( "d9701.12c", 0x000000, 0x100000, CRC(07d711a6) SHA1(6b5a4017eb1d31dc184831f85d786331f4a8e01f) ) + // these are confirmed correct, though it's the only set using the smaller PROMs. ROM_REGION( 0x400, "proms", 0 ) - ROM_LOAD( "n82s135-1.bin", 0x000, 0x100, CRC(66ed363f) SHA1(65bd37842c441c2e712844b07c0cfe37ef16d0ef) ) - ROM_LOAD( "n82s135-2.bin", 0x200, 0x100, CRC(a19821db) SHA1(62dda90dd67dfbc0b96f161f1f2b7a46a5805eae) ) + ROM_LOAD( "82s135.9b", 0x000, 0x100, CRC(66ed363f) SHA1(65bd37842c441c2e712844b07c0cfe37ef16d0ef) ) + ROM_LOAD( "82s135.11b", 0x100, 0x100, CRC(a19821db) SHA1(62dda90dd67dfbc0b96f161f1f2b7a46a5805eae) ) +ROM_END + +ROM_START( scherrymp10u ) // DYNA D9702 PCB; DYNA PLUS V1.0U in bookkeeping screen + ROM_REGION16_LE( 0x040000, "boot_prg", 0 ) + ROM_LOAD16_WORD( "m27c2001.bin", 0x000000, 0x40000, CRC(6e797b3f) SHA1(cc333e3dc2d416f1059559ce958bfe25a3869fc8) ) + + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD( "d9701.12c", 0x000000, 0x100000, CRC(07d711a6) SHA1(6b5a4017eb1d31dc184831f85d786331f4a8e01f) ) + + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "82s147.9b", 0x000, 0x200, CRC(dcf976d2) SHA1(73a08e4587f3516d694a8060b79470cf71df3925) ) + ROM_LOAD( "82s147.11b", 0x200, 0x200, CRC(a67e7a63) SHA1(b23e0eb9af13e57bbc8602ddc7fb381ba5c8267e) ) +ROM_END + +ROM_START( cb5 ) // Wing W4 board + DYNA D9701 subboard; DYNA CB5 V1.3 in bookkeeping screen. Appears to be the missing link to igs/goldstar.cpp hw. + ROM_REGION16_LE( 0x040000, "boot_prg", 0 ) + ROM_LOAD16_WORD( "cb5-131.1g", 0x020000, 0x20000, CRC(7d47192c) SHA1(bc65f0b3223789fbcd78a7f3ba4f1c0e2a1ee4da) ) + + ROM_REGION( 0x100000, "gfx", 0 ) // not dumped for this set, but seems to work fine. Pics of another PCB show D9801 marked on the flash, so it could be different. + ROM_LOAD( "flash", 0x000000, 0x100000, BAD_DUMP CRC(07d711a6) SHA1(6b5a4017eb1d31dc184831f85d786331f4a8e01f) ) + + ROM_REGION( 0x400, "proms", 0 ) // not dumped for this set, but seem to work fine. Marked as bad dump as precaution + ROM_LOAD( "82s147.9b", 0x000, 0x200, BAD_DUMP CRC(dcf976d2) SHA1(73a08e4587f3516d694a8060b79470cf71df3925) ) + ROM_LOAD( "82s147.11b", 0x200, 0x200, BAD_DUMP CRC(a67e7a63) SHA1(b23e0eb9af13e57bbc8602ddc7fb381ba5c8267e) ) ROM_END /* New DongmulDongmul 2 (뉴 동물동물 2, New AnimalAnimal 2) runs on slightly different hardware, but with same CPU, custom and I/O. @@ -1115,7 +1561,7 @@ ROM_END |_______________________________________________________________________________| */ -ROM_START( ndongmul2 ) // 뉴 동물동물 2 (bootleg MIA 94V-0 PCB; DYNA PLUS V1.2N in bookkeeping screen) +ROM_START( ndongmul2 ) // 뉴 동물동물 2 (bootleg MIA 94V-0 PCB; DYNA PLUS V1.2N in bookkeeping screen - based on the Super Cherry Master Plus codebase) ROM_REGION16_LE( 0x080000, "boot_prg", 0 ) // CPU91A-011-9915JK001 ROM_LOAD16_WORD( "am27c020.u10", 0x000000, 0x040000, CRC(550e53e5) SHA1(a90ee66e7ae9b58005b6ed412669d86532c75156) ) @@ -1135,10 +1581,30 @@ ROM_START( ndongmul2 ) // 뉴 동물동물 2 (bootleg MIA 94V-0 PCB; DYNA PLUS V ROM_LOAD( "gal16v8d.u7", 0x000000, 0x000117, CRC(55e39258) SHA1(4546fdbd343290c2a7953b4cd0f8db5aab2fad18) ) ROM_END + +void cb2001_state::init_smaller_proms() +{ + uint8_t *proms = memregion("proms")->base(); + std::vector buffer(0x400); + memcpy(&buffer[0], proms, 0x400); + + for (int i = 0; i < 0x400; i++) + { + if (!(i & 0x20)) + proms[i] = buffer[(i & 0x1f) | ((i & 0x3c0) >> 1)]; + else + proms[i] = 0x00; + } + + m_palette->update(); +} + } // anonymous namespace -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS -GAME( 2001, cb2001, 0, cb2001, cb2001, cb2001_state, empty_init, ROT0, "Dyna", "Cherry Bonus 2001", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1999, ndongmul2, 0, ndongmul2, ndongmul2, cb2001_state, empty_init, ROT0, "Dyna", "New DongmulDongmul 2", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // goes into the weeds at various point, due to either missing MCU dump or incomplete decryption. Bad reels GFX. -GAME( 2001, scherrym, 0, cb2001, cb2001, cb2001_state, empty_init, ROT0, "Dyna", "Super Cherry Master", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // 2001 version? (we have bootlegs running on z80 hw of a 1996 version) +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS +GAME( 2000, cb2001, 0, cb2001, cb2001, cb2001_state, empty_init, ROT0, "Dyna", "Cherry Bonus 2001 (V1.1I)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1999, ndongmul2, 0, ndongmul2, ndongmul2, cb2001_state, empty_init, ROT0, "Dyna", "New DongmulDongmul 2 (V1.2N)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // goes into the weeds at various point, due to either missing MCU dump or incomplete decryption. Bad reels GFX. +GAME( 1997, scherrymp, 0, scherrymp, scherrymp, cb2001_state, init_smaller_proms, ROT0, "Dyna", "Super Cherry Master Plus (V1.6)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // 2001 version? (we have bootlegs running on z80 hw of a 1996 version) +GAME( 1997, scherrymp10u, scherrymp, scherrymp, scherrymp, cb2001_state, empty_init, ROT0, "Dyna", "Super Cherry Master Plus (V1.0U)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // +GAME( 1997, cb5, 0, cb5, cb5, cb2001_state, empty_init, ROT0, "Dyna", "Cherry Bonus V Five (V1.3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/changyu.cpp b/src/mame/misc/changyu.cpp index bfa86483213d9..7a6275f70cdd6 100644 --- a/src/mame/misc/changyu.cpp +++ b/src/mame/misc/changyu.cpp @@ -89,6 +89,8 @@ class changyu_state : public driver_device void main_map(address_map &map); void main2_map(address_map &map); + void prog2_map(address_map &map); + void ext2_map(address_map &map); virtual void machine_start() override; @@ -163,6 +165,18 @@ void changyu_state::main2_map(address_map &map) map(0x6000, 0xffff).rom().region("boot_rom", 0x6000); } +void changyu_state::prog2_map(address_map &map) +{ + + map(0x0000, 0xfff).rom().region("mcu", 0); +} + + +void changyu_state::ext2_map(address_map &map) +{ + map(0x0502, 0x0503).w("ay", FUNC(ay8910_device::data_address_w)); +} + static INPUT_PORTS_START( changyu ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -265,6 +279,8 @@ void changyu_state::changyu2(machine_config &config) I87C51(config.replace(), m_mcu, XTAL(8'000'000)); // m_mcu->set_disable(); + m_mcu->set_addrmap(AS_PROGRAM, &changyu_state::prog2_map); + m_mcu->set_addrmap(AS_IO, &changyu_state::ext2_map); YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); } diff --git a/src/mame/misc/clpoker.cpp b/src/mame/misc/clpoker.cpp index cc23208fe2699..3ed3421ad9581 100644 --- a/src/mame/misc/clpoker.cpp +++ b/src/mame/misc/clpoker.cpp @@ -138,7 +138,7 @@ static INPUT_PORTS_START( clpoker ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -268,7 +268,7 @@ void clpoker_state::clpoker(machine_config &config) ppi_inputs.in_pb_callback().set_ioport("INB"); ppi_inputs.in_pc_callback().set_ioport("INC"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); // wrong diff --git a/src/mame/misc/crazybal.cpp b/src/mame/misc/crazybal.cpp index 32929018a9d7f..dd5af32605da9 100644 --- a/src/mame/misc/crazybal.cpp +++ b/src/mame/misc/crazybal.cpp @@ -9,11 +9,17 @@ Crazy Balls by E.G.S. (Electronic Games Systems) Entirely TTL. Believed to be the first arcade game to have high score initials entry. This was achieved via a keyboard on the control panel: http://www.citylan.it/wiki/images/c/c3/1698_control_panel_%2B_ingame.jpg +crazybal: main PCB is marked: "EGS 113 [S]" on component side sub PCB is marked: "EGS 114 [S]" on component side 27.025 OSC on main PCB -A PCB set is available for tracing. +crazybala: +main PCB is marked: "EGS 106" on component side +sub PCB is marked: "EGS 107" on component side + +PCB set 113 + 114 is available for tracing. +Schematics are available for PCB set 106 + 107. */ @@ -54,15 +60,12 @@ class crazybal_state : public driver_device void crazybal(machine_config &config); protected: - - // driver_device overrides virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; private: - // devices required_device m_maincpu; required_device m_video; }; @@ -95,10 +98,10 @@ void crazybal_state::video_start() void crazybal_state::crazybal(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NETLIST_CPU(config, m_maincpu, netlist::config::DEFAULT_CLOCK()).set_source(netlist_crazybal); - /* video hardware */ + // video hardware SCREEN(config, "screen", SCREEN_TYPE_RASTER); FIXFREQ(config, m_video).set_screen("screen"); m_video->set_monitor_clock(MASTER_CLOCK); @@ -109,7 +112,7 @@ void crazybal_state::crazybal(machine_config &config) } -ROM_START( crazybal ) +ROM_START( crazybal ) // EGS 113 + EGS 114 PCBs ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE00 ) ROM_REGION( 0x0600, "mainpcb_proms", ROMREGION_ERASE00 ) // all Sn74S287N @@ -124,7 +127,19 @@ ROM_START( crazybal ) ROM_LOAD( "3.12l", 0x000, 0x100, CRC(e2ca8670) SHA1(60bc4be4185c50a9afd3a28d1fb9e8f46c93764a) ) // Sn74S287N ROM_END +ROM_START( crazybala ) // EGS 106 + EGS 107 PCBs (found in a cabinet distributed by Bontempi) + ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE00 ) + + ROM_REGION( 0x0340, "mainpcb_proms", ROMREGION_ERASE00 ) + ROM_LOAD( "74s287.12c", 0x000, 0x100, CRC(1f05c2df) SHA1(189e90ca29ef043ed1d4640aed3fa472a4e26da8) ) + ROM_LOAD( "74s287.12d", 0x100, 0x100, CRC(f1d7a030) SHA1(697cf26dbfbd6207cb1dd2e098d6dba9b0bdbaf3) ) + ROM_LOAD( "74s287.13e", 0x200, 0x100, CRC(57280959) SHA1(8162d9868e8367ba4c21712dc275ce4888cfbc70) ) + ROM_LOAD( "6331.4g", 0x300, 0x020, CRC(21ee11cc) SHA1(4cdf16665015ee984a300e59c73eb2aa12c13e4e) ) + ROM_LOAD( "74s188.6h", 0x320, 0x020, CRC(7b4b2f9f) SHA1(96b4a90e3c51582434e0eca1c3701cc2183dd372) ) +ROM_END + } // anonymous namespace -GAME( 1978, crazybal, 0, crazybal, 0, crazybal_state, empty_init, ROT0, "Electronic Games Systems", "Crazy Balls", MACHINE_IS_SKELETON ) +GAME( 1978, crazybal, 0, crazybal, 0, crazybal_state, empty_init, ROT0, "Electronic Games Systems / NAT", "Crazy Balls (NAT)", MACHINE_IS_SKELETON ) +GAME( 1978, crazybala, crazybal, crazybal, 0, crazybal_state, empty_init, ROT0, "Electronic Games Systems / Bontempi", "Crazy Balls (Bontempi)", MACHINE_IS_SKELETON ) diff --git a/src/mame/misc/dcheese.cpp b/src/mame/misc/dcheese.cpp index b6855b1367ef3..8981ac991eca5 100644 --- a/src/mame/misc/dcheese.cpp +++ b/src/mame/misc/dcheese.cpp @@ -237,7 +237,7 @@ static INPUT_PORTS_START( dcheese ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -287,7 +287,7 @@ static INPUT_PORTS_START( lottof2 ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -335,7 +335,7 @@ static INPUT_PORTS_START( fredmem ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -388,7 +388,7 @@ void dcheese_state::dcheese(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom"); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/misc/dfruit.cpp b/src/mame/misc/dfruit.cpp index 5c33706500b5f..780c208db1b8f 100644 --- a/src/mame/misc/dfruit.cpp +++ b/src/mame/misc/dfruit.cpp @@ -1,24 +1,20 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese +/************************************************************************************************** -/*************************************************************************** - - Fruit Dream (c) 1993 Nippon Data Kiki / Star Fish - Gemcrush (c) 1996 Star Fish +Fruit Dream (c) 1993 Nippon Data Kiki / Star Fish +Gemcrush (c) 1996 Star Fish - driver by Angelo Salese +Uses a TC0091LVC, a variant of the one used on Taito L HW - Uses a TC0091LVC, a variant of the one used on Taito L HW +TODO: +- inputs are grossly mapped, lack of any input test doesn't help at all; +- lamps? +- service mode? +- nvram? +- dfruit: has an X on top-left corner after POST, is it supposed to be disabled somehow? - TODO: - - inputs are grossly mapped, lack of any input test doesn't help at all; - - lamps? - - service mode? - - nvram? - - dfruit: (possible bug) has an X on top-left corner after POST, - is it supposed to be disabled somehow? - -***************************************************************************/ +**************************************************************************************************/ #include "emu.h" @@ -50,8 +46,8 @@ class dfruit_state : public driver_device void output_w(uint8_t data); - TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); - void program_map(address_map &map); + TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb); + void main_map(address_map &map); void tc0091lvc_map(address_map &map); }; @@ -75,7 +71,7 @@ void dfruit_state::tc0091lvc_map(address_map &map) map(0xff08, 0xff08).rw(m_maincpu, FUNC(tc0091lvc_device::rom_bank_r), FUNC(tc0091lvc_device::rom_bank_w)); } -void dfruit_state::program_map(address_map &map) +void dfruit_state::main_map(address_map &map) { tc0091lvc_map(map); map(0xa000, 0xa003).rw("i8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); @@ -257,7 +253,7 @@ static INPUT_PORTS_START( gemcrush ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -TIMER_DEVICE_CALLBACK_MEMBER(dfruit_state::scanline_callback) +TIMER_DEVICE_CALLBACK_MEMBER(dfruit_state::scanline_cb) { int scanline = param; @@ -291,9 +287,9 @@ void dfruit_state::dfruit(machine_config &config) // basic machine hardware TC0091LVC(config, m_maincpu, MASTER_CLOCK / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &dfruit_state::program_map); + m_maincpu->set_addrmap(AS_PROGRAM, &dfruit_state::main_map); - TIMER(config, "scantimer").configure_scanline(FUNC(dfruit_state::scanline_callback), "screen", 0, 1); + TIMER(config, "scantimer").configure_scanline(FUNC(dfruit_state::scanline_cb), "screen", 0, 1); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/enigma2.cpp b/src/mame/misc/enigma2.cpp index 5e47aeacbe151..1b0368d3743c8 100644 --- a/src/mame/misc/enigma2.cpp +++ b/src/mame/misc/enigma2.cpp @@ -184,8 +184,8 @@ class enigma2_state : public driver_device void init_enigma2(); - DECLARE_CUSTOM_INPUT_MEMBER(p1_controls_r); - DECLARE_CUSTOM_INPUT_MEMBER(p2_controls_r); + ioport_value p1_controls_r(); + ioport_value p2_controls_r(); protected: virtual void machine_start() override; @@ -535,13 +535,13 @@ void enigma2_state::enigma2_flip_screen_w(uint8_t data) } -CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r) +ioport_value enigma2_state::p1_controls_r() { return ioport("P1CONTROLS")->read(); } -CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r) +ioport_value enigma2_state::p2_controls_r() { if (m_flip_screen) return ioport("P2CONTROLS")->read(); diff --git a/src/mame/misc/epos.cpp b/src/mame/misc/epos.cpp index 0b621b2d3364c..6c64a5768a1b3 100644 --- a/src/mame/misc/epos.cpp +++ b/src/mame/misc/epos.cpp @@ -124,7 +124,7 @@ class tristar8000_state : public epos_base_state void tristar8000(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(coin_r) { return m_coin_latch; } + ioport_value coin_r() { return m_coin_latch; } DECLARE_INPUT_CHANGED_MEMBER(coin_switch) { if (newval) m_coin_latch |= param; } protected: diff --git a/src/mame/misc/flower.cpp b/src/mame/misc/flower.cpp index 730aba4317b89..e0c812969cd50 100644 --- a/src/mame/misc/flower.cpp +++ b/src/mame/misc/flower.cpp @@ -86,9 +86,11 @@ CHIP # POSITION TYPE #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/74259.h" #include "machine/gen_latch.h" + #include "flower_a.h" #include "emupal.h" #include "screen.h" @@ -98,8 +100,6 @@ CHIP # POSITION TYPE namespace { -#define MASTER_CLOCK XTAL(18'432'000) - class flower_state : public driver_device { public: @@ -124,6 +124,12 @@ class flower_state : public driver_device DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); +protected: + virtual void machine_start() override; + virtual void video_start() override; + + virtual void machine_reset() override; + private: void flipscreen_w(int state); void coin_counter_w(int state); @@ -143,12 +149,6 @@ class flower_state : public driver_device void audio_map(address_map &map); void shared_map(address_map &map); - // driver_device overrides - virtual void machine_start() override; - virtual void machine_reset() override; - - virtual void video_start() override; - required_device m_mastercpu; required_device m_slavecpu; required_device m_audiocpu; @@ -505,6 +505,8 @@ void flower_state::slave_irq_ack_w(int state) void flower_state::flower(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 18.432_MHz_XTAL; + Z80(config, m_mastercpu, MASTER_CLOCK / 4); // divider unknown m_mastercpu->set_addrmap(AS_PROGRAM, &flower_state::shared_map); @@ -515,7 +517,7 @@ void flower_state::flower(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &flower_state::audio_map); m_audiocpu->set_periodic_int(FUNC(flower_state::irq0_line_hold), attotime::from_hz(90)); - config.set_perfect_quantum(m_mastercpu); + config.set_maximum_quantum(attotime::from_hz(m_mastercpu->clock() / 4)); ls259_device &outlatch(LS259(config, "outlatch")); // M74LS259P @ 11K outlatch.q_out_cb<0>().set_nop(); @@ -632,5 +634,5 @@ ROM_END } // anonymous namespace -GAME( 1986, flower, 0, flower, flower, flower_state, empty_init, ROT0, "Clarue (Komax license)", "Flower (US)", MACHINE_IMPERFECT_SOUND|MACHINE_IMPERFECT_GRAPHICS|MACHINE_NO_COCKTAIL ) -GAME( 1986, flowerj, flower, flower, flower, flower_state, empty_init, ROT0, "Clarue (Sega / Alpha Denshi Co. license)", "Flower (Japan)", MACHINE_IMPERFECT_SOUND|MACHINE_IMPERFECT_GRAPHICS|MACHINE_NO_COCKTAIL ) +GAME( 1986, flower, 0, flower, flower, flower_state, empty_init, ROT0, "Clarue (Komax license)", "Flower (US)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL ) +GAME( 1986, flowerj, flower, flower, flower, flower_state, empty_init, ROT0, "Clarue (Sega / Alpha Denshi Co. license)", "Flower (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/misc/gei.cpp b/src/mame/misc/gei.cpp index a06d3112eedf2..964851f5b5f75 100644 --- a/src/mame/misc/gei.cpp +++ b/src/mame/misc/gei.cpp @@ -1059,7 +1059,7 @@ void gei_state::getrivia(machine_config &config) m_ppi[1]->out_pb_callback().set(FUNC(gei_state::lamps_w)); m_ppi[1]->out_pc_callback().set(FUNC(gei_state::lamps2_w)); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); // sound hardware SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/misc/gi6809.cpp b/src/mame/misc/gi6809.cpp index 3d3ed95d32b7c..7fab0573163a8 100644 --- a/src/mame/misc/gi6809.cpp +++ b/src/mame/misc/gi6809.cpp @@ -635,7 +635,7 @@ void gi6809_state::gi6809_base(machine_config &config) NETLIST_LOGIC_INPUT(config, "sound_nl:bit3", "PA3.IN", 0); NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "OUTPUT").set_mult_offset(1.0, 0.0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); } diff --git a/src/mame/misc/hitpoker.cpp b/src/mame/misc/hitpoker.cpp index 84e11965d2fbf..68bffb3934735 100644 --- a/src/mame/misc/hitpoker.cpp +++ b/src/mame/misc/hitpoker.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:David Haywood, Angelo Salese +// copyright-holders: David Haywood, Angelo Salese + /****************************************************************************** Hit Poker (c) 1997 Accept LTD @@ -15,6 +16,8 @@ Many thanks to Olivier Galibert for the CPU identify effort ;-) - 24Khz monitor isn't supported, it changes the resolution to 648 x 480 and changes the register 9 (raster lines x character lines) from 7 to 0xf. - sound (I've heard something reasonable during tests, so it could be OK); +- convert to memory_view; +- convert to tilemap system. ================================================================================ @@ -44,10 +47,12 @@ Some debug tricks (let's test this CPU as more as possible): #include "emu.h" + #include "cpu/mc68hc11/mc68hc11.h" #include "machine/ds17x85.h" #include "sound/ay8910.h" #include "video/mc6845.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -62,126 +67,133 @@ class hitpoker_state : public driver_device : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_videoram(*this, "videoram", 0x3600, ENDIANNESS_BIG), + m_paletteram(*this, "paletteram", 0x1000, ENDIANNESS_BIG), + m_colorram(*this, "colorram", 0x2000, ENDIANNESS_BIG) { } void hitpoker(machine_config &config); + void reelmtp(machine_config &config); void init_hitpoker(); -private: - uint8_t m_pic_data = 0; - std::unique_ptr m_videoram; - std::unique_ptr m_paletteram; - std::unique_ptr m_colorram; - - uint8_t hitpoker_vram_r(offs_t offset); - void hitpoker_vram_w(offs_t offset, uint8_t data); - uint8_t hitpoker_cram_r(offs_t offset); - void hitpoker_cram_w(offs_t offset, uint8_t data); - uint8_t hitpoker_paletteram_r(offs_t offset); - void hitpoker_paletteram_w(offs_t offset, uint8_t data); - uint8_t hitpoker_pic_r(); - void hitpoker_pic_w(uint8_t data); +protected: + virtual void machine_start() override; virtual void video_start() override; - uint32_t screen_update_hitpoker(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +private: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + + memory_share_creator m_videoram; + memory_share_creator m_paletteram; + memory_share_creator m_colorram; + + uint8_t m_pic_data = 0; + + [[maybe_unused]] uint8_t test_r(); + uint8_t vram_r(offs_t offset); + void vram_w(offs_t offset, uint8_t data); + uint8_t cram_r(offs_t offset); + void cram_w(offs_t offset, uint8_t data); + uint8_t paletteram_r(offs_t offset); + void paletteram_w(offs_t offset, uint8_t data); + uint8_t hitpoker_pic_r(); + uint8_t reelmtp_pic_r(); + void pic_w(uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void hitpoker_map(address_map &map); + void reelmtp_map(address_map &map); }; -#define CRTC_CLOCK XTAL(3'579'545) +void hitpoker_state::machine_start() +{ + save_item(NAME(m_pic_data)); +} void hitpoker_state::video_start() { - m_videoram = make_unique_clear(0x3600); - m_paletteram = make_unique_clear(0x1000); - m_colorram = make_unique_clear(0x2000); + // TODO: convert to tilemaps } -uint32_t hitpoker_state::screen_update_hitpoker(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hitpoker_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int count = 0; - int y,x; bitmap.fill(rgb_t::black(), cliprect); - for (y=0;y<31;y++) + for (int y = 0; y < 31; y++) { - for (x=0;x<81;x++) //it's probably 80 + 1 global line attribute at the start of each line + for (int x = 0; x < 81; x++) // it's probably 80 + 1 global line attribute at the start of each line { - int tile,color,gfx_bpp; + int const tile = (((m_videoram[count] << 8)|(m_videoram[count + 1])) & 0x3fff); + int const gfx_bpp = (m_colorram[count] & 0x80) >> 7; // flag between 4 and 8 bpp + int const color = gfx_bpp ? ((m_colorram[count] & 0x70) >> 4) : (m_colorram[count] & 0xf); - tile = (((m_videoram[count]<<8)|(m_videoram[count+1])) & 0x3fff); - gfx_bpp = (m_colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp - color = gfx_bpp ? ((m_colorram[count] & 0x70)>>4) : (m_colorram[count] & 0xf); + m_gfxdecode->gfx(gfx_bpp)->opaque(bitmap, cliprect, tile, color, 0, 0, x * 8, y * 8); - m_gfxdecode->gfx(gfx_bpp)->opaque(bitmap,cliprect,tile,color,0,0,x*8,y*8); - - count+=2; + count += 2; } } return 0; } -uint8_t hitpoker_state::hitpoker_vram_r(offs_t offset) +uint8_t hitpoker_state::vram_r(offs_t offset) { uint8_t *ROM = memregion("maincpu")->base(); - if(m_pic_data & 0x10) + if (m_pic_data & 0x10) return m_videoram[offset]; else - return ROM[offset+0x8000]; + return ROM[offset + 0x8000]; } -void hitpoker_state::hitpoker_vram_w(offs_t offset, uint8_t data) +void hitpoker_state::vram_w(offs_t offset, uint8_t data) { -// uint8_t *ROM = memregion("maincpu")->base(); - -// if(m_sys_regs[0x00] & 0x10) m_videoram[offset] = data; } -uint8_t hitpoker_state::hitpoker_cram_r(offs_t offset) +uint8_t hitpoker_state::cram_r(offs_t offset) { uint8_t *ROM = memregion("maincpu")->base(); - if(m_pic_data & 0x10) + if (m_pic_data & 0x10) return m_colorram[offset]; else - return ROM[offset+0xc000]; + return ROM[offset + 0xc000]; } -void hitpoker_state::hitpoker_cram_w(offs_t offset, uint8_t data) +void hitpoker_state::cram_w(offs_t offset, uint8_t data) { m_colorram[offset] = data; } -uint8_t hitpoker_state::hitpoker_paletteram_r(offs_t offset) +uint8_t hitpoker_state::paletteram_r(offs_t offset) { uint8_t *ROM = memregion("maincpu")->base(); - if(m_pic_data & 0x10) + if (m_pic_data & 0x10) return m_paletteram[offset]; else - return ROM[offset+0xe000]; + return ROM[offset + 0xe000]; } -void hitpoker_state::hitpoker_paletteram_w(offs_t offset, uint8_t data) +void hitpoker_state::paletteram_w(offs_t offset, uint8_t data) { - int r,g,b,datax; m_paletteram[offset] = data; - offset>>=1; - datax=256*m_paletteram[offset*2]+m_paletteram[offset*2+1]; + offset >>= 1; + int const datax = 256 * m_paletteram[offset * 2] + m_paletteram[offset * 2 + 1]; - /* RGB565 */ - b = ((datax)&0xf800)>>11; - g = ((datax)&0x07e0)>>5; - r = ((datax)&0x001f)>>0; + // RGB565 + int const b = (datax & 0xf800) >> 11; + int const g = (datax & 0x07e0) >> 5; + int const r = (datax & 0x001f) >> 0; m_palette->set_pen_color(offset, pal5bit(r), pal6bit(g), pal5bit(b)); } @@ -189,9 +201,9 @@ void hitpoker_state::hitpoker_paletteram_w(offs_t offset, uint8_t data) uint8_t hitpoker_state::hitpoker_pic_r() { -// logerror("R\n"); + // logerror("%s PIC R\n", machine().describe_context()); - if(m_maincpu->pc() == 0x3143 || + if (m_maincpu->pc() == 0x3143 || m_maincpu->pc() == 0x314e || m_maincpu->pc() == 0x3164 || m_maincpu->pc() == 0x3179) @@ -200,26 +212,39 @@ uint8_t hitpoker_state::hitpoker_pic_r() return (m_pic_data & 0x7f) | (m_pic_data & 0x40 ? 0x80 : 0x00); } -void hitpoker_state::hitpoker_pic_w(uint8_t data) +uint8_t hitpoker_state::reelmtp_pic_r() // TODO: is this really a PIC or is it internal to the custom MCU? +{ + // logerror("%s PIC R\n", machine().describe_context()); + + // TODO: + + if (m_maincpu->pc() == 0x471d || + m_maincpu->pc() == 0x4728 || + m_maincpu->pc() == 0x473e || + m_maincpu->pc() == 0x4753) + return m_pic_data; + + return (m_pic_data & 0x7f) | (m_pic_data & 0x40 ? 0x80 : 0x00); +} + +void hitpoker_state::pic_w(uint8_t data) { - m_pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00; -// logerror("%02x W\n",data); + m_pic_data = data; // | (data & 0x40) ? 0x80 : 0x00; + // logerror("%02x PIC W\n", data); } -#if 0 uint8_t hitpoker_state::test_r() { return machine().rand(); } -#endif -/* overlap empty rom addresses */ +// overlap empty ROM addresses void hitpoker_state::hitpoker_map(address_map &map) { map(0x0000, 0xb5ff).rom(); map(0xbf00, 0xffff).rom(); - map(0x8000, 0xb5ff).rw(FUNC(hitpoker_state::hitpoker_vram_r), FUNC(hitpoker_state::hitpoker_vram_w)); + map(0x8000, 0xb5ff).rw(FUNC(hitpoker_state::vram_r), FUNC(hitpoker_state::vram_w)); map(0xb800, 0xbdff).ram(); map(0xbe00, 0xbe7f).rw("rtc", FUNC(ds17x85_device::read_direct), FUNC(ds17x85_device::write_direct)); map(0xbe80, 0xbe80).w("crtc", FUNC(mc6845_device::address_w)); @@ -227,8 +252,26 @@ void hitpoker_state::hitpoker_map(address_map &map) map(0xbe90, 0xbe91).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); map(0xbea0, 0xbea0).portr("VBLANK"); //probably other bits as well // map(0xbe00, 0xbeff).r(FUNC(hitpoker_state::test_r)); - map(0xc000, 0xdfff).rw(FUNC(hitpoker_state::hitpoker_cram_r), FUNC(hitpoker_state::hitpoker_cram_w)); - map(0xe000, 0xefff).rw(FUNC(hitpoker_state::hitpoker_paletteram_r), FUNC(hitpoker_state::hitpoker_paletteram_w)); + map(0xc000, 0xdfff).rw(FUNC(hitpoker_state::cram_r), FUNC(hitpoker_state::cram_w)); + map(0xe000, 0xefff).rw(FUNC(hitpoker_state::paletteram_r), FUNC(hitpoker_state::paletteram_w)); +} + +void hitpoker_state::reelmtp_map(address_map &map) +{ + map(0x0100, 0x07ff).ram(); + map(0x0800, 0xb7ff).rom(); + map(0xb900, 0xffff).rom(); + + map(0x8000, 0xb5ff).rw(FUNC(hitpoker_state::vram_r), FUNC(hitpoker_state::vram_w)); + map(0xb800, 0xb87f).rw("rtc", FUNC(ds17x85_device::read_direct), FUNC(ds17x85_device::write_direct)); + map(0xb880, 0xb880).w("crtc", FUNC(mc6845_device::address_w)); + map(0xb881, 0xb881).w("crtc", FUNC(mc6845_device::register_w)); + map(0xb890, 0xb891).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); + map(0xb8a0, 0xb8a0).portr("VBLANK"); + //map(0xb8c1, 0xb8c1).w // TODO + //map(0xb8e1, 0xb8e1).w // TODO + map(0xc000, 0xdfff).rw(FUNC(hitpoker_state::cram_r), FUNC(hitpoker_state::cram_w)); + //map(0xe000, 0xefff).rw(FUNC(hitpoker_state::paletteram_r), FUNC(hitpoker_state::paletteram_w)); } static INPUT_PORTS_START( hitpoker ) @@ -236,22 +279,22 @@ static INPUT_PORTS_START( hitpoker ) PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) //resets the game? + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) // resets the game? PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) //"permanent ram initialized" if combined with the reset switch + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) // "permanent ram initialized" if combined with the reset switch PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "H-Blank" ) //scanline counter probably + PORT_DIPNAME( 0x20, 0x20, "H-Blank" ) // scanline counter probably PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Monitor" ) //a JP probably + PORT_DIPNAME( 0x40, 0x40, "Monitor" ) // a JP probably PORT_DIPSETTING( 0x40, "15KHz" ) PORT_DIPSETTING( 0x00, "24KHz" ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") @@ -309,6 +352,16 @@ static INPUT_PORTS_START( hitpoker ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END +// TODO: complete, currently just the bare minimum to make it show something +static INPUT_PORTS_START( reelmtp ) + PORT_INCLUDE( hitpoker ) + + PORT_MODIFY("VBLANK") // these 2 seem inverted wrt hitpoker + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") + PORT_DIPNAME( 0x80, 0x80, "H-Blank" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END static const gfx_layout hitpoker_layout_4bpp = { @@ -333,8 +386,8 @@ static const gfx_layout hitpoker_layout_8bpp = }; static GFXDECODE_START( gfx_hitpoker ) - GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_4bpp, 0, 0x100 ) - GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_8bpp, 0, 8 ) + GFXDECODE_ENTRY( "tiles", 0, hitpoker_layout_4bpp, 0, 0x100 ) + GFXDECODE_ENTRY( "tiles", 0, hitpoker_layout_8bpp, 0, 8 ) GFXDECODE_END void hitpoker_state::hitpoker(machine_config &config) @@ -342,47 +395,58 @@ void hitpoker_state::hitpoker(machine_config &config) MC68HC11A1(config, m_maincpu, 8'000'000); m_maincpu->set_addrmap(AS_PROGRAM, &hitpoker_state::hitpoker_map); m_maincpu->in_pa_callback().set(FUNC(hitpoker_state::hitpoker_pic_r)); - m_maincpu->out_pa_callback().set(FUNC(hitpoker_state::hitpoker_pic_w)); + m_maincpu->out_pa_callback().set(FUNC(hitpoker_state::pic_w)); m_maincpu->in_pe_callback().set_constant(0); ds17x85_device &rtc(DS17487(config, "rtc", 32768)); rtc.irq().set_inputline(m_maincpu, MC68HC11_IRQ_LINE); - /* 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_size(648, 480); //setted by the CRTC + screen.set_size(648, 480); // set by the CRTC screen.set_visarea(0, 648-1, 0, 240-1); - screen.set_screen_update(FUNC(hitpoker_state::screen_update_hitpoker)); + screen.set_screen_update(FUNC(hitpoker_state::screen_update)); - hd6845s_device &crtc(HD6845S(config, "crtc", CRTC_CLOCK/2)); /* hand tuned to get ~60 fps */ + hd6845s_device &crtc(HD6845S(config, "crtc", XTAL(3'579'545) / 2)); // hand tuned to get ~60 FPS crtc.set_screen("screen"); crtc.set_show_border_area(false); crtc.set_char_width(8); - //crtc.out_vsync_callback().set(FUNC(hitpoker_state::hitpoker_irq)); + //crtc.out_vsync_callback().set(FUNC(hitpoker_state::irq)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_hitpoker); PALETTE(config, m_palette).set_entries(0x800); SPEAKER(config, "mono").front_center(); - ym2149_device &aysnd(YM2149(config, "aysnd", 1500000)); + ym2149_device &aysnd(YM2149(config, "aysnd", 1'500'000)); aysnd.port_a_read_callback().set_ioport("DSW1"); aysnd.port_b_read_callback().set_ioport("DSW2"); aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); } +void hitpoker_state::reelmtp(machine_config &config) +{ + hitpoker(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &hitpoker_state::reelmtp_map); + m_maincpu->in_pa_callback().set(FUNC(hitpoker_state::reelmtp_pic_r)); + // TODO: there's only one 25.175 MHz XTAL. Adjust clocks + + // TODO: RAMDAC +} + void hitpoker_state::init_hitpoker() { uint8_t *ROM = memregion("maincpu")->base(); - ROM[0x1220] = 0x01; //patch eeprom write? + ROM[0x1220] = 0x01; // patch EEPROM write? ROM[0x1221] = 0x01; ROM[0x1222] = 0x01; ROM[0x10c6] = 0x01; - ROM[0x10c7] = 0x01; //patch the checksum routine + ROM[0x10c7] = 0x01; // patch the checksum routine // must match RTC serial number } @@ -401,14 +465,44 @@ ROM_START( hitpoker ) ROM_REGION( 0x10000, "pic", 0 ) ROM_LOAD( "pic", 0x00000, 0x1000, NO_DUMP ) // unknown type - ROM_REGION( 0x100000, "gfx1", 0 ) // tile 0x4c8 seems to contain something non-gfx related, could be tilemap / colour data, check! + ROM_REGION( 0x100000, "tiles", 0 ) // tile 0x4c8 seems to contain something non-gfx related, could be tilemap / colour data, check! ROM_LOAD16_BYTE( "u42.bin", 0x00001, 0x40000, CRC(cbe56fec) SHA1(129bfd10243eaa7fb6a087f96de90228e6030353) ) ROM_LOAD16_BYTE( "u43.bin", 0x00000, 0x40000, CRC(6c0d4283) SHA1(04a4fd82f5cc0ed9f548e490ac67d287227073c3) ) ROM_LOAD16_BYTE( "u44.bin", 0x80001, 0x40000, CRC(e23d5f30) SHA1(ca8855301528aa4eeff40cb820943b4268f8596e) ) // the 'adult images' are 8bpp ROM_LOAD16_BYTE( "u45.bin", 0x80000, 0x40000, CRC(e65b3e52) SHA1(c0c1a360a4a1823bf71c0a4105ff41f4102862e8) ) // the first part of these 2 is almost empty as the standard gfx are 4bpp ROM_END +// PCB features Motorola SC80566FN (custom MC68HC11 based MCU), 25.175 MHz XTAL, YM2149F, DS17487-5 RTC, MC6845P CRTC, ADV471KP50E RAMDAC, 1 4-DIP bank +// Can't spot any PIC. +ROM_START( reelmtp ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "u12.bin", 0x00000, 0x10000, CRC(b613a0e1) SHA1(071f36b88261a44d82ef0322ddf12502ffacf998) ) // 27C512 + + ROM_REGION( 0x200, "maincpu:eeprom", ROMREGION_ERASEFF ) + // must match RTC serial number. TODO! + ROM_FILL( 0x003, 1, 0x4d ) + ROM_FILL( 0x002, 1, 0x41 ) + ROM_FILL( 0x001, 1, 0x4d ) + ROM_FILL( 0x000, 1, 0x45 ) + + // TODO: bigger than what MAME expects for this RTC model? + ROM_REGION( 0x1100, "rtc_dump", 0 ) + ROM_LOAD( "ds17487-5.u14", 0x0000, 0x1100, CRC(bffb8967) SHA1(28276f01c114c477a0c022b17d250c4952922625) ) + + ROM_REGION( 0x180000, "tiles", 0 ) // TODO: wrong loading / decode + ROM_LOAD( "u40.bin", 0x000000, 0x40000, CRC(cbac4a12) SHA1(01133620ba5b3bb02712d30356d003b748315258) ) // M27C2001 + // 0x40000 - 07ffff? + ROM_LOAD( "u41.bin", 0x080000, 0x80000, CRC(17c57221) SHA1(1a3cd5a5a3d7736fc50d605da98667a3efa7cd3c) ) // 27C040 + ROM_LOAD( "u42.bin", 0x100000, 0x80000, CRC(30f31d9e) SHA1(4637e04e647ae3fc6b93093ae7468fefdcc355cc) ) // 27C040 + + ROM_REGION( 0x600, "plds", ROMREGION_ERASE00 ) + ROM_LOAD( "palce16v8h.u10", 0x000, 0x117, CRC(75ab49ba) SHA1(9060d59e92df0c6ed7b5041a98bb4ab5759e7d62) ) + ROM_LOAD( "palce16v8h.2", 0x200, 0x117, NO_DUMP ) // U location no readable, but just over the above one + ROM_LOAD( "pal.u26", 0x400, 0x117, NO_DUMP ) // scratched, can't read type +ROM_END + } // anonymous namespace -GAME( 1997, hitpoker, 0, hitpoker, hitpoker, hitpoker_state, init_hitpoker, ROT0, "Accept Ltd.", "Hit Poker (Bulgaria)", MACHINE_NOT_WORKING ) +GAME( 1997, hitpoker, 0, hitpoker, hitpoker, hitpoker_state, init_hitpoker, ROT0, "Accept Ltd.", "Hit Poker (Bulgaria)", MACHINE_NOT_WORKING ) +GAME( 1999, reelmtp, 0, reelmtp, reelmtp, hitpoker_state, empty_init, ROT0, "Accept Ltd.", "Reel Magic Turbo Play", MACHINE_NOT_WORKING ) diff --git a/src/mame/misc/imolagp.cpp b/src/mame/misc/imolagp.cpp index 435ca1cd63334..19708059f1ad0 100644 --- a/src/mame/misc/imolagp.cpp +++ b/src/mame/misc/imolagp.cpp @@ -130,7 +130,7 @@ class imolagp_state : public driver_device void imolagp(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(imolagp_steerlatch_r); + ioport_value imolagp_steerlatch_r(); protected: virtual void machine_start() override; @@ -416,7 +416,7 @@ void imolagp_state::imolagp_slave_io(address_map &map) ***************************************************************************/ -CUSTOM_INPUT_MEMBER(imolagp_state::imolagp_steerlatch_r) +ioport_value imolagp_state::imolagp_steerlatch_r() { return m_steerlatch & 0xf; } diff --git a/src/mame/misc/interflip8035.cpp b/src/mame/misc/interflip8035.cpp index eb309639040e4..fb38dbf4ea16f 100644 --- a/src/mame/misc/interflip8035.cpp +++ b/src/mame/misc/interflip8035.cpp @@ -1237,7 +1237,7 @@ void interflip8035_state::interflip(machine_config &config) add_em_reels(config, 20, attotime::from_double(2)); // hopper device - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); // sound stuff SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/jackhouse.cpp b/src/mame/misc/jackhouse.cpp index 1f04ebded6681..7a93eb6b91305 100644 --- a/src/mame/misc/jackhouse.cpp +++ b/src/mame/misc/jackhouse.cpp @@ -707,7 +707,7 @@ void jackhouse_state::jackhouse(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_jackhouse); config.set_default_layout(layout_jackhouse); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/misc/jaminator.cpp b/src/mame/misc/jaminator.cpp index 754af617fd8cd..6fae6d8eab664 100644 --- a/src/mame/misc/jaminator.cpp +++ b/src/mame/misc/jaminator.cpp @@ -64,12 +64,12 @@ class jaminator_state : public driver_device void jaminator(machine_config &config); void input_sel_w(u8 data); - DECLARE_CUSTOM_INPUT_MEMBER(input_r); - DECLARE_CUSTOM_INPUT_MEMBER(bender_r); + ioport_value input_r(); + ioport_value bender_r(); // link cable not emulated yet, but output needs to be looped back too (used for starting songs, etc) void link_data_w(u8 data) { m_link_data = data; } - DECLARE_CUSTOM_INPUT_MEMBER(link_data_r) { return m_link_data; } + ioport_value link_data_r() { return m_link_data; } protected: virtual void machine_start() override; @@ -219,7 +219,7 @@ void jaminator_state::input_sel_w(u8 data) } //************************************************************************** -CUSTOM_INPUT_MEMBER(jaminator_state::input_r) +ioport_value jaminator_state::input_r() { if (m_input_sel < 0x7) return m_inputs[m_input_sel]->read(); @@ -228,7 +228,7 @@ CUSTOM_INPUT_MEMBER(jaminator_state::input_r) } //************************************************************************** -CUSTOM_INPUT_MEMBER(jaminator_state::bender_r) +ioport_value jaminator_state::bender_r() { // the bender PCB only has 15 contact positions (0-14), but the ROM recognizes 16 values static const u8 bendval[] = { diff --git a/src/mame/misc/katosmedz80.cpp b/src/mame/misc/katosmedz80.cpp index 1668a1a08ed2d..287a7d3af2c37 100644 --- a/src/mame/misc/katosmedz80.cpp +++ b/src/mame/misc/katosmedz80.cpp @@ -272,7 +272,7 @@ class katosmedz80_state : public driver_device m_pos(*this, "mpos%u", 0U) { } - DECLARE_CUSTOM_INPUT_MEMBER(arm_sensors_r); + ioport_value arm_sensors_r(); void dnbanban(machine_config &config) ATTR_COLD; protected: @@ -372,7 +372,7 @@ void katosmedz80_state::io_map(address_map &map) */ -CUSTOM_INPUT_MEMBER(katosmedz80_state::arm_sensors_r) +ioport_value katosmedz80_state::arm_sensors_r() { return m_sensors; } diff --git a/src/mame/misc/kingpin.cpp b/src/mame/misc/kingpin.cpp index f3a72a58b2683..21760e2de5889 100644 --- a/src/mame/misc/kingpin.cpp +++ b/src/mame/misc/kingpin.cpp @@ -176,7 +176,7 @@ static INPUT_PORTS_START( kingpin ) PORT_START("IN1") PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Quit") PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Odd") - PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) @@ -240,7 +240,7 @@ void kingpin_state::kingpin(machine_config &config) AY8912(config, "aysnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.50); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, "hopper", attotime::from_msec(100)); config.set_default_layout(layout_kingpin); } diff --git a/src/mame/misc/kurukuru.cpp b/src/mame/misc/kurukuru.cpp index 33c92289a2868..809506d5f1977 100644 --- a/src/mame/misc/kurukuru.cpp +++ b/src/mame/misc/kurukuru.cpp @@ -450,9 +450,6 @@ class kurukuru_state : public driver_device #define YM2149_CLOCK MAIN_CLOCK/6/2 // '/SEL' pin tied to GND, so internal divisor x2 is active #define M5205_CLOCK XTAL(384'000) -#define HOPPER_PULSE 50 // time between hopper pulses in milliseconds -#define VDP_MEM 0x30000 - /************************************************* * Interrupts * @@ -861,11 +858,11 @@ void kurukuru_state::kurukuru(machine_config &config) // video hardware v9938_device &v9938(V9938(config, "v9938", MAIN_CLOCK)); v9938.set_screen_ntsc("screen"); - v9938.set_vram_size(VDP_MEM); + v9938.set_vram_size(0x30000); v9938.int_cb().set_inputline("maincpu", 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(50)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/magic10.cpp b/src/mame/misc/magic10.cpp index 54934856a264d..7d6959c3951e9 100644 --- a/src/mame/misc/magic10.cpp +++ b/src/mame/misc/magic10.cpp @@ -984,8 +984,8 @@ void magic10_state::magic10(machine_config &config) // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &magic10_state::magic10_map); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); - HOPPER(config, m_hopper, attotime::from_msec(20), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6)); + HOPPER(config, m_hopper, attotime::from_msec(20)); } @@ -1044,7 +1044,7 @@ void spetrix_state::spetrix(machine_config &config) { base(config); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6)); m_maincpu->set_addrmap(AS_PROGRAM, &spetrix_state::spetrix_map); m_maincpu->set_vblank_int("screen", FUNC(spetrix_state::irq2_line_hold)); // L1 interrupts diff --git a/src/mame/misc/marywu.cpp b/src/mame/misc/marywu.cpp index e045bdfe93e48..7bdd517d5e210 100644 --- a/src/mame/misc/marywu.cpp +++ b/src/mame/misc/marywu.cpp @@ -10,14 +10,16 @@ TODO: * Figure out where exactly all devices are mapped to (the devices are - 2 sound chips, the 2kb SRAM, the 8bit dipswitches, + 2 sound chips, the 2kb SRAM, the 8bit DIP switches, 31 LEDs, 13 modules of double-digit 7-seg displays and 4 push-buttons). * we may also have user inputs from the coin slot and from the cabinet buttons, for making bets. **************************************************************************/ #include "emu.h" + #include "cpu/mcs51/mcs51.h" +#include "machine/nvram.h" #include "machine/i8279.h" #include "sound/ay8910.h" #include "speaker.h" @@ -34,10 +36,14 @@ class marywu_state : public driver_device : driver_device(mconfig, type, tag) , m_digits(*this, "digit%u", 0U) , m_leds(*this, "led%u", 0U) + , m_inputs(*this, { "KEYS1", "KEYS2", "DSW", "PUSHBUTTONS" }) { } void marywu(machine_config &config); +protected: + virtual void machine_start() override; + private: void display_7seg_data_w(uint8_t data); void multiplex_7seg_w(uint8_t data); @@ -50,96 +56,74 @@ class marywu_state : public driver_device void program_map(address_map &map); uint8_t m_selected_7seg_module = 0; - virtual void machine_start() override; + output_finder<32> m_digits; output_finder<30> m_leds; + required_ioport_array<4> m_inputs; }; static INPUT_PORTS_START( marywu ) PORT_START("KEYS1") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_START("KEYS2") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x01, "Unknown bit #0" ) PORT_DIPLOCATION("DSW:1") - PORT_DIPSETTING(0x01, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x02, 0x02, "Unknown bit #1" ) PORT_DIPLOCATION("DSW:2") - PORT_DIPSETTING(0x02, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x04, 0x04, "Unknown bit #2" ) PORT_DIPLOCATION("DSW:3") - PORT_DIPSETTING(0x04, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x08, 0x08, "Unknown bit #3" ) PORT_DIPLOCATION("DSW:4") - PORT_DIPSETTING(0x08, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x10, 0x10, "Unknown bit #4" ) PORT_DIPLOCATION("DSW:5") - PORT_DIPSETTING(0x10, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x20, 0x20, "Unknown bit #5" ) PORT_DIPLOCATION("DSW:6") - PORT_DIPSETTING(0x20, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x40, 0x40, "Unknown bit #6" ) PORT_DIPLOCATION("DSW:7") - PORT_DIPSETTING(0x40, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) - PORT_DIPNAME( 0x80, 0x80, "Unknown bit #7" ) PORT_DIPLOCATION("DSW:8") - PORT_DIPSETTING(0x80, DEF_STR( On ) ) - PORT_DIPSETTING(0x00, DEF_STR( Off ) ) + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "DSW:1") + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "DSW:2") + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DSW:3") + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DSW:4") + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DSW:5") + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW:6") + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DSW:7") + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW:8") PORT_START("PUSHBUTTONS") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) // K0 + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) // K1 + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) // K2 + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) // K3 + PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END void marywu_state::ay1_port_a_w(uint8_t data) { - for (uint8_t i=0; i<8; i++){ + for (uint8_t i = 0; i < 8; i++) m_leds[i] = BIT(data, i); - } } void marywu_state::ay1_port_b_w(uint8_t data) { - for (uint8_t i=0; i<8; i++){ - m_leds[i+8] = BIT(data, i); - } + for (uint8_t i = 0; i < 8; i++) + m_leds[i + 8] = BIT(data, i); } void marywu_state::ay2_port_a_w(uint8_t data) { - for (uint8_t i=0; i<8; i++){ - m_leds[i+16] = BIT(data, i); - } + for (uint8_t i = 0; i < 8; i++) + m_leds[i + 16] = BIT(data, i); } void marywu_state::ay2_port_b_w(uint8_t data) { - for (uint8_t i=0; i<6; i++){ - /* we only have 30 LEDs. The last 2 bits in this port are unused. */ - m_leds[i+24] = BIT(data, i); - } + // we only have 30 LEDs. The last 2 bits in this port are unused. + for (uint8_t i = 0; i < 6; i++) + m_leds[i + 24] = BIT(data, i); } void marywu_state::multiplex_7seg_w(uint8_t data) @@ -149,13 +133,15 @@ void marywu_state::multiplex_7seg_w(uint8_t data) uint8_t marywu_state::keyboard_r() { - switch(m_selected_7seg_module % 8){ - case 0: return ioport("KEYS1")->read(); - case 1: return ioport("KEYS2")->read(); - case 2: return ioport("DSW")->read(); - case 3: return ioport("PUSHBUTTONS")->read(); + switch (m_selected_7seg_module & 0x07) + { + case 0: + case 1: + case 2: + case 3: + return m_inputs[m_selected_7seg_module & 0x07]->read(); default: - return 0x00; + return 0x00; } } @@ -163,7 +149,7 @@ void marywu_state::display_7seg_data_w(uint8_t data) { static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // HEF4511BP (7 seg display driver) - m_digits[2 * m_selected_7seg_module + 0] = patterns[data & 0x0F]; + m_digits[2 * m_selected_7seg_module + 0] = patterns[data & 0x0f]; m_digits[2 * m_selected_7seg_module + 1] = patterns[data >> 4]; } @@ -174,11 +160,9 @@ void marywu_state::program_map(address_map &map) void marywu_state::io_map(address_map &map) { - map(0x8000, 0x87ff).mirror(0x0800).ram(); /* HM6116: 2kbytes of Static RAM */ - map(0x9000, 0x9000).mirror(0x0ffc).w("ay1", FUNC(ay8910_device::data_address_w)); - map(0x9001, 0x9001).mirror(0x0ffc).rw("ay1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); - map(0x9002, 0x9002).mirror(0x0ffc).w("ay2", FUNC(ay8910_device::data_address_w)); - map(0x9003, 0x9003).mirror(0x0ffc).rw("ay2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0x8000, 0x87ff).mirror(0x0800).ram().share("nvram"); /* HM6116: 2kbytes of Static RAM */ + map(0x9000, 0x9001).mirror(0x0ffc).rw("ay1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); + map(0x9002, 0x9003).mirror(0x0ffc).rw("ay2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); map(0xb000, 0xb001).mirror(0x0ffe).rw("i8279", FUNC(i8279_device::read), FUNC(i8279_device::write)); map(0xf000, 0xf000).noprw(); /* TODO: Investigate this. There's something going on at this address range. */ } @@ -191,14 +175,20 @@ void marywu_state::machine_start() void marywu_state::marywu(machine_config &config) { + // The 8279 (U23) and PSGs (U16 and U14) are clocked using the ALE output from the 8031. + // This is normally 1/6th of the input clock frequency, but a pulse is skipped during external data memory accesses. + // If the program accesses external data memory, sound generation and keyboard scanning will be affected. + /* basic machine hardware */ i80c31_device &maincpu(I80C31(config, "maincpu", XTAL(10'738'635))); //actual CPU is a Winbond w78c31b-24 maincpu.set_addrmap(AS_PROGRAM, &marywu_state::program_map); maincpu.set_addrmap(AS_IO, &marywu_state::io_map); //TODO: figure out what each bit is mapped to in the 80c31 ports P1 and P3 + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* Keyboard & display interface */ - i8279_device &kbdc(I8279(config, "i8279", XTAL(10'738'635))); // should it be perhaps a fraction of the XTAL clock ? + i8279_device &kbdc(I8279(config, "i8279", XTAL(10'738'635) / 6)); kbdc.out_sl_callback().set(FUNC(marywu_state::multiplex_7seg_w)); // select block of 7seg modules by multiplexing the SL scan lines kbdc.in_rl_callback().set(FUNC(marywu_state::keyboard_r)); // keyboard Return Lines kbdc.out_disp_callback().set(FUNC(marywu_state::display_7seg_data_w)); @@ -208,12 +198,13 @@ void marywu_state::marywu(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ay8910_device &ay1(AY8910(config, "ay1", XTAL(10'738'635))); /* should it be perhaps a fraction of the XTAL clock ? */ + + ay8910_device &ay1(AY8910(config, "ay1", XTAL(10'738'635) / 6)); ay1.add_route(ALL_OUTPUTS, "mono", 0.50); ay1.port_a_write_callback().set(FUNC(marywu_state::ay1_port_a_w)); ay1.port_b_write_callback().set(FUNC(marywu_state::ay1_port_b_w)); - ay8910_device &ay2(AY8910(config, "ay2", XTAL(10'738'635))); /* should it be perhaps a fraction of the XTAL clock ? */ + ay8910_device &ay2(AY8910(config, "ay2", XTAL(10'738'635) / 6)); ay2.add_route(ALL_OUTPUTS, "mono", 0.50); ay2.port_a_write_callback().set(FUNC(marywu_state::ay2_port_a_w)); ay2.port_b_write_callback().set(FUNC(marywu_state::ay2_port_b_w)); diff --git a/src/mame/misc/mgavegas.cpp b/src/mame/misc/mgavegas.cpp index 1bf8796d99f0c..90b5e3e00e178 100644 --- a/src/mame/misc/mgavegas.cpp +++ b/src/mame/misc/mgavegas.cpp @@ -459,7 +459,7 @@ static INPUT_PORTS_START( mgavegas ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // 25 ptas in to play PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // 100ptas in for change with 4 25 ptas coins PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) - PORT_BIT( 0x10, IP_ACTIVE_LOW,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("25 ptas level") //"hack" hopper always full PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("Door") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("Channel") @@ -510,7 +510,7 @@ void mgavegas_state::mgavegas(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(200)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/mjsenpu.cpp b/src/mame/misc/mjsenpu.cpp index 7493f7dff580f..14714516cc948 100644 --- a/src/mame/misc/mjsenpu.cpp +++ b/src/mame/misc/mjsenpu.cpp @@ -43,10 +43,12 @@ *********************************************************************/ #include "emu.h" + #include "cpu/e132xs/e132xs.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -72,6 +74,11 @@ class mjsenpu_state : public driver_device void init_mjsenpu(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + private: /* devices */ required_device m_maincpu; @@ -80,9 +87,9 @@ class mjsenpu_state : public driver_device required_shared_ptr m_mainram; // required_shared_ptr m_vram; - uint8_t m_pal[0x200]; - uint32_t m_vram0[0x20000 / 4]; - uint32_t m_vram1[0x20000 / 4]; + uint8_t m_pal[0x200] = { }; + uint32_t m_vram0[0x20000 / 4] = { }; + uint32_t m_vram1[0x20000 / 4] = { }; uint8_t m_control = 0; uint8_t m_mux = 0; @@ -102,9 +109,6 @@ class mjsenpu_state : public driver_device uint32_t vram_r(offs_t offset); void vram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; uint32_t screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_palette; @@ -163,15 +167,15 @@ void mjsenpu_state::control_w(uint8_t data) // bit 0x20 not used? // bit 0x10 is the M6295 bank, samples <26 are the same in both banks and so bank switch isn't written for them, not even in sound test. - m_oki->set_rom_bank((data&0x10)>>4); + m_oki->set_rom_bank(BIT(data, 4)); // bits 0x08 is used in the alt payout / hopper mode (see dipswitches) // 0x04 seem to be hopper/ticket related? different ones get used depending on the dips - m_hopper->motor_w(data & 0x04); + m_hopper->motor_w(BIT(~data, 2)); // bit 0x02 could be coin counter? - machine().bookkeeping().coin_counter_w(0, data & 0x02 ); + machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // bit 0x01 alternates frequently, using as video buffer, but that's a complete guess m_control = data; @@ -471,7 +475,7 @@ void mjsenpu_state::mjsenpu(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // more likely coins out? - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/mpu12wbk.cpp b/src/mame/misc/mpu12wbk.cpp index 56940b7621ff4..1c9875b17a2fa 100644 --- a/src/mame/misc/mpu12wbk.cpp +++ b/src/mame/misc/mpu12wbk.cpp @@ -962,7 +962,7 @@ void mpu12wbk_state::mpu12wbk(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(100)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/multfish.cpp b/src/mame/misc/multfish.cpp index 11a39c5f46b4e..1e1b9a9ab8d44 100644 --- a/src/mame/misc/multfish.cpp +++ b/src/mame/misc/multfish.cpp @@ -1080,7 +1080,7 @@ void igrosoft_gamble_state::igrosoft_gamble(machine_config &config) AY8910(config, "aysnd", 6000000/4).add_route(ALL_OUTPUTS, "mono", 0.30); M48T35(config, m_m48t35, 0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); } void igrosoft_gamble_state::rollfr(machine_config &config) diff --git a/src/mame/misc/nexus3d.cpp b/src/mame/misc/nexus3d.cpp index c53c7b302862d..8c4573a03185b 100644 --- a/src/mame/misc/nexus3d.cpp +++ b/src/mame/misc/nexus3d.cpp @@ -15,7 +15,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/nandflash.h" #include "emupal.h" #include "screen.h" @@ -125,9 +124,9 @@ void nexus3d_state::IntReq(int level) uint32_t inten = m_intmask ^ 0xffffffff; if (m_intpend & inten) - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); else - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } diff --git a/src/mame/misc/piggypas.cpp b/src/mame/misc/piggypas.cpp index 9f18a22de7fe7..8e420e7861c1c 100644 --- a/src/mame/misc/piggypas.cpp +++ b/src/mame/misc/piggypas.cpp @@ -235,7 +235,7 @@ void piggypas_state::piggypas(machine_config &config) ppi.out_pb_callback().set(FUNC(piggypas_state::ctrl_w)); ppi.in_pc_callback().set_ioport("IN0"); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); } void piggypas_state::fidlstix(machine_config &config) diff --git a/src/mame/misc/sanremmg.cpp b/src/mame/misc/sanremmg.cpp index bc3db5d4c5d5c..6330bb750f5b8 100644 --- a/src/mame/misc/sanremmg.cpp +++ b/src/mame/misc/sanremmg.cpp @@ -33,7 +33,6 @@ M30624FG (M16C/62A family) needs CPU core and dumping of internal ROM #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/misc/skylncr.cpp b/src/mame/misc/skylncr.cpp index 19e24ccf161ba..adb00ceb02741 100644 --- a/src/mame/misc/skylncr.cpp +++ b/src/mame/misc/skylncr.cpp @@ -134,9 +134,6 @@ namespace { -#define HOPPER_PULSE 50 // guessed - - class skylncr_state : public driver_device { public: @@ -1689,7 +1686,7 @@ void skylncr_state::skylncr(machine_config &config) ppi1.in_pb_callback().set_ioport("IN3"); ppi1.in_pc_callback().set_ioport("IN4"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration guessed // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/ssingles.cpp b/src/mame/misc/ssingles.cpp index 1526f4b93a672..c0a4f95eeb376 100644 --- a/src/mame/misc/ssingles.cpp +++ b/src/mame/misc/ssingles.cpp @@ -187,7 +187,7 @@ class ssingles_state : public driver_device void ssingles(machine_config &config); void atamanot(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(controls_r); + ioport_value controls_r(); protected: virtual void video_start() override; @@ -329,7 +329,7 @@ void ssingles_state::c001_w(uint8_t data) m_prot_data ^= data ^ 0x11; } -CUSTOM_INPUT_MEMBER(ssingles_state::controls_r) +ioport_value ssingles_state::controls_r() { int data = 7; switch (m_extra->read()) //multiplexed diff --git a/src/mame/misc/tapatune.cpp b/src/mame/misc/tapatune.cpp index 1e89dc53368a5..113879c45affa 100644 --- a/src/mame/misc/tapatune.cpp +++ b/src/mame/misc/tapatune.cpp @@ -37,12 +37,14 @@ ****************************************************************************/ #include "emu.h" + #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "sound/bsmt2000.h" #include "video/mc6845.h" + #include "screen.h" #include "speaker.h" @@ -70,6 +72,10 @@ class tapatune_state : public driver_device void tapatune(machine_config &config); void tapatune_base(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: required_device m_maincpu; optional_device m_videocpu; @@ -77,22 +83,19 @@ class tapatune_state : public driver_device optional_shared_ptr m_videoram; - uint8_t m_paletteram[0x300]{}; - uint16_t m_palette_write_addr = 0; - rgb_t m_pens[0x100]; - uint8_t m_controls_mux = 0; - uint8_t m_z80_to_68k_index = 0; - uint8_t m_z80_to_68k_data = 0; - uint8_t m_68k_to_z80_index = 0; - uint8_t m_68k_to_z80_data = 0; - uint8_t m_z80_data_available = 0; - uint8_t m_68k_data_available = 0; - uint8_t m_bsmt_data_l = 0; - uint8_t m_bsmt_data_h = 0; - bool m_bsmt_reset = false; - - virtual void machine_start() override; - virtual void machine_reset() override; + uint8_t m_paletteram[0x300]{}; + uint16_t m_palette_write_addr = 0; + rgb_t m_pens[0x100]; + uint8_t m_controls_mux = 0; + uint8_t m_z80_to_68k_index = 0; + uint8_t m_z80_to_68k_data = 0; + uint8_t m_68k_to_z80_index = 0; + uint8_t m_68k_to_z80_data = 0; + uint8_t m_z80_data_available = 0; + uint8_t m_68k_data_available = 0; + uint8_t m_bsmt_data_l = 0; + uint8_t m_bsmt_data_h = 0; + bool m_bsmt_reset = false; void crtc_vsync(int state); @@ -505,7 +508,7 @@ static INPUT_PORTS_START( tapatune ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("BUTTONS") @@ -536,7 +539,7 @@ void tapatune_state::tapatune_base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/misc/tickee.cpp b/src/mame/misc/tickee.cpp index d3fe904439280..7320d2481b2b6 100644 --- a/src/mame/misc/tickee.cpp +++ b/src/mame/misc/tickee.cpp @@ -344,8 +344,8 @@ void tickee_state::tickee_control_w(offs_t offset, uint8_t data) break; case 3: - m_ticket[0]->motor_w(BIT(data, 3)); - m_ticket[1]->motor_w(BIT(data, 2)); + m_ticket[0]->motor_w(BIT(~data, 3)); + m_ticket[1]->motor_w(BIT(~data, 2)); break; default: @@ -806,8 +806,8 @@ void tickee_gun_state::tickee(machine_config &config) set_beamadd(50, 0); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); + TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100)); // video hardware TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -850,8 +850,8 @@ void tickee_state::mouseatk(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); + TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100)); // video hardware TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -908,7 +908,7 @@ void tickee_gun_state::maletmad(machine_config &config) { rapidfir(config); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); } diff --git a/src/mame/misc/tvg01.cpp b/src/mame/misc/tvg01.cpp index 2f30155df83c0..06509067896a2 100644 --- a/src/mame/misc/tvg01.cpp +++ b/src/mame/misc/tvg01.cpp @@ -103,9 +103,6 @@ class tvg01_state : public driver_device #define CPU_CLOCK MAIN_CLOCK / 6 #define PSG_CLOCK MAIN_CLOCK / 12 -#define VDP_MEM 0x20000 // 4x MB81464-15 -#define HOPPER_PULSE 50 // time between hopper pulses in milliseconds - void tvg01_state::machine_start() { @@ -305,10 +302,10 @@ void tvg01_state::theboat(machine_config &config) v9938_device &vdp(V9938(config, "vdp", VDP_CLOCK)); // unknown type (surface-scratched 64-pin SDIP) vdp.set_screen_ntsc("screen"); - vdp.set_vram_size(VDP_MEM); // 4x MB81464-15 + vdp.set_vram_size(0x20000); // 4x MB81464-15 vdp.int_cb().set_inputline("maincpu", INPUT_LINE_IRQ0); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(50)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/vamphalf.cpp b/src/mame/misc/vamphalf.cpp index 7ffc026b54a50..47a9fb4e43247 100644 --- a/src/mame/misc/vamphalf.cpp +++ b/src/mame/misc/vamphalf.cpp @@ -138,7 +138,7 @@ class vamphalf_state : public driver_device void init_mrkicker(); void init_solitaire(); - DECLARE_CUSTOM_INPUT_MEMBER(boonggab_photo_sensors_r); + ioport_value boonggab_photo_sensors_r(); u16 eeprom_r(offs_t offset); u32 eeprom32_r(); @@ -918,7 +918,7 @@ u32 vamphalf_state::screen_update_aoh(screen_device &screen, bitmap_ind16 &bitma return 0; } -CUSTOM_INPUT_MEMBER(vamphalf_state::boonggab_photo_sensors_r) +ioport_value vamphalf_state::boonggab_photo_sensors_r() { static const u16 photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; u8 res = m_photosensors->read(); diff --git a/src/mame/misc/videosaa.cpp b/src/mame/misc/videosaa.cpp index 4fecce9b4809a..9f60fc03c6498 100644 --- a/src/mame/misc/videosaa.cpp +++ b/src/mame/misc/videosaa.cpp @@ -386,7 +386,7 @@ void videosaa_state::machine_start() save_pointer(NAME(m_vram0), 0x800); save_pointer(NAME(m_vram1), 0x800); save_item(NAME(m_chip_latch)); - save_pointer(NAME(m_video_latch), 4); + save_item(NAME(m_video_latch)); } void videosaa_state::machine_reset() diff --git a/src/mame/morrow/mpz80.cpp b/src/mame/morrow/mpz80.cpp index fef2ceab6014e..8fb4a38289585 100644 --- a/src/mame/morrow/mpz80.cpp +++ b/src/mame/morrow/mpz80.cpp @@ -723,7 +723,7 @@ void mpz80_state::mpz80(machine_config &config) S100_BUS(config, m_s100, XTAL(4'000'000) / 2); m_s100->irq().set(FUNC(mpz80_state::s100_pint_w)); m_s100->nmi().set(FUNC(mpz80_state::s100_nmi_w)); - m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_BOGUSWAIT); + //m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_WAIT); S100_SLOT(config, S100_TAG ":1", mpz80_s100_cards, "mm65k16s"); S100_SLOT(config, S100_TAG ":2", mpz80_s100_cards, "wunderbus"); S100_SLOT(config, S100_TAG ":3", mpz80_s100_cards, "dj2db"); diff --git a/src/mame/motorola/mex68kecb.cpp b/src/mame/motorola/mex68kecb.cpp new file mode 100644 index 0000000000000..1d092b687b634 --- /dev/null +++ b/src/mame/motorola/mex68kecb.cpp @@ -0,0 +1,236 @@ +// license:BSD-3-Clause +// copyright-holders:Chris Hanson +/* + * mex68kecb.cpp - Motorola MEX68KECB + * + * Documentation: + * http://www.bitsavers.org/components/motorola/68000/MEX68KECB/MEX68KECB_D2_EduCompBd_Jul82.pdf + * + * The Motorola MC68000 Educational Computer Board is a single-board computer with + * a 4MHz 68000 CPU, 32KB RAM, 16KB ROM, host and terminal serial ports, a + * parallel interface/timer, a cassette interface, and a prototyping area with + * full access to the 68000 bus. The ROM contains TUTOR, a debug and bootstrap + * system that was the predecessor of MACSBUG. + * + * Specifications: + * - 4MHz MC68000L4 CPU + * - MC6850 ACIA x 2 + * - MC68230 PIT + * + * TODO: + * - Cassette I/O + * + */ + +#include "emu.h" + +#include "bus/rs232/rs232.h" +#include "cpu/m68000/m68000.h" +#include "machine/68230pit.h" +#include "machine/6850acia.h" +#include "machine/mc14411.h" + + +namespace { + +class mex68kecb_state : public driver_device +{ +public: + static constexpr feature_type unemulated_features() { return feature::TAPE; } + + mex68kecb_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_bootvect(*this, "bootvect") + , m_sysram(*this, "ram") + , m_maincpu(*this, "maincpu") + , m_pit(*this, "pit") + , m_brg(*this, "brg") + , m_acia1(*this, "acia1") + , m_acia2(*this, "acia2") + , m_acia1_baud(*this, "ACIA1_BAUD") + , m_acia2_baud(*this, "ACIA2_BAUD") + , m_terminal(*this, "terminal") + , m_host(*this, "host") + { } + + void mex68kecb(machine_config &config) ATTR_COLD; + + DECLARE_INPUT_CHANGED_MEMBER(abort_button); + +protected: + virtual void machine_reset() override ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + // Clocks from Baud Rate Generator + template void write_acia_clock(int state); + + void bootvect_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + memory_view m_bootvect; + required_shared_ptr m_sysram; // Pointer to System RAM needed by bootvect_w and masking RAM buffer for post reset accesses + + required_device m_maincpu; + required_device m_pit; + required_device m_brg; + required_device m_acia1; + required_device m_acia2; + required_ioport m_acia1_baud; + required_ioport m_acia2_baud; + + required_device m_terminal; + required_device m_host; +}; + + +/* Input ports */ +static INPUT_PORTS_START( mex68kecb ) + PORT_START("ACIA1_BAUD") + PORT_DIPNAME(0xff, 0x80, "Terminal Baud Rate") PORT_DIPLOCATION("J10:8,7,6,5,4,3,2,1") + PORT_DIPSETTING(0x80, "9600") + PORT_DIPSETTING(0x40, "4800") + PORT_DIPSETTING(0x20, "2400") + PORT_DIPSETTING(0x10, "1200") + PORT_DIPSETTING(0x08, "600") + PORT_DIPSETTING(0x04, "300") + PORT_DIPSETTING(0x02, "150") + PORT_DIPSETTING(0x01, "110") + + PORT_START("ACIA2_BAUD") + PORT_DIPNAME(0xff, 0x80, "Host Baud Rate") PORT_DIPLOCATION("J9:8,7,6,5,4,3,2,1") + PORT_DIPSETTING(0x80, "9600") + PORT_DIPSETTING(0x40, "4800") + PORT_DIPSETTING(0x20, "2400") + PORT_DIPSETTING(0x10, "1200") + PORT_DIPSETTING(0x08, "600") + PORT_DIPSETTING(0x04, "300") + PORT_DIPSETTING(0x02, "150") + PORT_DIPSETTING(0x01, "110") + + PORT_START("ABORT") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Abort button") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, mex68kecb_state, abort_button, 0) +INPUT_PORTS_END + + +void mex68kecb_state::mex68kecb(machine_config &config) +{ + M68000(config, m_maincpu, 8_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &mex68kecb_state::mem_map); + + // Set up BRG. + + MC14411(config, m_brg, 1.8432_MHz_XTAL); + m_brg->out_f<1>().set(FUNC(mex68kecb_state::write_acia_clock<7>)); // 9600bps + m_brg->out_f<3>().set(FUNC(mex68kecb_state::write_acia_clock<6>)); // 4800bps + m_brg->out_f<5>().set(FUNC(mex68kecb_state::write_acia_clock<5>)); // 2400bps + m_brg->out_f<7>().set(FUNC(mex68kecb_state::write_acia_clock<4>)); // 1200bps + m_brg->out_f<8>().set(FUNC(mex68kecb_state::write_acia_clock<3>)); // 600bps + m_brg->out_f<9>().set(FUNC(mex68kecb_state::write_acia_clock<2>)); // 300bps + m_brg->out_f<11>().set(FUNC(mex68kecb_state::write_acia_clock<1>)); // 150bps + m_brg->out_f<13>().set(FUNC(mex68kecb_state::write_acia_clock<0>)); // 110bps + + // Set up PIT and ACIAs. + + PIT68230(config, m_pit, 8_MHz_XTAL / 2); + ACIA6850(config, m_acia1); + ACIA6850(config, m_acia2); + + // Set up interrupts. + + // Nothing at IRQ1 + m_pit->timer_irq_callback().set_inputline(m_maincpu, M68K_IRQ_2); + m_pit->port_irq_callback().set_inputline(m_maincpu, M68K_IRQ_3); + // Optional 6800 peripherals at IRQ4 + m_acia1->irq_handler().set_inputline(m_maincpu, M68K_IRQ_5); + m_acia2->irq_handler().set_inputline(m_maincpu, M68K_IRQ_6); + // Abort button at IRQ7, see abort_button() + + // Set up terminal RS-232. + + RS232_PORT(config, m_terminal, default_rs232_devices, "terminal"); + m_terminal->rxd_handler().set(m_acia1, FUNC(acia6850_device::write_rxd)); + m_terminal->cts_handler().set(m_acia1, FUNC(acia6850_device::write_cts)); + m_terminal->dcd_handler().set(m_acia1, FUNC(acia6850_device::write_dcd)); + m_acia1->txd_handler().set(m_terminal, FUNC(rs232_port_device::write_txd)); + m_acia1->rts_handler().set(m_terminal, FUNC(rs232_port_device::write_rts)); + + // Set up host RS-232. + + RS232_PORT(config, m_host, default_rs232_devices, nullptr); + m_host->rxd_handler().set(m_acia2, FUNC(acia6850_device::write_rxd)); + m_host->cts_handler().set(m_acia2, FUNC(acia6850_device::write_cts)); + m_host->dcd_handler().set(m_acia2, FUNC(acia6850_device::write_dcd)); + m_acia2->txd_handler().set(m_host, FUNC(rs232_port_device::write_txd)); + m_acia2->rts_handler().set(m_host, FUNC(rs232_port_device::write_rts)); +} + +void mex68kecb_state::mem_map(address_map &map) +{ + map.unmap_value_high(); + + map(0x000000, 0x007fff).ram().share("ram"); // 32KB RAM + map(0x008000, 0x00bfff).rom().region("roms", 0); // 16KB ROM + map(0x010000, 0x01003f).rw(m_pit, FUNC(pit68230_device::read), FUNC(pit68230_device::write)).umask16(0x00ff); + map(0x010040, 0x010043).rw(m_acia1, FUNC(acia6850_device::read), FUNC(acia6850_device::write)).umask16(0xff00); + map(0x010040, 0x010043).rw(m_acia2, FUNC(acia6850_device::read), FUNC(acia6850_device::write)).umask16(0x00ff); + + map(0x000000, 0x000007).view(m_bootvect); + m_bootvect[0](0x000000, 0x000007).rom().region("roms", 0); // After first write we act as RAM + m_bootvect[0](0x000000, 0x000007).w(FUNC(mex68kecb_state::bootvect_w)); // ROM mirror just during reset +} + +void mex68kecb_state::machine_reset() +{ + // Reset BRG. + m_brg->rsa_w(CLEAR_LINE); + m_brg->rsb_w(ASSERT_LINE); + + // Reset pointer to bootvector in ROM for bootvector view + m_bootvect.select(0); +} + +template +void mex68kecb_state::write_acia_clock(int state) +{ + if (BIT(m_acia1_baud->read(), Bit)) { + m_acia1->write_txc(state); + m_acia1->write_rxc(state); + } + + if (BIT(m_acia2_baud->read(), Bit)) { + m_acia2->write_txc(state); + m_acia2->write_rxc(state); + } +} + +// Abort button handler +INPUT_CHANGED_MEMBER(mex68kecb_state::abort_button) +{ + m_maincpu->set_input_line(M68K_IRQ_7, newval ? CLEAR_LINE : ASSERT_LINE); // active low +} + +// Boot vector handler, the PCB hardwires the first 8 bytes from 0x008000 to 0x0 at reset. +void mex68kecb_state::bootvect_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_sysram[offset]); + m_bootvect.disable(); // redirect all upcoming accesses to masking RAM until reset. +} + + +/* ROM definition */ +ROM_START( mex68kecb ) + ROM_REGION16_BE(0x4000, "roms", ROMREGION_ERASE00) + ROM_DEFAULT_BIOS("tutor13") + + ROM_SYSTEM_BIOS(0, "tutor13", "Motorola TUTOR 1.3") + ROMX_LOAD("tutor13u.bin", 0x000000, 0x002000, CRC(7d11a0e9) SHA1(18ec8899651e78301b406f4fe6d4141c853e9e30), ROM_SKIP(1) | ROM_BIOS(0) ) + ROMX_LOAD("tutor13l.bin", 0x000001, 0x002000, CRC(2bb3a4e2) SHA1(3dac64ec5af4f46a367959ec80677103e3822f20), ROM_SKIP(1) | ROM_BIOS(0) ) +ROM_END + +} // anonymous namespace + + +// Driver +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1981, mex68kecb, 0, 0, mex68kecb, mex68kecb, mex68kecb_state, empty_init, "Motorola", "Motorola 68K ECB", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/msx/big10.cpp b/src/mame/msx/big10.cpp index afedf20b55521..1cad47601fc0c 100644 --- a/src/mame/msx/big10.cpp +++ b/src/mame/msx/big10.cpp @@ -50,16 +50,14 @@ ***************************************************************************/ - -#define MASTER_CLOCK XTAL(21'477'272) // Dumper notes poorly refers to a 21.?727 Xtal. - - #include "emu.h" + #include "cpu/z80/z80.h" #include "sound/ay8910.h" #include "video/v9938.h" #include "machine/nvram.h" #include "machine/ticket.h" + #include "screen.h" #include "speaker.h" @@ -97,10 +95,6 @@ class big10_state : public driver_device }; -#define HOPPER_PULSE 40 // time between hopper pulses in milliseconds -#define VDP_MEM 0x40000 - - /**************************************** * Input Ports Demux & Common Routines * ****************************************/ @@ -108,7 +102,7 @@ class big10_state : public driver_device void big10_state::mux_w(uint8_t data) { m_mux_data = ~data; - m_hopper->motor_w(BIT(data, 6)); + m_hopper->motor_w(BIT(~data, 6)); m_lamp = BIT(~data, 7); // maybe a coin counter? } @@ -232,6 +226,8 @@ INPUT_PORTS_END void big10_state::big10(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 21.477272_MHz_XTAL; // Dumper notes poorly refers to a 21.?727 Xtal. + // basic machine hardware Z80(config, m_maincpu, MASTER_CLOCK/6); // guess m_maincpu->set_addrmap(AS_PROGRAM, &big10_state::main_map); @@ -239,12 +235,12 @@ void big10_state::big10(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(40)); // video hardware v9938_device &v9938(V9938(config, "v9938", MASTER_CLOCK)); v9938.set_screen_ntsc("screen"); - v9938.set_vram_size(VDP_MEM); + v9938.set_vram_size(0x40000); v9938.int_cb().set_inputline("maincpu", 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); diff --git a/src/mame/msx/msx.cpp b/src/mame/msx/msx.cpp index 48db4cac1df05..7b2113e55d996 100644 --- a/src/mame/msx/msx.cpp +++ b/src/mame/msx/msx.cpp @@ -730,11 +730,16 @@ void msx2p_base_state::machine_start() { msx2_base_state::machine_start(); - m_boot_flags = m_cold_boot_flags; save_item(NAME(m_boot_flags)); save_item(NAME(m_vdp_mode)); } +void msx2p_base_state::machine_reset() +{ + msx2_base_state::machine_reset(); + m_boot_flags = m_cold_boot_flags; +} + void msx2p_base_state::msx2plus_io_map(address_map &map) { msx2_v9958_io_map(map); diff --git a/src/mame/msx/msx.h b/src/mame/msx/msx.h index ac95bb041a9a7..1f4f22cde002a 100644 --- a/src/mame/msx/msx.h +++ b/src/mame/msx/msx.h @@ -351,6 +351,7 @@ class msx2p_base_state : public msx2_base_state void set_cold_boot_flags(u8 cold_boot_flags) { m_cold_boot_flags = cold_boot_flags; } virtual void machine_start() override; + virtual void machine_reset() override; void msx2plus_base(ay8910_type ay8910_type, machine_config &config, const internal_layout &layout); void msx2plus_pal_base(ay8910_type ay8910_type, machine_config &config, const internal_layout &layout); diff --git a/src/mame/msx/msx2p.cpp b/src/mame/msx/msx2p.cpp index 7cf6cf8cbd062..6458918768b71 100644 --- a/src/mame/msx/msx2p.cpp +++ b/src/mame/msx/msx2p.cpp @@ -53,9 +53,6 @@ class msx2p_state : public msx2p_base_state void phc35j(machine_config &config); void hbf1xdj(machine_config &config); void hbf1xv(machine_config &config); - - void fsa1gt(machine_config &config); - void fsa1st(machine_config &config); }; /******************************** MSX 2+ **********************************/ @@ -638,94 +635,6 @@ void msx2p_state::hbf1xv(machine_config &config) msx2plus(SND_YM2149, config, layout_msx_jp_1fdd); } -/* MSX Turbo-R - Panasonic FS-A1GT */ - -ROM_START(fsa1gt) - ROM_REGION(0x46c000, "maincpu", 0) - ROM_LOAD("a1gtbios.rom", 0x0000, 0x8000, CRC(937c8dbb) SHA1(242e73d8284a012b275c0a266844ebbc4269d787)) - ROM_LOAD("a1gtext.rom", 0x8000, 0x4000, CRC(70aea0fe) SHA1(018d7a5222f28514908fb1b1513286a6558a6d05)) - ROM_LOAD("a1gtdos.rom", 0xc000, 0x10000, CRC(bb2a0eae) SHA1(4880bf34f1c86fff5456ec2b4cf70d02339e2caa)) - ROM_LOAD("a1gtkdr.rom", 0x1c000, 0x8000, CRC(eaf0d125) SHA1(5b39c1ccd3a213b78e02927f56a9abc72cd8c28d)) - ROM_LOAD("a1gtmus.rom", 0x24000, 0x4000, CRC(f5f93437) SHA1(6aea1aef5ec31c1826c22edf580525f93baad425)) - ROM_LOAD("a1gtopt.rom", 0x28000, 0x4000, CRC(50d11f60) SHA1(b4433a3975c57dd440d6bf12dbd28b2ac1b90ef4)) - ROM_LOAD("a1gtkfn.rom", 0x2c000, 0x40000, CRC(1f6406fb) SHA1(5aff2d9b6efc723bc395b0f96f0adfa83cc54a49)) - ROM_LOAD("a1gtfirm.rom", 0x6c000, 0x400000, CRC(feefeadc) SHA1(e779c338eb91a7dea3ff75f3fde76b8af22c4a3a)) -ROM_END - -void msx2p_state::fsa1gt(machine_config &config) -{ - // AY8910 (in T9769) - // FDC: tc8566af, 1 3.5" DSDD drive - // 2 Cartridge slots - // T9769C + S1990 - // FM built-in - // Microphone - // MIDI-in - // MIDI-out - // firmware switch - // pause button - // ren-sha turbo slider - - add_internal_slot(config, MSX_SLOT_ROM, "bios", 0, 0, 0, 2, "maincpu"); - add_internal_slot(config, MSX_SLOT_MUSIC, "mus", 0, 2, 1, 1, "maincpu", 0x24000).set_ym2413_tag(m_ym2413); - add_internal_slot(config, MSX_SLOT_ROM, "opt", 0, 3, 1, 1, "maincpu", 0x28000); - add_cartridge_slot<1>(config, 1); - add_cartridge_slot<2>(config, 2); - add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 0, 0, 4).set_total_size(0x20000); // 128KB?? Mapper RAM - add_internal_slot(config, MSX_SLOT_ROM, "ext", 3, 1, 0, 1, "maincpu", 0x8000); - add_internal_slot(config, MSX_SLOT_ROM, "kdr", 3, 1, 1, 2, "maincpu", 0x1c000); - add_internal_disk(config, MSX_SLOT_DISK4_TC8566, "dos", 3, 2, 1, 3, "maincpu", 0xc000); - add_internal_slot(config, MSX_SLOT_ROM, "firm", 3, 3, 0, 4, "maincpu", 0x6c000); - MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00); - - msx_ym2413(config); - - turbor(SND_AY8910, config, layout_msx_jp_1fdd); -} - -/* MSX Turbo-R - Panasonic FS-A1ST */ - -ROM_START(fsa1st) - ROM_REGION(0x46c000, "maincpu", 0) - ROM_LOAD("a1stbios.rom", 0x0000, 0x8000, CRC(77b94ae0) SHA1(f078b5ec56884bfb81481d45c7151418770bff5a)) - ROM_LOAD("a1stext.rom", 0x8000, 0x4000, CRC(2c2c77a4) SHA1(373412f9c32762de1c3a7e27fc3d80614e0a0c8e)) - ROM_LOAD("a1stdos.rom", 0xc000, 0x10000, CRC(1fc71407) SHA1(5d2186658adcf4ce0c2d3232384b5712341108e5)) - ROM_LOAD("a1stkdr.rom", 0x1c000, 0x8000, CRC(eaf0d125) SHA1(5b39c1ccd3a213b78e02927f56a9abc72cd8c28d)) - ROM_LOAD("a1stmus.rom", 0x24000, 0x4000, CRC(fd7dec41) SHA1(e002a9b426732e6c2d31e548c40cf7c122348ce3)) - ROM_LOAD("a1stopt.rom", 0x28000, 0x4000, CRC(c6a4a2a1) SHA1(cb06dea7b025745f9d2b87dcf03ded615287ead3)) - ROM_LOAD("a1stkfn.rom", 0x2c000, 0x40000, CRC(1f6406fb) SHA1(5aff2d9b6efc723bc395b0f96f0adfa83cc54a49)) - ROM_LOAD("a1stfirm.rom", 0x6c000, 0x400000, CRC(139ac99c) SHA1(c212b11fda13f83dafed688c54d098e7e47ab225)) -ROM_END - -void msx2p_state::fsa1st(machine_config &config) -{ - // AY8910 (in T9769) - // FDC: tc8566af, 1 3.5" DSDD drive - // T9769C + S1990 - // 2 Cartridge slots - // FM built-in - // microphone - // firmware switch - // pause button - // ren-sha turbo slider - - add_internal_slot(config, MSX_SLOT_ROM, "bios", 0, 0, 0, 2, "maincpu"); - add_internal_slot(config, MSX_SLOT_MUSIC, "mus", 0, 2, 1, 1, "maincpu", 0x24000).set_ym2413_tag(m_ym2413); - add_internal_slot(config, MSX_SLOT_ROM, "opt", 0, 3, 1, 1, "maincpu", 0x28000); - add_cartridge_slot<1>(config, 1); - add_cartridge_slot<2>(config, 2); - add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 0, 0, 4).set_total_size(0x20000); // 128KB?? Mapper RAM - add_internal_slot(config, MSX_SLOT_ROM, "ext", 3, 1, 0, 1, "maincpu", 0x8000); - add_internal_slot(config, MSX_SLOT_ROM, "kdr", 3, 1, 1, 2, "maincpu", 0x1c000); - add_internal_disk(config, MSX_SLOT_DISK4_TC8566, "dos", 3, 2, 1, 3, "maincpu", 0xc000); - add_internal_slot(config, MSX_SLOT_ROM, "firm", 3, 3, 0, 4, "maincpu", 0x6c000); - MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00); - - msx_ym2413(config); - - turbor(SND_AY8910, config, layout_msx_jp_1fdd); -} - } // anonymous namespace COMP(19??, expert3i, 0, 0, expert3i, msx2, msx2p_state, empty_init, "Ciel", "Expert 3 IDE (MSX2+, Brazil)", MACHINE_NOT_WORKING) // Some hardware not emulated @@ -741,8 +650,3 @@ COMP(1989, phc70fd2, 0, 0, phc70fd2, msx2jp, msx2p_state, empty COMP(1989, phc35j, 0, 0, phc35j, msx2jp, msx2p_state, empty_init, "Sanyo", "PHC-35J / Wavy35 (MSX2+, Japan)", 0) COMP(1988, hbf1xdj, 0, 0, hbf1xdj, msx2jp, msx2p_state, empty_init, "Sony", "HB-F1XDJ (MSX2+, Japan)", 0) COMP(1989, hbf1xv, 0, 0, hbf1xv, msx2jp, msx2p_state, empty_init, "Sony", "HB-F1XV (MSX2+, Japan)", 0) - -/* MSX Turbo-R */ -/* Temporary placeholders, Turbo-R hardware is not supported yet */ -COMP(1991, fsa1gt, 0, 0, fsa1gt, msx2jp, msx2p_state, empty_init, "Panasonic", "FS-A1GT (MSX Turbo-R, Japan)", MACHINE_NOT_WORKING) -COMP(1991, fsa1st, 0, 0, fsa1st, msx2jp, msx2p_state, empty_init, "Panasonic", "FS-A1ST (MSX Turbo-R, Japan)", MACHINE_NOT_WORKING) diff --git a/src/mame/msx/msx_s1990.cpp b/src/mame/msx/msx_s1990.cpp new file mode 100644 index 0000000000000..abc443cdf3366 --- /dev/null +++ b/src/mame/msx/msx_s1990.cpp @@ -0,0 +1,268 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#include "emu.h" +#include "msx_s1990.h" + + +#define LOG_CPU (1U << 1) +#define LOG_PCM (1U << 2) +//#define VERBOSE (LOG_CPU | LOG_PCM) +#include "logmacro.h" + +/*************************************************************************** + + ASCII S1990 MSX-Engine + +TODO: +- Injection of wait states when accessing VDP when Z80 is active. +- Injection of wait states when accessing VDP when R800 is active. +- Injection of wait state to align 7MHz R800 bus with 3.5MHz MSX bus. +- Unknown what the other internal registers do + +Internal registers: +- 0x00 +- 0x01 +- 0x02 +- 0x03 +- 0x04 +- 0x05 - Read only? + Read + 7------- Unknown + -6------ 1 - Firmware enabled + --543210 Unknown +- 0x06 - R/W - CPU Control + Write + 76------ Unknown + --5----- 0 - R800 active, 1 - Z80 active + ---43210 Unknown +- 0x07 +- 0x08 +- 0x09 +- 0x0a +- 0x0b +- 0x0c +- 0x0d +- 0x0e - Byte before last byte written - read only? +- 0x0f - Last byte written - read only? + +***************************************************************************/ + + +DEFINE_DEVICE_TYPE(MSX_S1990, msx_s1990_device, "msx_s1990", "MSX-Engine S1990") + + +msx_s1990_device::msx_s1990_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_S1990, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) + , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) + , m_firmware_switch_cb(*this, 0) + , m_pause_led_cb(*this) + , m_r800_led_cb(*this) + , m_dac_write_cb(*this) + , m_sample_hold_cb(*this) + , m_select_cb(*this) + , m_filter_cb(*this) + , m_muting_cb(*this) + , m_comp_cb(*this, 0) + , m_z80(*this, finder_base::DUMMY_TAG) + , m_r800(*this, finder_base::DUMMY_TAG) + , m_reg_index(0) + , m_last_counter_reset(attotime::zero) + , m_last_pcm_write_ticks(0) + , m_pcm_control(0) + , m_pcm_data(0x80) + , m_dac_timer(nullptr) + , m_z80_halt_enabled(false) +{ +} + + +device_memory_interface::space_config_vector msx_s1990_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_IO, &m_io_config) + }; +} + + +void msx_s1990_device::device_start() +{ + space(AS_PROGRAM).specific(m_data); + space(AS_IO).specific(m_io); + + save_item(NAME(m_regs)); + save_item(NAME(m_reg_index)); + save_item(NAME(m_last_counter_reset)); + save_item(NAME(m_last_pcm_write_ticks)); + save_item(NAME(m_pcm_control)); + save_item(NAME(m_pcm_data)); + + m_dac_timer = timer_alloc(FUNC(msx_s1990_device::dac_write), this); +} + + +void msx_s1990_device::device_reset() +{ + m_regs[6] = 0x20; // Z80 active + m_last_counter_reset = attotime::zero; + m_last_pcm_write_ticks = 0; + m_z80->resume(SUSPEND_REASON_HALT); + m_r800->suspend(SUSPEND_REASON_HALT, true); +} + + +INPUT_CHANGED_MEMBER(msx_s1990_device::pause_callback) +{ + if (m_z80_halt_enabled && BIT(m_regs[0x06], 5)) + m_z80->set_input_line(Z80_INPUT_LINE_WAIT, BIT(newval, 0) ? ASSERT_LINE : CLEAR_LINE); +} + + +void msx_s1990_device::pause_w(u8 data) +{ + m_pause_led_cb(BIT(data, 0)); + m_z80_halt_enabled = BIT(data, 1); + m_r800_led_cb(BIT(data, 7)); +} + + +void msx_s1990_device::reg_index_write(u8 data) +{ + m_reg_index = data; +} + + +u8 msx_s1990_device::regs_read() +{ + if ((m_reg_index & 0x0f) == 0x05) + return (m_firmware_switch_cb()) ? 0x40 : 0x00; + return m_regs[m_reg_index & 0x0f]; +} + + +void msx_s1990_device::regs_write(u8 data) +{ + if ((m_reg_index & 0x0f) == 0x06) + { + if (BIT(data, 5)) + { + LOGMASKED(LOG_CPU, "Enable Z80, disable R800\n"); + m_z80->resume(SUSPEND_REASON_HALT); + m_r800->suspend(SUSPEND_REASON_HALT, true); + } + else + { + LOGMASKED(LOG_CPU, "Disable Z80, enable R800\n"); + m_z80->suspend(SUSPEND_REASON_HALT, true); + m_r800->resume(SUSPEND_REASON_HALT); + } + } + + m_regs[m_reg_index & 0x0f] = data; +} + + +void msx_s1990_device::mem_write(offs_t offset, u8 data) +{ + // TODO Clock syncing when in R800 mode + m_regs[0x0e] = m_regs[0x0f]; + m_regs[0x0f] = data; + m_data.write_byte(offset, data); +} + + +u8 msx_s1990_device::mem_read(offs_t offset) +{ + // TODO Clock syncing when in R800 mode + return m_data.read_byte(offset); +} + + +void msx_s1990_device::io_write(offs_t offset, u8 data) +{ + // TODO Clock syncing/extra wait cycles + // TODO Injection of wait states when accessing VDP + m_io.write_byte(offset, data); +} + + +u8 msx_s1990_device::io_read(offs_t offset) +{ + // TODO Clock syncing/extra wait cycles + return m_io.read_byte(offset); +} + + +void msx_s1990_device::counter_write(u8 data) +{ + // TODO: Round to last counter tick? + m_last_counter_reset = machine().time(); +} + + +u8 msx_s1990_device::counter_read(offs_t offset) +{ + u64 counter = attotime_to_clocks(machine().time() - m_last_counter_reset) / 28; + return (counter >> (8 * BIT(offset, 0))) & 0xff; +} + + +TIMER_CALLBACK_MEMBER(msx_s1990_device::dac_write) +{ + m_dac_write_cb(m_pcm_data); +} + + +void msx_s1990_device::pmdac(u8 data) +{ + m_pcm_data = data; + if (!BIT(m_pcm_control, 1)) + { + // Round to last counter tick and schedule next dac write? + m_last_pcm_write_ticks = machine().time().as_ticks(PCM_FREQUENCY); + m_dac_timer->adjust(attotime::from_ticks(m_last_pcm_write_ticks + 1, PCM_FREQUENCY)); + } +} + + +u8 msx_s1990_device::pmcnt() +{ + return (machine().time().as_ticks(PCM_FREQUENCY) - m_last_pcm_write_ticks) & 0x03; +} + + +void msx_s1990_device::pmcntl(u8 data) +{ + // 7------- 0 + // -6------ 0 + // --5----- 0 + // ---4---- SMPL + // ----3--- SEL + // -----2-- FILT + // ------1- MUTE + // -------0 ADDA ?? + + LOGMASKED(LOG_PCM, "pmcntl: %02x\n", data); + m_pcm_control = data & 0x1f; + m_sample_hold_cb(BIT(m_pcm_control, 4)); + m_select_cb(BIT(m_pcm_control, 3)); + m_filter_cb(BIT(m_pcm_control, 2)); + m_muting_cb(BIT(m_pcm_control, 1)); +} + + +u8 msx_s1990_device::pmstat() +{ + // 7------- COMP + // -6------ 0 + // --5----- 0 + // ---4---- SMPL + // ----3--- SEL + // -----2-- FILT + // ------1- MUTE + // -------0 BUFF ?? + + return (m_pcm_control & 0x1f) | (m_comp_cb() ? 0x80 : 0x00); +} diff --git a/src/mame/msx/msx_s1990.h b/src/mame/msx/msx_s1990.h new file mode 100644 index 0000000000000..3a8c7587d3533 --- /dev/null +++ b/src/mame/msx/msx_s1990.h @@ -0,0 +1,93 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_MSX_MSX_S1990_H +#define MAME_MSX_MSX_S1990_H + +#pragma once + +#include "cpu/z80/r800.h" +#include "cpu/z80/z80.h" + +DECLARE_DEVICE_TYPE(MSX_S1990, msx_s1990_device) + +class msx_s1990_device : public device_t, + public device_memory_interface +{ +public: + msx_s1990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type imperfect_features() { return feature::TIMING; } + + // configuration + template void set_z80_tag(T &&tag) { m_z80.set_tag(std::forward(tag)); } + template void set_r800_tag(T &&tag) { m_r800.set_tag(std::forward(tag)); } + auto firmware_switch_callback() { return m_firmware_switch_cb.bind(); } + auto pause_led_callback() { return m_pause_led_cb.bind(); } + auto r800_led_callback() { return m_r800_led_cb.bind(); } + auto dac_write_callback() { return m_dac_write_cb.bind(); } + auto sample_hold_callback() { return m_sample_hold_cb.bind(); } + auto select_callback() { return m_select_cb.bind(); } + auto filter_callback() { return m_filter_cb.bind(); } + auto muting_callback() { return m_muting_cb.bind(); } + auto comp_callback() { return m_comp_cb.bind(); } + + void pause_w(u8 data); + + void reg_index_write(u8 data); + u8 regs_read(); + void regs_write(u8 data); + + void mem_write(offs_t offset, u8 data); + u8 mem_read(offs_t offset); + void io_write(offs_t offset, u8 data); + u8 io_read(offs_t offset); + + void counter_write(u8 data); + u8 counter_read(offs_t offset); + + void pmdac(u8 data); + u8 pmcnt(); + void pmcntl(u8 data); + u8 pmstat(); + + DECLARE_INPUT_CHANGED_MEMBER(pause_callback); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + // device_memory_interface implementation + virtual space_config_vector memory_space_config() const override; + virtual u32 translate_memory_address(u16 address) { return address; } + +private: + TIMER_CALLBACK_MEMBER(dac_write); + + static constexpr u32 PCM_FREQUENCY = 15750; + const address_space_config m_program_config; + const address_space_config m_io_config; + memory_access<16, 0, 0, ENDIANNESS_LITTLE>::specific m_data; + memory_access<16, 0, 0, ENDIANNESS_LITTLE>::specific m_io; + devcb_read_line m_firmware_switch_cb; + devcb_write_line m_pause_led_cb; + devcb_write_line m_r800_led_cb; + devcb_write8 m_dac_write_cb; + devcb_write_line m_sample_hold_cb; + devcb_write_line m_select_cb; + devcb_write_line m_filter_cb; + devcb_write_line m_muting_cb; + devcb_read_line m_comp_cb; + required_device m_z80; + required_device m_r800; + + u8 m_regs[16]; + u8 m_reg_index; + attotime m_last_counter_reset; + u64 m_last_pcm_write_ticks; + u8 m_pcm_control; + u8 m_pcm_data; + emu_timer *m_dac_timer; + bool m_z80_halt_enabled; +}; + +#endif // MAME_MSX_MSX_S1990_H diff --git a/src/mame/msx/msxtr.cpp b/src/mame/msx/msxtr.cpp new file mode 100644 index 0000000000000..eb684081dbb91 --- /dev/null +++ b/src/mame/msx/msxtr.cpp @@ -0,0 +1,463 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol + +#include "emu.h" +#include "msx.h" +#include "msx_keyboard.h" +#include "msx_s1990.h" +#include "msx_systemflags.h" +#include "bus/midi/midi.h" +#include "bus/msx/slot/disk.h" +#include "bus/msx/slot/music.h" +#include "bus/msx/slot/panasonic08r.h" +#include "bus/msx/slot/ram_mm.h" +#include "bus/msx/slot/rom.h" +#include "machine/i8251.h" +#include "machine/pit8253.h" +#include "softlist_dev.h" + +#include "msx_turbor.lh" + +using namespace msx_keyboard; + + +/*************************************************************************** + + MSX Turbo-R machine drivers + +The R800 and Z80 see exactly the same memory layouts, only one of the two CPUs +is active at any one time. The S1990 controls which CPU is active and can inject +wait states depending on which cpu is active. + +TODO: +- sfg extensions may not work due to irq callbacks being registered with the Z80 only. +- v9958 commands seem to execute too fast. Several software items hang because of this. +- verify midi interface operation on fsa1gt. +- Implement DAC/PCM related hardware/filter and hook it up to the S1990. +- Microphone input. + +***************************************************************************/ + +namespace { + +class msxtr_state : public msx2p_base_state +{ +public: + msxtr_state(const machine_config &mconfig, device_type type, const char *tag) + : msx2p_base_state(mconfig, type, tag, 21.477272_MHz_XTAL, 6) + , m_r800(*this, "r800") + , m_s1990(*this, "s1990") + , m_pause_switch(*this, "PAUSE") + , m_firmware_switch(*this, "FIRMWARE") + , m_pause_led(*this, "pause_led") + , m_r800_led(*this, "r800_led") + , m_pcmdac(*this, "pcmdac") + { + } + + void fsa1st(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void turbor(ay8910_type ay8910_type, machine_config &config, const internal_layout &layout); + void turbor_add_softlists(machine_config &config); + void s1990_mem_map(address_map &map); + void s1990_io_map(address_map &map); + void cpu_mem_map(address_map &map); + void cpu_io_map(address_map &map); + + virtual void setup_slot_spaces(msx_internal_slot_interface &device) override; + virtual address_space& get_io_space() override; + + void pause_led_w(int state); + void r800_led_w(int state); + void pcm_dac_w(u8 data); + void pcm_sample_hold_w(int state); + void pcm_select_w(int state); + void pcm_filter_w(int state); + void muting_w(int state); + int pcm_comp_r(); + + required_device m_r800; + required_device m_s1990; + required_ioport m_pause_switch; + required_ioport m_firmware_switch; + output_finder<> m_pause_led; + output_finder<> m_r800_led; + required_device m_pcmdac; + u8 m_pcm_last_sample; + u8 m_pcm_held_sample; + u8 m_pcm_sample_hold; +}; + +class fsa1gt_state : public msxtr_state +{ +public: + fsa1gt_state(const machine_config &mconfig, device_type type, const char *tag) + : msxtr_state(mconfig, type, tag) + , m_i8251(*this, "i8251") + , m_i8254(*this, "i8254") + , m_midiin(*this, "midiin_port") + , m_midiout(*this, "midiout_port") + , m_dtr(false) + , m_rts(false) + , m_rxrdy(false) + , m_timer2_ff(false) + { + } + + void fsa1gt(machine_config &config); + +private: + required_device m_i8251; + required_device m_i8254; + required_device m_midiin; + required_device m_midiout; + bool m_dtr; + bool m_rts; + bool m_rxrdy; + bool m_timer2_ff; + + void s1990_io_map(address_map &map); + void dtr_w(int state); + void rts_w(int state); + void rxrdy_w(int state); + void timer0_w(int state); + void timer2_w(int state); + void update_midi_int_state(); + void clear_timer2_ff(u8 data); +}; + + +address_space& msxtr_state::get_io_space() +{ + return m_s1990->space(AS_IO); +} + +void msxtr_state::setup_slot_spaces(msx_internal_slot_interface &device) +{ + device.set_memory_space(m_s1990, AS_PROGRAM); + device.set_io_space(m_s1990, AS_IO); + // TODO: This is used for signalling irq vectors. But that should go to the currently active cpu not just the z80. + device.set_maincpu(m_maincpu); +} + +void msxtr_state::machine_start() +{ + msx2p_base_state::machine_start(); + m_pause_led.resolve(); + m_r800_led.resolve(); + + save_item(NAME(m_pcm_last_sample)); + save_item(NAME(m_pcm_held_sample)); + save_item(NAME(m_pcm_sample_hold)); +} + +void msxtr_state::machine_reset() +{ + msx2p_base_state::machine_reset(); + m_pause_led = 0; + m_r800_led = 0; +} + +void msxtr_state::s1990_mem_map(address_map &map) +{ + memory_map(map); +} + +void msxtr_state::s1990_io_map(address_map &map) +{ + msx2plus_io_map(map); + map(0xa4, 0xa4).rw(m_s1990, FUNC(msx_s1990_device::pmcnt), FUNC(msx_s1990_device::pmdac)); + map(0xa5, 0xa5).rw(m_s1990, FUNC(msx_s1990_device::pmstat), FUNC(msx_s1990_device::pmcntl)); + map(0xa7, 0xa7).portr(m_pause_switch.finder_tag()); + map(0xa7, 0xa7).w(m_s1990, FUNC(msx_s1990_device::pause_w)); + map(0xe4, 0xe4).w(m_s1990, FUNC(msx_s1990_device::reg_index_write)); + map(0xe5, 0xe5).rw(m_s1990, FUNC(msx_s1990_device::regs_read), FUNC(msx_s1990_device::regs_write)); + map(0xe6, 0xe6).w(m_s1990, FUNC(msx_s1990_device::counter_write)); + map(0xe6, 0xe7).r(m_s1990, FUNC(msx_s1990_device::counter_read)); +} + +void msxtr_state::cpu_mem_map(address_map &map) +{ + map(0x0000, 0xffff).rw(m_s1990, FUNC(msx_s1990_device::mem_read), FUNC(msx_s1990_device::mem_write)); +} + +void msxtr_state::cpu_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0xff).rw(m_s1990, FUNC(msx_s1990_device::io_read), FUNC(msx_s1990_device::io_write)); +} + +void msxtr_state::pause_led_w(int state) +{ + m_pause_led = state; +} + +void msxtr_state::r800_led_w(int state) +{ + m_r800_led = state; +} + +void msxtr_state::turbor(ay8910_type ay8910_type, machine_config &config, const internal_layout &layout) +{ + msx2plus_base(ay8910_type, config, layout); + + m_maincpu->set_addrmap(AS_PROGRAM, &msxtr_state::cpu_mem_map); + m_maincpu->set_addrmap(AS_IO, &msxtr_state::cpu_io_map); + + R800(config, m_r800, 28.636363_MHz_XTAL); + m_r800->set_addrmap(AS_PROGRAM, &msxtr_state::cpu_mem_map); + m_r800->set_addrmap(AS_IO, &msxtr_state::cpu_io_map); + + MSX_S1990(config, m_s1990, 28.636363_MHz_XTAL / 4); + m_s1990->set_addrmap(AS_PROGRAM, &msxtr_state::s1990_mem_map); + m_s1990->set_addrmap(AS_IO, &msxtr_state::s1990_io_map); + m_s1990->set_z80_tag(m_maincpu); + m_s1990->set_r800_tag(m_r800); + m_s1990->pause_led_callback().set(FUNC(msxtr_state::pause_led_w)); + m_s1990->r800_led_callback().set(FUNC(msxtr_state::r800_led_w)); + m_s1990->firmware_switch_callback().set_ioport(m_firmware_switch); + m_s1990->dac_write_callback().set(FUNC(msxtr_state::pcm_dac_w)); + m_s1990->sample_hold_callback().set(FUNC(msxtr_state::pcm_sample_hold_w)); + m_s1990->select_callback().set(FUNC(msxtr_state::pcm_select_w)); + m_s1990->filter_callback().set(FUNC(msxtr_state::pcm_filter_w)); + m_s1990->muting_callback().set(FUNC(msxtr_state::muting_w)); + m_s1990->comp_callback().set(FUNC(msxtr_state::pcm_comp_r)); + + // TODO: Do IRQ requests go to both cpus (only to be ignored by the inactive cpu) or only to the currently active cpu? + m_mainirq->output_handler().append_inputline(m_r800, INPUT_LINE_IRQ0); + + DAC_8BIT_R2R(config, m_pcmdac).add_route(ALL_OUTPUTS, m_speaker, 1.0); // Unknown DAC type + + // Software lists + turbor_add_softlists(config); +} + +void msxtr_state::pcm_dac_w(u8 data) +{ + m_pcmdac->write(data); + m_pcm_last_sample = data; +} + +void msxtr_state::pcm_sample_hold_w(int state) +{ + if (!m_pcm_sample_hold && state) + m_pcm_held_sample = m_pcm_last_sample; + m_pcm_sample_hold = state; +} + +void msxtr_state::pcm_select_w(int state) +{ + // TODO pcm select +} + +void msxtr_state::pcm_filter_w(int state) +{ + // TODO enable pcm filter +} + +int msxtr_state::pcm_comp_r() +{ + // TODO pcm output compare + return 0; +} + +void msxtr_state::muting_w(int state) +{ + // TODO mute all sound +} + +void msxtr_state::turbor_add_softlists(machine_config &config) +{ + if (m_hw_def.has_cartslot()) + { + SOFTWARE_LIST(config, "cart_list").set_original("msxr_cart"); + SOFTWARE_LIST(config, "msx2p_cart_list").set_compatible("msx2p_cart"); + SOFTWARE_LIST(config, "msx2_cart_list").set_compatible("msx2_cart"); + SOFTWARE_LIST(config, "msx1_cart_list").set_compatible("msx1_cart"); + } + + if (m_hw_def.has_fdc()) + { + SOFTWARE_LIST(config, "flop_list").set_original("msxr_flop"); + SOFTWARE_LIST(config, "msx2p_flop_list").set_compatible("msx2p_flop"); + SOFTWARE_LIST(config, "msx2_flop_list").set_compatible("msx2_flop"); + SOFTWARE_LIST(config, "msx1_flop_list").set_compatible("msx1_flop"); + } +} + +/* MSX Turbo-R - Panasonic FS-A1GT */ + +ROM_START(fsa1gt) + ROM_REGION(0x400000, "firmware", 0) + // This should be 2 1MB roms at locations IC20 and IC23. + ROM_LOAD("a1gtfirm.rom", 0, 0x400000, CRC(feefeadc) SHA1(e779c338eb91a7dea3ff75f3fde76b8af22c4a3a) BAD_DUMP) + + ROM_REGION(0x40000, "kanji", 0) + ROM_LOAD("a1gtkfn.rom", 0, 0x40000, CRC(1f6406fb) SHA1(5aff2d9b6efc723bc395b0f96f0adfa83cc54a49)) +ROM_END + +void fsa1gt_state::s1990_io_map(address_map &map) +{ + msxtr_state::s1990_io_map(map); + map(0xe8, 0xe9).rw(m_i8251, FUNC(i8251_device::read), FUNC(i8251_device::write)); + map(0xea, 0xea).w(FUNC(fsa1gt_state::clear_timer2_ff)); + map(0xec, 0xef).rw(m_i8254, FUNC(pit8254_device::read), FUNC(pit8254_device::write)); +} + +void fsa1gt_state::fsa1gt(machine_config &config) +{ + // AY8910 (in T9769) + // FDC: tc8566af, 1 3.5" DSDD drive + // 2 Cartridge slots + // T9769C + S1990 + // FM built-in + // Microphone + // MIDI-in + // MIDI-out + // firmware switch + // pause button + // ren-sha turbo slider + + add_internal_slot(config, MSX_SLOT_ROM, "bios", 0, 0, 0, 2, "firmware", 0x050000); + add_internal_slot(config, MSX_SLOT_MUSIC, "msxmusic", 0, 2, 1, 1, "firmware", 0x07c000).set_ym2413_tag(m_ym2413); + add_internal_slot(config, MSX_SLOT_ROM, "opt", 0, 3, 1, 1, "firmware", 0x048000); + add_cartridge_slot<1>(config, 1); + add_cartridge_slot<2>(config, 2); + add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 0, 0, 4).set_total_size(0x80000); // 512KB Mapper RAM + add_internal_slot(config, MSX_SLOT_ROM, "ext", 3, 1, 0, 1, "firmware", 0x070000); + add_internal_slot(config, MSX_SLOT_ROM, "kdr", 3, 1, 1, 2, "firmware", 0x074000); + add_internal_disk(config, MSX_SLOT_DISK4_TC8566, "dos", 3, 2, 1, 3, "firmware", 0x060000); + add_internal_slot(config, MSX_SLOT_PANASONIC08R, "firmware", 3, 3, 0, 4, "firmware").set_sram_size(0x8000).set_mm_tag("ram_mm"); + + MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00); + + msx_ym2413(config); + + m_hw_def.has_cassette(false); + turbor(SND_AY8910, config, layout_msx_turbor); + m_s1990->set_addrmap(AS_IO, &fsa1gt_state::s1990_io_map); + + I8251(config, m_i8251, 16_MHz_XTAL / 4); // Not sure about this + m_i8251->txd_handler().set(m_midiout, FUNC(midi_port_device::write_txd)); + m_i8251->dtr_handler().set(*this, FUNC(fsa1gt_state::dtr_w)); + m_i8251->rts_handler().set(*this, FUNC(fsa1gt_state::rts_w)); + m_i8251->rxrdy_handler().set(*this, FUNC(fsa1gt_state::rxrdy_w)); + + PIT8254(config, m_i8254); + m_i8254->set_clk<0>(16_MHz_XTAL / 4); + m_i8254->set_clk<2>(16_MHz_XTAL/ 4); + m_i8254->out_handler<0>().set(*this, FUNC(fsa1gt_state::timer0_w)); + m_i8254->out_handler<2>().set(*this, FUNC(fsa1gt_state::timer2_w)); + + MIDI_PORT(config, m_midiin, midiin_slot, "midiin").rxd_handler().set(m_i8251, FUNC(i8251_device::rx_w)); + MIDI_PORT(config, m_midiout, midiout_slot, "midiout"); +} + +void fsa1gt_state::rts_w(int state) +{ + m_rts = state; + update_midi_int_state(); +} + +void fsa1gt_state::rxrdy_w(int state) +{ + m_rxrdy = state; + update_midi_int_state(); +} + +void fsa1gt_state::dtr_w(int state) +{ + m_dtr = state; + update_midi_int_state(); +} + +void fsa1gt_state::timer0_w(int state) +{ + m_i8251->tx_clock_w(state); + m_i8251->rx_clock_w(state); +} + +void fsa1gt_state::timer2_w(int state) +{ + m_timer2_ff = m_timer2_ff | state; + m_i8254->write_clk1(state); + update_midi_int_state(); +} + +void fsa1gt_state::clear_timer2_ff(u8 data) +{ + m_timer2_ff = false; + update_midi_int_state(); +} + +void fsa1gt_state::update_midi_int_state() +{ + m_i8251->write_dsr(m_timer2_ff && m_dtr); + m_mainirq->in_w<3>(!((m_timer2_ff && m_dtr) || (m_rts && m_rxrdy))); +} + +/* MSX Turbo-R - Panasonic FS-A1ST */ + +ROM_START(fsa1st) + ROM_REGION(0x400000, "firmware", 0) + // This should be either 3 512KB roms or 1 1MB and 1 512KB rom (at IC12 and IC18?). Both variants are known to exist. + ROM_LOAD("a1stfirm.rom", 0, 0x400000, CRC(139ac99c) SHA1(c212b11fda13f83dafed688c54d098e7e47ab225) BAD_DUMP) + + ROM_REGION(0x40000, "kanji", 0) + ROM_LOAD("a1stkfn.rom", 0, 0x40000, CRC(1f6406fb) SHA1(5aff2d9b6efc723bc395b0f96f0adfa83cc54a49)) +ROM_END + +void msxtr_state::fsa1st(machine_config &config) +{ + // AY8910 (in T9769) + // FDC: tc8566af, 1 3.5" DSDD drive + // T9769C + S1990 + // 2 Cartridge slots + // FM built-in + // microphone + // firmware switch + // pause button + // ren-sha turbo slider + + add_internal_slot(config, MSX_SLOT_ROM, "bios", 0, 0, 0, 2, "firmware", 0x050000); + add_internal_slot(config, MSX_SLOT_MUSIC, "msxmusic", 0, 2, 1, 1, "firmware", 0x07c000).set_ym2413_tag(m_ym2413); + add_internal_slot(config, MSX_SLOT_ROM, "opt", 0, 3, 1, 1, "firmware", 0x048000); + add_cartridge_slot<1>(config, 1); + add_cartridge_slot<2>(config, 2); + add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 0, 0, 4).set_total_size(0x40000); // 256KB Mapper RAM + add_internal_slot(config, MSX_SLOT_ROM, "ext", 3, 1, 0, 1, "firmware", 0x070000); + add_internal_slot(config, MSX_SLOT_ROM, "kdr", 3, 1, 1, 2, "firmware", 0x074000); + add_internal_disk(config, MSX_SLOT_DISK4_TC8566, "dos", 3, 2, 1, 3, "firmware", 0x060000); + add_internal_slot(config, MSX_SLOT_PANASONIC08R, "firmware", 3, 3, 0, 4, "firmware").set_sram_size(0x4000).set_mm_tag("ram_mm"); + + MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00); + + msx_ym2413(config); + + m_hw_def.has_cassette(false); + turbor(SND_AY8910, config, layout_msx_turbor); +} + +INPUT_PORTS_START(msxtr) + PORT_INCLUDE(msx2jp) + + PORT_START("PAUSE") + PORT_CONFNAME(0x01, 0x00, "Pause") PORT_CHANGED_MEMBER("s1990", msx_s1990_device, pause_callback, 0) + PORT_CONFSETTING(0x00, "off") + PORT_CONFSETTING(0x01, "on") + + PORT_START("FIRMWARE") + PORT_CONFNAME(0x01, 0x01, "Firmware") + PORT_CONFSETTING(0x01, "enabled") + PORT_CONFSETTING(0x00, "disabled") +INPUT_PORTS_END + +} // anonymous namespace + +/* MSX Turbo-R */ +COMP(1991, fsa1gt, 0, 0, fsa1gt, msxtr, fsa1gt_state, empty_init, "Panasonic", "FS-A1GT (MSX Turbo-R, Japan)", MACHINE_NOT_WORKING) +COMP(1991, fsa1st, 0, 0, fsa1st, msxtr, msxtr_state, empty_init, "Panasonic", "FS-A1ST (MSX Turbo-R, Japan)", MACHINE_NOT_WORKING) diff --git a/src/mame/namco/baraduke.cpp b/src/mame/namco/baraduke.cpp index 815b33bdc2793..5057e8a3232d9 100644 --- a/src/mame/namco/baraduke.cpp +++ b/src/mame/namco/baraduke.cpp @@ -254,16 +254,12 @@ void baraduke_state::palette(palette_device &palette) const // convert from 32x32 to 36x28 TILEMAP_MAPPER_MEMBER(baraduke_state::tx_tilemap_scan) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(baraduke_state::tx_get_tile_info) diff --git a/src/mame/namco/cgang.cpp b/src/mame/namco/cgang.cpp index b5f4f070913c3..fc73e87c59eac 100644 --- a/src/mame/namco/cgang.cpp +++ b/src/mame/namco/cgang.cpp @@ -809,7 +809,7 @@ void cgang_state::cgang(machine_config &config) WATCHDOG_TIMER(config, m_watchdog); // HA1835P m_watchdog->set_time(attotime::from_msec(100)); // approximation - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(3000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(3000)); // video hardware PWM_DISPLAY(config, m_digits).set_size(10, 7); diff --git a/src/mame/namco/digdug.cpp b/src/mame/namco/digdug.cpp index 4542d1d10ff52..2cab91a794211 100644 --- a/src/mame/namco/digdug.cpp +++ b/src/mame/namco/digdug.cpp @@ -75,16 +75,12 @@ void digdug_state::digdug_palette(palette_device &palette) const /* convert from 32x32 to 36x28 */ TILEMAP_MAPPER_MEMBER(digdug_state::tilemap_scan) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } diff --git a/src/mame/namco/galaga_v.cpp b/src/mame/namco/galaga_v.cpp index 7e0999fb98ff0..907f6e20f2ade 100644 --- a/src/mame/namco/galaga_v.cpp +++ b/src/mame/namco/galaga_v.cpp @@ -100,16 +100,12 @@ void galaga_state::galaga_palette(palette_device &palette) const /* convert from 32x32 to 36x28 */ TILEMAP_MAPPER_MEMBER(galaga_state::tilemap_scan) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } diff --git a/src/mame/namco/mappy_v.cpp b/src/mame/namco/mappy_v.cpp index a2aeeb42e40e3..b66f5bcb737c4 100644 --- a/src/mame/namco/mappy_v.cpp +++ b/src/mame/namco/mappy_v.cpp @@ -224,23 +224,17 @@ void mappy_state::phozon_palette(palette_device &palette) const /* convert from 32x32 to 36x28 */ TILEMAP_MAPPER_MEMBER(mappy_state::superpac_tilemap_scan) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } /* tilemap is a composition of a 32x60 scrolling portion and two 2x28 fixed portions on the sides */ TILEMAP_MAPPER_MEMBER(mappy_state::mappy_tilemap_scan) { - int offs; - col -= 2; if (col & 0x20) { @@ -248,14 +242,12 @@ TILEMAP_MAPPER_MEMBER(mappy_state::mappy_tilemap_scan) mapping from logical to hardware coordinates, which is true to the hardware. Not doing it that way would cause missing tiles in motos and todruaga */ if (row & 0x20) - offs = 0x7ff; // outside visible area + return 0x7ff; // outside visible area else - offs = ((row + 2) & 0x0f) + (row & 0x10) + ((col & 3) << 5) + 0x780; + return ((row + 2) & 0x0f) + (row & 0x10) + ((col & 3) << 5) + 0x780; } else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(mappy_state::superpac_get_tile_info) diff --git a/src/mame/namco/namcoio_gearbox.cpp b/src/mame/namco/namcoio_gearbox.cpp index 5e8aefd6aa1f9..7362ba920ed73 100644 --- a/src/mame/namco/namcoio_gearbox.cpp +++ b/src/mame/namco/namcoio_gearbox.cpp @@ -107,7 +107,7 @@ ioport_constructor namcoio_gearbox_device::device_input_ports() const //static const ioport_value gearbox_table[] = { 0x0f, 0x0a, 0x09, 0x0e, 0x0d, 0x06, 0x05 }; -CUSTOM_INPUT_MEMBER( namcoio_gearbox_device::in_r ) +ioport_value namcoio_gearbox_device::in_r() { if(ioport("CONFIG")->read() & 1) return ioport("GEARBOX")->read() & 0xf; diff --git a/src/mame/namco/namcoio_gearbox.h b/src/mame/namco/namcoio_gearbox.h index 86bd04cfb310e..dc88ca88e6324 100644 --- a/src/mame/namco/namcoio_gearbox.h +++ b/src/mame/namco/namcoio_gearbox.h @@ -24,7 +24,7 @@ class namcoio_gearbox_device : public device_t namcoio_gearbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations - DECLARE_CUSTOM_INPUT_MEMBER( in_r ); + ioport_value in_r(); int clutch_r(); uint8_t m_gearbox_state = 0; virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/namco/namcos10.cpp b/src/mame/namco/namcos10.cpp index abe9e7e4303a6..ac934de1cf590 100644 --- a/src/mame/namco/namcos10.cpp +++ b/src/mame/namco/namcos10.cpp @@ -1383,9 +1383,9 @@ void namcos10_state::namcos10_mgexio(machine_config &config) namcos10_mgexio_device &mgexio(NAMCOS10_MGEXIO(config, m_exio, 0)); - HOPPER(config, m_mgexio_hopper[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_mgexio_hopper[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_mgexio_hopper[2], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_mgexio_hopper[0], attotime::from_msec(100)); + HOPPER(config, m_mgexio_hopper[1], attotime::from_msec(100)); + HOPPER(config, m_mgexio_hopper[2], attotime::from_msec(100)); mgexio.port4_read_callback().set([this] (offs_t offset) { uint8_t r = 0; diff --git a/src/mame/namco/namcos12.cpp b/src/mame/namco/namcos12.cpp index e0f05baaf3ae7..17d61c7de27a7 100644 --- a/src/mame/namco/namcos12.cpp +++ b/src/mame/namco/namcos12.cpp @@ -81,8 +81,10 @@ Truck Kyosokyoku (TKK2/VER.A) (C) Namco, 2000 COH-700 SYS Wanted Games ------------ -Aerosmith - Quest for Fame (C) Namco, 2001 +Aerosmith - Quest for Fame (C) Namco, 1999 (flyer date) http://www.bandainamcogames.co.jp/am/vg/questforfame/ +https://flyers.arcade-museum.com/videogames/show/2167#gallery-1 +https://flyers.arcade-museum.com/videogames/show/2167#gallery-2 Soul Calibur Ver.B (C) Namco, 1998 (flyer date) https://flyers.arcade-museum.com/?page=flyer&db=videodb&id=1009&image=1 @@ -91,8 +93,9 @@ Probably doesn't exist Submarines (C) Namco, 1999 (flyer date) https://flyers.arcade-museum.com/?page=flyer&db=videodb&id=5531&image=1 -This was cancelled, only the flyer exists. -It was shown only at an amusement show. Possibly a prototype still exists. Possibly not. +https://www.youtube.com/watch?v=k-JbUTWcFjg +Unreleased but was demonstrated at the 1999 Amusement Machine Operator's Union (AMOU) tradeshow in Tokyo. +Was possibly a sequel to Namco's 1978 'Submarine'. Tekno Werk (C) Namco, 1999 A music game with two 17-key Yamaha keyboards side by side for 2 players diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index 333f4135cd3af..d054240b1bc8f 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -2914,15 +2914,36 @@ TIMER_DEVICE_CALLBACK_MEMBER(adillor_state::trackball_interrupt) TIMER_DEVICE_CALLBACK_MEMBER(adillor_state::trackball_update) { // arbitrary timer for reading optical trackball + u32 const trackval[2] = { m_opt[0]->read(), m_opt[1]->read() }; + s32 delta[2] = { s32(trackval[0] - m_trackball_count[0]), s32(trackval[1] - m_trackball_count[1]) }; + m_trackball_count[0] = trackval[0]; + m_trackball_count[1] = trackval[1]; + if (delta[0] > 0x8000) + delta[0] -= 0x10000; + else if (delta[0] < -0x8000) + delta[0] += 0x10000; + if (delta[1] > 0x8000) + delta[1] -= 0x10000; + else if (delta[1] < -0x8000) + delta[1] += 0x10000; + m_trackball_residual[0] += delta[0]; + m_trackball_residual[1] += delta[1]; + int const speed[2] = { std::clamp(m_trackball_residual[0], -0x7f, 0x7f), std::clamp(m_trackball_residual[1], -0x7f, 0x7f) }; + m_trackball_residual[0] -= speed[0]; + m_trackball_residual[1] -= speed[1]; + // -1.0 .. 1.0 - double x = (double)(int)(m_opt[0]->read() - 0x80) / 127.0; - double y = (double)(int)(m_opt[1]->read() - 0x80) / 127.0; + double x = speed[0] / 127.0; + double y = speed[1] / 127.0; // note that it is rotated by 45 degrees, so instead of axes like (+), they are like (x) - double ox = x, oy = y; - double a = M_PI / 4.0; - x = ox*cos(a) - oy*sin(a); - y = ox*sin(a) + oy*cos(a); + if (BIT(m_config_switches->read(), 1)) + { + double const ox = x, oy = y; + double const a = M_PI / 4.0; + x = ox*cos(a) - oy*sin(a); + y = ox*sin(a) + oy*cos(a); + } // tied to mcu A2/A3 timer (speed determines frequency) double t[2]; @@ -3443,10 +3464,10 @@ static INPUT_PORTS_START( adillor ) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("OPT.0") - PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x01, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(8) PORT_NAME("Trackball X") + PORT_BIT( 0xffff, 0x0000, IPT_TRACKBALL_X ) PORT_SENSITIVITY(0x100) PORT_KEYDELTA(0x10) PORT_START("OPT.1") - PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x01, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(8) PORT_NAME("Trackball Y") PORT_REVERSE + PORT_BIT( 0xffff, 0x0000, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(0x100) PORT_KEYDELTA(0x10) PORT_REVERSE PORT_START("DSW") PORT_DIPNAME( 0x00010000, 0x00010000, "Test Mode" ) PORT_DIPLOCATION("SW4:1") @@ -3465,6 +3486,9 @@ static INPUT_PORTS_START( adillor ) PORT_CONFNAME( 0x01, 0x00, "Enable Dev Inputs" ) PORT_CONFSETTING( 0x00, DEF_STR( No ) ) PORT_CONFSETTING( 0x01, DEF_STR( Yes ) ) + PORT_CONFNAME( 0x02, 0x02, "Trackball Orientation" ) + PORT_CONFSETTING( 0x00, "Direct" ) + PORT_CONFSETTING( 0x02, "Natural" ) PORT_START("CUSTOM.0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DEV", 0x01, EQUALS, 0x01) PORT_PLAYER(2) PORT_NAME("Dev Service Enter") @@ -3739,6 +3763,14 @@ void alpine_state::machine_start() save_item(NAME(m_motor_status)); } +void adillor_state::machine_start() +{ + namcos22s_state::machine_start(); + + save_item(NAME(m_trackball_count)); + save_item(NAME(m_trackball_residual)); +} + // System22 void namcos22_state::namcos22(machine_config &config) diff --git a/src/mame/namco/namcos22.h b/src/mame/namco/namcos22.h index e16cf9e401c37..ae74bf7beabba 100644 --- a/src/mame/namco/namcos22.h +++ b/src/mame/namco/namcos22.h @@ -667,14 +667,22 @@ class adillor_state : public namcos22s_state public: adillor_state(const machine_config &mconfig, device_type type, const char *tag) : namcos22s_state(mconfig, type, tag), - m_trackball_interrupt(*this, "trackball_int%u", 0) + m_trackball_interrupt(*this, "trackball_int%u", 0), + m_config_switches(*this, "DEV") { } void adillor(machine_config &config); void init_adillor(); +protected: + virtual void machine_start() override; + private: required_device_array m_trackball_interrupt; + required_ioport m_config_switches; + + u32 m_trackball_count[2] = { }; + s32 m_trackball_residual[2] = { }; TIMER_DEVICE_CALLBACK_MEMBER(trackball_update); TIMER_DEVICE_CALLBACK_MEMBER(trackball_interrupt); diff --git a/src/mame/namco/namcos86.cpp b/src/mame/namco/namcos86.cpp index 6e9c198d44cd4..831b8edabd703 100644 --- a/src/mame/namco/namcos86.cpp +++ b/src/mame/namco/namcos86.cpp @@ -312,7 +312,7 @@ void namcos86_state::cus115_w(offs_t offset, uint8_t data) case 5: // not used? case 6: // ? cleared on startup case 7: // ? cleared on startup - default: // 8-15 not used? + default: // 8-15 not used? break; } } @@ -1035,30 +1035,30 @@ GFXDECODE_END void namcos86_state::hopmappy(machine_config &config) { - /* basic machine hardware */ - MC6809E(config, m_cpu1, XTAL(49'152'000)/32); + // basic machine hardware + MC6809E(config, m_cpu1, 49.152_MHz_XTAL/32); m_cpu1->set_addrmap(AS_PROGRAM, &namcos86_state::cpu1_map); m_cpu1->set_vblank_int("screen", FUNC(namcos86_state::irq0_line_assert)); - MC6809E(config, m_cpu2, XTAL(49'152'000)/32); + MC6809E(config, m_cpu2, 49.152_MHz_XTAL/32); m_cpu2->set_addrmap(AS_PROGRAM, &namcos86_state::hopmappy_cpu2_map); m_cpu2->set_vblank_int("screen", FUNC(namcos86_state::irq0_line_assert)); - HD63701V0(config, m_mcu, XTAL(49'152'000)/8); /* or compatible 6808 with extra instructions */ + HD63701V0(config, m_mcu, 49.152_MHz_XTAL/8); // or compatible 6808 with extra instructions m_mcu->set_addrmap(AS_PROGRAM, &namcos86_state::hopmappy_mcu_map); m_mcu->in_p1_cb().set_ioport("IN2"); - m_mcu->in_p2_cb().set_constant(0xff); /* leds won't work otherwise */ + m_mcu->in_p2_cb().set_constant(0xff); // leds won't work otherwise m_mcu->out_p1_cb().set(FUNC(namcos86_state::coin_w)); m_mcu->out_p2_cb().set(FUNC(namcos86_state::led_w)); - m_mcu->set_vblank_int("screen", FUNC(namcos86_state::irq0_line_hold)); /* ??? */ + m_mcu->set_vblank_int("screen", FUNC(namcos86_state::irq0_line_hold)); // ??? - config.set_maximum_quantum(attotime::from_hz(48000)); /* heavy interleaving needed to avoid hangs in rthunder */ + config.set_maximum_quantum(attotime::from_hz(48000)); // heavy interleaving needed to avoid hangs in rthunder WATCHDOG_TIMER(config, m_watchdog); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(49'152'000)/8, 384, 3+8*8, 3+44*8, 264, 2*8, 30*8); + screen.set_raw(49.152_MHz_XTAL/8, 384, 3+8*8, 3+44*8, 264, 2*8, 30*8); screen.set_screen_update(FUNC(namcos86_state::screen_update)); screen.screen_vblank().set(FUNC(namcos86_state::screen_vblank)); screen.set_palette(m_palette); @@ -1066,12 +1066,13 @@ void namcos86_state::hopmappy(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_namcos86); PALETTE(config, m_palette, FUNC(namcos86_state::namcos86_palette), 4096); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - YM2151(config, "ymsnd", 3579580).add_route(0, "mono", 0.0).add_route(1, "mono", 0.60); /* only right channel is connected */ + ym2151_device &ymsnd(YM2151(config, "ymsnd", 3.579545_MHz_XTAL)); + ymsnd.add_route(0, "mono", 0.0).add_route(1, "mono", 0.60); // only right channel is connected - NAMCO_CUS30(config, m_cus30, XTAL(49'152'000)/2048); + NAMCO_CUS30(config, m_cus30, 49.152_MHz_XTAL/2048); m_cus30->set_voices(8); m_cus30->add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -1080,7 +1081,7 @@ void namcos86_state::roishtar(machine_config &config) { hopmappy(config); - /* basic machine hardware */ + // basic machine hardware m_cpu2->set_addrmap(AS_PROGRAM, &namcos86_state::roishtar_cpu2_map); m_mcu->set_addrmap(AS_PROGRAM, &namcos86_state::roishtar_mcu_map); } @@ -1089,12 +1090,12 @@ void namcos86_state::genpeitd(machine_config &config) { hopmappy(config); - /* basic machine hardware */ + // basic machine hardware m_cpu2->set_addrmap(AS_PROGRAM, &namcos86_state::genpeitd_cpu2_map); m_mcu->set_addrmap(AS_PROGRAM, &namcos86_state::genpeitd_mcu_map); - /* sound hardware */ - NAMCO_63701X(config, m_63701x, 6000000); + // sound hardware + NAMCO_63701X(config, m_63701x, 6_MHz_XTAL); m_63701x->add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -1102,12 +1103,12 @@ void namcos86_state::rthunder(machine_config &config) { hopmappy(config); - /* basic machine hardware */ + // basic machine hardware m_cpu2->set_addrmap(AS_PROGRAM, &namcos86_state::rthunder_cpu2_map); m_mcu->set_addrmap(AS_PROGRAM, &namcos86_state::rthunder_mcu_map); - /* sound hardware */ - NAMCO_63701X(config, m_63701x, 6000000); + // sound hardware + NAMCO_63701X(config, m_63701x, 6_MHz_XTAL); m_63701x->add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -1115,15 +1116,16 @@ void namcos86_state::wndrmomo(machine_config &config) { hopmappy(config); - /* basic machine hardware */ + // basic machine hardware m_cpu2->set_addrmap(AS_PROGRAM, &namcos86_state::wndrmomo_cpu2_map); m_mcu->set_addrmap(AS_PROGRAM, &namcos86_state::wndrmomo_mcu_map); - /* sound hardware */ - NAMCO_63701X(config, m_63701x, 6000000); + // sound hardware + NAMCO_63701X(config, m_63701x, 6_MHz_XTAL); m_63701x->add_route(ALL_OUTPUTS, "mono", 1.0); } + /*************************************************************************** Game driver(s) @@ -1136,36 +1138,36 @@ ROM_START( skykiddx ) ROM_LOAD( "sk3_1b.9c", 0x08000, 0x8000, CRC(767b3514) SHA1(7b85e520e56924235d1f4987333f183c914fafc1) ) ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) ) ROM_REGION( 0x0c000, "gfx1", 0 ) - ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) /* plane 1,2 */ - ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) ) /* plane 3 */ + ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) // plane 1,2 + ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "sk3_7.4r", 0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) ) /* plane 1,2 */ - ROM_LOAD( "sk3_8.4s", 0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) ) /* plane 3 */ + ROM_LOAD( "sk3_7.4r", 0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) ) // plane 1,2 + ROM_LOAD( "sk3_8.4s", 0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) ) // plane 3 ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "sk3_5.12h", 0x00000, 0x8000, CRC(5c7d4399) SHA1(9c57e2510b1a01f618364ddaa9b9fa0ce9ae7340) ) ROM_LOAD( "sk3_6.12k", 0x08000, 0x8000, CRC(c908a3b2) SHA1(5fd5304c314443fb3351e7a2d50a72a0fede7e6d) ) - /* 12l/m/p/r/t/u empty */ + // 12l/m/p/r/t/u empty ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) /* red & green components */ - ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) /* blue component */ - ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles color table */ - ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites color table */ - ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) // red & green components + ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) // blue component + ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) // tiles color table + ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) // sprites color table + ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x4000, "mcusub", 0 ) - ROM_LOAD( "sk3_4.6b", 0x0000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) ) /* subprogram for the MCU */ + ROM_LOAD( "sk3_4.6b", 0x0000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) ) // subprogram for the MCU - /* the ROM/voice expansion board is not present in this game */ + // the ROM/voice expansion board is not present in this game ROM_END ROM_START( skykiddxo ) @@ -1174,73 +1176,73 @@ ROM_START( skykiddxo ) ROM_LOAD( "sk3_1.9c", 0x08000, 0x8000, CRC(5722a291) SHA1(0b3ca2585bf5c18214c1337dce8f92027e9d78c2) ) ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) ) ROM_REGION( 0x0c000, "gfx1", 0 ) - ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) /* plane 1,2 */ - ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) ) /* plane 3 */ + ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) // plane 1,2 + ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "sk3_7.4r", 0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) ) /* plane 1,2 */ - ROM_LOAD( "sk3_8.4s", 0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) ) /* plane 3 */ + ROM_LOAD( "sk3_7.4r", 0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) ) // plane 1,2 + ROM_LOAD( "sk3_8.4s", 0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) ) // plane 3 ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "sk3_5.12h", 0x00000, 0x8000, CRC(5c7d4399) SHA1(9c57e2510b1a01f618364ddaa9b9fa0ce9ae7340) ) ROM_LOAD( "sk3_6.12k", 0x08000, 0x8000, CRC(c908a3b2) SHA1(5fd5304c314443fb3351e7a2d50a72a0fede7e6d) ) - /* 12l/m/p/r/t/u empty */ + // 12l/m/p/r/t/u empty ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) /* red & green components */ - ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) /* blue component */ - ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles color table */ - ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites color table */ - ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) // red & green components + ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) // blue component + ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) // tiles color table + ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) // sprites color table + ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x4000, "mcusub", 0 ) - ROM_LOAD( "sk3_4.6b", 0x0000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) ) /* subprogram for the MCU */ + ROM_LOAD( "sk3_4.6b", 0x0000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) ) // subprogram for the MCU - /* the ROM/voice expansion board is not present in this game */ + // the ROM/voice expansion board is not present in this game ROM_END ROM_START( hopmappy ) ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ + // 9d empty ROM_LOAD( "hm1_1.9c", 0x08000, 0x8000, CRC(1a83914e) SHA1(6cb96b2518f4b867e20bd5d31ac6913d09c95f06) ) ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "hm1_2.12c", 0xc000, 0x4000, CRC(c46cda65) SHA1(1131b4aa0a446569e1eb9f59964548058c7993e2) ) ROM_REGION( 0x06000, "gfx1", 0 ) - ROM_LOAD( "hm1_6.7r", 0x00000, 0x04000, CRC(fd0e8887) SHA1(b76737d22bb1c1ae4d700ea6796e8d91f6ffa275) ) /* plane 1,2 */ - ROM_FILL( 0x04000, 0x02000, 0x00 ) /* no plane 3 */ + ROM_LOAD( "hm1_6.7r", 0x00000, 0x04000, CRC(fd0e8887) SHA1(b76737d22bb1c1ae4d700ea6796e8d91f6ffa275) ) // plane 1,2 + ROM_FILL( 0x04000, 0x02000, 0x00 ) // no plane 3 ROM_REGION( 0x06000, "gfx2", 0 ) - ROM_LOAD( "hm1_5.4r", 0x00000, 0x04000, CRC(9c4f31ae) SHA1(1c7072355d6f98b8e8554da19eab0512fdd9e2e1) ) /* plane 1,2 */ - ROM_FILL( 0x04000, 0x02000, 0x00 ) /* no plane 3 */ + ROM_LOAD( "hm1_5.4r", 0x00000, 0x04000, CRC(9c4f31ae) SHA1(1c7072355d6f98b8e8554da19eab0512fdd9e2e1) ) // plane 1,2 + ROM_FILL( 0x04000, 0x02000, 0x00 ) // no plane 3 ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "hm1_4.12h", 0x00000, 0x8000, CRC(78719c52) SHA1(06d7bb9f29ccdbf563b3bf13c0290510b26e186f) ) - /* 12k/l/m/p/r/t/u empty */ + // 12k/l/m/p/r/t/u empty ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "hm1-1.3r", 0x0000, 0x0200, CRC(cc801088) SHA1(d2c39ac1694d9b8c426e253702ecd096e68c6db9) ) /* red & green components */ - ROM_LOAD( "hm1-2.3s", 0x0200, 0x0200, CRC(a1cb71c5) SHA1(d8c33c2e52d64ebf4a07d8a26453e7b872cae413) ) /* blue component */ - ROM_LOAD( "hm1-3.4v", 0x0400, 0x0800, CRC(e362d613) SHA1(16d87711c1ac4ac2b649a32a5627cbd62cc5031f) ) /* tiles color table */ - ROM_LOAD( "hm1-4.5v", 0x0c00, 0x0800, CRC(678252b4) SHA1(9e2f7328532be3ac4b48bd5d52cd993108558452) ) /* sprites color table */ - ROM_LOAD( "hm1-5.6u", 0x1400, 0x0020, CRC(475bf500) SHA1(7e6a91e57d3709a5c70786c8e3ed545ee6026d03) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "hm1-1.3r", 0x0000, 0x0200, CRC(cc801088) SHA1(d2c39ac1694d9b8c426e253702ecd096e68c6db9) ) // red & green components + ROM_LOAD( "hm1-2.3s", 0x0200, 0x0200, CRC(a1cb71c5) SHA1(d8c33c2e52d64ebf4a07d8a26453e7b872cae413) ) // blue component + ROM_LOAD( "hm1-3.4v", 0x0400, 0x0800, CRC(e362d613) SHA1(16d87711c1ac4ac2b649a32a5627cbd62cc5031f) ) // tiles color table + ROM_LOAD( "hm1-4.5v", 0x0c00, 0x0800, CRC(678252b4) SHA1(9e2f7328532be3ac4b48bd5d52cd993108558452) ) // sprites color table + ROM_LOAD( "hm1-5.6u", 0x1400, 0x0020, CRC(475bf500) SHA1(7e6a91e57d3709a5c70786c8e3ed545ee6026d03) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x4000, "mcusub", 0 ) - ROM_LOAD( "hm1_3.6b", 0x0000, 0x2000, CRC(6496e1db) SHA1(f990fb3b2f93295282e8dee4488a4c3fc5ef83d1) ) /* subprogram for the MCU */ + ROM_LOAD( "hm1_3.6b", 0x0000, 0x2000, CRC(6496e1db) SHA1(f990fb3b2f93295282e8dee4488a4c3fc5ef83d1) ) // subprogram for the MCU - /* the ROM/voice expansion board is not present in this game */ + // the ROM/voice expansion board is not present in this game ROM_END ROM_START( roishtar ) @@ -1249,16 +1251,16 @@ ROM_START( roishtar ) ROM_LOAD( "ri1_1c.9c", 0x08000, 0x8000, CRC(14acbacb) SHA1(3c6130f9e5a4ba84be0cc3547c1086707ee3b8e9) ) ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "ri1_3.12c", 0x8000, 0x8000, CRC(a39829f7) SHA1(e08114d5154367a3cc36f1485253f18044a1888d) ) ROM_REGION( 0x06000, "gfx1", 0 ) - ROM_LOAD( "ri1_14.7r", 0x00000, 0x04000, CRC(de8154b4) SHA1(70a65e4656cf9fcf5c54e84c628ec95393e856fb) ) /* plane 1,2 */ - ROM_LOAD( "ri1_15.7s", 0x04000, 0x02000, CRC(4298822b) SHA1(5aad41fd719c2f310ae485caaacda129c9f2ac94) ) /* plane 3 */ + ROM_LOAD( "ri1_14.7r", 0x00000, 0x04000, CRC(de8154b4) SHA1(70a65e4656cf9fcf5c54e84c628ec95393e856fb) ) // plane 1,2 + ROM_LOAD( "ri1_15.7s", 0x04000, 0x02000, CRC(4298822b) SHA1(5aad41fd719c2f310ae485caaacda129c9f2ac94) ) // plane 3 ROM_REGION( 0x06000, "gfx2", 0 ) - ROM_LOAD( "ri1_12.4r", 0x00000, 0x04000, CRC(557e54d3) SHA1(d22969deefcb3c3443d08a215f1ec2e874650b19) ) /* plane 1,2 */ - ROM_LOAD( "ri1_13.4s", 0x04000, 0x02000, CRC(9ebe8e32) SHA1(5990a86bfbf2669e512e8ca875c69b4c60c4d108) ) /* plane 3 */ + ROM_LOAD( "ri1_12.4r", 0x00000, 0x04000, CRC(557e54d3) SHA1(d22969deefcb3c3443d08a215f1ec2e874650b19) ) // plane 1,2 + ROM_LOAD( "ri1_13.4s", 0x04000, 0x02000, CRC(9ebe8e32) SHA1(5990a86bfbf2669e512e8ca875c69b4c60c4d108) ) // plane 3 ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "ri1_5.12h", 0x00000, 0x8000, CRC(46b59239) SHA1(bb08e57cd5864f41e27a07dcf449896570d2203d) ) @@ -1268,40 +1270,40 @@ ROM_START( roishtar ) ROM_LOAD( "ri1_9.12p", 0x20000, 0x8000, CRC(f3de3c2a) SHA1(02705bfd37f8996c5fc9c5bf2a99e859083a75e6) ) ROM_LOAD( "ri1_10.12r", 0x28000, 0x8000, CRC(6dacc70d) SHA1(c7db40a0e90c9717f8a2f1507daff997856a3b91) ) ROM_LOAD( "ri1_11.12t", 0x30000, 0x8000, CRC(fb6bc533) SHA1(a840af58d6db66518520bc7d88867a09a2e502c2) ) - /* 12u empty */ + // 12u empty ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "ri1-1.3r", 0x0000, 0x0200, CRC(29cd0400) SHA1(a9b0d09492710e72e34155cd6a7b7c1a34c56b20) ) /* red & green components */ - ROM_LOAD( "ri1-2.3s", 0x0200, 0x0200, CRC(02fd278d) SHA1(db104fc7acf2739def902180981eb7ba10ec3dda) ) /* blue component */ - ROM_LOAD( "ri1-3.4v", 0x0400, 0x0800, CRC(cbd7e53f) SHA1(77ef70be4e8a21948d697649352a5e3527086cf2) ) /* tiles color table */ - ROM_LOAD( "ri1-4.5v", 0x0c00, 0x0800, CRC(22921617) SHA1(7304cb5a86f524f912feb8b58801393cce5d3b09) ) /* sprites color table */ - ROM_LOAD( "ri1-5.6u", 0x1400, 0x0020, CRC(e2188075) SHA1(be079ace2070433d4d90c757aef3e415b4e21455) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "ri1-1.3r", 0x0000, 0x0200, CRC(29cd0400) SHA1(a9b0d09492710e72e34155cd6a7b7c1a34c56b20) ) // red & green components + ROM_LOAD( "ri1-2.3s", 0x0200, 0x0200, CRC(02fd278d) SHA1(db104fc7acf2739def902180981eb7ba10ec3dda) ) // blue component + ROM_LOAD( "ri1-3.4v", 0x0400, 0x0800, CRC(cbd7e53f) SHA1(77ef70be4e8a21948d697649352a5e3527086cf2) ) // tiles color table + ROM_LOAD( "ri1-4.5v", 0x0c00, 0x0800, CRC(22921617) SHA1(7304cb5a86f524f912feb8b58801393cce5d3b09) ) // sprites color table + ROM_LOAD( "ri1-5.6u", 0x1400, 0x0020, CRC(e2188075) SHA1(be079ace2070433d4d90c757aef3e415b4e21455) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "ri1_4.6b", 0x0000, 0x8000, CRC(552172b8) SHA1(18b35cb116baba362831fc046241895198b07a53) ) /* subprogram for the MCU */ + ROM_LOAD( "ri1_4.6b", 0x0000, 0x8000, CRC(552172b8) SHA1(18b35cb116baba362831fc046241895198b07a53) ) // subprogram for the MCU - /* the ROM/voice expansion board is not present in this game */ + // the ROM/voice expansion board is not present in this game ROM_END ROM_START( genpeitd ) ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ + // 9d empty ROM_LOAD( "gt1_1b.9c", 0x08000, 0x8000, CRC(75396194) SHA1(2a526064fb91b2796c913f3050867352ac63e643) ) ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "gt1_2.12c", 0xc000, 0x4000, CRC(302f2cb6) SHA1(19c39afb7d49d80aeaaf67a837cd02bfd3d64fbd) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "gt1_7.7r", 0x00000, 0x10000, CRC(ea77a211) SHA1(32b8ae11723b6223b42225805acd0dcab65516a5) ) /* plane 1,2 */ - ROM_LOAD( "gt1_6.7s", 0x10000, 0x08000, CRC(1b128a2e) SHA1(6d7b95326919420538b509a119c26e9109e5539e) ) /* plane 3 */ + ROM_LOAD( "gt1_7.7r", 0x00000, 0x10000, CRC(ea77a211) SHA1(32b8ae11723b6223b42225805acd0dcab65516a5) ) // plane 1,2 + ROM_LOAD( "gt1_6.7s", 0x10000, 0x08000, CRC(1b128a2e) SHA1(6d7b95326919420538b509a119c26e9109e5539e) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "gt1_5.4r", 0x00000, 0x08000, CRC(44d58b06) SHA1(9663f026092484a4041e486bad23e8e58a4dbf95) ) /* plane 1,2 */ - ROM_LOAD( "gt1_4.4s", 0x08000, 0x04000, CRC(db8d45b0) SHA1(fd4ebdf442e8b9ccc026079c29a975b1fa6e8dd6) ) /* plane 3 */ + ROM_LOAD( "gt1_5.4r", 0x00000, 0x08000, CRC(44d58b06) SHA1(9663f026092484a4041e486bad23e8e58a4dbf95) ) // plane 1,2 + ROM_LOAD( "gt1_4.4s", 0x08000, 0x04000, CRC(db8d45b0) SHA1(fd4ebdf442e8b9ccc026079c29a975b1fa6e8dd6) ) // plane 3 ROM_REGION( 0x100000, "gfx3", 0 ) ROM_LOAD( "gt1_11.12h", 0x00000, 0x20000, CRC(3181a5fe) SHA1(a98b8609afe3a41ed7b1432b3c2850e8de2c428b) ) @@ -1314,34 +1316,37 @@ ROM_START( genpeitd ) ROM_LOAD( "gt1_9.12u", 0xe0000, 0x10000, CRC(d95a5fd7) SHA1(819ac376ac0eb6ffa69153d579a9c11ae5feb6a4) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "gt1-1.3r", 0x0000, 0x0200, CRC(2f0ddddb) SHA1(27fa45c0baf9a48002db11be9b3c0472ecfd986c) ) /* red & green components */ - ROM_LOAD( "gt1-2.3s", 0x0200, 0x0200, CRC(87d27025) SHA1(a50f969d48a99c6d29141458fb3e34b23cf5e67c) ) /* blue component */ - ROM_LOAD( "gt1-3.4v", 0x0400, 0x0800, CRC(c178de99) SHA1(67289ef9e5068636023316560f9f1690a8384bfb) ) /* tiles color table */ - ROM_LOAD( "gt1-4.5v", 0x0c00, 0x0800, CRC(9f48ef17) SHA1(78c813dd57326f3f5ab785005ef89ba96303adeb) ) /* sprites color table */ - ROM_LOAD( "gt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "gt1-1.3r", 0x0000, 0x0200, CRC(2f0ddddb) SHA1(27fa45c0baf9a48002db11be9b3c0472ecfd986c) ) // red & green components + ROM_LOAD( "gt1-2.3s", 0x0200, 0x0200, CRC(87d27025) SHA1(a50f969d48a99c6d29141458fb3e34b23cf5e67c) ) // blue component + ROM_LOAD( "gt1-3.4v", 0x0400, 0x0800, CRC(c178de99) SHA1(67289ef9e5068636023316560f9f1690a8384bfb) ) // tiles color table + ROM_LOAD( "gt1-4.5v", 0x0c00, 0x0800, CRC(9f48ef17) SHA1(78c813dd57326f3f5ab785005ef89ba96303adeb) ) // sprites color table + ROM_LOAD( "gt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "gt1_3.6b", 0x0000, 0x8000, CRC(315cd988) SHA1(87b1a90b2a53571f7d8f9a475125f3f31ed3cb5d) ) /* subprogram for the MCU */ + ROM_LOAD( "gt1_3.6b", 0x0000, 0x8000, CRC(315cd988) SHA1(87b1a90b2a53571f7d8f9a475125f3f31ed3cb5d) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "gt1_10b.f1", 0x00000, 0x10000, CRC(5721ad0d) SHA1(f16afb3f468957a9de270366605592e14837b8c2) ) - /* h1 empty */ - /* k1 empty */ - /* m1 empty */ + // h1 empty + // k1 empty + // m1 empty + + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "gt1_17.f3", 0x00000, 0x20000, CRC(26181ff8) SHA1(c97a0e6282b2af88d960c71e3af5283608493d31) ) ROM_LOAD( "gt1_18.h3", 0x20000, 0x20000, CRC(7ef9e5ea) SHA1(0464d43b39903ce373d70854bbcd5da05896ecae) ) ROM_LOAD( "gt1_19.k3", 0x40000, 0x20000, CRC(38e11f6c) SHA1(52dea9d444d5a0421db4a8bf5c79a9d901b6f005) ) - /* m3 empty */ + // m3 empty ROM_END ROM_START( rthunder ) // program and mcu updated to rt3 ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ + // 9d empty ROM_LOAD( "rt3_1b.9c", 0x8000, 0x8000, CRC(7d252a1b) SHA1(cb92709e94eb273b3ce44c55cd252170ad1017f4) ) ROM_REGION( 0x10000, "cpu2", 0 ) @@ -1349,12 +1354,12 @@ ROM_START( rthunder ) // program and mcu updated to rt3 ROM_LOAD( "rt3_2b.12c", 0x08000, 0x8000, CRC(a7ea46ee) SHA1(52e8757aacb4e01f8432125729e2323c48ebc4f5) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */ - ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) /* plane 3 */ + ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) // plane 1,2 + ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) /* plane 1,2 */ - ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) /* plane 3 */ + ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) // plane 1,2 + ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "rt1_9.12h", 0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) ) @@ -1367,48 +1372,51 @@ ROM_START( rthunder ) // program and mcu updated to rt3 ROM_LOAD( "rt1_16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */ - ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */ - ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */ - ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */ - ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) // red & green components + ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) // blue component + ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) // tiles color table + ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) // sprites color table + ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "rt3_4.6b", 0x0000, 0x8000, CRC(00cf293f) SHA1(bc441d21bb4c54a01d2393fbe99201714cd4439d) ) /* subprogram for the MCU */ + ROM_LOAD( "rt3_4.6b", 0x0000, 0x8000, CRC(00cf293f) SHA1(bc441d21bb4c54a01d2393fbe99201714cd4439d) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "rt1_17.f1", 0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) ) ROM_LOAD( "rt1_18.h1", 0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) ) ROM_LOAD( "rt3_19.k1", 0x20000, 0x10000, CRC(c16675e9) SHA1(e31c28cb95ffa85392c74e1d81bfa89acbaefeb9) ) ROM_LOAD( "rt3_20.m1", 0x30000, 0x10000, CRC(c470681b) SHA1(87f8d8509c3e8207f34c6001aaf4d0afdad82d0d) ) - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM + + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "rt1_21.f3", 0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) ) ROM_LOAD( "rt2_22.h3", 0x20000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) ) - /* k3 empty */ - /* m3 empty */ + // k3 empty + // m3 empty ROM_END // original PCB, but with a piggyback board as replacement for the custom '130' with what appears to be 2x BPROMs and 4x simple TTL chips. The program also appears to have been hacked ROM_START( rthundera ) ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ - ROM_LOAD( "1.9c", 0x8000, 0x8000, CRC(13c92678) SHA1(e241fd6067d37f1986905c56f180c687dc536803) ) // 12 bytes differ, looks hacked from above + // 9d empty + ROM_LOAD( "1.9c", 0x8000, 0x8000, CRC(13c92678) SHA1(e241fd6067d37f1986905c56f180c687dc536803) ) // 12 bytes differ, looks hacked from above ROM_REGION( 0x10000, "cpu2", 0 ) ROM_LOAD( "rt3_3.12d", 0x00000, 0x8000, CRC(a13f601c) SHA1(8987174e364d20eeab706c3e0d4e0d3c2b96723c) ) ROM_LOAD( "rt3_2b.12c", 0x08000, 0x8000, CRC(a7ea46ee) SHA1(52e8757aacb4e01f8432125729e2323c48ebc4f5) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */ - ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) /* plane 3 */ + ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) // plane 1,2 + ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) /* plane 1,2 */ - ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) /* plane 3 */ + ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) // plane 1,2 + ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "rt1_9.12h", 0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) ) @@ -1421,47 +1429,50 @@ ROM_START( rthundera ) ROM_LOAD( "rt1_16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */ - ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */ - ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */ - ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */ - ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) // red & green components + ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) // blue component + ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) // tiles color table + ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) // sprites color table + ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "rt3_4.6b", 0x0000, 0x8000, CRC(00cf293f) SHA1(bc441d21bb4c54a01d2393fbe99201714cd4439d) ) /* subprogram for the MCU */ + ROM_LOAD( "rt3_4.6b", 0x0000, 0x8000, CRC(00cf293f) SHA1(bc441d21bb4c54a01d2393fbe99201714cd4439d) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "rt1_17.f1", 0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) ) ROM_LOAD( "rt1_18.h1", 0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) ) ROM_LOAD( "rt3_19.k1", 0x20000, 0x10000, CRC(c16675e9) SHA1(e31c28cb95ffa85392c74e1d81bfa89acbaefeb9) ) ROM_LOAD( "20.m1", 0x30000, 0x10000, CRC(05d5db25) SHA1(39f531a7605b653d827957087797f86e83d867e1) ) // 1 bit differs in an unused area, could be bitrot. - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM + + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "rt1_21.f3", 0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) ) ROM_LOAD( "rt2_22.h3", 0x20000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) ) - /* k3 empty */ - /* m3 empty */ + // k3 empty + // m3 empty ROM_END ROM_START( rthunder2 ) // program updated to rt2, 19/20 banked CPU code updated to rt3 ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ - ROM_LOAD( "rt2_1.9c", 0x8000, 0x8000, CRC(7eaa9fdf) SHA1(aecc338b025eb5cd48c26ffb2c658d03478361c8) ) + // 9d empty + ROM_LOAD( "rt2_1.9c", 0x8000, 0x8000, CRC(7eaa9fdf) SHA1(aecc338b025eb5cd48c26ffb2c658d03478361c8) ) ROM_REGION( 0x10000, "cpu2", 0 ) - ROM_LOAD( "rt2_3.12d", 0x00000, 0x8000, CRC(f5d439d8) SHA1(87c610913e86c2dca5ec64f7a96ef3a0ddfe5968) ) - ROM_LOAD( "rt2_2.12c", 0x08000, 0x8000, CRC(1c0e29e0) SHA1(17f6981d10414d14535835919bb05413498421f1) ) + ROM_LOAD( "rt2_3.12d", 0x00000, 0x8000, CRC(f5d439d8) SHA1(87c610913e86c2dca5ec64f7a96ef3a0ddfe5968) ) + ROM_LOAD( "rt2_2.12c", 0x08000, 0x8000, CRC(1c0e29e0) SHA1(17f6981d10414d14535835919bb05413498421f1) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */ - ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) /* plane 3 */ + ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) // plane 1,2 + ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) /* plane 1,2 */ - ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) /* plane 3 */ + ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) // plane 1,2 + ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "rt1_9.12h", 0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) ) @@ -1474,48 +1485,51 @@ ROM_START( rthunder2 ) // program updated to rt2, 19/20 banked CPU code updated ROM_LOAD( "rt1_16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */ - ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */ - ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */ - ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */ - ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) // red & green components + ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) // blue component + ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) // tiles color table + ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) // sprites color table + ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "rt2_4.6b", 0x0000, 0x8000, CRC(0387464f) SHA1(ce7f521bc2ecc6525880da2551daf595a394a275) ) /* subprogram for the MCU */ + ROM_LOAD( "rt2_4.6b", 0x0000, 0x8000, CRC(0387464f) SHA1(ce7f521bc2ecc6525880da2551daf595a394a275) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "rt1_17.f1", 0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) ) ROM_LOAD( "rt1_18.h1", 0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) ) ROM_LOAD( "rt3_19.k1", 0x20000, 0x10000, CRC(c16675e9) SHA1(e31c28cb95ffa85392c74e1d81bfa89acbaefeb9) ) ROM_LOAD( "rt3_20.m1", 0x30000, 0x10000, CRC(c470681b) SHA1(87f8d8509c3e8207f34c6001aaf4d0afdad82d0d) ) - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM + + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "rt1_21.f3", 0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) ) ROM_LOAD( "rt2_22.h3", 0x20000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) ) - /* k3 empty */ - /* m3 empty */ + // k3 empty + // m3 empty ROM_END ROM_START( rthunder1 ) // some roms (mcu + samples) and maybe r19 updated to rt2 ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ - ROM_LOAD( "rt1_1b.9c", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) ) + // 9d empty + ROM_LOAD( "rt1_1b.9c", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) ) ROM_REGION( 0x10000, "cpu2", 0 ) - ROM_LOAD( "rt1_3.12d", 0x00000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) ) - ROM_LOAD( "rt1_2b.12c", 0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) ) + ROM_LOAD( "rt1_3.12d", 0x00000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) ) + ROM_LOAD( "rt1_2b.12c", 0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */ - ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) /* plane 3 */ + ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) // plane 1,2 + ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) /* plane 1,2 */ - ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) /* plane 3 */ + ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) // plane 1,2 + ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "rt1_9.12h", 0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) ) @@ -1528,48 +1542,52 @@ ROM_START( rthunder1 ) // some roms (mcu + samples) and maybe r19 updated to rt2 ROM_LOAD( "rt1_16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */ - ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */ - ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */ - ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */ - ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) // red & green components + ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) // blue component + ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) // tiles color table + ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) // sprites color table + ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "rt2_4.6b", 0x0000, 0x8000, CRC(0387464f) SHA1(ce7f521bc2ecc6525880da2551daf595a394a275) ) /* subprogram for the MCU */ + ROM_LOAD( "rt2_4.6b", 0x0000, 0x8000, CRC(0387464f) SHA1(ce7f521bc2ecc6525880da2551daf595a394a275) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "rt1_17.f1", 0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) ) ROM_LOAD( "rt1_18.h1", 0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) ) ROM_LOAD( "r19", 0x20000, 0x10000, CRC(fe9343b0) SHA1(ae8e5ee11eaf7dc1e8f814b0a0beef97731f042b) ) // probably rt2 - ROM_LOAD( "rt1_20.m1", 0x30000, 0x10000, CRC(f8518d4f) SHA1(3a8551d46ffdf82844b2eb1b2c01cf2d8423a49e) ) // maybe labeled rt2? content is the same as rt1 tho, we have no rt2 rom for this position otherwise tho, only rt1 and rt3, strange. + // rt1_20 maybe labeled rt2? contents is the same as rt1 though, we have no rt2 rom for this position otherwise though, only rt1 and rt3, strange. + ROM_LOAD( "rt1_20.m1", 0x30000, 0x10000, CRC(f8518d4f) SHA1(3a8551d46ffdf82844b2eb1b2c01cf2d8423a49e) ) + + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "rt1_21.f3", 0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) ) ROM_LOAD( "rt2_22.h3", 0x20000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) ) - /* k3 empty */ - /* m3 empty */ + // k3 empty + // m3 empty ROM_END ROM_START( rthunder0 ) ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ - ROM_LOAD( "rt1_1b.9c", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) ) + // 9d empty + ROM_LOAD( "rt1_1b.9c", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) ) ROM_REGION( 0x10000, "cpu2", 0 ) - ROM_LOAD( "rt1_3.12d", 0x00000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) ) - ROM_LOAD( "rt1_2b.12c", 0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) ) + ROM_LOAD( "rt1_3.12d", 0x00000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) ) + ROM_LOAD( "rt1_2b.12c", 0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) ) ROM_REGION( 0x18000, "gfx1", 0 ) - ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */ - ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) /* plane 3 */ + ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) // plane 1,2 + ROM_LOAD( "rt1_8.7s", 0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) /* plane 1,2 */ - ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) /* plane 3 */ + ROM_LOAD( "rt1_5.4r", 0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) ) // plane 1,2 + ROM_LOAD( "rt1_6.4s", 0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "rt1_9.12h", 0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) ) @@ -1582,49 +1600,51 @@ ROM_START( rthunder0 ) ROM_LOAD( "rt1_16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */ - ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */ - ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */ - ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */ - ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) // red & green components + ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) // blue component + ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) // tiles color table + ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) // sprites color table + ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "rt1_4.6b", 0x0000, 0x8000, CRC(3f795094) SHA1(390eef98e3dec690bf942c35617e2fa004c96e5c) ) /* subprogram for the MCU */ + ROM_LOAD( "rt1_4.6b", 0x0000, 0x8000, CRC(3f795094) SHA1(390eef98e3dec690bf942c35617e2fa004c96e5c) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "rt1_17.f1", 0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) ) ROM_LOAD( "rt1_18.h1", 0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) ) ROM_LOAD( "rt1_19.k1", 0x20000, 0x10000, CRC(1273a048) SHA1(b8a0a6f5d9f9d351a622252afb409a111431c5ca) ) ROM_LOAD( "rt1_20.m1", 0x30000, 0x10000, CRC(f8518d4f) SHA1(3a8551d46ffdf82844b2eb1b2c01cf2d8423a49e) ) - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM + + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "rt1_21.f3", 0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) ) ROM_LOAD( "rt1_22.h3", 0x20000, 0x10000, CRC(842a2fd4) SHA1(5aee47d680621ab5a33b13433f37bd74e977c3f6) ) - /* k3 empty */ - /* m3 empty */ + // k3 empty + // m3 empty ROM_END ROM_START( wndrmomo ) ROM_REGION( 0x10000, "cpu1", 0 ) - /* 9d empty */ + // 9d empty ROM_LOAD( "wm1_1.9c", 0x8000, 0x8000, CRC(34b50bf0) SHA1(112c8c8a0a16382008cacd2e484f91fa9338d10a) ) - ROM_REGION( 0x10000, "cpu2", 0 ) - /* 12d empty */ + // 12d empty ROM_LOAD( "wm1_2.12c", 0x8000, 0x8000, CRC(3181efd0) SHA1(01a2e0e4c8ced6f48b6e70393a3c4152b079e9b0) ) ROM_REGION( 0x0c000, "gfx1", 0 ) - ROM_LOAD( "wm1_6.7r", 0x00000, 0x08000, CRC(93955fbb) SHA1(cffd457886c40bf709b573237165ae8fa9784e32) ) /* plane 1,2 */ - ROM_LOAD( "wm1_7.7s", 0x08000, 0x04000, CRC(7d662527) SHA1(09d1dc46a402c67dddcdd4cc90f32948c7a28795) ) /* plane 3 */ + ROM_LOAD( "wm1_6.7r", 0x00000, 0x08000, CRC(93955fbb) SHA1(cffd457886c40bf709b573237165ae8fa9784e32) ) // plane 1,2 + ROM_LOAD( "wm1_7.7s", 0x08000, 0x04000, CRC(7d662527) SHA1(09d1dc46a402c67dddcdd4cc90f32948c7a28795) ) // plane 3 ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "wm1_4.4r", 0x00000, 0x08000, CRC(bbe67836) SHA1(bc998c2ddc2664db614e7c487f77073a5be69e89) ) /* plane 1,2 */ - ROM_LOAD( "wm1_5.4s", 0x08000, 0x04000, CRC(a81b481f) SHA1(b5a029e432b29e157505b975ea57cd4b5da361a7) ) /* plane 3 */ + ROM_LOAD( "wm1_4.4r", 0x00000, 0x08000, CRC(bbe67836) SHA1(bc998c2ddc2664db614e7c487f77073a5be69e89) ) // plane 1,2 + ROM_LOAD( "wm1_5.4s", 0x08000, 0x04000, CRC(a81b481f) SHA1(b5a029e432b29e157505b975ea57cd4b5da361a7) ) // plane 3 ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "wm1_8.12h", 0x00000, 0x10000, CRC(14f52e72) SHA1(0f8f58cd13e3393a113817593816f53a218f3ce4) ) @@ -1637,25 +1657,28 @@ ROM_START( wndrmomo ) ROM_LOAD( "wm1_15.12u", 0x70000, 0x10000, CRC(b5c98be0) SHA1(bdd6e0e02632866eea60a6bdeff3af8b6cd08d68) ) ROM_REGION( 0x1420, "proms", 0 ) - ROM_LOAD( "wm1-1.3r", 0x0000, 0x0200, CRC(1af8ade8) SHA1(1aa0d314c34abc4154092d4b588214afb0b21e22) ) /* red & green components */ - ROM_LOAD( "wm1-2.3s", 0x0200, 0x0200, CRC(8694e213) SHA1(f00d692e587c3706e71b6eeef21e1ea87c9dd921) ) /* blue component */ - ROM_LOAD( "wm1-3.4v", 0x0400, 0x0800, CRC(2ffaf9a4) SHA1(2002df3cc38e05f3e127d05c244cb101d1f1d85f) ) /* tiles color table */ - ROM_LOAD( "wm1-4.5v", 0x0c00, 0x0800, CRC(f4e83e0b) SHA1(b000d884c6e0373b0403bc9d63eb0452c1197491) ) /* sprites color table */ - ROM_LOAD( "wm1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */ + ROM_LOAD( "wm1-1.3r", 0x0000, 0x0200, CRC(1af8ade8) SHA1(1aa0d314c34abc4154092d4b588214afb0b21e22) ) // red & green components + ROM_LOAD( "wm1-2.3s", 0x0200, 0x0200, CRC(8694e213) SHA1(f00d692e587c3706e71b6eeef21e1ea87c9dd921) ) // blue component + ROM_LOAD( "wm1-3.4v", 0x0400, 0x0800, CRC(2ffaf9a4) SHA1(2002df3cc38e05f3e127d05c244cb101d1f1d85f) ) // tiles color table + ROM_LOAD( "wm1-4.5v", 0x0c00, 0x0800, CRC(f4e83e0b) SHA1(b000d884c6e0373b0403bc9d63eb0452c1197491) ) // sprites color table + ROM_LOAD( "wm1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) // tile address decoder (used at runtime) ROM_REGION( 0x1000, "mcu", 0 ) - ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_LOAD( "cus60-60a1.mcu", 0x0000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code ROM_REGION( 0x8000, "mcusub", 0 ) - ROM_LOAD( "wm1_3.6b", 0x0000, 0x8000, CRC(55f01df7) SHA1(c11574a8b51bf965790b97895452e9fa9ab6b752) ) /* subprogram for the MCU */ + ROM_LOAD( "wm1_3.6b", 0x0000, 0x8000, CRC(55f01df7) SHA1(c11574a8b51bf965790b97895452e9fa9ab6b752) ) // subprogram for the MCU - ROM_REGION( 0x40000, "user1", 0 ) /* bank switched data for CPU1 */ + ROM_REGION( 0x40000, "user1", 0 ) // bank switched data for CPU1 ROM_LOAD( "wm1_16.f1", 0x00000, 0x10000, CRC(e565f8f3) SHA1(e1f417003ef9f700f9d5ed091484463c704c8b9f) ) - /* h1 empty */ - /* k1 empty */ - /* m1 empty */ + // h1 empty + // k1 empty + // m1 empty + + ROM_REGION( 0x1000, "mcu2", 0 ) + ROM_LOAD( "hd637a01x0p.e3", 0x0000, 0x1000, NO_DUMP ) // internal ROM - ROM_REGION( 0x80000, "namco2", 0 ) /* PCM samples for Hitachi CPU */ + ROM_REGION( 0x80000, "namco2", 0 ) // PCM samples for Hitachi MCU ROM_LOAD( "wm1_17.f3", 0x00000, 0x10000, CRC(bea3c318) SHA1(50b6e4c546ce056d68fbb2e52cb88397daa615aa) ) ROM_LOAD( "wm1_18.h3", 0x20000, 0x10000, CRC(6d73bcc5) SHA1(fccd83bb3a872b4cd8bd9f11f5cdf5926cb9b74e) ) ROM_LOAD( "wm1_19.k3", 0x40000, 0x10000, CRC(d288e912) SHA1(d0db58d7ed3d8cf895e031901f91f810f0e18709) ) @@ -1666,7 +1689,7 @@ ROM_END void namcos86_state::init_namco86() { - /* shuffle tile ROMs so regular gfx unpack routines can be used */ + // shuffle tile ROMs so regular gfx unpack routines can be used uint8_t *gfx = memregion("gfx1")->base(); int size = memregion("gfx1")->bytes() * 2 / 3; diff --git a/src/mame/namco/skykid.cpp b/src/mame/namco/skykid.cpp index 7481eb9797ab9..5916a86ccd89b 100644 --- a/src/mame/namco/skykid.cpp +++ b/src/mame/namco/skykid.cpp @@ -165,16 +165,12 @@ void skykid_state::palette(palette_device &palette) const // convert from 32x32 to 36x28 TILEMAP_MAPPER_MEMBER(skykid_state::tx_tilemap_scan) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(skykid_state::tx_get_tile_info) diff --git a/src/mame/namco/wacky_gator.cpp b/src/mame/namco/wacky_gator.cpp index 8f3ba4d7d1fde..88d4ee2498c04 100644 --- a/src/mame/namco/wacky_gator.cpp +++ b/src/mame/namco/wacky_gator.cpp @@ -47,8 +47,8 @@ class wackygtr_state : public driver_device m_lamps(*this, "lamp%u", 0U) { } - DECLARE_CUSTOM_INPUT_MEMBER(alligators_rear_sensors_r); - DECLARE_CUSTOM_INPUT_MEMBER(alligators_front_sensors_r); + ioport_value alligators_rear_sensors_r(); + ioport_value alligators_front_sensors_r(); void wackygtr(machine_config &config); @@ -162,7 +162,7 @@ void wackygtr_state::pmm8713_ck(int i, int state) } } -CUSTOM_INPUT_MEMBER(wackygtr_state::alligators_rear_sensors_r) +ioport_value wackygtr_state::alligators_rear_sensors_r() { return ((m_motors_pos[0] < 10) ? 0x01 : 0) | ((m_motors_pos[1] < 10) ? 0x02 : 0) | @@ -172,7 +172,7 @@ CUSTOM_INPUT_MEMBER(wackygtr_state::alligators_rear_sensors_r) (m_alligators_ctrl ^ 0x1f); } -CUSTOM_INPUT_MEMBER(wackygtr_state::alligators_front_sensors_r) +ioport_value wackygtr_state::alligators_front_sensors_r() { return ((m_motors_pos[0] < 5 || m_motors_pos[0] > 55) ? 0x01 : 0) | ((m_motors_pos[1] < 5 || m_motors_pos[1] > 55) ? 0x02 : 0) | @@ -337,7 +337,7 @@ void wackygtr_state::wackygtr(machine_config &config) m_pit8253[1]->set_clk<2>(XTAL(3'579'545)/16); // this is a guess m_pit8253[1]->out_handler<2>().set(FUNC(wackygtr_state::alligator_ck<4>)); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); } diff --git a/src/mame/namco/warpwarp_v.cpp b/src/mame/namco/warpwarp_v.cpp index af943a6b2ef58..d07db51ffcd18 100644 --- a/src/mame/namco/warpwarp_v.cpp +++ b/src/mame/namco/warpwarp_v.cpp @@ -151,16 +151,12 @@ void warpwarp_state::warpwarp_palette(palette_device &palette) const /* convert from 32x32 to 34x28 */ TILEMAP_MAPPER_MEMBER(warpwarp_state::tilemap_scan) { - int offs; - row += 2; col--; if (col & 0x20) - offs = row + ((col & 1) << 5); + return row + ((col & 1) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(warpwarp_state::geebee_get_tile_info) diff --git a/src/mame/ncr/dmv.cpp b/src/mame/ncr/dmv.cpp index 69237aa5400be..924849184d3ae 100644 --- a/src/mame/ncr/dmv.cpp +++ b/src/mame/ncr/dmv.cpp @@ -402,27 +402,28 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( dmv_state::hgdc_draw_text ) QUICKLOAD_LOAD_MEMBER(dmv_state::quickload_cb) { - /* Avoid loading a program if CP/M-80 is not in memory */ + // Avoid loading a program if CP/M-80 is not in memory if ((m_ram->base()[0] != 0xc3) || (m_ram->base()[5] != 0xc3)) - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); + const int mem_avail = 256 * m_ram->base()[7] + m_ram->base()[6] - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); - /* Load image to the TPA (Transient Program Area) */ + // Load image to the TPA (Transient Program Area) uint16_t quickload_size = image.length(); for (uint16_t i = 0; i < quickload_size; i++) { uint8_t data; - if (image.fread( &data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - m_ram->base()[i+0x100] = data; + if (image.fread(&data, 1) != 1) + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + m_ram->base()[i + 0x100] = data; } - m_ram->base()[0x80] = m_ram->base()[0x81] = 0; // clear out command tail + m_ram->base()[0x80] = m_ram->base()[0x81] = 0; // clear out command tail - m_maincpu->set_pc(0x100); // start program - m_maincpu->set_state_int(Z80_SP, 256 * m_ram->base()[7] - 300); // put the stack a bit before BDOS + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); // put the stack a bit before BDOS + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } diff --git a/src/mame/nec/pc6001.cpp b/src/mame/nec/pc6001.cpp index 5187f2e17fc62..a62687193525d 100644 --- a/src/mame/nec/pc6001.cpp +++ b/src/mame/nec/pc6001.cpp @@ -1128,7 +1128,7 @@ static INPUT_PORTS_START( pc6001 ) PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0a PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0b lf PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0c vt - PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(27) + PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0e cr PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0f so diff --git a/src/mame/nec/pc9801.cpp b/src/mame/nec/pc9801.cpp index ac6b0d98da4a9..c2a7e7661dd4e 100644 --- a/src/mame/nec/pc9801.cpp +++ b/src/mame/nec/pc9801.cpp @@ -1246,7 +1246,7 @@ void pc9801vm_state::upd7220_grcg_2_map(address_map &map) map(0x00000, 0x3ffff).rw(FUNC(pc9801vm_state::upd7220_grcg_r), FUNC(pc9801vm_state::upd7220_grcg_w)).share("video_ram_2"); } -CUSTOM_INPUT_MEMBER(pc98_base_state::system_type_r) +ioport_value pc98_base_state::system_type_r() { // System Type (0x00 stock PC-9801, 0xc0 PC-9801U / PC-98LT, PC-98HA, 0x80 others) return m_sys_type; diff --git a/src/mame/nec/pc9801.h b/src/mame/nec/pc9801.h index 30ef597bb4152..0649027eef8f9 100644 --- a/src/mame/nec/pc9801.h +++ b/src/mame/nec/pc9801.h @@ -101,7 +101,7 @@ class pc98_base_state : public driver_device { } - DECLARE_CUSTOM_INPUT_MEMBER(system_type_r); + ioport_value system_type_r(); protected: required_device m_gfxdecode; diff --git a/src/mame/nec/pce_cd.cpp b/src/mame/nec/pce_cd.cpp index 87ec67f30189c..f62b8861664de 100644 --- a/src/mame/nec/pce_cd.cpp +++ b/src/mame/nec/pce_cd.cpp @@ -23,7 +23,7 @@ PC Engine CD HW sub-portion: - Audio CD player rewind/fast forward don't work properly \- never go past 1 minute mark, underflows; - Fader feature is sketchy and unchecked against real HW; -- Implement proper check condition errors (non-SCSI complaint); +- Implement proper check condition errors (non-SCSI compliant); **************************************************************************************************/ diff --git a/src/mame/neogeo/midas.cpp b/src/mame/neogeo/midas.cpp index ac6dd4f966c8c..c68983ed45b0d 100644 --- a/src/mame/neogeo/midas.cpp +++ b/src/mame/neogeo/midas.cpp @@ -579,14 +579,14 @@ static INPUT_PORTS_START( hammer ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("HAMMER") // bc0000 - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize1", ticket_dispenser_device, line_r) // prize 1 sensor ("tejisw 1") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize2", ticket_dispenser_device, line_r) // prize 2 sensor ("tejisw 2") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_IMPULSE(5) PORT_NAME( "Hammer" ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize1", ticket_dispenser_device, line_r) // prize 1 sensor ("tejisw 1") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize2", ticket_dispenser_device, line_r) // prize 2 sensor ("tejisw 2") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_IMPULSE(5) PORT_NAME( "Hammer" ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -671,17 +671,9 @@ void midas_state::hammer(machine_config &config) EEPROM_93C46_16BIT(config, m_eeprom); - TICKET_DISPENSER(config, m_prize[0], 0); - m_prize[0]->set_period(attotime::from_msec(1000*5)); - m_prize[0]->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); - - TICKET_DISPENSER(config, m_prize[1], 0); - m_prize[1]->set_period(attotime::from_msec(1000*5)); - m_prize[1]->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); - - TICKET_DISPENSER(config, m_ticket, 0); - m_ticket->set_period(attotime::from_msec(200)); - m_ticket->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); + TICKET_DISPENSER(config, m_prize[0], attotime::from_msec(1000*5)); + TICKET_DISPENSER(config, m_prize[1], attotime::from_msec(1000*5)); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/neogeo/neogeo.cpp b/src/mame/neogeo/neogeo.cpp index f58a635b724b8..87de6d74d898d 100644 --- a/src/mame/neogeo/neogeo.cpp +++ b/src/mame/neogeo/neogeo.cpp @@ -915,7 +915,7 @@ uint16_t ngarcade_base_state::in1_edge_joy_r() return ((m_edge->in1_r() & m_ctrl2->read_ctrl()) << 8) | 0xff; } -CUSTOM_INPUT_MEMBER(ngarcade_base_state::startsel_edge_joy_r) +ioport_value ngarcade_base_state::startsel_edge_joy_r() { uint32_t ret = m_edge->read_start_sel() | ~0x05; if (m_ctrl1) @@ -1059,7 +1059,7 @@ void ngarcade_base_state::save_ram_w(offs_t offset, uint16_t data, uint16_t mem_ * *************************************/ -CUSTOM_INPUT_MEMBER(neogeo_base_state::get_memcard_status) +ioport_value neogeo_base_state::get_memcard_status() { // D0 and D1 are memcard 1 and 2 presence indicators, D2 indicates memcard // write protect status (we are always write enabled) @@ -1095,7 +1095,7 @@ void neogeo_base_state::memcard_w(offs_t offset, uint16_t data, uint16_t mem_mas * *************************************/ -CUSTOM_INPUT_MEMBER(neogeo_base_state::get_audio_result) +ioport_value neogeo_base_state::get_audio_result() { uint8_t ret = m_soundlatch2->read(); diff --git a/src/mame/neogeo/neogeo.h b/src/mame/neogeo/neogeo.h index 7b47e36c0fb37..741f4e40781e6 100644 --- a/src/mame/neogeo/neogeo.h +++ b/src/mame/neogeo/neogeo.h @@ -43,8 +43,8 @@ class neogeo_base_state : public driver_device { public: - DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status); - DECLARE_CUSTOM_INPUT_MEMBER(get_audio_result); + ioport_value get_memcard_status(); + ioport_value get_audio_result(); protected: neogeo_base_state(const machine_config &mconfig, device_type type, const char *tag) @@ -222,7 +222,7 @@ class neogeo_base_state : public driver_device class ngarcade_base_state : public neogeo_base_state { public: - DECLARE_CUSTOM_INPUT_MEMBER(startsel_edge_joy_r); + ioport_value startsel_edge_joy_r(); protected: ngarcade_base_state(const machine_config &mconfig, device_type type, const char *tag) diff --git a/src/mame/nintendo/gba.cpp b/src/mame/nintendo/gba.cpp index 93401f513c6ac..f483f317dcca3 100644 --- a/src/mame/nintendo/gba.cpp +++ b/src/mame/nintendo/gba.cpp @@ -17,6 +17,7 @@ #include "cpu/arm7/arm7.h" #include "cpu/arm7/arm7core.h" #include "sound/gb.h" + #include "softlist_dev.h" #include "speaker.h" @@ -148,8 +149,8 @@ void gba_state::request_irq(uint32_t int_type) // master enable? if (IME & 1) { - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } } } @@ -1182,12 +1183,12 @@ uint32_t gba_state::gba_10000000_r(offs_t offset, uint32_t mem_mask) { auto &mspace = m_maincpu->space(AS_PROGRAM); uint32_t data; - uint32_t pc = m_maincpu->state_int(ARM7_PC); + uint32_t pc = m_maincpu->state_int(arm7_cpu_device::ARM7_PC); if (pc >= 0x10000000) { return 0; } - uint32_t cpsr = m_maincpu->state_int(ARM7_CPSR); + uint32_t cpsr = m_maincpu->state_int(arm7_cpu_device::ARM7_CPSR); if (T_IS_SET( cpsr)) { data = mspace.read_dword(pc + 8); diff --git a/src/mame/nintendo/nds.cpp b/src/mame/nintendo/nds.cpp index 81fbcd857afcb..fde2e24128aca 100644 --- a/src/mame/nintendo/nds.cpp +++ b/src/mame/nintendo/nds.cpp @@ -839,8 +839,8 @@ void nds_state::request_irq(int cpu, uint32_t int_type) { if (cpu == 0) { - m_arm9->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); - m_arm9->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_arm9->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); + m_arm9->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } else { @@ -851,8 +851,8 @@ void nds_state::request_irq(int cpu, uint32_t int_type) m_arm7halted = false; } - m_arm7->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); - m_arm7->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_arm7->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); + m_arm7->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } } } diff --git a/src/mame/nintendo/nds.h b/src/mame/nintendo/nds.h index 4e180898f93e7..3a483f2273e80 100644 --- a/src/mame/nintendo/nds.h +++ b/src/mame/nintendo/nds.h @@ -6,7 +6,6 @@ #define MAME_NINTENDO_NDS_H #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/bankdev.h" #include "machine/timer.h" diff --git a/src/mame/nintendo/nes_arcade_bl.cpp b/src/mame/nintendo/nes_arcade_bl.cpp index 490b352956070..2efbd0d6daaf8 100644 --- a/src/mame/nintendo/nes_arcade_bl.cpp +++ b/src/mame/nintendo/nes_arcade_bl.cpp @@ -328,6 +328,9 @@ ROM_START( smb3bl ) ROM_LOAD( "mario_3-6.bin", 0x10000, 0x10000, CRC(a88664e0) SHA1(327d246f198713f20adc7764ee539d18eb0b82ad) ) // hvc-um-0 chr [2/2] IDENTICAL ROM_REGION( 0x8000, "timercpu", 0 ) + /* 2KiB content repeated 8 times to fill the upper half of the ROM (lower half is empty). + Also seen using a 27C128 (16K*8) with the 2KiB content repeated 8 times to fill the entire ROM, with CRC(986fb6b3) and + SHA1(fa205601adf15947bb073afd5fbd57cd971bff7d) */ ROM_LOAD( "nes_jamma_base.bin", 0x0000, 0x4000, CRC(ea276bdd) SHA1(1cd5916e9a6ea9e40526a4fe55b846ca1818fd5f) ) // BADADDR x-xxxxxxxxxxxxx ROM_CONTINUE( 0x0000, 0x4000 ) ROM_END diff --git a/src/mame/nintendo/nes_vt02_vt03.cpp b/src/mame/nintendo/nes_vt02_vt03.cpp index bc6604f7dc68d..90f3e45404329 100644 --- a/src/mame/nintendo/nes_vt02_vt03.cpp +++ b/src/mame/nintendo/nes_vt02_vt03.cpp @@ -1382,6 +1382,12 @@ ROM_START( gamezn2 ) ROM_LOAD16_WORD_SWAP( "gamezone2.bin", 0x00000, 0x400000, CRC(f7b2d609) SHA1(7d2d8f6e822c4e6b97e9accaa524b7910c6b97bf) ) // byteswapped as protection? ROM_END +ROM_START( tvmjfc ) + ROM_REGION( 0x200000, "mainrom", 0 ) + ROM_LOAD( "s29al016m90tfir2_tsop48.bin", 0x00000, 0x200000, CRC(28ef6219) SHA1(7ac2592f2a88532f537629660074ebae08efab82) ) +ROM_END + + void nes_vt_state::init_protpp() @@ -1594,3 +1600,6 @@ CONS( 201?, ppgc200g, 0, 0, nes_vt_pal_8mb, nes_vt, nes_vt_state, emp // unknown tech level, it's most likely a vt09 or vt369 but isn't using any of the extended features CONS( 201?, dgun2869, 0, 0, nes_vt_16mb, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "My Arcade Retro Micro Controller - 220 Built-In Video Games (DGUN-2869)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) CONS( 201?, dgun2959, 0, 0, nes_vt_pal_16mb, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "My Arcade Plug And Play 220 Game Retro Controller (DGUN-2959)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) + +// needs inputs - unit is a Mahjong controller. This is said to be a hack(?) of a Famicom game (unless it was licensed by the original developer) +CONS( 200?, tvmjfc, 0, 0, nes_vt_2mb, nes_vt, nes_vt_state, empty_init, "bootleg?", "TV Mahjong Game (VTxx hardware)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/nintendo/vsnes.cpp b/src/mame/nintendo/vsnes.cpp index 6c4679cafbbdd..ebaf27d2ba668 100644 --- a/src/mame/nintendo/vsnes.cpp +++ b/src/mame/nintendo/vsnes.cpp @@ -184,6 +184,7 @@ class vs_base_state : public driver_device { } + virtual void machine_start() override; virtual void machine_reset() override; template void vsnes_coin_counter_w(offs_t offset, u8 data); @@ -217,11 +218,11 @@ class vs_base_state : public driver_device memory_bank_array_creator<4> m_prg_banks; memory_view m_prg_view; - int m_prg_chunks = 0; + u32 m_prg_chunks = 0; memory_bank_array_creator<8> m_chr_banks; memory_view m_chr_view; - int m_chr_chunks = 0; + u32 m_chr_chunks = 0; bool m_has_gun = false; @@ -232,9 +233,9 @@ class vs_base_state : public driver_device optional_ioport m_gunx; optional_ioport m_guny; - int m_coin = 0; - int m_input_latch[4]{}; - int m_input_strobe[2]{}; + u8 m_coin = 0; + u32 m_input_latch[4]{}; + u8 m_input_strobe[2]{}; }; class vs_uni_state : public vs_base_state @@ -269,32 +270,32 @@ class vs_uni_state : public vs_base_state virtual void machine_start() override; private: - void vsnormal_vrom_banking(u8 data); - void vskonami_rom_banking(offs_t offset, u8 data); + void vsnormal_vrom_banking_w(u8 data); + void vskonami_rom_banking_w(offs_t offset, u8 data); void vsgshoe_gun_in0_w(u8 data); - void drmario_rom_banking(offs_t offset, u8 data); - void vsvram_rom_banking(u8 data); - void vs108_rom_banking(offs_t offset, u8 data); + void drmario_rom_banking_w(offs_t offset, u8 data); + void vsvram_rom_banking_w(u8 data); + void vs108_rom_banking_w(offs_t offset, u8 data); u8 rbibb_prot_r(offs_t offset); u8 supxevs_prot_1_r(); u8 supxevs_prot_2_r(); u8 supxevs_prot_3_r(); u8 supxevs_prot_4_r(); u8 tkoboxng_prot_r(offs_t offset); - void sunsoft3_rom_banking(offs_t offset, u8 data); + void sunsoft3_rom_banking_w(offs_t offset, u8 data); void set_bnglngby_irq_w(u8 data); u8 set_bnglngby_irq_r(); void v_set_videorom_bank(int start, int count, int vrom_start_bank); - int m_mmc1_shiftreg = 0; - int m_mmc1_shiftcount = 0; - int m_mmc1_prg16k = 0; - int m_mmc1_switchlow = 0; - int m_mmc1_chr4k = 0; - int m_108_reg = 0; - int m_prot_index = 0; - int m_ret = 0; + u8 m_mmc1_shiftreg = 0; + u8 m_mmc1_shiftcount = 0; + bool m_mmc1_prg16k = false; + u8 m_mmc1_switchlow = 0; + bool m_mmc1_chr4k = false; + u8 m_108_reg = 0; + u8 m_prot_index = 0; + u8 m_ret = 0; }; class vs_dual_state : public vs_base_state @@ -312,7 +313,7 @@ class vs_dual_state : public vs_base_state virtual void machine_start() override; private: - template void vsdual_vrom_banking(u8 data); + template void vsdual_vrom_banking_w(u8 data); }; class vs_smbbl_state : public vs_base_state @@ -347,7 +348,7 @@ class vs_smbbl_state : public vs_base_state u8 m_bootleg_sound_offset = 0; u8 m_bootleg_sound_data = 0; - int m_bootleg_latched_scanline = 0; + s32 m_bootleg_latched_scanline = 0; }; @@ -369,7 +370,8 @@ template u8 vs_base_state::vsnes_coin_counter_r(offs_t offset) { // reads effectively write MSB of address (via open bus) to coin counter - machine().bookkeeping().coin_counter_w(Side, BIT(offset, 8)); + if (!machine().side_effects_disabled()) + machine().bookkeeping().coin_counter_w(Side, BIT(offset, 8)); // only for platoon return m_coin; @@ -382,8 +384,8 @@ void vs_base_state::vsnes_in0_w(u8 data) if (m_input_strobe[Side] & ~data & 1) { // load up the latches - int p1 = 2 * Side; - int p2 = p1 + 1; + const u8 p1 = 2 * Side; + const u8 p2 = p1 + 1; m_input_latch[p1] = m_in[p1]->read(); m_input_latch[p2] = m_in[p2]->read(); @@ -397,17 +399,21 @@ void vs_base_state::vsnes_in0_w(u8 data) template u8 vs_base_state::vsnes_in0_r() { - int p1 = 2 * Side; + const u8 p1 = 2 * Side; - if (m_input_strobe[Side] & 1) + if (!machine().side_effects_disabled()) { - m_input_latch[p1] = m_in[p1]->read(); - if (m_has_gun && m_sensor->detect_light(m_gunx->read(), m_guny->read())) - m_input_latch[p1] |= 0x40; + if (m_input_strobe[Side] & 1) + { + m_input_latch[p1] = m_in[p1]->read(); + if (m_has_gun && m_sensor->detect_light(m_gunx->read(), m_guny->read())) + m_input_latch[p1] |= 0x40; + } } - int ret = m_input_latch[p1] & 1; - m_input_latch[p1] >>= 1; + u8 ret = m_input_latch[p1] & 1; + if (!machine().side_effects_disabled()) + m_input_latch[p1] >>= 1; // FIXME: UniSystem's wiring harness connects S Coin 2 to S Coin 1 edge hardness // This should mean games that don't check Coin 2 inputs respond on UniSys, but on DualSys they'd miss the Coin 2 inserts as all 4 inputs are separate? @@ -423,16 +429,23 @@ u8 vs_base_state::vsnes_in1_r() { // Only the Sub side CPU can kick the watchdog, which it must do by periodically reading $4017. // This is one reason UniSystem games too must be installed on the Sub side. - if (m_watchdog && Side == SUB) - m_watchdog->watchdog_reset(); + if (!machine().side_effects_disabled()) + { + if (m_watchdog && Side == SUB) + m_watchdog->watchdog_reset(); + } - int p2 = 2 * Side + 1; + const u8 p2 = 2 * Side + 1; - if (m_input_strobe[Side] & 1) - m_input_latch[p2] = m_in[p2]->read(); + if (!machine().side_effects_disabled()) + { + if (m_input_strobe[Side] & 1) + m_input_latch[p2] = m_in[p2]->read(); + } - int ret = m_input_latch[p2] & 1; - m_input_latch[p2] >>= 1; + u8 ret = m_input_latch[p2] & 1; + if (!machine().side_effects_disabled()) + m_input_latch[p2] >>= 1; ret |= m_dsw[Side]->read() & ~3; // merge the rest of the dipswitches @@ -508,8 +521,17 @@ void vs_uni_state::v_set_videorom_bank(int start, int count, int vrom_start_bank m_chr_banks[i + start]->set_entry(vrom_start_bank + i); } +void vs_base_state::machine_start() +{ + save_item(NAME(m_coin)); + save_item(NAME(m_input_latch)); + save_item(NAME(m_input_strobe)); +} + void vs_uni_state::machine_start() { + vs_base_state::machine_start(); + // establish chr banks // DRIVER_INIT is called first - means we can handle this different for VRAM games! if (m_gfx1_rom != nullptr) @@ -526,15 +548,26 @@ void vs_uni_state::machine_start() } else m_chr_view.select(0); + + save_item(NAME(m_mmc1_shiftreg)); + save_item(NAME(m_mmc1_shiftcount)); + save_item(NAME(m_mmc1_prg16k)); + save_item(NAME(m_mmc1_switchlow)); + save_item(NAME(m_mmc1_chr4k)); + save_item(NAME(m_108_reg)); + save_item(NAME(m_prot_index)); + save_item(NAME(m_ret)); } void vs_dual_state::machine_start() { + vs_base_state::machine_start(); + for (int i = 0; i < 2; i++) { const char *region = i ? "gfx2" : "gfx1"; u8 *base = memregion(region)->base(); - int entries = memregion(region)->bytes() / 0x2000; + const u32 entries = memregion(region)->bytes() / 0x2000; m_chr_banks[i]->configure_entries(0, entries, base, 0x2000); m_chr_banks[i]->set_entry(0); } @@ -542,12 +575,18 @@ void vs_dual_state::machine_start() void vs_smbbl_state::machine_start() { + vs_base_state::machine_start(); + m_ppu1->set_scanline_callback(*this, FUNC(vs_smbbl_state::smbbl_scanline_cb)); u8 *base = m_gfx1_rom->base(); - int entries = m_gfx1_rom->bytes() / 0x2000; + const u32 entries = m_gfx1_rom->bytes() / 0x2000; m_chr_banks[0]->configure_entries(0, entries, base, 0x2000); m_chr_banks[0]->set_entry(0); + + save_item(NAME(m_bootleg_sound_offset)); + save_item(NAME(m_bootleg_sound_data)); + save_item(NAME(m_bootleg_latched_scanline)); } /********************************************************************************** @@ -559,7 +598,7 @@ void vs_smbbl_state::machine_start() //********************************************************************************** // Most games: VROM Banking in controller 0 write -void vs_uni_state::vsnormal_vrom_banking(u8 data) +void vs_uni_state::vsnormal_vrom_banking_w(u8 data) { // switch vrom v_set_videorom_bank(0, 8, (data & 4) ? 8 : 0); @@ -573,7 +612,7 @@ void vs_uni_state::vsnormal_vrom_banking(u8 data) void vs_uni_state::init_vsnormal() { // vrom switching is enabled with bit 2 of $4016 - m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_uni_state::vsnormal_vrom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_uni_state::vsnormal_vrom_banking_w))); } //********************************************************************************** @@ -588,7 +627,7 @@ void vs_uni_state::init_vsgun() //********************************************************************************** // Konami VRC1 games: ROM banking at $8000-$ffff -void vs_uni_state::vskonami_rom_banking(offs_t offset, u8 data) +void vs_uni_state::vskonami_rom_banking_w(offs_t offset, u8 data) { int reg = BIT(offset, 12, 3); @@ -616,7 +655,7 @@ void vs_uni_state::init_vskonami() init_prg_banking(); // banking is done with writes to the $8000-$ffff area - m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::vskonami_rom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::vskonami_rom_banking_w))); } //********************************************************************************** @@ -628,7 +667,7 @@ void vs_uni_state::vsgshoe_gun_in0_w(u8 data) m_prg_banks[0]->set_entry(BIT(data, 2)); // otherwise do normal CHR banking and IO write - vsnormal_vrom_banking(data); + vsnormal_vrom_banking_w(data); } void vs_uni_state::init_vsgshoe() @@ -645,13 +684,13 @@ void vs_uni_state::init_vsgshoe() //********************************************************************************** // MMC1 (Dr Mario): ROM banking at $8000-$ffff -void vs_uni_state::drmario_rom_banking(offs_t offset, u8 data) +void vs_uni_state::drmario_rom_banking_w(offs_t offset, u8 data) { // reset mapper if (data & 0x80) { m_mmc1_shiftcount = 0; - m_mmc1_prg16k = 1; + m_mmc1_prg16k = true; m_mmc1_switchlow = 1; return; @@ -702,7 +741,7 @@ void vs_uni_state::init_drmario() init_prg_banking(); // MMC1 mapper at $8000-$ffff - m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::drmario_rom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::drmario_rom_banking_w))); m_mmc1_shiftreg = 0; m_mmc1_shiftcount = 0; @@ -711,7 +750,7 @@ void vs_uni_state::init_drmario() //********************************************************************************** // (UNROM) Games with VRAM instead of graphics ROMs: ROM banking at $8000-$ffff -void vs_uni_state::vsvram_rom_banking(u8 data) +void vs_uni_state::vsvram_rom_banking_w(u8 data) { prg16(0, data); } @@ -722,13 +761,13 @@ void vs_uni_state::init_vsvram() init_prg_banking(); // banking is done with writes to the $8000-$ffff area - m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8smo_delegate(*this, FUNC(vs_uni_state::vsvram_rom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8smo_delegate(*this, FUNC(vs_uni_state::vsvram_rom_banking_w))); } //********************************************************************************** // (Namco) 108 (MMC3 predecessor) games -void vs_uni_state::vs108_rom_banking(offs_t offset, u8 data) +void vs_uni_state::vs108_rom_banking_w(offs_t offset, u8 data) { switch (offset & 0x6001) { @@ -752,7 +791,7 @@ void vs_uni_state::vs108_rom_banking(offs_t offset, u8 data) break; default: - logerror("vs108_rom_banking uncaught: %04x value: %02x\n", offset + 0x8000, data); + logerror("vs108_rom_banking_w uncaught: %04x value: %02x\n", offset + 0x8000, data); break; } } @@ -767,7 +806,7 @@ void vs_uni_state::init_vs108() m_108_reg = 0; // 108 chip at $8000-$9fff - m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::vs108_rom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::vs108_rom_banking_w))); } // Vs. RBI Baseball @@ -785,11 +824,15 @@ u8 vs_uni_state::rbibb_prot_r(offs_t offset) if (offset == 0) { - m_prot_index = 0; + if (!machine().side_effects_disabled()) + m_prot_index = 0; return 0; } - return prot_data[m_prot_index++ & 0x1f]; + const u8 prot_index = m_prot_index; + if (!machine().side_effects_disabled()) + m_prot_index++; + return prot_data[prot_index & 0x1f]; } void vs_uni_state::init_rbibb() @@ -805,7 +848,8 @@ void vs_uni_state::init_rbibb() u8 vs_uni_state::supxevs_prot_1_r() { - m_prot_index ^= 1; + if (!machine().side_effects_disabled()) + m_prot_index ^= 1; return 0x05; } @@ -850,11 +894,15 @@ u8 vs_uni_state::tkoboxng_prot_r(offs_t offset) if (offset == 0) { - m_prot_index = 0; + if (!machine().side_effects_disabled()) + m_prot_index = 0; return 0; } - return prot_data[m_prot_index++ & 0x1f]; + const u8 prot_index = m_prot_index; + if (!machine().side_effects_disabled()) + m_prot_index++; + return prot_data[prot_index & 0x1f]; } void vs_uni_state::init_tkoboxng() @@ -876,7 +924,7 @@ void vs_uni_state::init_vsfdf() //********************************************************************************** // Sunsoft-3 (Platoon) rom banking -void vs_uni_state::sunsoft3_rom_banking(offs_t offset, u8 data) +void vs_uni_state::sunsoft3_rom_banking_w(offs_t offset, u8 data) { switch (offset & 0x7800) { @@ -899,7 +947,7 @@ void vs_uni_state::init_platoon() // point program banks to last 32K init_prg_banking(); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::sunsoft3_rom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8sm_delegate(*this, FUNC(vs_uni_state::sunsoft3_rom_banking_w))); } //********************************************************************************** @@ -934,7 +982,7 @@ void vs_uni_state::init_bnglngby() // VS DualSystem template -void vs_dual_state::vsdual_vrom_banking(u8 data) +void vs_dual_state::vsdual_vrom_banking_w(u8 data) { // switch vrom m_chr_banks[Side]->set_entry(BIT(data, 2)); @@ -950,8 +998,8 @@ void vs_dual_state::vsdual_vrom_banking(u8 data) void vs_dual_state::init_vsdual() { // vrom switching is enabled with bit 2 of $4016 - m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_dual_state::vsdual_vrom_banking
))); - m_subcpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_dual_state::vsdual_vrom_banking))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_dual_state::vsdual_vrom_banking_w
))); + m_subcpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_dual_state::vsdual_vrom_banking_w))); } //********************************************************************************** @@ -972,7 +1020,7 @@ u8 vs_smbbl_state::smbbl_ppu_data_r() { // CPU always reads higher CHR ROM banks from $2007, PPU always reads lower ones m_chr_banks[0]->set_entry(1); - u8 data = m_ppu1->read(0x2007); + const u8 data = m_ppu1->read(0x2007); m_chr_banks[0]->set_entry(0); return data; diff --git a/src/mame/nmk/ddealer.cpp b/src/mame/nmk/ddealer.cpp index 65f769a91b92f..54b2513e03f62 100644 --- a/src/mame/nmk/ddealer.cpp +++ b/src/mame/nmk/ddealer.cpp @@ -10,11 +10,10 @@ TODO: - Understand better the video emulation and convert it to tilemaps; - - Check audio IRQ frequency (controls music tempo, if too high 2 Player mode becomes slow) ========================================================================================================== - pcb marked GD91071 + pcb marked GD91071 68000P10 YM2203C @@ -30,12 +29,13 @@ *********************************************************************************************************/ - #include "emu.h" + #include "cpu/m68000/m68000.h" #include "cpu/tlcs90/tlcs90.h" #include "machine/timer.h" #include "sound/ymopn.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -57,6 +57,7 @@ class ddealer_state : public driver_device m_work_ram(*this, "work_ram"), m_mcu_shared_ram(*this, "mcu_shared_ram"), m_in0_io(*this, "IN0"), + m_vtiming_prom(*this, "vtiming"), m_maincpu(*this, "maincpu"), m_protcpu(*this, "protcpu"), m_screen(*this, "screen"), @@ -66,6 +67,11 @@ class ddealer_state : public driver_device void ddealer(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + private: void flipscreen_w(u16 data); void back_vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); @@ -88,9 +94,7 @@ class ddealer_state : public driver_device void ddealer_map(address_map &map); void prot_map(address_map &map); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; + TIMER_DEVICE_CALLBACK_MEMBER(ddealer_scanline); // memory pointers required_shared_ptr m_vregs; @@ -99,6 +103,7 @@ class ddealer_state : public driver_device required_shared_ptr m_work_ram; required_shared_ptr m_mcu_shared_ram; required_ioport m_in0_io; + required_memory_region m_vtiming_prom; // devices required_device m_maincpu; @@ -114,17 +119,20 @@ class ddealer_state : public driver_device tilemap_t *m_fg_tilemap_left; tilemap_t *m_fg_tilemap_right; - u8 m_bus_status; + u8 m_bus_status = 0; + u8 m_interrupt_trigger = 0; }; void ddealer_state::machine_start() { save_item(NAME(m_bus_status)); + save_item(NAME(m_interrupt_trigger)); } void ddealer_state::machine_reset() { m_bus_status = 0x04; + m_interrupt_trigger = 0x01; } void ddealer_state::mcu_port6_w(u8 data) @@ -167,8 +175,7 @@ void ddealer_state::mcu_side_shared_w(offs_t offset, u8 data) u8 ddealer_state::mcu_side_shared_r(offs_t offset) { - u8 retval = m_maincpu->space(AS_PROGRAM).read_byte((offset)); - return retval; + return m_maincpu->space(AS_PROGRAM).read_byte(offset); } void ddealer_state::prot_map(address_map &map) @@ -193,20 +200,14 @@ TILE_GET_INFO_MEMBER(ddealer_state::get_back_tile_info) { u32 code, color; get_tile_info(m_back_vram[tile_index], code, color); - tileinfo.set(0, - code, - color, - 0); + tileinfo.set(0, code, color, 0); } TILE_GET_INFO_MEMBER(ddealer_state::get_fg_tile_info) { u32 code, color; get_tile_info(m_fg_vram[tile_index], code, color); - tileinfo.set(1, - code, - color, - 0); + tileinfo.set(1, code, color, 0); } template @@ -214,10 +215,7 @@ TILE_GET_INFO_MEMBER(ddealer_state::get_fg_splitted_tile_info) { u32 code, color; get_tile_info(m_fg_vram[Offset + (tile_index & 0x17ff)], code, color); - tileinfo.set(1, - code, - color, - 0); + tileinfo.set(1, code, color, 0); } TILEMAP_MAPPER_MEMBER(ddealer_state::scan_fg) @@ -229,26 +227,26 @@ void ddealer_state::video_start() { m_back_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_back_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, - tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_tile_info)), - tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), - 16, 16, 256, 32); + tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_tile_info)), + tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), + 16, 16, 256, 32); m_fg_tilemap_left = &machine().tilemap().create(*m_gfxdecode, - tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_splitted_tile_info<0>)), - tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), - 16, 16, 128, 32); + tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_splitted_tile_info<0>)), + tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), + 16, 16, 128, 32); m_fg_tilemap_right = &machine().tilemap().create(*m_gfxdecode, - tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_splitted_tile_info<0x800>)), - tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), - 16, 16, 128, 32); + tilemap_get_info_delegate(*this, FUNC(ddealer_state::get_fg_splitted_tile_info<0x800>)), + tilemap_mapper_delegate(*this, FUNC(ddealer_state::scan_fg)), + 16, 16, 128, 32); m_fg_tilemap->set_transparent_pen(15); m_fg_tilemap_left->set_transparent_pen(15); m_fg_tilemap_right->set_transparent_pen(15); - m_back_tilemap->set_scrolldx(64,64); - m_fg_tilemap->set_scrolldx(64,64); - m_fg_tilemap_left->set_scrolldx(64,64); - m_fg_tilemap_right->set_scrolldx(64,64); + m_back_tilemap->set_scrolldx(28+64,28+64); + m_fg_tilemap->set_scrolldx(28+64,28+64); + m_fg_tilemap_left->set_scrolldx(28+64,28+64); + m_fg_tilemap_right->set_scrolldx(28+64,28+64); } void ddealer_state::draw_video_layer(u16* vreg_base, tilemap_t *tmap, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -423,14 +421,68 @@ static GFXDECODE_START( gfx_ddealer ) GFXDECODE_ENTRY( "fgrom", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) GFXDECODE_END +/* + Summary of triggered IRQs: + + - IRQ1: + - At 102 scanline + + - IRQ4: (VBOUT) + - At 240 scanline (VBOUT = start of VBLANK = end of active video) + + Refer to nmk16.cpp for a more thorough description. +*/ +TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_scanline) +{ +// constexpr int SPRDMA_INDEX = 0; // not used in emulation +// constexpr int VSYNC_INDEX = 1; // not used in emulation +// constexpr int VBLANK_INDEX = 2; // not used in emulation +// constexpr int NOT_USED = 3; // not used in emulation + constexpr int IPL0_INDEX = 4; + constexpr int IPL1_INDEX = 5; + constexpr int IPL2_INDEX = 6; + constexpr int TRIGG_INDEX = 7; + + constexpr int PROM_START_OFFSET = 0x75; // previous entries are never addressed + constexpr int PROM_FRAME_OFFSET = 0x0b; // first 11 "used" entries (from 0x75 to 0x7f: 0xb entries) are prior to start of frame, which occurs on 0x80 address (128 entry) + + u8 *prom = m_vtiming_prom->base(); + int len = m_vtiming_prom->bytes(); + + int scanline = param; + + // every PROM entry is addressed each 2 scanlines, so only even lines are actually addressing it: + if ((scanline & 0x1) == 0x0) + { + int promAddress = (((scanline / 2) + PROM_FRAME_OFFSET) % (len - PROM_START_OFFSET)) + PROM_START_OFFSET; + + LOG("ddealer_scanline: Scanline: %03d - Current PROM entry: %03d\n", scanline, promAddress); + + u8 val = prom[promAddress]; + + // Interrupt requests are triggered at raising edge of bit 7: + u8 trigger = BIT(val, TRIGG_INDEX); + if (m_interrupt_trigger == 0 && trigger == 1) + { + u8 int_level = bitswap<3>(val, IPL2_INDEX, IPL1_INDEX, IPL0_INDEX); + if (int_level > 0) + { + LOG("ddealer_scanline: Triggered interrupt: IRQ%d at scanline: %03d\n", int_level, scanline); + m_maincpu->set_input_line(int_level, HOLD_LINE); + } + } + + m_interrupt_trigger = trigger; + } +} + void ddealer_state::ddealer(machine_config &config) { - M68000(config, m_maincpu, XTAL(16'000'000)/2); /* 8MHz */ + M68000(config, m_maincpu, 16_MHz_XTAL/2); // 8MHz m_maincpu->set_addrmap(AS_PROGRAM, &ddealer_state::ddealer_map); - m_maincpu->set_vblank_int("screen", FUNC(ddealer_state::irq4_line_hold)); - m_maincpu->set_periodic_int(FUNC(ddealer_state::irq1_line_hold), attotime::from_hz(60)); //guess, controls music tempo, 112 is way too fast, 90 causes 2 player mode to be too slow + TIMER(config, "scantimer").configure_scanline(FUNC(ddealer_state::ddealer_scanline), "screen", 0, 1); - TMP91640(config, m_protcpu, XTAL(16'000'000)/4); // Toshiba TMP91640 marked as NMK-110, with 16Kbyte internal ROM, 512bytes internal RAM + TMP91640(config, m_protcpu, 16_MHz_XTAL/4); // Toshiba TMP91640 marked as NMK-110, with 16Kbyte internal ROM, 512bytes internal RAM m_protcpu->set_addrmap(AS_PROGRAM, &ddealer_state::prot_map); m_protcpu->port_write<6>().set(FUNC(ddealer_state::mcu_port6_w)); m_protcpu->port_read<5>().set(FUNC(ddealer_state::mcu_port5_r)); @@ -441,36 +493,35 @@ void ddealer_state::ddealer(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_ddealer); 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(512, 256); - screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_raw(16_MHz_XTAL/2, 512, 28, 412, 278, 16, 240); // confirmed screen.set_screen_update(FUNC(ddealer_state::screen_update)); screen.set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 0x200); SPEAKER(config, "mono").front_center(); - YM2203(config, "ymsnd", XTAL(6'000'000) / 8).add_route(ALL_OUTPUTS, "mono", 0.40); /* 7.5KHz */ + YM2203(config, "ymsnd", 6_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.40); // 7.5kHz } ROM_START( ddealer ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "1.ic6", 0x00001, 0x20000, CRC(ce0dff50) SHA1(2d7a03f6b9609aea7511a4dc49560a901b0b9f19) ) ROM_LOAD16_BYTE( "2.ic28", 0x00000, 0x20000, CRC(f00c346f) SHA1(bd73efb19d5f9efc88210d92a82a3f4595b41097) ) ROM_REGION( 0x04000, "protcpu", 0 ) ROM_LOAD( "nmk-110_ddealer.bin", 0x0000, 0x4000, CRC(088db9b4) SHA1(71946399e37ffa9293eceac637b76c9169ac16e6) ) // chip markings are identical to nmk-110 on thunder dragon, code is confirmed to be different - ROM_REGION( 0x20000, "bgrom", 0 ) /* BG */ + ROM_REGION( 0x20000, "bgrom", 0 ) // BG ROM_LOAD( "4.ic65", 0x00000, 0x20000, CRC(4939ff1b) SHA1(af2f2feeef5520d775731a58cbfc8fcc913b7348) ) - ROM_REGION( 0x80000, "fgrom", 0 ) /* FG */ + ROM_REGION( 0x80000, "fgrom", 0 ) // FG ROM_LOAD( "3.ic64", 0x00000, 0x80000, CRC(660e367c) SHA1(54827a8998c58c578c594126d5efc18a92363eaa)) - ROM_REGION( 0x200, "user1", 0 ) /* Proms */ - ROM_LOAD( "5.ic67", 0x000, 0x100, CRC(1d3d7e17) SHA1(b5aa0d024f0c0b5f72a2d0a23d1576775a7b3826) ) // 82S135 - ROM_LOAD( "6.ic86", 0x100, 0x100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // 82S129 + ROM_REGION( 0x0100, "htiming", 0 ) + ROM_LOAD( "6.ic86", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // 82S129 + + ROM_REGION( 0x0100, "vtiming", 0 ) + ROM_LOAD( "5.ic67", 0x0000, 0x0100, CRC(1d3d7e17) SHA1(b5aa0d024f0c0b5f72a2d0a23d1576775a7b3826) ) // 82S135 ROM_END } // anonymous namespace diff --git a/src/mame/nmk/nmk16.cpp b/src/mame/nmk/nmk16.cpp index 08457b5eadb8e..25fb8684d3f25 100644 --- a/src/mame/nmk/nmk16.cpp +++ b/src/mame/nmk/nmk16.cpp @@ -693,7 +693,7 @@ void nmk16_state::bioship_map(address_map &map) void nmk16_state::hachamf_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - // I/O Region + map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); @@ -704,19 +704,13 @@ void nmk16_state::hachamf_map(address_map &map) map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); - - // Video Region map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); - // Main RAM, inc sprites, shared with MCU - - map(0x0f0000, 0x0fffff).ram().share("mainram"); // ram is shared with MCU + map(0x0f0000, 0x0fffff).ram().share("mainram"); // Main RAM, inc sprites, shared with MCU } - - void nmk16_state::tdragon_map(address_map &map) { map(0x000000, 0x03ffff).rom(); @@ -4022,12 +4016,12 @@ GFXDECODE_END void nmk16_state::machine_start() { - save_item(NAME(m_interrupt_trigger)); + save_item(NAME(m_vtiming_val)); } void nmk16_state::machine_reset() { - m_interrupt_trigger = 0x01; + m_vtiming_val = 0xff; } /*************************************************************************** @@ -4104,7 +4098,7 @@ void nmk16_state::machine_reset() For V-timing PROM, it's tipically a 82S135 (256x8bit) (first 117 entries are not used). Some games (such as Comad - ones) use a 82S147 (512x8bit) with A5 tied to GND, using only half of the total space. TODO: currently unsupported + ones) use a 82S147 (512x8bit) with A5 tied to GND, using only half of the total space. The format is: Offset Bits Description @@ -4213,17 +4207,17 @@ void nmk16_state::set_screen_hires(machine_config &config) */ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) { -// constexpr int SPRDMA_INDEX = 0; // not used in emulation TODO: check if it could be used to trigger the sprite DMA instead of setting it 4 lines after VBOUT -// constexpr int VSYNC_INDEX = 1; // not used in emulation -// constexpr int VBLANK_INDEX = 2; // not used in emulation -// constexpr int NOT_USED = 3; // not used in emulation + constexpr int SPRDMA_INDEX = 0; +// constexpr int VSYNC_INDEX = 1; // not used in emulation +// constexpr int VBLANK_INDEX = 2; // not used in emulation +// constexpr int NOT_USED = 3; // not used in emulation constexpr int IPL0_INDEX = 4; constexpr int IPL1_INDEX = 5; constexpr int IPL2_INDEX = 6; constexpr int TRIGG_INDEX = 7; - constexpr int PROM_START_OFFSET = 0x75; // previous entries are never addressed - constexpr int PROM_FRAME_OFFSET = 0x0b; // first 11 "used" entries (from 0x75 to 0x7f: 0xb entries) are prior to start of frame, which occurs on 0x80 address (128 entry) + constexpr int PROM_START_OFFSET = 0x75; // previous entries are never addressed + constexpr int PROM_FRAME_OFFSET = 0x0b; // first 11 "used" entries (from 0x75 to 0x7f: 0xb entries) are prior to start of frame, which occurs on 0x80 address (128 entry) u8 *prom = m_vtiming_prom->base(); int len = m_vtiming_prom->bytes(); @@ -4233,33 +4227,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) // every PROM entry is addressed each 2 scanlines, so only even lines are actually addressing it: if ((scanline & 0x1) == 0x0) { + u8 address = ((((scanline / 2) + PROM_FRAME_OFFSET) % (0x100 - PROM_START_OFFSET)) + PROM_START_OFFSET) % len; - int promAddress = (((scanline / 2) + PROM_FRAME_OFFSET) % (len - PROM_START_OFFSET)) + PROM_START_OFFSET; - - LOG("nmk16_scanline: Scanline: %03d - Current PROM entry: %03d\n", scanline, promAddress); + LOG("nmk16_scanline: Scanline: %03d - Current PROM entry: %03d\n", scanline, address); - u8 val = prom[promAddress]; + u8 val = prom[address]; - // Interrupt requests are triggered at raising edge of bit 7: - u8 trigger = BIT(val, TRIGG_INDEX); - if (m_interrupt_trigger == 0 && trigger == 1) + // Interrupt requests are triggered at rising edge of bit 7: + if (BIT(val & ~m_vtiming_val, TRIGG_INDEX)) { - u8 int_level = bitswap<3>(val, IPL2_INDEX, IPL1_INDEX, IPL0_INDEX); if (int_level > 0) { LOG("nmk16_scanline: Triggered interrupt: IRQ%d at scanline: %03d\n", int_level, scanline); m_maincpu->set_input_line(int_level, HOLD_LINE); } - - // Triggered at VBOUT. TODO: check if this could be triggered using SPRDMA_INDEX instead - if (int_level == 4) - { - m_dma_timer->adjust(m_screen->time_until_pos(scanline + 4)); // as per UPL docs, 256 usec after VBOUT = 4 lines, but index on the PROM says otherwise. - } } - m_interrupt_trigger = trigger; + // Sprite DMA, as per UPL docs, 256 usec after VBOUT = 4 lines, but index on the PROM says otherwise: + if (BIT(val & ~m_vtiming_val, SPRDMA_INDEX)) + sprite_dma(); + + m_vtiming_val = val; } } @@ -4286,7 +4275,7 @@ IRQ4 - V-blanking interrupt LV4 LV2 LV1 LV1 | DISPLAY |<->|<--->| | - |256| 694 | | + |128| 694 | | | us| usec| | | | DMA | | @@ -4305,17 +4294,18 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_hacky_scanline) { const int VBIN_SCANLINE = 16; const int VBOUT_SCANLINE = VBIN_SCANLINE + 224; // VBIN + 224 lines high of active video - const int SPRDMA_SCANLINE = VBOUT_SCANLINE + 4; // 256 usec after VBOUT = 4 lines (each line is 64 USEC) + const int SPRDMA_SCANLINE = VBOUT_SCANLINE + 2; // 2 lines after VBOUT const int IRQ1_SCANLINE_1 = VBIN_SCANLINE + 52; // 52 lines after VBIN and 68 from the start of frame const int IRQ1_SCANLINE_2 = IRQ1_SCANLINE_1 + 128; // 128 lines after IRQ1_SCANLINE_1 int scanline = param; if (scanline == VBOUT_SCANLINE) // vblank-out irq - { m_maincpu->set_input_line(4, HOLD_LINE); - m_dma_timer->adjust(m_screen->time_until_pos(SPRDMA_SCANLINE)/*attotime::from_usec(256)*/); - } + + // sprite DMA after VBOUT + if (scanline == SPRDMA_SCANLINE) + sprite_dma(); /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ @@ -4336,7 +4326,7 @@ void nmk16_state::set_hacky_interrupt_timing(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(nmk16_state::nmk16_hacky_scanline), "screen", 0, 1); } -TIMER_CALLBACK_MEMBER(nmk16_state::dma_callback) +void nmk16_state::sprite_dma() { // 2 buffers confirmed on PCB, 1 on sabotenb memcpy(m_spriteram_old2.get(),m_spriteram_old.get(), 0x1000); @@ -4897,7 +4887,7 @@ void nmk16_state::ssmissin(machine_config &config) // basic machine hardware M68000(config, m_maincpu, 8000000); // 8 Mhz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_map); - set_hacky_interrupt_timing(config); + set_interrupt_timing(config); Z80(config, m_audiocpu, 8000000/2); // 4 Mhz m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_sound_map); @@ -4994,10 +4984,11 @@ void nmk16_state::strahljbl(machine_config &config) seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } +// OSC : 10MHz, 12MHz, 16MHz void nmk16_state::hachamf(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, 10000000); // 10 MHz ? + M68000(config, m_maincpu, 10000000); // MC68000P10, 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::hachamf_map); set_interrupt_timing(config); @@ -5032,8 +5023,16 @@ void nmk16_state::hachamf(machine_config &config) m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } -u8 tdragon_prot_state::mcu_port7_r() +void tdragon_prot_state::hachamf_prot(machine_config &config) { + hachamf(config); + + TMP91640(config, m_protcpu, 4000000); // Toshiba TMP91640 marked as NMK-113, with 16Kbyte internal ROM, 512bytes internal RAM + m_protcpu->set_addrmap(AS_PROGRAM, &tdragon_prot_state::tdragon_prot_map); + m_protcpu->port_write<6>().set(FUNC(tdragon_prot_state::mcu_port6_w)); + m_protcpu->port_read<5>().set(FUNC(tdragon_prot_state::mcu_port5_r)); + m_protcpu->port_read<6>().set(FUNC(tdragon_prot_state::mcu_port6_r)); + // The NMK-113 code contains multiple different codepaths, which appear to be for different games // a value is read from port 7, and masked with 0xf // This happens in various places in the code, with 5 different possible startup programs, and @@ -5057,20 +5056,7 @@ u8 tdragon_prot_state::mcu_port7_r() // 0x0d - unknown // 0x0e - Double Dealer (but we use the single game 110 found on a Double Dealer PCB) // 0x0f - Thunder Dragon (but we use the single game 110 found on a Thunder Dragon PCB) - - return 0x0c; -} - -void tdragon_prot_state::hachamf_prot(machine_config &config) -{ - hachamf(config); - - TMP91640(config, m_protcpu, 4000000); // Toshiba TMP91640 marked as NMK-113, with 16Kbyte internal ROM, 512bytes internal RAM - m_protcpu->set_addrmap(AS_PROGRAM, &tdragon_prot_state::tdragon_prot_map); - m_protcpu->port_write<6>().set(FUNC(tdragon_prot_state::mcu_port6_w)); - m_protcpu->port_read<5>().set(FUNC(tdragon_prot_state::mcu_port5_r)); - m_protcpu->port_read<6>().set(FUNC(tdragon_prot_state::mcu_port6_r)); - m_protcpu->port_read<7>().set(FUNC(tdragon_prot_state::mcu_port7_r)); + m_protcpu->port_read<7>().set_constant(0x0c); config.set_maximum_quantum(attotime::from_hz(6000)); } @@ -5906,6 +5892,18 @@ void nmk16_state::decode_ssmissin() { rom[A] = decode_byte(rom[A], decode_data_ssmissingfx[0]); } + + // Vertical timing ROM is half empty + rom = memregion("vtiming")->base(); + len = memregion("vtiming")->bytes(); + assert(len == 0x200); + for (int A = 0; A < len; A++) + { + if (A < 0x100) + rom[A] = rom[(A & 0x1f) | (A << 1 & 0x1c0)]; + else + rom[A] = 0; + } } void nmk16_state::init_nmk() @@ -7205,7 +7203,7 @@ ROM_START( tdragon1 ) ROM_LOAD16_BYTE( "thund.8", 0x00000, 0x20000, CRC(edd02831) SHA1(d6bc8d2c37707768a8bf666090f33eea12dda336) ) ROM_LOAD16_BYTE( "thund.7", 0x00001, 0x20000, CRC(52192fe5) SHA1(9afef197410e7feb71dc48003e181fbbaf5c99b2) ) - ROM_REGION( 0x04000, "protcpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x04000, "protcpu", 0 ) ROM_LOAD( "nmk-110-tdragon.bin", 0x00000, 0x4000, CRC(cf66a660) SHA1(a1d3346f7688e9bf5513194a2890a9a6aaf28742) ) // 910527 and "SLASH META" for game name string (Slash Metal was an earlier name for the game, tiles still exist in ROM) ROM_REGION( 0x020000, "fgtile", 0 ) @@ -9681,7 +9679,7 @@ ROM_START( redfoxwp2a ) ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) - ROM_REGION( 0x10000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 + ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega_3.u4", 0x000000, 0x10000, CRC(64608687) SHA1(c13e55429171653437c8e8c7c8e9c6c5ffa2d2dc) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples @@ -10225,7 +10223,7 @@ ROM_START( spec2kh ) ROM_LOAD( "u153.bin", 0x000000, 0x200000, CRC(a00bbf8f) SHA1(622f52ef50d52cdd5e6b250d68439caae5c13404) ) // UC2 MX29F1610ML Flash ROM ROM_LOAD( "u152.bin", 0x200000, 0x200000, CRC(f6423fab) SHA1(253e0791eb58efa1df42e9c74d397e6e65c8c252) ) // UC3 MX29F1610ML Flash ROM - ROM_REGION( 0x20000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 + ROM_REGION( 0x20000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "yonatech4.u3", 0x00000, 0x20000, CRC(5626b08e) SHA1(63207ed6b4fc8684690bf3fe1991a4f3babd73e8) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples @@ -10250,7 +10248,7 @@ ROM_START( spec2k ) ROM_LOAD( "uc3", 0x000000, 0x200000, CRC(1d087122) SHA1(9e82c5f26c1387c6006cbd9248b333921388146c) ) ROM_LOAD( "uc2", 0x200000, 0x200000, CRC(998dc05c) SHA1(cadf8bb0b8944372fbce9934b93684749ebc3ba0) ) - ROM_REGION( 0x20000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 + ROM_REGION( 0x20000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "u3", 0x00000, 0x20000, CRC(921503b8) SHA1(dea6e9d47c9db83e79907bc0609a64176aff26bc) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples @@ -10305,6 +10303,7 @@ ROM_START( twinactn ) ROM_LOAD( "afega.su13", 0x040000, 0x40000, CRC(30e1c306) SHA1(c859f11fd329793b11e96264e91c79a557b488a4) ) ROM_END + /*************************************************************************** @@ -10313,7 +10312,6 @@ ROM_END ***************************************************************************/ - GAME( 1989, tharrier, 0, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "UPL", "Task Force Harrier", MACHINE_NO_COCKTAIL ) GAME( 1989, tharrieru, tharrier, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "UPL (American Sammy license)", "Task Force Harrier (US)", MACHINE_NO_COCKTAIL ) // US version but no regional notice diff --git a/src/mame/nmk/nmk16.h b/src/mame/nmk/nmk16.h index 50d3a535456db..297e64143864a 100644 --- a/src/mame/nmk/nmk16.h +++ b/src/mame/nmk/nmk16.h @@ -144,7 +144,6 @@ class nmk16_state : public driver_device, public seibu_sound_common optional_ioport_array<2> m_dsw_io; optional_ioport_array<3> m_in_io; - emu_timer *m_dma_timer = nullptr; int m_tilerambank = 0; int m_sprdma_base = 0; int mask[4*2]{}; @@ -158,7 +157,7 @@ class nmk16_state : public driver_device, public seibu_sound_common u8 m_scroll[2][4]{}; u16 m_vscroll[4]{}; int m_prot_count = 0; - u8 m_interrupt_trigger; + u8 m_vtiming_val = 0; void mainram_strange_w(offs_t offset, u16 data/*, u16 mem_mask = ~0*/); u16 mainram_swapped_r(offs_t offset); @@ -207,7 +206,7 @@ class nmk16_state : public driver_device, public seibu_sound_common u32 screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_vblank_powerins_bootleg(int state); - TIMER_CALLBACK_MEMBER(dma_callback); + void sprite_dma(); TIMER_DEVICE_CALLBACK_MEMBER(manybloc_scanline); void video_init(); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u16 *src); @@ -293,7 +292,6 @@ class tdragon_prot_state : public nmk16_state void mcu_port6_w(u8 data); u8 mcu_port5_r(); u8 mcu_port6_r(); - u8 mcu_port7_r(); // NMK-113 uses this u8 m_bus_status; }; diff --git a/src/mame/nmk/nmk16_v.cpp b/src/mame/nmk/nmk16_v.cpp index 28201073ec80a..a3f325f3a3848 100644 --- a/src/mame/nmk/nmk16_v.cpp +++ b/src/mame/nmk/nmk16_v.cpp @@ -90,7 +90,6 @@ void nmk16_state::video_init() m_bgbank = 0; m_mustang_bg_xscroll = 0; - m_dma_timer = timer_alloc(FUNC(nmk16_state::dma_callback), this); save_pointer(NAME(m_spriteram_old), 0x1000/2); save_pointer(NAME(m_spriteram_old2), 0x1000/2); save_item(NAME(m_bgbank)); diff --git a/src/mame/nokia/nokia_3310.cpp b/src/mame/nokia/nokia_3310.cpp index fb59e8c3b606a..7c44961006cf0 100644 --- a/src/mame/nokia/nokia_3310.cpp +++ b/src/mame/nokia/nokia_3310.cpp @@ -14,7 +14,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/intelfsh.h" #include "video/pcd8544.h" @@ -242,7 +241,7 @@ void noki3310_state::machine_reset() { // according to the boot rom disassembly here http://www.nokix.pasjagsm.pl/help/blacksphere/sub_100hardware/sub_arm/sub_bootrom.htm // flash entry point is at 0x200040, we can probably reassemble the above code, but for now this should be enough. - m_maincpu->set_state_int(ARM7_R15, 0x200040); + m_maincpu->set_state_int(arm7_cpu_device::ARM7_R15, 0x200040); memset(m_mad2_regs, 0, 0x100); m_mad2_regs[0x01] = 0x01; // power-on flag diff --git a/src/mame/northstar/horizon.cpp b/src/mame/northstar/horizon.cpp index d8397baa6c457..160fd79ff1932 100644 --- a/src/mame/northstar/horizon.cpp +++ b/src/mame/northstar/horizon.cpp @@ -213,7 +213,7 @@ void horizon_state::horizon(machine_config &config) // S-100 S100_BUS(config, m_s100, XTAL(8'000'000) / 4); - m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_BOGUSWAIT); + //m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_WAIT); //S100_SLOT(config, S100_TAG":1", horizon_s100_cards, nullptr, nullptr); // CPU S100_SLOT(config, "s100:2", horizon_s100_cards, nullptr); // RAM S100_SLOT(config, "s100:3", horizon_s100_cards, "mdsad"); // MDS diff --git a/src/mame/novag/accord.cpp b/src/mame/novag/accord.cpp index 3c792e55cefce..8a620fb272e9c 100644 --- a/src/mame/novag/accord.cpp +++ b/src/mame/novag/accord.cpp @@ -177,7 +177,7 @@ static INPUT_PORTS_START( accord ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_B) PORT_NAME("Black/White") 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, accord_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, accord_state, power_off, 0) INPUT_PORTS_END @@ -232,4 +232,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, accord, 0, 0, accord, accord, accord_state, empty_init, "Novag Industries", "Accord", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, accord, 0, 0, accord, accord, accord_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Accord", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/cexpert.cpp b/src/mame/novag/cexpert.cpp index bc6b3ff2662eb..845d189d48015 100644 --- a/src/mame/novag/cexpert.cpp +++ b/src/mame/novag/cexpert.cpp @@ -50,7 +50,6 @@ class cexpert_state : public driver_device m_inputs(*this, "IN.%u", 0) { } - // machine configs void cexpert(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(change_cpu_freq); @@ -67,13 +66,10 @@ class cexpert_state : public driver_device required_ioport_array<8> m_inputs; u8 m_inp_mux = 0; - u8 m_led_select = 0; - // address maps void main_map(address_map &map); // I/O handlers - void update_display(); void mux_w(u8 data); void control_w(u8 data); u8 input1_r(); @@ -82,9 +78,7 @@ class cexpert_state : public driver_device void cexpert_state::machine_start() { - // register for savestates save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } INPUT_CHANGED_MEMBER(cexpert_state::change_cpu_freq) @@ -99,16 +93,11 @@ INPUT_CHANGED_MEMBER(cexpert_state::change_cpu_freq) I/O *******************************************************************************/ -void cexpert_state::update_display() -{ - m_display->matrix(1 << m_led_select, m_inp_mux); -} - void cexpert_state::mux_w(u8 data) { // d0-d7: input mux, led data m_inp_mux = data; - update_display(); + m_display->write_mx(data); } void cexpert_state::control_w(u8 data) @@ -116,11 +105,11 @@ void cexpert_state::control_w(u8 data) // d0-d2: clock/printer? // d3: enable beeper - m_beeper->set_state(data >> 3 & 1); + m_beeper->set_state(BIT(data, 3)); // d4-d7: 74145 to led select - m_led_select = data >> 4 & 0xf; - update_display(); + u8 sel = data >> 4 & 0xf; + m_display->write_my(1 << sel); } u8 cexpert_state::input1_r() @@ -145,7 +134,6 @@ u8 cexpert_state::input2_r() data |= m_inputs[i]->read() << 6; // other: ? - return ~data; } @@ -264,4 +252,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1985, cexpert, 0, 0, cexpert, cexpert, cexpert_state, empty_init, "Novag Industries", "Constellation Expert", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, cexpert, 0, 0, cexpert, cexpert, cexpert_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Constellation Expert", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/cforte.cpp b/src/mame/novag/cforte.cpp index d73742a736053..029436093f556 100644 --- a/src/mame/novag/cforte.cpp +++ b/src/mame/novag/cforte.cpp @@ -93,7 +93,7 @@ void cforte_state::machine_start() I/O *******************************************************************************/ -// HLCD0538 +// LCD void cforte_state::lcd_output_w(u64 data) { @@ -115,7 +115,7 @@ void cforte_state::lcd_output_w(u64 data) } -// TTL/generic +// misc void cforte_state::update_display() { @@ -135,9 +135,9 @@ void cforte_state::control_w(u8 data) // d0: HLCD0538 data in // d1: HLCD0538 clk // d2: HLCD0538 lcd - m_lcd->data_w(data & 1); - m_lcd->clk_w(data >> 1 & 1); - m_lcd->lcd_w(data >> 2 & 1); + m_lcd->data_w(BIT(data, 0)); + m_lcd->clk_w(BIT(data, 1)); + m_lcd->lcd_w(BIT(data, 2)); // d3: ? (goes high at power-off NMI) @@ -146,7 +146,7 @@ void cforte_state::control_w(u8 data) update_display(); // d7: enable beeper - m_beeper->set_state(data >> 7 & 1); + m_beeper->set_state(BIT(data, 7)); } u8 cforte_state::input1_r() @@ -171,7 +171,6 @@ u8 cforte_state::input2_r() data |= m_inputs[i]->read() << 6; // other: ? - return ~data; } @@ -293,5 +292,5 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1986, cfortea, 0, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries", "Constellation Forte (version A)", MACHINE_SUPPORTS_SAVE ) -SYST( 1986, cforteb, cfortea, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries", "Constellation Forte (version B)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, cfortea, 0, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Constellation Forte (version A)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, cforteb, cfortea, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Constellation Forte (version B)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/const.cpp b/src/mame/novag/const.cpp index 5b7220376eb00..6fc0952605415 100644 --- a/src/mame/novag/const.cpp +++ b/src/mame/novag/const.cpp @@ -129,7 +129,6 @@ class const_state : public driver_device bool m_power = false; u8 m_inp_mux = 0; - u8 m_led_select = 0; // address maps void const_map(address_map &map); @@ -137,19 +136,23 @@ class const_state : public driver_device void sconst_map(address_map &map); // I/O handlers - void update_display(); void mux_w(u8 data); void control_w(u8 data); u8 input1_r(); u8 input2_r(); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void const_state::machine_start() { // register for savestates save_item(NAME(m_power)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } INPUT_CHANGED_MEMBER(const_state::power_off) @@ -175,28 +178,23 @@ void const_state::init_const() I/O *******************************************************************************/ -void const_state::update_display() -{ - m_display->matrix(m_led_select, m_inp_mux); -} - void const_state::mux_w(u8 data) { // d0-d7: input mux, led data m_inp_mux = data; - update_display(); + m_display->write_mx(data); } void const_state::control_w(u8 data) { // d0-d2: ? // d3: ? (goes high at power-off NMI) + // d4-d6: select led row - m_led_select = data >> 4 & 7; - update_display(); + m_display->write_my(data >> 4 & 7); // d7: enable beeper - m_beeper->set_state(data >> 7 & 1); + m_beeper->set_state(BIT(data, 7)); } u8 const_state::input1_r() @@ -322,7 +320,7 @@ static INPUT_PORTS_START( ssensor4 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Hint") 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, const_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, const_state, power_off, 0) INPUT_PORTS_END static INPUT_PORTS_START( nconstq ) @@ -347,7 +345,7 @@ static INPUT_PORTS_START( sconst ) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Print List / Acc. Time / Pawn") PORT_START("POWER") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, const_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, const_state, power_off, 0) INPUT_PORTS_END @@ -513,11 +511,11 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag Industries", "Super Sensor IV", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Sensor IV", MACHINE_SUPPORTS_SAVE ) -SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag Industries", "Constellation", MACHINE_SUPPORTS_SAVE ) -SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag Industries", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE ) -SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag Industries", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE ) -SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag Industries", "Constellation Quattro", MACHINE_SUPPORTS_SAVE ) +SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation", MACHINE_SUPPORTS_SAVE ) +SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation Quattro", MACHINE_SUPPORTS_SAVE ) -SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag Industries", "Super Constellation", MACHINE_SUPPORTS_SAVE ) +SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Constellation", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/constjr.cpp b/src/mame/novag/constjr.cpp index d821dae80453e..14dbb850824a9 100644 --- a/src/mame/novag/constjr.cpp +++ b/src/mame/novag/constjr.cpp @@ -182,7 +182,7 @@ static INPUT_PORTS_START( constjr ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_B) PORT_NAME("Black/White") 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, constjr_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, constjr_state, power_off, 0) INPUT_PORTS_END @@ -237,4 +237,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1985, constjr, 0, 0, constjr, constjr, constjr_state, empty_init, "Novag Industries", "Constellation Junior", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, constjr, 0, 0, constjr, constjr, constjr_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Constellation Junior", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/diablo.cpp b/src/mame/novag/diablo.cpp index b137913fd3074..330bcfe1b7049 100644 --- a/src/mame/novag/diablo.cpp +++ b/src/mame/novag/diablo.cpp @@ -6,7 +6,7 @@ Novag Diablo 68000 (model 908) Novag Scorpio 68000 (model 909) -Hardware notes (Diablo): +Hardware notes (Diablo 68000): - M68000 @ 16MHz, IPL1 256Hz, IPL2 from ACIA IRQ(always high) - 2*8KB RAM TC5565 battery-backed, 2*32KB hashtable RAM TC55257 - 3*32KB ROM (27C256 or equivalent) @@ -35,8 +35,8 @@ Scorpio 68000 hardware is very similar, but with chessboard buttons and side led #include "speaker.h" // internal artwork -#include "novag_diablo68k.lh" -#include "novag_scorpio68k.lh" +#include "novag_diablo68.lh" +#include "novag_scorpio68.lh" namespace { @@ -58,8 +58,8 @@ class diablo_state : public driver_device { } // machine configs - void diablo68k(machine_config &config); - void scorpio68k(machine_config &config); + void diablo68(machine_config &config); + void scorpio68(machine_config &config); protected: virtual void machine_start() override; @@ -77,18 +77,16 @@ class diablo_state : public driver_device required_ioport_array<8> m_inputs; u8 m_inp_mux = 0; - u8 m_led_data = 0; - u8 m_led_side = 0; u8 m_lcd_control = 0; u8 m_lcd_data = 0; // address maps - void diablo68k_map(address_map &map); - void scorpio68k_map(address_map &map); + void diablo68_map(address_map &map); + void scorpio68_map(address_map &map); // I/O handlers - void update_display(); void control_w(u8 data); + void control2_w(u8 data); void lcd_data_w(u8 data); void leds_w(u8 data); u8 input1_r(); @@ -102,8 +100,6 @@ void diablo_state::machine_start() { // register for savestates save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_data)); - save_item(NAME(m_led_side)); save_item(NAME(m_lcd_control)); save_item(NAME(m_lcd_data)); } @@ -137,14 +133,7 @@ HD44780_PIXEL_UPDATE(diablo_state::lcd_pixel_update) } -// TTL - -void diablo_state::update_display() -{ - // update leds (lcd is done separately) - u8 led_select = 1 << m_inp_mux; - m_display->matrix(led_select, m_led_side << 8 | m_led_data); -} +// misc void diablo_state::control_w(u8 data) { @@ -155,14 +144,19 @@ void diablo_state::control_w(u8 data) m_lcd_control = data & 3; // d7: enable beeper - m_beeper->set_state(data >> 7 & 1); - - // d2,d3: side leds(scorpio) - m_led_side = ~data >> 2 & 3; + m_beeper->set_state(BIT(data, 7)); // d4-d6: input mux, led select m_inp_mux = data >> 4 & 7; - update_display(); + m_display->write_my(1 << m_inp_mux); +} + +void diablo_state::control2_w(u8 data) +{ + control_w(data); + + // d2,d3: side leds (scorpio68) + m_display->write_mx(~data >> 2 & 3); } void diablo_state::lcd_data_w(u8 data) @@ -173,9 +167,8 @@ void diablo_state::lcd_data_w(u8 data) void diablo_state::leds_w(u8 data) { - // d0-d7: chessboard leds - m_led_data = data; - update_display(); + // d0-d7: chessboard leds (diablo68) + m_display->write_mx(data); } u8 diablo_state::input1_r() @@ -197,7 +190,7 @@ u8 diablo_state::input2_r() Address Maps *******************************************************************************/ -void diablo_state::diablo68k_map(address_map &map) +void diablo_state::diablo68_map(address_map &map) { map(0x000000, 0x00ffff).rom(); map(0x200000, 0x20ffff).rom().region("maincpu", 0x10000); @@ -211,10 +204,10 @@ void diablo_state::diablo68k_map(address_map &map) map(0xff8000, 0xffbfff).ram().share("nvram"); } -void diablo_state::scorpio68k_map(address_map &map) +void diablo_state::scorpio68_map(address_map &map) { - diablo68k_map(map); - map(0x380000, 0x380000).w(FUNC(diablo_state::control_w)); + diablo68_map(map); + map(0x380000, 0x380000).w(FUNC(diablo_state::control2_w)); map(0x3c0000, 0x3c0001).nopw(); } @@ -224,7 +217,7 @@ void diablo_state::scorpio68k_map(address_map &map) Input Ports *******************************************************************************/ -static INPUT_PORTS_START( diablo68k ) +static INPUT_PORTS_START( diablo68 ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Go") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Take Back / Analyze Games") @@ -272,12 +265,12 @@ INPUT_PORTS_END Machine Configs *******************************************************************************/ -void diablo_state::diablo68k(machine_config &config) +void diablo_state::diablo68(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 16_MHz_XTAL); m_maincpu->set_interrupt_mixer(false); - m_maincpu->set_addrmap(AS_PROGRAM, &diablo_state::diablo68k_map); + m_maincpu->set_addrmap(AS_PROGRAM, &diablo_state::diablo68_map); auto &irq_clock(CLOCK(config, "irq_clock", 32.768_kHz_XTAL/128)); // 256Hz irq_clock.set_pulse_width(attotime::from_nsec(1380)); // active for 1.38us @@ -305,8 +298,8 @@ void diablo_state::diablo68k(machine_config &config) m_lcd->set_lcd_size(2, 8); m_lcd->set_pixel_update_cb(FUNC(diablo_state::lcd_pixel_update)); - PWM_DISPLAY(config, m_display).set_size(8, 8+2); - config.set_default_layout(layout_novag_diablo68k); + PWM_DISPLAY(config, m_display).set_size(8, 8); + config.set_default_layout(layout_novag_diablo68); // sound hardware SPEAKER(config, "mono").front_center(); @@ -325,17 +318,18 @@ void diablo_state::diablo68k(machine_config &config) m_rs232->dsr_handler().set("acia", FUNC(mos6551_device::write_dsr)); } -void diablo_state::scorpio68k(machine_config &config) +void diablo_state::scorpio68(machine_config &config) { - diablo68k(config); + diablo68(config); // basic machine hardware - m_maincpu->set_addrmap(AS_PROGRAM, &diablo_state::scorpio68k_map); + m_maincpu->set_addrmap(AS_PROGRAM, &diablo_state::scorpio68_map); m_board->set_type(sensorboard_device::BUTTONS); m_board->set_delay(attotime::from_msec(150)); - config.set_default_layout(layout_novag_scorpio68k); + m_display->set_width(2); + config.set_default_layout(layout_novag_scorpio68); } @@ -344,17 +338,24 @@ void diablo_state::scorpio68k(machine_config &config) ROM Definitions *******************************************************************************/ -ROM_START( diablo68 ) // ID = D 1.08 +ROM_START( diablo68 ) // ID = D 1.08, serial 90999x + ROM_REGION16_BE( 0x20000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE("d_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) ) + ROM_LOAD16_BYTE("d_a09.u2", 0x00001, 0x8000, CRC(bcd27647) SHA1(2de5bccd4e7b9a32957811c0028dbca1a407b9b0) ) + ROM_LOAD16_BYTE("502.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom +ROM_END + +ROM_START( diablo68a ) // ID = D 1.08, serial 90984x ROM_REGION16_BE( 0x20000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE("d_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) ) - ROM_LOAD16_BYTE("d_924.u2", 0x00001, 0x8000, CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5) ) // only 2 bytes differ (one of them is the checksum) + ROM_LOAD16_BYTE("d_924.u2", 0x00001, 0x8000, CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5) ) // only 4 bytes different from diablo68 ROM_LOAD16_BYTE("502.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom ROM_END -ROM_START( diablo68a ) // ID = D 1.08 +ROM_START( diablo68b ) // ID = D 1.08, serial 90973x ROM_REGION16_BE( 0x20000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE("d_evn_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) ) - ROM_LOAD16_BYTE("d_odd_904.u2", 0x00001, 0x8000, CRC(d46fcc7a) SHA1(8ed69cd0fec07bf5451eaa882c87cf7cf70c87eb) ) + ROM_LOAD16_BYTE("d_odd_904.u2", 0x00001, 0x8000, CRC(d46fcc7a) SHA1(8ed69cd0fec07bf5451eaa882c87cf7cf70c87eb) ) // only 2 bytes different from diablo68a ROM_LOAD16_BYTE("ds_bk.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom ROM_END @@ -374,8 +375,9 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1991, diablo68, 0, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Diablo 68000 (set 1)", MACHINE_SUPPORTS_SAVE ) -SYST( 1991, diablo68a, diablo68, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Diablo 68000 (set 2)", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1991, diablo68, 0, 0, diablo68, diablo68, diablo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Diablo 68000 (set 1)", MACHINE_SUPPORTS_SAVE ) +SYST( 1991, diablo68a, diablo68, 0, diablo68, diablo68, diablo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Diablo 68000 (set 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1991, diablo68b, diablo68, 0, diablo68, diablo68, diablo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Diablo 68000 (set 3)", MACHINE_SUPPORTS_SAVE ) -SYST( 1991, scorpio68, 0, 0, scorpio68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Scorpio 68000", MACHINE_SUPPORTS_SAVE ) +SYST( 1991, scorpio68, 0, 0, scorpio68, diablo68, diablo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Scorpio 68000", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/diamond.cpp b/src/mame/novag/diamond.cpp index e004f9bfd1078..b0b50ec7f7095 100644 --- a/src/mame/novag/diamond.cpp +++ b/src/mame/novag/diamond.cpp @@ -533,6 +533,6 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1994, diamond, 0, 0, diamond, diamond, diamond_state, empty_init, "Novag Industries", "Diamond", MACHINE_SUPPORTS_SAVE ) +SYST( 1994, diamond, 0, 0, diamond, diamond, diamond_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Diamond", MACHINE_SUPPORTS_SAVE ) -SYST( 1997, diamond2, 0, 0, diamond2, diamond2, diamond_state, empty_init, "Novag Industries", "Diamond II", MACHINE_SUPPORTS_SAVE ) +SYST( 1997, diamond2, 0, 0, diamond2, diamond2, diamond_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Diamond II", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/emerclp.cpp b/src/mame/novag/emerclp.cpp index eb57e7651971f..d286d012570f9 100644 --- a/src/mame/novag/emerclp.cpp +++ b/src/mame/novag/emerclp.cpp @@ -319,4 +319,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1997, emerclp, 0, 0, emerclp, emerclp, emerclp_state, empty_init, "Novag Industries", "Emerald Classic Plus", MACHINE_SUPPORTS_SAVE ) +SYST( 1997, emerclp, 0, 0, emerclp, emerclp, emerclp_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Emerald Classic Plus", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/mentor16.cpp b/src/mame/novag/mentor16.cpp index 0b91c63a74a94..877f63edd6474 100644 --- a/src/mame/novag/mentor16.cpp +++ b/src/mame/novag/mentor16.cpp @@ -250,7 +250,7 @@ static INPUT_PORTS_START( mentor16 ) 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") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, mentor16_state, power_off, 0) INPUT_PORTS_END @@ -312,4 +312,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1989, mentor16, 0, 0, mentor16, mentor16, mentor16_state, empty_init, "Novag Industries", "Mentor 16", MACHINE_SUPPORTS_SAVE ) +SYST( 1989, mentor16, 0, 0, mentor16, mentor16, mentor16_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Mentor 16", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/micro.cpp b/src/mame/novag/micro.cpp index f3ecd10342a20..64cc6499e63ca 100644 --- a/src/mame/novag/micro.cpp +++ b/src/mame/novag/micro.cpp @@ -6,7 +6,8 @@ Novag Micro Chess It's a portable chesscomputer with sensory board. The MCU says "(C) CAL R & O3", -though the program is supposedly by David Kittinger? +though the program is supposedly by David Kittinger? Unlikely, since his first +work with Novag was Super Sensor IV, a couple of months newer than Micro Chess. Hardware notes: - Mostek 3875/42 (4KB ROM, 64 bytes extra RAM) @@ -105,9 +106,9 @@ void micro_state::input_w(u8 data) u8 micro_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard u8 cb_mux = (m_inp_mux << 2) | (m_control >> 5 & 3); cb_mux = bitswap<8>(cb_mux,4,5,6,7,1,0,3,2); diff --git a/src/mame/novag/micro2.cpp b/src/mame/novag/micro2.cpp index c7ceca736e07e..e41ac1c33c390 100644 --- a/src/mame/novag/micro2.cpp +++ b/src/mame/novag/micro2.cpp @@ -90,10 +90,8 @@ class micro2_state : public driver_device bool m_kp_select = false; u8 m_inp_mux = 0; - u8 m_led_select = 0; // I/O handlers - void update_display(); void mux_w(u8 data); void control_w(u8 data); u8 input_r(); @@ -101,12 +99,17 @@ class micro2_state : public driver_device void set_cpu_freq(); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void micro2_state::machine_start() { // register for savestates save_item(NAME(m_kp_select)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } void micro2_state::set_cpu_freq() @@ -124,18 +127,11 @@ void micro2_state::set_cpu_freq() I/O *******************************************************************************/ -// MCU ports/generic - -void micro2_state::update_display() -{ - m_display->matrix(m_led_select, m_inp_mux); -} - void micro2_state::mux_w(u8 data) { // D0-D7: input mux, led data m_inp_mux = ~data; - update_display(); + m_display->write_mx(m_inp_mux); } void micro2_state::control_w(u8 data) @@ -147,15 +143,14 @@ void micro2_state::control_w(u8 data) m_dac->write(BIT(data, 2) & BIT(~data, 3)); // P24-P26: led select - m_led_select = ~data >> 4 & 7; - update_display(); + m_display->write_my(~data >> 4 & 7); } u8 micro2_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard buttons for (int i = 0; i < 8; i++) if (BIT(m_inp_mux, i)) diff --git a/src/mame/novag/primo.cpp b/src/mame/novag/primo.cpp index 684ad27a0537f..f46c76c13eebd 100644 --- a/src/mame/novag/primo.cpp +++ b/src/mame/novag/primo.cpp @@ -316,7 +316,7 @@ static INPUT_PORTS_START( primo ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") 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, primo_state, primo_power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, primo_state, primo_power_off, 0) INPUT_PORTS_END static INPUT_PORTS_START( supremo ) @@ -352,7 +352,7 @@ static INPUT_PORTS_START( snova ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") 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, primo_state, snova_power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, primo_state, snova_power_off, 0) INPUT_PORTS_END @@ -479,9 +479,9 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init, "Novag Industries", "Primo (Novag)", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Primo (Novag)", MACHINE_SUPPORTS_SAVE ) -SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag Industries", "Supremo", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Supremo", MACHINE_SUPPORTS_SAVE ) -SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, set 1)", MACHINE_SUPPORTS_SAVE ) -SYST( 1990, nsnovaa, nsnova, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, set 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Nova (Novag, set 1)", MACHINE_SUPPORTS_SAVE ) +SYST( 1990, nsnovaa, nsnova, 0, snova, snova, primo_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Nova (Novag, set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/robotadv.cpp b/src/mame/novag/robotadv.cpp index 5d05211e5b0a4..f6f85f68415b9 100644 --- a/src/mame/novag/robotadv.cpp +++ b/src/mame/novag/robotadv.cpp @@ -573,4 +573,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1982, robotadv, 0, 0, robotadv, robotadv, robotadv_state, empty_init, "Novag Industries", "Chess Robot Adversary", MACHINE_SUPPORTS_SAVE | MACHINE_MECHANICAL | MACHINE_IMPERFECT_CONTROLS ) +SYST( 1982, robotadv, 0, 0, robotadv, robotadv, robotadv_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Chess Robot Adversary", MACHINE_SUPPORTS_SAVE | MACHINE_MECHANICAL | MACHINE_IMPERFECT_CONTROLS ) diff --git a/src/mame/novag/sapphire.cpp b/src/mame/novag/sapphire.cpp index 6a9f5f3e4e3b8..6cf2388faa3e9 100644 --- a/src/mame/novag/sapphire.cpp +++ b/src/mame/novag/sapphire.cpp @@ -457,6 +457,6 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1994, sapphire, 0, 0, sapphire, sapphire, sapphire_state, empty_init, "Novag Industries", "Sapphire", MACHINE_SUPPORTS_SAVE ) +SYST( 1994, sapphire, 0, 0, sapphire, sapphire, sapphire_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Sapphire", MACHINE_SUPPORTS_SAVE ) -SYST( 1997, sapphire2, 0, 0, sapphire2, sapphire, sapphire_state, empty_init, "Novag Industries", "Sapphire II", MACHINE_SUPPORTS_SAVE ) +SYST( 1997, sapphire2, 0, 0, sapphire2, sapphire, sapphire_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Sapphire II", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/savant.cpp b/src/mame/novag/savant.cpp index 91a3e535fd85e..67130c728605f 100644 --- a/src/mame/novag/savant.cpp +++ b/src/mame/novag/savant.cpp @@ -434,5 +434,5 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1981, savant, 0, 0, savant, savant, savant_state, empty_init, "Novag Industries", "Savant", MACHINE_SUPPORTS_SAVE ) -SYST( 1982, savant2, savant, 0, savant, savant, savant_state, empty_init, "Novag Industries", "Savant II", MACHINE_SUPPORTS_SAVE ) +SYST( 1981, savant, 0, 0, savant, savant, savant_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Savant", MACHINE_SUPPORTS_SAVE ) +SYST( 1982, savant2, savant, 0, savant, savant, savant_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Savant II", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/sdiamond.cpp b/src/mame/novag/sdiamond.cpp index 85c54f1b9b7b5..1b7edc752eed5 100644 --- a/src/mame/novag/sdiamond.cpp +++ b/src/mame/novag/sdiamond.cpp @@ -373,4 +373,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 2003, sdiamond, 0, 0, sdiamond, sdiamond, sdiamond_state, empty_init, "Perfect Technology", "Star Diamond", MACHINE_SUPPORTS_SAVE ) +SYST( 2003, sdiamond, 0, 0, sdiamond, sdiamond, sdiamond_state, empty_init, "Perfect Technology / Intelligent Heuristic Programming", "Star Diamond", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/sexpert.cpp b/src/mame/novag/sexpert.cpp index d37e3a1dfbe76..aef7ee01c7ca2 100644 --- a/src/mame/novag/sexpert.cpp +++ b/src/mame/novag/sexpert.cpp @@ -103,7 +103,6 @@ class sexpert_state : public driver_device required_ioport_array<8> m_inputs; u8 m_inp_mux = 0; - u8 m_led_data = 0; u8 m_lcd_control = 0; u8 m_lcd_data = 0; @@ -111,7 +110,6 @@ class sexpert_state : public driver_device void sexpert_map(address_map &map); // I/O handlers - void update_display(); virtual void lcd_control_w(u8 data); virtual void lcd_data_w(u8 data); void leds_w(u8 data); @@ -127,7 +125,6 @@ void sexpert_state::machine_start() { // register for savestates save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_data)); save_item(NAME(m_lcd_control)); save_item(NAME(m_lcd_data)); } @@ -213,13 +210,7 @@ HD44780_PIXEL_UPDATE(sexpert_state::lcd_pixel_update) } -// TTL/generic - -void sexpert_state::update_display() -{ - // update leds (lcd is done separately) - m_display->matrix(m_inp_mux, m_led_data); -} +// common void sexpert_state::lcd_control_w(u8 data) { @@ -240,8 +231,7 @@ void sexpert_state::lcd_data_w(u8 data) void sexpert_state::leds_w(u8 data) { // d0-d7: chessboard leds - m_led_data = data; - update_display(); + m_display->write_mx(data); } void sexpert_state::mux_w(u8 data) @@ -250,11 +240,11 @@ void sexpert_state::mux_w(u8 data) m_rombank->set_entry(data & 1); // d3: enable beeper - m_beeper->set_state(data >> 3 & 1); + m_beeper->set_state(BIT(data, 3)); // d4-d7: 74145 to input mux/led select m_inp_mux = 1 << (data >> 4 & 0xf) & 0xff; - update_display(); + m_display->write_my(m_inp_mux); } u8 sexpert_state::input1_r() @@ -301,10 +291,10 @@ void sforte_state::lcd_data_w(u8 data) // d0-d2: 74145 to input mux/led select // 74145 D from lcd control d2 (HD44780 E) m_inp_mux = 1 << ((m_lcd_control << 1 & 8) | (data & 7)); + m_display->write_my(m_inp_mux); // d5,d6: led data - m_led_data = ~data >> 5 & 3; - update_display(); + m_display->write_mx(~data >> 5 & 3); // d7: enable beeper // capacitor for noise filter (sound glitches otherwise) @@ -341,10 +331,7 @@ void sexpert_state::sexpert_map(address_map &map) void sforte_state::sforte_map(address_map &map) { sexpert_map(map); - map(0x1ff4, 0x1ff4).nopw(); - map(0x1ff5, 0x1ff5).nopw(); - map(0x1ff6, 0x1ff6).w(FUNC(sforte_state::lcd_control_w)); - map(0x1ff7, 0x1ff7).w(FUNC(sforte_state::lcd_data_w)); + map(0x1ff4, 0x1ff5).nopw(); } @@ -483,6 +470,7 @@ void sforte_state::sforte(machine_config &config) m_board->set_type(sensorboard_device::BUTTONS); + m_display->set_width(2); config.set_default_layout(layout_novag_sforte); } @@ -599,17 +587,17 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 1)", MACHINE_SUPPORTS_SAVE ) // 886 -SYST( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 2)", MACHINE_SUPPORTS_SAVE ) // 878 -SYST( 1987, sexperta2, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 3)", MACHINE_SUPPORTS_SAVE ) // 878 -SYST( 1988, sexpertb, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE ) // 887 -SYST( 1990, sexpertc, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v3.6)", MACHINE_SUPPORTS_SAVE ) // 902 -SYST( 1990, sexpertc1, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v3.0)", MACHINE_SUPPORTS_SAVE ) // 902 -SYST( 1990, sexpertc2, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v1.2)", MACHINE_SUPPORTS_SAVE ) // 902 - -SYST( 1987, sfortea, 0, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 1)", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, sfortea1, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 2)", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, sfortea2, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 3)", MACHINE_SUPPORTS_SAVE ) -SYST( 1988, sforteb, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version B)", MACHINE_SUPPORTS_SAVE ) -SYST( 1990, sfortec, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version C, v3.6)", MACHINE_SUPPORTS_SAVE ) -SYST( 1990, sfortec1, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version C, v1.2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version A, set 1)", MACHINE_SUPPORTS_SAVE ) // 886 +SYST( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version A, set 2)", MACHINE_SUPPORTS_SAVE ) // 878 +SYST( 1987, sexperta2, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version A, set 3)", MACHINE_SUPPORTS_SAVE ) // 878 +SYST( 1988, sexpertb, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE ) // 887 +SYST( 1990, sexpertc, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version C, v3.6)", MACHINE_SUPPORTS_SAVE ) // 902 +SYST( 1990, sexpertc1, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version C, v3.0)", MACHINE_SUPPORTS_SAVE ) // 902 +SYST( 1990, sexpertc2, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Expert (version C, v1.2)", MACHINE_SUPPORTS_SAVE ) // 902 + +SYST( 1987, sfortea, 0, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version A, set 1)", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, sfortea1, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version A, set 2)", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, sfortea2, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version A, set 3)", MACHINE_SUPPORTS_SAVE ) +SYST( 1988, sforteb, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version B)", MACHINE_SUPPORTS_SAVE ) +SYST( 1990, sfortec, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version C, v3.6)", MACHINE_SUPPORTS_SAVE ) +SYST( 1990, sfortec1, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries / Intelligent Heuristic Programming", "Super Forte (version C, v1.2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/vip.cpp b/src/mame/novag/vip.cpp index 2caa420962074..fae8fab2642b9 100644 --- a/src/mame/novag/vip.cpp +++ b/src/mame/novag/vip.cpp @@ -106,7 +106,7 @@ class vip_state : public driver_device void svip(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(power_off) { if (newval) m_power = false; } - DECLARE_CUSTOM_INPUT_MEMBER(power_r) { return m_power ? 1 : 0; } + ioport_value power_r() { return m_power ? 1 : 0; } protected: virtual void machine_start() override; @@ -271,7 +271,7 @@ static INPUT_PORTS_START( vip ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(vip_state, power_r) 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, vip_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, vip_state, power_off, 0) INPUT_PORTS_END static INPUT_PORTS_START( svip ) @@ -421,9 +421,9 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1987, nvip, 0, 0, vip, vip, vip_state, empty_init, "Novag Industries", "VIP (Novag)", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, nvip, 0, 0, vip, vip, vip_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "VIP (Novag)", MACHINE_SUPPORTS_SAVE ) -SYST( 1989, nsvip, 0, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE ) -SYST( 1989, nsvipa, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE ) -SYST( 1989, nsvipb, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE ) -SYST( 1989, nsvipc, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE ) +SYST( 1989, nsvip, 0, 0, svip, svip, vip_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE ) +SYST( 1989, nsvipa, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE ) +SYST( 1989, nsvipb, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE ) +SYST( 1989, nsvipc, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/novag/zircon2.cpp b/src/mame/novag/zircon2.cpp index 08b6981947ec8..eac13b7c4e5ac 100644 --- a/src/mame/novag/zircon2.cpp +++ b/src/mame/novag/zircon2.cpp @@ -331,4 +331,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1995, zircon2, 0, 0, zircon2, zircon2, zircon2_state, empty_init, "Novag Industries", "Zircon II", MACHINE_SUPPORTS_SAVE ) +SYST( 1995, zircon2, 0, 0, zircon2, zircon2, zircon2_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Zircon II", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/olympia/lbeach.cpp b/src/mame/olympia/lbeach.cpp index 80c8194f0017d..1f2f1e9d166a6 100644 --- a/src/mame/olympia/lbeach.cpp +++ b/src/mame/olympia/lbeach.cpp @@ -66,8 +66,8 @@ class lbeach_state : public driver_device m_palette(*this, "palette") { } - DECLARE_CUSTOM_INPUT_MEMBER(col_bg_r) { return m_collision_bg_car; } - DECLARE_CUSTOM_INPUT_MEMBER(col_fg_r) { return m_collision_fg_car; } + ioport_value col_bg_r() { return m_collision_bg_car; } + ioport_value col_fg_r() { return m_collision_fg_car; } void lbeach(machine_config &config); diff --git a/src/mame/omori/battlex.cpp b/src/mame/omori/battlex.cpp index 0feaff1879eae..7d60e93553bbd 100644 --- a/src/mame/omori/battlex.cpp +++ b/src/mame/omori/battlex.cpp @@ -111,7 +111,7 @@ class battlex_state : public driver_device void battlex(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(in0_b4_r); + ioport_value in0_b4_r(); protected: virtual void machine_start() override; @@ -287,7 +287,7 @@ INTERRUPT_GEN_MEMBER(battlex_state::interrupt) device.execute().set_input_line(0, ASSERT_LINE); } -CUSTOM_INPUT_MEMBER(battlex_state::in0_b4_r) +ioport_value battlex_state::in0_b4_r() { uint32_t ret = m_in0_b4; if (m_in0_b4) diff --git a/src/mame/pacman/pacman.cpp b/src/mame/pacman/pacman.cpp index d2a42a79e842a..c50b69040614e 100644 --- a/src/mame/pacman/pacman.cpp +++ b/src/mame/pacman/pacman.cpp @@ -8651,7 +8651,7 @@ void pacman_state::init_pengomc1() romdata[i] = buf[i^0xff]; } -CUSTOM_INPUT_MEMBER(clubpacm_state::clubpacm_input_r) +ioport_value clubpacm_state::clubpacm_input_r() { ioport_value data = 0x0f; diff --git a/src/mame/pacman/pacman.h b/src/mame/pacman/pacman.h index 309933f57a4bc..efa200e4d107d 100644 --- a/src/mame/pacman/pacman.h +++ b/src/mame/pacman/pacman.h @@ -287,7 +287,7 @@ class clubpacm_state : public pacman_state void clubpacm(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(clubpacm_input_r); + ioport_value clubpacm_input_r(); void init_clubpacma(); diff --git a/src/mame/pacman/pacman_v.cpp b/src/mame/pacman/pacman_v.cpp index 8d93e7681c625..8a030e788c003 100644 --- a/src/mame/pacman/pacman_v.cpp +++ b/src/mame/pacman/pacman_v.cpp @@ -169,16 +169,12 @@ void pacman_state::pacman_rbg_palette(palette_device &palette) const TILEMAP_MAPPER_MEMBER(pacman_state::pacman_scan_rows) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(pacman_state::pacman_get_tile_info) @@ -543,17 +539,17 @@ Jr. Pac-Man TILEMAP_MAPPER_MEMBER(pacman_state::jrpacman_scan_rows) { - int offs; - row += 2; col -= 2; - if ((col & 0x20) && (row & 0x20)) - offs = 0; - else if (col & 0x20) - offs = row + (((col&0x3) | 0x38)<< 5); + if (col & 0x20) + { + if (row & 0x20) + return 0x77f; // outside visible area + else + return row + (((col & 0x3) | 0x38) << 5); + } else - offs = col + (row << 5); - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(pacman_state::jrpacman_get_tile_info) @@ -579,8 +575,7 @@ void pacman_state::jrpacman_mark_tile_dirty(int offset) if (offset < 0x20) { /* line color - mark whole line as dirty */ - int i; - for (i = 2 * 0x20; i < 56 * 0x20; i += 0x20) + for (int i = 2 * 0x20; i < 56 * 0x20; i += 0x20) { m_bg_tilemap->mark_tile_dirty(offset + i); } diff --git a/src/mame/pacman/schick.cpp b/src/mame/pacman/schick.cpp index 3bba80f55a6e3..f8a9805702e52 100644 --- a/src/mame/pacman/schick.cpp +++ b/src/mame/pacman/schick.cpp @@ -164,16 +164,12 @@ void schick_state::machine_start() TILEMAP_MAPPER_MEMBER(schick_state::schick_scan_rows) { - int offs; - row += 2; col -= 2; if (col & 0x20) - offs = row + ((col & 0x1f) << 5); + return row + ((col & 0x1f) << 5); else - offs = col + (row << 5); - - return offs; + return col + (row << 5); } TILE_GET_INFO_MEMBER(schick_state::schick_get_tile_info) diff --git a/src/mame/pc/README.md b/src/mame/pc/README.md index ea9e4fcc42862..5099745270816 100644 --- a/src/mame/pc/README.md +++ b/src/mame/pc/README.md @@ -1,3 +1,3 @@ -# **src/mame/pc** # +# **src/mame/pc** -Generic folder with MAME drivers for IBM PC, PC compatibles, or PC-based arcade hardware. \ No newline at end of file +Generic folder with MAME drivers for IBM PC, PC compatibles, or PC-based arcade hardware. diff --git a/src/mame/pc/calchase.cpp b/src/mame/pc/calchase.cpp index 1899866546b88..561972f386972 100644 --- a/src/mame/pc/calchase.cpp +++ b/src/mame/pc/calchase.cpp @@ -146,7 +146,7 @@ class isa16_calchase_jamma_if : public device_t, public device_isa16_card_interf isa16_calchase_jamma_if(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; - DECLARE_CUSTOM_INPUT_MEMBER( heartbeat_r ); + ioport_value heartbeat_r(); protected: virtual void device_start() override; @@ -247,7 +247,7 @@ TIMER_CALLBACK_MEMBER(isa16_calchase_jamma_if::heartbeat_cb) m_hb_state ^= 1; } -CUSTOM_INPUT_MEMBER(isa16_calchase_jamma_if::heartbeat_r) +ioport_value isa16_calchase_jamma_if::heartbeat_r() { return m_hb_state; } diff --git a/src/mame/pc/champ2.cpp b/src/mame/pc/champ2.cpp new file mode 100644 index 0000000000000..7f93c60e4034e --- /dev/null +++ b/src/mame/pc/champ2.cpp @@ -0,0 +1,207 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + +Countertop Champ II? (c) 1993 U.S. Games + +Bartop style multigame/quiz/fortune teller +Dump contains a MS-DOS 3.3 ROM disk, ebay auction shows a Pine Technology PT-319A +(SARC RC2016A5 chipset) + 2 other populated ISA16 cards out of 6. + +TODO: +- Does extensive checks to COM1, towards what it claims to be `mtv1` (MicroTouch?) +- ROM disk banking incomplete, meaning of $ca000 writes unknown; + +**************************************************************************************************/ + +#include "emu.h" +#include "bus/isa/isa_cards.h" +#include "bus/pc_kbd/keyboards.h" +#include "bus/pc_kbd/pc_kbdc.h" +#include "cpu/i386/i386.h" +#include "machine/at.h" +#include "machine/bankdev.h" +#include "machine/ds128x.h" +#include "machine/nvram.h" +#include "machine/ram.h" + + +namespace { + +class champ2_state : public driver_device +{ +public: + champ2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_mb(*this, "mb") + , m_ram(*this, "ram") + , m_bank(*this, "bank%u", 0U) + { } + + void champ2(machine_config &config); + void init_at(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + void init_at_common(int xmsbase); + +private: + required_device m_maincpu; + required_device m_mb; + required_device m_ram; + required_device_array m_bank; + void bank_map(address_map &map); + void main_io(address_map &map); + void main_map(address_map &map); +}; + + +void champ2_state::main_map(address_map &map) +{ + map(0x000000, 0x09ffff).bankrw("bank10"); + // Selectable thru jumpers (0xc800, 0xd000, 0xd800, 0xe000) + map(0x0c8000, 0x0c9fff).m(m_bank[0], FUNC(address_map_bank_device::amap8)); + map(0x0ca000, 0x0cbfff).m(m_bank[1], FUNC(address_map_bank_device::amap8)); + // writes to $+2000 then $+0000, same value (0x03) at POST, + // then writes 0 to $+2000 and N to $+0000 + map(0x0c8000, 0x0c8000).lw8( + NAME([this] (offs_t offset, u8 data) { + logerror("$c8000 bank %02x\n", data); + m_bank[1]->set_bank(data & 0x7f); + }) + ); + map(0x0ca000, 0x0ca000).lw8( + NAME([this] (offs_t offset, u8 data) { + logerror("$ca000 bank %02x\n", data); + //m_bank[0]->set_bank(data & 0x7f); + }) + ); + map(0x0e0000, 0x0fffff).rom().region("bios", 0); + map(0xfe0000, 0xffffff).rom().region("bios", 0); +} + +void champ2_state::main_io(address_map &map) +{ + map.global_mask(0x3ff); + map(0x0000, 0x00ff).m(m_mb, FUNC(at_mb_device::map)); + map(0x0200, 0x0201).portr("GAME"); +} + + +void champ2_state::bank_map(address_map &map) +{ + map(0x00000, 0xfffff).rom().region("game_prg", 0); +} + +static INPUT_PORTS_START( champ2 ) + PORT_START("GAME") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_DIPNAME( 0x0100, 0x0100, "GAME" ) + 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 ) ) + // punts with "terminated - illegal" if any of these two are low + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +void champ2_state::machine_start() +{ +} + +void champ2_state::machine_reset() +{ + m_bank[0]->set_bank(0); + m_bank[1]->set_bank(0); +} + + +void champ2_state::champ2(machine_config &config) +{ + I386SX(config, m_maincpu, 16'000'000); + m_maincpu->set_addrmap(AS_PROGRAM, &champ2_state::main_map); + m_maincpu->set_addrmap(AS_IO, &champ2_state::main_io); + m_maincpu->set_irq_acknowledge_callback("mb:pic8259_master", FUNC(pic8259_device::inta_cb)); +// m_maincpu->shutdown_callback().set("mb", FUNC(at_mb_device::shutdown)); + + AT_MB(config, m_mb).at_softlists(config); + m_mb->kbd_clk().set("kbd", FUNC(pc_kbdc_device::clock_write_from_mb)); + m_mb->kbd_data().set("kbd", FUNC(pc_kbdc_device::data_write_from_mb)); + + pc_kbdc_device &pc_kbdc(PC_KBDC(config, "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL)); + pc_kbdc.out_clock_cb().set(m_mb, FUNC(at_mb_device::kbd_clk_w)); + pc_kbdc.out_data_cb().set(m_mb, FUNC(at_mb_device::kbd_data_w)); + + // FIXME: determine ISA bus clock + ISA16_SLOT(config, "isa1", 0, "mb:isabus", pc_isa16_cards, "vga", false); + ISA16_SLOT(config, "isa2", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa3", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa4", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa5", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa6", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + + RAM(config, m_ram).set_default_size("15M").set_extra_options("640K,1024K,1664K,2M,4M,8M,15M"); + + for (auto bank : m_bank) + ADDRESS_MAP_BANK(config, bank).set_map(&champ2_state::bank_map).set_options(ENDIANNESS_LITTLE, 8, 20, 0x2000); +} + + +ROM_START( champ2 ) + ROM_REGION16_LE(0x20000, "bios", 0) + // borrowed from pc/at.cpp pt319a + ROM_LOAD( "3sam001.bin", 0x10000, 0x10000, BAD_DUMP CRC(cad22030) SHA1(85bb6027579a87bfe7ea0f7df3676fdaa64920ac)) + + ROM_REGION( 0x100000, "game_prg", 0 ) + ROM_LOAD( "champ2.u2", 0x00000, 0x80000, CRC(058bd1a4) SHA1(e4c0db329cda0cdcab7c7b4d130f1c38fa32385f) ) + ROM_LOAD( "champ2.u3", 0x80000, 0x80000, CRC(3bb1951f) SHA1(8057327285f57787cc7da678427767ee7f979a64) ) + + ROM_REGION( 0x1caf, "pal", 0 ) + ROM_LOAD( "champ2.u7", 0x00000, 0x1caf, BAD_DUMP CRC(bd70e89b) SHA1(3567d22057e366a439ffce2dd35180f5df80d47c) ) +ROM_END + +void champ2_state::init_at_common(int xmsbase) +{ + address_space& space = m_maincpu->space(AS_PROGRAM); + + /* managed RAM */ + membank("bank10")->set_base(m_ram->pointer()); + + if (m_ram->size() > xmsbase) + { + offs_t ram_limit = 0x100000 + m_ram->size() - xmsbase; + space.install_ram(0x100000, ram_limit - 1, m_ram->pointer() + xmsbase); + } +} + +void champ2_state::init_at() +{ + init_at_common(0xa0000); +} + +} // anonymous namespace + + +//GAME( 1993, champ, 0, champ2, champ2, champ2_state, empty_init, ROT0, "U.S. Games", "Countertop Champion", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +// Title assumed by "Champ II" ROM labels +GAME( 1994, champ2, 0, champ2, champ2, champ2_state, init_at, ROT0, "U.S. Games", "Countertop Champion 2 (ver 2.11)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/pc/ct486.cpp b/src/mame/pc/ct486.cpp index 77dd93dd360b5..501b5b1188250 100644 --- a/src/mame/pc/ct486.cpp +++ b/src/mame/pc/ct486.cpp @@ -182,9 +182,6 @@ void ct486_state::ct486(machine_config &config) SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); - // video hardware - PALETTE(config, "palette").set_entries(256); // todo: really needed? - /* software lists */ SOFTWARE_LIST(config, "pc_disk_list").set_original("ibm5150"); SOFTWARE_LIST(config, "at_disk_list").set_original("ibm5170"); diff --git a/src/mame/pc/filetto.cpp b/src/mame/pc/filetto.cpp new file mode 100644 index 0000000000000..a3944e9c3e401 --- /dev/null +++ b/src/mame/pc/filetto.cpp @@ -0,0 +1,424 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese, Chris Hardy +/************************************************************************************************** + +Filetto (c) 1990 Novarmatic + +TODO: +- Add a proper FDC device; +- UM5100 sample clock; +- buzzer sound; + +=================================================================================================== +The PCB is a un-modified IBM-PC with a CGA adapter & a prototyping card that controls the +interface between the pc and the Jamma connectors.Additionally there's also a UM5100 sound +chip for the sound. +PCB Part Number: S/N 90289764 NOVARXT +PCB Contents: +1x UMC 8923S-UM5100 voice processor (upper board) +1x MMI PAL16L8ACN-940CRK9 (upper board) +1x AMD AMPAL16R8APC-8804DM (upper board) +1x AMD P8088-1 main processor 8.000MHz (lower board) +1x Proton PT8010AF PLCC 28.636MHz (lower board) +1x UMC 8928LP-UM8272A floppy disk controller (lower board) +1x UMC 8935CS-UM82C11 Printer Adapter Interface (lower board) +1x UMC 8936CS-UM8250B Programmable asynchronous communications element (lower board) +1x UMC 8937NS-UM82C8167 Real Time Clock (lower board) +1x Yamaha V6363 CMDC QFP (lower board) +There isn't any keyboard found connected to the pcb. + +=================================================================================================== +The software of this game can be extracted with a normal Windows program extractor. +The files names are: +-command.com (1) +-ibmbio.com (1) +-ibmdos.com (1) +-ansi.sys (1) +-config.sys (2) +-autoexec.bat (3) +-x.exe (4) +(1)This is an old Italian version of MS-DOS (v3.30 18th March 1987). +(2)Contains "device=ansi.sys",it's an hook-up for the graphics used by the BIOS. +(3)It has an Echo off (as you can notice from the game itself) and then the loading of the +main program (x.exe). +(4)The main program,done in plain Basic with several Italian comments in it.The date of +the main program is 9th October 1990. + +**************************************************************************************************/ + +#include "emu.h" +#include "bus/isa/cga.h" +#include "cpu/i86/i86.h" +#include "machine/bankdev.h" +#include "machine/genpc.h" +#include "sound/hc55516.h" + +class isa8_cga_filetto_device : public isa8_cga_device +{ +public: + // construction/destruction + isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual const tiny_rom_entry *device_rom_region() const override; +}; + +DEFINE_DEVICE_TYPE(ISA8_CGA_FILETTO, isa8_cga_filetto_device, "filetto_cga", "ISA8_CGA_FILETTO") + +//------------------------------------------------- +// isa8_cga_filetto_device - constructor +//------------------------------------------------- + +isa8_cga_filetto_device::isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + isa8_cga_device(mconfig, ISA8_CGA_FILETTO, tag, owner, clock) +{ +} + +ROM_START( filetto_cga ) + ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_LOAD("u67.bin", 0x0000, 0x2000, CRC(09710122) SHA1(de84bdd9245df287bbd3bb808f0c3531d13a3545) ) +ROM_END + +const tiny_rom_entry *isa8_cga_filetto_device::device_rom_region() const +{ + return ROM_NAME( filetto_cga ); +} + +namespace { + +class filetto_state : public driver_device +{ +public: + filetto_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_mb(*this, "mb") + , m_bank(*this, "bank") + , m_cvsd(*this, "voice") + , m_samples(*this, "samples") + { } + + void filetto(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + TIMER_CALLBACK_MEMBER(sample_tick); + +private: + int m_lastvalue; + uint8_t m_disk_data[2]; + uint8_t m_port_b_data; + uint8_t m_status; + uint8_t m_clr_status; + uint8_t m_voice, m_bit; + uint32_t m_vaddr; + emu_timer *m_sample; + + uint8_t disk_iobank_r(offs_t offset); + void disk_iobank_w(offs_t offset, uint8_t data); + uint8_t fdc765_status_r(); + uint8_t fdc765_data_r(); + void fdc765_data_w(uint8_t data); + void fdc_dor_w(uint8_t data); + uint8_t port_a_r(); + uint8_t port_b_r(); + uint8_t port_c_r(); + void port_b_w(uint8_t data); + void voice_start_w(uint8_t data); + + required_device m_maincpu; + required_device m_mb; + required_device m_bank; + required_device m_cvsd; + required_memory_region m_samples; + void bank_map(address_map &map); + void filetto_io(address_map &map); + void filetto_map(address_map &map); +}; + + +uint8_t filetto_state::disk_iobank_r(offs_t offset) +{ + //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,m_maincpu->pc()); + //if(offset == 0) return ioport("DSW")->read(); + if(offset == 1) return ioport("IN1")->read(); + + return m_disk_data[offset]; +} + +void filetto_state::disk_iobank_w(offs_t offset, uint8_t data) +{ +/* + BIOS does a single out $0310,$F0 on reset + + Then does 2 outs to set the bank.. + + X1 X2 + + $F0 $F2 = m0 + $F1 $F2 = m1 + $F0 $F3 = m2 + $F1 $F3 = m3 + + The sequence of + + out $0310,X1 + out $0310,X2 + + sets the selected rom that appears in $C0000-$CFFFF + +*/ + int bank = 0; + +// printf("bank %d set to %02X\n", offset,data); + + if (data == 0xF0) + { + bank = 0; + } + else + { + if((m_lastvalue == 0xF0) && (data == 0xF2)) + bank = 0; + else if ((m_lastvalue == 0xF1) && (data == 0xF2)) + bank = 1; + else if ((m_lastvalue == 0xF0) && (data == 0xF3)) + bank = 2; + else if ((m_lastvalue == 0xF1) && (data == 0xF3)) + bank = 3; + } + + if (!(data & 0xf0)) + { + int bit = (data >> 1) - 2; + m_voice &= ~(1 << bit); + m_voice |= BIT(data, 0) << bit; + } + + m_bank->set_bank(bank); + + m_lastvalue = data; + + m_disk_data[offset] = data; +} + +uint8_t filetto_state::port_a_r() +{ + return 0xaa;//harmless keyboard error occurs without this +} + +uint8_t filetto_state::port_b_r() +{ + return m_port_b_data; +} + +uint8_t filetto_state::port_c_r() +{ + return 0x00;// DIPS? +} + +// Filetto uses this for either beep and um5100 sound routing,probably there's a I/O select somewhere ... +void filetto_state::port_b_w(uint8_t data) +{ + m_mb->m_pit8253->write_gate2(BIT(data, 0)); + m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); + m_port_b_data = data; +// m_cvsd->digit_w(data); +} + +/*Floppy Disk Controller 765 device*/ +/*Currently we only emulate it at a point that the BIOS will pass the checks*/ + +#define FDC_BUSY 0x10 +#define FDC_WRITE 0x40 +#define FDC_READ 0x00 /*~0x40*/ + +uint8_t filetto_state::fdc765_status_r() +{ + uint8_t tmp; + tmp = m_status | 0x80; + m_clr_status++; + if(m_clr_status == 0x10) + { + m_status = 0; + m_clr_status = 0; + } + return tmp; +} + +uint8_t filetto_state::fdc765_data_r() +{ + m_status = (FDC_READ); + m_mb->m_pic8259->ir6_w(0); + return 0xc0; +} + +void filetto_state::fdc765_data_w(uint8_t data) +{ + m_status = (FDC_WRITE); +} + + +void filetto_state::fdc_dor_w(uint8_t data) +{ + m_mb->m_pic8259->ir6_w(1); +} + +// TODO: move to a real um5100 device +void filetto_state::voice_start_w(uint8_t data) +{ + // TODO: accurate pitch frequency + m_sample->adjust(attotime::zero, 0, attotime::from_hz(44150)); + m_bit = 7; + m_vaddr = ((m_voice & 0xf / 5) | (BIT(m_voice, 4) << 2)) * 0x8000; + logerror("%x %x\n",m_voice,m_vaddr); +} + +void filetto_state::filetto_map(address_map &map) +{ + map(0xc0000, 0xcffff).m(m_bank, FUNC(address_map_bank_device::amap8)); + map(0xf0000, 0xfffff).rom().region("bios", 0); +} + +void filetto_state::filetto_io(address_map &map) +{ + map.global_mask(0x3ff); + map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); + map(0x0060, 0x0060).r(FUNC(filetto_state::port_a_r)); //not a real 8255 + map(0x0061, 0x0061).rw(FUNC(filetto_state::port_b_r), FUNC(filetto_state::port_b_w)); + map(0x0062, 0x0062).r(FUNC(filetto_state::port_c_r)); + map(0x0201, 0x0201).portr("COIN"); // game port + map(0x0310, 0x0311).rw(FUNC(filetto_state::disk_iobank_r), FUNC(filetto_state::disk_iobank_w)); //Prototyping card + map(0x0312, 0x0312).portr("IN0"); // Prototyping card, r/o + map(0x0313, 0x0313).w(FUNC(filetto_state::voice_start_w)); + map(0x03f2, 0x03f2).w(FUNC(filetto_state::fdc_dor_w)); + map(0x03f4, 0x03f4).r(FUNC(filetto_state::fdc765_status_r)); //765 Floppy Disk Controller (FDC) Status + map(0x03f5, 0x03f5).rw(FUNC(filetto_state::fdc765_data_r), FUNC(filetto_state::fdc765_data_w));//FDC Data +} + + +void filetto_state::bank_map(address_map &map) +{ + map(0x00000, 0x3ffff).rom().region("game_prg", 0); +} + +static INPUT_PORTS_START( filetto ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + + PORT_START("IN1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "Extra Play" ) + PORT_DIPSETTING( 0x04, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, "Play at 6th match reached" ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("COIN") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START( "pcvideo_cga_config" ) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +TIMER_CALLBACK_MEMBER(filetto_state::sample_tick) +{ + m_cvsd->digit_w(BIT(m_samples->as_u8(m_vaddr), m_bit)); + m_cvsd->clock_w(1); + m_cvsd->clock_w(0); + if (m_bit == 0) + { + m_vaddr++; + m_bit = 8; + if (!(m_vaddr % 0x8000)) + m_sample->adjust(attotime::never); + } + m_bit--; +} + +void filetto_state::machine_start() +{ + m_sample = timer_alloc(FUNC(filetto_state::sample_tick), this); + + m_status = 0; + m_clr_status = 0; +} + +void filetto_state::machine_reset() +{ + m_lastvalue = -1; + m_voice = 0; +} + +static void filetto_isa8_cards(device_slot_interface &device) +{ + device.option_add_internal("filetto", ISA8_CGA_FILETTO); +} + + +void filetto_state::filetto(machine_config &config) +{ + I8088(config, m_maincpu, XTAL(14'318'181)/3); + m_maincpu->set_addrmap(AS_PROGRAM, &filetto_state::filetto_map); + m_maincpu->set_addrmap(AS_IO, &filetto_state::filetto_io); + m_maincpu->set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); + + PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu); + m_mb->int_callback().set_inputline(m_maincpu, 0); + m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + + ISA8_SLOT(config, "isa1", 0, "mb:isa", filetto_isa8_cards, "filetto", true); // FIXME: determine ISA bus clock + + HC55516(config, m_cvsd, 0).add_route(ALL_OUTPUTS, "mb:mono", 0.60); //8923S-UM5100 is a HC55536 with ROM hook-up + + RAM(config, RAM_TAG).set_default_size("640K"); + + ADDRESS_MAP_BANK(config, m_bank).set_map(&filetto_state::bank_map).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000); +} + +ROM_START( filetto ) + ROM_REGION( 0x10000, "bios", 0 ) + ROM_LOAD("u49.bin", 0xc000, 0x2000, CRC(1be6948a) SHA1(9c433f63d347c211ee4663f133e8417221bc4bf0)) + ROM_RELOAD( 0x8000, 0x2000 ) + ROM_RELOAD( 0x4000, 0x2000 ) + ROM_RELOAD( 0x0000, 0x2000 ) + ROM_LOAD("u55.bin", 0xe000, 0x2000, CRC(1e455ed7) SHA1(786d18ce0ab1af45fc538a2300853e497488f0d4) ) + ROM_RELOAD( 0xa000, 0x2000 ) + ROM_RELOAD( 0x6000, 0x2000 ) + ROM_RELOAD( 0x2000, 0x2000 ) + + ROM_REGION( 0x40000, "game_prg", 0 ) // program data + ROM_LOAD( "m0.u1", 0x00000, 0x10000, CRC(2408289d) SHA1(eafc144a557a79b58bcb48545cb9c9778e61fcd3) ) + ROM_LOAD( "m1.u2", 0x10000, 0x10000, CRC(5b623114) SHA1(0d9a14e6b7f57ce4fa09762343b610a973910f58) ) + ROM_LOAD( "m2.u3", 0x20000, 0x10000, CRC(abc64869) SHA1(564fc9d90d241a7b7776160b3fd036fb08037355) ) + ROM_LOAD( "m3.u4", 0x30000, 0x10000, CRC(0c1e8a67) SHA1(f1b9280c65fcfcb5ec481cae48eb6f52d6cdbc9d) ) + + ROM_REGION( 0x40000, "samples", 0 ) // UM5100 sample roms + ROM_LOAD("v1.u15", 0x00000, 0x20000, CRC(613ddd07) SHA1(ebda3d559315879819cb7034b5696f8e7861fe42) ) + ROM_LOAD("v2.u14", 0x20000, 0x20000, CRC(427e012e) SHA1(50514a6307e63078fe7444a96e39d834684db7df) ) +ROM_END + + +} // anonymous namespace + + +GAME( 1990, filetto, 0, filetto, filetto, filetto_state, empty_init, ROT0, "Novarmatic", "Filetto (v1.05 901009)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/pc/pcxt.cpp b/src/mame/pc/pcxt.cpp deleted file mode 100644 index 5f8714854aef6..0000000000000 --- a/src/mame/pc/pcxt.cpp +++ /dev/null @@ -1,625 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Angelo Salese, Chris Hardy, David Haywood, Tomasz Slanina -/****************************************************************************************** - -PC-XT (c) 1987 IBM - -(Actually Arcade games running on more or less modified PC-XT HW) - -driver by Angelo Salese & Chris Hardy -original tetriunk.c by David Haywood & Tomasz Slanina - -Notes: -- The Korean Tetris is a blantant rip-off of the Mirrorsoft/Andromeda Software Tetris PC - version; - -TODO: -- 02851: tetriskr: Corrupt game graphics after some time of gameplay, caused by a wrong - reading of the i/o $3c8 bit 1. (seems fixed?) -- tetriskr can store inputs read during the timer irq. If ds is 0x40 when the irq is taken - it will corrupt the BIOS data area which can lead to corrupt graphics -- Add a proper FDC device. -- buzzer sound has issues in both games - -******************************************************************************************** -Filetto HW notes: -The PCB is a un-modified IBM-PC with a CGA adapter & a prototyping card that controls the -interface between the pc and the Jamma connectors.Additionally there's also a UM5100 sound -chip for the sound. -PCB Part Number: S/N 90289764 NOVARXT -PCB Contents: -1x UMC 8923S-UM5100 voice processor (upper board) -1x MMI PAL16L8ACN-940CRK9 (upper board) -1x AMD AMPAL16R8APC-8804DM (upper board) -1x AMD P8088-1 main processor 8.000MHz (lower board) -1x Proton PT8010AF PLCC 28.636MHz (lower board) -1x UMC 8928LP-UM8272A floppy disk controller (lower board) -1x UMC 8935CS-UM82C11 Printer Adapter Interface (lower board) -1x UMC 8936CS-UM8250B Programmable asynchronous communications element (lower board) -1x UMC 8937NS-UM82C8167 Real Time Clock (lower board) -1x Yamaha V6363 CMDC QFP (lower board) -There isn't any keyboard found connected to the pcb. -******************************************************************************************** -Filetto SW notes: -The software of this game can be extracted with a normal Windows program extractor. -The files names are: --command.com (1) --ibmbio.com (1) --ibmdos.com (1) --ansi.sys (1) --config.sys (2) --autoexec.bat (3) --x.exe (4) -(1)This is an old Italian version of MS-DOS (v3.30 18th March 1987). -(2)Contains "device=ansi.sys",it's an hook-up for the graphics used by the BIOS. -(3)It has an Echo off (as you can notice from the game itself) and then the loading of the -main program (x.exe). -(4)The main program,done in plain Basic with several Italian comments in it.The date of -the main program is 9th October 1990. - -******************************************************************************************/ - -#include "emu.h" -#include "bus/isa/cga.h" -#include "cpu/i86/i86.h" -#include "sound/hc55516.h" -#include "machine/bankdev.h" -#include "machine/genpc.h" - - -class isa8_cga_filetto_device : public isa8_cga_device -{ -public: - // construction/destruction - isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual const tiny_rom_entry *device_rom_region() const override; -}; - -DEFINE_DEVICE_TYPE(ISA8_CGA_FILETTO, isa8_cga_filetto_device, "filetto_cga", "ISA8_CGA_FILETTO") - -//------------------------------------------------- -// isa8_cga_filetto_device - constructor -//------------------------------------------------- - -isa8_cga_filetto_device::isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - isa8_cga_device(mconfig, ISA8_CGA_FILETTO, tag, owner, clock) -{ -} - -ROM_START( filetto_cga ) - ROM_REGION( 0x2000, "gfx1", 0 ) - ROM_LOAD("u67.bin", 0x0000, 0x2000, CRC(09710122) SHA1(de84bdd9245df287bbd3bb808f0c3531d13a3545) ) -ROM_END - -const tiny_rom_entry *isa8_cga_filetto_device::device_rom_region() const -{ - return ROM_NAME( filetto_cga ); -} - - - -class isa8_cga_tetriskr_device : public isa8_cga_superimpose_device -{ -public: - // construction/destruction - isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; - virtual void device_start() override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint8_t bg_bank_r(); - void bg_bank_w(uint8_t data); -private: - required_region_ptr m_bg; - uint8_t m_bg_bank = 0; -}; - - -/* for superimposing CGA over a different source video (i.e. tetriskr) */ -DEFINE_DEVICE_TYPE(ISA8_CGA_TETRISKR, isa8_cga_tetriskr_device, "tetriskr_cga", "ISA8_CGA_TETRISKR") - -//------------------------------------------------- -// isa8_cga_tetriskr_device - constructor -//------------------------------------------------- - -isa8_cga_tetriskr_device::isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - isa8_cga_superimpose_device(mconfig, ISA8_CGA_TETRISKR, tag, owner, clock), - m_bg(*this, "gfx2") -{ -} - - -void isa8_cga_tetriskr_device::device_start() -{ - m_bg_bank = 0; - isa8_cga_superimpose_device::device_start(); - m_isa->install_device(0x3c0, 0x3c0, read8smo_delegate(*this, FUNC(isa8_cga_tetriskr_device::bg_bank_r)), write8smo_delegate(*this, FUNC(isa8_cga_tetriskr_device::bg_bank_w))); -} - -void isa8_cga_tetriskr_device::bg_bank_w(uint8_t data) -{ - m_bg_bank = (data & 0x0f) ^ 8; -} - -uint8_t isa8_cga_tetriskr_device::bg_bank_r() -{ - return 0xff; -} - - -uint32_t isa8_cga_tetriskr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - //popmessage("%04x",m_start_offs); - - bitmap.fill(rgb_t::black(), cliprect); - - for(int y=cliprect.min_y;y<=cliprect.max_y;y++) - { - int yi = y % 8; - int yj = y / 8; - for(int x=cliprect.min_x;x<=cliprect.max_x;x++) - { - int xi = x % 8; - int xj = x / 8; - uint8_t color = 0; - /* TODO: first byte seems bogus? */ - for(int pen_i = 0;pen_i<4;pen_i++) - color |= ((m_bg[yj*320/8+xj+(pen_i*0x20000)+yi*0x400+m_bg_bank*0x2000+1] >> (7-xi)) & 1) << pen_i; - - bitmap.pix(y, x) = m_palette->pen(color); - } - } - - isa8_cga_device::screen_update(screen, bitmap, cliprect); - return 0; -} - -ROM_START( tetriskr_cga ) - ROM_REGION( 0x2000, "gfx1",ROMREGION_ERASE00 ) /* gfx - 1bpp font*/ - ROM_LOAD( "b-3.u36", 0x1800, 0x0800, CRC(1a636f9a) SHA1(a356cc57914d0c9b9127670b55d1f340e64b1ac9) ) - ROM_IGNORE( 0x1800 ) - - ROM_REGION( 0x80000+1, "gfx2",ROMREGION_INVERT | ROMREGION_ERASEFF ) - ROM_LOAD( "b-1.u59", 0x00000, 0x10000, CRC(4719d986) SHA1(6e0499944b968d96fbbfa3ead6237d69c769d634)) - ROM_LOAD( "b-2.u58", 0x10000, 0x10000, CRC(599e1154) SHA1(14d99f90b4fedeab0ac24ffa9b1fd9ad0f0ba699)) - ROM_LOAD( "b-4.u54", 0x20000, 0x10000, CRC(e112c450) SHA1(dfdecfc6bd617ec520b7563b7caf44b79d498bd3)) - ROM_LOAD( "b-5.u53", 0x30000, 0x10000, CRC(050b7650) SHA1(5981dda4ed43b6e81fbe48bfba90a8775d5ecddf)) - ROM_LOAD( "b-6.u49", 0x40000, 0x10000, CRC(d596ceb0) SHA1(8c82fb638688971ef11159a6b240253e63f0949d)) - ROM_LOAD( "b-7.u48", 0x50000, 0x10000, CRC(79336b6c) SHA1(7a95875f3071bdc3ee25c0e6a5a3c00ef02dc977)) - ROM_LOAD( "b-8.u44", 0x60000, 0x10000, CRC(1f82121a) SHA1(106da0f39f1260d0761217ed0a24c1611bfd7f05)) - ROM_LOAD( "b-9.u43", 0x70000, 0x10000, CRC(4ea22349) SHA1(14dfd3dbd51f8bd6f3290293b8ea1c165e8cf7fd)) -ROM_END - -const tiny_rom_entry *isa8_cga_tetriskr_device::device_rom_region() const -{ - return ROM_NAME( tetriskr_cga ); -} - - -namespace { - -class pcxt_state : public driver_device -{ -public: - pcxt_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_mb(*this, "mb"), - m_bank(*this, "bank"), - m_cvsd(*this, "voice"), - m_samples(*this, "samples"){ } - - void tetriskr(machine_config &config); - void filetto(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - TIMER_CALLBACK_MEMBER(sample_tick); - -private: - int m_lastvalue; - uint8_t m_disk_data[2]; - uint8_t m_port_b_data; - uint8_t m_status; - uint8_t m_clr_status; - uint8_t m_voice, m_bit; - uint32_t m_vaddr; - emu_timer *m_sample; - - uint8_t disk_iobank_r(offs_t offset); - void disk_iobank_w(offs_t offset, uint8_t data); - uint8_t fdc765_status_r(); - uint8_t fdc765_data_r(); - void fdc765_data_w(uint8_t data); - void fdc_dor_w(uint8_t data); - uint8_t port_a_r(); - uint8_t port_b_r(); - uint8_t port_c_r(); - void port_b_w(uint8_t data); - void voice_start_w(uint8_t data); - - required_device m_maincpu; - required_device m_mb; - optional_device m_bank; - optional_device m_cvsd; - optional_memory_region m_samples; - void bank_map(address_map &map); - void filetto_io(address_map &map); - void filetto_map(address_map &map); - void tetriskr_io(address_map &map); - void tetriskr_map(address_map &map); -}; - - -uint8_t pcxt_state::disk_iobank_r(offs_t offset) -{ - //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,m_maincpu->pc()); - //if(offset == 0) return ioport("DSW")->read(); - if(offset == 1) return ioport("IN1")->read(); - - return m_disk_data[offset]; -} - -void pcxt_state::disk_iobank_w(offs_t offset, uint8_t data) -{ -/* - BIOS does a single out $0310,$F0 on reset - - Then does 2 outs to set the bank.. - - X1 X2 - - $F0 $F2 = m0 - $F1 $F2 = m1 - $F0 $F3 = m2 - $F1 $F3 = m3 - - The sequence of - - out $0310,X1 - out $0310,X2 - - sets the selected rom that appears in $C0000-$CFFFF - -*/ - int bank = 0; - -// printf("bank %d set to %02X\n", offset,data); - - if (data == 0xF0) - { - bank = 0; - } - else - { - if((m_lastvalue == 0xF0) && (data == 0xF2)) - bank = 0; - else if ((m_lastvalue == 0xF1) && (data == 0xF2)) - bank = 1; - else if ((m_lastvalue == 0xF0) && (data == 0xF3)) - bank = 2; - else if ((m_lastvalue == 0xF1) && (data == 0xF3)) - bank = 3; - } - - if (!(data & 0xf0)) - { - int bit = (data >> 1) - 2; - m_voice &= ~(1 << bit); - m_voice |= BIT(data, 0) << bit; - } - - m_bank->set_bank(bank); - - m_lastvalue = data; - - m_disk_data[offset] = data; -} - -uint8_t pcxt_state::port_a_r() -{ - return 0xaa;//harmless keyboard error occurs without this -} - -uint8_t pcxt_state::port_b_r() -{ - return m_port_b_data; -} - -uint8_t pcxt_state::port_c_r() -{ - return 0x00;// DIPS? -} - -/*'buzzer' sound routes here*/ -/* Filetto uses this for either beep and um5100 sound routing,probably there's a mux somewhere.*/ -/* The Korean Tetris uses it as a regular buzzer,probably the sound is all in there...*/ -void pcxt_state::port_b_w(uint8_t data) -{ - m_mb->m_pit8253->write_gate2(BIT(data, 0)); - m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); - m_port_b_data = data; -// m_cvsd->digit_w(data); -} - -/*Floppy Disk Controller 765 device*/ -/*Currently we only emulate it at a point that the BIOS will pass the checks*/ - -#define FDC_BUSY 0x10 -#define FDC_WRITE 0x40 -#define FDC_READ 0x00 /*~0x40*/ - -uint8_t pcxt_state::fdc765_status_r() -{ - uint8_t tmp; - tmp = m_status | 0x80; - m_clr_status++; - if(m_clr_status == 0x10) - { - m_status = 0; - m_clr_status = 0; - } - return tmp; -} - -uint8_t pcxt_state::fdc765_data_r() -{ - m_status = (FDC_READ); - m_mb->m_pic8259->ir6_w(0); - return 0xc0; -} - -void pcxt_state::fdc765_data_w(uint8_t data) -{ - m_status = (FDC_WRITE); -} - - -void pcxt_state::fdc_dor_w(uint8_t data) -{ - m_mb->m_pic8259->ir6_w(1); -} - -// TODO: um5100 device; the actual codec may be sightly different -void pcxt_state::voice_start_w(uint8_t data) -{ - m_sample->adjust(attotime::zero, 0, attotime::from_hz(28000)); - m_bit = 7; - m_vaddr = ((m_voice & 0xf / 5) | (BIT(m_voice, 4) << 2)) * 0x8000; - logerror("%x %x\n",m_voice,m_vaddr); -} - -void pcxt_state::filetto_map(address_map &map) -{ - map(0xc0000, 0xcffff).m(m_bank, FUNC(address_map_bank_device::amap8)); - map(0xf0000, 0xfffff).rom().region("bios", 0); -} - -void pcxt_state::filetto_io(address_map &map) -{ - map.global_mask(0x3ff); - map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); - map(0x0060, 0x0060).r(FUNC(pcxt_state::port_a_r)); //not a real 8255 - map(0x0061, 0x0061).rw(FUNC(pcxt_state::port_b_r), FUNC(pcxt_state::port_b_w)); - map(0x0062, 0x0062).r(FUNC(pcxt_state::port_c_r)); - map(0x0201, 0x0201).portr("COIN"); //game port - map(0x0310, 0x0311).rw(FUNC(pcxt_state::disk_iobank_r), FUNC(pcxt_state::disk_iobank_w)); //Prototyping card - map(0x0312, 0x0312).portr("IN0"); //Prototyping card,read only - map(0x0313, 0x0313).w(FUNC(pcxt_state::voice_start_w)); - map(0x03f2, 0x03f2).w(FUNC(pcxt_state::fdc_dor_w)); - map(0x03f4, 0x03f4).r(FUNC(pcxt_state::fdc765_status_r)); //765 Floppy Disk Controller (FDC) Status - map(0x03f5, 0x03f5).rw(FUNC(pcxt_state::fdc765_data_r), FUNC(pcxt_state::fdc765_data_w));//FDC Data -} - -void pcxt_state::tetriskr_map(address_map &map) -{ - map(0xf0000, 0xfffff).rom().region("bios", 0); -} - -void pcxt_state::tetriskr_io(address_map &map) -{ - map.global_mask(0x3ff); - map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); - map(0x0060, 0x0060).r(FUNC(pcxt_state::port_a_r)); //not a real 8255 - map(0x0061, 0x0061).rw(FUNC(pcxt_state::port_b_r), FUNC(pcxt_state::port_b_w)); - map(0x0062, 0x0062).r(FUNC(pcxt_state::port_c_r)); - map(0x03c8, 0x03c8).portr("IN0"); - map(0x03c9, 0x03c9).portr("IN1"); -// map(0x03ce, 0x03ce).portr("IN1"); //read then discarded? -} - -void pcxt_state::bank_map(address_map &map) -{ - map(0x00000, 0x3ffff).rom().region("game_prg", 0); -} - -static INPUT_PORTS_START( filetto ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - - PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Extra Play" ) - PORT_DIPSETTING( 0x04, DEF_STR( No ) ) - PORT_DIPSETTING( 0x00, "Play at 6th match reached" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("COIN") - PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START( "pcvideo_cga_config" ) - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - -static INPUT_PORTS_START( tetriskr ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) //probably unused - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - PORT_START("IN1") //dip-switches - PORT_DIPNAME( 0x03, 0x03, "Starting Level" ) - PORT_DIPSETTING( 0x03, "0" ) - PORT_DIPSETTING( 0x02, "2" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x00, "6" ) - PORT_DIPNAME( 0x04, 0x04, "Starting Bomb" ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) ) -// PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) duplicate - PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) - - PORT_START( "pcvideo_cga_config" ) - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - -TIMER_CALLBACK_MEMBER(pcxt_state::sample_tick) -{ - m_cvsd->digit_w(BIT(m_samples->as_u8(m_vaddr), m_bit)); - m_cvsd->clock_w(1); - m_cvsd->clock_w(0); - if (m_bit == 0) - { - m_vaddr++; - m_bit = 8; - if (!(m_vaddr % 0x8000)) - m_sample->adjust(attotime::never); - } - m_bit--; -} - -void pcxt_state::machine_start() -{ - m_sample = timer_alloc(FUNC(pcxt_state::sample_tick), this); - - m_status = 0; - m_clr_status = 0; -} - -void pcxt_state::machine_reset() -{ - m_lastvalue = -1; - m_voice = 0; -} - -static void filetto_isa8_cards(device_slot_interface &device) -{ - device.option_add_internal("filetto", ISA8_CGA_FILETTO); - device.option_add_internal("tetriskr", ISA8_CGA_TETRISKR); -} - - -void pcxt_state::filetto(machine_config &config) -{ - I8088(config, m_maincpu, XTAL(14'318'181)/3); - m_maincpu->set_addrmap(AS_PROGRAM, &pcxt_state::filetto_map); - m_maincpu->set_addrmap(AS_IO, &pcxt_state::filetto_io); - m_maincpu->set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); - - PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu); - m_mb->int_callback().set_inputline(m_maincpu, 0); - m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - - ISA8_SLOT(config, "isa1", 0, "mb:isa", filetto_isa8_cards, "filetto", true); // FIXME: determine ISA bus clock - - HC55516(config, m_cvsd, 0).add_route(ALL_OUTPUTS, "mb:mono", 0.60); //8923S-UM5100 is a HC55536 with ROM hook-up - - RAM(config, RAM_TAG).set_default_size("640K"); - - ADDRESS_MAP_BANK(config, m_bank).set_map(&pcxt_state::bank_map).set_options(ENDIANNESS_LITTLE, 8, 18, 0x10000); -} - -void pcxt_state::tetriskr(machine_config &config) -{ - I8088(config, m_maincpu, XTAL(14'318'181)/3); - m_maincpu->set_addrmap(AS_PROGRAM, &pcxt_state::tetriskr_map); - m_maincpu->set_addrmap(AS_IO, &pcxt_state::tetriskr_io); - m_maincpu->set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); - - PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu); - m_mb->int_callback().set_inputline(m_maincpu, 0); - m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - - ISA8_SLOT(config, "isa1", 0, "mb:isa", filetto_isa8_cards, "tetriskr", true); // FIXME: determine ISA bus clock - - RAM(config, RAM_TAG).set_default_size("64K"); -} - -ROM_START( filetto ) - ROM_REGION( 0x10000, "bios", 0 ) - ROM_LOAD("u49.bin", 0xc000, 0x2000, CRC(1be6948a) SHA1(9c433f63d347c211ee4663f133e8417221bc4bf0)) - ROM_RELOAD( 0x8000, 0x2000 ) - ROM_RELOAD( 0x4000, 0x2000 ) - ROM_RELOAD( 0x0000, 0x2000 ) - ROM_LOAD("u55.bin", 0xe000, 0x2000, CRC(1e455ed7) SHA1(786d18ce0ab1af45fc538a2300853e497488f0d4) ) - ROM_RELOAD( 0xa000, 0x2000 ) - ROM_RELOAD( 0x6000, 0x2000 ) - ROM_RELOAD( 0x2000, 0x2000 ) - - ROM_REGION( 0x40000, "game_prg", 0 ) // program data - ROM_LOAD( "m0.u1", 0x00000, 0x10000, CRC(2408289d) SHA1(eafc144a557a79b58bcb48545cb9c9778e61fcd3) ) - ROM_LOAD( "m1.u2", 0x10000, 0x10000, CRC(5b623114) SHA1(0d9a14e6b7f57ce4fa09762343b610a973910f58) ) - ROM_LOAD( "m2.u3", 0x20000, 0x10000, CRC(abc64869) SHA1(564fc9d90d241a7b7776160b3fd036fb08037355) ) - ROM_LOAD( "m3.u4", 0x30000, 0x10000, CRC(0c1e8a67) SHA1(f1b9280c65fcfcb5ec481cae48eb6f52d6cdbc9d) ) - - ROM_REGION( 0x40000, "samples", 0 ) // UM5100 sample roms? - ROM_LOAD("v1.u15", 0x00000, 0x20000, CRC(613ddd07) SHA1(ebda3d559315879819cb7034b5696f8e7861fe42) ) - ROM_LOAD("v2.u14", 0x20000, 0x20000, CRC(427e012e) SHA1(50514a6307e63078fe7444a96e39d834684db7df) ) -ROM_END - -ROM_START( tetriskr ) - ROM_REGION( 0x10000, "bios", 0 ) /* code */ - ROM_LOAD( "b-10.u10", 0x0000, 0x10000, CRC(efc2a0f6) SHA1(5f0f1e90237bee9b78184035a32055b059a91eb3) ) - ROM_FILL( 0x1bdb, 1, 0xba ) // patch to work around input bug mentioned above - ROM_FILL( 0x1bdc, 1, 0x00 ) - ROM_FILL( 0x1bdd, 1, 0x01 ) - ROM_FILL( 0x1bde, 1, 0x8e ) - ROM_FILL( 0x1bdf, 1, 0xda ) -ROM_END - -} // anonymous namespace - - -GAME( 1990, filetto, 0, filetto, filetto, pcxt_state, empty_init, ROT0, "Novarmatic", "Filetto (v1.05 901009)", MACHINE_IMPERFECT_SOUND ) -GAME( 1988?,tetriskr, 0, tetriskr, tetriskr, pcxt_state, empty_init, ROT0, "bootleg", "Tetris (Korean bootleg of Mirrorsoft PC-XT Tetris)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/pc/sis630.cpp b/src/mame/pc/sis630.cpp index 8772064370ac6..eb2640baef137 100644 --- a/src/mame/pc/sis630.cpp +++ b/src/mame/pc/sis630.cpp @@ -10,8 +10,8 @@ TODO (main): \- fan monitor, cfr. I/O $294 reads in shutms11 BIOS fan tests; \- FDC doesn't work, moans on first boot; - '900 Ethernet PXE (missing ROM dump); -- USB controllers (OpenHCI complaint); -- ACPI is not fully lpc-acpi complaint; +- USB controllers (OpenHCI compliant); +- ACPI is not fully lpc-acpi compliant; - EISA slots; - SMBus; - PS/2 mouse is unstable, worked around by disabling and using a serial mouse instead. @@ -316,7 +316,7 @@ void sis630_state::sis630(machine_config &config) serport1.ri_handler().set("superio:it8705f", FUNC(it8705f_device::nri2_w)); serport1.cts_handler().set("superio:it8705f", FUNC(it8705f_device::ncts2_w)); - // TODO: AMR (Audio/modem riser) + UPT (Panel Link-TV out), assume [E]ISA complaint, needs specific slot options + // TODO: AMR (Audio/modem riser) + UPT (Panel Link-TV out), assume [E]ISA compliant, needs specific slot options // ISA16_SLOT(config, "isa1", 0, "pci:01.0:isabus", pc_isa16_cards, nullptr, false); // ISA16_SLOT(config, "isa2", 0, "pci:01.0:isabus", pc_isa16_cards, nullptr, false); } diff --git a/src/mame/pc/tetriskr.cpp b/src/mame/pc/tetriskr.cpp new file mode 100644 index 0000000000000..f43e543ff1b04 --- /dev/null +++ b/src/mame/pc/tetriskr.cpp @@ -0,0 +1,281 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese, David Haywood, Tomasz Slanina +/****************************************************************************************** + +Korean Tetris Arcade game +(blantant rip-off of the Mirrorsoft/Andromeda Software Tetris PC-XT) + +original tetriunk.c by David Haywood & Tomasz Slanina + + +TODO: +- 02851: tetriskr: Corrupt game graphics after some time of gameplay, caused by a wrong + reading of the i/o $3c8 bit 1. (seems fixed?) +- tetriskr can store inputs read during the timer irq. If ds is 0x40 when the irq is taken + it will corrupt the BIOS data area which can lead to corrupt graphics +- DC offsetted buzzer sound; + +******************************************************************************************/ + +#include "emu.h" +#include "bus/isa/cga.h" +#include "cpu/i86/i86.h" +#include "machine/genpc.h" + +class isa8_cga_tetriskr_device : public isa8_cga_superimpose_device +{ +public: + // construction/destruction + isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual void device_start() override; + virtual const tiny_rom_entry *device_rom_region() const override; + + uint8_t bg_bank_r(); + void bg_bank_w(uint8_t data); +private: + required_region_ptr m_bg; + uint8_t m_bg_bank = 0; +}; + + +/* for superimposing CGA over a different source video (i.e. tetriskr) */ +DEFINE_DEVICE_TYPE(ISA8_CGA_TETRISKR, isa8_cga_tetriskr_device, "tetriskr_cga", "ISA8_CGA_TETRISKR") + +//------------------------------------------------- +// isa8_cga_tetriskr_device - constructor +//------------------------------------------------- + +isa8_cga_tetriskr_device::isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + isa8_cga_superimpose_device(mconfig, ISA8_CGA_TETRISKR, tag, owner, clock), + m_bg(*this, "gfx2") +{ +} + + +void isa8_cga_tetriskr_device::device_start() +{ + m_bg_bank = 0; + isa8_cga_superimpose_device::device_start(); + m_isa->install_device(0x3c0, 0x3c0, read8smo_delegate(*this, FUNC(isa8_cga_tetriskr_device::bg_bank_r)), write8smo_delegate(*this, FUNC(isa8_cga_tetriskr_device::bg_bank_w))); +} + +void isa8_cga_tetriskr_device::bg_bank_w(uint8_t data) +{ + m_bg_bank = (data & 0x0f) ^ 8; +} + +uint8_t isa8_cga_tetriskr_device::bg_bank_r() +{ + return 0xff; +} + + +uint32_t isa8_cga_tetriskr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + //popmessage("%04x",m_start_offs); + + bitmap.fill(rgb_t::black(), cliprect); + + for(int y=cliprect.min_y;y<=cliprect.max_y;y++) + { + int yi = y % 8; + int yj = y / 8; + for(int x=cliprect.min_x;x<=cliprect.max_x;x++) + { + int xi = x % 8; + int xj = x / 8; + uint8_t color = 0; + /* TODO: first byte seems bogus? */ + for(int pen_i = 0;pen_i<4;pen_i++) + color |= ((m_bg[yj*320/8+xj+(pen_i*0x20000)+yi*0x400+m_bg_bank*0x2000+1] >> (7-xi)) & 1) << pen_i; + + bitmap.pix(y, x) = m_palette->pen(color); + } + } + + isa8_cga_device::screen_update(screen, bitmap, cliprect); + return 0; +} + +ROM_START( tetriskr_cga ) + ROM_REGION( 0x2000, "gfx1",ROMREGION_ERASE00 ) /* gfx - 1bpp font*/ + ROM_LOAD( "b-3.u36", 0x1800, 0x0800, CRC(1a636f9a) SHA1(a356cc57914d0c9b9127670b55d1f340e64b1ac9) ) + ROM_IGNORE( 0x1800 ) + + ROM_REGION( 0x80000+1, "gfx2",ROMREGION_INVERT | ROMREGION_ERASEFF ) + ROM_LOAD( "b-1.u59", 0x00000, 0x10000, CRC(4719d986) SHA1(6e0499944b968d96fbbfa3ead6237d69c769d634)) + ROM_LOAD( "b-2.u58", 0x10000, 0x10000, CRC(599e1154) SHA1(14d99f90b4fedeab0ac24ffa9b1fd9ad0f0ba699)) + ROM_LOAD( "b-4.u54", 0x20000, 0x10000, CRC(e112c450) SHA1(dfdecfc6bd617ec520b7563b7caf44b79d498bd3)) + ROM_LOAD( "b-5.u53", 0x30000, 0x10000, CRC(050b7650) SHA1(5981dda4ed43b6e81fbe48bfba90a8775d5ecddf)) + ROM_LOAD( "b-6.u49", 0x40000, 0x10000, CRC(d596ceb0) SHA1(8c82fb638688971ef11159a6b240253e63f0949d)) + ROM_LOAD( "b-7.u48", 0x50000, 0x10000, CRC(79336b6c) SHA1(7a95875f3071bdc3ee25c0e6a5a3c00ef02dc977)) + ROM_LOAD( "b-8.u44", 0x60000, 0x10000, CRC(1f82121a) SHA1(106da0f39f1260d0761217ed0a24c1611bfd7f05)) + ROM_LOAD( "b-9.u43", 0x70000, 0x10000, CRC(4ea22349) SHA1(14dfd3dbd51f8bd6f3290293b8ea1c165e8cf7fd)) +ROM_END + +const tiny_rom_entry *isa8_cga_tetriskr_device::device_rom_region() const +{ + return ROM_NAME( tetriskr_cga ); +} + + +namespace { + +class tetriskr_state : public driver_device +{ +public: + tetriskr_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_mb(*this, "mb") + { } + + void tetriskr(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + TIMER_CALLBACK_MEMBER(sample_tick); + +private: + uint8_t m_port_b_data; + + uint8_t port_a_r(); + uint8_t port_b_r(); + uint8_t port_c_r(); + void port_b_w(uint8_t data); + + required_device m_maincpu; + required_device m_mb; + void tetriskr_io(address_map &map); + void tetriskr_map(address_map &map); +}; + +uint8_t tetriskr_state::port_a_r() +{ + //harmless keyboard error occurs without this + return 0xaa; +} + +uint8_t tetriskr_state::port_b_r() +{ + return m_port_b_data; +} + +uint8_t tetriskr_state::port_c_r() +{ + return 0x00;// DIPS? +} + +void tetriskr_state::port_b_w(uint8_t data) +{ + m_mb->m_pit8253->write_gate2(BIT(data, 0)); + m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); + m_port_b_data = data; +// m_cvsd->digit_w(data); +} + +void tetriskr_state::tetriskr_map(address_map &map) +{ + map(0xf0000, 0xfffff).rom().region("bios", 0); +} + +void tetriskr_state::tetriskr_io(address_map &map) +{ + map.global_mask(0x3ff); + map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); + map(0x0060, 0x0060).r(FUNC(tetriskr_state::port_a_r)); //not a real 8255 + map(0x0061, 0x0061).rw(FUNC(tetriskr_state::port_b_r), FUNC(tetriskr_state::port_b_w)); + map(0x0062, 0x0062).r(FUNC(tetriskr_state::port_c_r)); + map(0x03c8, 0x03c8).portr("IN0"); + map(0x03c9, 0x03c9).portr("IN1"); +// map(0x03ce, 0x03ce).portr("IN1"); //read then discarded? +} + +static INPUT_PORTS_START( tetriskr ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) //probably unused + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + PORT_START("IN1") //dip-switches + PORT_DIPNAME( 0x03, 0x03, "Starting Level" ) + PORT_DIPSETTING( 0x03, "0" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x00, "6" ) + PORT_DIPNAME( 0x04, 0x04, "Starting Bomb" ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) ) +// PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) duplicate + PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) + + PORT_START( "pcvideo_cga_config" ) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +void tetriskr_state::machine_start() +{ +} + +void tetriskr_state::machine_reset() +{ +} + +static void tetriskr_isa8_cards(device_slot_interface &device) +{ + device.option_add_internal("tetriskr", ISA8_CGA_TETRISKR); +} + + +void tetriskr_state::tetriskr(machine_config &config) +{ + I8088(config, m_maincpu, XTAL(14'318'181)/3); + m_maincpu->set_addrmap(AS_PROGRAM, &tetriskr_state::tetriskr_map); + m_maincpu->set_addrmap(AS_IO, &tetriskr_state::tetriskr_io); + m_maincpu->set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); + + PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu); + m_mb->int_callback().set_inputline(m_maincpu, 0); + m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + + ISA8_SLOT(config, "isa1", 0, "mb:isa", tetriskr_isa8_cards, "tetriskr", true); // FIXME: determine ISA bus clock + + RAM(config, RAM_TAG).set_default_size("64K"); +} + +ROM_START( tetriskr ) + ROM_REGION( 0x10000, "bios", 0 ) /* code */ + ROM_LOAD( "b-10.u10", 0x0000, 0x10000, CRC(efc2a0f6) SHA1(5f0f1e90237bee9b78184035a32055b059a91eb3) ) + ROM_FILL( 0x1bdb, 1, 0xba ) // patch to work around input bug mentioned above + ROM_FILL( 0x1bdc, 1, 0x00 ) + ROM_FILL( 0x1bdd, 1, 0x01 ) + ROM_FILL( 0x1bde, 1, 0x8e ) + ROM_FILL( 0x1bdf, 1, 0xda ) +ROM_END + +} // anonymous namespace + + +GAME( 1988?,tetriskr, 0, tetriskr, tetriskr, tetriskr_state, empty_init, ROT0, "bootleg", "Tetris (Korean bootleg of Mirrorsoft PC-XT Tetris)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/philips/cdi.cpp b/src/mame/philips/cdi.cpp index de3ab5b3f1fee..1bf25ae6ca603 100644 --- a/src/mame/philips/cdi.cpp +++ b/src/mame/philips/cdi.cpp @@ -669,9 +669,11 @@ ROM_START( cdi490a ) ROM_SYSTEM_BIOS( 0, "cdi490", "CD-i 490" ) ROMX_LOAD( "cdi490a.rom", 0x000000, 0x80000, CRC(e2f200f6) SHA1(c9bf3c4c7e4fe5cbec3fe3fc993c77a4522ca547), ROM_BIOS(0) | ROM_GROUPWORD | ROM_REVERSE ) - ROM_REGION(0x40000, "mpegs", 0) // keep these somewhere - ROM_LOAD( "impega.rom", 0x0000, 0x40000, CRC(84d6f6aa) SHA1(02526482a0851ea2a7b582d8afaa8ef14a8bd914) ) - ROM_LOAD( "vmpega.rom", 0x0000, 0x40000, CRC(db264e8b) SHA1(be407fbc102f1731a0862554855e963e5a47c17b) ) + ROM_REGION(0x60000, "mpegs", 0) // keep these somewhere + ROM_LOAD( "impega.rom", 0x00000, 0x40000, CRC(84d6f6aa) SHA1(02526482a0851ea2a7b582d8afaa8ef14a8bd914) ) // 1ST AND 2ND HALF IDENTICAL + // Philips CD-i - DVC card 22ER9141 + ROM_LOAD16_BYTE( "fmv ffd9 p7308 r4.1 vmpeg.bin", 0x40000, 0x10000, CRC(30ba9273) SHA1(d8adca0627b356ced6131b9458ac1175e43e6548) ) + ROM_LOAD16_BYTE( "fmv 4ba9 p7307 r4.1 vmpeg.bin", 0x40001, 0x10000, CRC(623edb1f) SHA1(4c6b11e28ad4c2f5c2e439f7910a783e0a79d1a9) ) ROM_END ROM_START( cdibios ) // for the quizard sets diff --git a/src/mame/phoenix/phoenix.h b/src/mame/phoenix/phoenix.h index 4d960d8324a62..26e59f2b5bf16 100644 --- a/src/mame/phoenix/phoenix.h +++ b/src/mame/phoenix/phoenix.h @@ -23,7 +23,7 @@ class phoenix_state : public driver_device { } - DECLARE_CUSTOM_INPUT_MEMBER(player_input_r); + ioport_value player_input_r(); int pleiads_protection_r(); void condor(machine_config &config); diff --git a/src/mame/phoenix/phoenix_v.cpp b/src/mame/phoenix/phoenix_v.cpp index c0774699549cb..64b4bacd41367 100644 --- a/src/mame/phoenix/phoenix_v.cpp +++ b/src/mame/phoenix/phoenix_v.cpp @@ -294,7 +294,7 @@ void phoenix_state::phoenix_scroll_w(uint8_t data) } -CUSTOM_INPUT_MEMBER(phoenix_state::player_input_r) +ioport_value phoenix_state::player_input_r() { if (m_cocktail_mode) return (ioport("CTRL")->read() & 0xf0) >> 4; diff --git a/src/mame/pinball/flicker.cpp b/src/mame/pinball/flicker.cpp index 9665416ffdf85..2d6c547811dc3 100644 --- a/src/mame/pinball/flicker.cpp +++ b/src/mame/pinball/flicker.cpp @@ -61,7 +61,7 @@ class flicker_state : public genpin_class { } - DECLARE_CUSTOM_INPUT_MEMBER(coins_in); + ioport_value coins_in(); DECLARE_INPUT_CHANGED_MEMBER(test_changed); @@ -379,7 +379,7 @@ void flicker_state::cm_ram2_w(int state) } -CUSTOM_INPUT_MEMBER(flicker_state::coins_in) +ioport_value flicker_state::coins_in() { u8 const coins(m_coinport->read()); return BIT(coins, 7) ? (coins & 0x3f) : 0; diff --git a/src/mame/pinball/icecold.cpp b/src/mame/pinball/icecold.cpp index 11cf16bf1984b..820ffe02250aa 100644 --- a/src/mame/pinball/icecold.cpp +++ b/src/mame/pinball/icecold.cpp @@ -51,7 +51,7 @@ class icecold_state : public driver_device void icecold(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER( test_switch_press ); - DECLARE_CUSTOM_INPUT_MEMBER( motors_limit_r ); + ioport_value motors_limit_r(); protected: virtual void machine_start() override; @@ -225,7 +225,7 @@ void icecold_state::machine_reset() m_ball_gate_sw = 1; } -CUSTOM_INPUT_MEMBER( icecold_state::motors_limit_r ) +ioport_value icecold_state::motors_limit_r() { uint8_t data = 0; diff --git a/src/mame/pinball/micropin.cpp b/src/mame/pinball/micropin.cpp index f06f89f53a4d3..4f218e6c49426 100644 --- a/src/mame/pinball/micropin.cpp +++ b/src/mame/pinball/micropin.cpp @@ -548,7 +548,16 @@ ROM_START(pentacup2) // 2 undumped proms DMA-01, DMA-02 ROM_END -} // Anonymous namespace +ROM_START(pentacupt) + ROM_REGION(0x10000, "v2cpu", 0) + ROM_LOAD("microt_1.bin", 0x0000, 0x0800, CRC(690646eb) SHA1(86253b61ac9554ee5bdcdf9c0a2302fc393b9ada)) + ROM_LOAD("microt_2.bin", 0x0800, 0x0800, CRC(51d09098) SHA1(4efe3a05ad60f0fc52aa5402e660f34b99855b59)) + ROM_LOAD("microt_3.bin", 0x1000, 0x0800, CRC(cefb0966) SHA1(836491745417fc0d5f88c01a9c69a5c322d194be)) + ROM_LOAD("microt_4.bin", 0x1800, 0x0800, CRC(6f691929) SHA1(a18352312706e0f0af14a33fac31c3f5f7156ba8)) +ROM_END + +} // anonymous namespace GAME(1978, pentacup, 0, pent6800, pent6800, pent6800_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1980, pentacup2, pentacup, pent8085, pent8085, pent8085_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, pentacupt, pentacup, pent8085, pent8085, pent8085_state, empty_init, ROT0, "Micropin", "Pentacup (rev. T)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/pinball/mrgame.cpp b/src/mame/pinball/mrgame.cpp index 8efd90dd314f3..e7a29a866cdc5 100644 --- a/src/mame/pinball/mrgame.cpp +++ b/src/mame/pinball/mrgame.cpp @@ -728,7 +728,7 @@ void mrgame_state::mrgame(machine_config &config) dacvol.add_route(0, "rdac", -1.0, DAC_INPUT_RANGE_LO); tms5220_device &tms(TMS5220(config, "tms", 672000)); // uses a RC combination. 672k copied from jedi.h - tms.ready_cb().set_inputline("audiocpu2", Z80_INPUT_LINE_BOGUSWAIT); + tms.ready_cb().set_inputline("audiocpu2", Z80_INPUT_LINE_WAIT); tms.add_route(ALL_OUTPUTS, "lspeaker", 1.0); tms.add_route(ALL_OUTPUTS, "rspeaker", 1.0); diff --git a/src/mame/pinball/peyper.cpp b/src/mame/pinball/peyper.cpp index ecb18ac6d993c..3170395ec56d7 100644 --- a/src/mame/pinball/peyper.cpp +++ b/src/mame/pinball/peyper.cpp @@ -63,7 +63,7 @@ class peyper_state : public genpin_class , m_io_outputs(*this, "out%d", 0U) { } - template DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r); + template ioport_value wolfman_replay_hs_r(); void init_0() { m_game = 0; } void init_1() { m_game = 1; } void init_2() { m_game = 2; } @@ -213,7 +213,7 @@ void peyper_state::sol_w(u8 data) template -CUSTOM_INPUT_MEMBER(peyper_state::wolfman_replay_hs_r) +ioport_value peyper_state::wolfman_replay_hs_r() { switch (Mask) { diff --git a/src/mame/pinball/sam.cpp b/src/mame/pinball/sam.cpp index 2232038c684d8..6df35362031b6 100644 --- a/src/mame/pinball/sam.cpp +++ b/src/mame/pinball/sam.cpp @@ -54,7 +54,6 @@ The Walking Dead (Pro) F8 *********************************************************************************************************************/ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" namespace { diff --git a/src/mame/pinball/st_mp200.cpp b/src/mame/pinball/st_mp200.cpp index 48a1309548ef2..5c5338f97bfb1 100644 --- a/src/mame/pinball/st_mp200.cpp +++ b/src/mame/pinball/st_mp200.cpp @@ -426,7 +426,7 @@ void st_mp200_state::u11_ca2_w(int state) m_s14001a->set_output_gain(0, ((m_u10a >> 3 & 0xf) + 1) / 16.0); u8 clock_divisor = 16 - (m_u10a & 0x07); - m_s14001a->set_clock(S14001_CLOCK / clock_divisor / 8); + m_s14001a->set_unscaled_clock(S14001_CLOCK / clock_divisor / 8); } } } diff --git a/src/mame/playmark/playmark.cpp b/src/mame/playmark/playmark.cpp index 7452cadcbc6b9..53c5cb49c6469 100644 --- a/src/mame/playmark/playmark.cpp +++ b/src/mame/playmark/playmark.cpp @@ -1315,8 +1315,8 @@ void playmark_state::hotmind(machine_config &config) MCFG_VIDEO_START_OVERRIDE(playmark_state,hotmind) - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); @@ -1356,8 +1356,8 @@ void playmark_state::luckboomh(machine_config &config) MCFG_VIDEO_START_OVERRIDE(playmark_state,luckboomh) - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/playmark/powerbal.cpp b/src/mame/playmark/powerbal.cpp index 490a4511dd43b..51caf7d412a20 100644 --- a/src/mame/playmark/powerbal.cpp +++ b/src/mame/playmark/powerbal.cpp @@ -699,8 +699,8 @@ void magicstk_state::magicstk(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_powerbal); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 512); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/promat/gstream.cpp b/src/mame/promat/gstream.cpp index e485c62602225..ae72a8408cabe 100644 --- a/src/mame/promat/gstream.cpp +++ b/src/mame/promat/gstream.cpp @@ -165,7 +165,7 @@ class gstream_state : public driver_device void init_x2222(); int mirror_service_r(); - DECLARE_CUSTOM_INPUT_MEMBER(gstream_mirror_r); + ioport_value gstream_mirror_r(); int x2222_toggle_r(); private: @@ -232,7 +232,7 @@ int gstream_state::mirror_service_r() return ~result; } -CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_r) +ioport_value gstream_state::gstream_mirror_r() { int result; diff --git a/src/mame/psikyo/psikyo4.cpp b/src/mame/psikyo/psikyo4.cpp index e14de096750cb..174f064463c5d 100644 --- a/src/mame/psikyo/psikyo4.cpp +++ b/src/mame/psikyo/psikyo4.cpp @@ -166,7 +166,7 @@ INTERRUPT_GEN_MEMBER(psikyo4_state::interrupt) } template -CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */ +ioport_value psikyo4_state::mahjong_ctrl_r()/* used by hotgmck/hgkairak */ { int ret = 0xff; @@ -297,7 +297,7 @@ void psikyo4_state::ps4_ymf_map(address_map &map) } -CUSTOM_INPUT_MEMBER(psikyo4_state::system_r) +ioport_value psikyo4_state::system_r() { return m_system->read(); } diff --git a/src/mame/psikyo/psikyo4.h b/src/mame/psikyo/psikyo4.h index 227c3516827fe..ad14699766188 100644 --- a/src/mame/psikyo/psikyo4.h +++ b/src/mame/psikyo/psikyo4.h @@ -36,8 +36,8 @@ class psikyo4_state : public driver_device void ps4big(machine_config &config); void ps4small(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(system_r); - template DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r); + ioport_value system_r(); + template ioport_value mahjong_ctrl_r(); private: /* memory pointers */ diff --git a/src/mame/psion/psion5.cpp b/src/mame/psion/psion5.cpp index 244b1ae00a324..e711e9392b255 100644 --- a/src/mame/psion/psion5.cpp +++ b/src/mame/psion/psion5.cpp @@ -125,8 +125,8 @@ void psion5mx_state::check_interrupts() { m_maincpu->resume(SUSPEND_REASON_HALT); } - m_maincpu->set_input_line(ARM7_FIRQ_LINE, m_pending_ints & m_int_mask & IRQ_FIQ_MASK ? ASSERT_LINE : CLEAR_LINE); - m_maincpu->set_input_line(ARM7_IRQ_LINE, m_pending_ints & m_int_mask & IRQ_IRQ_MASK ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_pending_ints & m_int_mask & IRQ_FIQ_MASK ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_pending_ints & m_int_mask & IRQ_IRQ_MASK ? ASSERT_LINE : CLEAR_LINE); } TIMER_CALLBACK_MEMBER(psion5mx_state::update_timer1) diff --git a/src/mame/psion/psion5.h b/src/mame/psion/psion5.h index 3dad0a0e415ab..4ecb68ee59b4b 100644 --- a/src/mame/psion/psion5.h +++ b/src/mame/psion/psion5.h @@ -15,7 +15,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "etna.h" #include "sound/spkrdev.h" diff --git a/src/mame/rare/kinst.cpp b/src/mame/rare/kinst.cpp index 0453ec7ebe8c3..8238d0c89bec7 100644 --- a/src/mame/rare/kinst.cpp +++ b/src/mame/rare/kinst.cpp @@ -219,7 +219,7 @@ class kinst_state : public driver_device void kinst(machine_config &config); void kinst2(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(sound_status_r) { return BIT(m_dcs->control_r(), 11); } + ioport_value sound_status_r() { return BIT(m_dcs->control_r(), 11); } protected: required_device m_maincpu; diff --git a/src/mame/rare/xtheball.cpp b/src/mame/rare/xtheball.cpp index 27036f93f896a..8c1312e3ed086 100644 --- a/src/mame/rare/xtheball.cpp +++ b/src/mame/rare/xtheball.cpp @@ -25,16 +25,17 @@ namespace { class xtheball_state : public driver_device { public: - xtheball_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_watchdog(*this, "watchdog"), - m_tlc34076(*this, "tlc34076"), - m_ticket(*this, "ticket"), - m_vram_bg(*this, "vrabg"), - m_vram_fg(*this, "vrafg"), - m_analog_x(*this, "ANALOGX"), - m_analog_y(*this, "ANALOGY") { } + xtheball_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_watchdog(*this, "watchdog"), + m_tlc34076(*this, "tlc34076"), + m_ticket(*this, "ticket"), + m_vram_bg(*this, "vrabg"), + m_vram_fg(*this, "vrafg"), + m_analog_x(*this, "ANALOGX"), + m_analog_y(*this, "ANALOGY") + { } void xtheball(machine_config &config); @@ -319,7 +320,7 @@ void xtheball_state::xtheball(machine_config &config) latch3.q_out_cb<3>().set(FUNC(xtheball_state::foreground_mode_w)); // Q3 = video foreground control? - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); WATCHDOG_TIMER(config, m_watchdog); diff --git a/src/mame/recfranco/rfslots8085.cpp b/src/mame/recfranco/rfslots8085.cpp index 217d41c9ea684..25729c8fa5e08 100644 --- a/src/mame/recfranco/rfslots8085.cpp +++ b/src/mame/recfranco/rfslots8085.cpp @@ -845,8 +845,8 @@ void rfslots8085_state::rf53_3297(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper[0], attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // hopper motor 25 Pts. - HOPPER(config, m_hopper[1], attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // hopper motor 100 Pts. + HOPPER(config, m_hopper[0], attotime::from_msec(150)); // hopper motor 25 Pts. + HOPPER(config, m_hopper[1], attotime::from_msec(150)); // hopper motor 100 Pts. add_em_reels(config, 100, attotime::from_double(2)); diff --git a/src/mame/recfranco/rfslotsmcs48.cpp b/src/mame/recfranco/rfslotsmcs48.cpp index 2795c75774500..40dcd01aa676d 100644 --- a/src/mame/recfranco/rfslotsmcs48.cpp +++ b/src/mame/recfranco/rfslotsmcs48.cpp @@ -728,7 +728,7 @@ void rfslotsmcs48_state::rf_3115_base(machine_config &config) NVRAM(config, "data_ram", nvram_device::DEFAULT_ALL_0); // Hopper device - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); SPEAKER(config, "mono").front_center(); } diff --git a/src/mame/saitek/blitz.cpp b/src/mame/saitek/blitz.cpp index 50364cd199f8e..5f9d6ce1518b4 100644 --- a/src/mame/saitek/blitz.cpp +++ b/src/mame/saitek/blitz.cpp @@ -116,6 +116,12 @@ class blitz_state : public driver_device void p6_w(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void blitz_state::machine_start() { m_out_lcd.resolve(); @@ -280,7 +286,7 @@ static INPUT_PORTS_START( blitz ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN) PORT_START("POWER") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, blitz_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, blitz_state, power_off, 0) INPUT_PORTS_END diff --git a/src/mame/saitek/chesstrv.cpp b/src/mame/saitek/chesstrv.cpp index 5cb2e1fbd67bd..e0c4f66d1623f 100644 --- a/src/mame/saitek/chesstrv.cpp +++ b/src/mame/saitek/chesstrv.cpp @@ -313,5 +313,5 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1980, chesstrv, 0, 0, chesstrv, chesstrv, chesstrv_state, empty_init, "SciSys / Novag Industries", "Chess Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) -SYST( 1982, chesstrvi, 0, 0, chesstrvi, chesstrvi, chesstrv_state, empty_init, "SciSys", "Chess Intercontinental Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) +SYST( 1980, chesstrv, 0, 0, chesstrv, chesstrv, chesstrv_state, empty_init, "SciSys / Novag Industries / Philidor Software", "Chess Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) +SYST( 1982, chesstrvi, 0, 0, chesstrvi, chesstrvi, chesstrv_state, empty_init, "SciSys / Philidor Software", "Chess Intercontinental Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/companion2.cpp b/src/mame/saitek/companion2.cpp index b98f23d7f0a1a..81247281fb581 100644 --- a/src/mame/saitek/companion2.cpp +++ b/src/mame/saitek/companion2.cpp @@ -6,7 +6,8 @@ SciSys Chess Companion II family CXG Enterprise "S" family -The chess engine is LogiChess (ported from Z80 to 6801), by Kaare Danielsen. +The chess engine is LogiChess (ported from Z80 to 6801), by Kaare Danielsen, +after founding the company LogiSoft ApS. NOTE: It triggers an NMI when the power switch is changed from ON to MEMORY. If this is not done, NVRAM won't save properly. @@ -16,7 +17,7 @@ If this is not done, NVRAM won't save properly. ================================================================================ -Hardware notes: +SciSys Chess Companion II family hardware notes: Chess Companion II: - PCB label: YO1B-01 REV.B @@ -283,7 +284,7 @@ static INPUT_PORTS_START( enterp ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) 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, compan2_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, compan2_state, power_off, 0) INPUT_PORTS_END static INPUT_PORTS_START( expchess ) @@ -413,7 +414,7 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1983, compan2, 0, 0, compan2, compan2, compan2_state, empty_init, "SciSys", "Chess Companion II", MACHINE_SUPPORTS_SAVE ) -SYST( 1983, expchess, compan2, 0, expchess, expchess, compan2_state, empty_init, "SciSys", "Explorer Chess", MACHINE_SUPPORTS_SAVE ) +SYST( 1983, compan2, 0, 0, compan2, compan2, compan2_state, empty_init, "SciSys / LogiSoft", "Chess Companion II", MACHINE_SUPPORTS_SAVE ) +SYST( 1983, expchess, compan2, 0, expchess, expchess, compan2_state, empty_init, "SciSys / LogiSoft", "Explorer Chess", MACHINE_SUPPORTS_SAVE ) -SYST( 1984, enterp, 0, 0, enterp, enterp, compan2_state, empty_init, "CXG Systems / Newcrest Technology", "Enterprise \"S\"", MACHINE_SUPPORTS_SAVE ) +SYST( 1984, enterp, 0, 0, enterp, enterp, compan2_state, empty_init, "CXG Systems / Newcrest Technology / LogiSoft", "Enterprise \"S\"", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/corona.cpp b/src/mame/saitek/corona.cpp index 3ddb1d33fd9fc..bc170d0607ec1 100644 --- a/src/mame/saitek/corona.cpp +++ b/src/mame/saitek/corona.cpp @@ -29,13 +29,13 @@ different compared to Stratos/Turbo King. namespace { -// note: sub-class of saitek_stratos_state (see stratos.h, stratos.cpp) +// note: sub-class of stratos_base_state (see stratos.h, stratos.cpp) -class corona_state : public saitek_stratos_state +class corona_state : public stratos_base_state { public: corona_state(const machine_config &mconfig, device_type type, const char *tag) : - saitek_stratos_state(mconfig, type, tag), + stratos_base_state(mconfig, type, tag), m_rombank(*this, "rombank"), m_board(*this, "board"), m_dac(*this, "dac"), @@ -81,7 +81,7 @@ class corona_state : public saitek_stratos_state void corona_state::machine_start() { - saitek_stratos_state::machine_start(); + stratos_base_state::machine_start(); // register for savestates save_item(NAME(m_control1)); @@ -94,7 +94,7 @@ void corona_state::machine_start() void corona_state::machine_reset() { - saitek_stratos_state::machine_reset(); + stratos_base_state::machine_reset(); m_control2 = 0; m_rombank.select(0); diff --git a/src/mame/saitek/cp2000.cpp b/src/mame/saitek/cp2000.cpp index d2ede7c7c1c41..f75e74f7e6009 100644 --- a/src/mame/saitek/cp2000.cpp +++ b/src/mame/saitek/cp2000.cpp @@ -6,22 +6,24 @@ SciSys Chess Partner 2000, also sold by Novag with the same name. It's probably the last SciSys / Novag collaboration. +Entering moves is not as friendly as newer sensory games. The player is expected +to press ENTER after their own move, but if they (accidentally) press it after +doing the computer's move, the computer takes your turn. + +Capturing pieces is also unintuitive, having to press the destination square twice. + Hardware notes: - 3850PK CPU at ~2.77MHz(averaged), 3853PK memory interface - 4KB ROM, 256 bytes RAM(2*2111N) - 4-digit 7seg panel, sensory chessboard 3850 is officially rated 2MHz, and even the CP2000 manual says it runs at 2MHz, -but tests show that the chesscomputer runs at a much higher speed. Three individual -CP2000 were measured, by timing move calculation, and one recording to verify -beeper pitch and display blinking rate. Real CP2000 CPU frequency is in the -2.63MHz to 2.91MHz range. - -Entering moves is not as friendly as newer sensory games. The player is expected -to press ENTER after their own move, but if they (accidentally) press it after -doing the computer's move, the computer takes your turn. +but tests show that it runs at a much higher speed. Three individual CP2000 were +measured, by timing move calculation, and one recording to verify beeper pitch and +display blinking rate. Real CP2000 CPU frequency is in the 2.63MHz-2.91MHz range. -Capturing pieces is also unintuitive, having to press the destination square twice. +The 'sequels' CP3000-CP6000 are on HMCS40 (see minichess.cpp and trsensor.cpp), +Chess Partner 1000 does not exist. *******************************************************************************/ @@ -53,7 +55,6 @@ class cp2000_state : public driver_device m_inputs(*this, "IN.%u", 0) { } - // machine configs void cp2000(machine_config &config); protected: @@ -67,16 +68,14 @@ class cp2000_state : public driver_device required_device m_dac; required_ioport_array<4> m_inputs; - u16 m_inp_mux = 0; u8 m_select = 0; - u8 m_7seg_data = 0; + u16 m_inp_mux = 0; // address maps void main_map(address_map &map); void main_io(address_map &map); // I/O handlers - void update_display(); void control_w(u8 data); void digit_w(u8 data); u8 input_r(); @@ -87,7 +86,6 @@ void cp2000_state::machine_start() // register for savestates save_item(NAME(m_select)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_7seg_data)); } @@ -96,20 +94,12 @@ void cp2000_state::machine_start() I/O *******************************************************************************/ -// 3850 ports - -void cp2000_state::update_display() -{ - m_display->matrix(m_select, m_7seg_data); -} - void cp2000_state::control_w(u8 data) { // d0-d3: digit select - m_select = ~data; - update_display(); - // d4: keypad/chessboard select + m_select = ~data; + m_display->write_my(m_select); // d5: speaker out m_dac->write(BIT(~data, 5)); @@ -133,13 +123,13 @@ u8 cp2000_state::input_r() { // d0-d3: multiplexed inputs from d4-d7 for (int i = 0; i < 4; i++) - if (BIT(m_inp_mux, i+4)) + if (BIT(m_inp_mux, i + 4)) data |= m_inputs[i]->read(); // d4-d7: multiplexed inputs from d0-d3 for (int i = 0; i < 4; i++) if (m_inp_mux & m_inputs[i]->read()) - data |= 1 << (i+4); + data |= 0x10 << i; } return data; @@ -152,8 +142,7 @@ void cp2000_state::digit_w(u8 data) m_inp_mux = data; // also digit segment data - m_7seg_data = bitswap<8>(data,0,2,1,3,4,5,6,7); - update_display(); + m_display->write_mx(bitswap<8>(data,0,2,1,3,4,5,6,7)); } @@ -258,4 +247,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1980, cp2000, 0, 0, cp2000, cp2000, cp2000_state, empty_init, "SciSys / Novag Industries", "Chess Partner 2000", MACHINE_SUPPORTS_SAVE ) +SYST( 1980, cp2000, 0, 0, cp2000, cp2000, cp2000_state, empty_init, "SciSys / Novag Industries / Philidor Software", "Chess Partner 2000", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/delta1.cpp b/src/mame/saitek/delta1.cpp index 9699c794443a9..62ce5615527f4 100644 --- a/src/mame/saitek/delta1.cpp +++ b/src/mame/saitek/delta1.cpp @@ -31,6 +31,7 @@ In the Delta-1 ROM is even some fragmented code remaining of the message: *******************************************************************************/ #include "emu.h" + #include "cpu/f8/f8.h" #include "machine/f3853.h" #include "machine/timer.h" @@ -107,8 +108,6 @@ void delta1_state::machine_start() I/O *******************************************************************************/ -// 3850 ports - void delta1_state::update_display() { m_display->matrix(m_led_select, (m_blink && m_7seg_rc) ? 0 : m_7seg_data); diff --git a/src/mame/saitek/ecbackg.cpp b/src/mame/saitek/ecbackg.cpp index df7609798ce13..07df9b88d203f 100644 --- a/src/mame/saitek/ecbackg.cpp +++ b/src/mame/saitek/ecbackg.cpp @@ -470,7 +470,7 @@ static INPUT_PORTS_START( ecbackg ) PORT_CONFSETTING( 0x01, DEF_STR( Yes ) ) 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, ecbackg_state, power_off, 0) PORT_NAME("Stop") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, power_off, 0) PORT_NAME("Stop") PORT_START("BOARD") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, init_board, 0) PORT_NAME("Board Reset Backgammon") diff --git a/src/mame/saitek/exechess.cpp b/src/mame/saitek/exechess.cpp index c5e87b7294b85..c16c0f0372db0 100644 --- a/src/mame/saitek/exechess.cpp +++ b/src/mame/saitek/exechess.cpp @@ -268,4 +268,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1981, exechess, 0, 0, exechess, exechess, exechess_state, empty_init, "SciSys", "Executive Chess", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) +SYST( 1981, exechess, 0, 0, exechess, exechess, exechess_state, empty_init, "SciSys / Philidor Software", "Executive Chess", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index 1de39e86d1214..2a829ab3e6efd 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -154,18 +154,24 @@ class gk2000_state : public driver_device u8 m_lcd_com = 0; // I/O handlers + void standby(int state); + void lcd_pwm_w(offs_t offset, u8 data); void update_lcd(); 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(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void gk2000_state::machine_start() { m_out_lcd.resolve(); diff --git a/src/mame/saitek/intchess.cpp b/src/mame/saitek/intchess.cpp index 58e85f99d86f1..706dd028422ab 100644 --- a/src/mame/saitek/intchess.cpp +++ b/src/mame/saitek/intchess.cpp @@ -3,13 +3,18 @@ // thanks-to:Berger, Achim /******************************************************************************* -SciSys Intelligent Chess +Intelligent Games / SciSys Intelligent Chess +Developed by Intelligent Games, the same group of people that worked on SciSys +Super System III and Mark V. Manufactured by SciSys, their main business partner +at the time. The visual interface is an evolution of "Tolinka". + +It was advertised in a 1980 brochure by SciSys, but it looks like SciSys didn't +sell this chess computer. It was marketed by Intelligent Games themselves. The UK version wasn't widely released, the German version was more common. -Development by Intelligent Games, the same group of people that worked on the -Super System III and Mark V. The visual interface is an evolution of "Tolinka". Hardware notes: +- PCB label: INTELLIGENT GAMES Ltd, (C) 1980, IG3 - Synertek 6502A @ ~1.1MHz - Synertek 6522 VIA - 2*4KB ROM(Synertek 2332), 2KB RAM(4*M5L2114LP) @@ -26,6 +31,7 @@ Hardware notes: *******************************************************************************/ #include "emu.h" + #include "cpu/m6502/m6502.h" #include "imagedev/cassette.h" #include "machine/6522via.h" @@ -39,7 +45,7 @@ Hardware notes: #include "speaker.h" // internal artwork -#include "saitek_intchess.lh" +#include "intchess.lh" namespace { @@ -65,9 +71,6 @@ class intchess_state : public driver_device void intchess(machine_config &config); -protected: - virtual void machine_start() override; - private: // devices/pointers required_device m_maincpu; @@ -81,14 +84,9 @@ class intchess_state : public driver_device required_device m_palette; required_device m_cass; - u8 m_select = 0; - u8 m_7seg_data = 0; - - // address maps void main_map(address_map &map); // I/O handlers - void update_display(); void seg_w(u8 data); void control_w(u8 data); u8 control_r(); @@ -100,13 +98,6 @@ class intchess_state : public driver_device TIMER_DEVICE_CALLBACK_MEMBER(cass_input); }; -void intchess_state::machine_start() -{ - // register for savestates - save_item(NAME(m_select)); - save_item(NAME(m_7seg_data)); -} - INPUT_CHANGED_MEMBER(intchess_state::reset_button) { // assume that reset button is tied to 6502/6522 @@ -164,24 +155,17 @@ void intchess_state::vram_w(offs_t offset, u8 data) I/O *******************************************************************************/ -void intchess_state::update_display() -{ - m_display->matrix(m_select, m_7seg_data); -} - void intchess_state::seg_w(u8 data) { // PA1-PA7: 7seg data // PA0: ? - m_7seg_data = bitswap<8>(~data,0,1,2,3,4,5,6,7); - update_display(); + m_display->write_mx(bitswap<8>(~data,0,1,2,3,4,5,6,7)); } void intchess_state::control_w(u8 data) { // PB0-PB3: digit select - m_select = data & 0xf; - update_display(); + m_display->write_my(data & 0xf); // PB5-PB7 to cassette deck // PB5: speaker @@ -321,7 +305,7 @@ void intchess_state::intchess(machine_config &config) PWM_DISPLAY(config, m_display).set_size(4, 8); m_display->set_segmask(0xf, 0x7f); - config.set_default_layout(layout_saitek_intchess); + config.set_default_layout(layout_intchess); // sound hardware SPEAKER(config, "speaker").front_center(); @@ -358,4 +342,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1980, intchess, 0, 0, intchess, intchess, intchess_state, empty_init, "SciSys / Intelligent Games", "Intelligent Chess", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_GRAPHICS ) +SYST( 1980, intchess, 0, 0, intchess, intchess, intchess_state, empty_init, "Intelligent Games / SciSys", "Intelligent Chess", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/saitek/mark5.cpp b/src/mame/saitek/mark5.cpp index be57b41150a95..41bd6ea8e332c 100644 --- a/src/mame/saitek/mark5.cpp +++ b/src/mame/saitek/mark5.cpp @@ -133,6 +133,12 @@ class mark5_state : public driver_device void write_lcd(int state); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void mark5_state::machine_start() { m_out_x.resolve(); diff --git a/src/mame/saitek/minichess.cpp b/src/mame/saitek/minichess.cpp index 0ae7a13310907..248b9cf80d6b4 100644 --- a/src/mame/saitek/minichess.cpp +++ b/src/mame/saitek/minichess.cpp @@ -19,6 +19,10 @@ Excluding resellers with same title, this MCU was used in: - SciSys Chess Partner 3000 - SciSys Chess Partner 4000 +MCU clock is via a resistor, this less accurate than with an XTAL, so the speed +may vary. Graduate Chess appears to have a 62K resistor between the OSC pins, +which would make it around 500kHz? + On CP3000/4000 they added a level slider. This will oscillate the level switch input pin, so the highest level setting is the same as level 2 on Mini Chess. It works on the old A34 MCU because the game keeps reading D0 while computing. @@ -182,7 +186,7 @@ INPUT_PORTS_END void mini_state::smchess(machine_config &config) { // basic machine hardware - HD44801(config, m_maincpu, 400'000); + HD44801(config, m_maincpu, 400'000); // approximation m_maincpu->write_r<2>().set(FUNC(mini_state::seg_w<0>)); m_maincpu->write_r<3>().set(FUNC(mini_state::seg_w<1>)); m_maincpu->write_d().set(FUNC(mini_state::mux_w)); @@ -210,7 +214,7 @@ void mini_state::smchess(machine_config &config) ROM_START( smchess ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD("44801a34_proj_t", 0x0000, 0x2000, CRC(be71f1c0) SHA1(6b4d5c8f8491c82bdec1938bd83c14e826ff3e30) ) + ROM_LOAD("44801a34_scisys-w_ltd_proj_t", 0x0000, 0x2000, CRC(be71f1c0) SHA1(6b4d5c8f8491c82bdec1938bd83c14e826ff3e30) ) ROM_REGION( 48645, "screen", 0 ) ROM_LOAD("smchess.svg", 0, 48645, CRC(19beaa99) SHA1(2d738bd6953dfd7a2c8c37814badd0aac2960c8c) ) @@ -225,4 +229,4 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1981, smchess, 0, 0, smchess, smchess, mini_state, empty_init, "SciSys", "Mini Chess", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) +SYST( 1981, smchess, 0, 0, smchess, smchess, mini_state, empty_init, "SciSys / Philidor Software", "Mini Chess", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/prschess.cpp b/src/mame/saitek/prschess.cpp index a3c8392101894..3628de1e3e287 100644 --- a/src/mame/saitek/prschess.cpp +++ b/src/mame/saitek/prschess.cpp @@ -24,6 +24,7 @@ Hardware notes: *******************************************************************************/ #include "emu.h" + #include "cpu/m6502/m6502.h" #include "machine/sensorboard.h" #include "sound/dac.h" diff --git a/src/mame/saitek/risc2500.cpp b/src/mame/saitek/risc2500.cpp index 1ecb84778a784..7fa177f40cdbe 100644 --- a/src/mame/saitek/risc2500.cpp +++ b/src/mame/saitek/risc2500.cpp @@ -47,7 +47,6 @@ Undocumented buttons: #include "machine/nvram.h" #include "machine/ram.h" #include "machine/sensorboard.h" -#include "machine/timer.h" #include "sound/dac.h" #include "video/sed1520.h" @@ -68,10 +67,10 @@ class risc2500_state : public driver_device risc2500_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_boot_view(*this, "boot_view"), m_rom(*this, "maincpu"), m_ram(*this, "ram"), m_nvram(*this, "nvram"), - m_disable_bootrom(*this, "disable_bootrom"), m_dac(*this, "dac"), m_lcdc(*this, "lcdc"), m_board(*this, "board"), @@ -89,14 +88,13 @@ class risc2500_state : public driver_device protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_post_load() override { install_bootrom(m_bootrom_enabled); } private: required_device m_maincpu; + memory_view m_boot_view; required_region_ptr m_rom; required_device m_ram; required_device m_nvram; - required_device m_disable_bootrom; required_device m_dac; required_device m_lcdc; required_device m_board; @@ -105,13 +103,13 @@ class risc2500_state : public driver_device output_finder<14> m_syms; output_finder<16> m_leds; + emu_timer *m_boot_timer; + bool m_power = false; u32 m_control = 0; u32 m_prev_pc = 0; u64 m_prev_cycle = 0; - bool m_bootrom_enabled = false; - void risc2500_mem(address_map &map); void lcd_palette(palette_device &palette) const; @@ -121,22 +119,28 @@ class risc2500_state : public driver_device u32 rom_r(offs_t offset); void power_off(); - u32 disable_boot_rom_r(); - void install_bootrom(bool enable); - TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); } + u32 disable_bootrom_r(); + TIMER_CALLBACK_MEMBER(disable_bootrom) { m_boot_view.select(1); } }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void risc2500_state::machine_start() { m_digits.resolve(); m_syms.resolve(); m_leds.resolve(); + m_boot_timer = timer_alloc(FUNC(risc2500_state::disable_bootrom), this); + m_boot_view[1].install_ram(0, m_ram->size() - 1, m_ram->pointer()); m_nvram->set_base(m_ram->pointer(), m_ram->size()); // register for savestates save_item(NAME(m_power)); - save_item(NAME(m_bootrom_enabled)); save_item(NAME(m_control)); save_item(NAME(m_prev_pc)); save_item(NAME(m_prev_cycle)); @@ -144,7 +148,8 @@ void risc2500_state::machine_start() void risc2500_state::machine_reset() { - install_bootrom(true); + m_boot_view.select(0); + m_boot_timer->adjust(attotime::never); m_power = true; m_control = 0; @@ -211,31 +216,6 @@ SED1520_UPDATE_CB(risc2500_state::screen_update_cb) I/O *******************************************************************************/ -// bootrom bankswitch - -void risc2500_state::install_bootrom(bool enable) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - program.unmap_readwrite(0, std::max(m_rom.bytes(), size_t(m_ram->size())) - 1); - - if (enable) - program.install_read_handler(0, m_rom.bytes() - 1, read32sm_delegate(*this, FUNC(risc2500_state::rom_r))); - else - program.install_ram(0, m_ram->size() - 1, m_ram->pointer()); - - m_bootrom_enabled = enable; -} - -u32 risc2500_state::disable_boot_rom_r() -{ - // disconnect bootrom from the bus after next opcode - if (m_bootrom_enabled && !m_disable_bootrom->enabled() && !machine().side_effects_disabled()) - m_disable_bootrom->adjust(m_maincpu->cycles_to_attotime(10)); - - return 0; -} - - // soft power on/off INPUT_CHANGED_MEMBER(risc2500_state::on_button) @@ -316,6 +296,15 @@ void risc2500_state::control_w(u32 data) m_control = data; } +u32 risc2500_state::disable_bootrom_r() +{ + // disconnect bootrom from the bus after next opcode + if (!machine().side_effects_disabled() && m_boot_timer->remaining().is_never()) + m_boot_timer->adjust(m_maincpu->cycles_to_attotime(10)); + + return 0; +} + u32 risc2500_state::rom_r(offs_t offset) { if (!machine().side_effects_disabled()) @@ -352,7 +341,10 @@ u32 risc2500_state::rom_r(offs_t offset) void risc2500_state::risc2500_mem(address_map &map) { - map(0x01800000, 0x01800003).r(FUNC(risc2500_state::disable_boot_rom_r)); + map(0x00000000, 0x001fffff).view(m_boot_view); + m_boot_view[0](0x00000000, 0x0003ffff).r(FUNC(risc2500_state::rom_r)); + + map(0x01800000, 0x01800003).r(FUNC(risc2500_state::disable_bootrom_r)); map(0x01000000, 0x01000003).rw(FUNC(risc2500_state::input_r), FUNC(risc2500_state::control_w)); map(0x02000000, 0x0203ffff).r(FUNC(risc2500_state::rom_r)); } @@ -426,8 +418,6 @@ void risc2500_state::risc2500(machine_config &config) const attotime irq_period = attotime::from_hz(32.768_kHz_XTAL / 128); // 256Hz m_maincpu->set_periodic_int(FUNC(risc2500_state::irq1_line_assert), irq_period); - TIMER(config, "disable_bootrom").configure_generic(FUNC(risc2500_state::disable_bootrom)); - RAM(config, m_ram).set_extra_options("128K, 256K, 512K, 1M, 2M"); m_ram->set_default_size("128K"); m_ram->set_default_value(0); diff --git a/src/mame/saitek/ssystem3.cpp b/src/mame/saitek/ssystem3.cpp index 6885e4d8da335..b1001a59c0c20 100644 --- a/src/mame/saitek/ssystem3.cpp +++ b/src/mame/saitek/ssystem3.cpp @@ -3,14 +3,15 @@ // thanks-to:Berger /******************************************************************************* -SciSys / Novag Chess Champion: Super System III (aka MK III), distributed by -both SciSys and Novag. Which company was responsible for which part of the -manufacturing chain is unknown. The software is by SciSys (no mention of Novag -in the ROM, it has "COPYRIGHT SCISYS LTD 1979"). +SciSys / Novag Chess Champion: Super System III (aka MK III) + +It was distributed by both SciSys and Novag. Which company was responsible for +which part of the production chain is unknown. The copyright was assigned to SciSys +(no mention of Novag in the ROM, it has "COPYRIGHT SCISYS LTD 1979"). This is their 1st original product. MK II was licensed from Peter Jennings, and -MK I was, to put it bluntly, a bootleg. The chess engine is by Mike Johnson, -with support from David Levy. +MK I was, to put it bluntly, a bootleg. The chess engine is by Mike Johnson, with +support from David Levy, Philidor Software. Hardware notes: @@ -572,5 +573,6 @@ ROM_END *******************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, init_ssystem3, "SciSys / Novag Industries", "Chess Champion: Super System III", MACHINE_SUPPORTS_SAVE ) -SYST( 1980, ssystem4, 0, 0, ssystem4, ssystem4, ssystem3_state, empty_init, "SciSys", "Chess Champion: Super System IV", MACHINE_SUPPORTS_SAVE ) +SYST( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, init_ssystem3, "SciSys / Novag Industries / Philidor Software", "Chess Champion: Super System III", MACHINE_SUPPORTS_SAVE ) + +SYST( 1980, ssystem4, 0, 0, ssystem4, ssystem4, ssystem3_state, empty_init, "SciSys / Philidor Software", "Chess Champion: Super System IV", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/saitek/stratos.cpp b/src/mame/saitek/stratos.cpp index 6dd97d210fbda..fad1c3800def2 100644 --- a/src/mame/saitek/stratos.cpp +++ b/src/mame/saitek/stratos.cpp @@ -69,11 +69,11 @@ is engine version C. #include "saitek_tking.lh" -class stratos_state : public saitek_stratos_state +class stratos_state : public stratos_base_state { public: stratos_state(const machine_config &mconfig, device_type type, const char *tag) : - saitek_stratos_state(mconfig, type, tag), + stratos_base_state(mconfig, type, tag), m_banked_nvram(*this, "nvram.u7", 0x2000, ENDIANNESS_LITTLE), m_nvrambank(*this, "nvrambank"), m_rombank(*this, "rombank"), @@ -123,9 +123,9 @@ class stratos_state : public saitek_stratos_state }; -// saitek_stratos_state +// stratos_base_state -void saitek_stratos_state::machine_start() +void stratos_base_state::machine_start() { // resolve handlers m_out_digit.resolve(); @@ -139,7 +139,7 @@ void saitek_stratos_state::machine_start() save_item(NAME(m_lcd_data)); } -void saitek_stratos_state::machine_reset() +void stratos_base_state::machine_reset() { m_power = true; m_lcd_ready = false; @@ -147,7 +147,7 @@ void saitek_stratos_state::machine_reset() clear_lcd(); } -INPUT_CHANGED_MEMBER(saitek_stratos_state::change_cpu_freq) +INPUT_CHANGED_MEMBER(stratos_base_state::change_cpu_freq) { // known officially* released CPU speeds: 5MHz, 5.626MHz, 5.67MHz // *not including reseller overclocks, user mods, or the "Turbo Kit" @@ -160,7 +160,7 @@ INPUT_CHANGED_MEMBER(saitek_stratos_state::change_cpu_freq) void stratos_state::machine_start() { - saitek_stratos_state::machine_start(); + stratos_base_state::machine_start(); // init banks m_rombank->configure_entries(0, 2, memregion("maincpu")->base(), 0x8000); @@ -174,7 +174,7 @@ void stratos_state::machine_start() void stratos_state::machine_reset() { - saitek_stratos_state::machine_reset(); + stratos_base_state::machine_reset(); m_control = 0; m_rombank->set_entry(0); @@ -189,7 +189,7 @@ void stratos_state::machine_reset() // soft power on/off -INPUT_CHANGED_MEMBER(saitek_stratos_state::go_button) +INPUT_CHANGED_MEMBER(stratos_base_state::go_button) { if (newval && !m_power) { @@ -198,7 +198,7 @@ INPUT_CHANGED_MEMBER(saitek_stratos_state::go_button) } } -void saitek_stratos_state::power_off() +void stratos_base_state::power_off() { m_power = false; m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); @@ -212,7 +212,7 @@ void saitek_stratos_state::power_off() // LCD HLE -void saitek_stratos_state::update_lcd() +void stratos_base_state::update_lcd() { // output individual segments for (int i = 0; i < 0x40; i++) @@ -230,7 +230,7 @@ void saitek_stratos_state::update_lcd() m_out_digit[i + 5] = (m_lcd_data[0x11 + i * 2] << 4 | m_lcd_data[0x11 + i * 2 + 1]) & 0x7f; } -void saitek_stratos_state::lcd_data_w(u8 data) +void stratos_base_state::lcd_data_w(u8 data) { // d0-d3: lcd data // d4-d7: unused? @@ -418,10 +418,10 @@ INPUT_PORTS_START( saitek_stratos ) PORT_CONFSETTING( 0x01, DEF_STR( Normal ) ) PORT_START("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, go_button, 0) PORT_NAME("Go") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, go_button, 0) PORT_NAME("Go") PORT_START("CPU") - PORT_CONFNAME( 0x03, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, change_cpu_freq, 0) // factory set + PORT_CONFNAME( 0x03, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, change_cpu_freq, 0) // factory set PORT_CONFSETTING( 0x00, "5MHz" ) PORT_CONFSETTING( 0x01, "5.626MHz" ) PORT_CONFSETTING( 0x02, "5.67MHz" ) @@ -468,7 +468,7 @@ static INPUT_PORTS_START( tking ) // same buttons, but different locations PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Normal") PORT_MODIFY("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, go_button, 0) PORT_NAME("Go") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, go_button, 0) PORT_NAME("Go") INPUT_PORTS_END static INPUT_PORTS_START( tking2 ) diff --git a/src/mame/saitek/stratos.h b/src/mame/saitek/stratos.h index 25ab5c7732d50..ac760875cced6 100644 --- a/src/mame/saitek/stratos.h +++ b/src/mame/saitek/stratos.h @@ -17,10 +17,10 @@ #include -class saitek_stratos_state : public driver_device +class stratos_base_state : public driver_device { public: - saitek_stratos_state(const machine_config &mconfig, device_type type, const char *tag) : + stratos_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_display(*this, "display"), diff --git a/src/mame/saitek/tschess.cpp b/src/mame/saitek/tschess.cpp new file mode 100644 index 0000000000000..f8bbec484af7a --- /dev/null +++ b/src/mame/saitek/tschess.cpp @@ -0,0 +1,199 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/******************************************************************************* + +SciSys Travel Sensor Chess (aka Travel Sensor) + +The chess engine was written by Mark Taylor, employee of Intelligent Software +(formerly known as Philidor Software). The I/O is very similar to CXG Sensor +Computachess (see cxg/computachess.cpp). + +Hardware notes: +- PCB label: SCISYS TC-A, 201148 +- Hitachi 44801A85 MCU @ ~400kHz (R=91K) or ~350Hz (R=150K) +- piezo, 21 leds, button sensors chessboard + +44801A85 MCU is used in: +- SciSys Travel Sensor Chess +- SciSys Travel Mate Chess +- SciSys Chess Partner 5000 +- SciSys Chess Partner 6000 + +TODO: +- add memory switch (it goes to the HLT pin) + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/hmcs40/hmcs40.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "video/pwm.h" + +#include "speaker.h" + +// internal artwork +#include "saitek_tschess.lh" + + +namespace { + +class tschess_state : public driver_device +{ +public: + tschess_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_display(*this, "display"), + m_dac(*this, "dac"), + m_inputs(*this, "IN.%u", 0) + { } + + void tschess(machine_config &config); + + // New Game button is directly tied to MCU reset + DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } + +protected: + virtual void machine_start() 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; + + u8 m_inp_mux = 0; + + template void mux_w(u8 data); + void control_w(u16 data); + u16 input_r(); +}; + +void tschess_state::machine_start() +{ + save_item(NAME(m_inp_mux)); +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +template +void tschess_state::mux_w(u8 data) +{ + // R2x,R3x: input mux, led data + m_inp_mux = (m_inp_mux & ~(0xf << (N*4))) | ((data ^ 0xf) << (N*4)); + m_display->write_mx(m_inp_mux); +} + +void tschess_state::control_w(u16 data) +{ + // D1-D3: led select + m_display->write_my(~data >> 1 & 7); + + // D4: speaker out + m_dac->write(BIT(data, 4)); +} + +u16 tschess_state::input_r() +{ + u16 data = 0; + + // D6,D7: read buttons + for (int i = 0; i < 2; i++) + if (m_inp_mux & m_inputs[i]->read()) + data |= 0x40 << i; + + // D8-D15: read chessboard + for (int i = 0; i < 8; i++) + if (BIT(m_inp_mux, i)) + data |= m_board->read_file(i ^ 7) << 8; + + return ~data; +} + + + +/******************************************************************************* + Input Ports +*******************************************************************************/ + +static INPUT_PORTS_START( tschess ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("White/Black") + 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_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Rook") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") + + PORT_START("IN.1") + PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Compute") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set Up") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Sound") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") + + PORT_START("RESET") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, tschess_state, reset_button, 0) PORT_NAME("New Game") +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void tschess_state::tschess(machine_config &config) +{ + // basic machine hardware + HD44801(config, m_maincpu, 400'000); // approximation + m_maincpu->write_r<2>().set(FUNC(tschess_state::mux_w<0>)); + m_maincpu->write_r<3>().set(FUNC(tschess_state::mux_w<1>)); + m_maincpu->write_d().set(FUNC(tschess_state::control_w)); + m_maincpu->read_d().set(FUNC(tschess_state::input_r)); + + 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)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(3, 8); + config.set_default_layout(layout_saitek_tschess); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( tschess ) + ROM_REGION( 0x2000, "maincpu", 0 ) + ROM_LOAD("44801a85_scisys_tc-1982.u1", 0x0000, 0x2000, CRC(3ed0253a) SHA1(a3352758285292cfb0ad66e095cc951113332ced) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Drivers +*******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1982, tschess, 0, 0, tschess, tschess, tschess_state, empty_init, "SciSys / Intelligent Software", "Travel Sensor Chess", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/sanritsu/mjkjidai.cpp b/src/mame/sanritsu/mjkjidai.cpp index 04f8ca818daaa..0bd5bf551acb7 100644 --- a/src/mame/sanritsu/mjkjidai.cpp +++ b/src/mame/sanritsu/mjkjidai.cpp @@ -67,7 +67,7 @@ class mjkjidai_state : public driver_device void mjkjidai(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(keyboard_r); + ioport_value keyboard_r(); protected: virtual void machine_start() override; @@ -254,7 +254,7 @@ void mjkjidai_state::adpcm_int(int state) } } -CUSTOM_INPUT_MEMBER(mjkjidai_state::keyboard_r) +ioport_value mjkjidai_state::keyboard_r() { int res = 0x3f; diff --git a/src/mame/saturn/st17xx.cpp b/src/mame/saturn/st17xx.cpp index b49420e0ea320..b461d00b8e68d 100644 --- a/src/mame/saturn/st17xx.cpp +++ b/src/mame/saturn/st17xx.cpp @@ -37,7 +37,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/sega/315_5338a.cpp b/src/mame/sega/315_5338a.cpp index f07220ced39b8..13c2459e900d7 100644 --- a/src/mame/sega/315_5338a.cpp +++ b/src/mame/sega/315_5338a.cpp @@ -47,7 +47,7 @@ sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, cons void sega_315_5338a_device::device_start() { // register for save states - save_pointer(NAME(m_port_value), 7); + save_item(NAME(m_port_value)); save_item(NAME(m_port_config)); save_item(NAME(m_serial_output)); save_item(NAME(m_address)); diff --git a/src/mame/sega/315_5649.cpp b/src/mame/sega/315_5649.cpp index e9a1167e7897d..79c66e5393e99 100644 --- a/src/mame/sega/315_5649.cpp +++ b/src/mame/sega/315_5649.cpp @@ -52,7 +52,7 @@ sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const void sega_315_5649_device::device_start() { // register for save states - save_pointer(NAME(m_port_value), 7); + save_item(NAME(m_port_value)); save_item(NAME(m_port_config)); save_item(NAME(m_analog_channel)); save_item(NAME(m_mode)); diff --git a/src/mame/sega/dc.cpp b/src/mame/sega/dc.cpp index 7b4675f9d50f9..ba285936c232a 100644 --- a/src/mame/sega/dc.cpp +++ b/src/mame/sega/dc.cpp @@ -14,7 +14,6 @@ #include "mie.h" #include "cpu/sh/sh4.h" -#include "cpu/arm7/arm7core.h" //#include "debugger.h" @@ -624,7 +623,7 @@ void dc_state::soundram_w(offs_t offset, uint16_t data, uint16_t mem_mask) void dc_state::aica_irq(int state) { - m_soundcpu->set_input_line(ARM7_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); + m_soundcpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } void dc_state::sh4_aica_irq(int state) diff --git a/src/mame/sega/dc.h b/src/mame/sega/dc.h index 43532309195b5..6e84f024afbcd 100644 --- a/src/mame/sega/dc.h +++ b/src/mame/sega/dc.h @@ -12,7 +12,6 @@ #include "powervr2.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "cpu/sh/sh4.h" #include "machine/timer.h" #include "sound/aica.h" diff --git a/src/mame/sega/dccons.cpp b/src/mame/sega/dccons.cpp index 9d6a53e1f5525..0d5264e85aa5c 100644 --- a/src/mame/sega/dccons.cpp +++ b/src/mame/sega/dccons.cpp @@ -59,7 +59,6 @@ #include "bus/ata/gdrom.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "cpu/sh/sh4.h" #include "imagedev/cdromimg.h" #include "machine/aicartc.h" diff --git a/src/mame/sega/megadriv_rad.cpp b/src/mame/sega/megadriv_rad.cpp index 3a46189daff5d..a5d4f1f5d751e 100644 --- a/src/mame/sega/megadriv_rad.cpp +++ b/src/mame/sega/megadriv_rad.cpp @@ -539,6 +539,11 @@ ROM_START( rad_md1uk ) ROM_LOAD16_WORD_SWAP( "radicauk.u2", 0x000000, 0x400000, CRC(03a6734b) SHA1(255048d46b593bc975b3a6c44e8b8e35917511c7) ) ROM_END +ROM_START( mdtvp1j ) + ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "l08y6_i_32m.u2", 0x000000, 0x400000, CRC(740a8859) SHA1(cf1212ef28e75e2cea752cf10a06ea715a30ae07) ) // 04-07-23 date sticker (23 July 2004) +ROM_END + ROM_START( rad_gen2 ) ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "radica_genesis_vol2_red_usa.bin", 0x000000, 0x400000, CRC(7c1a0f0e) SHA1(a6441f75a4cd48f1563aeafdfbdde00202d4067c) ) @@ -709,6 +714,7 @@ void megadriv_ra145_state::init_ra145() CONS( 2004, rad_gen1, 0, 0, megadriv_radica_3button_ntsc, radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 1 (Radica, Arcade Legends) (USA)", 0) CONS( 2004, rad_md1, rad_gen1, 0, megadriv_radica_3button_pal, radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Mega Drive Collection Volume 1 (Radica, Arcade Legends) (Europe)", 0) CONS( 2004, rad_md1uk, rad_gen1, 0, megadriv_radica_3button_pal, radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Mega Drive Collection Volume 1 (Radica, Arcade Legends) (UK)", 0) +CONS( 2004, mdtvp1j, rad_gen1, 0, megadriv_radica_3button_ntsc, radica_3button_1player, megadriv_radica_state, init_megadriv, "Sega Toys", "Mega Drive Play TV 1 (Japan)", 0) // expects US region despite being a Japanese unit (Bean Machine is region locked) CONS( 2004, rad_gen2, 0, 0, megadriv_radica_3button_ntsc, radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 2 (Radica, Arcade Legends) (USA)", 0) CONS( 2004, rad_md2uk, rad_gen2, 0, megadriv_radica_3button_pal, radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Mega Drive Collection Volume 2 (Radica, Arcade Legends) (UK)", 0) diff --git a/src/mame/sega/model2.cpp b/src/mame/sega/model2.cpp index 13594b5a5dfc2..d538ec8a5995c 100644 --- a/src/mame/sega/model2.cpp +++ b/src/mame/sega/model2.cpp @@ -1623,7 +1623,7 @@ u8 model2_state::in0_r() */ // Used by Sega Rally and Daytona USA, others might be different -CUSTOM_INPUT_MEMBER(model2_state::daytona_gearbox_r) +ioport_value model2_state::daytona_gearbox_r() { u8 res = m_gears.read_safe(0); int i; diff --git a/src/mame/sega/model2.h b/src/mame/sega/model2.h index 12f41dc4a1b3f..36ea35deb9a60 100644 --- a/src/mame/sega/model2.h +++ b/src/mame/sega/model2.h @@ -83,7 +83,7 @@ class model2_state : public driver_device std::unique_ptr m_poly; /* Public for access by the ioports */ - DECLARE_CUSTOM_INPUT_MEMBER(daytona_gearbox_r); + ioport_value daytona_gearbox_r(); /* Public for access by MCFG */ TIMER_DEVICE_CALLBACK_MEMBER(model2_interrupt); diff --git a/src/mame/sega/naomi.cpp b/src/mame/sega/naomi.cpp index 3e4345bb1c1d3..c8d2cdc21896f 100644 --- a/src/mame/sega/naomi.cpp +++ b/src/mame/sega/naomi.cpp @@ -78,7 +78,9 @@ EPF8452AQC160-3 - Altera FLEX EPF8452AQC160-3 FPGA (QFP160) ADM485 - Analog Devices ADM485 +5 V Low Power EIA RS-485 Transceiver (SOIC8) PCM1725 - Burr-Brown PCM1725 Stereo Audio Digital to Analog Converter 16 Bits, 96kHz Sampling (SOIC14) JP1 - AICA sound block Master Clock source: 2-3 - onboard OSC1 33.8688MHz (default), 1-2 - cart/DIMM connector CN2 pin A48 (alt setting, not used at practice, there is no known devices which provide external AICA clock). - JP4 - set to 2-3. Alt setting is 1-2 + JP2 - (not mounted) Fan check: 1-2 - hold reset if fan not working (default), 2-3 - disabled. + JP3 - (not mounted) 315-6146 to Maple port 0 comms: 2-3 - enabled (default), 1-2 - disabled. + JP4 - Ext.NMI from CN1 A3 goes to: 2-3 - SH-4 NMI (default), 1-2 - SH-4 TCLK. CN1/2/3 - Connectors for ROM cart or GDROM DIMM Unit CN25/26 - Connectors for Filter Board @@ -677,6 +679,8 @@ Melty Blood Actress Again Version A (Rev A) 841-0061C 24455 6 \Mushiking II / III / III+ (Ver. 1.000-) (Korea) 840-0168C not present 2 (512Mb) present 317-0437-COM present requires 610-0669 barcode reader, 838-14245-92 "MAPLE/232C CONVERT BD" (MIE-based), 838-14243 "RFID CHIP R/W BD" and RFID chip /Mushiking The King Of Beetles \Mushiking IV / V / VI (World) 840-0180C not present 2 (512Mb) present 317-0437-COM present IC2# is labeled "VER.1", IC4# is marked "8A", requires 610-0669 barcode reader, 838-14245-92 "MAPLE/232C CONVERT BD" (MIE-based), 838-14243 "RFID CHIP R/W BD" and RFID chip +/Mushiking The King Of Beetles +\Mushiking IV / V / VI (Taiwan) 840-0181C not present 2 (512Mb) present 317-0437-COM present IC2# is labeled "VER.1", IC4# is marked "8A", requires 610-0669 barcode reader, 838-14245-92 "MAPLE/232C CONVERT BD" (MIE-based), 838-14243 "RFID CHIP R/W BD" and RFID chip Mushiking The King Of Beetles 2006 First (Japan) 840-0167C not present 2 (512Mb) present 317-0444-JPN present IC4# is marked "18", require 610-0669 barcode reader Mushiking The King Of Beetles 2006 Second (Japan) 840-0171C not present 2 (512Mb) present 317-0444-JPN present IC4# is marked "18", require 610-0669 barcode reader Pokasuka Ghost! 840-0170C not present 5 (512Mb) present 317-0461-COM present requires 837-14672 sensor board (SH4 based) @@ -1973,7 +1977,7 @@ INPUT_CHANGED_MEMBER(naomi_state::naomi_mp_w) m_mp_mux = newval; } -CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r) +ioport_value naomi_state::naomi_mp_r() { uint8_t retval = 0; @@ -2043,7 +2047,7 @@ static INPUT_PORTS_START( naomi_mp ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(naomi_state::suchie3_mp_r) +ioport_value naomi_state::suchie3_mp_r() { uint8_t retval = 0; @@ -2071,7 +2075,7 @@ static INPUT_PORTS_START( suchie3 ) PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(naomi_state, suchie3_mp_r) INPUT_PORTS_END -template CUSTOM_INPUT_MEMBER(naomi_state::naomi_kb_r) +template ioport_value naomi_state::naomi_kb_r() { for (int i = 0; i < 5; i++) { @@ -6612,6 +6616,20 @@ ROM_START( mushik4e ) ROM_PARAMETER( ":rom_board:id", "5502" ) ROM_END +ROM_START( mushik4t ) + NAOMI_BIOS + NAOMI_DEFAULT_EEPROM + + ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASEFF) + ROM_LOAD( "fpr-24420.ic8", 0x0000000, 0x4000000, CRC(4a44a604) SHA1(deaba62d563ac835f673533ffe18f73937b9a26f) ) + ROM_LOAD( "fpr-24421.ic9", 0x4000000, 0x4000000, BAD_DUMP CRC(af137021) SHA1(2b380253263e92bc2dcf1a3262dfe7f32c3703dc) ) + + ROM_REGION( 0x800, "pic_readout", 0 ) + ROM_LOAD( "317-0437-com.ic3", 0, 0x800, CRC(3b6fcee8) SHA1(65fbdd3b8c61a4b5ccb6389b25483a7ecdc0794d) ) + + ROM_PARAMETER( ":rom_board:id", "5502" ) +ROM_END + ROM_START( zunou ) NAOMI_BIOS NAOMI_DEFAULT_EEPROM @@ -10436,7 +10454,7 @@ ROM_END /********************************************** * -* Naomi 2 network CD and DVD-ROM defines +* Naomi network CD and DVD-ROM defines * *********************************************/ @@ -11002,6 +11020,7 @@ void naomi_state::init_hotd2() /* 0175 */ GAME( 2007, asndynmto, asndynmt, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Asian Dynamite / Dynamite Deka EX (older)", GAME_FLAGS ) // no revision stickers, presumably older revision but might be release for Asian market /* 0177 */ GAME( 2007, rhytngk, naomi, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega / Nintendo - J.P ROOM", "Rhythm Tengoku (Japan)", GAME_FLAGS ) /* 0180 */ GAME( 2007, mushik4e, naomi, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Mushiking The King Of Beetles - Mushiking IV / V / VI (World)", GAME_FLAGS ) // not for Japan or Korea, version can be changed in secret menu, ~equivalent of Japanese 2K6 versions. +/* 0181 */ GAME( 2007, mushik4t, mushik4e, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Mushiking The King Of Beetles - Mushiking IV / V / VI (Taiwan)", GAME_FLAGS ) // not for Japan or Korea, version can be changed in secret menu, ~equivalent of Japanese 2K6 versions. /* 0183 */ GAME( 2009, shorseprvl,shorsepr, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Star Horse Progress Returns (main screen left)", GAME_FLAGS ) /* 0184 */ GAME( 2009, shorseprvr,shorsepr, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Star Horse Progress Returns (main screen right)", GAME_FLAGS ) /* 0185 */ GAME( 2009, shorseprl, shorsepr, naomim4, naomi, naomi_state, init_naomi, ROT0, "Sega", "Star Horse Progress Returns (live and voice)", GAME_FLAGS ) diff --git a/src/mame/sega/naomi.h b/src/mame/sega/naomi.h index e1aa4381f2ed2..4020c8564a8e4 100644 --- a/src/mame/sega/naomi.h +++ b/src/mame/sega/naomi.h @@ -58,9 +58,9 @@ class naomi_state : public dc_state void init_naomigd(); void init_naomigd_mp(); - DECLARE_CUSTOM_INPUT_MEMBER(naomi_mp_r); - DECLARE_CUSTOM_INPUT_MEMBER(suchie3_mp_r); - template DECLARE_CUSTOM_INPUT_MEMBER(naomi_kb_r); + ioport_value naomi_mp_r(); + ioport_value suchie3_mp_r(); + template ioport_value naomi_kb_r(); DECLARE_INPUT_CHANGED_MEMBER(naomi_mp_w); uint64_t naomi2_biose_idle_skip_r(); diff --git a/src/mame/sega/sega_beena.cpp b/src/mame/sega/sega_beena.cpp index 2d12dd8135af9..184cc6c899728 100644 --- a/src/mame/sega/sega_beena.cpp +++ b/src/mame/sega/sega_beena.cpp @@ -1679,15 +1679,15 @@ int32_t sega_9h0_0008_state::rescale_alpha_step(uint8_t step) void sega_9h0_0008_state::request_irq() { - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } void sega_9h0_0008_state::request_fiq() { if (m_requested_fiq) { - m_maincpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); - m_maincpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, CLEAR_LINE); m_requested_fiq = false; } diff --git a/src/mame/sega/segajw.cpp b/src/mame/sega/segajw.cpp index 8f8036f20c873..6c0e488cc4538 100644 --- a/src/mame/sega/segajw.cpp +++ b/src/mame/sega/segajw.cpp @@ -58,7 +58,7 @@ class segajw_state : public driver_device void segajw(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(coin_drop_start); - DECLARE_CUSTOM_INPUT_MEMBER(coin_sensors_r); + ioport_value coin_sensors_r(); int hopper_sensors_r(); protected: @@ -153,7 +153,7 @@ int segajw_state::hopper_sensors_r() return data; } -CUSTOM_INPUT_MEMBER( segajw_state::coin_sensors_r ) +ioport_value segajw_state::coin_sensors_r() { uint8_t data = 0; diff --git a/src/mame/sega/segaorun.cpp b/src/mame/sega/segaorun.cpp index fa92ce857781d..7042efe518f06 100644 --- a/src/mame/sega/segaorun.cpp +++ b/src/mame/sega/segaorun.cpp @@ -912,7 +912,7 @@ void segaorun_state::sound_portmap(address_map &map) // GENERIC PORT DEFINITIONS //************************************************************************** -CUSTOM_INPUT_MEMBER(segaorun_state::bankmotor_pos_r) +ioport_value segaorun_state::bankmotor_pos_r() { return m_bankmotor_pos >> 8 & 0xff; } diff --git a/src/mame/sega/segaorun.h b/src/mame/sega/segaorun.h index 7f27e19171a38..7375fa4f40475 100644 --- a/src/mame/sega/segaorun.h +++ b/src/mame/sega/segaorun.h @@ -76,7 +76,7 @@ class segaorun_state : public sega_16bit_common_base void init_outrunb(); void init_shangon(); - CUSTOM_INPUT_MEMBER( bankmotor_pos_r ); + ioport_value bankmotor_pos_r(); protected: // PPI read/write handlers diff --git a/src/mame/sega/segas16a.cpp b/src/mame/sega/segas16a.cpp index 5ec0b6c05af61..fff253a5d9dce 100644 --- a/src/mame/sega/segas16a.cpp +++ b/src/mame/sega/segas16a.cpp @@ -1187,7 +1187,7 @@ static INPUT_PORTS_START( afighter ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(afighter_16a_analog_state::afighter_accel_r) +ioport_value afighter_16a_analog_state::afighter_accel_r() { int accel = m_accel->read(); @@ -1202,7 +1202,7 @@ CUSTOM_INPUT_MEMBER(afighter_16a_analog_state::afighter_accel_r) return 0; } -CUSTOM_INPUT_MEMBER(afighter_16a_analog_state::afighter_handl_left_r) +ioport_value afighter_16a_analog_state::afighter_handl_left_r() { int steer = m_steer->read(); @@ -1220,7 +1220,7 @@ CUSTOM_INPUT_MEMBER(afighter_16a_analog_state::afighter_handl_left_r) return 0x00; } -CUSTOM_INPUT_MEMBER(afighter_16a_analog_state::afighter_handl_right_r) +ioport_value afighter_16a_analog_state::afighter_handl_right_r() { int steer = m_steer->read(); @@ -3745,39 +3745,39 @@ ROM_END // ROM_START( wb31 ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code - ROM_LOAD16_BYTE( "epr-12084.bin", 0x000000, 0x10000, CRC(b6deb654) SHA1(37066cc63902233bb8b56d3171c42bf8a8f82e58) ) - ROM_LOAD16_BYTE( "epr-12082.bin", 0x000001, 0x10000, CRC(38dc5b15) SHA1(b25bf60d269a87f9d8dbc1a3787c8ff9a6e7482c) ) - ROM_LOAD16_BYTE( "epr-12085.bin", 0x020000, 0x10000, CRC(0962098b) SHA1(150fc439dd5e773bef706f058abdb4d2ec44e355) ) - ROM_LOAD16_BYTE( "epr-12083.bin", 0x020001, 0x10000, CRC(3d631a8e) SHA1(4940ff6cf380fb914876ade39ea37f42b79bf11d) ) + ROM_LOAD16_BYTE( "epr-12084.43", 0x000000, 0x10000, CRC(b6deb654) SHA1(37066cc63902233bb8b56d3171c42bf8a8f82e58) ) + ROM_LOAD16_BYTE( "epr-12082.26", 0x000001, 0x10000, CRC(38dc5b15) SHA1(b25bf60d269a87f9d8dbc1a3787c8ff9a6e7482c) ) + ROM_LOAD16_BYTE( "epr-12085.42", 0x020000, 0x10000, CRC(0962098b) SHA1(150fc439dd5e773bef706f058abdb4d2ec44e355) ) + ROM_LOAD16_BYTE( "epr-12083.25", 0x020001, 0x10000, CRC(3d631a8e) SHA1(4940ff6cf380fb914876ade39ea37f42b79bf11d) ) ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key ROM_LOAD( "317-0084.key", 0x0000, 0x2000, CRC(2c58dafa) SHA1(24d06970eda896fdd5e3486132bd19834f7d3659) ) ROM_REGION( 0x30000, "gfx1", 0 ) // tiles - ROM_LOAD( "epr-12086.bin", 0x00000, 0x10000, CRC(45b949df) SHA1(84390d16da00b775988e5f6c20950cb2304b1a74) ) - ROM_LOAD( "epr-12087.bin", 0x10000, 0x10000, CRC(6f0396b7) SHA1(0a340f2b58e5ecfe504197a8fd2111181e868a3e) ) - ROM_LOAD( "epr-12088.bin", 0x20000, 0x10000, CRC(ba8c0749) SHA1(7d996c7a1ad249c06ef7ec9c87a83710c98005d3) ) + ROM_LOAD( "epr-12086.95", 0x00000, 0x10000, CRC(45b949df) SHA1(84390d16da00b775988e5f6c20950cb2304b1a74) ) + ROM_LOAD( "epr-12087.94", 0x10000, 0x10000, CRC(6f0396b7) SHA1(0a340f2b58e5ecfe504197a8fd2111181e868a3e) ) + ROM_LOAD( "epr-12088.83", 0x20000, 0x10000, CRC(ba8c0749) SHA1(7d996c7a1ad249c06ef7ec9c87a83710c98005d3) ) ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites - ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x008000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) ) + ROM_LOAD16_BYTE( "epr-12090.10", 0x00001, 0x008000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) ) ROM_CONTINUE( 0x40001, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) ) + ROM_LOAD16_BYTE( "epr-12094.11", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) ) ROM_CONTINUE( 0x40000, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12091.b2", 0x10001, 0x008000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) ) + ROM_LOAD16_BYTE( "epr-12091.17", 0x10001, 0x008000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) ) ROM_CONTINUE( 0x50001, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12095.b6", 0x10000, 0x008000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) ) + ROM_LOAD16_BYTE( "epr-12095.18", 0x10000, 0x008000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) ) ROM_CONTINUE( 0x50000, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12092.b3", 0x20001, 0x008000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) ) + ROM_LOAD16_BYTE( "epr-12092.23", 0x20001, 0x008000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) ) ROM_CONTINUE( 0x60001, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12096.b7", 0x20000, 0x008000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) ) + ROM_LOAD16_BYTE( "epr-12096.24", 0x20000, 0x008000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) ) ROM_CONTINUE( 0x60000, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12093.b4", 0x30001, 0x008000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) ) + ROM_LOAD16_BYTE( "epr-12093.29", 0x30001, 0x008000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) ) ROM_CONTINUE( 0x70001, 0x008000 ) - ROM_LOAD16_BYTE( "epr-12097.b8", 0x30000, 0x008000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) ) + ROM_LOAD16_BYTE( "epr-12097.30", 0x30000, 0x008000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) ) ROM_CONTINUE( 0x70000, 0x008000 ) ROM_REGION( 0x10000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "epr-12089.bin", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) ) + ROM_LOAD( "epr-12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) ) ROM_END ROM_START( wb31d ) diff --git a/src/mame/sega/segas16a.h b/src/mame/sega/segas16a.h index 02c73ac651fbf..2fcd4580f57dd 100644 --- a/src/mame/sega/segas16a.h +++ b/src/mame/sega/segas16a.h @@ -198,9 +198,9 @@ class afighter_16a_analog_state : public segas16a_state , m_steer(*this, "STEER") { } - DECLARE_CUSTOM_INPUT_MEMBER(afighter_accel_r); - DECLARE_CUSTOM_INPUT_MEMBER(afighter_handl_left_r); - DECLARE_CUSTOM_INPUT_MEMBER(afighter_handl_right_r); + ioport_value afighter_accel_r(); + ioport_value afighter_handl_left_r(); + ioport_value afighter_handl_right_r(); private: required_ioport m_accel; diff --git a/src/mame/sega/segas16b.cpp b/src/mame/sega/segas16b.cpp index 42166fd3e45f7..e3c087e15a2bb 100644 --- a/src/mame/sega/segas16b.cpp +++ b/src/mame/sega/segas16b.cpp @@ -2172,7 +2172,7 @@ static INPUT_PORTS_START( afighter ) INPUT_PORTS_END /* this is identical to the s16a implementation, maybe should be moved to common class */ -CUSTOM_INPUT_MEMBER(afighter_16b_analog_state::afighter_accel_r) +ioport_value afighter_16b_analog_state::afighter_accel_r() { int accel = m_accel->read(); @@ -2187,7 +2187,7 @@ CUSTOM_INPUT_MEMBER(afighter_16b_analog_state::afighter_accel_r) return 0; } -CUSTOM_INPUT_MEMBER(afighter_16b_analog_state::afighter_handl_left_r) +ioport_value afighter_16b_analog_state::afighter_handl_left_r() { int steer = m_steer->read(); @@ -2205,7 +2205,7 @@ CUSTOM_INPUT_MEMBER(afighter_16b_analog_state::afighter_handl_left_r) return 0x00; } -CUSTOM_INPUT_MEMBER(afighter_16b_analog_state::afighter_handl_right_r) +ioport_value afighter_16b_analog_state::afighter_handl_right_r() { int steer = m_steer->read(); diff --git a/src/mame/sega/segas16b.h b/src/mame/sega/segas16b.h index 2ad3870ae92f2..998796ea8d595 100644 --- a/src/mame/sega/segas16b.h +++ b/src/mame/sega/segas16b.h @@ -324,9 +324,9 @@ class afighter_16b_analog_state : public segas16b_state , m_steer(*this, "STEER") { } - DECLARE_CUSTOM_INPUT_MEMBER(afighter_accel_r); - DECLARE_CUSTOM_INPUT_MEMBER(afighter_handl_left_r); - DECLARE_CUSTOM_INPUT_MEMBER(afighter_handl_right_r); + ioport_value afighter_accel_r(); + ioport_value afighter_handl_left_r(); + ioport_value afighter_handl_right_r(); private: required_ioport m_accel; diff --git a/src/mame/sega/segas32.cpp b/src/mame/sega/segas32.cpp index 3b4837a9a1f3e..ece2dbd14bd77 100644 --- a/src/mame/sega/segas32.cpp +++ b/src/mame/sega/segas32.cpp @@ -9,10 +9,9 @@ Still to do: * fix protection * fix jpark correctly - * priorities in multi32 appear wrong - stadium cross map screen - and title fight ingame backgrounds * should f1lap be set up as a twin cabinet / direct link or can it be operated as a single screen, unlike f1en/air rescue + * also see segas32_v.cpp for gfx issues **************************************************************************** @@ -61,13 +60,13 @@ PCB Layout | 93C46 D42264 | |CNB SW2 D42264 | | SW1 D42264 | -| CNA DSW1 32MHz 50MHz D42264 | +| CNA DSW1 32.2159MHz 50MHz D42264 | |-------------------------------------------------------------------------------------------| Notes: - V60 CPU running at 16.00MHz [32/2] - Z80 CPU running at 8.000MHz [32/4] - YM3438 running at 8.000MHz [32/4] + V60 CPU running at 16.108MHz [32.2159/2] + Z80 CPU running at 8.054MHz [32.2159/4] + YM3438 running at 8.054MHz [32.2159/4] CNE/F/I - Multi-pin connectors for connection of ROM Board CND - 4 pin connector for 2nd Speaker for Stereo Output CNA - 30 pin connector for extra controls PCB @@ -211,7 +210,7 @@ PCB Layout V70 CPU running at 20.00MHz [40/2] Z80 CPU running at 8.000MHz [32/4] YM3438 running at 8.000MHz [32/4] - 315-5560 running at 8.000MHz [32/4] + 315-5560 running at 10.000MHz [40/4] CND/E/F/H: Multi-pin connectors for connection of ROM Board CNC : 4 pin connector for 2nd Speaker for Stereo Output CNJ : 32 pin connector (purpose unknown) @@ -485,7 +484,6 @@ JP1234 - Four 2-pin jumpers. JP3 is shorted, the others are not shorted ********************************************************************************************* - On "Super Visual Football: European Sega Cup" and "JLEAGUE" : JLEAGUE was the original code developed and released in early @@ -606,13 +604,6 @@ segas32_state::segas32_state(const machine_config &mconfig, device_type type, co * *************************************/ -#define MASTER_CLOCK 32215900 -#define RFC_CLOCK XTAL(50'000'000) -#define MULTI32_CLOCK XTAL(40'000'000) - -#define TIMER_0_CLOCK ((MASTER_CLOCK/2)/2048) /* confirmed */ -#define TIMER_1_CLOCK ((RFC_CLOCK/16)/256) /* confirmed */ - #define MAIN_IRQ_VBSTART 0 #define MAIN_IRQ_VBSTOP 1 #define MAIN_IRQ_SOUND 2 @@ -692,10 +683,8 @@ void segas32_state::update_irq_state() void segas32_state::signal_v60_irq(int which) { - int i; - /* see if this interrupt input is mapped to any vectors; if so, mark them */ - for (i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) if (m_v60_irq_control[i] == which) m_v60_irq_control[7] |= 1 << i; update_irq_state(); @@ -728,8 +717,6 @@ uint8_t segas32_state::int_control_r(offs_t offset) void segas32_state::int_control_w(offs_t offset, uint8_t data) { - int duration; - // logerror("%06X:int_control_w(%X) = %02X\n", m_maincpu->pc(), offset, data); switch (offset) { @@ -757,25 +744,30 @@ void segas32_state::int_control_w(offs_t offset, uint8_t data) case 8: case 9: /* timer 0 count */ + { m_v60_irq_control[offset] = data; - duration = m_v60_irq_control[8] + ((m_v60_irq_control[9] << 8) & 0xf00); + uint16_t duration = m_v60_irq_control[8] | ((m_v60_irq_control[9] << 8) & 0xf00); if (duration) { - attotime period = attotime::from_hz(TIMER_0_CLOCK) * duration; + const XTAL xtal = m_is_multi32 ? 32_MHz_XTAL : 32.2159_MHz_XTAL; + attotime period = attotime::from_ticks(0x800 * duration, xtal / 2); m_v60_irq_timer[0]->adjust(period, MAIN_IRQ_TIMER0); } break; + } case 10: case 11: /* timer 1 count */ + { m_v60_irq_control[offset] = data; - duration = m_v60_irq_control[10] + ((m_v60_irq_control[11] << 8) & 0xf00); + uint16_t duration = m_v60_irq_control[10] | ((m_v60_irq_control[11] << 8) & 0xf00); if (duration) { - attotime period = attotime::from_hz(TIMER_1_CLOCK) * duration; + attotime period = attotime::from_ticks(0x100 * duration, 50_MHz_XTAL / 16); m_v60_irq_timer[1]->adjust(period, MAIN_IRQ_TIMER1); } break; + } case 12: case 13: @@ -2232,7 +2224,6 @@ GFXDECODE_END - /************************************* * * Machine driver @@ -2241,6 +2232,8 @@ GFXDECODE_END void segas32_state::device_add_mconfig(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 32.2159_MHz_XTAL; + /* basic machine hardware */ V60(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->set_addrmap(AS_PROGRAM, &segas32_state::system32_map); @@ -2250,7 +2243,7 @@ void segas32_state::device_add_mconfig(machine_config &config) m_soundcpu->set_addrmap(AS_PROGRAM, &segas32_state::system32_sound_map); m_soundcpu->set_addrmap(AS_IO, &segas32_state::system32_sound_portmap); - sega_315_5296_device &io_chip(SEGA_315_5296(config, "io_chip", 0)); // unknown clock + sega_315_5296_device &io_chip(SEGA_315_5296(config, "io_chip", MASTER_CLOCK/4)); io_chip.in_pa_callback().set_ioport("P1_A"); io_chip.in_pb_callback().set_ioport("P2_A"); io_chip.in_pc_callback().set_ioport("PORTC_A"); @@ -2293,7 +2286,7 @@ void segas32_state::device_add_mconfig(machine_config &config) ym2.add_route(0, "lspeaker", 0.40); ym2.add_route(1, "rspeaker", 0.40); - rf5c68_device &rfsnd(RF5C68(config, "rfsnd", RFC_CLOCK/4)); // ASSP (RF)5C105 or Sega 315-5476A + rf5c68_device &rfsnd(RF5C68(config, "rfsnd", 50_MHz_XTAL/4)); // ASSP (RF)5C105 or Sega 315-5476A rfsnd.add_route(0, "lspeaker", 0.55); rfsnd.add_route(1, "rspeaker", 0.55); rfsnd.set_addrmap(0, &segas32_state::rf5c68_map); @@ -2310,8 +2303,6 @@ segas32_regular_state::segas32_regular_state(const machine_config &mconfig, cons - - void segas32_state::system32_analog_map(address_map &map) { map.unmap_value_high(); @@ -2346,8 +2337,6 @@ segas32_analog_state::segas32_analog_state(const machine_config &mconfig, device - - void segas32_trackball_state::system32_trackball_map(address_map &map) { map.unmap_value_high(); @@ -2388,8 +2377,6 @@ segas32_trackball_state::segas32_trackball_state(const machine_config &mconfig, - - void segas32_state::system32_4player_map(address_map &map) { map.unmap_value_high(); @@ -2423,8 +2410,6 @@ segas32_4player_state::segas32_4player_state(const machine_config &mconfig, devi - - void segas32_state::ga2_main_map(address_map &map) { map.unmap_value_high(); @@ -2454,21 +2439,20 @@ segas32_v25_state::segas32_v25_state(const machine_config &mconfig, const char * - - void segas32_upd7725_state::device_add_mconfig(machine_config &config) { segas32_analog_state::device_add_mconfig(config); - /* add a upd7725; this is on the 837-8341 daughterboard which plugs into the socket on the master pcb's ROM board where an fd1149 could go */ - upd7725_device &dsp(UPD7725(config, "dsp", 8000000)); // TODO: Find real clock speed for the upd7725; this is a canned oscillator on the 837-8341 pcb + // add a upd7725; this is on the 837-8341 daughterboard which plugs into the socket on the master pcb's ROM board where an fd1149 could go + upd7725_device &dsp(UPD7725(config, "dsp", 16_MHz_XTAL/2)); dsp.set_addrmap(AS_PROGRAM, &segas32_upd7725_state::upd7725_prg_map); dsp.set_addrmap(AS_DATA, &segas32_upd7725_state::upd7725_data_map); dsp.set_disable(); // TODO: disable for now, needs DMA pins and interrupts implemented in upd7725 core + // TODO: find /INT source for upd7725 // TODO: figure out how the p0 and p1 lines from the upd7725 affect the mainboard; do they select one of four (or 8) latches to/from the mainboard? // TODO: trace out the 837-8341 pcb - // See HLE of this dsp in /src/mame/machine/segas32.cpp : arescue_dsp_r and arescue_dsp_w + // See HLE of this dsp in segas32_m.cpp: arescue_dsp_r and arescue_dsp_w } DEFINE_DEVICE_TYPE(SEGA_S32_UPD7725_DEVICE, segas32_upd7725_state, "segas32_pcb_upd7725", "Sega System 32 uPD7725 PCB") @@ -2480,7 +2464,6 @@ segas32_upd7725_state::segas32_upd7725_state(const machine_config &mconfig, cons - void segas32_cd_state::lamps1_w(uint8_t data) { for (int i = 0; i < 8; i++) @@ -2564,6 +2547,9 @@ segas32_cd_state::segas32_cd_state(const machine_config &mconfig, const char *ta void sega_multi32_state::device_add_mconfig(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 32_MHz_XTAL; + constexpr XTAL MULTI32_CLOCK = 40_MHz_XTAL; + /* basic machine hardware */ V70(config, m_maincpu, MULTI32_CLOCK/2); m_maincpu->set_addrmap(AS_PROGRAM, &sega_multi32_state::multi32_map); @@ -2573,7 +2559,7 @@ void sega_multi32_state::device_add_mconfig(machine_config &config) m_soundcpu->set_addrmap(AS_PROGRAM, &sega_multi32_state::multi32_sound_map); m_soundcpu->set_addrmap(AS_IO, &sega_multi32_state::multi32_sound_portmap); - sega_315_5296_device &io_chip_0(SEGA_315_5296(config, "io_chip_0", 0)); // unknown clock + sega_315_5296_device &io_chip_0(SEGA_315_5296(config, "io_chip_0", MASTER_CLOCK/4)); io_chip_0.in_pa_callback().set_ioport("P1_A"); io_chip_0.in_pb_callback().set_ioport("P2_A"); io_chip_0.in_pc_callback().set_ioport("PORTC_A"); @@ -2585,7 +2571,7 @@ void sega_multi32_state::device_add_mconfig(machine_config &config) io_chip_0.out_cnt1_callback().set(FUNC(segas32_state::display_enable_w<0>)); io_chip_0.out_cnt2_callback().set_inputline(m_soundcpu, INPUT_LINE_RESET).invert(); - sega_315_5296_device &io_chip_1(SEGA_315_5296(config, "io_chip_1", 0)); // unknown clock + sega_315_5296_device &io_chip_1(SEGA_315_5296(config, "io_chip_1", MASTER_CLOCK/4)); io_chip_1.in_pa_callback().set_ioport("P1_B"); io_chip_1.in_pb_callback().set_ioport("P2_B"); io_chip_1.in_pc_callback().set_ioport("PORTC_B"); @@ -2852,13 +2838,13 @@ void segas32_new_state::sega_multi32_6p(machine_config &config) SEGA_MULTI32_6PLAYER_DEVICE(config, "mainpcb", 0); } + /************************************* * * ROM definition(s) * *************************************/ - #define ROM_LOAD_x2(name, base, length, crc) \ ROM_LOAD( name, base + 0 * length, length, crc ) \ ROM_RELOAD( base + 1 * length, length ) @@ -5847,8 +5833,8 @@ void segas32_state::init_jpark() segas32_common_init(); - pROM[0xC15A8/2] = 0xCD70; - pROM[0xC15AA/2] = 0xD8CD; + pROM[0xc15a8/2] = 0xcd70; + pROM[0xc15aa/2] = 0xd8cd; m_sw1_output = &segas32_state::jpark_sw1_output; } diff --git a/src/mame/sega/segas32.h b/src/mame/sega/segas32.h index 21f7194a741d1..c062d828395d3 100644 --- a/src/mame/sega/segas32.h +++ b/src/mame/sega/segas32.h @@ -18,8 +18,6 @@ #include "tilemap.h" - - class segas32_state : public device_t { public: diff --git a/src/mame/sega/segas32_m.cpp b/src/mame/sega/segas32_m.cpp index b78e0d912b18e..f20189ebb82fb 100644 --- a/src/mame/sega/segas32_m.cpp +++ b/src/mame/sega/segas32_m.cpp @@ -37,7 +37,6 @@ const uint8_t segas32_v25_state::ga2_opcode_table[256] = { void segas32_v25_state::decrypt_protrom() { - int i; uint8_t *rom = memregion("mcu")->base(); std::vector temp(0x100000); @@ -45,7 +44,7 @@ void segas32_v25_state::decrypt_protrom() memcpy(&temp[0], rom, 0x10000); // unscramble the address lines - for(i = 0; i < 0x10000; i++) + for (int i = 0; i < 0x10000; i++) rom[i] = temp[bitswap<16>(i, 14, 11, 15, 12, 13, 4, 3, 7, 5, 10, 2, 8, 9, 6, 1, 0)]; } @@ -87,31 +86,32 @@ uint16_t segas32_state::ga2_wakeup_protection_r(offs_t offset) // arcade revision C, allowing the game to run correctly. #define CLEARED_LEVELS 0xE5C4 #define CURRENT_LEVEL 0xF06E -#define CURRENT_LEVEL_STATUS 0xF0BC +#define CURRENT_LEVEL_STATUS 0xF0BC #define LEVEL_ORDER_ARRAY 0x263A void segas32_state::sonic_level_load_protection(offs_t offset, uint16_t data, uint16_t mem_mask) { uint16_t level; -//Perform write + + // Perform write COMBINE_DATA(&m_system32_workram[CLEARED_LEVELS / 2]); -//Refresh current level - if (m_system32_workram[CLEARED_LEVELS / 2] == 0) - { - level = 0x0007; - } - else - { - const uint8_t *ROM = m_maincpu_region->base(); - level = *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 1); - level |= *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 2) << 8; - } - m_system32_workram[CURRENT_LEVEL / 2] = level; + // Refresh current level + if (m_system32_workram[CLEARED_LEVELS / 2] == 0) + { + level = 0x0007; + } + else + { + const uint8_t *ROM = m_maincpu_region->base(); + level = *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 1); + level |= *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 2) << 8; + } + m_system32_workram[CURRENT_LEVEL / 2] = level; -//Reset level status - m_system32_workram[CURRENT_LEVEL_STATUS / 2] = 0x0000; - m_system32_workram[(CURRENT_LEVEL_STATUS + 2) / 2] = 0x0000; + // Reset level status + m_system32_workram[CURRENT_LEVEL_STATUS / 2] = 0x0000; + m_system32_workram[(CURRENT_LEVEL_STATUS + 2) / 2] = 0x0000; } @@ -202,11 +202,11 @@ void segas32_state::darkedge_fd1149_vblank() space.write_word(0x20f072, 0); space.write_word(0x20f082, 0); - if( space.read_byte(0x20a12c) != 0 ) + if (space.read_byte(0x20a12c) != 0) { - space.write_byte(0x20a12c, space.read_byte(0x20a12c)-1 ); + space.write_byte(0x20a12c, space.read_byte(0x20a12c)-1); - if( space.read_byte(0x20a12c) == 0 ) + if (space.read_byte(0x20a12c) == 0) space.write_byte(0x20a12e, 1); } } @@ -235,12 +235,12 @@ void segas32_state::f1lap_fd1149_vblank() { address_space &space = m_maincpu->space(AS_PROGRAM); - space.write_byte(0x20F7C6, 0); + space.write_byte(0x20f7c6, 0); // needed to start a game - uint8_t val = space.read_byte(0x20EE81); - if (val == 0xff) space.write_byte(0x20EE81,0); - + uint8_t val = space.read_byte(0x20ee81); + if (val == 0xff) + space.write_byte(0x20ee81,0); } @@ -253,7 +253,7 @@ void segas32_state::f1lap_fd1149_vblank() void segas32_state::dbzvrvs_protection_w(address_space &space, uint16_t data) { - space.write_word( 0x2080c8, space.read_word( 0x200044 ) ); + space.write_word(0x2080c8, space.read_word(0x200044)); } @@ -333,19 +333,19 @@ uint16_t segas32_state::arf_wakeup_protection_r(offs_t offset) ******************************************************************************/ void segas32_state::jleague_protection_w(address_space &space, offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA( &m_system32_workram[0xf700/2 + offset ] ); + COMBINE_DATA(&m_system32_workram[0xf700/2 + offset]); - switch( offset ) + switch (offset) { // Map team browser selection to opponent browser selection // using same lookup table that V60 uses for sound sample mapping. case 0: - space.write_byte( 0x20f708, space.read_word( 0x7bbc0 + data*2 ) ); + space.write_byte(0x20f708, space.read_word(0x7bbc0 + data*2)); break; // move on to team browser case 4/2: - space.write_byte( 0x200016, data & 0xff ); + space.write_byte(0x200016, data & 0xff); break; default: @@ -376,9 +376,9 @@ void segas32_state::jleague_protection_w(address_space &space, offs_t offset, ui uint16_t segas32_state::arescue_dsp_r(offs_t offset) { - if( offset == 4/2 ) + if (offset == 4/2) { - switch( m_arescue_dsp_io[0] ) + switch (m_arescue_dsp_io[0]) { case 0: case 1: @@ -395,7 +395,7 @@ uint16_t segas32_state::arescue_dsp_r(offs_t offset) break; default: - logerror("Unhandled DSP cmd %04x (%04x).\n", m_arescue_dsp_io[0], m_arescue_dsp_io[1] ); + logerror("Unhandled DSP cmd %04x (%04x).\n", m_arescue_dsp_io[0], m_arescue_dsp_io[1]); break; } } diff --git a/src/mame/sega/segas32_v.cpp b/src/mame/sega/segas32_v.cpp index 92dca067e6bf4..7b921596f665a 100644 --- a/src/mame/sega/segas32_v.cpp +++ b/src/mame/sega/segas32_v.cpp @@ -289,7 +289,7 @@ void segas32_state::device_start() memset(m_videoram, 0x00, 0x20000); m_videoram[0x1ff00/2] = 0x8000; - memset(m_mixer_control, 0xff, sizeof(m_mixer_control[0][0]) * 0x80 ); + memset(m_mixer_control, 0xff, sizeof(m_mixer_control[0][0]) * 0x80); /* needs to be initialized to 0xff, otherwise f1en has bad sound (MT04531) */ if (m_soundram) diff --git a/src/mame/sega/sg1000.cpp b/src/mame/sega/sg1000.cpp index b26f32fbdb2da..6698d052eefa9 100644 --- a/src/mame/sega/sg1000.cpp +++ b/src/mame/sega/sg1000.cpp @@ -394,7 +394,7 @@ INPUT_CHANGED_MEMBER( sg1000_state::trigger_nmi ) } /*------------------------------------------------- - CUSTOM_INPUT_MEMBER( ctrl2_r ) + ioport_value ctrl2_r() -------------------------------------------------*/ template diff --git a/src/mame/sega/sg1000a.cpp b/src/mame/sega/sg1000a.cpp index 9f98d03f096b3..17bd6185a89bc 100644 --- a/src/mame/sega/sg1000a.cpp +++ b/src/mame/sega/sg1000a.cpp @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Tomasz Slanina /********************************************************* -Sega hardware based on their SG-1000 console -Driver by Tomasz Slanina +Sega arcade hardware based on their SG-1000 console +Driver by Tomasz Slanina Supported games : - Champion Boxing @@ -285,10 +285,11 @@ namespace { class sg1000a_state : public driver_device { public: - sg1000a_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + sg1000a_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_decrypted_opcodes(*this, "decrypted_opcodes") { } + m_decrypted_opcodes(*this, "decrypted_opcodes") + { } void sderbys(machine_config &config); void sderby2s(machine_config &config); @@ -521,6 +522,7 @@ void sg1000a_state::sderbys(machine_config &config) sderby2s(config); m_maincpu->set_addrmap(AS_OPCODES, &sg1000a_state::decrypted_opcodes_map); } + /************************************* * * ROM definitions diff --git a/src/mame/sega/shtzone.cpp b/src/mame/sega/shtzone.cpp index 6e9455c6334aa..32e022bae714b 100644 --- a/src/mame/sega/shtzone.cpp +++ b/src/mame/sega/shtzone.cpp @@ -84,8 +84,8 @@ class shtzone_state : public sms_state void shtzone(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(gun_tl_p1_r); - DECLARE_CUSTOM_INPUT_MEMBER(gun_tl_p2_r); + ioport_value gun_tl_p1_r(); + ioport_value gun_tl_p2_r(); protected: virtual void machine_start() override; @@ -194,12 +194,12 @@ void shtzone_state::prg_map(address_map &map) map(0xdc00, 0xdc00).portr("IN1"); } -CUSTOM_INPUT_MEMBER(shtzone_state::gun_tl_p1_r) +ioport_value shtzone_state::gun_tl_p1_r() { return BIT(m_port_ctrl1->in_r(), 4); } -CUSTOM_INPUT_MEMBER(shtzone_state::gun_tl_p2_r) +ioport_value shtzone_state::gun_tl_p2_r() { return BIT(m_port_ctrl2->in_r(), 4); } diff --git a/src/mame/sega/stactics.cpp b/src/mame/sega/stactics.cpp index 64e3d5912d925..81675e5a30164 100644 --- a/src/mame/sega/stactics.cpp +++ b/src/mame/sega/stactics.cpp @@ -89,7 +89,7 @@ class stactics_state : public driver_device int shot_standby_r(); int not_shot_arrive_r(); int motor_not_ready_r(); - DECLARE_CUSTOM_INPUT_MEMBER(get_rng); + ioport_value get_rng(); protected: virtual void machine_start() override; @@ -645,7 +645,7 @@ void stactics_state::move_motor() * *************************************/ -CUSTOM_INPUT_MEMBER(stactics_state::get_rng) +ioport_value stactics_state::get_rng() { // this is a 555 timer, but cannot read one of the resistor values return machine().rand() & 0x07; diff --git a/src/mame/sega/stv.cpp b/src/mame/sega/stv.cpp index 969b95d4c58d4..1cd47ce126a6c 100644 --- a/src/mame/sega/stv.cpp +++ b/src/mame/sega/stv.cpp @@ -1284,7 +1284,7 @@ void stv_state::stv_slot(machine_config &config) void stv_state::hopper(machine_config &config) { stv(config); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem); m_slave->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem); diff --git a/src/mame/sega/system1.cpp b/src/mame/sega/system1.cpp index 471a29206cf24..b7c1b6a8e3eff 100644 --- a/src/mame/sega/system1.cpp +++ b/src/mame/sega/system1.cpp @@ -433,14 +433,14 @@ void system1_state::videomode_w(u8 data) * *************************************/ -CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_data_r) +ioport_value system1_state::dakkochn_mux_data_r() { static const char *const ports[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" }; return ioport(ports[m_dakkochn_mux_data])->read(); } -CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_status_r) +ioport_value system1_state::dakkochn_mux_status_r() { /* reads from here indicate which mux port is selected */ return 1 << (m_dakkochn_mux_data); diff --git a/src/mame/sega/system1.h b/src/mame/sega/system1.h index cc21c621baef9..140d390eee729 100644 --- a/src/mame/sega/system1.h +++ b/src/mame/sega/system1.h @@ -113,8 +113,8 @@ class system1_state : public driver_device void init_bootsys2(); void init_bootsys2d(); - DECLARE_CUSTOM_INPUT_MEMBER(dakkochn_mux_data_r); - DECLARE_CUSTOM_INPUT_MEMBER(dakkochn_mux_status_r); + ioport_value dakkochn_mux_data_r(); + ioport_value dakkochn_mux_status_r(); protected: virtual void machine_start() override; diff --git a/src/mame/sega/turbo.cpp b/src/mame/sega/turbo.cpp index c8785aff6c2fd..e494598d38a5c 100644 --- a/src/mame/sega/turbo.cpp +++ b/src/mame/sega/turbo.cpp @@ -440,7 +440,7 @@ void turbo_base_state::digit_w(uint8_t data) * *************************************/ -CUSTOM_INPUT_MEMBER(turbo_base_state::pedal_r) +ioport_value turbo_base_state::pedal_r() { // inverted 2-bit Gray code from a pair of optos in mechanical pedal uint8_t pedal = m_pedal->read(); diff --git a/src/mame/sega/turbo.h b/src/mame/sega/turbo.h index b96c410974216..08e2adab2534b 100644 --- a/src/mame/sega/turbo.h +++ b/src/mame/sega/turbo.h @@ -44,7 +44,7 @@ class turbo_base_state : public driver_device , m_lamp(*this, "lamp") { } - DECLARE_CUSTOM_INPUT_MEMBER(pedal_r); + ioport_value pedal_r(); protected: virtual void machine_start() override; diff --git a/src/mame/sega/zaxxon.cpp b/src/mame/sega/zaxxon.cpp index b29c99fde6848..be991e56e29d3 100644 --- a/src/mame/sega/zaxxon.cpp +++ b/src/mame/sega/zaxxon.cpp @@ -351,7 +351,7 @@ uint8_t zaxxon_state::razmataz_counter_r() template -CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r) +ioport_value zaxxon_state::razmataz_dial_r() { int res; diff --git a/src/mame/sega/zaxxon.h b/src/mame/sega/zaxxon.h index 3beff1af871e3..cb9f7f2e03c58 100644 --- a/src/mame/sega/zaxxon.h +++ b/src/mame/sega/zaxxon.h @@ -48,7 +48,7 @@ class zaxxon_state : public driver_device void init_razmataz(); void init_zaxxonj(); - template DECLARE_CUSTOM_INPUT_MEMBER(razmataz_dial_r); + template ioport_value razmataz_dial_r(); template int zaxxon_coin_r(); DECLARE_INPUT_CHANGED_MEMBER(service_switch); DECLARE_INPUT_CHANGED_MEMBER(zaxxon_coin_inserted); diff --git a/src/mame/seibu/banprestoms.cpp b/src/mame/seibu/banprestoms.cpp index 26fcc264d1044..f32d5eff5b439 100644 --- a/src/mame/seibu/banprestoms.cpp +++ b/src/mame/seibu/banprestoms.cpp @@ -413,7 +413,7 @@ void banprestoms_state::banprestoms(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // TODO: period is guessed + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); // TODO: period is guessed // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: copied from other drivers using the same CRTC diff --git a/src/mame/seibu/feversoc.cpp b/src/mame/seibu/feversoc.cpp index 433b186d0970c..0355b31e4d4ef 100644 --- a/src/mame/seibu/feversoc.cpp +++ b/src/mame/seibu/feversoc.cpp @@ -323,7 +323,7 @@ void feversoc_state::feversoc(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60)); } /*************************************************************************** diff --git a/src/mame/seibu/seibuspi.cpp b/src/mame/seibu/seibuspi.cpp index 27fcb92eaf433..8d9c540b5b81c 100644 --- a/src/mame/seibu/seibuspi.cpp +++ b/src/mame/seibu/seibuspi.cpp @@ -554,7 +554,8 @@ SXX2C ROM SUB10 (C)1998 ------------------------------------- Notes: * : These ROMs are surface mounted -61256 : 32k x8 SRAM (x2) +61256 : 32k x8 SRAM (x2). These are tied to the RISE11 chip with RAM A11-A14 tied to vcc/gnd so + these RAMs are configured as 2kB each and the RISE11 has a total of 4kB connected to it. RISE11: SEIBU custom stamped 'RISE11' (QFP240) PAL1 : PALCE 16V8 stamped 'SPI ROM 10-2' PAL2 : PALCE 16V8 stamped 'SPI ROM 10-1' @@ -1205,7 +1206,7 @@ void seibuspi_state::ymf_irqhandler(int state) } template -CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode) +ioport_value seibuspi_state::ejanhs_encode() { /* E-Jan Highschool has a keyboard with the following keys The keys are encoded with 3 bits for each input port diff --git a/src/mame/seibu/seibuspi.h b/src/mame/seibu/seibuspi.h index 839b015c2adfa..c25c8c697f869 100644 --- a/src/mame/seibu/seibuspi.h +++ b/src/mame/seibu/seibuspi.h @@ -56,7 +56,7 @@ class seibuspi_state : public driver_device void init_ejanhs(); void init_sys386f(); - template DECLARE_CUSTOM_INPUT_MEMBER(ejanhs_encode); + template ioport_value ejanhs_encode(); IRQ_CALLBACK_MEMBER(spi_irq_callback); INTERRUPT_GEN_MEMBER(spi_interrupt); diff --git a/src/mame/seta/albazc.cpp b/src/mame/seta/albazc.cpp index b1dcbfbd903ca..254b48002c0f8 100644 --- a/src/mame/seta/albazc.cpp +++ b/src/mame/seta/albazc.cpp @@ -227,7 +227,7 @@ void albazc_state::hanaroku(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/champbwl.cpp b/src/mame/seta/champbwl.cpp index a0954ac559eb2..36193f6741034 100644 --- a/src/mame/seta/champbwl.cpp +++ b/src/mame/seta/champbwl.cpp @@ -323,7 +323,7 @@ void doraemon_state::outputs_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // gift out counter machine().bookkeeping().coin_lockout_w(0, BIT(~data, 3)); // coin lockout - m_hopper->motor_w(BIT(~data, 2)); // gift out motor + m_hopper->motor_w(BIT(data, 2)); // gift out motor m_mainbank->set_entry((data & 0x30) >> 4); @@ -481,7 +481,7 @@ static INPUT_PORTS_START( doraemon ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // sensor + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // sensor PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) INPUT_PORTS_END @@ -601,7 +601,7 @@ void doraemon_state::doraemon(machine_config &config) m_spritegen->set_bg_yoffsets(0x00, 0x01); m_spritegen->set_fg_yoffsets(0x00, 0x10); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/downtown.cpp b/src/mame/seta/downtown.cpp index 80a5736db66c1..5b044b8d35697 100644 --- a/src/mame/seta/downtown.cpp +++ b/src/mame/seta/downtown.cpp @@ -466,8 +466,8 @@ class usclssic_state : public downtown_state void usclssic(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(trackball_x_r); - DECLARE_CUSTOM_INPUT_MEMBER(trackball_y_r); + ioport_value trackball_x_r(); + ioport_value trackball_y_r(); protected: virtual void machine_start() override; @@ -858,12 +858,12 @@ u16 usclssic_state::dsw_r(offs_t offset) return 0; } -CUSTOM_INPUT_MEMBER(usclssic_state::trackball_x_r) +ioport_value usclssic_state::trackball_x_r() { return m_track_x[m_port_select ? 1 : 0]->read(); } -CUSTOM_INPUT_MEMBER(usclssic_state::trackball_y_r) +ioport_value usclssic_state::trackball_y_r() { return m_track_y[m_port_select ? 1 : 0]->read(); } diff --git a/src/mame/seta/jclub2.cpp b/src/mame/seta/jclub2.cpp index 47e086d407a29..4d1f7dca0af8d 100644 --- a/src/mame/seta/jclub2.cpp +++ b/src/mame/seta/jclub2.cpp @@ -1168,8 +1168,8 @@ void jclub2o_state::jclub2o(machine_config &config) EEPROM_S29290_16BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -1209,8 +1209,8 @@ void jclub2_state::jclub2(machine_config &config) EEPROM_93C46_8BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -1253,8 +1253,8 @@ void darkhors_state::darkhors(machine_config &config) EEPROM_93C46_8BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/seta.cpp b/src/mame/seta/seta.cpp index c3b5eab497398..6673aff4c7fce 100644 --- a/src/mame/seta/seta.cpp +++ b/src/mame/seta/seta.cpp @@ -1553,8 +1553,8 @@ class setaroul_state : public seta_state void setaroul(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(coin_drop_start); - DECLARE_CUSTOM_INPUT_MEMBER(coin_sensors_r); - DECLARE_CUSTOM_INPUT_MEMBER(hopper_sensors_r); + ioport_value coin_sensors_r(); + ioport_value hopper_sensors_r(); void screen_vblank(int state); @@ -2807,7 +2807,7 @@ INPUT_CHANGED_MEMBER( setaroul_state::coin_drop_start ) m_coin_start_cycles = m_maincpu->total_cycles(); } -CUSTOM_INPUT_MEMBER( setaroul_state::coin_sensors_r ) +ioport_value setaroul_state::coin_sensors_r() { u8 data = 0x03; @@ -4577,7 +4577,7 @@ static INPUT_PORTS_START( setaroul ) PORT_SERVICE( 0x08, 0x08 ) PORT_DIPLOCATION("SW2:1") // service mode PORT_START("COIN") // d40009.b - PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // medal (causes hopper over run / empty if the dsw is on) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // medal (causes hopper over run / empty if the dsw is on) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset") // rst (button SW5? Press twice quickly to enter the keyboard test) PORT_DIPNAME( 0x04, 0x04, "Credit Meter" ) PORT_DIPLOCATION("SW6:1") // crt.mtr (switch SW6? Shows stats screen. With added menus, if their dsw is on) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) @@ -6888,7 +6888,7 @@ static INPUT_PORTS_START( jockeyc ) PORT_START("COIN") // 200002.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Drop - 1P PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) // Hopper Overflow - 1P - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper1", ticket_dispenser_device, line_r) // Hopper Coin Out - 1P + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper1", ticket_dispenser_device, line_r) // Hopper Coin Out - 1P PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) // Attendant Pay - 1P PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Coin B - 1P") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin A - 1P") @@ -6896,7 +6896,7 @@ static INPUT_PORTS_START( jockeyc ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Sense 1 - 1P PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Drop - 2P PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) // Sel Sense (single hopper mode) / Hopper Overflow - 2P (double hopper mode) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper2", ticket_dispenser_device, line_r) // Hopper Coin Out - 2P (double hopper mode) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper2", ticket_dispenser_device, line_r) // Hopper Coin Out - 2P (double hopper mode) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) // Attendant Pay - 2P PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Coin B - 2P") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coin A - 2P") @@ -7799,7 +7799,7 @@ void setaroul_state::setaroul(machine_config &config) // devices UPD4992(config, m_rtc, 32'768); // ! Actually D4911C ! ACIA6850(config, "acia0", 0); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(150)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -9091,8 +9091,8 @@ void jockeyc_state::jockeyc(machine_config &config) // devices UPD4992(config, m_rtc, 32'768); // ! Actually D4911C ! ACIA6850(config, "acia0", 0); - TICKET_DISPENSER(config, "hopper1", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); - TICKET_DISPENSER(config, "hopper2", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper1", attotime::from_msec(150)); + TICKET_DISPENSER(config, "hopper2", attotime::from_msec(150)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index 8e69b482d9102..d720e290a9a1f 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -1723,7 +1723,7 @@ static INPUT_PORTS_START( reelquak ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("TICKET") // $400003.b - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // ticket sensor + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // ticket sensor PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Knock Down") // knock down @@ -2111,7 +2111,7 @@ static INPUT_PORTS_START( telpacfl ) PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") // bet switch (converts credits into balls) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) // door switch - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // coin out switch (medals jam error when stuck i.e. メダルづまり) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // coin out switch (medals jam error when stuck i.e. メダルづまり) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - @@ -2371,7 +2371,7 @@ void seta2_state::reelquak(machine_config &config) downcast(*m_maincpu).parallel_w_cb().set(FUNC(seta2_state::reelquak_leds_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_dispenser, attotime::from_msec(200)); m_screen->set_visarea(0x00, 0x140-1, 0x000, 0x0f0-1); } @@ -2417,7 +2417,7 @@ void seta2_state::telpacfl(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom"); // not hooked up, seems unused NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_dispenser, attotime::from_msec(200)); // video hardware m_screen->set_visarea(0x0, 0x180-1, 0x00, 0xf0-1); // still off by 1 because of different CRTC regs? diff --git a/src/mame/seta/ssv.cpp b/src/mame/seta/ssv.cpp index fd9a4383c49a1..13745eb33a042 100644 --- a/src/mame/seta/ssv.cpp +++ b/src/mame/seta/ssv.cpp @@ -2603,8 +2603,8 @@ void ssv_state::ssv(machine_config &config) m_ensoniq->set_region2("ensoniq.2"); m_ensoniq->set_region3("ensoniq.3"); m_ensoniq->set_channels(1); - m_ensoniq->add_route(0, "lspeaker", 0.1); - m_ensoniq->add_route(1, "rspeaker", 0.1); + m_ensoniq->add_route(0, "lspeaker", 0.075); + m_ensoniq->add_route(1, "rspeaker", 0.075); } void drifto94_state::drifto94(machine_config &config) diff --git a/src/mame/sgi/sgi_ge5.h b/src/mame/sgi/sgi_ge5.h index 39a8f859623bb..a9efc878fe28c 100644 --- a/src/mame/sgi/sgi_ge5.h +++ b/src/mame/sgi/sgi_ge5.h @@ -38,7 +38,6 @@ class sgi_ge5_device : public cpu_device // device_execute_interface overrides virtual u32 execute_min_cycles() const noexcept override { return 1; } virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override {} diff --git a/src/mame/sharp/wizard.cpp b/src/mame/sharp/wizard.cpp index e75005ab50fe9..a957002686fc6 100644 --- a/src/mame/sharp/wizard.cpp +++ b/src/mame/sharp/wizard.cpp @@ -62,7 +62,6 @@ More info: #include "bus/generic/slot.h" #include "bus/generic/carts.h" #include "cpu/arm7/arm7.h" // wrong, needs CPU core -#include "cpu/arm7/arm7core.h" #include "screen.h" #include "softlist_dev.h" diff --git a/src/mame/sharp/x68k.cpp b/src/mame/sharp/x68k.cpp index 1d3083b76904c..8e5def0a501a6 100644 --- a/src/mame/sharp/x68k.cpp +++ b/src/mame/sharp/x68k.cpp @@ -635,12 +635,10 @@ uint16_t x68k_state::sram_r(offs_t offset) void x68k_state::vid_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - switch(offset) - { - case 0x000: + if(offset < 0x80) COMBINE_DATA(m_video.reg); - break; - case 0x080: // priority levels + else if(offset < 0x100) + { COMBINE_DATA(m_video.reg+1); if(ACCESSING_BITS_0_7) { @@ -661,13 +659,11 @@ void x68k_state::vid_w(offs_t offset, uint16_t data, uint16_t mem_mask) if(m_video.sprite_pri == 3) m_video.sprite_pri--; } - break; - case 0x100: + } + else if(offset < 0x180) COMBINE_DATA(m_video.reg+2); - break; - default: + else LOGMASKED(LOG_SYS, "VC: Invalid video controller write (offset = 0x%04x, data = %04x)\n",offset,data); - } } uint16_t x68k_state::vid_r(offs_t offset) diff --git a/src/mame/sharp/x68k_crtc.cpp b/src/mame/sharp/x68k_crtc.cpp index 73db692757ab9..6614075d07f76 100644 --- a/src/mame/sharp/x68k_crtc.cpp +++ b/src/mame/sharp/x68k_crtc.cpp @@ -148,8 +148,8 @@ void x68k_crtc_device::refresh_mode() m_vtotal = (m_reg[4] + 1) / m_vmultiple; // default is 567 (568 scanlines) m_hbegin = (m_reg[2] * 8) + 1; m_hend = m_reg[3] * 8; - m_vbegin = m_reg[6] / m_vmultiple; - m_vend = (m_reg[7] - 1) / m_vmultiple; + m_vbegin = (m_reg[6] + 1) / m_vmultiple; + m_vend = m_reg[7] / m_vmultiple; m_hsync_end = (m_reg[1]) * 8; m_vsync_end = (m_reg[5]) / m_vmultiple; m_hsyncadjust = m_reg[8]; @@ -278,7 +278,7 @@ TIMER_CALLBACK_MEMBER(x68k_crtc_device::vblank_irq) if (val == 0) // V-DISP off { m_vblank = 0; - vblank_line = m_vend; + vblank_line = m_vend + 1; if (vblank_line > m_vtotal) vblank_line = m_vtotal; irq_time = screen().time_until_pos(vblank_line, 2); diff --git a/src/mame/sharp/x68k_v.cpp b/src/mame/sharp/x68k_v.cpp index 141c78c450657..7ba37589be3dc 100644 --- a/src/mame/sharp/x68k_v.cpp +++ b/src/mame/sharp/x68k_v.cpp @@ -138,7 +138,7 @@ void x68k_state::spritereg_w(offs_t offset, uint16_t data, uint16_t mem_mask) m_video.bg_hstart = (data - 4) * 8 + 1; break; case 0x407: // BG V-DISP (like CRTC reg 6) - m_video.bg_vstart = data - 1; + m_video.bg_vstart = data; break; case 0x408: // BG H/V-Res m_video.bg_hvres = data & 0x1f; @@ -443,7 +443,7 @@ template rgb_t x68k_state::get_gfx_pixel(int scanline, int pixel, b if(colour || (m_video.gfx_pri == 2)) { if(blend) - return ((blendpix >> 1) & 0xff7f7f7f) + ((pal555(colour, 6, 11, 1) >> 1) & 0x7f7f7f); + return ((blendpix >> 1) & 0xff7f7f7f) + ((pal555(colour, 6, 11, 1) >> 2) & 0x3f3f3f); else return pal555(colour, 6, 11, 1); } @@ -461,7 +461,7 @@ template rgb_t x68k_state::get_gfx_pixel(int scanline, int pixel, b if((m_gfxpalette->pen(colour) & 0xffffff) || (m_video.gfx_pri == 2)) { if(blend) - return ((blendpix >> 1) & 0xff7f7f7f) + ((m_gfxpalette->pen(colour) >> 1) & 0x7f7f7f); + return ((blendpix >> 1) & 0xff7f7f7f) + ((m_gfxpalette->pen(colour) >> 2) & 0x3f3f3f); else return m_gfxpalette->pen(colour); } diff --git a/src/mame/sharp/zaurus.cpp b/src/mame/sharp/zaurus.cpp index 3c22565efaaee..1481b9bfb95ca 100644 --- a/src/mame/sharp/zaurus.cpp +++ b/src/mame/sharp/zaurus.cpp @@ -1401,7 +1401,6 @@ Features: handwriting recognition, 1280x960 1.33 MP camera, wireless/cellular ph #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/locomo.h" #include "machine/pxa255.h" #include "machine/sa1110.h" @@ -1417,8 +1416,7 @@ Features: handwriting recognition, 1280x960 1.33 MP camera, wireless/cellular ph #define PXA255_CLOCK 400000000 #define PXA270_CLOCK 416000000 -namespace -{ +namespace { class zaurus_state : public driver_device { diff --git a/src/mame/sigma/sigmab98.cpp b/src/mame/sigma/sigmab98.cpp index 7834f6c605fd2..c81ef9c5d788c 100644 --- a/src/mame/sigma/sigmab98.cpp +++ b/src/mame/sigma/sigmab98.cpp @@ -114,6 +114,7 @@ To Do: *************************************************************************************************************/ #include "emu.h" + #include "cpu/z80/kl5c80a12.h" #include "cpu/z80/ky80.h" #include "machine/74165.h" @@ -126,6 +127,7 @@ To Do: #include "sound/okim9810.h" #include "sound/ymz280b.h" #include "video/bufsprite.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -734,7 +736,7 @@ void sigmab98_state::show_outputs() void sigmab98_state::eeprom_w(uint8_t data) { // latch the bit - m_eeprom->di_write((data & 0x40) >> 6); + m_eeprom->di_write(BIT(data, 6)); // reset line asserted: reset. // if ((m_c0 ^ data) & 0x20) @@ -765,9 +767,9 @@ void sigmab98_state::c4_w(uint8_t data) // 20 led? (starts blinking after coin in) void sigmab98_state::c6_w(uint8_t data) { - machine().bookkeeping().coin_lockout_w(0, (~data) & 0x02); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 1)); - machine().bookkeeping().coin_counter_w(0, data & 0x04); + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); if ((data & 0x08) && !(m_c6 & 0x08)) m_buffered_spriteram->copy(); @@ -784,7 +786,7 @@ void sigmab98_state::c6_w(uint8_t data) // 02 hopper motor on (active low)? void sigmab98_state::c8_w(uint8_t data) { - m_hopper->motor_w((!(data & 0x02) && (data & 0x01)) ? 0 : 1); + m_hopper->motor_w(~data >> 1 & data & 1); m_c8 = data; show_outputs(); @@ -819,7 +821,7 @@ void sigmab98_state::gegege_io_map(address_map &map) map(0xc6, 0xc6).w(FUNC(sigmab98_state::c6_w)); map(0xc8, 0xc8).w(FUNC(sigmab98_state::c8_w)); - map(0xe5, 0xe5).nopr(); // during irq + map(0xe5, 0xe5).nopr(); // during irq } @@ -1201,19 +1203,19 @@ GFXDECODE_END // 1 button (plus bet and payout) static INPUT_PORTS_START( sigma_1b ) PORT_START("EEPROM") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // Related to d013. Must be 0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // Related to d013. Must be 0 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // Related to d013. Must be 0 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_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_START("BUTTON") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_NAME("Medal") // coin/medal in (coin error) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_1) // bet / select in test menu PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) @@ -1289,7 +1291,7 @@ static INPUT_PORTS_START( lufykzku ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("PAYOUT") @@ -1365,14 +1367,14 @@ static INPUT_PORTS_START( sammymdl ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COIN") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin1 in - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin2 in - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(5) PORT_NAME("Medal") // medal in - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin1 in + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin2 in + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(5) PORT_NAME("Medal") // medal in + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( haekaka ) @@ -1387,22 +1389,22 @@ static INPUT_PORTS_START( haekaka ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COIN") - 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_SERVICE ) // test sw - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // button - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin / set in test mode - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + 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_SERVICE ) // test sw + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // button + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin / set in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( gocowboy ) PORT_START("BUTTON") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // shoot PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(20) // coin - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_small", ticket_dispenser_device, line_r) // 1/2' pay sensor (small) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_large", ticket_dispenser_device, line_r) // 3/4' pay sensor (large) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_small", ticket_dispenser_device, line_r) // 1/2' pay sensor (small) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_large", ticket_dispenser_device, line_r) // 3/4' pay sensor (large) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Switch") // capsule test (pressed while booting) / next in test mode PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Switch") // reset backup ram (pressed while booting) / previous in test mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) // test mode (keep pressed in game) / select in test mode / service coin @@ -1444,7 +1446,7 @@ void sigmab98_state::sigmab98(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); EEPROM_93C46_16BIT(config, "eeprom"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1516,7 +1518,7 @@ void lufykzku_state::lufykzku(machine_config &config) // No EEPROM MB3773(config, m_watchdog, 0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // 2 x 8-bit parallel/serial converters TTL165(config, m_dsw_shifter[0]); @@ -1593,7 +1595,7 @@ void sammymdl_state::sammymdl(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // battery backed RAM EEPROM_93C46_8BIT(config, "eeprom"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); @@ -1640,8 +1642,8 @@ void sammymdl_state::gocowboy(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(sammymdl_state::gocowboy_int), "screen", 0, 1); config.device_remove("hopper"); - TICKET_DISPENSER(config, m_hopper_small, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); - TICKET_DISPENSER(config, m_hopper_large, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper_small, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper_large, attotime::from_msec(200)); m_screen->screen_vblank().set_nop(); } diff --git a/src/mame/sinclair/specnext_sprites.cpp b/src/mame/sinclair/specnext_sprites.cpp index da067ef43fe2a..d4a0ffef27fa4 100644 --- a/src/mame/sinclair/specnext_sprites.cpp +++ b/src/mame/sinclair/specnext_sprites.cpp @@ -317,6 +317,11 @@ void specnext_sprites_device::device_reset() update_config(); } +void specnext_sprites_device::device_post_load() +{ + m_sprites_cache.clear(); +} + // device type definition DEFINE_DEVICE_TYPE(SPECNEXT_SPRITES, specnext_sprites_device, "sprites", "Spectrum Next Sprites") diff --git a/src/mame/sinclair/specnext_sprites.h b/src/mame/sinclair/specnext_sprites.h index 2d3ec3eac0b80..21c10ee73fd07 100644 --- a/src/mame/sinclair/specnext_sprites.h +++ b/src/mame/sinclair/specnext_sprites.h @@ -44,6 +44,7 @@ class specnext_sprites_device : public device_t, public device_gfx_interface virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; + virtual void device_post_load() override ATTR_COLD; memory_share_creator m_sprite_pattern_ram; memory_share_creator m_sprite_attr_ram; diff --git a/src/mame/sinclair/sprinter.cpp b/src/mame/sinclair/sprinter.cpp index e5d747559ba4c..b1a48938130de 100644 --- a/src/mame/sinclair/sprinter.cpp +++ b/src/mame/sinclair/sprinter.cpp @@ -108,9 +108,10 @@ class sprinter_state : public spectrum_128_state INPUT_CHANGED_MEMBER(turbo_changed); protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + virtual void device_post_load() override ATTR_COLD; void map_io(address_map &map); void map_mem(address_map &map); @@ -121,6 +122,7 @@ class sprinter_state : public spectrum_128_state void update_memory(); void update_cpu(); + void update_video(bool is312); virtual TIMER_CALLBACK_MEMBER(irq_on) override; virtual TIMER_CALLBACK_MEMBER(irq_off) override; @@ -356,6 +358,13 @@ void sprinter_state::update_cpu() m_maincpu->set_clock_scale((m_turbo && m_turbo_hard) ? 6 : 1); // 1 - 21MHz, 0 - 3.5MHz } +void sprinter_state::update_video(bool is312) +{ + const u16 vtotal = SPRINT_HEIGHT - (8 * is312); + m_screen->configure(SPRINT_WIDTH, vtotal, m_screen->visible_area(), HZ_TO_ATTOSECONDS(X_SP / 3) * SPRINT_WIDTH * vtotal); + update_int(true); +} + u32 sprinter_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_conf) @@ -371,7 +380,8 @@ void sprinter_state::screen_update_graph(screen_device &screen, bitmap_ind16 &bi const bool flash = BIT(screen.frame_number(), 4); for (u16 vpos = cliprect.top(); vpos <= cliprect.bottom();) { - const u16 b8 = (SPRINT_HEIGHT + vpos - SPRINT_BORDER_TOP - m_hold.second) % SPRINT_HEIGHT; + const u16 scr_height = screen.height(); + const u16 b8 = (scr_height + vpos - SPRINT_BORDER_TOP - m_hold.second) % scr_height; for (u16 hpos = cliprect.left(); hpos <= cliprect.right();) { const u16 a16 = (SPRINT_WIDTH + hpos - SPRINT_BORDER_LEFT - m_hold.first) % SPRINT_WIDTH; @@ -404,8 +414,8 @@ void sprinter_state::draw_tile(u8* mode, bitmap_ind16 &bitmap, const rectangle & { for (auto dx = cliprect.left(); dx <= cliprect.right(); dx++) { - const u8 color = m_vram[(y + ((dy & 7) >> lowres)) * 1024 + x + ((dx & 15) >> (1 + lowres))]; - *pix++ = pal + (BIT(mode[0], 5) ? color : ((dx & 1) ? (color & 0x0f) : (color >> 4))); + const u8 color = m_vram[(y + (((dy - m_hold.second) & 7) >> lowres)) * 1024 + x + (((dx - m_hold.first) & 15) >> (1 + lowres))]; + *pix++ = pal + (BIT(mode[0], 5) ? color : (((dx - m_hold.first) & 1) ? (color & 0x0f) : (color >> 4))); } pix += SPRINT_WIDTH - cliprect.width(); } @@ -462,7 +472,8 @@ void sprinter_state::screen_update_game(screen_device &screen, bitmap_ind16 &bit { for (u16 vpos = cliprect.top(); vpos <= cliprect.bottom(); vpos++) { - const u8 b = ((SPRINT_HEIGHT + vpos - SPRINT_BORDER_TOP - m_hold.second) % SPRINT_HEIGHT) >> 3; + const u16 scr_height = screen.height(); + const u8 b = ((scr_height + vpos - SPRINT_BORDER_TOP - m_hold.second) % scr_height) >> 3; const u8 a = ((SPRINT_WIDTH + cliprect.left() - SPRINT_BORDER_LEFT - m_hold.first) % SPRINT_WIDTH) >> 4; std::pair scroll = lookback_scroll(a, b); @@ -479,7 +490,7 @@ void sprinter_state::screen_update_game(screen_device &screen, bitmap_ind16 &bit scroll = {mode[3] & 0x0f, mode[3] >> 4}; a16 = (SPRINT_WIDTH + hpos + (scroll.first << 1) - SPRINT_BORDER_LEFT - m_hold.first) % SPRINT_WIDTH; } - const u16 b8 = (SPRINT_HEIGHT + vpos + scroll.second - SPRINT_BORDER_TOP - m_hold.second) % SPRINT_HEIGHT; + const u16 b8 = (scr_height + vpos + scroll.second - SPRINT_BORDER_TOP - m_hold.second) % scr_height; if (mode == nullptr) { @@ -729,6 +740,10 @@ void sprinter_state::dcp_w(offs_t offset, u8 data) case 0x2b: // HDD2 - primary m_ata_selected = 0; break; + case 0x2c: // 320 + case 0x2d: // 312 + update_video(dcpp & 1); + break; case 0x2e: if (m_conf) machine().schedule_hard_reset(); @@ -1163,12 +1178,13 @@ void sprinter_state::update_int(bool recalculate) if (recalculate) m_ints.clear(); + const u8 height = m_screen->height() / 8; if (m_ints.empty()) { - for (auto scr_b = 0; scr_b <= 39; scr_b++) + for (auto scr_b = 0; scr_b < height; scr_b++) { bool pre_int = false; - const u8 b = (scr_b + 40 - 2) % 40; // 2-top border + const u8 b = (scr_b + height - 2) % height; // 2-top border for (auto scr_a = 0; scr_a <= 55; scr_a++) { const u8 a = (scr_a + 56 - 6) % 56; // 3-left border, 3-teared blank? @@ -1413,7 +1429,16 @@ void sprinter_state::machine_reset() m_bank_view3.disable(); } else + { update_memory(); + update_video(0); + } +} + +void sprinter_state::device_post_load() +{ + spectrum_128_state::device_post_load(); + m_ints.clear(); } static const gfx_layout sprinter_charlayout = @@ -1540,7 +1565,7 @@ TIMER_CALLBACK_MEMBER(sprinter_state::irq_on) TIMER_CALLBACK_MEMBER(sprinter_state::irq_off) { - m_irq_off_timer->adjust(attotime::never); // in case it's called from INT Ack, not by timer itself + m_irq_off_timer->reset(); // in case it's called from INT Ack, not by timer itself m_hold_irq = 0; m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); } @@ -1561,7 +1586,7 @@ TIMER_CALLBACK_MEMBER(sprinter_state::cbl_tick) { m_hold_irq = 1; m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); - m_irq_off_timer->adjust(attotime::never); + m_irq_off_timer->reset(); } } diff --git a/src/mame/sinclair/tsconf.cpp b/src/mame/sinclair/tsconf.cpp index f56ef0cd975fb..d06debc753954 100644 --- a/src/mame/sinclair/tsconf.cpp +++ b/src/mame/sinclair/tsconf.cpp @@ -30,8 +30,6 @@ FAQ-RUS: https://forum.tslabs.info/viewtopic.php?f=35&t=157 TODO: - Ram cache - VDos -- INTs not perfect. Currently all signals are invalidated after 32t(3.5MHz). Must only do so for frame, not scanline/DMA -- Palette change in the middle of the frame e.g. zapili-c0 ****************************************************************************/ @@ -96,9 +94,9 @@ void tsconf_state::tsconf_io(address_map &map) map(0xffdf, 0xffdf).lr8(NAME([this]() -> u8 { return ~m_io_mouse[1]->read(); })); map(0x8ff7, 0x8ff7).select(0x7000).w(FUNC(tsconf_state::tsconf_port_f7_w)); // 3:bff7 5:dff7 6:eff7 map(0xbff7, 0xbff7).r(FUNC(tsconf_state::tsconf_port_f7_r)); - map(0x00fb, 0x00fb).mirror(0xff00).w("cent_data_out", FUNC(output_latch_device::write)); - map(0x8000, 0x8000).mirror(0x3ffd).lw8(NAME([this](u8 data) { return m_ay[m_ay_selected]->data_w(data); })); - map(0xc000, 0xc000).mirror(0x3ffd).lr8(NAME([this]() { return m_ay[m_ay_selected]->data_r(); })) + map(0x00fb, 0x00fb).mirror(0xff00).w(m_dac, FUNC(dac_byte_interface::data_w)); + map(0x80fd, 0x80fd).mirror(0x3f00).lw8(NAME([this](u8 data) { return m_ay[m_ay_selected]->data_w(data); })); + map(0xc0fd, 0xc0fd).mirror(0x3f00).lr8(NAME([this]() { return m_ay[m_ay_selected]->data_r(); })) .w(FUNC(tsconf_state::tsconf_ay_address_w)); } @@ -117,9 +115,9 @@ void tsconf_state::tsconf_bank_w(offs_t offset, u8 data) static const gfx_layout spectrum_charlayout = { - 8, 8, // 8 x 8 characters */ - 96, // 96 characters */ - 1, // 1 bits per pixel */ + 8, 8, // 8 x 8 characters + 96, // 96 characters + 1, // 1 bits per pixel {0}, // no bitplanes {STEP8(0, 1)}, // x offsets {STEP8(0, 8)}, // y offsets @@ -145,8 +143,7 @@ static const gfx_layout tsconf_tile_16cpp_layout = 4, {STEP4(0, 1)}, {STEP8(0, 4)}, - {STEP8(0, 256 * 8)}, - // Much more tiles when needed. Because tiles are in RAW format but we don't know region properties. + {STEP8(0, 256 * 8)}, // Much more tiles when needed. Because tiles are in RAW format but we don't know region properties. 8 * 4 }; @@ -237,6 +234,12 @@ void tsconf_state::machine_reset() while (m_keyboard->read() != 0) { /* invalidate buffer */ } } +void tsconf_state::device_post_load() +{ + spectrum_128_state::device_post_load(); + m_sprites_cache.clear(); +} + INPUT_PORTS_START( tsconf ) PORT_INCLUDE( spec_plus ) @@ -281,7 +284,7 @@ void tsconf_state::tsconf(machine_config &config) GLUKRS(config, m_glukrs); - TSCONF_DMA(config, m_dma, 14_MHz_XTAL / 2); + TSCONF_DMA(config, m_dma, 14_MHz_XTAL * 2); m_dma->in_mreq_callback().set(FUNC(tsconf_state::ram_read16)); m_dma->out_mreq_callback().set(FUNC(tsconf_state::ram_write16)); m_dma->in_spireq_callback().set(FUNC(tsconf_state::spi_read16)); @@ -308,9 +311,7 @@ void tsconf_state::tsconf(machine_config &config) .add_route(1, "rspeaker", 0.25) .add_route(2, "rspeaker", 0.50); - CENTRONICS(config, m_centronics, centronics_devices, "covox"); - output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); - m_centronics->set_output_latch(cent_data_out); + DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "mono", 0.75);; PALETTE(config, "palette", FUNC(tsconf_state::tsconf_palette), 256); m_screen->set_raw(14_MHz_XTAL / 2, 448, with_hblank(0), 448, 320, with_vblank(0), 320); @@ -329,7 +330,13 @@ void tsconf_state::tsconf(machine_config &config) ROM_START(tsconf) ROM_REGION(0x080000, "maincpu", ROMREGION_ERASEFF) // ROM: 32 * 16KB - ROM_LOAD("ts-bios.rom", 0, 0x10000, CRC(b060b0d9) SHA1(820d3539de115141daff220a3cb733fc880d1bab)) + ROM_DEFAULT_BIOS("v2407") + + ROM_SYSTEM_BIOS(0, "v1", "v1") + ROMX_LOAD("ts-bios.rom", 0, 0x10000, CRC(b060b0d9) SHA1(820d3539de115141daff220a3cb733fc880d1bab), ROM_BIOS(0)) + + ROM_SYSTEM_BIOS(1, "v2407", "Update 24.07.28") + ROMX_LOAD("ts-bios.240728.rom", 0, 0x10000, CRC(19f8ad7b) SHA1(9cee82d4a6212686358a50b0fd5a2981b3323ab6), ROM_BIOS(1)) ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS diff --git a/src/mame/sinclair/tsconf.h b/src/mame/sinclair/tsconf.h index 157a5560a175b..70495c250dbf7 100644 --- a/src/mame/sinclair/tsconf.h +++ b/src/mame/sinclair/tsconf.h @@ -16,10 +16,10 @@ #include "tsconfdma.h" #include "beta_m.h" -#include "bus/centronics/ctronics.h" #include "machine/pckeybrd.h" #include "machine/spi_sdcard.h" #include "sound/ay8910.h" +#include "sound/dac.h" #include "tilemap.h" @@ -39,7 +39,7 @@ class tsconf_state : public spectrum_128_state , m_gfxdecode(*this, "gfxdecode") , m_cram(*this, "cram") , m_sfile(*this, "sfile") - , m_centronics(*this, "centronics") + , m_dac(*this, "dac") , m_ay(*this, "ay%u", 0U) , m_mod_ay(*this, "MOD_AY") { @@ -54,6 +54,7 @@ class tsconf_state : public spectrum_128_state virtual void video_start() override ATTR_COLD; virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; + virtual void device_post_load() override ATTR_COLD; virtual TIMER_CALLBACK_MEMBER(irq_off) override; TIMER_CALLBACK_MEMBER(irq_frame); @@ -232,9 +233,9 @@ class tsconf_state : public spectrum_128_state tilemap_t *m_ts_tilemap[3]{}; required_device m_cram; required_device m_sfile; - required_device m_centronics; std::vector m_sprites_cache; + required_device m_dac; required_device_array m_ay; u8 m_ay_selected; required_ioport m_mod_ay; diff --git a/src/mame/sinclair/tsconf_m.cpp b/src/mame/sinclair/tsconf_m.cpp index 518c705af8d51..92f9678fd1776 100644 --- a/src/mame/sinclair/tsconf_m.cpp +++ b/src/mame/sinclair/tsconf_m.cpp @@ -163,7 +163,6 @@ void tsconf_state::tsconf_update_screen(screen_device &screen, bitmap_rgb32 &bit } else { - bitmap.fill(m_palette->pen_color(get_border_color()), cliprect); tsconf_draw_gfx(bitmap, cliprect); } } @@ -253,7 +252,6 @@ void tsconf_state::tsconf_draw_txt(bitmap_rgb32 &bitmap, const rectangle &clipre void tsconf_state::tsconf_draw_gfx(bitmap_rgb32 &bitmap, const rectangle &cliprect) { u8 pal_offset = m_regs[PAL_SEL] << 4; - const rgb_t transparent = m_palette->pen_color(0); for (u16 vpos = cliprect.top(); vpos <= cliprect.bottom(); vpos++) { u16 y_offset = (OFFS_512(G_Y_OFFS_L) + m_gfx_y_frame_offset + vpos) & 0x1ff; @@ -275,19 +273,11 @@ void tsconf_state::tsconf_draw_gfx(bitmap_rgb32 &bitmap, const rectangle &clipre video_location -= 256; u8 pix = *video_location++; rgb_t pen = m_palette->pen_color(pal_offset | (pix >> 4)); - if (pen != transparent) - { - *bm = pen; - } - bm++; + *bm++ = pen; if (width != 1) { pen = m_palette->pen_color(pal_offset | (pix & 0x0f)); - if (pen != transparent) - { - *bm = pen; - } - bm++; + *bm++ = pen; } } } @@ -298,11 +288,7 @@ void tsconf_state::tsconf_draw_gfx(bitmap_rgb32 &bitmap, const rectangle &clipre if (x_offset == 512) video_location -= 512; rgb_t pen = m_palette->pen_color(*video_location++); - if (pen != transparent) - { - *bm = pen; - } - bm++; + *bm++ = pen; } } } @@ -441,18 +427,18 @@ void tsconf_state::ram_page_write(u8 page, offs_t offset, u8 data) if (ram_addr >= PAGE4K(m_regs[SG_PAGE] & 0xf8) && ram_addr < PAGE4K((m_regs[SG_PAGE] & 0xf8) + 8)) m_gfxdecode->gfx(TM_SPRITES)->mark_all_dirty(); - m_ram->write(ram_addr, data); + m_ram->pointer()[ram_addr] = data; } u16 tsconf_state::ram_read16(offs_t offset) { - return (m_ram->read(offset & ~offs_t(1)) << 8) | m_ram->read(offset | 1); + return (m_ram->pointer()[offset & ~offs_t(1)] << 8) | m_ram->pointer()[offset | 1]; } void tsconf_state::ram_write16(offs_t offset, u16 data) { ram_page_write(0, offset & ~offs_t(1), data >> 8); - ram_page_write(0, offset | 1, data & 0xff); + m_ram->pointer()[offset | 1] = data & 0xff; } u16 tsconf_state::spi_read16() @@ -514,7 +500,7 @@ void tsconf_state::tsconf_port_7ffd_w(u8 data) void tsconf_state::tsconf_ula_w(offs_t offset, u8 data) { spectrum_ula_w(offset, data); - tsconf_port_xxaf_w(BORDER << 8, (data & 0x07) | (m_regs[PAL_SEL] << 4)); + tsconf_port_xxaf_w(BORDER << 8, 0xf0 | (data & 0x07)); } u8 tsconf_state::tsconf_port_xxaf_r(offs_t port) @@ -828,7 +814,9 @@ IRQ_CALLBACK_MEMBER(tsconf_state::irq_vector) { u8 vector = 0xff; if (m_int_mask & 1) + { m_int_mask &= ~1; + } else if (m_int_mask & 2) { m_int_mask &= ~2; @@ -841,7 +829,7 @@ IRQ_CALLBACK_MEMBER(tsconf_state::irq_vector) } if (!m_int_mask) - m_maincpu->set_input_line(0, CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); return vector; } @@ -849,8 +837,6 @@ IRQ_CALLBACK_MEMBER(tsconf_state::irq_vector) TIMER_CALLBACK_MEMBER(tsconf_state::irq_off) { m_int_mask &= ~1; - if (!m_int_mask) - m_maincpu->set_input_line(0, CLEAR_LINE); } void tsconf_state::update_frame_timer() @@ -862,10 +848,14 @@ void tsconf_state::update_frame_timer() { next = m_screen->time_until_pos(vpos, hpos << 1); if (next >= m_screen->frame_period()) + { next = attotime::zero; + } } else + { next = attotime::never; + } m_frame_irq_timer->adjust(next); } @@ -881,8 +871,7 @@ void tsconf_state::dma_ready(int line) { if (BIT(m_regs[INT_MASK], 2)) { - if (!m_int_mask) - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); m_int_mask |= 4; } } @@ -891,8 +880,7 @@ TIMER_CALLBACK_MEMBER(tsconf_state::irq_frame) { if (BIT(m_regs[INT_MASK], 0)) { - if (!m_int_mask) - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); m_int_mask |= 1; } @@ -902,8 +890,7 @@ TIMER_CALLBACK_MEMBER(tsconf_state::irq_scanline) { if (BIT(m_regs[INT_MASK], 1)) { - if (!m_int_mask) - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); m_int_mask |= 2; } diff --git a/src/mame/sinclair/tsconfdma.cpp b/src/mame/sinclair/tsconfdma.cpp index 854e8a64b5fe6..69f0dbbb4fd73 100644 --- a/src/mame/sinclair/tsconfdma.cpp +++ b/src/mame/sinclair/tsconfdma.cpp @@ -4,11 +4,17 @@ TS-Conf (ZX-Evolution) DMA Controller +TODO: +* Each memory cycle aligned to 7MHz clock and taking 1 tick + **********************************************************************/ #include "emu.h" #include "tsconfdma.h" +#define VERBOSE ( LOG_GENERAL ) +#include "logmacro.h" + tsconfdma_device::tsconfdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TSCONF_DMA, tag, owner, clock), m_in_mreq_cb(*this, 0), @@ -36,11 +42,16 @@ void tsconfdma_device::device_start() save_item(NAME(m_m2)); save_item(NAME(m_asz)); save_item(NAME(m_task)); + save_item(NAME(m_tx_s_addr)); + save_item(NAME(m_tx_d_addr)); + save_item(NAME(m_tx_data)); + save_item(NAME(m_tx_block_num)); + save_item(NAME(m_tx_block)); } void tsconfdma_device::device_reset() { - m_dma_clock->adjust(attotime::never); + m_dma_clock->reset(); m_block_num = 0; m_ready = ASSERT_LINE; @@ -98,9 +109,12 @@ void tsconfdma_device::set_block_num_h(u8 num_h) m_block_num = (m_block_num & 0x00ff) | ((num_h & 0x03) << 8); } -void tsconfdma_device::start_tx(u8 dev, bool s_align, bool d_align, bool align_opt) +void tsconfdma_device::start_tx(u8 task, bool s_align, bool d_align, bool align_opt) { - m_task = dev; + if (!m_ready) + LOG("Starting new tx without previous completed\n"); + + m_task = task; m_align_s = s_align; m_align_d = d_align; m_asz = align_opt; @@ -109,127 +123,90 @@ void tsconfdma_device::start_tx(u8 dev, bool s_align, bool d_align, bool align_o m_m2 = m_asz ? 0x0001ff : 0x0000ff; m_ready = CLEAR_LINE; - // TODO Transfers 2 byte/cycle at 7MHz - m_dma_clock->adjust(attotime::from_ticks(m_block_num + 1, 7_MHz_XTAL)); + m_tx_block_num = 0; + m_tx_block = 0; + m_dma_clock->adjust(attotime::from_ticks(1, clock() / 6), 0, attotime::from_ticks(1, clock() / 6)); } TIMER_CALLBACK_MEMBER(tsconfdma_device::dma_clock) { + if (m_tx_block == 0) + { + m_tx_s_addr = m_address_s; + m_tx_d_addr = m_address_d; + } + switch (m_task) { case 0b0001: // Mem -> Mem - for (u16 block = 0; block <= m_block_num; block++) - { - auto s_addr = m_address_s; - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) - { - m_out_mreq_cb(d_addr, m_in_mreq_cb(s_addr)); - s_addr = m_align_s ? ((s_addr & m_m1) | ((s_addr + 2) & m_m2)) : ((s_addr + 2) & 0x3fffff); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); - } - m_address_s = m_align_s ? (m_address_s + m_align) : s_addr; - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; - } + m_out_mreq_cb(m_tx_d_addr, m_in_mreq_cb(m_tx_s_addr)); break; case 0b0010: // SPI -> Mem - for (u16 block = 0; block <= m_block_num; block++) - { - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) - { - m_out_mreq_cb(d_addr, m_in_mspi_cb()); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); - } - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; - } + m_out_mreq_cb(m_tx_d_addr, m_in_mspi_cb()); break; case 0b0100: // Fill - for (u16 block = 0; block <= m_block_num; block++) + if (!m_tx_block_num && !m_tx_block) { - u16 data = m_in_mreq_cb(m_address_s); - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) - { - m_out_mreq_cb(d_addr, data); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); - } - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; + m_tx_data = m_in_mreq_cb(m_address_s); } + m_out_mreq_cb(m_tx_d_addr, m_tx_data); break; case 0b1001: // Blt -> Mem - for (u16 block = 0; block <= m_block_num; block++) { - auto s_addr = m_address_s; - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) + u16 d_val = m_in_mreq_cb(m_tx_d_addr); + u16 s_val = m_in_mreq_cb(m_tx_s_addr); + if (m_asz) { - u16 d_val = m_in_mreq_cb(d_addr); - u16 s_val = m_in_mreq_cb(s_addr); - if (m_asz) - { - d_val = (d_val & 0xff00) | (((s_val & 0x00ff) ? s_val : d_val) & 0x00ff); - d_val = (d_val & 0x00ff) | (((s_val & 0xff00) ? s_val : d_val) & 0xff00); - } - else - { - d_val = (d_val & 0xfff0) | (((s_val & 0x000f) ? s_val : d_val) & 0x000f); - d_val = (d_val & 0xff0f) | (((s_val & 0x00f0) ? s_val : d_val) & 0x00f0); - d_val = (d_val & 0xf0ff) | (((s_val & 0x0f00) ? s_val : d_val) & 0x0f00); - d_val = (d_val & 0x0fff) | (((s_val & 0xf000) ? s_val : d_val) & 0xf000); - } - m_out_mreq_cb(d_addr, d_val); - s_addr = m_align_s ? ((s_addr & m_m1) | ((s_addr + 2) & m_m2)) : ((s_addr + 2) & 0x3fffff); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); + d_val = (d_val & 0xff00) | (((s_val & 0x00ff) ? s_val : d_val) & 0x00ff); + d_val = (d_val & 0x00ff) | (((s_val & 0xff00) ? s_val : d_val) & 0xff00); } - m_address_s = m_align_s ? (m_address_s + m_align) : s_addr; - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; + else + { + d_val = (d_val & 0xfff0) | (((s_val & 0x000f) ? s_val : d_val) & 0x000f); + d_val = (d_val & 0xff0f) | (((s_val & 0x00f0) ? s_val : d_val) & 0x00f0); + d_val = (d_val & 0xf0ff) | (((s_val & 0x0f00) ? s_val : d_val) & 0x0f00); + d_val = (d_val & 0x0fff) | (((s_val & 0xf000) ? s_val : d_val) & 0xf000); + } + m_out_mreq_cb(m_tx_d_addr, d_val); } break; case 0b1100: // RAM -> CRAM - for (u16 block = 0; block <= m_block_num; block++) - { - auto s_addr = m_address_s; - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) - { - m_out_cram_cb(d_addr, m_in_mreq_cb(s_addr)); - s_addr = m_align_s ? ((s_addr & m_m1) | ((s_addr + 2) & m_m2)) : ((s_addr + 2) & 0x3fffff); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); - } - m_address_s = m_align_s ? (m_address_s + m_align) : s_addr; - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; - } + m_out_cram_cb(m_tx_d_addr, m_in_mreq_cb(m_tx_s_addr)); break; case 0b1101: // RAM -> SFILE - for (u16 block = 0; block <= m_block_num; block++) - { - auto s_addr = m_address_s; - auto d_addr = m_address_d; - for (u16 len = 0; len <= m_block_len; len++) - { - m_out_sfile_cb(d_addr, m_in_mreq_cb(s_addr)); - s_addr = m_align_s ? ((s_addr & m_m1) | ((s_addr + 2) & m_m2)) : ((s_addr + 2) & 0x3fffff); - d_addr = m_align_d ? ((d_addr & m_m1) | ((d_addr + 2) & m_m2)) : ((d_addr + 2) & 0x3fffff); - } - m_address_s = m_align_s ? (m_address_s + m_align) : s_addr; - m_address_d = m_align_d ? (m_address_d + m_align) : d_addr; - } + m_out_sfile_cb(m_tx_d_addr, m_in_mreq_cb(m_tx_s_addr)); break; default: - logerror("'tsdma': TX %02X: %06X (%02X:%04X) -> %06X\n", m_task, m_address_s, m_block_len, m_block_num, m_address_d); + LOG("Unknown task %02X: %06X (%02X:%04X) -> %06X\n", m_task, m_address_s, m_block_len, m_block_num, m_address_d); + m_tx_block_num = m_block_num; + m_tx_block = m_block_len; break; } - m_dma_clock->adjust(attotime::never); - m_ready = ASSERT_LINE; - m_on_ready_cb(0); + m_tx_s_addr = m_align_s ? ((m_tx_s_addr & m_m1) | ((m_tx_s_addr + 2) & m_m2)) : ((m_tx_s_addr + 2) & 0x3fffff); + m_tx_d_addr = m_align_d ? ((m_tx_d_addr & m_m1) | ((m_tx_d_addr + 2) & m_m2)) : ((m_tx_d_addr + 2) & 0x3fffff); + + ++m_tx_block; + if (m_tx_block > m_block_len) + { + m_address_s = m_align_s ? (m_address_s + m_align) : m_tx_s_addr; + m_address_d = m_align_d ? (m_address_d + m_align) : m_tx_d_addr; + + m_tx_block = 0; + ++m_tx_block_num; + if (m_tx_block_num > m_block_num) + { + m_dma_clock->reset(); + m_ready = ASSERT_LINE; + m_on_ready_cb(1); + } + } } // device type definition diff --git a/src/mame/sinclair/tsconfdma.h b/src/mame/sinclair/tsconfdma.h index 843ee84bcde5b..387dc2e3c7c3e 100644 --- a/src/mame/sinclair/tsconfdma.h +++ b/src/mame/sinclair/tsconfdma.h @@ -34,11 +34,11 @@ class tsconfdma_device : public device_t void set_block_len(uint8_t len); void set_block_num_l(uint8_t num_l); void set_block_num_h(uint8_t num_h); - void start_tx(uint8_t dev, bool s_align, bool d_align, bool blitting_opt); + void start_tx(uint8_t task, bool s_align, bool d_align, bool blitting_opt); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; devcb_read16 m_in_mreq_cb; devcb_write16 m_out_mreq_cb; @@ -57,6 +57,12 @@ class tsconfdma_device : public device_t u8 m_block_len; u16 m_block_num; + offs_t m_tx_s_addr; + offs_t m_tx_d_addr; + u16 m_tx_data; + u16 m_tx_block_num; + u16 m_tx_block; + emu_timer *m_dma_clock; u8 m_task; bool m_align_s; diff --git a/src/mame/skeleton/attache.cpp b/src/mame/skeleton/attache.cpp index 2ddcfeb7e9273..8834691e4c317 100644 --- a/src/mame/skeleton/attache.cpp +++ b/src/mame/skeleton/attache.cpp @@ -139,9 +139,6 @@ class attache_state : public driver_device uint8_t dma_mem_r(offs_t offset); void dma_mem_w(offs_t offset, uint8_t data); - uint8_t fdc_dma_r(); - void fdc_dma_w(uint8_t data); - void hreq_w(int state); void eop_w(int state); [[maybe_unused]] void fdc_dack_w(int state); @@ -190,6 +187,7 @@ class attache_state : public driver_device uint8_t memmap_r(); void memmap_w(uint8_t data); + void set_latch(uint8_t data); void operation_strobe(uint8_t data); void keyboard_clock_w(bool state); uint8_t keyboard_data_r(); @@ -554,6 +552,16 @@ uint8_t attache_state::pio_portB_r() return ret; } +void attache_state::set_latch(uint8_t data) +{ + m_pio_latch = data; + m_rom_active = ~data & 0x04; + m_floppy0->mon_w((data & 0x01) ? 0 : 1); + m_floppy1->mon_w((data & 0x01) ? 0 : 1); + m_gfx_enabled = data & 0x02; + // TODO: display brightness +} + void attache_state::operation_strobe(uint8_t data) { //logerror("PIO: Port A write operation %i, data %02x\n",m_pio_select,data); @@ -590,12 +598,7 @@ void attache_state::operation_strobe(uint8_t data) logerror("CMOS: write %01x to byte %02x (read)\n",data & 0x0f, m_cmos_select); break; case PIO_SEL_LATCH: - m_pio_latch = data; - m_rom_active = ~data & 0x04; - m_floppy0->mon_w((data & 0x01) ? 0 : 1); - m_floppy1->mon_w((data & 0x01) ? 0 : 1); - m_gfx_enabled = data & 0x02; - // TODO: display brightness + set_latch(data); break; case PIO_SEL_NOP: logerror("PIO: NOP write\n"); @@ -779,17 +782,6 @@ void attache_state::dma_mask_w(uint8_t data) m_dma->write(0x0f,data); } -uint8_t attache_state::fdc_dma_r() -{ - uint8_t ret = m_fdc->dma_r(); - return ret; -} - -void attache_state::fdc_dma_w(uint8_t data) -{ - m_fdc->dma_w(data); -} - uint8_t attache_state::dma_mem_r(offs_t offset) { return m_maincpu->space(AS_PROGRAM).read_byte(offset); @@ -1113,6 +1105,7 @@ void attache_state::machine_start() void attache_state::machine_reset() { m_kb_bitpos = 0; + set_latch(0); } void attache816_state::machine_reset() @@ -1175,8 +1168,8 @@ void attache_state::attache(machine_config &config) m_dma->out_eop_callback().set(FUNC(attache_state::eop_w)); m_dma->in_memr_callback().set(FUNC(attache_state::dma_mem_r)); m_dma->out_memw_callback().set(FUNC(attache_state::dma_mem_w)); - m_dma->in_ior_callback<0>().set(FUNC(attache_state::fdc_dma_r)); - m_dma->out_iow_callback<0>().set(FUNC(attache_state::fdc_dma_w)); + m_dma->in_ior_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_r)); + m_dma->out_iow_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_w)); // m_dma->out_dack_callback<0>().set(FUNC(attache_state::fdc_dack_w)); UPD765A(config, m_fdc, 8_MHz_XTAL, true, true); @@ -1264,8 +1257,8 @@ void attache816_state::attache816(machine_config &config) m_dma->out_eop_callback().set(FUNC(attache_state::eop_w)); m_dma->in_memr_callback().set(FUNC(attache_state::dma_mem_r)); m_dma->out_memw_callback().set(FUNC(attache_state::dma_mem_w)); - m_dma->in_ior_callback<0>().set(FUNC(attache_state::fdc_dma_r)); - m_dma->out_iow_callback<0>().set(FUNC(attache_state::fdc_dma_w)); + m_dma->in_ior_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_r)); + m_dma->out_iow_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_w)); // m_dma->out_dack_callback<0>().set(FUNC(attache_state::fdc_dack_w)); UPD765A(config, m_fdc, 8_MHz_XTAL, true, true); diff --git a/src/mame/skeleton/boramz80.cpp b/src/mame/skeleton/boramz80.cpp index b590e7e332432..fafcd9dbbdb73 100644 --- a/src/mame/skeleton/boramz80.cpp +++ b/src/mame/skeleton/boramz80.cpp @@ -46,6 +46,8 @@ class boramz80_state : public driver_device void pk(machine_config &config) ATTR_COLD; + void init_tpkborama(); + protected: virtual void video_start() override ATTR_COLD; @@ -261,8 +263,50 @@ ROM_START( tpkboram ) ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(4a293afa) SHA1(be532e6a476f78638e7f558bf8093e1914bc3688) ) ROM_END +// this runs on a newer ATPK-BORAM PK-0500 PCB. Given all GFX match tpkboram, it's probably a newer revision. +// code is encrypted +ROM_START( tpkborama ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "223.rom", 0x0000, 0x8000, CRC(1d776d37) SHA1(6918cddb0b47d28cf8145823f869dfd2296c0eed) ) + + ROM_REGION( 0x4000, "chars", 0 ) // these are same as tpkboram + ROM_LOAD( "1.cg1", 0x0000, 0x2000, CRC(69f44d04) SHA1(2f98805e4b70ce3426078f35ff260a3bc97fab86) ) + ROM_LOAD( "2.cg2", 0x2000, 0x2000, CRC(c1adf009) SHA1(0d5d8b39d40c807b9b5ed7418ba871c4d683286a) ) + + ROM_REGION( 0x40000, "tiles", 0 ) // these are all 1st and 2nd half identical, but same as tpkboram if split + ROM_LOAD( "3.pg1", 0x00000, 0x8000, CRC(612c5b39) SHA1(9682167b1fbbcd34b71c2628641b646a2993f61b) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "4.pg2", 0x08000, 0x8000, CRC(14ee6437) SHA1(a046b3efb14a400d201f7ce1c3ee0e01badb46a6) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "5.pg3", 0x10000, 0x8000, CRC(ce87f0c5) SHA1(96379856182bb0c81c805906551ec2e4aa2eb1d5) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "6.pg4", 0x18000, 0x8000, CRC(0a8a6106) SHA1(ac88f1ef2eb39cd24a236b2f18e85367c0736ae8) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "7.pg5", 0x20000, 0x8000, CRC(484a0eec) SHA1(6e32da2d4d78fb4c4bae2d2da945a71231051d5f) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "8.pg6", 0x28000, 0x8000, CRC(772d8996) SHA1(bd0412d0656a26a80b0f00ff5d6bcff2c4adb6c7) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "9.pg7", 0x30000, 0x8000, CRC(ff052a99) SHA1(7523ab2eeef1e44107710c8a68897daa7bf2ce12) ) + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(61a4e0f3) SHA1(8d9f0efd3b691eaf93c933c63ba6aa34ebad71b1) ) + ROM_IGNORE( 0x8000 ) +ROM_END + + +void boramz80_state::init_tpkborama() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x8000; i++) + { + // TODO + rom[i] = rom[i]; + } +} + } // anonymous namespace -GAME( 1987, pkboram, 0, pk, pkboram, boramz80_state, empty_init, ROT0, "Boram", "PK - New Exciting Poker!", MACHINE_IS_SKELETON ) // PK-BORAM 0211 aug.04.1987. BORAM CORP -GAME( 1988, tpkboram, 0, pk, tpkboram, boramz80_state, empty_init, ROT0, "Boram", "Turbo PK", MACHINE_IS_SKELETON ) // PK-TURBO jan.29.1988. BORAM CORP. +GAME( 1987, pkboram, 0, pk, pkboram, boramz80_state, empty_init, ROT0, "Boram", "PK - New Exciting Poker!", MACHINE_IS_SKELETON ) // PK-BORAM 0211 aug.04.1987. BORAM CORP +GAME( 1988, tpkboram, 0, pk, tpkboram, boramz80_state, empty_init, ROT0, "Boram", "Turbo PK", MACHINE_IS_SKELETON ) // PK-TURBO jan.29.1988. BORAM CORP. +GAME( 1998, tpkborama, tpkboram, pk, tpkboram, boramz80_state, init_tpkborama, ROT0, "Boram", "Turbo PK (Ver 2.3B2, encrypted)", MACHINE_IS_SKELETON ) // dep inctype-23B1998 0519Ver 2.3B2 diff --git a/src/mame/skeleton/cxhumax.cpp b/src/mame/skeleton/cxhumax.cpp index 5c32f100af3da..ad931cc4d494e 100644 --- a/src/mame/skeleton/cxhumax.cpp +++ b/src/mame/skeleton/cxhumax.cpp @@ -95,7 +95,7 @@ void cxhumax_state::cx_gxa_w(offs_t offset, uint32_t data, uint32_t mem_mask) if((m_intctrl_regs[INTREG(INTGROUP2, INTIRQ)] & m_intctrl_regs[INTREG(INTGROUP2, INTENABLE)]) || (m_intctrl_regs[INTREG(INTGROUP1, INTIRQ)] & m_intctrl_regs[INTREG(INTGROUP1, INTENABLE)])) - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); break; default: @@ -298,7 +298,7 @@ TIMER_CALLBACK_MEMBER(cxhumax_state::timer_tick) /* Interrupt if Timer interrupt is not masked in ITC_INTENABLE_REG */ if (m_intctrl_regs[INTREG(INTGROUP2, INTENABLE)] & INT_TIMER_BIT) - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } } attotime period = attotime::from_hz(XTAL(54'000'000))*m_timer_regs.timer[param].timebase; @@ -394,7 +394,7 @@ void cxhumax_state::cx_uart2_w(offs_t offset, uint32_t data, uint32_t mem_mask) /* If INT is enabled at INT Ctrl raise it */ if(m_intctrl_regs[INTREG(INTGROUP1, INTENABLE)]&INT_UART2_BIT) { - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } } } @@ -525,9 +525,9 @@ void cxhumax_state::cx_intctrl_w(offs_t offset, uint32_t data, uint32_t mem_mask /* check if */ if((m_intctrl_regs[INTREG(INTGROUP2, INTIRQ)] & m_intctrl_regs[INTREG(INTGROUP2, INTENABLE)]) || (m_intctrl_regs[INTREG(INTGROUP1, INTIRQ)] & m_intctrl_regs[INTREG(INTGROUP1, INTENABLE)])) - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); else - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } @@ -711,7 +711,7 @@ void cxhumax_state::cx_i2c1_w(offs_t offset, uint32_t data, uint32_t mem_mask) m_intctrl_regs[INTREG(INTGROUP1, INTSTATSET)] |= 1<<7; if (m_intctrl_regs[INTREG(INTGROUP1, INTENABLE)] & (1<<7)) { LOG("%s: (I2C1) Int\n", machine().describe_context()); - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } break; case I2C_STAT_REG: diff --git a/src/mame/skeleton/cxhumax.h b/src/mame/skeleton/cxhumax.h index d94b4245e1fc7..a502321a8da57 100644 --- a/src/mame/skeleton/cxhumax.h +++ b/src/mame/skeleton/cxhumax.h @@ -6,9 +6,8 @@ #pragma once #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" -#include "machine/intelfsh.h" #include "machine/i2cmem.h" +#include "machine/intelfsh.h" #include "machine/terminal.h" diff --git a/src/mame/skeleton/design.cpp b/src/mame/skeleton/design.cpp index 7634cdb5b8bbb..aa067db226998 100644 --- a/src/mame/skeleton/design.cpp +++ b/src/mame/skeleton/design.cpp @@ -354,9 +354,9 @@ ROM_START( designe ) ROM_END -// Different Azkoyen vending machines on similar hardware +// Different Azkoyen tobacco vending machines on similar hardware -/* Azkoyen models T6, T8, and T12 (Azkoyen PCB 104-4455-02-80/1). MCS-48-based. Unknown display. +/* Azkoyen models T6, T8, and T12 (Azkoyen PCB 104-4455-02-80/1). MCS-48-based. ___________________________________________________________ | __________ | _|_ ___ | BATT | _|_ @@ -377,13 +377,16 @@ _|_ | NEC D8279C-5 | |____________| =| |= |..| | | | | =| | |__| |__| =| |__________________________________________________________| + */ +// T6 uses a 4 digits 7-segments display. ROM_START( azkoyent6 ) ROM_REGION(0x2000, "maincpu", 0) ROM_LOAD("43504560-0_t-6.u04", 0x0000, 0x2000, CRC(a4289b26) SHA1(40587094b11c6cf9308673ffac2ed9d445d458e9)) ROM_END +// T8 uses a 3 digits 7-segments display. ROM_START( azkoyent8 ) ROM_REGION(0x2000, "maincpu", 0) ROM_LOAD("43504570-2_t8_3.u04", 0x0000, 0x2000, CRC(76ac54bf) SHA1(da4c4a9f1c9c85d59169d62682bb7b73a9dd133b)) diff --git a/src/mame/skeleton/digiblast.cpp b/src/mame/skeleton/digiblast.cpp index baac494ecf2fe..d9de05fcd336c 100644 --- a/src/mame/skeleton/digiblast.cpp +++ b/src/mame/skeleton/digiblast.cpp @@ -10,7 +10,6 @@ #include "bus/generic/slot.h" #include "bus/generic/carts.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/s3c2410.h" #include "emupal.h" diff --git a/src/mame/skeleton/dyna_d0404.cpp b/src/mame/skeleton/dyna_d0404.cpp new file mode 100644 index 0000000000000..734720e9bd39a --- /dev/null +++ b/src/mame/skeleton/dyna_d0404.cpp @@ -0,0 +1,204 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Dyna D0404 PCB + +This PCB is newer hardware than the one is misc/cb2001.cpp, possibly the next one. +It seems Dyna got rid of some legacy features like physical DIPs, color PROMs and AY sound. +While the CPU is sanded off, ROM seems to contain valid ARM code. +Currently unknown what produces the sound. + +The main components are: +208-pin custom (sanded off). MCU/CPU? +176-pin custom (sanded off). GFX? +4x AMIC LP61 1024S-12 SRAM or equivalent (for CPU?) +2x IDT71024 SRAM or equivalent (for GFX?) +2x A625308AM-70S SRAM or equivalent (for GFX?) +24.000 MHz XTAL +2x LH28F800SGE-L70 or equivalent flash ROMs +2x GAL16V8D +Oki M62X42B RTC +*/ + + +#include "emu.h" + +#include "cpu/arm7/arm7.h" +#include "machine/msm6242.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class dyna_d0404_state : public driver_device +{ +public: + dyna_d0404_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void dyna_d0404(machine_config &config); + +protected: + virtual void video_start() override; + +private: + required_device m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map); +}; + + +uint32_t dyna_d0404_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + + return 0; +} + +void dyna_d0404_state::video_start() +{ +} + + +void dyna_d0404_state::program_map(address_map &map) +{ + map(0x00000000, 0x000fffff).rom(); +} + + +static INPUT_PORTS_START( cm2005 ) + PORT_START("IN0") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static GFXDECODE_START( gfx_dyna_d0404 ) + // TODO +GFXDECODE_END + + +void dyna_d0404_state::dyna_d0404(machine_config &config) +{ + ARM7(config, m_maincpu, 24_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &dyna_d0404_state::program_map); + + MSM6242(config, "rtc", 32.768_kHz_XTAL); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 64*8); + screen.set_visarea(0, 64*8-1, 0, 32*8-1); + screen.set_screen_update(FUNC(dyna_d0404_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_dyna_d0404); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + // sound hardware + SPEAKER(config, "mono").front_center(); + // TODO: identify +} + + +ROM_START( cm2005 ) // DYNA CM2005 VER. 1.10U at 0xc0000 in ROM + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "a29800uv.11b", 0x000000, 0x100000, CRC(b86c6953) SHA1(73c78a2529abad6aa61fda8285c172bdb6c380cd) ) + + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD( "a29800uv.12b", 0x000000, 0x100000, CRC(c1ae3e9a) SHA1(6cf883b586e074f7517aef4db1c7b006d0ed8df6) ) + + ROM_REGION( 0x80000, "plds", 0 ) // read as 27C020, need reduction + ROM_LOAD( "gal16v8.10a", 0x00000, 0x40000, CRC(a9f2655a) SHA1(07d9b767b5929bbeac917697ac618c293206bf72) ) + ROM_LOAD( "gal16v8.10b", 0x40000, 0x40000, CRC(d8320940) SHA1(a65973fefaff03696cdbb60a02bfb5e352254951) ) +ROM_END + +ROM_START( cm2005a ) // DYNA CM2005 VER. 1.02U at 0xc0000 in ROM + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "lh28f800.11b", 0x000000, 0x100000, CRC(f567782c) SHA1(6138d3170dc4505e1ab2444f26e76e56d5393444) ) + + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD( "lh28f800.12b", 0x000000, 0x100000, CRC(c1ae3e9a) SHA1(6cf883b586e074f7517aef4db1c7b006d0ed8df6) ) + + ROM_REGION( 0x80000, "plds", 0 ) // read as 27C020, need reduction + ROM_LOAD( "gal16v8.10a", 0x00000, 0x40000, CRC(a9f2655a) SHA1(07d9b767b5929bbeac917697ac618c293206bf72) ) + ROM_LOAD( "gal16v8.10b", 0x40000, 0x40000, CRC(d8320940) SHA1(a65973fefaff03696cdbb60a02bfb5e352254951) ) +ROM_END + +ROM_START( cm2005b ) // DYNA CM2005 VER. 0.14H at 0xc0000 in ROM + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "lh28f800.11b", 0x000000, 0x100000, CRC(1af9c956) SHA1(77daffbb8279098218e8401260363af9de4b1d7f) ) // SLDH + + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD( "lh28f800.12b", 0x000000, 0x100000, CRC(74163225) SHA1(14853e347e4e439166e218cd2713e372c871a984) ) // SLDH + + ROM_REGION( 0x80000, "plds", 0 ) // read as 27C020, need reduction + ROM_LOAD( "gal16v8.10a", 0x00000, 0x40000, CRC(a9f2655a) SHA1(07d9b767b5929bbeac917697ac618c293206bf72) ) + ROM_LOAD( "gal16v8.10b", 0x40000, 0x40000, CRC(d8320940) SHA1(a65973fefaff03696cdbb60a02bfb5e352254951) ) +ROM_END + +} // anonymous namespace + + +GAME( 2005, cm2005, 0, dyna_d0404, cm2005, dyna_d0404_state, empty_init, ROT0, "Dyna", "Cherry Master 2005 (Ver. 1.10U)", MACHINE_IS_SKELETON ) +GAME( 2005, cm2005a, cm2005, dyna_d0404, cm2005, dyna_d0404_state, empty_init, ROT0, "Dyna", "Cherry Master 2005 (Ver. 1.02U)", MACHINE_IS_SKELETON ) +GAME( 2005, cm2005b, cm2005, dyna_d0404, cm2005, dyna_d0404_state, empty_init, ROT0, "Dyna", "Cherry Master 2005 (Ver. 0.14H)", MACHINE_IS_SKELETON ) diff --git a/src/mame/skeleton/easy_karaoke.cpp b/src/mame/skeleton/easy_karaoke.cpp index f2a12428dc97e..6d7cd3035872c 100644 --- a/src/mame/skeleton/easy_karaoke.cpp +++ b/src/mame/skeleton/easy_karaoke.cpp @@ -82,7 +82,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" @@ -164,7 +163,7 @@ void easy_karaoke_cartslot_state::machine_start() void ivl_karaoke_state::machine_reset() { - m_maincpu->set_state_int(ARM7_R15, 0x04000000); + m_maincpu->set_state_int(arm7_cpu_device::ARM7_R15, 0x04000000); } DEVICE_IMAGE_LOAD_MEMBER(easy_karaoke_cartslot_state::cart_load) diff --git a/src/mame/skeleton/gm1000.cpp b/src/mame/skeleton/gm1000.cpp index 4704cd6e99807..7433aead16d5e 100644 --- a/src/mame/skeleton/gm1000.cpp +++ b/src/mame/skeleton/gm1000.cpp @@ -2,7 +2,7 @@ // copyright-holders:AJR /******************************************************************************* - Skeleton driver for Suzuki BH-1000/Hammond GM-1000 sound module. + Skeleton driver for Nihon Eniac BH-1000/Hammond GM-1000 sound module. *******************************************************************************/ @@ -106,6 +106,18 @@ void gm1000_state::gm1000(machine_config &config) lcdc.set_function_set_at_any_time(true); } +ROM_START(bh1000) + ROM_REGION16_LE(0x40000, "program", 0) + ROM_LOAD16_BYTE("bh1_mgs71a__u6_sysl__v2.1_bf66.u6", 0x00000, 0x20000, CRC(d003880c) SHA1(5cf727c42dd1b903c0048f147b461676e8c35faf)) // MX27C1000-90 + ROM_LOAD16_BYTE("bh1_mgs71a__u7_sysh__v2.1_2fac.u7", 0x00001, 0x20000, CRC(989417a1) SHA1(3de4f10a2e7cde5eb93f04bd75db36e194b1d991)) // MX27C1000-90 + + ROM_REGION(0x800000, "waves", 0) // DIP42 mask ROMs "© SUZUKI 1993". + ROM_LOAD("319-35006_wd06__m531602c-53.u13", 0x000000, 0x200000, CRC(AFCEA840) SHA1(F003B19B83560191BEF03D0D2C1559D77BDAA227)) + ROM_LOAD("319-35007_wd07__m531602c-52.u14", 0x200000, 0x200000, CRC(1F322DDB) SHA1(5F3B1BE61782B74E4696D23CD551AA07EB709BB7)) + ROM_LOAD("319-35008_wd08__m531602c-54.u15", 0x200000, 0x200000, CRC(BE9C158B) SHA1(878B08ACE7B54FA27180C9C45D4B90C04B4BB656)) + ROM_LOAD("319-35009_wd09__m531602c-55.u16", 0x200000, 0x200000, CRC(DEE0B84A) SHA1(C528131182D24C42C9D64D3B7F811FD8FE88C3E5)) +ROM_END + ROM_START(gm1000) ROM_REGION16_LE(0x40000, "program", 0) ROM_LOAD16_BYTE("bh1_mgs71a__u6_sysl__v2.1_bf66.u6", 0x00000, 0x20000, CRC(d003880c) SHA1(5cf727c42dd1b903c0048f147b461676e8c35faf)) // MX27C1000-90 @@ -120,4 +132,5 @@ ROM_END } // anonymous namespace +SYST(1994, bh1000, 0, 0, gm1000, gm1000, gm1000_state, empty_init, "NIHON ENIAC CO.,LTD.", "Sound Saurus BH-1000", MACHINE_IS_SKELETON) SYST(1994, gm1000, 0, 0, gm1000, gm1000, gm1000_state, empty_init, "Suzuki (Hammond license)", "GM-1000 GM Sound Module", MACHINE_IS_SKELETON) diff --git a/src/mame/skeleton/i7000.cpp b/src/mame/skeleton/i7000.cpp index eb65cb3c8e880..abb15ecf4c980 100644 --- a/src/mame/skeleton/i7000.cpp +++ b/src/mame/skeleton/i7000.cpp @@ -45,7 +45,7 @@ #include "emu.h" #include "bus/generic/carts.h" #include "bus/generic/slot.h" -#include "cpu/z80/z80.h" //CPU was actually a NSC800 (Z80 compatible) +#include "cpu/z80/nsc800.h" #include "machine/i8279.h" #include "machine/pit8253.h" #include "sound/spkrdev.h" diff --git a/src/mame/skeleton/koto_zevio.cpp b/src/mame/skeleton/koto_zevio.cpp index 292bcf5dbe274..d26fcce813576 100644 --- a/src/mame/skeleton/koto_zevio.cpp +++ b/src/mame/skeleton/koto_zevio.cpp @@ -1,12 +1,11 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -// The Zevio SoC was developed by Koto Laboratory, the same company behind the Wonderswan +// The Zevio SoC was developed by Koto Laboratory, the same company behind the Wonderswan #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "screen.h" #include "speaker.h" @@ -98,16 +97,22 @@ void zevio_state::zevio(machine_config &config) } +// ドラゴンボールZ スカウターバトル体感かめはめ波 おらとおめえとスカウター +ROM_START( dbzscout ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "mr27t6402l.ic6", 0x000000, 0x800000, CRC(9cb896d6) SHA1(4185ee4593c2ef3b637f6004d1f80dadd4530902) ) +ROM_END + ROM_START( dbzonep ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASEFF ) ROM_LOAD( "mr27t6402l.u1", 0x000000, 0x800000, CRC(57f7c319) SHA1(65118a9c61defc75cefe5e45062c0a4788e2a26c) ) // original dump had the first 0x100 bytes repeated again at the end, why? ROM_REGION( 0x800, "eeprom", ROMREGION_ERASEFF ) - ROM_LOAD( "s24cs16a.u6", 0x000000, 0x800, CRC(a1724ea8) SHA1(93a6f73e30f47b6a0c83f62dfd9d8236473518a8) ) + ROM_LOAD( "s24cs16a.u6", 0x000000, 0x800, CRC(a1724ea8) SHA1(93a6f73e30f47b6a0c83f62dfd9d8236473518a8) ) ROM_END } // anonymous namespace -// 2007 - Dragon Ball Z: Scouter Battle Taikan Kamehameha: Ora to Omee to Scouter +CONS( 2007, dbzscout, 0, 0, zevio, zevio, zevio_state, empty_init, "Bandai / Koto", "Dragon Ball Z: Scouter Battle Taikan Kamehameha: Ora to Omee to Scouter (Japan)", MACHINE_IS_SKELETON ) CONS( 2008, dbzonep, 0, 0, zevio, zevio, zevio_state, empty_init, "Bandai / Koto", "Dragon Ball Z x One Piece: Battle Taikan Gum-Gum no Kamehameha: Omee no Koe de Ora o Yobu (Japan)", MACHINE_IS_SKELETON ) diff --git a/src/mame/skeleton/pap2.cpp b/src/mame/skeleton/pap2.cpp new file mode 100644 index 0000000000000..f00c4f0248f2c --- /dev/null +++ b/src/mame/skeleton/pap2.cpp @@ -0,0 +1,99 @@ +/* + +Linksys PAP2 two-port analog telephone adapter + +ESS Visba 3 ES3890F @ 27MHz (CPU/MCU) +Realtek RTL8019AS (NIC) +ICSI IC41LV16100S-50KG (2MB RAM) +SST39VF080-70-4C-EI (1MB flash ROM) +2x Silicon Labs Si3210-KT (line interfaces) + +Four of the five LEDs are controlled by ES3890F GPIOs +Power LEDs are connected to AUX1[4] and AUX1[5] (pin 112 and 113) +Phone 1 LED is connected to AUX1[6] (pin 114) +Phone 2 LED is connected to AUX1[7] (pin 115) +Ethernet LED is connected to RTL8019AS somehow + +RTL8019AS pin 65 is tied to VDD to disable PnP +RTL8019AS pin 96 is tied to ground to share the flash ROM's 8-bit data bus +RTL8019AS registers are selected when ES3890F pin 19 (/CS1) is low +It looks like the RTL8019AS EEPROM pins are connected to ES3890F AUX2[0-3]? + + +There are several ATAs based on essentially the same hardware: + +Sipura SPA-2000 +Sipura SPA-1000 +Sipura SPA-3000 (ES3890F, RTL8019AS, 2MB RAM, 1MB flash, unknown line interfaces) +Sipura SPA-1001 (ES3890F, RTL8019AS, 2MB RAM, 1MB flash, 1x Si3210) +Sipura SPA-2100 (Sipura SIP316F @ 27MHz, 2x RTL8019AS, 8MB RAM, 2MB flash, unknown line interfaces) +Sipura SPA-2002 +Linksys PAP2T (ES3890F, RTL8019AS, 2MB RAM, 1MB flash, 2x Si3215) +Linksys SPA2102? + +There are also ATAs with similar names but probably very different hardware: + +Linksys PAP2 V2 +Cisco SPA112 +Cisco SPA122 + +*/ + +#include "emu.h" + +#include "cpu/mipsx/mipsx.h" + + +namespace { + +class pap2_state : public driver_device + +{ +public: + pap2_state(machine_config const &mconfig, device_type type, char const *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { + } + + void pap2(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_reset() override; + +private: + required_device m_maincpu; + + void mem(address_map &map); +}; + + +void pap2_state::machine_reset() +{ + m_maincpu->set_state_int(STATE_GENPC, 0x1cffff80); // might actually be 0x7fffff80 with a ROM mirror +} + +void pap2_state::mem(address_map &map) +{ + map(0x00000000, 0x001fffff).ram(); + map(0x1c000000, 0x1c0fffff).mirror(0x00f00000).rom().region("maincpu", 0); + // ES3890F registers at 0x20000000-0x2000ffff, ES6008 datasheet could be helpful +} + +void pap2_state::pap2(machine_config &config) +{ + MIPSX(config, m_maincpu, 27'000'000); + m_maincpu->set_addrmap(AS_PROGRAM, &pap2_state::mem); +} + +INPUT_PORTS_START(pap2) +INPUT_PORTS_END + +ROM_START(pap2) + ROM_REGION32_BE(0x100000, "maincpu", 0 ) + ROM_LOAD("linksys-pap2-2.0.12-ls_rom dump of pap2 flash chip.rom", 0x000000, 0x100000, BAD_DUMP CRC(4d0f1e5d) SHA1(73b163b00a3709a14f7419283c8515dd91009598) ) +ROM_END + +} + +SYST( 200?, pap2, 0, 0, pap2, pap2, pap2_state, empty_init, "Linksys (Cisco)", "PAP2", MACHINE_IS_SKELETON ) diff --git a/src/mame/skeleton/pullttrigger.cpp b/src/mame/skeleton/pullttrigger.cpp index 41444b81c3675..e23ee1c91af89 100644 --- a/src/mame/skeleton/pullttrigger.cpp +++ b/src/mame/skeleton/pullttrigger.cpp @@ -91,4 +91,4 @@ ROM_END } // anonymous namespace -COMP(2003, pullttrig, 0, 0, pullttrig, pullttrig, pullttrig_state, empty_init, "Digital Silkroad", "Pull The Trigger", MACHINE_IS_SKELETON ) +GAME(2003, pullttrig, 0, pullttrig, pullttrig, pullttrig_state, empty_init, ROT0, "Digital Silkroad", "Pull The Trigger", MACHINE_IS_SKELETON) diff --git a/src/mame/skeleton/sansa_fuze.cpp b/src/mame/skeleton/sansa_fuze.cpp index 945f7805aca36..b4f00e3c9e095 100644 --- a/src/mame/skeleton/sansa_fuze.cpp +++ b/src/mame/skeleton/sansa_fuze.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" namespace { diff --git a/src/mame/skeleton/syvg.cpp b/src/mame/skeleton/syvg.cpp new file mode 100644 index 0000000000000..417ec68ff5642 --- /dev/null +++ b/src/mame/skeleton/syvg.cpp @@ -0,0 +1,164 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +SYVG (Shyh-Yuan VideoGames / Shyh-Yuan Electronics - spelt Shih Yuan on some stickers) + +Z80 or Z180 based MCU (164 pin, correct arch / model currently unknown); +CPLD (84 pin, model currently unknown); +UT6264CPCL-70LL SRAM; +UT61256JC-12 SRAM; +2x SB61H1024AS-12 SRAM; +U6295 +21.0000 MHz XTAL + +PCB has no evident marking. One sticker: 15.75KHz (CGA) + +*/ + + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "sound/okim6295.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class syvg_state : public driver_device +{ +public: + syvg_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void syvg(machine_config &config); + + void init_luckyvl(); + +protected: + virtual void video_start() override; + +private: + required_device m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map); +}; + + +uint32_t syvg_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + + return 0; +} + +void syvg_state::video_start() +{ +} + + +void syvg_state::program_map(address_map &map) +{ + map(0x0000, 0xffff).rom(); +} + + +static INPUT_PORTS_START( luckyvl ) + 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 ) + + // no DSWs on PCB +INPUT_PORTS_END + + +static GFXDECODE_START( gfx_syvg ) + // TODO +GFXDECODE_END + + +void syvg_state::syvg(machine_config &config) +{ + Z80(config, m_maincpu, 21_MHz_XTAL / 4); // divider not verified + m_maincpu->set_addrmap(AS_PROGRAM, &syvg_state::program_map); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 64*8); + screen.set_visarea(0, 64*8-1, 0, 32*8-1); + screen.set_screen_update(FUNC(syvg_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_syvg); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 21_MHz_XTAL / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // TODO: divider and pin 7 not verified +} + + +ROM_START( luckyvl ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "lucky-v-line_202.u19", 0x00000, 0x20000, CRC(fe5aa9a6) SHA1(a64a5c2a74109595c5e37a6f12b7556a3a167d04) ) // encrypted + + ROM_REGION( 0x100000, "gfx", 0 ) + ROM_LOAD16_BYTE( "lucky-v-line.u5", 0x00000, 0x80000, CRC(06916190) SHA1(af172259058eb39df8e559e848236e312fe70af2) ) // FIXED BITS (xxxxxxx0) + ROM_LOAD16_BYTE( "lucky-v-line.u6", 0x00001, 0x80000, CRC(48cf0795) SHA1(baabf1cb0b658bddf8f5dfbf7752dc7f41dcbc93) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "lucky-v-line_sound.u17", 0x00000, 0x40000, CRC(dd548bf9) SHA1(7aa0a772b98dbfee27a4f437f5723075b44d3cb7) ) +ROM_END + + +void syvg_state::init_luckyvl() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x20000; i++) + { + // TODO + rom[i] = rom[i]; + } +} + +} // anonymous namespace + + +GAME( 2003, luckyvl, 0, syvg, luckyvl, syvg_state, init_luckyvl, ROT0, "Shyh-Yuan Electronics", "Lucky V Line", MACHINE_IS_SKELETON ) diff --git a/src/mame/skeleton/webtouchone.cpp b/src/mame/skeleton/webtouchone.cpp index 6406bccd0edb3..c0efa40468e99 100644 --- a/src/mame/skeleton/webtouchone.cpp +++ b/src/mame/skeleton/webtouchone.cpp @@ -4,7 +4,7 @@ /* Skeleton driver for Alcatel Web Touch One. More information and technical manuals: https://www.minitel-alcatel.fr/gamme_webphone.html - The phone asks for an adminstrative password for performing a factory reset. + The phone asks for an administrative password for performing a factory reset. Hardware info for model 2840: -CPU: Motorola PowerPC 823 diff --git a/src/mame/skeleton/xor100.cpp b/src/mame/skeleton/xor100.cpp index 709b4576de971..82ae418bab603 100644 --- a/src/mame/skeleton/xor100.cpp +++ b/src/mame/skeleton/xor100.cpp @@ -32,7 +32,7 @@ Note some of the commands are a bit buggy, eg F doesn't fill the last byte TODO: - Fix floppy. It needs to WAIT the cpu whenever port 0xFC is read, wait for either DRQ or INTRQ to assert, then release the cpu and then do the - actual port read. Our Z80 cannot do that. + actual port read. - The only available disks crash MAME when loaded. - honor jumper settings - CTC signal header @@ -280,7 +280,7 @@ uint8_t xor100_state::fdc_wait_r() { if (!m_fdc_irq && !m_fdc_drq) { - m_maincpu->set_input_line(Z80_INPUT_LINE_BOGUSWAIT, ASSERT_LINE); + //m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE); } } @@ -640,7 +640,7 @@ void xor100_state::xor100(machine_config &config) // S-100 S100_BUS(config, m_s100, 8_MHz_XTAL / 4); - m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_BOGUSWAIT); + //m_s100->rdy().set_inputline(m_maincpu, Z80_INPUT_LINE_WAIT); S100_SLOT(config, S100_TAG ":1", xor100_s100_cards, nullptr); S100_SLOT(config, S100_TAG ":2", xor100_s100_cards, nullptr); S100_SLOT(config, S100_TAG ":3", xor100_s100_cards, nullptr); diff --git a/src/mame/skeleton/zfirenze.cpp b/src/mame/skeleton/zfirenze.cpp new file mode 100644 index 0000000000000..a0636bec0f6e6 --- /dev/null +++ b/src/mame/skeleton/zfirenze.cpp @@ -0,0 +1,108 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Skeleton driver for Z80-based Necta/Zanussi vending machines. + + Zanussi / Necta Firenze vending machine: + + MAIN PCB + __________________________________________________________________________________________ + | ······ ··········· ········· ········· ······ ::::::::::::: ::::::::::::: | + | __________ ___ __________ __________ ___ ___ ___ ___ ___ ___ | + | |__DS1229_| SN76176BP |74HC374AN| |TD62083AP| |__| |__| |__| |__| |__| |__| <- 6 x TLP504A + | ___ ___ ___ ___ ___ __________ __________ ___ ·| + | SN76176BP |<- 4 x TLP504A ->| |_GET_GAL_| |ULN2062B_| TLP504A ·| + | __________ __________ __________ __________ __________ ___ | + | |CD74HCT86E |74HC374AN| |74HCT244B1 |MM74HCT138N CD74HC125E TLP504A ·| + | __________ ·| + | |MM74HC163N SPEAKER LED LED ·| + | __________ _____ __________ __________ ____ ____ ·| + | ____ |SCAN-GAL_| DIPSx4 |DS1238-10| |M74HC04B1| 93C66N 93C66N | + | MIC2940A __________ Xtal ______________ ·| + | |_________| ??? MHz |M5M5256CP-70LL | + | __________ _________ |_____________| | + | |M74HC32B1| __________ |TOSHIBA | | + | __________ __________ |_D48-GAL_| |TMPZ84C015BF-8 ·············· | + ||MM74HCT8N| |_KEY-GAL_| __________ | | E1 | + | |OKI 6242B | | ·············· | + | ············· Osc |_________| | + |______________??? MHz____________________________________________________________________| + + SCHEDA EXPANSIONE MEMORIA EPROM 6735-354-00 (connected to the main PCB EPROM socket E1) + _____________________________________________ + | ______________ ______________ | + | | EPROM A | | EPROM C | | + | |_____________| |_____________| | + | __________ __________ | + | |M74HC02B1| |PC74HC08T| ·············· | + | __________ __________ J1 | + | |M74HC32B1| |PC74HC08T| ·············· | + |____________________________________________| + +*/ + +#include "emu.h" +#include "cpu/z80/tmpz84c015.h" +#include "machine/msm6242.h" + +namespace { + +class zfirenze_state : public driver_device +{ +public: + zfirenze_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void zfirenze(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; +}; + +void zfirenze_state::machine_start() +{ +} + +void zfirenze_state::machine_reset() +{ +} + +static INPUT_PORTS_START( zfirenze ) + PORT_START("DSW0") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW0:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW0:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW0:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW0:4") +INPUT_PORTS_END + +void zfirenze_state::zfirenze(machine_config &config) +{ + TMPZ84C015(config, m_maincpu, XTAL(8'000'000)); // Toshiba TMPZ84C015BF-8, unknown clock + + MSM6242(config, "rtc", XTAL(32'768'000)); // OKI M6242B, unknown clock +} + +ROM_START( zfirenze ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "951200-1_firenze_c6m_a_8e00_20-01-95.u6", 0x00000, 0x10000, CRC(1ca85d3d) SHA1(4cb30a83b8c20eac7b31dd4fe5c79dfca6815dc8) ) + ROM_LOAD( "951200-2_firenze_c6m_c_8e00_20-01-95.u5", 0x10000, 0x10000, CRC(0107bb35) SHA1(1317d1055b9f9d05a4103612779059e84c4ac16e) ) + + ROM_REGION( 0x117, "plds", 0 ) + ROM_LOAD( "d48_gal_palce16v8h-25.u15", 0x000, 0x117, CRC(7467d098) SHA1(2085cccd4049ba07a1fafc1f16680e1aa8c8bb96) ) + ROM_LOAD( "get_gal_palce16v8h-25.u9", 0x000, 0x117, CRC(b4d4f0e1) SHA1(6a741e08082c46759a5eda914a91f7d18ef9128f) ) + ROM_LOAD( "key_gal_palce16v8h-25.u25", 0x000, 0x117, CRC(b52825d1) SHA1(b820c73929b03320378a4625ee4451bd81e9c5aa) ) + ROM_LOAD( "scan_gal_palce16v8h-25.u28", 0x000, 0x117, CRC(2dbb9247) SHA1(d80085bd5e9d17231a24c83797751a15b0440462) ) +ROM_END + + +} // anonymous namespace + + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +SYST( 1995, zfirenze, 0, 0, zfirenze, zfirenze, zfirenze_state, empty_init, "Zanussi / Necta", "Firenze (vending machine)", MACHINE_IS_SKELETON ) diff --git a/src/mame/skeleton/zvenezia.cpp b/src/mame/skeleton/zvenezia.cpp new file mode 100644 index 0000000000000..ac900d67fdb40 --- /dev/null +++ b/src/mame/skeleton/zvenezia.cpp @@ -0,0 +1,164 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Skeleton driver for MCS51-based Necta/Zanussi vending machines. + + Zanussi / Necta Venezia coffee vending machine (same PCB found also on other models, like Brio): + +CPU PCB (6735-365-02) + _______________________________________________________________________________________________________ + | ·· ··········· ·············· | + | ____ | + | T2512NH ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ | + | RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY RLY <- 17 relays + | ___ ___ _________ _________ _________ _________ _________ ___ _________ | + | LM393N LM393N |TD62083AP |74HC273AN |74HC273AN |74HC273AN |TD62083AP ADM692AN |74HC373N| | + | ___ _________ _________ _________ _______________ | + | ___ 67WR1K |74HC244N| |GAL16V8B| |_DIPSx8_| | mS6264L-10PC | | + | LM3578AN ____ _________ _________ _________ |______________| | + | LM340T12 HEAT LED |MM74HC14N |HIN232CP| |74HC244N| _______________ | + | RUN LED _________ _________ | EPROM | | + | |MM74HC14N |P80C32EBAA |______________| | + | | | Xtal ____ | + | |________| 11.0592 MHz 93C56N | + | ... ....... .......... ....... ......... EEPROM | + |______________________________________________________________________________________________________| + +KEYBOARD / DISPLAY PCB (4 digits, there are version with five) + _______________________________________ + |· ___ ___ ___ ___ ____ | + |· |__| |__| |__| |__| | || + |· |__|. |__|. |__|. |__|. | |<-Unknown MCU + | | || + |· ____ ____ | || + |· LED |SW6 | |SW1 | LED | || + |· |____| |____| | || + |· ____ ____ |____|| + |· LED |SW7 | |SW2 | LED | + | |____| |____| · | + |· ____ ____ · | + | LED |SW8 | |SW3 | LED · | + | D |____| |____| | + | B ____ ____ | + | 9 LED |SW9 | |SW4 | LED ____ | + | |____| |____| |PIP | | + |·· ____ ____ |____| | + |.. LED |SW10| |SW5 | LED | + |· |____| |____| | + |______________________________________| + +*/ + +#include "emu.h" +#include "cpu/mcs51/mcs51.h" +#include "machine/eepromser.h" + +namespace { + +class zvenezia_state : public driver_device +{ +public: + zvenezia_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void zvenezia(machine_config &config); + void zunknecta(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; +}; + +void zvenezia_state::machine_start() +{ +} + +void zvenezia_state::machine_reset() +{ +} + +static INPUT_PORTS_START( zvenezia ) + PORT_START("DSW0") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW0:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW0:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW0:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW0:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW0:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW0:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW0:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW0:8") +INPUT_PORTS_END + +static INPUT_PORTS_START( zunknecta ) +INPUT_PORTS_END + +void zvenezia_state::zvenezia(machine_config &config) +{ + I80C32(config, m_maincpu, 11.0592_MHz_XTAL); // Philips P80C32EBAA + + EEPROM_93C56_8BIT(config, "eeprom"); +} + +void zvenezia_state::zunknecta(machine_config &config) +{ + P80C552(config, m_maincpu, 12_MHz_XTAL); // Philips PCB 80C552-5 16WP +} + +ROM_START( zvenezia ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "venezia_rev_1.40_ife_14-04-95.u7", 0x00000, 0x10000, CRC(e03d9bf1) SHA1(ca728d754841993c818b5505fd3de66b3b9df13b) ) + + ROM_REGION( 0x117, "plds", 0 ) + ROM_LOAD( "gal16v8b.bin", 0x000, 0x117, NO_DUMP ) +ROM_END + + +/* Unknown Necta / Zanussi vending machine model: + + MAIN PCB (6735-360-00) + _____________________________________________________________________ + | _________ _________ | + | ··· _____ .. |PCF8574P| M74HC540B1 .. | + | ··· · RELAY .. _________ _________ _________ .. | + | ··· · _____ .. |PCF8574P| |PCF8574P| |PCF8574P| .. | + | · RELAY .. _________ _________ _________ .. | + | ··· ·· ___ .. M74HC541B1 M74HC541B1 M74HC541B1 .. | + | ___ ·· M0C3020 _________ _________ :| + | M0C3020 ·· |74HC00N_| |74HC00N_| :| + | · ___ ___ ________ ________ ________ ________ :| + | · |<-RELAY | |ULN2064B |ULN2064B |ULN2064B |ULN2064B | + | · | | |<-RELAY :| + | · |__| |__| :| + | ······· ······· ······ ······ ··········· ·········· ······· :| + |____________________________________________________________________| + + CPU PCB + ________________________________________________ + | ___________ ___________ | + | .. |M74HC541B1| |M74HC541B1| .. | + | .. ____________ _____________ .. | + | .. |Philips | | EPROM | .. | + | .. _____ |80C552-5 | |_____________| .. | + | .. Xtal | | __________ .. | + | 12 MHz |___________| |GD74HC273| | + | _________ _________ ____ ____ | + | M74HC141B1 PC74HC74P DS75176BN DS75176BN | + |_________________________________···· ·····____| + +*/ +ROM_START( zunknecta ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "prg-io_v1.1_marzo_92.u3", 0x0000, 0x8000, CRC(0a45a803) SHA1(a32f68bfc1532c6b7cc35517f408210aab962767) ) +ROM_END + +} // anonymous namespace + + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +SYST( 1995, zvenezia, 0, 0, zvenezia, zvenezia, zvenezia_state, empty_init, "Zanussi / Necta", "Venezia (coffee vending machine)", MACHINE_IS_SKELETON ) +SYST( 1992, zunknecta, 0, 0, zunknecta, zunknecta, zvenezia_state, empty_init, "Zanussi / Necta", "unknown Zanussi / Necta vending machine", MACHINE_IS_SKELETON ) diff --git a/src/mame/snk/snk.cpp b/src/mame/snk/snk.cpp index 014d7b159a812..1f69a180a18c0 100644 --- a/src/mame/snk/snk.cpp +++ b/src/mame/snk/snk.cpp @@ -1110,7 +1110,7 @@ hand, always returning 0xf inbetween valid values confuses the game. *****************************************************************************/ template -CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary) +ioport_value snk_state::gwar_rotary() { int value = m_rot_io[Which]->read(); @@ -1126,7 +1126,7 @@ CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary) } template -CUSTOM_INPUT_MEMBER(snk_state::gwarb_rotary) +ioport_value snk_state::gwarb_rotary() { if (m_joymode_io->read() == 1) { @@ -1173,12 +1173,12 @@ void snk_state::countryc_trackball_w(uint8_t data) m_countryc_trackball = data & 1; } -CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_x) +ioport_value snk_state::countryc_trackball_x() { return m_trackball_x_io[m_countryc_trackball]->read(); } -CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y) +ioport_value snk_state::countryc_trackball_y() { return m_trackball_y_io[m_countryc_trackball]->read(); } @@ -1187,7 +1187,7 @@ CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y) /************************************************************************/ template -CUSTOM_INPUT_MEMBER(snk_state::snk_bonus_r) +ioport_value snk_state::snk_bonus_r() { switch (Mask) { diff --git a/src/mame/snk/snk.h b/src/mame/snk/snk.h index 1c8fa9198703b..5bd6558013f6d 100644 --- a/src/mame/snk/snk.h +++ b/src/mame/snk/snk.h @@ -64,11 +64,11 @@ class snk_state : public driver_device void madcrush(machine_config &config); int sound_busy_r(); - template DECLARE_CUSTOM_INPUT_MEMBER(gwar_rotary); - template DECLARE_CUSTOM_INPUT_MEMBER(gwarb_rotary); - DECLARE_CUSTOM_INPUT_MEMBER(countryc_trackball_x); - DECLARE_CUSTOM_INPUT_MEMBER(countryc_trackball_y); - template DECLARE_CUSTOM_INPUT_MEMBER(snk_bonus_r); + template ioport_value gwar_rotary(); + template ioport_value gwarb_rotary(); + ioport_value countryc_trackball_x(); + ioport_value countryc_trackball_y(); + template ioport_value snk_bonus_r(); protected: virtual void machine_start() override; diff --git a/src/mame/snk/snk6502.cpp b/src/mame/snk/snk6502.cpp index e9fb4625dab66..88b5c8d7ff6ea 100644 --- a/src/mame/snk/snk6502.cpp +++ b/src/mame/snk/snk6502.cpp @@ -322,7 +322,7 @@ void snk6502_state::sasuke_start_counter() * *************************************/ -CUSTOM_INPUT_MEMBER(snk6502_state::sasuke_count_r) +ioport_value snk6502_state::sasuke_count_r() { return (m_sasuke_counter >> 4); } diff --git a/src/mame/snk/snk6502.h b/src/mame/snk/snk6502.h index c826150057dea..e4bd990a43ace 100644 --- a/src/mame/snk/snk6502.h +++ b/src/mame/snk/snk6502.h @@ -36,7 +36,7 @@ class snk6502_state : public driver_device void satansat(machine_config &config); void sasuke(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(sasuke_count_r); + ioport_value sasuke_count_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); DECLARE_VIDEO_START(pballoon); diff --git a/src/mame/sony/news_r3k.cpp b/src/mame/sony/news_r3k.cpp index a0931967d7af0..cca02ed93d86b 100644 --- a/src/mame/sony/news_r3k.cpp +++ b/src/mame/sony/news_r3k.cpp @@ -2,52 +2,44 @@ // copyright-holders:Patrick Mackinlay /* - * Sony NEWS R3000 systems. + * Sony NEWS R3000 single-processor systems. * * Sources: * - https://github.com/robohack/ucb-csrg-bsd/blob/master/sys/news3400/ * - https://www.mmcc.it/resources/docs/NWS-3410_3460_ServiceManual_MMCC.PDF * - https://www.mmcc.it/resources/docs/Sony_NEWS_NWS-3260_ROM_Monitor_User_Guide_r2.pdf + * - http://bitsavers.org/pdf/sony/news/Sony_NEWS_Technical_Manual_3ed_199103.pdf * * TODO: - * - lcd controller - * - screen params + * - LCD controller + * - screen timing parameters * - floppy density/eject - * - centronics port + * - Centronics port * - sound * - other models, including slots/cards */ #include "emu.h" -#include "cpu/mips/mips1.h" - -// memory -#include "machine/ram.h" - -// various hardware -#include "machine/timekpr.h" -#include "machine/z80scc.h" -#include "machine/am79c90.h" -#include "machine/upd765.h" #include "dmac_0448.h" #include "news_hid.h" -#include "machine/cxd1185.h" -// video -#include "screen.h" - -// audio -#include "sound/spkrdev.h" -#include "speaker.h" - -// busses and connectors -#include "machine/nscsi_bus.h" #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" #include "bus/rs232/rs232.h" - +#include "cpu/mips/mips1.h" #include "imagedev/floppy.h" +#include "machine/am79c90.h" +#include "machine/cxd1185.h" +#include "machine/nscsi_bus.h" +#include "machine/ram.h" +#include "machine/timekpr.h" +#include "machine/upd765.h" +#include "machine/z80scc.h" +#include "sound/spkrdev.h" + +#include "screen.h" +#include "speaker.h" #define VERBOSE 0 #include "logmacro.h" @@ -176,20 +168,21 @@ class nws3260_state : public news_r3k_base_state bool m_lcd_dim = false; }; -class nws3410_state : public news_r3k_base_state +class news_r3k_desktop_state : public news_r3k_base_state { public: static constexpr feature_type unemulated_features() { return feature::GRAPHICS; } - nws3410_state(machine_config const &mconfig, device_type type, char const *tag) + news_r3k_desktop_state(machine_config const &mconfig, device_type type, char const *tag) : news_r3k_base_state(mconfig, type, tag) { } void nws3410(machine_config &config); + void nws3720(machine_config &config); protected: - void nws3410_map(address_map &map); + void desktop_cpu_map(address_map &map); }; void nws3260_state::machine_start() @@ -249,9 +242,14 @@ void nws3260_state::nws3260_map(address_map &map) map(0x1ff60000, 0x1ff6001b).lw8([this] (offs_t offset, u8 data) { LOG("crtc offset %x 0x%02x\n", offset, data); }, "lfbm_crtc_w"); // TODO: HD64646FS } -void nws3410_state::nws3410_map(address_map &map) +void news_r3k_desktop_state::desktop_cpu_map(address_map &map) { cpu_map(map); + + // LCD framebuffer memory regions - without bus errors, the framebuffer probe logic in NEWS-OS will think there is an LCD attached + // While this doesn't break anything, it does cause the device to be exposed when it isn't present. + map(0x10000000, 0x1021ffff).r(FUNC(news_r3k_desktop_state::bus_error)); + map(0x1ff50000, 0x1ff6001b).r(FUNC(news_r3k_desktop_state::bus_error)); } void news_r3k_base_state::cpu_map(address_map &map) @@ -270,7 +268,7 @@ void news_r3k_base_state::cpu_map(address_map &map) // 1fcc0000 // cstrobe? // 1fcc0002 // sccstatus0? map(0x1fcc0003, 0x1fcc0003).rw(FUNC(news_r3k_base_state::debug_r), FUNC(news_r3k_base_state::debug_w)); - // 1fcc0007 // sccvect? + map(0x1fcc0007, 0x1fcc0007).lr8([this] () { return m_scc->m1_r(); }, "sccvect_r"); map(0x1fd00000, 0x1fd00007).m(m_hid, FUNC(news_hid_hle_device::map)); map(0x1fd40000, 0x1fd40003).noprw(); // FIXME: ignore buzzer for now @@ -323,7 +321,7 @@ static INPUT_PORTS_START(nws3260) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) INPUT_PORTS_END -static INPUT_PORTS_START(nws3410) +static INPUT_PORTS_START(nws_r3k_desktop) PORT_START("SW2") PORT_DIPNAME(0x07000000, 0x02000000, "Console") PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING(0x00000000, "Serial") @@ -570,11 +568,11 @@ void nws3260_state::nws3260(machine_config &config) m_lcd->set_screen_update(FUNC(nws3260_state::screen_update)); } -void nws3410_state::nws3410(machine_config &config) +void news_r3k_desktop_state::nws3410(machine_config &config) { R3000A(config, m_cpu, 20_MHz_XTAL, 65536, 65536); m_cpu->set_fpu(mips1_device_base::MIPS_R3010Av4); - m_cpu->set_addrmap(AS_PROGRAM, &nws3410_state::nws3410_map); + m_cpu->set_addrmap(AS_PROGRAM, &news_r3k_desktop_state::desktop_cpu_map); // Per the service manual, one or more NWA-029 4MB expansion kits can be used to increase from the base 8M up to 16M RAM(config, m_ram); @@ -585,9 +583,24 @@ void nws3410_state::nws3410(machine_config &config) m_serial[0]->set_default_option("terminal"); // No framebuffer emulation yet } +void news_r3k_desktop_state::nws3720(machine_config &config) +{ + R3000A(config, m_cpu, 20_MHz_XTAL, 65536, 65536); + m_cpu->set_fpu(mips1_device_base::MIPS_R3010Av4); + m_cpu->set_addrmap(AS_PROGRAM, &news_r3k_desktop_state::desktop_cpu_map); + + // 16MB expandable to 128MB (unknown increments) + RAM(config, m_ram); + m_ram->set_default_size("16M"); + m_ram->set_extra_options("128MB"); + common(config); + + m_serial[0]->set_default_option("terminal"); // No framebuffer emulation yet +} + ROM_START(nws3260) ROM_REGION32_BE(0x20000, "eprom", 0) - ROM_SYSTEM_BIOS(0, "nws3260", "NWS-3260 v2.0A") + ROM_SYSTEM_BIOS(0, "nws3260", "SONY NET WORK STATION R3000 Monitor Release 2.0A") ROMX_LOAD("mpu-16__ver.2.0a__1990_sony.ic64", 0x00000, 0x20000, CRC(61222991) SHA1(076fab0ad0682cd7dacc7094e42efe8558cbaaa1), ROM_BIOS(0)) // 2 x MB834200A-20 (4Mb mask ROM) @@ -613,16 +626,26 @@ ROM_END ROM_START(nws3410) ROM_REGION32_BE(0x20000, "eprom", 0) - ROM_SYSTEM_BIOS(0, "nws3410", "NWS-3410 v2.0") + ROM_SYSTEM_BIOS(0, "nws3410", "SONY NET WORK STATION R3000 Monitor Release 2.0") ROMX_LOAD("sony_nws-3410_mpu-12_v2_rom.bin", 0x00000, 0x20000, CRC(48a726c4) SHA1(5c6e9e6bccaaa3d63bc136355a436c17c49c9876), ROM_BIOS(0)) ROM_REGION32_BE(0x100, "idrom", 0) ROM_LOAD("idrom.bin", 0x000, 0x100, CRC(661e2516) SHA1(f0dca34174747321dad6f48c466e1c549b797d2e) BAD_DUMP) ROM_END +ROM_START(nws3720) + ROM_REGION32_BE(0x20000, "eprom", 0) + ROM_SYSTEM_BIOS(0, "nws3720", "SONY NET WORK STATION R3000 Monitor Release 2.0A") + ROMX_LOAD("sony_nws-3720.bin", 0x00000, 0x20000, CRC(61222991) SHA1(076fab0ad0682cd7dacc7094e42efe8558cbaaa1), ROM_BIOS(0)) + + ROM_REGION32_BE(0x100, "idrom", 0) + ROM_LOAD("idrom.bin", 0x000, 0x100, CRC(6ec5860e) SHA1(612d2c2f149b34551b5fd9392dd6f9b1612417b5) BAD_DUMP) +ROM_END + } // anonymous namespace -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP(1991, nws3260, 0, 0, nws3260, nws3260, nws3260_state, init_common, "Sony", "NWS-3260", MACHINE_NO_SOUND) -COMP(1991, nws3410, 0, 0, nws3410, nws3410, nws3410_state, init_common, "Sony", "NWS-3410", MACHINE_NO_SOUND) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP(1991, nws3260, 0, 0, nws3260, nws3260, nws3260_state, init_common, "Sony", "NWS-3260", MACHINE_NO_SOUND) +COMP(1991, nws3410, 0, 0, nws3410, nws_r3k_desktop, news_r3k_desktop_state, init_common, "Sony", "NWS-3410", MACHINE_NO_SOUND) +COMP(1991, nws3720, 0, 0, nws3720, nws_r3k_desktop, news_r3k_desktop_state, init_common, "Sony", "NWS-3720", MACHINE_NO_SOUND) diff --git a/src/mame/sony/pockstat.cpp b/src/mame/sony/pockstat.cpp index 83fb5a682f652..b72d192ba1729 100644 --- a/src/mame/sony/pockstat.cpp +++ b/src/mame/sony/pockstat.cpp @@ -34,7 +34,6 @@ #include "bus/generic/carts.h" #include "bus/generic/slot.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "sound/dac.h" #include "emupal.h" #include "screen.h" @@ -336,21 +335,21 @@ void pockstat_state::set_interrupt_line(uint32_t line, int state) const uint32_t new_irq = m_intc_regs.hold & m_intc_regs.enable & INT_IRQ_MASK; if (new_irq) { - m_maincpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, ASSERT_LINE); } else { - m_maincpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_IRQ_LINE, CLEAR_LINE); } const uint32_t new_fiq = m_intc_regs.hold & m_intc_regs.enable & INT_FIQ_MASK; if (new_fiq) { - m_maincpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, ASSERT_LINE); } else { - m_maincpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); + m_maincpu->set_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, CLEAR_LINE); } } @@ -934,7 +933,7 @@ void pockstat_state::machine_start() void pockstat_state::machine_reset() { - m_maincpu->set_state_int(ARM7_R15, 0x4000000); + m_maincpu->set_state_int(arm7_cpu_device::ARM7_R15, 0x4000000); m_flash_write_enable_count = 0; m_flash_write_count = 0; diff --git a/src/mame/sony/smc777.cpp b/src/mame/sony/smc777.cpp index 90ac6db57d031..297a107cee00c 100644 --- a/src/mame/sony/smc777.cpp +++ b/src/mame/sony/smc777.cpp @@ -21,25 +21,25 @@ #include "emu.h" +#include "cpu/mcs48/mcs48.h" #include "cpu/z80/z80.h" #include "imagedev/floppy.h" #include "imagedev/snapquik.h" +#include "machine/74259.h" #include "machine/timer.h" #include "machine/wd_fdc.h" -#include "softlist_dev.h" #include "sound/beep.h" #include "sound/sn76496.h" #include "video/mc6845.h" #include "emupal.h" #include "screen.h" +#include "softlist_dev.h" #include "speaker.h" namespace { -#define MASTER_CLOCK 4.028_MHz_XTAL - #define mc6845_h_char_total (m_crtc_vreg[0]+1) #define mc6845_h_display (m_crtc_vreg[1]) #define mc6845_h_sync_pos (m_crtc_vreg[2]) @@ -67,6 +67,7 @@ class smc777_state : public driver_device , m_crtc(*this, "crtc") , m_fdc(*this, "fdc") , m_floppy(*this, "fdc:%u", 0U) + , m_ioctrl(*this, "ioctrl") , m_beeper(*this, "beeper") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") @@ -95,6 +96,14 @@ class smc777_state : public driver_device uint8_t io_status_1c_r(); uint8_t io_status_1d_r(); void io_control_w(uint8_t data); + void raminh_w(int state); + void vsup_w(int state); + void screen_lines_w(int state); + void rgb_select_w(int state); + void mt_on_w(int state); + void sound_out_w(int state); + void printer_strb_w(int state); + void cas_out_w(int state); void color_mode_w(uint8_t data); void ramdac_w(offs_t offset, uint8_t data); uint8_t gcw_r(); @@ -125,6 +134,7 @@ class smc777_state : public driver_device required_device m_crtc; required_device m_fdc; required_device_array m_floppy; + required_device m_ioctrl; required_device m_beeper; required_device m_gfxdecode; required_device m_palette; @@ -143,7 +153,6 @@ class smc777_state : public driver_device uint8_t m_display_reg = 0; uint8_t m_fdc_irq_flag = 0; uint8_t m_fdc_drq_flag = 0; - uint8_t m_system_data = 0; struct { uint8_t r = 0, g = 0, b = 0; } m_pal; uint8_t m_raminh = 0, m_raminh_pending_change = 0; //bankswitch uint8_t m_raminh_prefetch = 0; @@ -410,34 +419,35 @@ QUICKLOAD_LOAD_MEMBER(smc777_state::quickload_cb) { address_space& prog_space = m_maincpu->space(AS_PROGRAM); - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); - - /* The right RAM bank must be active */ - - /* Avoid loading a program if CP/M-80 is not in memory */ + // Avoid loading a program if CP/M-80 is not in memory if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) { machine_reset(); - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); } - /* Load image to the TPA (Transient Program Area) */ + // Check for sufficient RAM based on position of CPM + const int mem_avail = 256 * prog_space.read_byte(7) + prog_space.read_byte(6) - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); + + // Load image to the TPA (Transient Program Area) uint16_t quickload_size = image.length(); for (uint16_t i = 0; i < quickload_size; i++) { uint8_t data; - if (image.fread( &data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - prog_space.write_byte(i+0x100, data); + if (image.fread(&data, 1) != 1) + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + prog_space.write_byte(i + 0x100, data); } - /* clear out command tail */ - prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); + // clear out command tail + prog_space.write_byte(0x80, 0); + prog_space.write_byte(0x81, 0); - /* Roughly set SP basing on the BDOS position */ - m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 300); - m_maincpu->set_pc(0x100); // start program + // Roughly set SP basing on the BDOS position + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } @@ -575,29 +585,50 @@ uint8_t smc777_state::io_status_1d_r() void smc777_state::io_control_w(uint8_t data) { - /* - * flip-flop based - * ---x -111 cassette write - * ---x -110 printer strobe - * ---x -101 beeper - * ---x -100 cassette start (MONITOR_ON_OFF) - * ---x -011 0=RGB 1=Component - * ---x -010 0=525 lines 1=625 lines (NTSC/PAL switch?) - * ---x -001 1=display disable - * ---x -000 ram inibit signal - */ - m_system_data = data; - switch(m_system_data & 0x07) - { - case 0x00: - // "ROM / RAM register change is done at the beginning of the next M1 cycle" - m_raminh_pending_change = ((data & 0x10) >> 4) ^ 1; - m_raminh_prefetch = (uint8_t)(m_maincpu->state_int(Z80_R)) & 0x7f; - break; - case 0x02: printf("Screen line number %d\n",data & 0x10 ? 625 : 525); break; - case 0x05: m_beeper->set_state(data & 0x10); break; - default: printf("System FF W %02x\n",data); break; - } + m_ioctrl->write_bit(data & 0x07, BIT(data, 4)); +} + +void smc777_state::raminh_w(int state) +{ + // "ROM / RAM register change is done at the beginning of the next M1 cycle" + m_raminh_pending_change = state ^ 1; + m_raminh_prefetch = (uint8_t)(m_maincpu->state_int(Z80_R)) & 0x7f; +} + +void smc777_state::vsup_w(int state) +{ + logerror("%s: Display %sabled\n", machine().describe_context(), state ? "dis" : "en"); +} + +void smc777_state::screen_lines_w(int state) +{ + logerror("%s: Screen line number %d\n", machine().describe_context(), state ? 625 : 525); +} + +void smc777_state::rgb_select_w(int state) +{ + // 0=RGB 1=Component + logerror("%s: %s video selected\n", machine().describe_context(), state ? "Component" : "RGB"); +} + +void smc777_state::mt_on_w(int state) +{ + logerror("%s: Cassette monitor %s\n", machine().describe_context(), state ? "on" : "off"); +} + +void smc777_state::sound_out_w(int state) +{ + m_beeper->set_state(state); +} + +void smc777_state::printer_strb_w(int state) +{ + logerror("%s: Printer strobe %d\n", machine().describe_context(), !state); +} + +void smc777_state::cas_out_w(int state) +{ + logerror("%s: Cassette write %d\n", machine().describe_context(), state); } void smc777_state::color_mode_w(uint8_t data) @@ -665,11 +696,11 @@ uint8_t smc777_state::smc777_mem_r(offs_t offset) uint8_t z80_r; // TODO: do the bankswitch AFTER that the prefetch instruction is executed (hackish implementation) - if(m_raminh_prefetch != 0xff) + if(m_raminh_prefetch != 0xff && !machine().side_effects_disabled()) { z80_r = (uint8_t)m_maincpu->state_int(Z80_R); - if(z80_r == ((m_raminh_prefetch+2) & 0x7f)) + if(z80_r == ((m_raminh_prefetch+1) & 0x7f)) { m_raminh = m_raminh_pending_change; m_raminh_prefetch = 0xff; @@ -1104,11 +1135,25 @@ static void smc777_floppies(device_slot_interface &device) void smc777_state::smc777(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 32.2238_MHz_XTAL; + /* basic machine hardware */ - Z80(config, m_maincpu, MASTER_CLOCK); + Z80(config, m_maincpu, MASTER_CLOCK / 8); // nominally 4.028 MHz m_maincpu->set_addrmap(AS_PROGRAM, &smc777_state::smc777_mem); m_maincpu->set_addrmap(AS_IO, &smc777_state::smc777_io); + I8041A(config, "mcu", 6_MHz_XTAL).set_disable(); + + LS259(config, m_ioctrl); + m_ioctrl->q_out_cb<0>().set(FUNC(smc777_state::raminh_w)); + m_ioctrl->q_out_cb<1>().set(FUNC(smc777_state::vsup_w)); + m_ioctrl->q_out_cb<2>().set(FUNC(smc777_state::screen_lines_w)); + m_ioctrl->q_out_cb<3>().set(FUNC(smc777_state::rgb_select_w)); + m_ioctrl->q_out_cb<4>().set(FUNC(smc777_state::mt_on_w)); + m_ioctrl->q_out_cb<5>().set(FUNC(smc777_state::sound_out_w)); + m_ioctrl->q_out_cb<6>().set(FUNC(smc777_state::printer_strb_w)); + m_ioctrl->q_out_cb<7>().set(FUNC(smc777_state::cas_out_w)); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -1122,14 +1167,14 @@ void smc777_state::smc777(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty); - HD6845S(config, m_crtc, MASTER_CLOCK/2); /* HD68A45SP; unknown clock, hand tuned to get ~60 fps */ + HD6845S(config, m_crtc, MASTER_CLOCK / 16); // HD68A45SP; unknown clock, hand tuned to get ~60 fps m_crtc->set_screen(m_screen); m_crtc->set_show_border_area(true); m_crtc->set_char_width(8); m_crtc->out_vsync_callback().set(FUNC(smc777_state::vsync_w)); // floppy controller - MB8876(config, m_fdc, 1_MHz_XTAL); + MB8876(config, m_fdc, MASTER_CLOCK / 32); // divider not confirmed m_fdc->intrq_wr_callback().set(FUNC(smc777_state::fdc_intrq_w)); m_fdc->drq_wr_callback().set(FUNC(smc777_state::fdc_drq_w)); @@ -1143,7 +1188,7 @@ void smc777_state::smc777(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - SN76489A(config, "sn1", MASTER_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.50); // unknown clock / divider + SN76489A(config, "sn1", MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "mono", 0.50); // unknown clock / divider BEEP(config, m_beeper, 300); // TODO: correct frequency m_beeper->add_route(ALL_OUTPUTS, "mono", 0.50); diff --git a/src/mame/stern/berzerk.cpp b/src/mame/stern/berzerk.cpp index 69008fed939bf..63dc11d479321 100644 --- a/src/mame/stern/berzerk.cpp +++ b/src/mame/stern/berzerk.cpp @@ -607,7 +607,7 @@ void berzerk_state::audio_w(offs_t offset, uint8_t data) /* clock control - the first LS161 divides the clock by 9 to 16, the 2nd by 8, giving a final clock from 19.5kHz to 34.7kHz */ int clock_divisor = 16 - (data & 0x07); - m_s14001a->set_clock(S14001_CLOCK / clock_divisor / 8); + m_s14001a->set_unscaled_clock(S14001_CLOCK / clock_divisor / 8); break; } diff --git a/src/mame/subsino/subsino.cpp b/src/mame/subsino/subsino.cpp index d01e641c196da..b53674bcedaf6 100644 --- a/src/mame/subsino/subsino.cpp +++ b/src/mame/subsino/subsino.cpp @@ -226,6 +226,7 @@ To Do: #include "subsino_crypt.h" #include "cpu/z180/hd647180x.h" +#include "cpu/z80/z80.h" #include "machine/i8255.h" #include "machine/nvram.h" #include "machine/ticket.h" @@ -1714,7 +1715,7 @@ static INPUT_PORTS_START( stbsub ) PORT_START("INC") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Small / Black / Stop 3") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big / Red") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1850,7 +1851,7 @@ static INPUT_PORTS_START( tesorone ) PORT_START("INC") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Small / Black / Stop 3") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big / Red") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2272,7 +2273,7 @@ static INPUT_PORTS_START( smoto16 ) PORT_START( "INB" ) // d006 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) // coin PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats / Test") // Bookkeeping. PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") // Game Rate & others. @@ -2281,7 +2282,7 @@ static INPUT_PORTS_START( smoto16 ) PORT_START( "INC" ) // d00c PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2368,7 +2369,7 @@ static INPUT_PORTS_START( smoto20 ) PORT_START( "INB" ) // d006 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) // coin PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats / Test") // Bookkeeping. PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") // Game Rate & others. @@ -2377,7 +2378,7 @@ static INPUT_PORTS_START( smoto20 ) PORT_START( "INC" ) // d00c PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2808,7 +2809,7 @@ void subsino_state::victor21(machine_config &config) ppi.tri_pb_callback().set_constant(0); ppi.in_pc_callback().set_ioport("INC"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2850,7 +2851,7 @@ void subsino_state::crsbingo(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &subsino_state::crsbingo_map); m_maincpu->set_addrmap(AS_IO, &subsino_state::subsino_iomap); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2891,7 +2892,7 @@ void subsino_state::srider(machine_config &config) ppi2.in_pb_callback().set_ioport("INA"); ppi2.in_pc_callback().set_ioport("INB"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2954,7 +2955,7 @@ void subsino_state::tisub(machine_config &config) ppi2.in_pb_callback().set_ioport("INA"); ppi2.in_pc_callback().set_ioport("INB"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2988,7 +2989,10 @@ void subsino_state::newhunterd(machine_config &config) { tisub(config); + Z80(config.replace(), m_maincpu, 6'000'000); // unknown clock m_maincpu->set_addrmap(AS_PROGRAM, &subsino_state::newhunterd_map); + + subdevice("screen")->screen_vblank().set_inputline(m_maincpu, 0, HOLD_LINE); // ? (needs some kind of source for IM 1 interrupt) } void subsino_state::stbsub(machine_config &config) @@ -3009,7 +3013,7 @@ void subsino_state::stbsub(machine_config &config) ppi2.in_pc_callback().set_ioport("INA"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index 1373946d81ca4..f9ce368e3f045 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -2787,7 +2787,7 @@ void subsino2_state::bishjan(machine_config &config) io.in_port_callback<9>().set_ioport("RESET"); io.out_port_callback<9>().set(FUNC(subsino2_state::bishjan_outputs_w)); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); DS2430A(config, m_eeprom).set_timing_scale(0.24); @@ -3028,14 +3028,14 @@ void subsino2_state::xtrain(machine_config &config) io.out_port_callback<8>().set(FUNC(subsino2_state::xtrain_out_b_w)); // B io.out_port_callback<9>().set(FUNC(subsino2_state::xtrain_out_a_w)); // A - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(200)); } void subsino2_state::ptrain(machine_config &config) { xtrain(config); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); } void subsino2_state::expcard(machine_config &config) diff --git a/src/mame/sun/sun3.cpp b/src/mame/sun/sun3.cpp index eb6267fc7c2bb..a576f4323b008 100644 --- a/src/mame/sun/sun3.cpp +++ b/src/mame/sun/sun3.cpp @@ -192,6 +192,7 @@ fefc34a - start of mem_size, which queries ECC registers for each memory board #include "machine/ncr5380.h" #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "bus/rs232/rs232.h" #include "bus/sunkbd/sunkbd.h" @@ -245,7 +246,8 @@ class sun3_state : public driver_device m_rom(*this, "user1"), m_idprom(*this, "idprom"), m_ram(*this, RAM_TAG), - m_lance(*this, "lance") + m_lance(*this, "lance"), + m_diagsw(*this, "diagsw") { } void sun3(machine_config &config); @@ -273,6 +275,7 @@ class sun3_state : public driver_device required_memory_region m_rom, m_idprom; required_device m_ram; required_device m_lance; + required_ioport m_diagsw; uint32_t tl_mmu_r(offs_t offset, uint32_t mem_mask = ~0); void tl_mmu_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); @@ -302,6 +305,8 @@ class sun3_state : public driver_device void vmetype2space_map(address_map &map); void vmetype3space_map(address_map &map); + uint32_t enable_r(); + uint32_t *m_rom_ptr, *m_ram_ptr; uint8_t *m_idprom_ptr; uint32_t m_enable, m_diag, m_dvma_enable, m_parregs[8], m_irqctrl, m_ecc[4]; @@ -333,6 +338,7 @@ static void scsi_devices(device_slot_interface &device) { device.option_add("cdrom", NSCSI_CDROM); device.option_add("harddisk", NSCSI_HARDDISK); + device.option_add("tape", NSCSI_TAPE); device.set_option_machine_config("cdrom", sun_cdrom); } @@ -472,7 +478,7 @@ uint32_t sun3_state::tl_mmu_r(offs_t offset, uint32_t mem_mask) return m_context<<24; case 4: // enable reg - return m_enable; + return enable_r(); case 5: // DVMA enable return m_dvma_enable<<24; @@ -507,7 +513,7 @@ uint32_t sun3_state::tl_mmu_r(offs_t offset, uint32_t mem_mask) } // boot mode? - if ((fc == M68K_FC_SUPERVISOR_PROGRAM) && !(m_enable & 0x80)) + if ((fc == M68K_FC_SUPERVISOR_PROGRAM) && !(enable_r() & 0x80)) { return m_rom_ptr[offset & 0x3fff]; } @@ -809,6 +815,13 @@ void sun3_state::vmetype3space_map(address_map &map) { } +uint32_t sun3_state::enable_r() +{ + // Incorporate diag switch value. + const uint32_t diagsw = m_diagsw->read() << 24; + return (m_enable & ~(u32(1) << 24)) | diagsw; +} + uint32_t sun3_state::irqctrl_r() { return m_irqctrl; @@ -976,6 +989,10 @@ uint32_t sun3_state::bw2_350_update(screen_device &screen, bitmap_rgb32 &bitmap, /* Input ports */ static INPUT_PORTS_START( sun3 ) + PORT_START("diagsw") + PORT_CONFNAME(1, 0, "Diagnostic Switch") + PORT_CONFSETTING(0, "Normal") + PORT_CONFSETTING(1, "Diagnostic") INPUT_PORTS_END void sun3_state::machine_start() @@ -1061,7 +1078,7 @@ void sun3_state::sun3(machine_config &config) NSCSI_CONNECTOR(config, "scsibus:1", scsi_devices, "harddisk"); NSCSI_CONNECTOR(config, "scsibus:2", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:3", scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, "tape"); NSCSI_CONNECTOR(config, "scsibus:5", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:6", scsi_devices, "cdrom"); NSCSI_CONNECTOR(config, "scsibus:7").option_set("sbc", NCR5380).machine_config([this] (device_t *device) { ncr5380(device); }); @@ -1167,7 +1184,7 @@ void sun3_state::sun3_50(machine_config &config) NSCSI_CONNECTOR(config, "scsibus:1", scsi_devices, "harddisk"); NSCSI_CONNECTOR(config, "scsibus:2", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:3", scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, "tape"); NSCSI_CONNECTOR(config, "scsibus:5", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:6", scsi_devices, "cdrom"); NSCSI_CONNECTOR(config, "scsibus:7").option_set("sbc", NCR5380).machine_config([this] (device_t *device) { ncr5380(device); }); diff --git a/src/mame/sun/sun3x.cpp b/src/mame/sun/sun3x.cpp index c996c14d56e47..b22af3705acc4 100644 --- a/src/mame/sun/sun3x.cpp +++ b/src/mame/sun/sun3x.cpp @@ -130,6 +130,7 @@ #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "cpu/m68000/m68030.h" #include "imagedev/floppy.h" #include "machine/icm7170.h" @@ -592,6 +593,7 @@ static void scsi_devices(device_slot_interface &device) { device.option_add("cdrom", NSCSI_CDROM); device.option_add("harddisk", NSCSI_HARDDISK); + device.option_add("tape", NSCSI_TAPE); device.set_option_machine_config("cdrom", sun_cdrom); } @@ -629,7 +631,7 @@ void sun3x_state::sun3_80(machine_config &config) NSCSI_CONNECTOR(config, "scsibus:1", scsi_devices, "harddisk"); NSCSI_CONNECTOR(config, "scsibus:2", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:3", scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:4", scsi_devices, "tape"); NSCSI_CONNECTOR(config, "scsibus:5", scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsibus:6", scsi_devices, "cdrom"); NSCSI_CONNECTOR(config, "scsibus:7").option_set("esp", NCR53C90).clock(20000000/2); // Emulex 2400138 (68-pin PLCC) diff --git a/src/mame/sun/sun4.cpp b/src/mame/sun/sun4.cpp index 66e67e2bd9cd9..5e61c892c945f 100644 --- a/src/mame/sun/sun4.cpp +++ b/src/mame/sun/sun4.cpp @@ -413,6 +413,7 @@ #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "bus/rs232/rs232.h" #include "bus/sunkbd/sunkbd.h" #include "bus/sunmouse/sunmouse.h" @@ -568,6 +569,8 @@ class sun4_base_state : public driver_device virtual void machine_reset() override; virtual void machine_start() override; + virtual void scsi_devices_config(machine_config &config) = 0; + u32 debugger_r(offs_t offset, u32 mem_mask = ~0); void debugger_w(offs_t offset, u32 data, u32 mem_mask = ~0); @@ -681,6 +684,9 @@ class sun4_state : public sun4_base_state void sun4(machine_config &config); +protected: + virtual void scsi_devices_config(machine_config &config) override; + private: void type1space_map(address_map &map); }; @@ -704,6 +710,9 @@ class sun4c_state : public sun4_base_state void sun4_65(machine_config &config); void sun4_75(machine_config &config); +protected: + virtual void scsi_devices_config(machine_config &config) override; + private: virtual void machine_start() override; virtual void machine_reset() override; @@ -1367,6 +1376,7 @@ static void sun_scsi_devices(device_slot_interface &device) { device.option_add("cdrom", NSCSI_CDROM); device.option_add("harddisk", NSCSI_HARDDISK); + device.option_add("tape", NSCSI_TAPE); device.option_add_internal("ncr53c90", NCR53C90); device.set_option_machine_config("cdrom", sun4_cdrom); } @@ -1433,15 +1443,8 @@ void sun4_base_state::sun4_base(machine_config &config) m_rs232[1]->dcd_handler().set(m_scc[1], FUNC(z80scc_device::dcdb_w)); m_rs232[1]->cts_handler().set(m_scc[1], FUNC(z80scc_device::ctsb_w)); - NSCSI_BUS(config, "scsibus"); - NSCSI_CONNECTOR(config, "scsibus:0", sun_scsi_devices, "harddisk"); - NSCSI_CONNECTOR(config, "scsibus:1", sun_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:2", sun_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:3", sun_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:4", sun_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:5", sun_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsibus:6", sun_scsi_devices, "cdrom"); - NSCSI_CONNECTOR(config, "scsibus:7", sun_scsi_devices, "ncr53c90", true).set_option_machine_config("ncr53c90", [this] (device_t *device) { ncr53c90(device); }); + // SCSI + scsi_devices_config(config); } void sun4_state::sun4(machine_config &config) @@ -1466,6 +1469,21 @@ void sun4_state::sun4(machine_config &config) m_maincpu->set_mmu(m_mmu); } +void sun4_state::scsi_devices_config(machine_config &config) +{ + // sun4 defaults to having a tape device at SCSI ID 4 + + NSCSI_BUS(config, "scsibus"); + NSCSI_CONNECTOR(config, "scsibus:0", sun_scsi_devices, "harddisk"); + NSCSI_CONNECTOR(config, "scsibus:1", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:2", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:3", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:4", sun_scsi_devices, "tape"); + NSCSI_CONNECTOR(config, "scsibus:5", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:6", sun_scsi_devices, "cdrom"); + NSCSI_CONNECTOR(config, "scsibus:7", sun_scsi_devices, "ncr53c90", true).set_option_machine_config("ncr53c90", [this] (device_t *device) { ncr53c90(device); }); +} + void sun4c_state::sun4c(machine_config &config) { /* basic machine hardware */ @@ -1620,6 +1638,21 @@ void sun4c_state::sun4_75(machine_config &config) m_maincpu->set_clock(40'000'000); } +void sun4c_state::scsi_devices_config(machine_config &config) +{ + // sun4c defaults to having nothing at SCSI ID 4 + + NSCSI_BUS(config, "scsibus"); + NSCSI_CONNECTOR(config, "scsibus:0", sun_scsi_devices, "harddisk"); + NSCSI_CONNECTOR(config, "scsibus:1", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:2", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:3", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:4", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:5", sun_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsibus:6", sun_scsi_devices, "cdrom"); + NSCSI_CONNECTOR(config, "scsibus:7", sun_scsi_devices, "ncr53c90", true).set_option_machine_config("ncr53c90", [this] (device_t *device) { ncr53c90(device); }); +} + /* Boot PROM diff --git a/src/mame/sun/ultra45.cpp b/src/mame/sun/ultra45.cpp new file mode 100644 index 0000000000000..0cde9aac18d9b --- /dev/null +++ b/src/mame/sun/ultra45.cpp @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders: +/*********************************************************************************************************** +Skeleton driver for Sun Microsystems Ultra 25 and Ultra 45 Workstations. + +Hardware info about Ultra 45: + -Dual UltraSPARC IIIi processor. + -PLX Technology PEX8532-BB25BI G (PCI Express Switch). + -ALI ULI M1575 A1 (Super South Bridge). + -Broadcom BCM5715CKPBG (Dual-Port Gigabit Ethernet controller with a PCI Express Host Interface). + +***********************************************************************************************************/ + +#include "emu.h" +#include "cpu/sparc/sparc.h" + + +namespace { + +class ultra45_state : public driver_device +{ +public: + ultra45_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + + void ultra45(machine_config &config); + +private: + required_device m_maincpu; +}; + + +static INPUT_PORTS_START(ultra45) +INPUT_PORTS_END + +void ultra45_state::ultra45(machine_config &config) +{ + SPARCV8(config, m_maincpu, 20'000'000); // Actually a 1.6GHz UltraSPARC IIIi CPU with 1 MB integrated Level2 cache + //SPARCV8(config, m_maincpu, 20'000'000); // Actually a 1.6GHz UltraSPARC IIIi CPU with 1 MB integrated Level2 cache (optional 2nd CPU) +} + + +// Probably all wrong +ROM_START(ultra45) + ROM_REGION(0x400000, "maincpu", 0) + ROM_LOAD( "chicago_4.25.9_cks_c1bd_s29al032d.u29", 0x000000, 0x400000, CRC(e08f3c4f) SHA1(87bd5c92f59121b5253c0c12d627d18401a01bf7) ) + + ROM_REGION(0x400000, "extra1", 0) + ROM_LOAD( "chicago_1.80.3_cks_8ee3_s29al032d.u81", 0x000000, 0x400000, CRC(0b18627e) SHA1(473fe575e0dad4467bb40cdb76234be354d67ac2) ) // checksum does not match with the one printed on the label, probably because a firmware update + + ROM_REGION(0x021000, "extra2", 0) + ROM_LOAD( "d887_at45db011b.u77", 0x000000, 0x021000, CRC(b6363183) SHA1(1769ffa968e0f79bbfa7bc147f8d6c179f5ca44b) ) + + ROM_REGION(0x008000, "extra3", 0) + ROM_LOAD( "ca4b_at25256an.u79", 0x000000, 0x008000, CRC(a35303fb) SHA1(df1b4121c8ae40b7fb9a03cc57e61f0da12e1110) ) + + /* Unprotected PIC16F777 near a 20 MHz xtal + ID0 = 2009h + ID1 = 0000h + ID2 = 2009h + ID3 = 0003h + Oscillator = High Speed + Watchdog = Disabled + Power-up timer = Disabled + MCLR pin = Disabled + Brown-out Reset enabled and always on */ + ROM_REGION(0x004000, "pic1", 0) + ROM_LOAD("972a_pic16f777.u13", 0x000000, 0x004000, CRC(a1d4b342) SHA1(564926990cf28a1f88a8a374f16ac172f7b8c8f7) ) + + ROM_REGION(0x004300, "pic2", 0) + ROM_LOAD("a4bb_pic12f629.u66", 0x000000, 0x004300, CRC(258bd64e) SHA1(58f64710a3f4d184a3aaa776aa351d30144806f5) ) + + ROM_REGION(0x0016cc, "pld", 0) + ROM_LOAD("chicago_0309_4m_cks_6d7b_xc9572xl.u15", 0x000000, 0x0016cc, CRC(d5fbe610) SHA1(a41e136eeb6c115523814ca3774ff7a0a0604569) ) +ROM_END + +} // anonymous namespace + +// YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS +COMP( 1996, ultra45, 0, 0, ultra45, ultra45, ultra45_state, empty_init, "Sun Microsystems", "Ultra 45", MACHINE_IS_SKELETON ) diff --git a/src/mame/sunelectronics/tonton.cpp b/src/mame/sunelectronics/tonton.cpp index 88e3f110748b0..2536cdc9b7023 100644 --- a/src/mame/sunelectronics/tonton.cpp +++ b/src/mame/sunelectronics/tonton.cpp @@ -135,7 +135,7 @@ static INPUT_PORTS_START( tonton ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown A") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_START("DSW1") @@ -226,7 +226,7 @@ void tonton_state::tonton(machine_config &config) m_v9938->int_cb().set_inputline(m_maincpu, 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/sunwise/anoworld.cpp b/src/mame/sunwise/anoworld.cpp index ec2b8302e81f2..ffb6590c32ed0 100644 --- a/src/mame/sunwise/anoworld.cpp +++ b/src/mame/sunwise/anoworld.cpp @@ -1,6 +1,6 @@ // license: BSD-3-Clause // copyright-holders: Angelo Salese, AJR -/*************************************************************************************************** +/************************************************************************************************** Another World (c) 1989 Sunwise @@ -8,13 +8,14 @@ Another World (c) 1989 Sunwise - Identify irq sources ($24 timer, $26 VBLANK?, $20 or $22 quadrature encoder); - Z80DMA never sends a ready signal, workaround by forcing is_ready fn to 1; - Verify data ROM bank; +- Complete inputs: cabinet shows 3 buttons and a trackball; - Sound i/f not fully understood: \- no irq from CTC, hooking up YM irq in daisy chain will fail device validation; \- sound ROMs mainly decodes as regular 8-bit DAC, mono, 8000 Hz. \- Denote they ends abruptly towards the end (bad ROMs?). \- is output connected to CTC ZC0 / ZC1 as DAC1BIT? -==================================================================================================== +=================================================================================================== TOP BOARD (S-8808A) ========= @@ -44,7 +45,7 @@ video output 5x 5816 RAM 18 MHz osc -***************************************************************************************************/ +**************************************************************************************************/ #include "emu.h" diff --git a/src/mame/taito/arkanoid.h b/src/mame/taito/arkanoid.h index 93c9c6e503695..4c800f49d7ef8 100644 --- a/src/mame/taito/arkanoid.h +++ b/src/mame/taito/arkanoid.h @@ -38,7 +38,7 @@ class arkanoid_state : public driver_device { } - DECLARE_CUSTOM_INPUT_MEMBER(arkanoid_semaphore_input_r); + ioport_value arkanoid_semaphore_input_r(); void init_block2(); void init_arkblock(); void init_hexa(); diff --git a/src/mame/taito/arkanoid_m.cpp b/src/mame/taito/arkanoid_m.cpp index 234e3b87e519d..c886fe22d9a0b 100644 --- a/src/mame/taito/arkanoid_m.cpp +++ b/src/mame/taito/arkanoid_m.cpp @@ -22,7 +22,7 @@ #include "logmacro.h" -CUSTOM_INPUT_MEMBER(arkanoid_state::arkanoid_semaphore_input_r) +ioport_value arkanoid_state::arkanoid_semaphore_input_r() { // bit 0 is host semaphore flag, bit 1 is MCU semaphore flag (both active low) return diff --git a/src/mame/taito/buggychl.cpp b/src/mame/taito/buggychl.cpp index 0741c167a36eb..d75011ffbe10c 100644 --- a/src/mame/taito/buggychl.cpp +++ b/src/mame/taito/buggychl.cpp @@ -147,7 +147,7 @@ class buggychl_state : public driver_device void buggychl(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(pedal_in_r); + ioport_value pedal_in_r(); protected: virtual void machine_start() override; @@ -651,7 +651,7 @@ Sound Master CPU (SMCPU) /******************************************************************************/ // accelerator is 4-bit, we need to convert it here so that it doesn't clash with other inputs in IN1 (known i/o framework fault) -CUSTOM_INPUT_MEMBER( buggychl_state::pedal_in_r ) +ioport_value buggychl_state::pedal_in_r() { return m_pedal_input->read() >> 4; } diff --git a/src/mame/taito/cchance.cpp b/src/mame/taito/cchance.cpp index bfefa20a413b6..4d20a3f4ee4e6 100644 --- a/src/mame/taito/cchance.cpp +++ b/src/mame/taito/cchance.cpp @@ -285,7 +285,7 @@ void cchance_state::cchance(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(cchance_state::scanline_cb), "screen", 0, 1); TAITOIO_OPTO(config, "opto", 0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); X1_001(config, m_spritegen, 12_MHz_XTAL, m_palette, gfx_cchance); m_spritegen->set_fg_yoffsets(-0x12, 0x0e); diff --git a/src/mame/taito/crbaloon.cpp b/src/mame/taito/crbaloon.cpp index 1a1c55939974f..cac0630212000 100644 --- a/src/mame/taito/crbaloon.cpp +++ b/src/mame/taito/crbaloon.cpp @@ -68,7 +68,7 @@ void crbaloon_state::pc3092_w(offs_t offset, uint8_t data) } -CUSTOM_INPUT_MEMBER(crbaloon_state::pc3092_r) +ioport_value crbaloon_state::pc3092_r() { uint32_t ret; diff --git a/src/mame/taito/crbaloon.h b/src/mame/taito/crbaloon.h index d674c04c1f1a9..5e55ac4b5909b 100644 --- a/src/mame/taito/crbaloon.h +++ b/src/mame/taito/crbaloon.h @@ -34,7 +34,7 @@ class crbaloon_state : public driver_device { } void crbaloon(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(pc3092_r); + ioport_value pc3092_r(); protected: virtual void machine_reset() override; diff --git a/src/mame/taito/cyclemb.cpp b/src/mame/taito/cyclemb.cpp index a1bf53d18c533..af03ba3440bf5 100644 --- a/src/mame/taito/cyclemb.cpp +++ b/src/mame/taito/cyclemb.cpp @@ -146,7 +146,7 @@ class cyclemb_state : public driver_device // void ym_irq(int state); void update_dial(int P); - template DECLARE_CUSTOM_INPUT_MEMBER(dial_r); + template ioport_value dial_r(); void init_skydest(); void init_cyclemb(); @@ -765,7 +765,7 @@ void cyclemb_state::update_dial(int P) } template -CUSTOM_INPUT_MEMBER(cyclemb_state::dial_r) +ioport_value cyclemb_state::dial_r() { return m_dial_status[P].current_value | (m_dial_status[P].reverse ? 0x80 : 0x00); } diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 6633414a76fd9..1961087f312fb 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -328,8 +328,8 @@ class opwolf_state : public driver_device void init_opwolfb(); void init_opwolfp(); - DECLARE_CUSTOM_INPUT_MEMBER(opwolf_gun_x_r); - DECLARE_CUSTOM_INPUT_MEMBER(opwolf_gun_y_r); + ioport_value opwolf_gun_x_r(); + ioport_value opwolf_gun_y_r(); protected: virtual void machine_start() override; @@ -628,14 +628,14 @@ void opwolf_state::counters_w(uint8_t data) machine().bookkeeping().coin_counter_w(0, ~data & 0x10); } -CUSTOM_INPUT_MEMBER(opwolf_state::opwolf_gun_x_r ) +ioport_value opwolf_state::opwolf_gun_x_r() { /* P1X - Have to remap 8 bit input value, into 0-319 visible range */ int scaled = (ioport(P1X_PORT_TAG)->read() * 320 ) / 256; return (scaled + 0x15 + m_opwolf_gun_xoffs); } -CUSTOM_INPUT_MEMBER(opwolf_state::opwolf_gun_y_r ) +ioport_value opwolf_state::opwolf_gun_y_r() { return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_opwolf_gun_yoffs); } diff --git a/src/mame/taito/superqix.cpp b/src/mame/taito/superqix.cpp index 9977d8f8c3cdc..06f52d80ac7e0 100644 --- a/src/mame/taito/superqix.cpp +++ b/src/mame/taito/superqix.cpp @@ -885,7 +885,7 @@ u8 hotsmash_state::hotsmash_z80_mcu_r() return m_from_mcu; } -CUSTOM_INPUT_MEMBER(hotsmash_state::pbillian_semaphore_input_r) +ioport_value hotsmash_state::pbillian_semaphore_input_r() { ioport_value res = 0; // bit 0x40 is PROBABLY latch 1 on 74ls74.7c, is high if m_z80_has_written is clear diff --git a/src/mame/taito/superqix.h b/src/mame/taito/superqix.h index 53cc1a51a16c8..c21f5c45ebd83 100644 --- a/src/mame/taito/superqix.h +++ b/src/mame/taito/superqix.h @@ -160,7 +160,7 @@ class hotsmash_state : public superqix_state_base void pbillian(machine_config &config); void pbillianb(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(pbillian_semaphore_input_r); + ioport_value pbillian_semaphore_input_r(); protected: virtual void machine_start() override; diff --git a/src/mame/taito/taito_f2.cpp b/src/mame/taito/taito_f2.cpp index a71ee07116267..69416419c91bc 100644 --- a/src/mame/taito/taito_f2.cpp +++ b/src/mame/taito/taito_f2.cpp @@ -5021,6 +5021,7 @@ ROM_START( qzquest ) /* Quiz Quest */ /* no Delta-T samples */ ROM_END +// Dual PCB version (main and sound program ROMs cannot be used on the single PCB version) ROM_START( pulirula ) ROM_REGION( 0xc0000, "maincpu", 0 ) /* 768k for 68000 code */ ROM_LOAD16_BYTE( "c98-12.rom", 0x00000, 0x40000, CRC(816d6cde) SHA1(cac583440cca9aa57373f4a6c9a68c5442a5258b) ) @@ -5073,6 +5074,7 @@ ROM_START( pulirulaj ) /* no Delta-T samples */ ROM_END +// Single PCB version (main and sound program ROMs cannot be used on the dual PCB version) ROM_START( pulirulaa ) // dumped from an original PCB without original ROM labels. The maincpu and audiocpu ROMs differ from the parent. ROM_REGION( 0xc0000, "maincpu", 0 ) /* 768k for 68000 code */ ROM_LOAD16_BYTE( "ic46.bin", 0x00000, 0x40000, CRC(584ae599) SHA1(c114442d93080aaf0641c1a9204569f0017af000) ) @@ -5618,7 +5620,7 @@ GAME( 1990, mjnquestb, mjnquest, mjnquest, mjnquest, taitof2_state, init_mjn GAME( 1990, footchmp, 0, footchmp, footchmp, taitof2_state, empty_init, ROT0, "Taito Corporation Japan", "Football Champ / Euro Football Champ (World)", MACHINE_SUPPORTS_SAVE ) // title depends on dipswitch GAME( 1990, htherou, footchmp, footchmp, htherou, taitof2_state, empty_init, ROT0, "Taito Corporation", "Hat Trick Hero (US)", MACHINE_SUPPORTS_SAVE ) // Single PCB -GAME( 1990, htheroj, footchmp, hthero, htheroj, taitof2_state, empty_init, ROT0, "Taito Corporation", "Hat Trick Hero (Japan)", MACHINE_SUPPORTS_SAVE ) // Double PCB +GAME( 1990, htheroj, footchmp, hthero, htheroj, taitof2_state, empty_init, ROT0, "Taito Corporation", "Hat Trick Hero (Japan)", MACHINE_SUPPORTS_SAVE ) // Dual PCB GAME( 1992, footchmpbl, footchmp, footchmpbl,footchmpbl, taitof2_state, empty_init, ROT0, "bootleg", "Football Champ / Euro Football Champ (World) (bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // very different hw register etc. GAME( 1992, euroch92, 0, footchmp, footchmp, taitof2_state, empty_init, ROT0, "Taito Corporation Japan", "Euro Champ '92 (World)", MACHINE_SUPPORTS_SAVE ) @@ -5636,8 +5638,8 @@ GAME( 1991, solfigtr, 0, solfigtr, solfigtr, taitof2_state, empty_in GAME( 1991, qzquest, 0, qzquest , qzquest, taitof2_state, empty_init, ROT0, "Taito Corporation", "Quiz Quest - Hime to Yuusha no Monogatari (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, pulirula, 0, pulirula, pulirula, taitof2_state, empty_init, ROT0, "Taito Corporation Japan", "PuLiRuLa (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, pulirulaa, pulirula, pulirula, pulirulaj, taitof2_state, empty_init, ROT0, "Taito Corporation", "PuLiRuLa (World, earlier?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, pulirula, 0, pulirula, pulirula, taitof2_state, empty_init, ROT0, "Taito Corporation Japan", "PuLiRuLa (World, dual PCB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, pulirulaa, pulirula, pulirula, pulirulaj, taitof2_state, empty_init, ROT0, "Taito Corporation", "PuLiRuLa (World, single PCB)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, pulirulaj, pulirula, pulirula, pulirulaj, taitof2_state, empty_init, ROT0, "Taito Corporation", "PuLiRuLa (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, metalb, 0, metalb, metalb, taitof2_state, empty_init, ROT0, "Taito Corporation Japan", "Metal Black (World)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/taito_f3.cpp b/src/mame/taito/taito_f3.cpp index 77a14478c4113..2dde35806f0f4 100644 --- a/src/mame/taito/taito_f3.cpp +++ b/src/mame/taito/taito_f3.cpp @@ -36,14 +36,14 @@ /******************************************************************************/ template -CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r) +ioport_value taito_f3_state::f3_analog_r() { const int data = m_dial[Num]->read(); return ((data & 0xf) << 12) | ((data & 0xff0) >> 4); } template -CUSTOM_INPUT_MEMBER(taito_f3_state::f3_coin_r) +ioport_value taito_f3_state::f3_coin_r() { return m_coin_word[Num]; } @@ -229,7 +229,7 @@ void taito_f3_state::bubsympb_oki_map(address_map &map) /******************************************************************************/ -CUSTOM_INPUT_MEMBER( taito_f3_state::eeprom_read ) +ioport_value taito_f3_state::eeprom_read() { return m_eepromin->read(); } diff --git a/src/mame/taito/taito_f3.h b/src/mame/taito/taito_f3.h index 892650101e7a6..1717bf1bcea99 100644 --- a/src/mame/taito/taito_f3.h +++ b/src/mame/taito/taito_f3.h @@ -90,9 +90,9 @@ class taito_f3_state : public driver_device void init_scfinals(); void init_pbobbl2x(); - template DECLARE_CUSTOM_INPUT_MEMBER(f3_analog_r); - template DECLARE_CUSTOM_INPUT_MEMBER(f3_coin_r); - DECLARE_CUSTOM_INPUT_MEMBER(eeprom_read); + template ioport_value f3_analog_r(); + template ioport_value f3_coin_r(); + ioport_value eeprom_read(); protected: using fixed8 = s32; diff --git a/src/mame/taito/taito_o.cpp b/src/mame/taito/taito_o.cpp index 25d621e6fc283..81b34fce47204 100644 --- a/src/mame/taito/taito_o.cpp +++ b/src/mame/taito/taito_o.cpp @@ -455,7 +455,7 @@ void taitoo_state::taitoo(machine_config &config) m_tc0080vco->set_bgflip_yoffs(-2); m_tc0080vco->set_palette(m_palette); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); m_hopper->dispense_handler().set(FUNC(taitoo_state::hopper_int_cb)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/taito/taito_z.cpp b/src/mame/taito/taito_z.cpp index 33d37b1e36ee9..e92a2ab9b325c 100644 --- a/src/mame/taito/taito_z.cpp +++ b/src/mame/taito/taito_z.cpp @@ -1359,20 +1359,20 @@ void spacegun_state::spacegun_eeprom_w(u8 data) GAME INPUTS **********************************************************/ -CUSTOM_INPUT_MEMBER(taitoz_state::gas_pedal_r) +ioport_value taitoz_state::gas_pedal_r() { static const u8 retval[8] = { 0,1,3,2,6,7,5,4 }; return retval[m_gas.read_safe(0) & 7]; } -CUSTOM_INPUT_MEMBER(taitoz_state::brake_pedal_r) +ioport_value taitoz_state::brake_pedal_r() { static const u8 retval[8] = { 0,1,3,2,6,7,5,4 }; return retval[m_brake.read_safe(0) & 7]; } // enforceja only, 3 bits applied on both pots -template CUSTOM_INPUT_MEMBER(taitoz_state::adstick_r) +template ioport_value taitoz_state::adstick_r() { static const u8 retval[8] = { 0,1,3,2,6,7,5,4 }; u8 raw_value = ((axis == 0 ? m_stickx : m_sticky).read_safe(0) >> 5) & 7; diff --git a/src/mame/taito/taito_z.h b/src/mame/taito/taito_z.h index c168421c69e2e..c4d55487242a3 100644 --- a/src/mame/taito/taito_z.h +++ b/src/mame/taito/taito_z.h @@ -49,9 +49,9 @@ class taitoz_state : public driver_device m_cpua_out(*this, "genout%u", 0U) { } - DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r); - DECLARE_CUSTOM_INPUT_MEMBER(brake_pedal_r); - template DECLARE_CUSTOM_INPUT_MEMBER(adstick_r); + ioport_value gas_pedal_r(); + ioport_value brake_pedal_r(); + template ioport_value adstick_r(); void bshark_base(machine_config &config); void bshark(machine_config &config); diff --git a/src/mame/taito/taitosj.cpp b/src/mame/taito/taitosj.cpp index 583b5bfb50282..e418ad825dd18 100644 --- a/src/mame/taito/taitosj.cpp +++ b/src/mame/taito/taitosj.cpp @@ -196,7 +196,7 @@ void taitosj_state::sound_semaphore2_w(uint8_t data) machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::sound_semaphore2_w_cb), this), data); } -CUSTOM_INPUT_MEMBER(taitosj_state::input_port_4_f0_r) +ioport_value taitosj_state::input_port_4_f0_r() { return m_input_port_4_f0; } @@ -255,7 +255,7 @@ void taitosj_state::main_mcu_map(address_map &map) // seems the most logical way to do the gears template -CUSTOM_INPUT_MEMBER(taitosj_state::kikstart_gear_r) +ioport_value taitosj_state::kikstart_gear_r() { // gear MUST be 1, 2 or 3 if (m_gear[Player]->read() & 0x01) m_kikstart_gears[Player] = 0x02; diff --git a/src/mame/taito/taitosj.h b/src/mame/taito/taitosj.h index b2a963c4cd1d1..fab0ed4ac4661 100644 --- a/src/mame/taito/taitosj.h +++ b/src/mame/taito/taitosj.h @@ -54,8 +54,8 @@ class taitosj_state : public driver_device void init_junglhbr(); void init_spacecr(); - DECLARE_CUSTOM_INPUT_MEMBER(input_port_4_f0_r); - template DECLARE_CUSTOM_INPUT_MEMBER(kikstart_gear_r); + ioport_value input_port_4_f0_r(); + template ioport_value kikstart_gear_r(); protected: virtual void machine_start() override; diff --git a/src/mame/taito/topspeed.cpp b/src/mame/taito/topspeed.cpp index 300c805114338..b7aaae2901057 100644 --- a/src/mame/taito/topspeed.cpp +++ b/src/mame/taito/topspeed.cpp @@ -206,8 +206,8 @@ class topspeed_state : public driver_device void topspeed(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r); - DECLARE_CUSTOM_INPUT_MEMBER(brake_pedal_r); + ioport_value gas_pedal_r(); + ioport_value brake_pedal_r(); protected: virtual void machine_start() override; @@ -587,13 +587,13 @@ u8 topspeed_state::input_bypass_r() } } -CUSTOM_INPUT_MEMBER(topspeed_state::gas_pedal_r) +ioport_value topspeed_state::gas_pedal_r() { static constexpr u8 retval[8] = { 0, 1, 3, 2, 6, 7, 5, 4 }; return retval[m_gas->read() & 7]; } -CUSTOM_INPUT_MEMBER(topspeed_state::brake_pedal_r) +ioport_value topspeed_state::brake_pedal_r() { static constexpr u8 retval[8] = { 0, 1, 3, 2, 6, 7, 5, 4 }; return retval[m_brake->read() & 7]; diff --git a/src/mame/tch/littlerb.cpp b/src/mame/tch/littlerb.cpp index 654a31aa56b15..364d16c27bcea 100644 --- a/src/mame/tch/littlerb.cpp +++ b/src/mame/tch/littlerb.cpp @@ -123,7 +123,7 @@ class littlerb_state : public driver_device void init_littlerb(); - DECLARE_CUSTOM_INPUT_MEMBER(frame_step_r); + ioport_value frame_step_r(); protected: virtual void machine_start() override; @@ -199,7 +199,7 @@ void littlerb_state::main(address_map &map) } // guess according to DASM code and checking the gameplay speed, could be different -CUSTOM_INPUT_MEMBER(littlerb_state::frame_step_r) +ioport_value littlerb_state::frame_step_r() { uint32_t ret = m_soundframe; diff --git a/src/mame/technos/ddragon3.cpp b/src/mame/technos/ddragon3.cpp index 6e5969eeb257f..724d1c57de82a 100644 --- a/src/mame/technos/ddragon3.cpp +++ b/src/mame/technos/ddragon3.cpp @@ -271,13 +271,13 @@ void wwfwfest_state::wwfwfest_priority_w(uint8_t data) /* DIPs are spread across the other input ports */ template -CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_3f_r) +ioport_value wwfwfest_state::dsw_3f_r() { return m_dsw[N]->read() & 0x3f; } template -CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_c0_r) +ioport_value wwfwfest_state::dsw_c0_r() { return (m_dsw[N]->read() & 0xc0) >> 6; } diff --git a/src/mame/technos/ddragon3.h b/src/mame/technos/ddragon3.h index aa1f61a040257..def802ee1291d 100644 --- a/src/mame/technos/ddragon3.h +++ b/src/mame/technos/ddragon3.h @@ -128,8 +128,8 @@ class wwfwfest_state : public ddragon3_state void wwfwfest(machine_config &config); void wwfwfstb(machine_config &config); - template DECLARE_CUSTOM_INPUT_MEMBER(dsw_3f_r); - template DECLARE_CUSTOM_INPUT_MEMBER(dsw_c0_r); + template ioport_value dsw_3f_r(); + template ioport_value dsw_c0_r(); private: /* wwfwfest has an extra layer */ diff --git a/src/mame/technos/renegade.cpp b/src/mame/technos/renegade.cpp index 61c4706cf28e7..8d0efa9eb89fc 100644 --- a/src/mame/technos/renegade.cpp +++ b/src/mame/technos/renegade.cpp @@ -156,7 +156,7 @@ class renegade_state : public driver_device void renegade(machine_config &config); void kuniokunb(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r); + ioport_value mcu_status_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); protected: @@ -439,7 +439,7 @@ uint8_t renegade_state::mcu_reset_r() return 0; } -CUSTOM_INPUT_MEMBER(renegade_state::mcu_status_r) +ioport_value renegade_state::mcu_status_r() { if (m_mcu.found()) { diff --git a/src/mame/technos/xain.cpp b/src/mame/technos/xain.cpp index fc19b92603e89..c9995b33f4bda 100644 --- a/src/mame/technos/xain.cpp +++ b/src/mame/technos/xain.cpp @@ -275,7 +275,7 @@ int xain_state::vblank_r() ***************************************************************************/ -CUSTOM_INPUT_MEMBER(xain_state::mcu_status_r) +ioport_value xain_state::mcu_status_r() { // bit 0 is host MCU flag, bit 1 is host semaphore flag (both active low) return diff --git a/src/mame/technos/xain.h b/src/mame/technos/xain.h index 87822efd16dfd..3e35db6474e03 100644 --- a/src/mame/technos/xain.h +++ b/src/mame/technos/xain.h @@ -39,7 +39,7 @@ class xain_state : public driver_device void xsleenab(machine_config &config); int vblank_r(); - DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r); + ioport_value mcu_status_r(); protected: virtual void machine_start() override; diff --git a/src/mame/tecmo/bombjack.cpp b/src/mame/tecmo/bombjack.cpp index f17dcda587201..7b0dc26dc9052 100644 --- a/src/mame/tecmo/bombjack.cpp +++ b/src/mame/tecmo/bombjack.cpp @@ -46,6 +46,7 @@ * Convert the audio and video hardware to devices. ***********************************************************************/ + #include "emu.h" #include "cpu/z80/z80.h" @@ -201,6 +202,7 @@ class calorie_state : public bombjack_state * Audio hardware * *************************************/ + u8 bombjack_state::soundlatch_r() { // An extra flip-flop is used to clear the LS273 after @@ -220,6 +222,7 @@ u8 bombjack_state::soundlatch_r() * Video hardware * *************************************/ + void bombjack_state::video_start() { save_item(NAME(m_bg_image)); @@ -250,13 +253,13 @@ void bombjack_state::colorram_w(offs_t offset, u8 data) void bombjack_state::spritectrl_w(offs_t offset, u8 data) { - data = BIT(data, 0, 4); // four bits, addresses 16 sprites + data &= 0x0f; // four bits, addresses 16 sprites m_spritectrl[offset] = data; } void bombjack_state::background_w(u8 data) { - data = BIT(data, 0, 5); // four address bits + a "KILL" bit + data &= 0x1f; // four address bits + a "KILL" bit if (m_bg_image != data) { m_bg_image = data; @@ -266,8 +269,7 @@ void bombjack_state::background_w(u8 data) void bombjack_state::flip_w(u8 data) { - data = BIT(data, 0); - m_flip = data; + m_flip = BIT(data, 0); m_bg_tilemap->set_flip(m_flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); m_fg_tilemap->set_flip(m_flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); @@ -289,13 +291,12 @@ void bombjack_state::vblank_nmi(int state) void bombjack_state::watchdog_w(u8 data) { - data = BIT(data, 0); - m_watchdog->watchdog_enable(data); + m_watchdog->watchdog_enable(BIT(data, 0)); } void bombjack_state::set_bg_tile_info(u8 const attr, u16 &code, u8 &color, bool &flipx, bool &flipy) { - color = BIT(attr, 0, 4); + color = attr & 0x0f; flipy = BIT(attr, 7); } @@ -309,7 +310,7 @@ void calorie_state::set_bg_tile_info(u8 const attr, u16 &code, u8 &color, bool & TILE_GET_INFO_MEMBER(bombjack_state::get_bg_tile_info) { - tile_index |= BIT(m_bg_image, 0, 4) << 9; + tile_index |= (m_bg_image & 0x0f) << 9; u8 const attr = m_bgmaps[tile_index + 0x100]; u16 code = m_bgmaps[tile_index]; @@ -318,7 +319,7 @@ TILE_GET_INFO_MEMBER(bombjack_state::get_bg_tile_info) set_bg_tile_info(attr, code, color, flipx, flipy); tileinfo.set(1, code, color, (flipx ? TILE_FLIPX : 0) | - (flipy ? TILE_FLIPY : 0)); + (flipy ? TILE_FLIPY : 0)); } void bombjack_state::set_fg_tile_info(u8 const attr, u16 &code, u8 &color, bool &flipx, bool &flipy) @@ -345,14 +346,13 @@ TILE_GET_INFO_MEMBER(bombjack_state::get_fg_tile_info) set_fg_tile_info(attr, code, color, flipx, flipy); tileinfo.set(0, code, color, (flipx ? TILE_FLIPX : 0) | - (flipy ? TILE_FLIPY : 0)); + (flipy ? TILE_FLIPY : 0)); } bool bombjack_state::large_sprite(int const index, u8 const attr) { - bool const reverse = m_spritectrl[0] > m_spritectrl[1]; - return (index > m_spritectrl[reverse ? 1 : 0]) && - (index <= m_spritectrl[reverse ? 0 : 1]); + u8 const rev = (m_spritectrl[0] > m_spritectrl[1]) ? 1 : 0; + return (index > m_spritectrl[rev]) && (index <= m_spritectrl[rev ^ 1]); } bool calorie_state::large_sprite(int const index, u8 const attr) @@ -368,7 +368,7 @@ void bombjack_state::draw_sprites(bitmap_ind16 &bitmap, rectangle const &cliprec int const offs = sprite * 4; int code = m_spriteram[offs]; int const attr = m_spriteram[offs + 1]; - int const color = BIT(attr, 0, 4); + int const color = attr & 0x0f; // BIT(attr, 4) - internal tag for bonus objects // BIT(attr, 5) - internal tag for large objects bool flipx = BIT(attr, 6); @@ -382,7 +382,7 @@ void bombjack_state::draw_sprites(bitmap_ind16 &bitmap, rectangle const &cliprec if (BIT(sprite, 0)) continue; else - code |= (1 << 6); + code |= 0x40; } int const vpos = large ? VBSTART - 16 : VBSTART; @@ -396,7 +396,7 @@ void bombjack_state::draw_sprites(bitmap_ind16 &bitmap, rectangle const &cliprec } m_gfxdecode->gfx(large ? 3 : 2)->transpen(bitmap, cliprect, - code, color, flipx, flipy, xpos, ypos, 0); + code, color, flipx, flipy, xpos, ypos, 0); } } @@ -418,6 +418,7 @@ u32 bombjack_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, r * Address maps * *************************************/ + void bombjack_state::program_map(address_map &map) { map(0x0000, 0x0fff).ram().share(m_mainram); @@ -498,6 +499,7 @@ void bombjack_state::bombjack_audio_portmap(address_map &map) * (Bomb Jack) * *************************************/ + static INPUT_PORTS_START( bombjack ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY @@ -578,6 +580,7 @@ INPUT_PORTS_END * (Calorie Kun) * *************************************/ + static INPUT_PORTS_START( calorie ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_4WAY @@ -660,6 +663,7 @@ INPUT_PORTS_END * Graphics definitions * *************************************/ + static gfx_layout const layout_8x8 = { 8, 8, @@ -706,6 +710,7 @@ GFXDECODE_END * Machine driver * *************************************/ + void bombjack_state::machine_start() { save_item(NAME(m_nmi_on)); @@ -810,6 +815,7 @@ void calorie_state::init_calorieb() * (Bomb Jack) * *************************************/ + ROM_START( bombjack ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "09_j01b.bin", 0x0000, 0x2000, CRC(c668dc30) SHA1(51dd6a2688b42e9f28f0882bd76f75be7ec3222a) ) @@ -944,6 +950,7 @@ ROM_END * (Calorie Kun) * *************************************/ + /* Calorie Kun Sega, 1986 @@ -1079,5 +1086,5 @@ GAME( 1984, bombjack2, bombjack, bombjack, bombjack, bombjack_state, empty_init GAME( 1984, bombjackt, bombjack, bombjack, bombjack, bombjack_state, empty_init, ROT90, "Tehkan (Tecfri license)", "Bomb Jack (Tecfri, Spain)", MACHINE_SUPPORTS_SAVE ) // official license GAME( 1985, bombjackbl, bombjack, bombjack, bombjack, bombjack_state, empty_init, ROT90, "bootleg", "Bomb Jack (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, calorie, 0, calorie, calorie, calorie_state, empty_init, ROT0, "Sega", "Calorie Kun vs Moguranian", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, calorieb, calorie, calorieb, calorie, calorie_state, init_calorieb, ROT0, "bootleg", "Calorie Kun vs Moguranian (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, calorie, 0, calorie, calorie, calorie_state, empty_init, ROT0, "Sega", "Calorie Kun vs Moguranian", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, calorieb, calorie, calorieb, calorie, calorie_state, init_calorieb, ROT0, "bootleg", "Calorie Kun vs Moguranian (bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/tecmo/tecmo16.cpp b/src/mame/tecmo/tecmo16.cpp index f568341e9b45a..36e505a53bc16 100644 --- a/src/mame/tecmo/tecmo16.cpp +++ b/src/mame/tecmo/tecmo16.cpp @@ -1004,10 +1004,12 @@ ROM_END /******************************************************************************/ -GAME( 1992, fstarfrc, 0, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (US)", MACHINE_SUPPORTS_SAVE ) // Has 'Recycle it, don't trash it" and 'Winners don't use drugs' screens after first attract cycle -GAME( 1992, fstarfrcj, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fstarfrcja, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fstarfrcw, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (World?)", MACHINE_SUPPORTS_SAVE ) // more similar the to the Japanese version than to the US one, not the parent because not sure it's the world version -GAME( 1992, riot, 0, riot, riot, tecmo16_state, empty_init, ROT0, "NMK", "Riot", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, riotw, riot, riot, riot, tecmo16_state, empty_init, ROT0, "Woong Bi", "Riot (Woong Bi license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, ginkun, 0, ginkun, ginkun, tecmo16_state, empty_init, ROT0, "Tecmo", "Ganbare Ginkun", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fstarfrc, 0, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (US)", MACHINE_SUPPORTS_SAVE ) // Has 'Recycle it, don't trash it" and 'Winners don't use drugs' screens after first attract cycle +GAME( 1992, fstarfrcj, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fstarfrcja, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fstarfrcw, fstarfrc, base, fstarfrc, tecmo16_state, empty_init, ROT90, "Tecmo", "Final Star Force (World?)", MACHINE_SUPPORTS_SAVE ) // more similar the to the Japanese version than to the US one, not the parent because not sure it's the world version + +GAME( 1992, riot, 0, riot, riot, tecmo16_state, empty_init, ROT0, "Tecmo (NMK license)", "Riot (NMK)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, riotw, riot, riot, riot, tecmo16_state, empty_init, ROT0, "Tecmo (Woong Bi license)", "Riot (Woong Bi)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1995, ginkun, 0, ginkun, ginkun, tecmo16_state, empty_init, ROT0, "Tecmo", "Ganbare Ginkun", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/thomson/thomson_v.cpp b/src/mame/thomson/thomson_v.cpp index b6ea65c039c70..10783ad7ae74d 100644 --- a/src/mame/thomson/thomson_v.cpp +++ b/src/mame/thomson/thomson_v.cpp @@ -1149,13 +1149,13 @@ void thomson_state::video_start() m_thom_border_index = 0; m_thom_vstate_dirty = true; m_thom_vstate_last_dirty = true; - save_pointer(NAME(m_thom_last_pal), sizeof(m_thom_last_pal)); - save_pointer(NAME(m_thom_pal), sizeof(m_thom_pal)); - save_pointer(NAME(m_thom_border_l), sizeof(m_thom_border_l)); - save_pointer(NAME(m_thom_border_r), sizeof(m_thom_border_r)); - save_pointer(NAME(m_thom_vbody), sizeof(m_thom_vbody)); - save_pointer(NAME(m_thom_vmodepage), sizeof(m_thom_vmodepage)); - save_pointer(NAME(m_thom_vmem_dirty), sizeof(m_thom_vmem_dirty)); + save_item(NAME(m_thom_last_pal)); + save_item(NAME(m_thom_pal)); + save_item(NAME(m_thom_border_l)); + save_item(NAME(m_thom_border_r)); + save_item(NAME(m_thom_vbody)); + save_item(NAME(m_thom_vmodepage)); + save_item(NAME(m_thom_vmem_dirty)); save_item(NAME(m_thom_pal_changed)); save_item(NAME(m_thom_vmodepage_changed)); save_item(NAME(m_thom_vmode)); diff --git a/src/mame/ti/ti99_4p.cpp b/src/mame/ti/ti99_4p.cpp index d2a28d8ecb933..846887a045275 100644 --- a/src/mame/ti/ti99_4p.cpp +++ b/src/mame/ti/ti99_4p.cpp @@ -970,7 +970,7 @@ void ti99_4p_state::driver_start() save_item(NAME(m_rom6_active)); save_item(NAME(m_rom6_upper)); save_item(NAME(m_dbin)); - save_pointer(NAME(m_mapper),16); + save_item(NAME(m_mapper)); } /* diff --git a/src/mame/toaplan/toaplan2.cpp b/src/mame/toaplan/toaplan2.cpp index a1402106625b3..440de4c31f5ca 100644 --- a/src/mame/toaplan/toaplan2.cpp +++ b/src/mame/toaplan/toaplan2.cpp @@ -404,8 +404,6 @@ To reset the NVRAM in Othello Derby, hold P1 Button 1 down while booting. #include "speaker.h" -#define PWRKICK_HOPPER_PULSE 50 // time between hopper pulses in milliseconds (probably wrong) - //#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */ constexpr unsigned toaplan2_state::T2PALETTE_LENGTH; @@ -4188,7 +4186,7 @@ void pwrkick_state::pwrkick(machine_config &config) // Sunwise SW931201-1 PCB (2 NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(PWRKICK_HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration is probably wrong /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/tomy/kisssite.cpp b/src/mame/tomy/kisssite.cpp index 446315af94dd8..949f929cdd131 100644 --- a/src/mame/tomy/kisssite.cpp +++ b/src/mame/tomy/kisssite.cpp @@ -20,7 +20,7 @@ S1L9223A01-Q0 SAMSUNG C031 S5L9284D01-Q0 -ASD AE43BH40I16I-35 +ASD AE43BH4016I-35 50G00290919D F 037B @@ -77,17 +77,19 @@ class kisssite_state : public driver_device void kisssite_state::machine_reset() { - m_maincpu->set_state_int(STATE_GENPC, 0xe2cc); // temp, there is code here, but this is unlikely to be the entry point + m_maincpu->set_state_int(STATE_GENPC, 0x1cffff80); // might actually be 0x7fffff80 with a ROM mirror } void kisssite_state::mem(address_map &map) { - map(0x0000000, 0x003ffff).rom(); + map(0x00000000, 0x0007ffff).ram(); + map(0x1c000000, 0x1c03ffff).mirror(0x00fc0000).rom().region("maincpu", 0); + // registers at 0x20000000-0x2000ffff, ES6008 datasheet could be helpful } void kisssite_state::kisssite(machine_config &config) { - MIPSX(config, m_maincpu, 60'000'000); // there is MIPS-X code at at around 0xe2e0 in the ROM, 0x60000019 is "r0 + r0 -> r0" which acts as a NOP + MIPSX(config, m_maincpu, 60'000'000); m_maincpu->set_addrmap(AS_PROGRAM, &kisssite_state::mem); CDROM(config, "cdrom").set_interface("cdrom"); diff --git a/src/mame/trainer/ms68k.cpp b/src/mame/trainer/ms68k.cpp new file mode 100644 index 0000000000000..7ad47bae5c195 --- /dev/null +++ b/src/mame/trainer/ms68k.cpp @@ -0,0 +1,326 @@ +// license:BSD-3-Clause +// copyright-holders:Chris Hanson +/* + * ms68k.cpp - Marion Systems MS68K + * + * Documentation: + * http://bitsavers.org/pdf/marionSystems/Marion_Systems_MS68K_Single_Board_Computer_Users_Manual.pdf + * + * The Marion Systems MS68K was a single-board MC68000 system designed by Tom + * Oberheim in 1985 with two serial ports, a parallel port, WD1772 floppy, + * optional SCSI, and up to 512KB of RAM and ROM each onboard, plus an + * expansion connector providing full access to the 68000 bus. It was used in + * a number of university-level computer systems classes, and a variant of + * Peter Stark’s SK*DOS was also available. + * + * The default ROM contains a port of Tiny BASIC 1.2 at 0xF04900, and a + * loader for it at 0xF04800. Thus while there is no direct command to start + * it, a simple GF04800 will start Tiny BASIC with it. + * + * Specifications: + * - 8MHz MC68000 CPU + * - 512KB maximum onboard RAM + * - 128KB maximum onboard EPROM + * - MC68681 DUART + * - TTL-supported parallel port + * - NCR53C80 SCSI controller + * - Expansion bus + * + * TODO: + * - Expansion bus + * + */ + +#include "emu.h" + +#include "bus/centronics/ctronics.h" +#include "bus/nscsi/devices.h" +#include "bus/rs232/rs232.h" +#include "cpu/m68000/m68000.h" +#include "imagedev/floppy.h" +#include "machine/mc68681.h" +#include "machine/ncr5380.h" +#include "machine/wd_fdc.h" + + +namespace { + +class ms68k_state : public driver_device +{ +public: + ms68k_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_bootvect(*this, "bootvect") + , m_maincpu(*this, "maincpu") + , m_duart(*this, "duart") + , m_terminal(*this, "terminal") + , m_modem(*this, "modem") + , m_fdc(*this, "fdc") + , m_floppy(*this, "fdc:%u", 0) + , m_floppy_selected_drive(0) + , m_scsi(*this, "scsibus:7:ncr5380") + , m_scsibus(*this, "scsibus") + , m_printer_conn(*this, "prn") + , m_printer_out(*this, "prn_out") + { } + + void ms68k(machine_config &config) ATTR_COLD; + + DECLARE_INPUT_CHANGED_MEMBER(nmi_button); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + +private: + memory_view m_bootvect; + + required_device m_maincpu; + + required_device m_duart; + required_device m_terminal; + required_device m_modem; + + required_device m_fdc; + required_device_array m_floppy; + uint8_t m_floppy_selected_drive; + + required_device m_scsi; + required_device m_scsibus; + + required_device m_printer_conn; + required_device m_printer_out; + + void mem_map(address_map &map) ATTR_COLD; + + uint8_t duart_r(offs_t offset); + void duart_w(offs_t offset, uint8_t data); + + // Floppy + static void floppy_types(device_slot_interface &device) ATTR_COLD; + static void floppy_formats(format_registration &fr) ATTR_COLD; + void floppy_side_w(int state); + void floppy_drive0_w(int state); + void floppy_drive1_w(int state); + void floppy_drive_select(int drive); + + // Printer + uint8_t printer_r(offs_t offset); + void printer_w(offs_t offset, uint8_t data); +}; + +/* Input ports */ +static INPUT_PORTS_START( ms68k ) + PORT_START("ABORT") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("NMI button") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, ms68k_state, nmi_button, 0) +INPUT_PORTS_END + + +void ms68k_state::ms68k(machine_config &config) +{ + M68000(config, m_maincpu, 16_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &ms68k_state::mem_map); + + // Set up DUART. + + MC68681(config, m_duart, 16_MHz_XTAL / 2); + // DUART Interrupt = 3 + m_duart->irq_cb().set_inputline(m_maincpu, M68K_IRQ_3); + m_duart->a_tx_cb().set(m_terminal, FUNC(rs232_port_device::write_txd)); + // DUART OP0 = RTS A + m_duart->outport_cb().append(m_terminal, FUNC(rs232_port_device::write_rts)).bit(0); + m_duart->b_tx_cb().set(m_modem, FUNC(rs232_port_device::write_txd)); + // DUART OP1 = RTS B + m_duart->outport_cb().append(m_modem, FUNC(rs232_port_device::write_rts)).bit(1); + // DUART OP3 = Floppy Side 1 Select + m_duart->outport_cb().append(FUNC(ms68k_state::floppy_side_w)).bit(3); + // DUART OP4 = Floppy Drive Select 0 + m_duart->outport_cb().append(FUNC(ms68k_state::floppy_drive0_w)).bit(4); + // DUART OP5 = Floppy Drive Select 1 + m_duart->outport_cb().append(FUNC(ms68k_state::floppy_drive1_w)).bit(5); + // DUART OP6 = Floppy Double Density + m_duart->outport_cb().append(m_fdc, FUNC(wd1772_device::dden_w)).bit(6); + // DUART OP2 = Printer Initialize + m_duart->outport_cb().append(m_printer_conn, FUNC(centronics_device::write_init)).bit(2); + // DUART OP7 = Printer Data Strobe + m_duart->outport_cb().append(m_printer_conn, FUNC(centronics_device::write_strobe)).bit(7); + + // Set up terminal RS-232. + + RS232_PORT(config, m_terminal, default_rs232_devices, "terminal"); + m_terminal->rxd_handler().set(m_duart, FUNC(mc68681_device::rx_a_w)); + // DUART IP0 = CTS + m_terminal->cts_handler().set(m_duart, FUNC(mc68681_device::ip0_w)); + + // Set up modem RS-232. + + RS232_PORT(config, m_modem, default_rs232_devices, nullptr); + m_modem->rxd_handler().set(m_duart, FUNC(mc68681_device::rx_b_w)); + // DUART IP1 = CTS + m_modem->cts_handler().set(m_duart, FUNC(mc68681_device::ip1_w)); + + // Set up SCSI. + + NSCSI_BUS(config, m_scsibus); + NSCSI_CONNECTOR(config, "scsibus:0", default_scsi_devices, "harddisk", false); + NSCSI_CONNECTOR(config, "scsibus:1", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:2", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:3", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:4", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:5", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:6", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsibus:7").option_set("ncr5380", NCR53C80) + .machine_config([this](device_t *device) { + // SCSI Interrupt = 5 + downcast(*device).irq_handler().set_inputline(m_maincpu, M68K_IRQ_5); + }); + + // Set up FDC. + + WD1772(config, m_fdc, 16_MHz_XTAL / 2); + // FDC Interrupt = 4 + m_fdc->intrq_wr_callback().set_inputline(m_maincpu, M68K_IRQ_3); + FLOPPY_CONNECTOR(config, m_floppy[0], floppy_types, "525sd", floppy_formats); + FLOPPY_CONNECTOR(config, m_floppy[1], floppy_types, "525sd", floppy_formats); + + // Set up printer. + + CENTRONICS(config, m_printer_conn, centronics_devices, "printer"); + OUTPUT_LATCH(config, m_printer_out); + m_printer_conn->set_output_latch(*m_printer_out); + // Printer Interrupt = 2 + m_printer_conn->ack_handler().append_inputline(m_maincpu, M68K_IRQ_2); + // DUART IP2 = Busy + m_printer_conn->busy_handler().set(m_duart, FUNC(mc68681_device::ip2_w)); + // DUART IP3 = Paper Out + m_printer_conn->perror_handler().set(m_duart, FUNC(mc68681_device::ip3_w)); + // DUART IP4 = Device Selected + m_printer_conn->select_handler().set(m_duart, FUNC(mc68681_device::ip4_w)); + // DUART IP5 = Acknowledge + m_printer_conn->ack_handler().set(m_duart, FUNC(mc68681_device::ip5_w)); + + // Set up Expansion. + // EXT Interrupt = 6 + // TODO: Implement expansion bus. +} + +void ms68k_state::mem_map(address_map &map) +{ + map.unmap_value_high(); + map(0x000000, 0x07ffff).ram().share("ram"); // 512KB RAM onboard maximum + map(0x000008, 0x07ffff).ram(); + map(0xd00000, 0xd7ffff).rw(m_scsi, FUNC(ncr5380_device::read), FUNC(ncr5380_device::write)).umask16(0x00ff); + map(0xd80000, 0xdfffff).rw(FUNC(ms68k_state::printer_r), FUNC(ms68k_state::printer_w)).umask16(0x00ff); + map(0xe00000, 0xe7ffff).rw(m_fdc, FUNC(wd1772_device::read), FUNC(wd1772_device::write)).umask16(0x00ff); + map(0xe80000, 0xefffff).r(m_duart, FUNC(mc68681_device::read)).w(FUNC(ms68k_state::duart_w)).umask16(0x00ff); + map(0xf00000, 0xf1ffff).rom().region("roms", 0); // 128KB ROM onboard maximum + + // ROM is mapped to 0 on reset, remapped on first DUART write + map(0x000000, 0x000007).view(m_bootvect); + m_bootvect[0](0x000000, 0x000007).rom().region("roms", 0); +} + +void ms68k_state::machine_start() +{ + save_item(NAME(m_floppy_selected_drive)); +} + +void ms68k_state::machine_reset() +{ + // Reset pointer to bootvector in ROM for bootvector view + m_bootvect.select(0); +} + +/* DUART */ + +void ms68k_state::duart_w(offs_t offset, uint8_t data) +{ + m_duart->write(offset, data); + + // The first write to the DUART also swaps ROM and RAM. + if (m_bootvect.entry().has_value()) { + m_bootvect.disable(); // stop mapping ROM until reset + } +} + +/* Floppy */ + +void ms68k_state::floppy_types(device_slot_interface &device) +{ + device.option_add("525sd", FLOPPY_525_SD); + device.option_add("525dd", FLOPPY_525_DD); + device.option_add("35dd", FLOPPY_35_DD); + device.option_add("35hd", FLOPPY_35_HD); +} + +void ms68k_state::floppy_formats(format_registration &fr) +{ + floppy_image_device::default_mfm_floppy_formats(fr); +} + +void ms68k_state::floppy_side_w(int state) +{ + floppy_image_device *floppy = nullptr; + floppy = m_floppy[m_floppy_selected_drive]->get_device(); + if (floppy) { + floppy->ss_w(state); + } +} + +void ms68k_state::floppy_drive0_w(int state) +{ + if (state) + floppy_drive_select(0); +} + +void ms68k_state::floppy_drive1_w(int state) +{ + if (state) + floppy_drive_select(1); +} + +void ms68k_state::floppy_drive_select(int drive) +{ + m_floppy_selected_drive = drive; + floppy_image_device *floppy = nullptr; + floppy = m_floppy[m_floppy_selected_drive]->get_device(); + m_fdc->set_floppy(floppy); +} + + +/* Printer */ +uint8_t ms68k_state::printer_r(offs_t offset) +{ + return 0; +} + +void ms68k_state::printer_w(offs_t offset, uint8_t data) +{ + m_printer_out->write(data); +} + + +/* NMI button */ +INPUT_CHANGED_MEMBER(ms68k_state::nmi_button) +{ + m_maincpu->set_input_line(M68K_IRQ_7, newval ? ASSERT_LINE : CLEAR_LINE); +} + + +/* ROM definition */ +ROM_START( ms68k ) + ROM_REGION16_BE(0x20000, "roms", ROMREGION_ERASE00) + ROM_DEFAULT_BIOS("msmon") + + ROM_SYSTEM_BIOS(0, "msmon", "MSMON") + ROMX_LOAD("msmonu27.bin", 0x000000, 0x010000, CRC(b278ea2a) SHA1(383911c213448d41198f2b44494376c1dc26e897), ROM_SKIP(1) | ROM_BIOS(0) ) + ROMX_LOAD("msmonu26.bin", 0x000001, 0x010000, CRC(7ff029cf) SHA1(4338ef716d455fd86e1c32c04e146d2be1603dff), ROM_SKIP(1) | ROM_BIOS(0) ) +ROM_END + +} // anonymous namespace + + +/* Driver */ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1981, ms68k, 0, 0, ms68k, ms68k, ms68k_state, empty_init, "Marion Systems", "MS68K", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/trainer/pro80.cpp b/src/mame/trainer/pro80.cpp index 4ff840b416934..bdb4e92dcefc8 100644 --- a/src/mame/trainer/pro80.cpp +++ b/src/mame/trainer/pro80.cpp @@ -179,7 +179,7 @@ void pro80_state::machine_start() { save_item(NAME(m_digit_sel)); save_item(NAME(m_cass_in)); - save_pointer(NAME(m_cass_data) ,4); + save_item(NAME(m_cass_data)); } void pro80_state::pro80(machine_config &config) diff --git a/src/mame/trs/coco3.cpp b/src/mame/trs/coco3.cpp index d3dae6e1711d0..6d5af8e936c22 100644 --- a/src/mame/trs/coco3.cpp +++ b/src/mame/trs/coco3.cpp @@ -311,7 +311,7 @@ void coco3_state::coco3(machine_config &config) // monitor SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(28.636363_MHz_XTAL/2, 912, 0, 640-1, 262, 1, 241-1); + m_screen->set_raw(28.636363_MHz_XTAL/2, 912, 0, 640, 262, 1, 240); m_screen->set_screen_update(FUNC(coco3_state::screen_update)); // internal ram diff --git a/src/mame/tvgames/generalplus_gpl16250_spi.cpp b/src/mame/tvgames/generalplus_gpl16250_spi.cpp index 08f48766dba37..85ad2e5beed8a 100644 --- a/src/mame/tvgames/generalplus_gpl16250_spi.cpp +++ b/src/mame/tvgames/generalplus_gpl16250_spi.cpp @@ -3,8 +3,8 @@ /* GPL16250* games using SPI Flash + RAM configuration - *part number could be different for these, they've only - been seen as globtops + *part number could be different for these, they've only + been seen as globtops */ #include "emu.h" @@ -140,6 +140,14 @@ ROM_START( prailpls ) ROM_LOAD16_WORD_SWAP( "mx25l25635f.u9", 0x0000, 0x2000000, CRC(17faefb0) SHA1(1d31c5aa1a37882f74c08414f69c4285149352b7) ) ROM_END +ROM_START( anpanbd ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only (if it exists at all) + + ROM_REGION(0x1000000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP( "mx25l12835f.u2", 0x0000, 0x1000000, CRC(c4be09d7) SHA1(c9098d0c1c9db649a010f67469f500b69407372f) ) +ROM_END + void generalplus_gpspispi_game_state::init_spi() { @@ -192,4 +200,7 @@ void generalplus_gpspispi_game_state::init_spi() // ぼくはプラレール運転士 新幹線で行こう!プラス (I am a Plarail driver Let's go by Shinkansen! Plus) CONS(2015, prailpls, 0, 0, generalplus_gpspispi, gcm394, generalplus_gpspispi_game_state, init_spi, "Takara Tomy", "Boku wa Plarail Untenshi Shinkansen de Ikou! Plus (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // has built-in screen, but can be connected to a TV +// this is a half-head shaped unit, SHP13017-R1 main PCB - アンパンマン レッツゴー!育脳ドライブ きみものれるよ!アンパンマンごう「それいけ!アンパンマン」 +CONS(2014, anpanbd, 0, 0, generalplus_gpspispi, gcm394, generalplus_gpspispi_game_state, init_spi, "JoyPalette", "Anpanman: Let's Go! Ikunou Drive (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) + CONS(2015, bkrankp, 0, 0, generalplus_gpspispi_bkrankp, gcm394, generalplus_gpspispi_bkrankp_game_state, init_spi, "Bandai", "Karaoke Ranking Party (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/tvgames/generalplus_gpl32612.cpp b/src/mame/tvgames/generalplus_gpl32612.cpp index 5afd315952f05..af190c1e1413a 100644 --- a/src/mame/tvgames/generalplus_gpl32612.cpp +++ b/src/mame/tvgames/generalplus_gpl32612.cpp @@ -23,7 +23,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" #include "softlist_dev.h" diff --git a/src/mame/tvgames/gpm4530a_lexibook_jg7420.cpp b/src/mame/tvgames/gpm4530a_lexibook_jg7420.cpp index 9ce8574ad1579..fee77505602d6 100644 --- a/src/mame/tvgames/gpm4530a_lexibook_jg7420.cpp +++ b/src/mame/tvgames/gpm4530a_lexibook_jg7420.cpp @@ -6,7 +6,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "machine/spi_sdcard.h" #include "screen.h" diff --git a/src/mame/tvgames/micom_mahjong.cpp b/src/mame/tvgames/micom_mahjong.cpp index 4f1224da9bcc9..a8956c6774707 100644 --- a/src/mame/tvgames/micom_mahjong.cpp +++ b/src/mame/tvgames/micom_mahjong.cpp @@ -25,6 +25,7 @@ Hardware notes: *******************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "sound/dac.h" @@ -83,7 +84,7 @@ void mmahjong_state::machine_start() /******************************************************************************* - I/O + Video *******************************************************************************/ u32 mmahjong_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -92,6 +93,16 @@ u32 mmahjong_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c return 0; } +static GFXDECODE_START( gfx_mmahjong ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 1 ) +GFXDECODE_END + + + +/******************************************************************************* + I/O +*******************************************************************************/ + void mmahjong_state::vram_w(offs_t offset, u8 data) { m_vram[offset] = data; @@ -133,7 +144,7 @@ void mmahjong_state::main_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x5000, 0x53ff).ram(); - map(0x6000, 0x63ff).w(FUNC(mmahjong_state::vram_w)).share("vram"); + map(0x6000, 0x63ff).w(FUNC(mmahjong_state::vram_w)).share(m_vram); map(0x7001, 0x7001).r(FUNC(mmahjong_state::input_r)); map(0x7002, 0x7002).w(FUNC(mmahjong_state::input_w)); map(0x7004, 0x7004).w(FUNC(mmahjong_state::sound_w)); @@ -181,10 +192,6 @@ INPUT_PORTS_END Machine Configs *******************************************************************************/ -static GFXDECODE_START( gfx_mmahjong ) - GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 1 ) -GFXDECODE_END - void mmahjong_state::mmahjong(machine_config &config) { // basic machine hardware diff --git a/src/mame/tvgames/monkey_king_3b.cpp b/src/mame/tvgames/monkey_king_3b.cpp index 7f92741565bb6..ca19b80f97c4f 100644 --- a/src/mame/tvgames/monkey_king_3b.cpp +++ b/src/mame/tvgames/monkey_king_3b.cpp @@ -65,7 +65,6 @@ debug possibilities. #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/tvgames/spg110.cpp b/src/mame/tvgames/spg110.cpp index 49738e0c4bc28..da72a10dc583b 100644 --- a/src/mame/tvgames/spg110.cpp +++ b/src/mame/tvgames/spg110.cpp @@ -47,7 +47,7 @@ class spg110_game_state : public driver_device void spg110_base(machine_config &config); void spg110_spdmo(machine_config& config); - DECLARE_CUSTOM_INPUT_MEMBER(plunger_r); + ioport_value plunger_r(); protected: required_device m_maincpu; @@ -247,7 +247,7 @@ static INPUT_PORTS_START( jak_capb ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(spg110_game_state::plunger_r) +ioport_value spg110_game_state::plunger_r() { // this is only needed because our PORT_CENTERDELTA doesn't work if set > 255 (and is limited in the menu to that) such a value that doesn't center quickly enough for the plunger to be effective return ioport("JOYY_REAL")->read()<<2; diff --git a/src/mame/tvgames/spg2xx.cpp b/src/mame/tvgames/spg2xx.cpp index 3ec99264ac7d6..2954770c4426d 100644 --- a/src/mame/tvgames/spg2xx.cpp +++ b/src/mame/tvgames/spg2xx.cpp @@ -790,12 +790,12 @@ static INPUT_PORTS_START( doyousud ) INPUT_PORTS_END -CUSTOM_INPUT_MEMBER(spg2xx_game_fordrace_state::wheel_r) +ioport_value spg2xx_game_fordrace_state::wheel_r() { return ioport("WHEEL_REAL")->read() >> 1; } -CUSTOM_INPUT_MEMBER(spg2xx_game_fordrace_state::wheel2_r) +ioport_value spg2xx_game_fordrace_state::wheel2_r() { // return 0x0800; uint16_t dat = ioport("WHEEL_REAL")->read(); @@ -1334,6 +1334,28 @@ static INPUT_PORTS_START( virtten ) PORT_MODIFY("P3") INPUT_PORTS_END + +static INPUT_PORTS_START( ddr33v ) + PORT_INCLUDE( spg2xx ) + + PORT_MODIFY("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // quits out of songs + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_MODIFY("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_MODIFY("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) + +INPUT_PORTS_END + + void spg2xx_game_state::machine_start() { if (m_bank) @@ -1850,7 +1872,6 @@ void spg2xx_game_lexiart_state::lexiart(machine_config &config) 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) { int bank = 0; @@ -2039,6 +2060,12 @@ void spg2xx_game_doraphone_state::doraphonep(machine_config &config) m_screen->set_refresh_hz(50); } +void spg2xx_game_ddr33v_state::init_ddr33v() +{ + // what is this checking? timer? battery state? protection? it goes to a blank screen after the boot logo otherwise + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); + rom[0x208055] = 0x4440; +} ROM_START( rad_skat ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) @@ -2293,6 +2320,12 @@ ROM_START( virtten ) ROM_LOAD16_WORD_SWAP( "virttennis.bin", 0x000000, 0x400000, CRC(e665bea9) SHA1(8c2c9f879c929e224cd885165ed60aed8baeb19d) ) ROM_END +ROM_START( ddr33v ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "ddr33v.bin", 0x000000, 0x800000, CRC(56c7015c) SHA1(a1faef2ab6eb191dea1497f8cfd4ccbd8c504e6d) ) +ROM_END + + void spg2xx_game_state::init_crc() { // several games have a byte sum checksum listed at the start of ROM, this little helper function logs what it should match. @@ -2466,3 +2499,7 @@ CONS( 2005, doyousud, 0, 0, spg2xx, doyousud, spg2xx_game_state, CONS( 200?, virtbb, 0, 0, spg2xx, virtbb, spg2xx_game_state, empty_init, "VTG Interactive", "Virtual Baseball (VTG)", MACHINE_NOT_WORKING ) // motion controls not fully understood CONS( 200?, virtten, 0, 0, spg2xx, virtten, spg2xx_game_state, empty_init, "VTG Interactive", "Virtual Tennis (VTG)", MACHINE_NOT_WORKING ) // motion controls not fully understood + +// 2007 ingame, 2008 on box. Hyperkin is mentioned as being the registered trademark holder alongside DDRGame on the box. +// Songs "composed by Kenneth Baylon" +CONS( 2008, ddr33v, 0, 0, spg2xx, ddr33v, spg2xx_game_ddr33v_state, init_ddr33v, "DDRGame / Hyperkin", "16-bit TV Dance Pad with 15 songs / Dance Dance Party Mix (DDRGame)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/tvgames/spg2xx.h b/src/mame/tvgames/spg2xx.h index 7e9b27a626365..11aaf07e874eb 100644 --- a/src/mame/tvgames/spg2xx.h +++ b/src/mame/tvgames/spg2xx.h @@ -270,8 +270,8 @@ class spg2xx_game_fordrace_state : public spg2xx_game_state void fordrace(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(wheel_r); - DECLARE_CUSTOM_INPUT_MEMBER(wheel2_r); + ioport_value wheel_r(); + ioport_value wheel2_r(); private: }; @@ -377,6 +377,18 @@ class spg2xx_game_doraphone_state : public spg2xx_game_state required_ioport_array<6> m_io_p1_rows; }; +class spg2xx_game_ddr33v_state : public spg2xx_game_state +{ +public: + spg2xx_game_ddr33v_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag) + { } + + void init_ddr33v(); + +protected: +private: +}; #endif // MAME_TVGAMES_SPG2XX_H diff --git a/src/mame/tvgames/titan_soc.cpp b/src/mame/tvgames/titan_soc.cpp index 6403e66dece7c..f6a7629c85a28 100644 --- a/src/mame/tvgames/titan_soc.cpp +++ b/src/mame/tvgames/titan_soc.cpp @@ -64,7 +64,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "emupal.h" #include "screen.h" diff --git a/src/mame/tvgames/trkfldch.cpp b/src/mame/tvgames/trkfldch.cpp index 00eb59bff29c4..f49f133a36497 100644 --- a/src/mame/tvgames/trkfldch.cpp +++ b/src/mame/tvgames/trkfldch.cpp @@ -795,7 +795,7 @@ void trkfldch_state::trkfldch_map(address_map &map) map(0x007870, 0x0078ff).rw(FUNC(trkfldch_state::unkregs_r), FUNC(trkfldch_state::unkregs_w)); - map(0x008000, 0x7fffff).rom().region("maincpu", 0x000000); // good for code mapped at 008000 and 050000 at least + map(0x008000, 0xffffff).rom().region("maincpu", 0x000000); // good for code mapped at 008000 and 050000 at least } void trkfldch_state::vectors_map(address_map &map) @@ -935,6 +935,53 @@ static INPUT_PORTS_START( trkfldch ) PORT_START("IN3") INPUT_PORTS_END +static INPUT_PORTS_START( konsb ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_DIPNAME( 0x01, 0x01, "IN1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_START("IN3") +INPUT_PORTS_END + static INPUT_PORTS_START( my1stddr ) PORT_START("IN0") PORT_DIPNAME( 0x01, 0x01, "IN0" ) @@ -1557,30 +1604,114 @@ void trkfldch_state::trkfldch(machine_config &config) } ROM_START( trkfldch ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "trackandfield.bin", 0x000000, 0x400000, CRC(f4f1959d) SHA1(344dbfe8df1897adf77da6e5ca0435c4d47d6842) ) ROM_END ROM_START( my1stddr ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "myfirstddr.bin", 0x000000, 0x400000, CRC(2ef57bfc) SHA1(9feea5adb9de8fe17e915f3a037e8ddd70e58ae7) ) ROM_END ROM_START( abl4play ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "abl4play.bin", 0x000000, 0x800000, CRC(5d57fb70) SHA1(34cdf80dc8cb08e5cd98c724268e4c5f483780d7) ) ROM_END ROM_START( shtscore ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "shootnscore.bin", 0x000000, 0x400000, CRC(37aa16bd) SHA1(609d0191301480c51ec1188c67101a4e88a5170f) ) ROM_END ROM_START( lexitvsprt ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "29l3211.u2a", 0x000000, 0x400000, CRC(65e5223c) SHA1(13eae6e34100fb9761335e87a3cf728bb31e860f) ) ROM_END +/* +Included with Orange model + + しあわせのおうじ (イギリス民話) + Shiawase no Ouji (English minwa) + ほしのぎんか (グリム童話) + Hoshi no Ginka (Grimm douwa) + おやゆびひめ (アンデルセン) + Oyayubi-hime (Anderson) + こびととくつや (グリム童話) + Kobi to Toku Tsuya (Grimm douwa) + みっつのねがい (日本昔話) + Mittsu no Negai (Nippon mukashi banashi) + うらしまたろう (日本昔話) + Urashima Tarou (Nippon mukashi banashi) + アフロンとがまじいの ちきゅうにやさしく (オリジナル) + Afuron to Gamajii no Chikyuu ni Yasashiku (Original) + かさこじぞう (日本昔話) + Kasakojizo (Nippon mukashi banashi) + きんのがちょう (グリム童話) + Kin no Gachou (Grimm douwa) + あそんでまなぼう (オリジナル) + Asonde Manabou (Original) +*/ +ROM_START( teleshi ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "s29gl128n90tfir.bin", 0x000000, 0x1000000, CRC(8c032142) SHA1(7dff151ea1abd5911e753f0708b0b4f66599791f) ) +ROM_END + +/* +Included with Purple model + + ももたろう (日本昔話) + Momotarou (Nippon mukashi banashi) + あかずきん (グリム童話) + Aka Zukin (Grimm douwa) + きたかぜのくれたテーブルかけ (ノルウェー民話) + Kita Kaze no Kureta Table Kake (Norway minwa) + いっすんぼうし (日本昔話) + Issun-boushi (Nippon mukashi banashi) + おおきなかぶ (ロシア民話) + Ookina Kabu (Russia minwa) + ありときりぎりす (イソップ童話) + Ari to Kirigirisu (Aesop douwa) + マッチうりのしょうじょ (アンデルセン) + Match Uri no Shoujo (Anderson) + かさこじぞう (日本昔話) + Kasa Jizou (Nippon mukashi banashi) + きんのがちょう (グリム童話) + Kin no Gachou (Grimm douwa) + あそんでまなぼう2 (オリジナル) + Asonde Manabou 2 (Original) +*/ +ROM_START( teleship ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "s29gl128n90tfir2.bin", 0x000000, 0x1000000, CRC(28c12a48) SHA1(68557849e2b6f3669de76540de841ca99119ec58) ) +ROM_END + +/* +The following were also available (via the Download service?) + +世界のお話 (ナレーション入り) [Sekai no Ohanashi (Narration-iri)] + + ブレーメンのおんがくたい (グリム童話) + Bremen no Ongakutai (Grimm douwa) + みにくいあひるのこ (アンデルセン) + Minikui Ahiru no Ko (Andersen) + てぶくろ (ウクライナ民話) + Tebukuro (Ukraine minwa) + はちかつぎひめ (日本昔話) + Hachi Katsugi-hime (Nippon mukashi banashi) + +遊んで学ぼう・お歌で遊ぼう [Asonde Manabu - Outa de Asobou] + + あそんでまなぼう (オリジナル) + Asonde Manabou (Original) + あそんでまなぼう2 (オリジナル) + Asonde Manabou 2 (Original) + おうたであそぼう3 (オリジナル) + Asonde Manabou 3 (Original) + おうたであそぼう4 (オリジナル) + Asonde Manabou 4 (Original) +*/ + } // anonymous namespace @@ -1590,3 +1721,7 @@ CONS( 2006, my1stddr, 0, 0, trkfldch, my1stddr,trkfldch_state, e CONS( 200?, abl4play, 0, 0, trkfldch, abl4play,trkfldch_state, empty_init, "Advance Bright Ltd", "4 Player System - 10 in 1", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) CONS( 200?, shtscore, 0, 0, trkfldch, shtscore,trkfldch_state, empty_init, "Halsall / time4toys.com / Electronic Games", "Shoot n' Score", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) CONS( 200?, lexitvsprt,0, 0, trkfldch, lexi, trkfldch_lexi_state, empty_init, "Lexibook", "TV Sports Plug & Play 5-in-1 (JG7000)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) + +// additional online content could be downloaded onto these if they were connected to a PC via USB +CONS( 2008, teleshi, 0, 0, trkfldch, konsb, trkfldch_state, empty_init, "Konami", "Teleshibai (Japan)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // テレしばい - this one is orange +CONS( 2008, teleship, 0, 0, trkfldch, konsb, trkfldch_state, empty_init, "Konami", "Teleshibai - Purple Version (Japan)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // テレしばい (パープルバージョン) - this has Purple Version as part of the name on the box diff --git a/src/mame/tvgames/xavix.cpp b/src/mame/tvgames/xavix.cpp index 36fa48111c763..5df4e4697101b 100644 --- a/src/mame/tvgames/xavix.cpp +++ b/src/mame/tvgames/xavix.cpp @@ -1240,6 +1240,15 @@ static INPUT_PORTS_START( evio ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. INPUT_PORTS_END +static INPUT_PORTS_START( daig ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN0") + + PORT_MODIFY("IN1") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. +INPUT_PORTS_END + static INPUT_PORTS_START( gcslottv ) // TODO: proper button names PORT_INCLUDE(xavix) @@ -1604,6 +1613,14 @@ void xavix_cart_state::xavix_cart_evio(machine_config &config) SOFTWARE_LIST(config, "cart_list_evio").set_original("evio"); } +void xavix_cart_state::xavix_cart_daig(machine_config &config) +{ + xavix_cart(config); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); + + SOFTWARE_LIST(config, "cart_list_daig").set_original("takara_daigunder_dx_cart"); +} + void xavix_cart_gcslottv_state::xavix_cart_gcslottv(machine_config &config) { xavix_cart(config); @@ -2109,6 +2126,13 @@ ROM_START( evio ) ROM_RELOAD(0x000000, 0x200000) ROM_END +// 爆闘宣言ダイガンダー +ROM_START( tak_daig ) + ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) + ROM_LOAD( "robottransformer_unit.bin", 0x600000, 0x200000, CRC(02deddaa) SHA1(7d7b54684f8b0b92daf02738560779c7df627b91) ) + ROM_RELOAD(0x000000, 0x200000) +ROM_END + // ガチンコ勝負! パチスロTV ROM_START( gcslottv ) @@ -2272,7 +2296,11 @@ CONS( 2003, taikodp, 0, 0, xavix_i2c_taiko, taikodp, xavix_i2c_car CONS( 2004, jpopira, 0, 0, xavix_i2c_jpopira,jpopira, xavix_i2c_cart_state, init_xavix, "Takara / SSD Company LTD", "Jumping Popira (Japan)", MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) -CONS( 2003, evio, 0, 0, xavix_cart_evio, evio, xavix_evio_cart_state, init_xavix, "Tomy / SSD Company LTD", "Evio (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) // inputs? it's a violin controller +CONS( 2003, evio, 0, 0, xavix_cart_evio, evio, xavix_evio_cart_state,init_xavix, "Tomy / SSD Company LTD", "Evio (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) // inputs? it's a violin controller + +// 2 ROM expansion cartridges were available for this, in the form of other robots (the heads acts as cartridges) see takara_daigunder_dx_cart.xml +// a number of other robots were also available, but those act as controllers and don't plug into the ROM slot (presumably the signal sent is used to determine the character) +CONS( 2002, tak_daig, 0, 0, xavix_cart_daig, daig, xavix_daig_cart_state,init_xavix, "Takara / SSD Company LTD", "Bakutou Sengen Daigunder DX (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) // inputs? maybe IO interrupt? CONS( 2002, gcslottv, 0, 0, xavix_cart_gcslottv, gcslottv, xavix_cart_gcslottv_state, init_xavix, "Takara / Sammy / DCT / SSD Company LTD", "Gachinko Shoubu! PachisloTV (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) diff --git a/src/mame/tvgames/xavix.h b/src/mame/tvgames/xavix.h index 07251d3494275..f838246f71702 100644 --- a/src/mame/tvgames/xavix.h +++ b/src/mame/tvgames/xavix.h @@ -717,6 +717,7 @@ class xavix_cart_state : public xavix_state void xavix_cart_popira(machine_config &config); void xavix_cart_ddrfammt(machine_config &config); void xavix_cart_evio(machine_config &config); + void xavix_cart_daig(machine_config &config); protected: @@ -950,6 +951,16 @@ class xavix_evio_cart_state : public xavix_cart_state virtual void write_io1(uint8_t data, uint8_t direction) override; }; +class xavix_daig_cart_state : public xavix_cart_state +{ +public: + xavix_daig_cart_state(const machine_config &mconfig, device_type type, const char *tag) + : xavix_cart_state(mconfig,type,tag) + { } + +protected: +}; + class xavix_ekara_state : public xavix_cart_state { public: diff --git a/src/mame/universal/ladybug.cpp b/src/mame/universal/ladybug.cpp index 4fbbd53c71f17..13ec126373e7c 100644 --- a/src/mame/universal/ladybug.cpp +++ b/src/mame/universal/ladybug.cpp @@ -78,8 +78,8 @@ class ladybug_state : public driver_device , m_p2_control(*this, "CONTP2") { } - DECLARE_CUSTOM_INPUT_MEMBER(ladybug_p1_control_r); - DECLARE_CUSTOM_INPUT_MEMBER(ladybug_p2_control_r); + ioport_value ladybug_p1_control_r(); + ioport_value ladybug_p2_control_r(); DECLARE_INPUT_CHANGED_MEMBER(coin1_inserted); DECLARE_INPUT_CHANGED_MEMBER(coin2_inserted); void ladybug(machine_config &config); @@ -267,12 +267,12 @@ INPUT_CHANGED_MEMBER(ladybug_state::coin2_inserted) m_maincpu->set_input_line(0, HOLD_LINE); } -CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r) +ioport_value ladybug_state::ladybug_p1_control_r() { return m_p1_control->read(); } -CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) +ioport_value ladybug_state::ladybug_p2_control_r() { // upright cabinet only uses a single set of controls */ return ((m_port_dsw0->read() & 0x20) ? m_p2_control : m_p1_control)->read(); diff --git a/src/mame/upl/nova2001.cpp b/src/mame/upl/nova2001.cpp index 97a7ae5ea11ba..8a644fed2f59f 100644 --- a/src/mame/upl/nova2001.cpp +++ b/src/mame/upl/nova2001.cpp @@ -139,7 +139,7 @@ e000 - e7ff R/W Work RAM * *************************************/ -CUSTOM_INPUT_MEMBER(nova2001_state::ninjakun_io_A002_ctrl_r) +ioport_value nova2001_state::ninjakun_io_A002_ctrl_r() { return m_ninjakun_io_a002_ctrl; } diff --git a/src/mame/upl/nova2001.h b/src/mame/upl/nova2001.h index 4a9b6d6723595..709e0f1b69d1e 100644 --- a/src/mame/upl/nova2001.h +++ b/src/mame/upl/nova2001.h @@ -31,7 +31,7 @@ class nova2001_state : public driver_device void init_raiders5(); void init_pkunwar(); - DECLARE_CUSTOM_INPUT_MEMBER(ninjakun_io_A002_ctrl_r); + ioport_value ninjakun_io_A002_ctrl_r(); private: required_device m_maincpu; diff --git a/src/mame/ussr/b2m_m.cpp b/src/mame/ussr/b2m_m.cpp index e1b1daad3d0f0..d999c5c6e5f3e 100644 --- a/src/mame/ussr/b2m_m.cpp +++ b/src/mame/ussr/b2m_m.cpp @@ -214,7 +214,7 @@ void b2m_state::machine_start() save_item(NAME(m_video_page)); save_item(NAME(m_romdisk_lsb)); save_item(NAME(m_romdisk_msb)); - save_pointer(NAME(m_color), 4); + save_item(NAME(m_color)); save_item(NAME(m_localmachine)); save_item(NAME(m_vblank_state)); diff --git a/src/mame/ussr/bk.cpp b/src/mame/ussr/bk.cpp index d2f644ef12262..dd8b084129b59 100644 --- a/src/mame/ussr/bk.cpp +++ b/src/mame/ussr/bk.cpp @@ -98,7 +98,6 @@ void bk_state::bk0010(machine_config &config) m_kbd->keydown_wr_callback().set( [this] (int state) { - m_sel1 |= SEL1_UPDATED; if (state) m_sel1 &= ~SEL1_KEYDOWN; else diff --git a/src/mame/ussr/bk_m.cpp b/src/mame/ussr/bk_m.cpp index 77f4d68cb1fa8..488989f9a60a3 100644 --- a/src/mame/ussr/bk_m.cpp +++ b/src/mame/ussr/bk_m.cpp @@ -44,7 +44,8 @@ uint16_t bk_state::sel1_r() { double level = m_cassette->input(); uint16_t data = 0100000 | m_sel1 | ((level < 0) ? 0 : SEL1_RX_CAS); - m_sel1 &= ~SEL1_UPDATED; + if (!machine().side_effects_disabled()) + m_sel1 &= ~SEL1_UPDATED; return data; } diff --git a/src/mame/ussr/debut.cpp b/src/mame/ussr/debut.cpp index f15409f83ba16..cf4f7b80c4dc7 100644 --- a/src/mame/ussr/debut.cpp +++ b/src/mame/ussr/debut.cpp @@ -13,7 +13,7 @@ Also sold in 1996 as Феникс (Fenix), same ROM contents as Debut-M. - where does the interrupt come from? - Debut-M is an updated version? Or is it the same program as Debut with a redesigned case? -******************************************************************************** +================================================================================ Hardware notes: - КР1810ВМ86 (i8086 clone), 16200K XTAL @@ -211,7 +211,7 @@ static INPUT_PORTS_START( debutm ) 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_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(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME(u8"ВП (Take Back)") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME(u8"УР (Level)") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME(u8"ВВ (Enter Position)") diff --git a/src/mame/ussr/istrebiteli.cpp b/src/mame/ussr/istrebiteli.cpp index 5c7d08c449226..9022fa8d67433 100644 --- a/src/mame/ussr/istrebiteli.cpp +++ b/src/mame/ussr/istrebiteli.cpp @@ -159,7 +159,7 @@ class istrebiteli_state : public driver_device void motogonki(machine_config &config); template int collision_r(); - DECLARE_CUSTOM_INPUT_MEMBER(coin_r); + ioport_value coin_r(); DECLARE_INPUT_CHANGED_MEMBER(coin_inc); @@ -482,7 +482,7 @@ int istrebiteli_state::collision_r() return m_spr_collision[ID]; } -CUSTOM_INPUT_MEMBER(istrebiteli_state::coin_r) +ioport_value istrebiteli_state::coin_r() { return coin_count; } diff --git a/src/mame/ussr/pk32.cpp b/src/mame/ussr/pk32.cpp new file mode 100644 index 0000000000000..2ded00a2d513f --- /dev/null +++ b/src/mame/ussr/pk32.cpp @@ -0,0 +1,199 @@ +// license:BSD-3-Clause +// copyright-holders:Andrei I. Holub +/********************************************************************** + Elektronika PK-32 +**********************************************************************/ + +#include "emu.h" + +#include "cpu/mpk1839/kl1839vm1.h" +#include "machine/ram.h" +#include "machine/terminal.h" + + +#define LOG_IO (1U << 1) +#define LOG_MEM (1U << 2) +#define LOG_TERM (1U << 3) + +#define VERBOSE ( LOG_GENERAL /*| LOG_IO | LOG_MEM | LOG_TERM*/ ) +#include "logmacro.h" + +#define LOGIO(...) LOGMASKED(LOG_IO, __VA_ARGS__) +#define LOGMEM(...) LOGMASKED(LOG_MEM, __VA_ARGS__) +#define LOGTERM(...) LOGMASKED(LOG_TERM, __VA_ARGS__) + + +namespace { + +class pk32_state : public driver_device +{ +public: + pk32_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ram(*this, RAM_TAG) + , m_terminal(*this, "terminal") + , m_io_rnp(*this, "RNP") + {} + + void pk32(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + +private: + void pk32_map_microcode(address_map &map); + void pk32_map_sysram(address_map &map); + void pk32_map_ram(address_map &map); + void pk32_map_io(address_map &map); + + required_device m_maincpu; + required_device m_ram; + required_device m_terminal; + + required_ioport m_io_rnp; // Initial Start Register + + u32 term_rx_db_r(); + void term_tx_db_w(u32 data); + u32 term_rx_cs_r(); + void term_rx_cs_w(u32 data); + u32 term_tx_cs_r(); + void term_tx_cs_w(u32 data); + void kbd_put(u8 data); + + u8 m_term_data = 0; + u16 m_term_status = 0; +}; + + +u32 pk32_state::term_rx_db_r() +{ + LOGTERM("RX DB -> %X\n", m_term_data); + m_term_status = 0x00; + return m_term_data; +} + +void pk32_state::term_tx_db_w(u32 data) +{ + LOGTERM("RX DB <- %X\n", data); + m_terminal->write(data); +} + +u32 pk32_state::term_rx_cs_r() +{ + //LOGTERM("RX CS -> %X\n", m_term_status); + return m_term_status; +} + +void pk32_state::term_rx_cs_w(u32 data) +{ + LOGTERM("RX CS <- %X\n", data); + m_term_status = data; +} + +u32 pk32_state::term_tx_cs_r() +{ + LOGTERM("TX CS -> %X\n", 0xff); + // always ready + return 0xff; +} + +void pk32_state::term_tx_cs_w(u32 data) +{ + LOGTERM("TX CS <- %X\n", data); +} + +void pk32_state::pk32_map_microcode(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("microcode", 0); +} + +void pk32_state::pk32_map_sysram(address_map &map) +{ + map(0x000000, 0x001fff).ram(); + map(0x800000, 0x800000).lr8(NAME([this](offs_t offset) { return m_io_rnp->read() | ((m_ram->size() >> 20) - 1); })); +} + +void pk32_state::pk32_map_ram(address_map &map) +{ + map(0x000000, 0xffffff).ram(); +} + +void pk32_state::pk32_map_io(address_map &map) +{ + map.unmap_value_high(); + map(0x00, 0x3f).unmaprw(); + + map(0x20, 0x20).r(FUNC(pk32_state::term_rx_cs_r)).w(FUNC(pk32_state::term_rx_cs_w)); + map(0x21, 0x21).r(FUNC(pk32_state::term_rx_db_r)); + map(0x22, 0x22).r(FUNC(pk32_state::term_tx_cs_r)).w(FUNC(pk32_state::term_tx_cs_w)); + map(0x23, 0x23).w(FUNC(pk32_state::term_tx_db_w)); +} + +/* Input ports */ +static INPUT_PORTS_START( pk32 ) + PORT_START("RNP") + PORT_CONFNAME( 0xf0, 0x10, "Boot" ) + PORT_CONFSETTING(0x00, "Terminal w/ test") + PORT_CONFSETTING(0x10, "Terminal w/o test") + PORT_CONFSETTING(0x20, "OS from MSCP w/ test") + PORT_CONFSETTING(0x30, "OS from MSCP w/o test") + PORT_CONFSETTING(0x40, "OS from user's device w/ test") + PORT_CONFSETTING(0x50, "User's program from 0") + PORT_CONFSETTING(0x60, "Resident devices") + PORT_CONFSETTING(0x80, "Accelerator ON") +INPUT_PORTS_END + +void pk32_state::kbd_put(u8 data) +{ + m_term_data = data; + m_term_status = 0xff; +} + + +void pk32_state::machine_start() +{ + save_item(NAME(m_term_data)); + save_item(NAME(m_term_status)); +} + +void pk32_state::machine_reset() +{ +} + +void pk32_state::pk32(machine_config &config) +{ + /* basic machine hardware */ + KL1839VM1(config, m_maincpu, XTAL(10'000'000)); + m_maincpu->set_addrmap(AS_OPCODES, &pk32_state::pk32_map_microcode); + m_maincpu->set_addrmap(AS_DATA, &pk32_state::pk32_map_sysram); + m_maincpu->set_addrmap(AS_PROGRAM, &pk32_state::pk32_map_ram); + m_maincpu->set_addrmap(AS_IO, &pk32_state::pk32_map_io); + + RAM(config, m_ram).set_default_size("16M").set_extra_options("8M,4M"); + + /* video hardware */ + GENERIC_TERMINAL(config, m_terminal, 0); + m_terminal->set_keyboard_callback(FUNC(pk32_state::kbd_put)); +} + +ROM_START(pk32) + ROM_REGION32_BE(0x10000, "microcode", ROMREGION_ERASE00) + ROM_DEFAULT_BIOS("v1") + + ROM_SYSTEM_BIOS(0, "v1", "1839src)") + ROMX_LOAD("fw-1839-src.bin", 0x0000, 0x10000, CRC(78c4d298) SHA1(eb3828718991968b4121e6819ae4c6859a8a3a5a), ROM_BIOS(0)) + + ROM_SYSTEM_BIOS(1, "v2", "1839isa") + ROMX_LOAD("fw-1839-isa.bin", 0x0000, 0x10000, CRC(180930a7) SHA1(dbcc7d665d28011b9c2beba3cc0e4073f34d7fc6), ROM_BIOS(1)) + + ROM_SYSTEM_BIOS(2, "v3", "1839pe1") + ROMX_LOAD("fw-1839pe1-006.bin", 0x0000, 0x10000, CRC(e6bb7639) SHA1(759993afc9b61d9cf83acf3e361dcec571beccf1), ROM_BIOS(2)) +ROM_END + + +} // Anonymous namespace + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1991, pk32, 0, 0, pk32, pk32, pk32_state, empty_init, "Elektronika", "PK-32", MACHINE_NOT_WORKING) diff --git a/src/mame/ussr/special_gambl.cpp b/src/mame/ussr/special_gambl.cpp index 488b253a54a19..07bc358557226 100644 --- a/src/mame/ussr/special_gambl.cpp +++ b/src/mame/ussr/special_gambl.cpp @@ -59,7 +59,7 @@ class dinaris_state : public driver_device void dice(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(boot_r) { return m_cold_boot; } + ioport_value boot_r() { return m_cold_boot; } DECLARE_INPUT_CHANGED_MEMBER(ram_test) { m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); } protected: @@ -112,7 +112,7 @@ static INPUT_PORTS_START(dice) PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE1) PORT_NAME("Clear stats") PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_SERVICE2) PORT_NAME("Reset") PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) @@ -274,7 +274,7 @@ void dinaris_state::dice(machine_config &config) m_ppi2->out_pc_callback().set(FUNC(dinaris_state::ppi2c_w)); NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); } ROM_START(dindice) diff --git a/src/mame/valadon/bagman.cpp b/src/mame/valadon/bagman.cpp index 602060b0e0468..01a3c25f18e6f 100644 --- a/src/mame/valadon/bagman.cpp +++ b/src/mame/valadon/bagman.cpp @@ -447,7 +447,7 @@ GFXDECODE_END /* squaitsa doesn't map the dial directly, instead it polls the results of the dial through an external circuitry. I don't know if the following is correct, there can possibly be multiple solutions for the same problem. */ -template CUSTOM_INPUT_MEMBER(squaitsa_state::dial_input_r) +template ioport_value squaitsa_state::dial_input_r() { uint8_t const dial_val = m_dial[N]->read(); diff --git a/src/mame/valadon/bagman.h b/src/mame/valadon/bagman.h index d7298f01001ee..2b7c390457a32 100644 --- a/src/mame/valadon/bagman.h +++ b/src/mame/valadon/bagman.h @@ -125,7 +125,7 @@ class squaitsa_state : public pickin_state m_old_val{ 0, 0 } { } - template DECLARE_CUSTOM_INPUT_MEMBER(dial_input_r); + template ioport_value dial_input_r(); protected: virtual void machine_start() override; diff --git a/src/mame/venture/suprridr.cpp b/src/mame/venture/suprridr.cpp index 18788d8772c11..e35a0396672a6 100644 --- a/src/mame/venture/suprridr.cpp +++ b/src/mame/venture/suprridr.cpp @@ -116,7 +116,7 @@ class suprridr_state : public driver_device void suprridr(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(control_r); + ioport_value control_r(); protected: virtual void machine_start() override; @@ -478,7 +478,7 @@ void suprridr_state::sound_portmap(address_map &map) * *************************************/ -CUSTOM_INPUT_MEMBER(suprridr_state::control_r) +ioport_value suprridr_state::control_r() { // screen flip multiplexes controls diff --git a/src/mame/virtual/vgmplay.cpp b/src/mame/virtual/vgmplay.cpp index b04cf2e237acd..e699d03eec7a4 100644 --- a/src/mame/virtual/vgmplay.cpp +++ b/src/mame/virtual/vgmplay.cpp @@ -230,7 +230,6 @@ class vgmplay_device : public cpu_device virtual uint32_t execute_min_cycles() const noexcept override; virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -664,11 +663,6 @@ uint32_t vgmplay_device::execute_max_cycles() const noexcept return 65536; } -uint32_t vgmplay_device::execute_input_lines() const noexcept -{ - return 0; -} - void vgmplay_device::blocks_clear() { for (int i = 0; i < 0x40; i++) diff --git a/src/mame/vsystem/rpunch.cpp b/src/mame/vsystem/rpunch.cpp index e2e9b03dd8e79..8d87fed6eacaf 100644 --- a/src/mame/vsystem/rpunch.cpp +++ b/src/mame/vsystem/rpunch.cpp @@ -150,7 +150,7 @@ class rpunch_state : public driver_device void rpunch(machine_config &config); void svolleybl(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(hi_bits_r) { return m_hi_bits->read(); } + ioport_value hi_bits_r() { return m_hi_bits->read(); } protected: required_device m_maincpu; diff --git a/src/mame/vsystem/tail2nos.cpp b/src/mame/vsystem/tail2nos.cpp index 7016e885cb926..71220ae584023 100644 --- a/src/mame/vsystem/tail2nos.cpp +++ b/src/mame/vsystem/tail2nos.cpp @@ -54,7 +54,7 @@ class tail2nos_state : public driver_device void tail2nos(machine_config &config); - template DECLARE_CUSTOM_INPUT_MEMBER(analog_in_r); + template ioport_value analog_in_r(); protected: virtual void machine_start() override; @@ -326,7 +326,7 @@ void tail2nos_state::sound_port_map(address_map &map) } template -CUSTOM_INPUT_MEMBER(tail2nos_state::analog_in_r) +ioport_value tail2nos_state::analog_in_r() { int delta = m_analog[N]->read(); diff --git a/src/mame/vtech/gamemachine.cpp b/src/mame/vtech/gamemachine.cpp index 1bcafe8121c27..0d034018ec488 100644 --- a/src/mame/vtech/gamemachine.cpp +++ b/src/mame/vtech/gamemachine.cpp @@ -138,6 +138,10 @@ class gm_state : public driver_device optional_device_array m_sound_nl; required_ioport_array<2> m_inputs; + u16 m_mux = 0; + u8 m_seg_data = 0; + u8 m_sound_data = 0; + void main_map(address_map &map); void main_io(address_map &map); @@ -149,10 +153,6 @@ class gm_state : public driver_device void sound_w(u8 data); void discrete_w(u8 data); u8 sound_r(); - - u16 m_mux = 0; - u8 m_seg_data = 0; - u8 m_sound_data = 0; }; void gm_state::machine_start() diff --git a/src/mame/vtech/innotv_innotabmax.cpp b/src/mame/vtech/innotv_innotabmax.cpp index 72e3925f40c60..6aa0a7b0816de 100644 --- a/src/mame/vtech/innotv_innotabmax.cpp +++ b/src/mame/vtech/innotv_innotabmax.cpp @@ -60,7 +60,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mame/vtech/nl_gamemachine.cpp b/src/mame/vtech/nl_gamemachine.cpp index 0341a1a95be02..b8d683013b45d 100644 --- a/src/mame/vtech/nl_gamemachine.cpp +++ b/src/mame/vtech/nl_gamemachine.cpp @@ -10,7 +10,6 @@ NETLIST_START(gamemachine) { - /* Standard stuff */ SOLVER(Solver, 48000) @@ -87,6 +86,4 @@ NETLIST_START(gamemachine) NET_C(Q1.C, SPK1.2) NET_C(C8.1, R1.1, R3.2, IC1.5) - } - diff --git a/src/mame/vtech/storio.cpp b/src/mame/vtech/storio.cpp index d4d85fe0b1e64..765b98f58d356 100644 --- a/src/mame/vtech/storio.cpp +++ b/src/mame/vtech/storio.cpp @@ -24,7 +24,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mame/vtech/vtech_innotab.cpp b/src/mame/vtech/vtech_innotab.cpp index 79ed5bf226429..022a681937e3f 100644 --- a/src/mame/vtech/vtech_innotab.cpp +++ b/src/mame/vtech/vtech_innotab.cpp @@ -15,7 +15,6 @@ #include "emu.h" #include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mame/wyse/wy30p.cpp b/src/mame/wyse/wy30p.cpp index b7ba4312af05f..92fec4befb818 100644 --- a/src/mame/wyse/wy30p.cpp +++ b/src/mame/wyse/wy30p.cpp @@ -10,6 +10,7 @@ *******************************************************************************/ #include "emu.h" +#include "bus/wysekbd/wysekbd.h" #include "cpu/mcs51/mcs51.h" #include "machine/eepromser.h" #include "screen.h" @@ -23,6 +24,7 @@ class wy30p_state : public driver_device wy30p_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_eeprom(*this, "eeprom") + , m_keyboard(*this, "keyboard") , m_screen(*this, "screen") { } @@ -36,13 +38,17 @@ class wy30p_state : public driver_device private: u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + u8 p1_r(); u8 p3_r(); + void keyboard_clock_w(u8 data); + void keyboard_reset_w(u8 data); u8 de00_r(); void prog_map(address_map &map); void ext_map(address_map &map); required_device m_eeprom; + required_device m_keyboard; required_device m_screen; }; @@ -56,11 +62,27 @@ u32 wy30p_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons return 0; } +u8 wy30p_state::p1_r() +{ + return 0x7f | (!m_keyboard->data_r() << 7); +} + u8 wy30p_state::p3_r() { return 0xdf | (m_eeprom->do_read() << 5); } +void wy30p_state::keyboard_clock_w(u8 data) +{ + m_keyboard->cmd_w(0); + m_keyboard->cmd_w(1); +} + +void wy30p_state::keyboard_reset_w(u8 data) +{ + m_keyboard->cmd_w(0); +} + u8 wy30p_state::de00_r() { return m_screen->vblank() << 7; // probably not correct @@ -75,6 +97,11 @@ void wy30p_state::ext_map(address_map &map) { map(0x0000, 0x1fff).ram(); map(0xa000, 0xa7ff).ram(); + map(0xc300, 0xc3ff).nopw(); // ? + map(0xc700, 0xc7ff).nopw(); // ? + map(0xc900, 0xc9ff).nopw(); // ? + map(0xdc00, 0xdc00).mirror(0xff).w(FUNC(wy30p_state::keyboard_clock_w)); + map(0xdd00, 0xdd00).mirror(0xff).w(FUNC(wy30p_state::keyboard_reset_w)); map(0xde00, 0xde00).mirror(0xff).r(FUNC(wy30p_state::de00_r)); } @@ -88,6 +115,7 @@ void wy30p_state::wy30p(machine_config &config) i8031_device &maincpu(I8031(config, "maincpu", 7.3728_MHz_XTAL)); maincpu.set_addrmap(AS_PROGRAM, &wy30p_state::prog_map); maincpu.set_addrmap(AS_IO, &wy30p_state::ext_map); + maincpu.port_in_cb<1>().set(FUNC(wy30p_state::p1_r)); maincpu.port_in_cb<3>().set(FUNC(wy30p_state::p3_r)); maincpu.port_out_cb<3>().set(m_eeprom, FUNC(eeprom_serial_er5911_device::cs_write)).bit(3); maincpu.port_out_cb<3>().append(m_eeprom, FUNC(eeprom_serial_er5911_device::clk_write)).bit(4); @@ -95,9 +123,12 @@ void wy30p_state::wy30p(machine_config &config) EEPROM_ER5911_8BIT(config, m_eeprom); + WYSE_KEYBOARD(config, m_keyboard, wy30_keyboards, "wy30"); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(31.2795_MHz_XTAL * 2 / 3, 1050, 0, 800, 331, 0, 312); // divider and dimensions guessed m_screen->set_screen_update(FUNC(wy30p_state::screen_update)); + m_screen->screen_vblank().set_inputline("maincpu", MCS51_INT0_LINE); } diff --git a/src/mame/wyse/wy85.cpp b/src/mame/wyse/wy85.cpp index 804636ffad053..e6f26591d28e0 100644 --- a/src/mame/wyse/wy85.cpp +++ b/src/mame/wyse/wy85.cpp @@ -2,19 +2,24 @@ // copyright-holders:AJR /******************************************************************************* - Skeleton driver for Wyse WY-85 VT220-compatible terminal. + Preliminary driver for Wyse WY-85 VT220-compatible terminal. - Unlike most later Wyse terminals, the WY-85 lacks a video gate array. - However, the 105-key keyboard has its own gate array. + Unlike most later Wyse terminals, the WY-85 lacks a video gate array. It + also has non-embedded hidden attributes, though they are buffered with the + characters into the same RAM using a doubled character clock. *******************************************************************************/ #include "emu.h" +#include "bus/rs232/rs232.h" +#include "bus/wysekbd/wysekbd.h" #include "cpu/mcs51/mcs51.h" #include "machine/er1400.h" #include "machine/mc68681.h" +#include "sound/beep.h" #include "video/scn2674.h" #include "screen.h" +#include "speaker.h" namespace { @@ -26,9 +31,17 @@ class wy85_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_earom(*this, "earom") + , m_kybd(*this, "kybd") , m_pvtc(*this, "pvtc") , m_duart(*this, "duart") + , m_beeper(*this, "beeper") + , m_comm(*this, "comm") + , m_pr(*this, "pr") , m_chargen(*this, "chargen") + , m_mainram(*this, "mainram") + , m_clr_rb(false) + , m_tru_inv(false) + , m_lc(0) { } @@ -46,24 +59,59 @@ class wy85_state : public driver_device u8 duart_r(offs_t offset); void duart_w(offs_t offset, u8 data); void earom_w(u8 data); - u8 misc_r(); + u8 font_r(); + void font_w(u8 data); + u8 utility_r(); + void duart_op_w(u8 data); u8 p1_r(); void p1_w(u8 data); + u8 p3_r(); void p3_w(u8 data); void prg_map(address_map &map); void io_map(address_map &map); + u8 pvtc_char_r(offs_t offset); + u8 pvtc_attr_r(offs_t offset); + u8 pvtc_charbuf_r(offs_t offset); + void pvtc_charbuf_w(offs_t offset, u8 data); + u8 pvtc_attrbuf_r(offs_t offset); + void pvtc_attrbuf_w(offs_t offset, u8 data); + + void char_row_buffer_map(address_map &map); + void attr_row_buffer_map(address_map &map); + required_device m_maincpu; required_device m_earom; + required_device m_kybd; required_device m_pvtc; required_device m_duart; + required_device m_beeper; + required_device m_comm; + required_device m_pr; required_region_ptr m_chargen; + required_shared_ptr m_mainram; + + std::unique_ptr m_rowbuf; + std::unique_ptr m_fontram; + + bool m_clr_rb; + bool m_tru_inv; + u8 m_lc; }; void wy85_state::machine_start() { + m_rowbuf = util::make_unique_clear(0x200); + m_fontram = util::make_unique_clear(0x800); + + save_pointer(NAME(m_rowbuf), 0x200); + save_pointer(NAME(m_fontram), 0x800); + + save_item(NAME(m_clr_rb)); + save_item(NAME(m_tru_inv)); + save_item(NAME(m_lc)); } void wy85_state::machine_reset() @@ -73,6 +121,30 @@ void wy85_state::machine_reset() SCN2672_DRAW_CHARACTER_MEMBER(wy85_state::draw_character) { + if (BIT(attrcode, 0, 2) == 0) + { + std::fill_n(&bitmap.pix(y, x), 10, rgb_t::black()); + return; + } + + u8 lc = m_lc + (m_clr_rb ? 0 : linecount); + u16 a = bitswap<2>(attrcode, 5, 6) << 11 | ((charcode & 0x7f) << 4) | (lc & 0xf); + u16 c = BIT(attrcode, 3) && (lc & 9) == 9 ? 0x3ff : a >= 0x1800 ? m_fontram[a - 0x1800] << 2 : m_chargen[a] << 2; + + rgb_t fg = !BIT(attrcode, 1) || (BIT(attrcode, 4) && blink) ? rgb_t(0xc0, 0xc0, 0xc0) : rgb_t::white(); + bool inv = (BIT(attrcode, 2) != cursor) == m_tru_inv; + if (inv && BIT(c, 2)) + c |= 3; + if (BIT(attrcode, 0, 2) == 3) + c |= c >> 1; + if (inv) + c ^= 0x3ff; + + for (int i = 0; i < 10; i++) + { + bitmap.pix(y, x++) = BIT(c, 9) ? fg : rgb_t::black(); + c <<= 1; + } } u8 wy85_state::pvtc_r(offs_t offset) @@ -105,40 +177,155 @@ void wy85_state::earom_w(u8 data) m_earom->data_w(BIT(data, 3) ? BIT(data, 0) : 1); } -u8 wy85_state::misc_r() +u8 wy85_state::font_r() +{ + if (!m_clr_rb) + { + if (!machine().side_effects_disabled()) + logerror("%s: Reading font ROM/RAM with RB enabled\n", machine().describe_context()); + return 0; + } + + u8 attr = m_rowbuf[0x100]; + if ((attr & 0x60) == 0x60) + return m_fontram[(m_rowbuf[0] & 0x7f) << 4 | m_lc]; + else + return m_chargen[bitswap<2>(attr, 5, 6) << 11 | (m_rowbuf[0] & 0x7f) << 4 | m_lc]; +} + +void wy85_state::font_w(u8 data) +{ + if (!m_clr_rb) + { + if (!machine().side_effects_disabled()) + logerror("%s: Writing to font RAM with RB enabled\n", machine().describe_context()); + return; + } + + if ((m_rowbuf[0x100] & 0x60) == 0x60) + m_fontram[(m_rowbuf[0] & 0x7f) << 4 | m_lc] = data; + + //logerror("%s: font_w %02X (CLR RB = %d, LC = %d, char[0] = %02X, attr[0] = %02X)\n", machine().describe_context(), data, m_clr_rb, m_lc, m_rowbuf[0], m_rowbuf[0x100]); +} + +u8 wy85_state::utility_r() { - // Bit 2 = EAROM output - // Bit 3 = keyboard return line? - return m_earom->data_r() << 2; + // D0 = HSYNC + // D1 = not connected? + // D2 = NVD OUT + // D3 = KEY DATA + return (m_earom->data_r() << 2) | (!m_kybd->data_r() << 3); +} + +void wy85_state::duart_op_w(u8 data) +{ + // OP0 = RTS + // OP1 = DTR + // OP2-OP5 = L0-L3 reload + // OP6 = SPDS + // OP7 = character width select + + m_comm->write_rts(BIT(data, 0)); + m_comm->write_dtr(BIT(data, 1)); + m_comm->write_spds(BIT(data, 6)); + + m_lc = BIT(data, 2, 4); } u8 wy85_state::p1_r() { - return 0xff; + // P1.4 = AUX DSR + return m_pr->dsr_r() ? 0xff : 0xef; } void wy85_state::p1_w(u8 data) { - // P1.7 = 80/132 column switch + // P1.0 = AUX DTR + // P1.1 = CLR RB + // P1.2 = pass-through? + // P1.3 = AUX RTS + // P1.5 = BEEPER + // P1.6 = TRU INV + // P1.7 = 80/132 column select + + m_pr->write_dtr(BIT(data, 0)); + m_pr->write_rts(BIT(data, 3)); + + m_clr_rb = !BIT(data, 1); + m_tru_inv = BIT(data, 6); + + m_beeper->set_state(BIT(data, 5)); +} + +u8 wy85_state::p3_r() +{ + return 0xfe | m_pr->rxd_r(); } void wy85_state::p3_w(u8 data) { - // P3.5 (T1) = keyboard clocK? + // P3.1 (TXD) = AUX TXD + // P3.5 (T1) = KEY OUT + + m_pr->write_txd(BIT(data, 1)); + m_kybd->cmd_w(!BIT(data, 5)); } void wy85_state::prg_map(address_map &map) { - map(0x0000, 0x3fff).rom().region("maincpu", 0); + map(0x0000, 0x3fff).mirror(0xc000).rom().region("maincpu", 0); } void wy85_state::io_map(address_map &map) { - map(0x0000, 0x1fff).ram(); // 4x HM6116P-3 (with 2 more in other capacities) - map(0x2000, 0x2000).mirror(0xff).w(FUNC(wy85_state::earom_w)); - map(0x4000, 0x47ff).rw(FUNC(wy85_state::pvtc_r), FUNC(wy85_state::pvtc_w)); - map(0x6000, 0x6fff).rw(FUNC(wy85_state::duart_r), FUNC(wy85_state::duart_w)); - map(0xa000, 0xa000).mirror(0xff).r(FUNC(wy85_state::misc_r)); + map(0x0000, 0x1fff).ram().share("mainram"); // 4x HM6116P-3 (with 2 more for the row buffer and font RAM) + map(0x2000, 0x2000).mirror(0x1fff).w(FUNC(wy85_state::earom_w)); + map(0x4000, 0x4000).select(0x700).mirror(0x18ff).rw(FUNC(wy85_state::pvtc_r), FUNC(wy85_state::pvtc_w)); + map(0x6000, 0x6000).select(0xf00).mirror(0x10ff).rw(FUNC(wy85_state::duart_r), FUNC(wy85_state::duart_w)); + map(0x8000, 0x8000).mirror(0x1fff).rw(FUNC(wy85_state::font_r), FUNC(wy85_state::font_w)); + map(0xa000, 0xa000).mirror(0x1fff).r(FUNC(wy85_state::utility_r)); +} + +u8 wy85_state::pvtc_char_r(offs_t offset) +{ + return m_mainram[offset & 0xfff]; +} + +u8 wy85_state::pvtc_attr_r(offs_t offset) +{ + return m_mainram[0x1000 + (offset & 0xfff)]; +} + +u8 wy85_state::pvtc_charbuf_r(offs_t offset) +{ + return m_rowbuf[m_clr_rb ? 0 : (offset + 1) & 0xff]; +} + +void wy85_state::pvtc_charbuf_w(offs_t offset, u8 data) +{ + m_rowbuf[m_clr_rb ? 0 : (offset + 1) & 0xff] = data; +} + +u8 wy85_state::pvtc_attrbuf_r(offs_t offset) +{ + return m_rowbuf[0x100 + (m_clr_rb ? 0 : (offset + 1) & 0xff)]; +} + +void wy85_state::pvtc_attrbuf_w(offs_t offset, u8 data) +{ + m_rowbuf[0x100 + (m_clr_rb ? 0 : (offset + 1) & 0xff)] = data; +} + +void wy85_state::char_row_buffer_map(address_map &map) +{ + map.global_mask(0x0ff); + map(0x000, 0x0ff).rw(FUNC(wy85_state::pvtc_charbuf_r), FUNC(wy85_state::pvtc_charbuf_w)); +} + +void wy85_state::attr_row_buffer_map(address_map &map) +{ + map.global_mask(0x0ff); + map(0x000, 0x0ff).rw(FUNC(wy85_state::pvtc_attrbuf_r), FUNC(wy85_state::pvtc_attrbuf_w)); } static INPUT_PORTS_START(wy85) @@ -151,25 +338,50 @@ void wy85_state::wy85(machine_config &config) m_maincpu->set_addrmap(AS_IO, &wy85_state::io_map); m_maincpu->port_in_cb<1>().set(FUNC(wy85_state::p1_r)); m_maincpu->port_out_cb<1>().set(FUNC(wy85_state::p1_w)); + m_maincpu->port_in_cb<3>().set(FUNC(wy85_state::p3_r)); m_maincpu->port_out_cb<3>().set(FUNC(wy85_state::p3_w)); ER1400(config, m_earom); // M5G1400 + WYSE_KEYBOARD(config, m_kybd, wy85_keyboards, "wy85"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_color(rgb_t::green()); - //screen.set_raw(48.5568_MHz_XTAL / 3, 96 * 10, 0, 80 * 10, 281, 0, 260); - screen.set_raw(48.5568_MHz_XTAL / 2, 160 * 9, 0, 132 * 9, 281, 0, 260); + screen.set_raw(48.5568_MHz_XTAL / 3, 96 * 10, 0, 80 * 10, 281, 0, 260); + //screen.set_raw(48.5568_MHz_XTAL / 2, 160 * 9, 0, 132 * 9, 281, 0, 260); screen.set_screen_update("pvtc", FUNC(scn2672_device::screen_update)); SCN2672(config, m_pvtc, 48.5568_MHz_XTAL / 30); // SCN2672B m_pvtc->set_screen("screen"); - m_pvtc->set_character_width(9); // 10 in 80-column mode + m_pvtc->set_character_width(10); // 9 in 132-column mode + m_pvtc->set_addrmap(0, &wy85_state::char_row_buffer_map); + m_pvtc->set_addrmap(1, &wy85_state::attr_row_buffer_map); m_pvtc->set_display_callback(FUNC(wy85_state::draw_character)); - //m_pvtc->intr_callback().set_inputline(m_maincpu, MCS51_T0_LINE); + m_pvtc->intr_callback().set_inputline(m_maincpu, MCS51_T0_LINE); m_pvtc->breq_callback().set_inputline(m_maincpu, MCS51_INT0_LINE); + m_pvtc->mbc_char_callback().set(FUNC(wy85_state::pvtc_char_r)); + m_pvtc->mbc_attr_callback().set(FUNC(wy85_state::pvtc_attr_r)); SCN2681(config, m_duart, 3.6864_MHz_XTAL); // SCN2681A (+ 4x µA9636ATC drivers and UA9639CP receivers) + m_duart->a_tx_cb().set(m_comm, FUNC(rs232_port_device::write_txd)); + m_duart->b_tx_cb().set("20ma", FUNC(rs232_port_device::write_txd)); + m_duart->outport_cb().set(FUNC(wy85_state::duart_op_w)); m_duart->irq_cb().set_inputline(m_maincpu, MCS51_INT1_LINE); + + SPEAKER(config, "speaker").front_center(); + BEEP(config, m_beeper, 1000).add_route(ALL_OUTPUTS, "speaker", 0.10); // FIXME: not accurate; actually uses same circuit as WY-50 with 74LS14 Schmitt triggers and discrete components + + RS232_PORT(config, m_comm, default_rs232_devices, nullptr); // RS423 port, also RS232 compatible + m_comm->rxd_handler().set(m_duart, FUNC(scn2681_device::rx_a_w)); + m_comm->cts_handler().set(m_duart, FUNC(scn2681_device::ip0_w)); + m_comm->dsr_handler().set(m_duart, FUNC(scn2681_device::ip1_w)); + m_comm->dcd_handler().set(m_duart, FUNC(scn2681_device::ip2_w)); + m_comm->si_handler().set(m_duart, FUNC(scn2681_device::ip4_w)); + + RS232_PORT(config, m_pr, default_rs232_devices, nullptr); // RS423 port, also RS232 compatible + + RS232_PORT(config, "20ma", default_rs232_devices, nullptr) // 20mA current loop, not actually RS232 compatible + .rxd_handler().set(m_duart, FUNC(scn2681_device::rx_b_w)); } ROM_START(wy85) @@ -186,4 +398,4 @@ ROM_END } // anonymous namespace -COMP(1985, wy85, 0, 0, wy85, wy85, wy85_state, empty_init, "Wyse Technology", "WY-85 (Rev. A)", MACHINE_IS_SKELETON) +COMP(1985, wy85, 0, 0, wy85, wy85, wy85_state, empty_init, "Wyse Technology", "WY-85", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/xerox/xerox820.cpp b/src/mame/xerox/xerox820.cpp index b984140ce8ae2..907383ce6bd48 100644 --- a/src/mame/xerox/xerox820.cpp +++ b/src/mame/xerox/xerox820.cpp @@ -380,36 +380,38 @@ static const z80_daisy_config xerox820_daisy_chain[] = QUICKLOAD_LOAD_MEMBER(xerox820_state::quickload_cb) { - if (image.length() >= 0xfd00) - return std::make_pair(image_error::INVALIDLENGTH, std::string()); + m_view.select(0); address_space &prog_space = m_maincpu->space(AS_PROGRAM); - m_view.select(0); - - /* Avoid loading a program if CP/M-80 is not in memory */ + // Avoid loading a program if CP/M-80 is not in memory if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) { machine_reset(); - return std::make_pair(image_error::UNSUPPORTED, std::string()); + return std::make_pair(image_error::UNSUPPORTED, "CP/M must already be running"); } - /* Load image to the TPA (Transient Program Area) */ + const int mem_avail = 256 * prog_space.read_byte(7) + prog_space.read_byte(6) - 512; + if (mem_avail < image.length()) + return std::make_pair(image_error::UNSPECIFIED, "Insufficient memory available"); + + // Load image to the TPA (Transient Program Area) uint16_t quickload_size = image.length(); for (uint16_t i = 0; i < quickload_size; i++) { uint8_t data; - if (image.fread( &data, 1) != 1) - return std::make_pair(image_error::UNSPECIFIED, std::string()); - prog_space.write_byte(i+0x100, data); + if (image.fread(&data, 1) != 1) + return std::make_pair(image_error::UNSPECIFIED, "Problem reading the image at offset " + std::to_string(i)); + prog_space.write_byte(i + 0x100, data); } - /* clear out command tail */ - prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); + // clear out command tail + prog_space.write_byte(0x80, 0); + prog_space.write_byte(0x81, 0); - /* Roughly set SP basing on the BDOS position */ - m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 300); - m_maincpu->set_pc(0x100); // start program + // Roughly set SP basing on the BDOS position + m_maincpu->set_state_int(Z80_SP, mem_avail + 384); + m_maincpu->set_pc(0x100); // start program return std::make_pair(std::error_condition(), std::string()); } diff --git a/src/mame/yamaha/ymdx100.cpp b/src/mame/yamaha/ymdx100.cpp index afc6c552aa24a..e4cfe5200dd3e 100644 --- a/src/mame/yamaha/ymdx100.cpp +++ b/src/mame/yamaha/ymdx100.cpp @@ -273,7 +273,7 @@ class yamaha_dx100_state : public driver_device void dx100(machine_config &config); void led_w(int state) { m_led = state; } - DECLARE_CUSTOM_INPUT_MEMBER(midi_in_r) { return m_midi_in; } + ioport_value midi_in_r() { return m_midi_in; } protected: virtual void driver_start() override; diff --git a/src/mame/yamaha/ymmu50.cpp b/src/mame/yamaha/ymmu50.cpp index 8954de09ad08d..45c835c4c7c52 100644 --- a/src/mame/yamaha/ymmu50.cpp +++ b/src/mame/yamaha/ymmu50.cpp @@ -90,7 +90,7 @@ class mu50_state : public driver_device required_ioport m_ioport_o2; required_shared_ptr m_ram; - u8 cur_p6, cur_pa, cur_pb, cur_pc; + u8 cur_p6, cur_p9, cur_pa, cur_pb, cur_pc; u16 adc_ar_r(); u16 adc_al_r(); @@ -99,12 +99,14 @@ class mu50_state : public driver_device void p6_w(u8 data); u8 p6_r(); + void p9_w(u8 data); void pa_w(u8 data); u8 pa_r(); void pb_w(u8 data); u8 pb_r(); void pc_w(u8 data); u8 pc_r(); + void update_contrast(); void mu50_map(address_map &map); @@ -114,7 +116,7 @@ class mu50_state : public driver_device void mu50_state::machine_start() { - cur_p6 = cur_pa = cur_pb = cur_pc = 0xff; + cur_p6 = cur_p9 = cur_pa = cur_pb = cur_pc = 0xff; } void mu50_state::machine_reset() @@ -178,14 +180,27 @@ u8 mu50_state::p6_r() return cur_p6; } +void mu50_state::p9_w(u8 data) +{ + cur_p9 = data; + update_contrast(); +} + u8 mu50_state::pb_r() { return cur_pb; } +void mu50_state::update_contrast() +{ + m_lcd->set_contrast(((~cur_p9 >> 3) & 0x6) | (BIT(~cur_pb, 1))); +} + void mu50_state::pb_w(u8 data) { cur_pb = data; + m_lcd->set_leds((~data >> 2) & 0x1f); + update_contrast(); } void mu50_state::pa_w(u8 data) @@ -239,6 +254,7 @@ void mu50_state::mu50(machine_config &config) m_mu50cpu->read_adc<7>().set_constant(0); m_mu50cpu->read_port6().set(FUNC(mu50_state::p6_r)); m_mu50cpu->write_port6().set(FUNC(mu50_state::p6_w)); + m_mu50cpu->write_port9().set(FUNC(mu50_state::p9_w)); m_mu50cpu->read_porta().set(FUNC(mu50_state::pa_r)); m_mu50cpu->write_porta().set(FUNC(mu50_state::pa_w)); m_mu50cpu->read_portb().set(FUNC(mu50_state::pb_r)); diff --git a/src/mame/yamaha/ymmu90.cpp b/src/mame/yamaha/ymmu90.cpp index d29708bd89959..deb649e6a8614 100644 --- a/src/mame/yamaha/ymmu90.cpp +++ b/src/mame/yamaha/ymmu90.cpp @@ -7,7 +7,8 @@ Preliminary driver by R. Belmont and O. Galibert The successor to the mu80, with the swp20/meg/eq combo remplaced by an all-in-one swp30. - Exists in rackable (mu90r) version but we don't have that firmware variant. + Exists in rackable (mu90r) version but we don't have that firmware variant and in + screenless version (mu90b). Sound roms are a subset of the mu100's. @@ -67,11 +68,12 @@ class mu90_state : public driver_device { } void mu90(machine_config &config); + void mu90b(machine_config &config); private: required_device m_maincpu; required_device m_swp30; - required_device m_lcd; + optional_device m_lcd; required_ioport m_ioport_p7; required_ioport m_ioport_p8; @@ -148,7 +150,7 @@ void mu90_state::pb_w(u8 data) u8 mu90_state::pb_r() { u8 res = 0xff; - if((cur_pa & 0x20)) { + if(m_lcd && (cur_pa & 0x20)) { if(cur_pa & 0x40) { if(cur_pa & 0x02) res &= m_lcd->data_read(); @@ -170,12 +172,13 @@ u8 mu90_state::pb_r() void mu90_state::pa_w(u8 data) { if(!(cur_pa & 0x01) && (data & 0x01)) { - m_lcd->set_contrast(cur_pb & 7); + if(m_lcd) + m_lcd->set_contrast(cur_pb & 7); logerror("ad1 input level %s\n", cur_pb & 0x80 ? "line" : "mic"); logerror("ad2 input level %s\n", cur_pb & 0x40 ? "line" : "mic"); } - if((cur_pa & 0x20) && !(data & 0x20)) { + if(m_lcd && (cur_pa & 0x20) && !(data & 0x20)) { if(!(cur_pa & 0x40)) { if(cur_pa & 0x02) m_lcd->data_write(cur_pb); @@ -185,14 +188,15 @@ void mu90_state::pa_w(u8 data) } if(!(cur_pa & 0x08) && (data & 0x08)) { - m_lcd->set_leds((cur_pb & 0x1f) | ((cur_pb & 0x80) >> 2)); + if(m_lcd) + m_lcd->set_leds((cur_pb & 0x1f) | ((cur_pb & 0x80) >> 2)); cur_ic34 = cur_pb; } cur_pa = data; } -void mu90_state::mu90(machine_config &config) +void mu90_state::mu90b(machine_config &config) { H83002(config, m_maincpu, 16_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &mu90_state::mu90_map); @@ -209,8 +213,6 @@ void mu90_state::mu90(machine_config &config) m_maincpu->read_portb().set(FUNC(mu90_state::pb_r)); m_maincpu->write_portb().set(FUNC(mu90_state::pb_w)); - MULCD(config, m_lcd); - SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -232,6 +234,13 @@ void mu90_state::mu90(machine_config &config) m_maincpu->write_sci_tx<0>().set(mdout, FUNC(midi_port_device::write_txd)); } +void mu90_state::mu90(machine_config &config) +{ + mu90b(config); + + MULCD(config, m_lcd); +} + #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios)) @@ -246,7 +255,19 @@ ROM_START( mu90 ) ROM_LOAD32_WORD( "xs743a0.ic23", 0x0000002, 0x400000, CRC(a9109a6c) SHA1(a67bb49378a38a2d809bd717d286e18bc6496db0) ) ROM_END +ROM_START( mu90b ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v101") + ROM_SYSTEM_BIOS( 0, "v101", "xt040c0 (v1.01, Dec. 26, 2005)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 0, "xt040c0.ic9", 0x000000, 0x100000, CRC(66fe5896) SHA1(811a8c7f0e8aac7a8807922d5add0fbfc07e1cfd) ) + + ROM_REGION32_LE( 0x800000, "swp30", ROMREGION_ERASE00 ) + ROM_LOAD32_WORD( "xs518a0.ic22", 0x0000000, 0x400000, CRC(2550d44f) SHA1(fd3cce228c7d389a2fde25c808a5b26080588cba) ) + ROM_LOAD32_WORD( "xs743a0.ic23", 0x0000002, 0x400000, CRC(a9109a6c) SHA1(a67bb49378a38a2d809bd717d286e18bc6496db0) ) +ROM_END + } // anonymous namespace -SYST( 1996, mu90, 0, 0, mu90, mu90, mu90_state, empty_init, "Yamaha", "MU90", MACHINE_NOT_WORKING ) +SYST( 1996, mu90, 0, 0, mu90, mu90, mu90_state, empty_init, "Yamaha", "MU90", MACHINE_NOT_WORKING ) +SYST( 2005, mu90b, mu90, 0, mu90b, mu90, mu90_state, empty_init, "Yamaha", "MU90B", MACHINE_NOT_WORKING ) diff --git a/src/mame/yamaha/ympsr150.cpp b/src/mame/yamaha/ympsr150.cpp index 9cbe1d3f66c21..af7b9d4239830 100644 --- a/src/mame/yamaha/ympsr150.cpp +++ b/src/mame/yamaha/ympsr150.cpp @@ -100,12 +100,12 @@ class psr150_state : public driver_device template void keys_w(int state); template - DECLARE_CUSTOM_INPUT_MEMBER(keys_r); + ioport_value keys_r(); - DECLARE_CUSTOM_INPUT_MEMBER(dial_r); + ioport_value dial_r(); DECLARE_INPUT_CHANGED_MEMBER(switch_w); - DECLARE_CUSTOM_INPUT_MEMBER(switch_r) { return m_switch; } + ioport_value switch_r() { return m_switch; } void apo_w(int state) { if (state) m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } DECLARE_INPUT_CHANGED_MEMBER(power_w) { if (!newval) m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } @@ -120,7 +120,7 @@ class psr150_state : public driver_device template void digit_w(u8 state) { m_digit[Num] = state ^ 0xff; } - DECLARE_CUSTOM_INPUT_MEMBER(lcd_r) { return m_lcdc->db_r() >> 4; } + ioport_value lcd_r() { return m_lcdc->db_r() >> 4; } void lcd_w(int state) { m_lcdc->db_w(state << 4); } private: @@ -162,7 +162,7 @@ void psr150_state::keys_w(int state) } template -CUSTOM_INPUT_MEMBER(psr150_state::keys_r) +ioport_value psr150_state::keys_r() { ioport_value result = 0; for (unsigned i = 0U; i < m_keys.size(); i++) @@ -172,7 +172,7 @@ CUSTOM_INPUT_MEMBER(psr150_state::keys_r) return result >> StartBit; } -CUSTOM_INPUT_MEMBER(psr150_state::dial_r) +ioport_value psr150_state::dial_r() { // return the dial position as a 2-bit gray code const u8 val = m_dial->read(); diff --git a/src/mame/yamaha/ympsr60.cpp b/src/mame/yamaha/ympsr60.cpp index 5f2925c42cff7..05b01b5768c6f 100644 --- a/src/mame/yamaha/ympsr60.cpp +++ b/src/mame/yamaha/ympsr60.cpp @@ -171,7 +171,7 @@ class psr60_state : public driver_device // optional sustain pedal input; if this doesn't change, sustain will not work // if no pedal present, it seems sustain should still work, so toggle the value // here a bit to make the keyboard notice - CUSTOM_INPUT_MEMBER(sustain_fuzz) { return (m_sustain_fuzz = !m_sustain_fuzz) ? 8 : 12; } + ioport_value sustain_fuzz() { return (m_sustain_fuzz = !m_sustain_fuzz) ? 8 : 12; } }; void psr60_state::psr60_map(address_map &map) diff --git a/src/mame/yeno/301xl.cpp b/src/mame/yeno/301xl.cpp index 8f27562a8d4e2..a858759c2fec6 100644 --- a/src/mame/yeno/301xl.cpp +++ b/src/mame/yeno/301xl.cpp @@ -9,8 +9,8 @@ NOTE: It triggers an IRQ when the power switch is changed from ON to SAVE. If this is not done, NVRAM won't save properly. It's by the same programmer as Chess King Triomphe / Counter Gambit, also using -the TRAP interrupt for the beeper routine. Intelligent Software did not exist -anymore in 1988. +the TRAP interrupt for the beeper routine. The ROM data contains (C)1988Bray, +it appears that Intelligent Chess Software went defunct around that time. Hardware notes: - PCB label: WSE 8108A @@ -184,7 +184,7 @@ static INPUT_PORTS_START( y301xl ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("White") 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, y301xl_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, y301xl_state, power_off, 0) INPUT_PORTS_END diff --git a/src/mame/yeno/416xl.cpp b/src/mame/yeno/416xl.cpp index 86949f07291c0..8e2633da6b6bf 100644 --- a/src/mame/yeno/416xl.cpp +++ b/src/mame/yeno/416xl.cpp @@ -161,7 +161,7 @@ static INPUT_PORTS_START( y416xl ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Show Move") 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, y416xl_state, power_off, 0) PORT_NAME("Power Off") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, y416xl_state, power_off, 0) INPUT_PORTS_END diff --git a/src/mame/zaccaria/zac1b1120.cpp b/src/mame/zaccaria/zac1b1120.cpp index 695b908160b02..c4dd4ceaebe18 100644 --- a/src/mame/zaccaria/zac1b1120.cpp +++ b/src/mame/zaccaria/zac1b1120.cpp @@ -58,7 +58,7 @@ class zac1b1120_state : public driver_device void tinvader(machine_config &config); void dodgem(machine_config &config); - DECLARE_CUSTOM_INPUT_MEMBER(bg_collision_r) { return m_collision_background; } + ioport_value bg_collision_r() { return m_collision_background; } protected: virtual void video_start() override; diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp index ca042aa807f2f..77dea9ed0489d 100644 --- a/src/osd/modules/debugger/debuggdbstub.cpp +++ b/src/osd/modules/debugger/debuggdbstub.cpp @@ -496,8 +496,8 @@ static const std::map gdb_register_maps = class debug_gdbstub : public osd_module, public debug_module { public: - debug_gdbstub() - : osd_module(OSD_DEBUG_PROVIDER, "gdbstub"), debug_module(), + debug_gdbstub() : + osd_module(OSD_DEBUG_PROVIDER, "gdbstub"), debug_module(), m_readbuf_state(PACKET_START), m_machine(nullptr), m_maincpu(nullptr), @@ -506,7 +506,7 @@ class debug_gdbstub : public osd_module, public debug_module m_address_space(nullptr), m_debugger_cpu(nullptr), m_debugger_console(nullptr), - m_debugger_host(nullptr), + m_debugger_host(), m_debugger_port(0), m_socket(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE), m_is_be(false), @@ -601,7 +601,7 @@ class debug_gdbstub : public osd_module, public debug_module address_space *m_address_space; debugger_cpu *m_debugger_cpu; debugger_console *m_debugger_console; - const char *m_debugger_host; + std::string m_debugger_host; int m_debugger_port; emu_file m_socket; bool m_is_be; @@ -795,8 +795,8 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop) std::string socket_name = string_format("socket.%s:%d", m_debugger_host, m_debugger_port); std::error_condition const filerr = m_socket.open(socket_name); if ( filerr ) - fatalerror("gdbstub: failed to start listening on host %s port %d\n", m_debugger_host, m_debugger_port); - osd_printf_info("gdbstub: listening on host %s port %d\n", m_debugger_host, m_debugger_port); + fatalerror("gdbstub: failed to start listening on address %s port %d\n", m_debugger_host, m_debugger_port); + osd_printf_info("gdbstub: listening on address %s port %d\n", m_debugger_host, m_debugger_port); m_initialized = true; } diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index 8c3275a754976..e48c012dba6d6 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -559,8 +559,7 @@ LRESULT debugwin_info::window_proc(UINT message, WPARAM wparam, LPARAM lparam) auto *minmax = (MINMAXINFO *)lparam; minmax->ptMinTrackSize.x = m_minwidth; minmax->ptMinTrackSize.y = m_minheight; - minmax->ptMaxSize.x = minmax->ptMaxTrackSize.x = m_maxwidth; - minmax->ptMaxSize.y = minmax->ptMaxTrackSize.y = m_maxheight; + // Leave default ptMaxSize and ptMaxTrackSize so maximum size is not restricted break; } diff --git a/src/osd/modules/input/input_common.h b/src/osd/modules/input/input_common.h index 28e53fb0ccbe8..73ddd2bf936be 100644 --- a/src/osd/modules/input/input_common.h +++ b/src/osd/modules/input/input_common.h @@ -91,7 +91,7 @@ template class event_based_device : public device_info { private: - static inline constexpr unsigned DEFAULT_EVENT_QUEUE_SIZE = 20; + static inline constexpr unsigned DEFAULT_EVENT_QUEUE_SIZE = 64; std::queue m_event_queue; @@ -117,7 +117,7 @@ class event_based_device : public device_info m_event_queue.pop(); } - void virtual poll(bool relative_reset) override + virtual void poll(bool relative_reset) override { std::lock_guard scope_lock(m_device_lock); @@ -128,6 +128,12 @@ class event_based_device : public device_info m_event_queue.pop(); } } + + virtual void reset() override + { + std::lock_guard scope_lock(m_device_lock); + std::queue().swap(m_event_queue); + } }; diff --git a/src/osd/modules/input/input_rawinput.cpp b/src/osd/modules/input/input_rawinput.cpp index 1bcbb38f78156..5b6813dcd5943 100644 --- a/src/osd/modules/input/input_rawinput.cpp +++ b/src/osd/modules/input/input_rawinput.cpp @@ -317,6 +317,7 @@ class rawinput_keyboard_device : public rawinput_device virtual void reset() override { + rawinput_device::reset(); m_pause_pressed = std::chrono::steady_clock::time_point::min(); memset(&m_keyboard, 0, sizeof(m_keyboard)); m_e1 = 0xffff; @@ -325,7 +326,6 @@ class rawinput_keyboard_device : public rawinput_device 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; } @@ -452,6 +452,7 @@ class rawinput_mouse_device : public rawinput_device virtual void reset() override { + rawinput_device::reset(); memset(&m_mouse, 0, sizeof(m_mouse)); m_x = m_y = m_v = m_h = 0; } @@ -498,11 +499,9 @@ class rawinput_mouse_device : public rawinput_device virtual void process_event(RAWINPUT const &rawinput) override { - // If this data was intended for a rawinput mouse if (rawinput.data.mouse.usFlags == MOUSE_MOVE_RELATIVE) { - m_x += rawinput.data.mouse.lLastX * input_device::RELATIVE_PER_PIXEL; m_y += rawinput.data.mouse.lLastY * input_device::RELATIVE_PER_PIXEL; @@ -559,6 +558,7 @@ class rawinput_lightgun_device : public rawinput_device virtual void reset() override { + rawinput_device::reset(); memset(&m_lightgun, 0, sizeof(m_lightgun)); m_v = 0; m_h = 0; @@ -608,7 +608,6 @@ class rawinput_lightgun_device : public rawinput_device // If this data was intended for a rawinput lightgun if (rawinput.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE) { - // update the X/Y positions m_lightgun.lX = normalize_absolute_axis(rawinput.data.mouse.lLastX, 0, input_device::ABSOLUTE_MAX); m_lightgun.lY = normalize_absolute_axis(rawinput.data.mouse.lLastY, 0, input_device::ABSOLUTE_MAX); @@ -703,9 +702,7 @@ class rawinput_module : public wininput_module RAWINPUTDEVICE registration; registration.usUsagePage = usagepage(); registration.usUsage = usage(); - registration.dwFlags = RIDEV_DEVNOTIFY; - if (background_input()) - registration.dwFlags |= RIDEV_INPUTSINK; + registration.dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK; registration.hwndTarget = dynamic_cast(*osd_common_t::window_list().front()).platform_window(); // register the device diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index e1ec2509d5ef6..ae1ef1515eb1e 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -608,6 +608,7 @@ class sdl_keyboard_device : public sdl_device virtual void reset() override { + sdl_device::reset(); memset(&m_keyboard.state, 0, sizeof(m_keyboard.state)); m_capslock_pressed = std::chrono::steady_clock::time_point::min(); } @@ -662,6 +663,7 @@ class sdl_mouse_device_base : public sdl_device virtual void reset() override { + sdl_device::reset(); memset(&m_mouse, 0, sizeof(m_mouse)); m_v = m_h = 0; } @@ -1330,6 +1332,7 @@ class sdl_joystick_device : public sdl_joystick_device_base virtual void reset() override { + sdl_joystick_device_base::reset(); memset(&m_joystick, 0, sizeof(m_joystick)); } @@ -2048,6 +2051,7 @@ class sdl_game_controller_device : public sdl_joystick_device_base virtual void reset() override { + sdl_joystick_device_base::reset(); memset(&m_controller, 0, sizeof(m_controller)); } diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index a6740979c164c..921c902ad31cc 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -46,6 +46,7 @@ class win32_keyboard_device : public event_based_device virtual void reset() override { + event_based_device::reset(); memset(&m_keyboard, 0, sizeof(m_keyboard)); } @@ -219,6 +220,7 @@ class win32_mouse_device : public event_based_device virtual void reset() override { + event_based_device::reset(); memset(&m_mouse, 0, sizeof(m_mouse)); memset(&m_win32_mouse, 0, sizeof(m_win32_mouse)); m_vscroll = m_hscroll = 0; @@ -303,6 +305,7 @@ class win32_lightgun_device_base : public event_based_device util::disasm_interface * { return new hd6309_disassembler; } }, { "hd63701", be, 0, []() -> util::disasm_interface * { return new m680x_disassembler(63701); } }, { "hmcs40", le, -1, []() -> util::disasm_interface * { return new hmcs40_disassembler; } }, + { "hmcs400", le, -1, []() -> util::disasm_interface * { return new hmcs400_disassembler; } }, { "hp2100", be, -1, []() -> util::disasm_interface * { return new hp2100_disassembler; } }, { "hp21mx", be, -1, []() -> util::disasm_interface * { return new hp21mx_disassembler; } }, { "hp_5061_3001", be, -1, []() -> util::disasm_interface * { return new hp_5061_3001_disassembler; } }, @@ -506,6 +509,7 @@ static const dasm_table_entry dasm_table[] = { "jaguargpu", be, 0, []() -> util::disasm_interface * { return new jaguar_disassembler(jaguar_disassembler::variant::GPU); } }, { "konami", be, 0, []() -> util::disasm_interface * { return new konami_disassembler; } }, { "ks0164", be, 0, []() -> util::disasm_interface * { return new ks0164_disassembler; } }, + { "kl1839vm1", be, 0, []() -> util::disasm_interface * { return new kl1839vm1_disassembler; } }, { "lc57", be, 0, []() -> util::disasm_interface * { return new lc57_disassembler; } }, { "lc58", be, -1, []() -> util::disasm_interface * { return new lc58_disassembler; } }, { "lc8670", be, 0, []() -> util::disasm_interface * { return new lc8670_disassembler; } },