From 6a28bbbd5396c9b64c8c1ea6fb7eb59bef8eff31 Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 22 Oct 2024 21:24:11 +0200 Subject: bus/cbus: drop PC9801 prefix for AMD-98 sound card * make it output mono * improve AY3 flip-flop mechanism * add logmacro --- hash/pc98.xml | 1519 +++++++++++++++++---------------- scripts/src/bus.lua | 4 +- src/devices/bus/cbus/amd98.cpp | 220 +++++ src/devices/bus/cbus/amd98.h | 59 ++ src/devices/bus/cbus/pc9801_86.cpp | 2 +- src/devices/bus/cbus/pc9801_amd98.cpp | 202 ----- src/devices/bus/cbus/pc9801_amd98.h | 59 -- src/mame/nec/pc9801.cpp | 11 +- src/mame/nec/pc9801.h | 2 +- 9 files changed, 1086 insertions(+), 992 deletions(-) create mode 100644 src/devices/bus/cbus/amd98.cpp create mode 100644 src/devices/bus/cbus/amd98.h delete mode 100644 src/devices/bus/cbus/pc9801_amd98.cpp delete mode 100644 src/devices/bus/cbus/pc9801_amd98.h diff --git a/hash/pc98.xml b/hash/pc98.xml index c0c15cd1423..9bac1cbb796 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -1256,7 +1256,6 @@ Utility disk file "BMENU." sports ugly GFX cyan fills (especially noticeable whe - Level II COBOL V2.1 @@ -1421,6 +1420,28 @@ Utility disk file "BMENU." sports ugly GFX cyan fills (especially noticeable whe + + + + CG Tsukuuru 3D + 19?? + アスキー (ASCII) + + + + + + + + + + + + + + + + @@ -2051,6 +2072,50 @@ Not extensively tested + + Candy 3 + 1988 + アスキー (ASCII) + + + + + + + + + + + + + + + + + + + + + + + + Challenge the Touch-Type 2 + 1992 + 日本マイコン販売 (Nihon Micom Hanbai) + + + + + + + + + + Computer Aided Economics 1992? @@ -2064,6 +2129,40 @@ Not extensively tested + + Cyber Vaccine Itekomashi (v1.0) + + 1990? + 日コン連 (Nichikon) + + + + + + + + + + + Golf My Data - Hyper Golf Score Data Base + 1994 + Wiz + + + + + + + + + + Norton Utilities (v6.50) 1994 @@ -2097,6 +2196,22 @@ Untested + + Systema Denshi Kakeibo + 1990 + ボーステック (Bothtec) + + + + + + + + + @@ -9032,8 +9147,12 @@ DAC1BIT sounds awful on anything, cfr. title screen (tested VM class, RS class a Brown's Run 1985 システムサコム (System Sacom) + + @@ -10457,6 +10576,38 @@ Requires 3.5" floppy emulation + + Chou·Baku + 1993 + アップルパイ/コーヒーぶれいく (Apple Pie / Coffee Break) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Chou Shinri Samâdhi 1994 @@ -10590,6 +10741,44 @@ Requires 3.5" floppy emulation + + Choujikuu Yousai Macross - Skull Leader + 1994 + ファミリーソフト (Family Soft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Choukousou Crisis 1994 @@ -11903,6 +12092,48 @@ Throws "E>" error with chrn=(0, 1, 1, 512) in 2dd mode + + CRW 2 + 1995 + ウィズ (Wiz) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Crystal Chaser - Tenkuu no Mashoukyuu 1991 @@ -12881,6 +13112,29 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] + + D.P.S. - Dream Program System (alt format) + 1989 + アリスソフト (Alicesoft) + + + + + + + + + + + + + + + + + D.P.S. SG - Dream Program System SG 1990 @@ -12945,6 +13199,38 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] + + D.P.S. SG 2 - Dream Program System SG Set 2 + 1991 + アリスソフト (Alicesoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + D.P.S. SG 3 - Dream Program System SG Set 3 1991 @@ -13108,6 +13394,40 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] + + Daikairei - Dainippon Teikoku Kaigun no Kiseki + 1988 + アートディンク (Artdink) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Daikairei - Nankai no Shitou @@ -13129,12 +13449,37 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] - + + + Daikairei - Nankai no Shitou (alt format) + 1989 + アートディンク (Artdink) + + + + + + + + + + + + + + + + + + Daikairei - Nankai no Shitou - Scenario C: Philippines Oki Kaisen 1990? アートディンク (Artdink) + @@ -13142,12 +13487,13 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] - + Daikairei - Nankai no Shitou - Scenario D: Java Tou Kessen 1990? アートディンク (Artdink) + @@ -13309,6 +13655,26 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] + + Daisenryaku III - Great Commander (alt format) + 1989 + システムソフト (SystemSoft) + + + + + + + + + + + + + + + + Daisenryaku III - Kakuchou Editor Disk 1990 @@ -13316,7 +13682,7 @@ Can't select any option in the two sample1 / sample2 programs via [mouse] - + @@ -13953,6 +14319,45 @@ Boots with NAX.EXE -T -BFF -Q -FC, accesses optional extra ports + + Days in Duel (alt format) + 1994 + スワット (Swat) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dead of the Brain - Shiryou no Sakebi @@ -14838,6 +15243,35 @@ Boots with NAX.EXE -T -BFF -Q -FC, accesses optional extra ports + + Diamond Players + 1992 + 日本テレネット (Nihon Telenet) + + + + + + + + + + + + + + + + + + + + + + + Dies Irae 1996 @@ -15214,6 +15648,19 @@ Boots with NAX.EXE -T -BFF -Q -FC, accesses optional extra ports + + DNA + 1987 + グレイ (Gray) + + + + + + + + + Doki Doki Card League @@ -15474,10 +15921,13 @@ Black screen, 2dd disk? [FDC] keeps accessing chrn=(0, 1, 17, 256) in 2HD mode - + Dome 1988 システムサコム (System Sacom) + @@ -15971,23 +16421,23 @@ Couple of "Unimplemented floating point control" opcodes triggered in error.log 1995 エルフ (Elf) - + - + - + @@ -16530,6 +16980,39 @@ Couple of "Unimplemented floating point control" opcodes triggered in error.log + + Dragon Princess - Ryuu no Densetsu + 1992 + ハートソフト (Heart Soft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dragon Slayer - The Legend of Heroes - Eiyuu Densetsu 1990 @@ -16859,11 +17342,13 @@ Couple of "Unimplemented floating point control" opcodes triggered in error.log - Duel 1990 呉ソフトウエア工房 (KSK) + @@ -16942,9 +17427,32 @@ Couple of "Unimplemented floating point control" opcodes triggered in error.log + + Dungeon Buster - Ex-Plores + 1990 + グレイト (Great) + + + + + + + + + + + + + + + + + - Dungeon Buster 2 Revive + Dungeon Buster 2 - Revive 1991 グレイト (Great) @@ -19521,6 +20029,35 @@ Black screen [FDC] keeps reading chrn=(0, 0, 3, 256) in 2dd mode + + Flashback + 1994 + ビクターエンタテインメント (Victor Entertainment) + + + + + + + + + + + + + + + + + + + + + + + Flash Point 1991 @@ -20470,7 +21007,7 @@ Reset machine after selecting option 1 "FUNNY start" 1992 M.N.M.ソフトウェア (M.N.M. Software) @@ -20501,6 +21038,36 @@ Non-functional in gameplay, random tileset + + Gaias Lord + 1993 + オレンジハウス (Orange House) + + + + + + + + + + + + + + + + + + + + + + + Gakuen Bomber 1994 @@ -20792,6 +21359,18 @@ Non-functional in gameplay, random tileset + + Gandhara + 1988 + エニックス (Enix) + + + + + + + + Gao Gao! Optional Disk 19?? @@ -20830,6 +21409,18 @@ Non-functional in gameplay, random tileset + + Gaplus (alt format) + 1985 + キャリーラボ (Carry Lab) + + + + + + + + Garyouden - Sangoku Seiha no Kei 1994 @@ -23321,6 +23912,24 @@ Draws garbage GVRAM during install (verify) + + Highway Star + 1986 + システムサコム (System Sacom) + + + + + + + + + + + + Himitsu no Hanazono 1992 @@ -29269,6 +29878,9 @@ Mixed 5'25/3'5 dump? Looks extremely unlikely Märchen Veil I 1985 システムサコム (System Sacom) + @@ -29285,11 +29897,12 @@ Mixed 5'25/3'5 dump? Looks extremely unlikely システムサコム (System Sacom) - + @@ -29300,10 +29913,13 @@ TODO: check master floppy, size looks suspicious - + Märchen Veil II (alt) 1986 システムサコム (System Sacom) + @@ -41232,7 +41848,7 @@ Hangs on new game after selecting any stage, waits for an irq to happen - + The Stellar Sign - Toki no Shirube 1995 アスキー (ASCII) @@ -42783,7 +43399,7 @@ Requires a VM class machine, runs too fast on RS and beyond - + Tantei Imamura Misa Jikenbo 19?? まいまい (Mai Mai) @@ -42800,7 +43416,7 @@ Requires a VM class machine, runs too fast on RS and beyond - + @@ -44086,6 +44702,22 @@ Eventually hangs with stuck [PC9801-26] sound note (verify, should be fixed) + + Tokyo Nampa Street + 1985 + エニックス (Enix) + + + + + + + + + + Tokyo Twilight Busters - Kindan no Ikenie Teito Jigoku Hen 1995 @@ -49640,529 +50272,6 @@ Is this a data disk for missing main game dump? --> - - - Candy 3 - 19?? - アスキー (ASCII) - - - - - - - - - - - - - - - - - - - - - - CG Tsukuuru 3D - 19?? - アスキー (ASCII) - - - - - - - - - - - - - - - - - - Challenge the Touch-Type 2 - 19?? - 日本マイコン販売 (Nihon Micom Hanbai) - - - - - - - - - - - Charade Magic - 1992 - ハートソフト (Heart Soft) - - - - - - - - - - - - - - - - - - - - - - - - - Chou·Baku - 1993 - アップルパイ/コーヒーぶれいく (Apple Pie / Coffee Break) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Choujikuu Yousai Macross - Skull Leader - 1994 - ファミリーソフト (Family Soft) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CRW 2 - 1995 - ウィズ (Wiz) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cyber Vaccine Itekomashi - 19?? - 日コン連 (Nichikon) - - - - - - - - - - D.P.S. - Dream Program System (alt format) - 1989 - アリスソフト (Alicesoft) - - - - - - - - - - - - - - - - - - D.P.S. SG 2 - Dream Program System SG Set 2 - 1991 - アリスソフト (Alicesoft) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daikairei - Dainippon Teikoku Kaigun no Kiseki - 1988 - アートディンク (Artdink) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daikairei - Nankai no Shitou (alt format) - 1989 - アートディンク (Artdink) - - - - - - - - - - - - - - - - - - - Daisenryaku III - Great Commander (alt format) - 1989 - システムソフト (SystemSoft) - - - - - - - - - - - - - - - - - - Days in Duel (alt format) - 1994 - スワット (Swat) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deep - 1994 - ジャスト (Jast) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Diamond Players - 1992 - 日本テレネット (Nihon Telenet) - - - - - - - - - - - - - - - - - - - - - - - - - DNA - 1987 - グレイ (Gray) - - - - - - - - - - - Dragon Princess - Ryuu no Densetsu - 1992 - ハートソフト (Heart Soft) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dungeon Buster - 1990 - グレイト (Great) - - - - - - - - - - - - - - - Farland Story Denki - Arc Ou no Ensei 1994 @@ -50241,35 +50350,6 @@ Is this a data disk for missing main game dump? - - Flashback - 1994 - ビクターエンタテインメント (Victor Entertainment) - - - - - - - - - - - - - - - - - - - - - - - Fundation - Shinjuku Story (alt format) @@ -50334,35 +50414,6 @@ No sound - - Gaias Lord - 1993 - オレンジハウス (Orange House) - - - - - - - - - - - - - - - - - - - - - - - Gakuen Senki - Kyoufu no Puppet Keikaku (alt format) 1994 @@ -50445,30 +50496,6 @@ Has non working optional RS-MIDI thru SQS -S CLI switch (will hang game if used) - - Gandhara - 1988 - エニックス (Enix) - - - - - - - - - - Gaplus (alt format) - 1985 - キャリーラボ (Carry Lab) - - - - - - - - Gazou Data - Juunishi Illustration Shuu 19?? @@ -50492,6 +50519,9 @@ Has non working optional RS-MIDI thru SQS -S CLI switch (will hang game if used) Genesis 1985 スクウェア (Square) + @@ -50565,18 +50595,6 @@ Has non working optional RS-MIDI thru SQS -S CLI switch (will hang game if used) - - Golf My Data - Hyper Golf Score Data Base - 19?? - Wiz - - - - - - - - Grand Prix Circus Power Up Kit 1991 @@ -50728,19 +50746,6 @@ Has non working optional RS-MIDI thru SQS -S CLI switch (will hang game if used) - - Highway Star - 1986 - システムサコム (System Sacom) - - - - - - - - - Hiouden II 1993 @@ -51519,12 +51524,13 @@ Black screen, keeps hitting an empty divide by zero exception at PC=1fcb6 + Leningrad 1987 ポニーキャニオン (Pony Canyon) - + @@ -53435,6 +53441,10 @@ Black screen, wants 2DD dip ON? Relics 1986 ボーステック (Bothtec) + @@ -53443,10 +53453,13 @@ Black screen, wants 2DD dip ON? - + Relics (alt) 1986 ボーステック (Bothtec) + @@ -54174,18 +54187,6 @@ hand repaired copy protection, looks for deleted sector -8 and -9 on track 76 - - Systema Denshi Kakeibo - 1990 - ボーステック (Bothtec) - - - - - - - - Tadashiedai-kun Jr. 19?? @@ -54494,19 +54495,6 @@ hand repaired copy protection, looks for deleted sector -8 and -9 on track 76 - - Tokyo Nampa Street - 1985 - エニックス (Enix) - - - - - - - - - The Tower? of Cabin - Cabin Panic (alt format) 1992 @@ -54554,8 +54542,13 @@ hand repaired copy protection, looks for deleted sector -8 and -9 on track 76 Toushi Keiba - 19?? + 1993? <unknown> + @@ -54929,8 +54922,13 @@ doesn't boot when converted to d88 (2DD) Zone 1985 システムサコム (System Sacom) + + @@ -56109,6 +56107,32 @@ This is a compilation of pictures and information about the enemies in Last Arma + + Charade Magic + 1992 + ハートソフト (Heart Soft) + + + + + + + + + + + + + + + + + + + + + + Cherry Moderate 1996 @@ -56618,6 +56642,68 @@ This is a compilation of pictures and information about the enemies in Last Arma + + Deep + 1994 + ジャスト (Jast) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + De·Ja 2 @@ -64876,7 +64962,6 @@ Cutoff [kanji] LR right side (verify, should be fixed) - Doujin Soft Shuusaku Game Collection Vol. 1 (5.25" Disks) 19?? @@ -66443,21 +66528,24 @@ Crashes with a BASIC error when accessing house near starting point, incomplete - - Volleyball 2 on 2 + + Volleyball 2 on 2 (3.5" Disk) 1994 <unofficial> - + - - Volleyball 2 on 2 (alt) + + Volleyball 2 on 2 (5.25" Disk) 19?? <unofficial> + @@ -66478,7 +66566,6 @@ Crashes with a BASIC error when accessing house near starting point, incomplete - 0x0F exp.3 @@ -66509,7 +66596,6 @@ Has XA and LT support according to spine card - 5x5 [Go! Go!] 1995? @@ -66546,13 +66632,13 @@ Has XA and LT support according to spine card - + Adesugata Sannin Musume 19?? <doujin> - + @@ -66608,13 +66694,12 @@ Has XA and LT support according to spine card - Akihime - Goddess in the Caeseress 19?? <doujin> - + @@ -66644,13 +66729,12 @@ Has XA and LT support according to spine card - Armored Girl Nirvana Mai 19?? <doujin> - + @@ -66669,7 +66753,6 @@ Has XA and LT support according to spine card - Atomic Punker 19?? @@ -66750,7 +66833,6 @@ Has XA and LT support according to spine card - Bounty Hunter Akemi 19?? @@ -66787,7 +66869,6 @@ Has XA and LT support according to spine card - CG Gallery 1 (B.T.B Software) 19?? @@ -66800,7 +66881,6 @@ Has XA and LT support according to spine card - C.G. Gallery 7 - Escort 1992 @@ -66866,7 +66946,6 @@ Has XA and LT support according to spine card - ChingHai 19?? @@ -66905,7 +66984,6 @@ Has XA and LT support according to spine card - Collon Club 3 19?? @@ -66976,7 +67054,6 @@ Has XA and LT support according to spine card - Dai Hinmin - Taiketsu Seifuku Musume 19?? @@ -67029,7 +67106,7 @@ Has XA and LT support according to spine card - Destructor + Destructor (5.25" Disk) 19?? <doujin> @@ -67040,13 +67117,12 @@ Has XA and LT support according to spine card - - Destructor (alt) + Destructor (3.5" Disk) 19?? <doujin> - + @@ -67124,7 +67200,6 @@ Has XA and LT support according to spine card - Dragon Egg 19?? @@ -67150,7 +67225,6 @@ Has XA and LT support according to spine card - E.S.P 1994 @@ -67222,7 +67296,6 @@ Has XA and LT support according to spine card - First Fantazy 5 1992 @@ -67479,7 +67552,7 @@ Has XA and LT support according to spine card - + Kitty World 2 1994 <doujin> @@ -67900,7 +67973,7 @@ Has XA and LT support according to spine card - + Mobile Delivery 1992 <doujin> @@ -67912,7 +67985,7 @@ Has XA and LT support according to spine card - + MoguPoko 19?? <doujin> @@ -67982,7 +68055,7 @@ Has XA and LT support according to spine card - + Nadia of the Sea - Mysteries of Blue Water 19?? <doujin> @@ -67994,12 +68067,12 @@ Has XA and LT support according to spine card - + Napple City 19?? <doujin> - + @@ -68149,7 +68222,7 @@ Has XA and LT support according to spine card - + Ossault Plus 19?? <doujin> @@ -68239,7 +68312,7 @@ Has XA and LT support according to spine card - + Ponjalla no Houkago - Sadoubu(re) Hen 1995 <doujin> @@ -68290,7 +68363,7 @@ Has XA and LT support according to spine card - + Princess Confusion 1992 <doujin> @@ -68314,7 +68387,7 @@ Has XA and LT support according to spine card - + Ray Cards 1995 <doujin> @@ -68345,7 +68418,7 @@ Has XA and LT support according to spine card - + Revival - Astro Wars Part II 19?? <doujin> @@ -68508,7 +68581,7 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + Sentimental Graphics Vol. 1 19?? <doujin> @@ -68557,7 +68630,7 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + Sinora's Quest 2 19?? <doujin> @@ -68569,12 +68642,12 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + Sinora's Quest 2 (alt) 19?? <doujin> - + @@ -68592,7 +68665,7 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + Skyblaster GR 1992 <doujin> @@ -68813,12 +68886,12 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + The Tower of Zarbartz 1994 <doujin> - + @@ -68938,7 +69011,7 @@ Doesn't autoboot on anything that isn't x68k, sports lowercased autoexec.bat, is - + Walpurgis Night 3 19?? <doujin> @@ -70432,4 +70505,6 @@ Related to Wizard98 + + diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 3d8d03c6575..b037f0381fd 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -5250,6 +5250,8 @@ end if (BUSES["CBUS"]~=null) then files { + MAME_DIR .. "src/devices/bus/cbus/amd98.cpp", + MAME_DIR .. "src/devices/bus/cbus/amd98.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_26.cpp", MAME_DIR .. "src/devices/bus/cbus/pc9801_26.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_55.cpp", @@ -5258,8 +5260,6 @@ if (BUSES["CBUS"]~=null) then MAME_DIR .. "src/devices/bus/cbus/pc9801_86.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_118.cpp", MAME_DIR .. "src/devices/bus/cbus/pc9801_118.h", - MAME_DIR .. "src/devices/bus/cbus/pc9801_amd98.cpp", - MAME_DIR .. "src/devices/bus/cbus/pc9801_amd98.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_snd.cpp", MAME_DIR .. "src/devices/bus/cbus/pc9801_snd.h", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.cpp", diff --git a/src/devices/bus/cbus/amd98.cpp b/src/devices/bus/cbus/amd98.cpp new file mode 100644 index 00000000000..8edfecafe60 --- /dev/null +++ b/src/devices/bus/cbus/amd98.cpp @@ -0,0 +1,220 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + +System Sacom AMD-98 (AmuseMent boarD) + +3 PSG chips, one of the first sound boards released for PC98 +Superseded by later NEC in-house sound boards + +TODO: +- not sure if it's AY8910 or YM2203, from a PCB pic it looks with stock AY logos? +- f/f not completely understood; +- PIT control; +- PCM section; + +=================================================================================================== + +- Known games with AMD-98 support + Brown's Run (System Sacom) + Dome (System Sacom) + Highway Star (System Sacom) + Marchen Veil I (System Sacom) + Marchen Veil II (System Sacom) + Zone (System Sacom) + Relics (Bothtec) + Thexder (Game Arts) + +**************************************************************************************************/ + +#include "emu.h" +#include "bus/cbus/amd98.h" +#include "speaker.h" + +#define LOG_LATCH (1U << 1) // Detailed AY3 latch setups + + +#define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGLATCH(...) LOGMASKED(LOG_LATCH, __VA_ARGS__) + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE(AMD98, amd98_device, "amd98", "System Sacom AMD-98") + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void amd98_device::device_add_mconfig(machine_config &config) +{ + // Assume mono, as per highway making engine noise from ay1 only + SPEAKER(config, "speaker").front_center(); + AY8910(config, m_ay1, 1'996'800); + m_ay1->port_a_read_callback().set_ioport("OPN_PA1"); + m_ay1->port_b_write_callback().set(FUNC(amd98_device::ay3_address_w)); + m_ay1->add_route(ALL_OUTPUTS, "speaker", 0.50); + + AY8910(config, m_ay2, 1'996'800); + m_ay2->port_a_read_callback().set_ioport("OPN_PA2"); + m_ay2->port_b_write_callback().set(FUNC(amd98_device::ay3_data_latch_w)); + m_ay2->add_route(ALL_OUTPUTS, "speaker", 0.50); + + AY8910(config, m_ay3, 1'996'800); + m_ay3->port_b_write_callback().set([this] (u8 data) { + LOG("AMD-98 DAC %02x\n", data); + }); + m_ay3->add_route(ALL_OUTPUTS, "speaker", 0.25); +} + +static INPUT_PORTS_START( pc9801_amd98 ) + PORT_START("OPN_PA1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("OPN_PA2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + +ioport_constructor amd98_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( pc9801_amd98 ); +} + + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// amd98_device - constructor +//------------------------------------------------- + +amd98_device::amd98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, AMD98, tag, owner, clock) + , m_bus(*this, DEVICE_SELF_OWNER) + , m_ay1(*this, "ay1") + , m_ay2(*this, "ay2") + , m_ay3(*this, "ay3") +{ +} + + +//------------------------------------------------- +// device_validity_check - perform validity checks +// on this device +//------------------------------------------------- + +void amd98_device::device_validity_check(validity_checker &valid) const +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void amd98_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void amd98_device::device_reset() +{ + m_bus->install_io(0x00d8, 0x00df, read8sm_delegate(*this, FUNC(amd98_device::read)), write8sm_delegate(*this, FUNC(amd98_device::write))); + // thexder access with following + m_bus->install_io(0x38d8, 0x38df, read8sm_delegate(*this, FUNC(amd98_device::read)), write8sm_delegate(*this, FUNC(amd98_device::write))); +} + + +//************************************************************************** +// READ/WRITE HANDLERS +//************************************************************************** + +uint8_t amd98_device::read(offs_t offset) +{ + switch(offset) + { + case 2: + return m_ay1->data_r(); + case 3: + return m_ay2->data_r(); + } + + LOG("AMD-98: unhandled %02x read\n", offset + 0xd8); + + return 0xff; +} + +void amd98_device::write(offs_t offset, uint8_t data) +{ + switch(offset) + { + case 0: + m_ay1->address_w(data); + break; + case 1: + m_ay2->address_w(data); + break; + case 2: + m_ay1->data_w(data); + break; + case 3: + m_ay2->data_w(data); + break; + default: + LOG("AMD-98: unhandled %02x write %02x\n", offset + 0xd8, data); + } +} + +void amd98_device::ay3_address_w(uint8_t data) +{ + LOGLATCH("AMD-98 AY3 latch %02x\n", data); + m_ay3_latch = data; +} + +void amd98_device::ay3_data_latch_w(uint8_t data) +{ + // TODO: actually goes 0 -> 1 -> 0 + // TODO: thexder is the odd one: uses 0x00 -> 0x40 -> 0x47 (address) -> 0x40 -> 0x40 -> 0x43 (data) -> 0x40 + if (!BIT(m_ay3_ff, 0) && BIT(data, 0)) + { + switch(data & 0xc2) + { + case 0x42: + LOG("AMD-98 AY3 write %02x address (f/f %02x)\n", m_ay3_latch, m_ay3_ff); + m_ay3->address_w(m_ay3_latch); + break; + case 0x40: + LOG("AMD-98 AY3 write %02x data (f/f %02x)\n", m_ay3_latch, m_ay3_ff); + m_ay3->data_w(m_ay3_latch); + break; + } + } + LOGLATCH("AMD-98 f/f %02x %02x\n", data, m_ay3_latch); + m_ay3_ff = data; +} diff --git a/src/devices/bus/cbus/amd98.h b/src/devices/bus/cbus/amd98.h new file mode 100644 index 00000000000..c97be6cb3b5 --- /dev/null +++ b/src/devices/bus/cbus/amd98.h @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/*************************************************************************** + + System Sacom AMD-98 (AmuseMent boarD) + +***************************************************************************/ + +#ifndef MAME_BUS_CBUS_AMD98_H +#define MAME_BUS_CBUS_AMD98_H + +#pragma once + +#include "bus/cbus/pc9801_cbus.h" +#include "sound/ay8910.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> amd98_device + +class amd98_device : public device_t +{ +public: + // construction/destruction + amd98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type imperfect_features() { return feature::SOUND; } + + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); + +protected: + // device-level overrides + virtual void device_validity_check(validity_checker &valid) const override; + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + +private: + void ay3_address_w(uint8_t data); + void ay3_data_latch_w(uint8_t data); + + uint8_t m_ay3_latch, m_ay3_ff; + + required_device m_bus; + required_device m_ay1; + required_device m_ay2; + required_device m_ay3; + +}; + +// device type definition +DECLARE_DEVICE_TYPE(AMD98, amd98_device) + +#endif // MAME_BUS_CBUS_AMD98_H diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index a474e33cc6d..e8630e77ce9 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -432,7 +432,7 @@ TIMER_CALLBACK_MEMBER(pc9801_86_device::dac_tick) // //************************************************************************** -DEFINE_DEVICE_TYPE(PC9801_SPEAKBOARD, pc9801_speakboard_device, "pc9801_spb", "NEC PC9801 SpeakBoard") +DEFINE_DEVICE_TYPE(PC9801_SPEAKBOARD, pc9801_speakboard_device, "pc9801_spb", "NEC PC-9801 SpeakBoard") ROM_START( pc9801_spb ) ROM_REGION( 0x4000, "sound_bios", ROMREGION_ERASEFF ) diff --git a/src/devices/bus/cbus/pc9801_amd98.cpp b/src/devices/bus/cbus/pc9801_amd98.cpp deleted file mode 100644 index 5b4d66bbdff..00000000000 --- a/src/devices/bus/cbus/pc9801_amd98.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Angelo Salese -/************************************************************************************************** - - System Sacom AMD-98 (AmuseMent boarD) - - 3 PSG chips, one of the first sound boards released for PC98 - Superseded by later NEC in-house sound boards - - TODO: - - not sure if it's AY8910 or YM2203, from a PCB pic it looks with stock AY logos? - - Third AY (uses port B from BOTH AYs); - - PIT control; - - PCM section; - -=================================================================================================== - -- Known games with AMD-98 support - Brown's Run (System Sacom) - Dome (System Sacom) - Highway Star (System Sacom) - Marchen Veil I (System Sacom) - Marchen Veil II (System Sacom) - Zone (System Sacom) - Relics (Bothtec) - Thexder (Game Arts) - -**************************************************************************************************/ - -#include "emu.h" -#include "bus/cbus/pc9801_amd98.h" -#include "speaker.h" - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -// device type definition -DEFINE_DEVICE_TYPE(PC9801_AMD98, pc9801_amd98_device, "pc9801_amd98", "System Sacom AMD-98") - -//------------------------------------------------- -// device_add_mconfig - add device configuration -//------------------------------------------------- - -void pc9801_amd98_device::device_add_mconfig(machine_config &config) -{ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - AY8910(config, m_ay1, 1'996'800); - m_ay1->port_a_read_callback().set_ioport("OPN_PA1"); - m_ay1->port_b_write_callback().set(FUNC(pc9801_amd98_device::ay3_address_w)); - m_ay1->add_route(ALL_OUTPUTS, "lspeaker", 0.50); - - AY8910(config, m_ay2, 1'996'800); - m_ay2->port_a_read_callback().set_ioport("OPN_PA2"); - m_ay2->port_b_write_callback().set(FUNC(pc9801_amd98_device::ay3_data_latch_w)); - m_ay2->add_route(ALL_OUTPUTS, "rspeaker", 0.50); - - AY8910(config, m_ay3, 1'996'800); - m_ay3->add_route(ALL_OUTPUTS, "lspeaker", 0.25); - m_ay3->add_route(ALL_OUTPUTS, "rspeaker", 0.25); -} - -static INPUT_PORTS_START( pc9801_amd98 ) - PORT_START("OPN_PA1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("OPN_PA2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -INPUT_PORTS_END - -ioport_constructor pc9801_amd98_device::device_input_ports() const -{ - return INPUT_PORTS_NAME( pc9801_amd98 ); -} - - - - -//************************************************************************** -// LIVE DEVICE -//************************************************************************** - -//------------------------------------------------- -// pc9801_amd98_device - constructor -//------------------------------------------------- - -pc9801_amd98_device::pc9801_amd98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, PC9801_AMD98, tag, owner, clock) - , m_bus(*this, DEVICE_SELF_OWNER) - , m_ay1(*this, "ay1") - , m_ay2(*this, "ay2") - , m_ay3(*this, "ay3") -{ -} - - -//------------------------------------------------- -// device_validity_check - perform validity checks -// on this device -//------------------------------------------------- - -void pc9801_amd98_device::device_validity_check(validity_checker &valid) const -{ -} - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void pc9801_amd98_device::device_start() -{ -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void pc9801_amd98_device::device_reset() -{ - m_bus->install_io(0x00d8, 0x00df, read8sm_delegate(*this, FUNC(pc9801_amd98_device::read)), write8sm_delegate(*this, FUNC(pc9801_amd98_device::write))); - // Thexder access with following - m_bus->install_io(0x38d8, 0x38df, read8sm_delegate(*this, FUNC(pc9801_amd98_device::read)), write8sm_delegate(*this, FUNC(pc9801_amd98_device::write))); -} - - -//************************************************************************** -// READ/WRITE HANDLERS -//************************************************************************** - -uint8_t pc9801_amd98_device::read(offs_t offset) -{ - switch(offset) - { - case 2: - return m_ay1->data_r(); - case 3: - return m_ay2->data_r(); - } - - logerror("%02x\n",offset); - - return 0xff; -} - -void pc9801_amd98_device::write(offs_t offset, uint8_t data) -{ - switch(offset) - { - case 0: - m_ay1->address_w(data); - break; - case 1: - m_ay2->address_w(data); - break; - case 2: - m_ay1->data_w(data); - break; - case 3: - m_ay2->data_w(data); - break; - default: - logerror("%02x %02x\n",offset,data); - } -} - -void pc9801_amd98_device::ay3_address_w(uint8_t data) -{ - m_ay3_latch = data; -} - -void pc9801_amd98_device::ay3_data_latch_w(uint8_t data) -{ - // TODO: this actually uses a flip flop mechanism, not quite sure about how it works yet - switch(data) - { - case 0x47: - //logerror("%02x addr\n",m_ay3_latch); - m_ay3->address_w(m_ay3_latch); - break; - case 0x43: - //logerror("%02x data\n",m_ay3_latch); - m_ay3->data_w(m_ay3_latch); - break; - } -} diff --git a/src/devices/bus/cbus/pc9801_amd98.h b/src/devices/bus/cbus/pc9801_amd98.h deleted file mode 100644 index 450b17d9342..00000000000 --- a/src/devices/bus/cbus/pc9801_amd98.h +++ /dev/null @@ -1,59 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Angelo Salese -/*************************************************************************** - - System Sacom AMD-98 (AmuseMent boarD) - -***************************************************************************/ - -#ifndef MAME_BUS_CBUS_PC9801_AMD98_H -#define MAME_BUS_CBUS_PC9801_AMD98_H - -#pragma once - -#include "bus/cbus/pc9801_cbus.h" -#include "sound/ay8910.h" - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> pc9801_amd98_device - -class pc9801_amd98_device : public device_t -{ -public: - // construction/destruction - pc9801_amd98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - static constexpr feature_type imperfect_features() { return feature::SOUND; } - - uint8_t read(offs_t offset); - void write(offs_t offset, uint8_t data); - -protected: - // device-level overrides - virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_start() override ATTR_COLD; - virtual void device_reset() override ATTR_COLD; - // optional information overrides - virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; - virtual ioport_constructor device_input_ports() const override ATTR_COLD; - -private: - void ay3_address_w(uint8_t data); - void ay3_data_latch_w(uint8_t data); - - uint8_t m_ay3_latch; - - required_device m_bus; - required_device m_ay1; - required_device m_ay2; - required_device m_ay3; - -}; - -// device type definition -DECLARE_DEVICE_TYPE(PC9801_AMD98, pc9801_amd98_device) - -#endif // MAME_BUS_CBUS_PC9801_AMD98_H diff --git a/src/mame/nec/pc9801.cpp b/src/mame/nec/pc9801.cpp index 6940716e768..4b342261657 100644 --- a/src/mame/nec/pc9801.cpp +++ b/src/mame/nec/pc9801.cpp @@ -605,7 +605,8 @@ uint8_t pc9801_state::f0_r(offs_t offset) { // iterate thru all devices to check if an AMD98 is present // TODO: move to cbus - for (pc9801_amd98_device &amd98 : device_type_enumerator(machine().root_device())) + // TODO: is this really part of PC-98 spec or it's coming from the device itself, as dip/jumper? + for (amd98_device &amd98 : device_type_enumerator(machine().root_device())) { logerror("%s: Read AMD98 ID %s\n", machine().describe_context(), amd98.tag()); return 0x18; // return the right ID @@ -1877,15 +1878,15 @@ static void pc9801_cbus_devices(device_slot_interface &device) { // official HW // PC-9801-14 - device.option_add("pc9801_26", PC9801_26); + device.option_add("pc9801_26", PC9801_26); device.option_add("pc9801_55u", PC9801_55U); device.option_add("pc9801_55l", PC9801_55L); - device.option_add("pc9801_86", PC9801_86); + device.option_add("pc9801_86", PC9801_86); device.option_add("pc9801_118", PC9801_118); device.option_add("pc9801_spb", PC9801_SPEAKBOARD); // Spark Board - device.option_add("pc9801_amd98", PC9801_AMD98); // AmuseMent boarD - device.option_add("mpu_pc98", MPU_PC98); + device.option_add("amd98", AMD98); + device.option_add("mpu_pc98", MPU_PC98); // doujinshi HW // MAD Factory / Doujin Hard (同人ハード) diff --git a/src/mame/nec/pc9801.h b/src/mame/nec/pc9801.h index 74e66948fe2..e89b64261bc 100644 --- a/src/mame/nec/pc9801.h +++ b/src/mame/nec/pc9801.h @@ -44,11 +44,11 @@ #include "video/upd7220.h" +#include "bus/cbus/amd98.h" #include "bus/cbus/pc9801_26.h" #include "bus/cbus/pc9801_55.h" #include "bus/cbus/pc9801_86.h" #include "bus/cbus/pc9801_118.h" -#include "bus/cbus/pc9801_amd98.h" #include "bus/cbus/mpu_pc98.h" #include "bus/cbus/pc9801_cbus.h" #include "pc9801_kbd.h" -- cgit v1.2.3