nec/pc88va.cpp: overhaul, make most software to start running with pc88va2 (#10656)

- nec/v5x.cpp: add ICU slave ack readback;
This commit is contained in:
Angelo Salese 2022-12-14 04:30:45 +01:00 committed by GitHub
parent 242f64d7e3
commit 9a8cac8d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 3273 additions and 1285 deletions

View File

@ -17,6 +17,7 @@ license:CC0
* Igo-mei-kyoku Shuu '87 ~ 囲碁名局集'87, by GAM
* Death Bringer ~ デス・ブリンガー, by Telenet Japan
* Arantia (Atlantia?) VA Special ~ アランティアVAスペシャル, by Victor Music Industry
* Go Kichi-kun ~ 碁キチくん, by GAM
* Go Kichi-kun 2 ~ 碁キチくん2, by GAM
* Ultima V ~ ウルティマⅤ, by Pony Canyon
* The Bard's Tale ~ ザ バーズテイル, by Pony Canyon
@ -28,7 +29,7 @@ license:CC0
* Ishin no Arashi ~ 維新の嵐, by Koei
* Teitoku no Ketsudan ~ 提督の決断, by Koei
* Nobunaga no Yabou - Sengoku Gunyou Den ~ 信長の野望・戦国群雄伝, by Koei
* Suikoden ~ 水滸伝, by Koei
* Suikoden - Tenmei no Chikai ~ 水滸伝 天命の誓い, by Koei
* Kawaiso Monogatari ~ かわいそう物語, by System Software
* Fantasy III ~ ファンタジーⅢ, by Starcraft
* Lodoss Shima Senki ~ ロードス島戦記, by Humming Bird Soft
@ -37,6 +38,10 @@ license:CC0
* Ultima I-IV ~ ウルティマIIV, by Pony Canyon
* Heroes of the Lance ~ ヒーローオブランス, by Pony Canyon
* Lightning Bacchus? ~ ライトニングバッカス, by NCS
* Record of Lodoss War ~ ロードス島戦記 by Humming Bird Soft
PC88VA software
* The Print Shop II ~ プリントショップ Ⅱ (Broderbund Japan)
PC88VA doujin games (mostly undumped)
@ -67,15 +72,27 @@ PC88VA doujin games (mostly undumped)
* 翼君の宝箱14 (by Wing software, 1999)
* くるッ★彡 (by Cenkeil, 1999)
* Frail Rulers (by Fredia, 1999)
* Voltige Aerienne / ディスクイメージ (2008?)
Operating Systems
* MS-DOS 2.11
* MS-DOS 3.1
* CDOS
-->
<!-- Demos and Utilities -->
<!-- These three demos all starts off with the same first two demo sequences -->
<!-- TODO: confirm if they need to be marked as clone once we got them working -->
<software name="pc88vad" supported="no">
<description>PC88-VA Demo</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<publisher>NEC</publisher>
<notes><![CDATA[
Crashes during first demo sequence
]]></notes>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1296112"> <!-- Data CRC16: 2729 -->
<rom name="pc88-va demo.d88" size="1296112" crc="56097ca5" sha1="833ef5f645fbaf1683b53d423e506a2f72e1e83e"/>
@ -89,7 +106,10 @@ PC88VA doujin games (mostly undumped)
<software name="88va1td" supported="no">
<description>88VA1 Tentou Demo</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<publisher>NEC</publisher>
<notes><![CDATA[
Crashes during first demo sequence
]]></notes>
<info name="alt_title" value="88VA1 店頭デモ" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1331888">
@ -101,7 +121,11 @@ PC88VA doujin games (mostly undumped)
<software name="88va2d" supported="no">
<description>88VA2 Demo</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<publisher>NEC</publisher>
<notes><![CDATA[
Crashes during or after second demo sequence
Transition fades out too late, sprite should supposedly fade out before reaching top of screen, requires [IDP] IBF flag
]]></notes>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1331888">
<rom name="nec pc-88va2 demo.d88" size="1331888" crc="ca33e185" sha1="7895ffebce522bacef50397b23414e09bce7e9d0"/>
@ -110,9 +134,13 @@ PC88VA doujin games (mostly undumped)
</software>
<software name="animefrm" supported="no">
<description>AnimeFramer</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<!-- PS88-VA101-HMW subtitle on cover -->
<description>Anime Framer (v1.0)</description>
<year>1987</year>
<publisher>NEC</publisher>
<notes><![CDATA[
No text for [gfx] status bar
]]></notes>
<info name="alt_title" value="アニメフレーマー" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Program Disk" />
@ -127,33 +155,41 @@ PC88VA doujin games (mostly undumped)
<rom name="animeframer - data disk.d88" size="1338960" crc="9b5cd907" sha1="80f1558a3d5c6d21d1c42d8325ae55e320674ef7"/>
</dataarea>
</part>
<!-- Package also contains a CD-ROM, what for? -->
</software>
<!-- Is this an Alt version of the program above (mistranslated), or another program? -->
<software name="paint" supported="no">
<description>Paint?</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<software name="paint" cloneof="animefrm" supported="no">
<description>Anime Framer (v1.0 alt)</description>
<year>1987</year>
<publisher>NEC</publisher>
<notes><![CDATA[
No text for [gfx] status bar
]]></notes>
<!-- labels were swapped -->
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Program Disk" />
<dataarea name="flop" size="1338960">
<rom name="paint - prog disk.d88" size="1331888" crc="08107401" sha1="aab13d4437358f0fac7adec31cf83d1a22608616"/>
<rom name="paint - data disk.d88" size="1331888" crc="73739619" sha1="60f493e7ab24ad8fc57367224a994b0ecf0ad5e2"/>
</dataarea>
</part>
<part name="flop2" interface="floppy_5_25">
<feature name="part_id" value="Data Disk" />
<dataarea name="flop" size="1338960">
<rom name="paint - data disk.d88" size="1331888" crc="73739619" sha1="60f493e7ab24ad8fc57367224a994b0ecf0ad5e2"/>
<rom name="paint - prog disk.d88" size="1331888" crc="08107401" sha1="aab13d4437358f0fac7adec31cf83d1a22608616"/>
</dataarea>
</part>
</software>
<software name="micromus" supported="no">
<description>Micromusician VA</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<description>Micro Musician VA</description>
<year>1989</year>
<publisher>Music Network</publisher>
<notes><![CDATA[
Very broken GFXs with extensive $510 [ROP] writes
Has unsupported MIF-201 [MIDI] interface cfr. http://www.pc88.gr.jp/vafaq/view.php/article/88va/vafaq/71
]]></notes>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1331888">
<rom name="micromusician va.d88" size="1331888" crc="f2ff8069" sha1="a201a60330c701f1f2021b73664582e535dc9b7e"/>
@ -164,7 +200,10 @@ PC88VA doujin games (mostly undumped)
<software name="pceva2tb" supported="no">
<description>PC-Engine (VA2 Tenpu-ban)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<publisher>NEC</publisher>
<notes><![CDATA[
Has HDFORM.COM utility
]]></notes>
<info name="alt_title" value="PC-Engine(VA2添付版)" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1338960">
@ -191,6 +230,10 @@ PC88VA doujin games (mostly undumped)
<description>Family Stadium</description>
<year>19??</year>
<publisher>ゲームアーツ (Game Arts)</publisher>
<notes><![CDATA[
Often crashes during loading [FDC] or during gameplay with stuck [OPNA] note
[SGP] playfield artifacts
]]></notes>
<info name="alt_title" value="ファミリースタジアム" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk 1" />
@ -214,10 +257,16 @@ PC88VA doujin games (mostly undumped)
</part>
</software>
<!-- TODO: seems a clone of famista, while famist89a is the actual '89 version -->
<software name="famist89" supported="no">
<description>Family Stadium '89 - Pennant Race Hen</description>
<year>19??</year>
<publisher>ゲームアーツ (Game Arts)</publisher>
<notes><![CDATA[
Often crashes during loading [FDC] or during gameplay with stuck [OPNA] note
[SGP] playfield artifacts
Needs graphic [OFX/OFY] scroll
]]></notes>
<info name="alt_title" value="ファミリースタジアム'89ペナントレース編" />
<!--combined image-->
<!--rom name="family stadium pennant race ban (va).d88" size="2563936" crc="91d95d8e" sha1="3d31ab00a0be2f792d2bcb031afd065d138c747a"/-->
@ -238,9 +287,12 @@ PC88VA doujin games (mostly undumped)
</software>
<software name="famist89a" cloneof="famist89" supported="no">
<description>Family Stadium '89 (Alt?)</description>
<description>Family Stadium '89 (alt?)</description>
<year>19??</year>
<publisher>ゲームアーツ (Game Arts)</publisher>
<notes><![CDATA[
Hangs during match loading
]]></notes>
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk 1" />
<dataarea name="flop" size="1298608">
@ -267,11 +319,16 @@ PC88VA doujin games (mostly undumped)
<description>Might &amp; Magic</description>
<year>198?</year>
<publisher>スタークラフト (Starcraft)</publisher>
<notes><![CDATA[
Main menu clearing artifacts [ROP]
]]></notes>
<info name="alt_title" value="マイトアンドマジック" />
<info name="usage" value="Boot with Disk C in drive 1"/>
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk A - User" />
<dataarea name="flop" size="1094592">
<rom name="might &amp; magic(diska_userdisk) (star craft).d88" size="1094592" crc="de68bba5" sha1="d6be57c867a3cca8b694bc2b129705c653ae44da"/>
<feature name="part_id" value="Disk C - Boot" />
<dataarea name="flop" size="1331888">
<rom name="might &amp; magic(diskc_bootdisk) (star craft).d88" size="1331888" crc="f3c56b5e" sha1="ab39d96aa7a5446a8cb8b929978f6211746d02bc"/>
</dataarea>
</part>
@ -283,9 +340,9 @@ PC88VA doujin games (mostly undumped)
</part>
<part name="flop3" interface="floppy_5_25">
<feature name="part_id" value="Disk C - Boot" />
<dataarea name="flop" size="1331888">
<rom name="might &amp; magic(diskc_bootdisk) (star craft).d88" size="1331888" crc="f3c56b5e" sha1="ab39d96aa7a5446a8cb8b929978f6211746d02bc"/>
<feature name="part_id" value="Disk A - User" />
<dataarea name="flop" size="1094592">
<rom name="might &amp; magic(diska_userdisk) (star craft).d88" size="1094592" crc="de68bba5" sha1="d6be57c867a3cca8b694bc2b129705c653ae44da"/>
</dataarea>
</part>
</software>
@ -294,6 +351,9 @@ PC88VA doujin games (mostly undumped)
<description>Might &amp; Magic Book 2</description>
<year>1984</year>
<publisher>スタークラフト (Starcraft)</publisher>
<notes><![CDATA[
Burps on [FDC] access after disk swap with program and player disks, trying to scan chrn=(4, 0, 1, 256)
]]></notes>
<info name="alt_title" value="マイトアンドマジック2" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Boot Disk" />
@ -328,6 +388,12 @@ PC88VA doujin games (mostly undumped)
<description>Olteus</description>
<year>1987</year>
<publisher>ウインキーソフト (Winky Soft)</publisher>
<notes><![CDATA[
Crashes during opening with an (A)bort (R)etry (F)ail [FDC]
[OPNA] dies often
Map select may use [SGP]
Needs graphic [OFX/OFY] scroll
]]></notes>
<info name="alt_title" value="オルテウス" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk A" />
@ -360,9 +426,15 @@ PC88VA doujin games (mostly undumped)
<!-- First 4th disk in TOSEC has diff crc than the one above -->
<software name="olteusa" cloneof="olteus" supported="no">
<description>Olteus (Alt Disk D)</description>
<description>Olteus (alt disk D)</description>
<year>1987</year>
<publisher>ウインキーソフト (Winky Soft)</publisher>
<notes><![CDATA[
Crashes during opening with an (A)bort (R)etry (F)ail [FDC]
[OPNA] dies often
Map select may use [SGP]
Needs graphic [OFX/OFY] scroll
]]></notes>
<info name="alt_title" value="オルテウス" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk A" />
@ -395,8 +467,13 @@ PC88VA doujin games (mostly undumped)
<software name="rtype" supported="no">
<description>R-Type</description>
<year>1988?</year>
<year>1988</year>
<publisher>NEC</publisher>
<notes><![CDATA[
Crashes often on opening [OPNA] or [FDC]
No enemy sprites during gameplay [SGP]
Needs graphic [OFX/OFY] scroll
]]></notes>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1296112">
<rom name="r-type(disk1) (irem).d88" size="1296112" crc="5d24bb7f" sha1="2f8ee8495ebc68dae466e753c7e38c0df4c654b8"/>
@ -414,6 +491,9 @@ PC88VA doujin games (mostly undumped)
<description>Rogue Alliance</description>
<year>198?</year>
<publisher>スタークラフト (Starcraft)</publisher>
<notes><![CDATA[
Burps on [FDC] access after disk swap with program and player disks, trying to scan chrn=(38, 0, 1, 256)
]]></notes>
<info name="alt_title" value="ローグアライアンス" />
<part name="flop1" interface="floppy_5_25">
@ -442,6 +522,12 @@ PC88VA doujin games (mostly undumped)
<description>Shanghai</description>
<year>1986</year>
<publisher>システムソフト (System Soft)</publisher>
<notes><![CDATA[
No sound even if the game claims to have it, cfr. settings pane (particularly clicks) [dac1bit]
Disk errors if accessing [FDC] with motor off (goes idle after a while)
[mouse] is a requirement?
Winning animation is glitchy [OFX/OFY]?, uses [IDP] text transpen with upper bits set (for flame effect?), eventually crashes (no pointer available)
]]></notes>
<info name="alt_title" value="上海" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1296112">
@ -454,7 +540,14 @@ PC88VA doujin games (mostly undumped)
<description>Shinra Bansho</description>
<year>1987</year>
<publisher>日本テレネット (Nihon Telenet)</publisher>
<notes><![CDATA[
Hangs on opening due of [OPNA] irq misfiring
Opening has a few weird places for [gfx] priority
Has [SGP] and [ROP] artifacts
Omake: if sound irqs don't run then needs to press key 0 pad to move on
]]></notes>
<info name="alt_title" value="神羅万象"/>
<info name="usage" value="Hold enter at boot to skip intro, press F2 on title screen to load a game, press F5 for sound test" />
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Disk A" />
<dataarea name="flop" size="1331888">
@ -474,6 +567,9 @@ PC88VA doujin games (mostly undumped)
<description>Sorcerian</description>
<year>1988</year>
<publisher>日本ファルコム (Nihon Falcom)</publisher>
<notes><![CDATA[
Enables [FDC] PIO mode, black screen
]]></notes>
<info name="release" value="19880617"/>
<info name="alt_title" value="ソーサリアン"/>
@ -660,6 +756,11 @@ PC88VA doujin games (mostly undumped)
<description>Tetris</description>
<year>1988</year>
<publisher>B·P·S (Bullet-Proof Software)</publisher>
<notes><![CDATA[
White screen after [SGP] transfers, jumps to lalaland on copyright screen
Triggers "unimplemented floating point control" at PC=0x1d88d
Known to have [floppy] copy protection, VAEG emu sports a lovely "TETRIS IS ONLY 6,800 YEN" on title screen with annoying SFX covering the BGM
]]></notes>
<info name="release" value="19881222"/>
<info name="alt_title" value="テトリス"/>
<part name="flop1" interface="floppy_5_25">
@ -670,11 +771,17 @@ PC88VA doujin games (mostly undumped)
</software>
<!-- Dual floppies, should work both on the PC88VA and on the PC98 (usually you just have to switch the first two disks depending on the system) -->
<!-- TODO: move to a shared SW list -->
<software name="illcity" supported="no">
<description>Illusion City - Genei Toshi</description>
<year>1992</year>
<publisher>マイクロキャビン (Micro Cabin)</publisher>
<notes><![CDATA[
Crashes with [ROP] artifacts on opening
No [OPNA] sound
Has unemulated [MIDI] options
]]></notes>
<info name="release" value="199201xx"/>
<info name="alt_title" value="幻影都市 ~イリュージョンシティ~"/>
@ -732,23 +839,32 @@ PC88VA doujin games (mostly undumped)
<description>Xak II</description>
<year>1990</year>
<publisher>マイクロキャビン (Micro Cabin)</publisher>
<notes><![CDATA[
Hangs on check at PC=2c67b on opening, wants either [OPNA] or [SGP] irq
No [OPNA] sound
[gfx]s have halved height
Heavy [ROP] artifacts during gameplay
Optionally wants kana lock enabled for entering a name for new game [keyboard] irq
]]></notes>
<info name="release" value="19901102"/>
<info name="usage" value="Boot with disk 2 in drive A: for gameplay"/>
<!-- status: baddump for non-factory save 1 -->
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1281968">
<rom name="xak 2 (disk 1).d88" size="1281968" crc="cd855b7a" sha1="508e25ca306631be64e69e476d49116e7ac04bce"/>
<rom name="xak 2 (disk 1).d88" size="1281968" crc="cd855b7a" sha1="508e25ca306631be64e69e476d49116e7ac04bce" />
</dataarea>
</part>
<part name="flop2" interface="floppy_5_25">
<dataarea name="flop" size="1281968">
<rom name="xak 2 (disk 2).d88" size="1281968" crc="3927cdcf" sha1="555daba18a61ea2219b5685a850b512dea085cf2"/>
<rom name="xak 2 (disk 2).d88" size="1281968" crc="3927cdcf" sha1="555daba18a61ea2219b5685a850b512dea085cf2" status="baddump"/>
</dataarea>
</part>
<part name="flop3" interface="floppy_5_25">
<dataarea name="flop" size="1281968">
<rom name="xak 2 (disk 3).d88" size="1281968" crc="42e25779" sha1="897b62c7fdb604f5bb729e0aeb183566e08c4e33"/>
<rom name="xak 2 (disk 3).d88" size="1281968" crc="42e25779" sha1="897b62c7fdb604f5bb729e0aeb183566e08c4e33" status="baddump"/>
</dataarea>
</part>
</software>
@ -757,8 +873,16 @@ PC88VA doujin games (mostly undumped)
<description>Fray - In Magical Adventure</description>
<year>1991</year>
<publisher>マイクロキャビン (Micro Cabin)</publisher>
<notes><![CDATA[
(A)bort (R)etry (F)ail during loading [FDC]
Missing graphics [ROP]
Sprites don't draw properly during gameplay [ROP]
No [OPNA] sound
[gfx]s have halved height
]]></notes>
<info name="release" value="19911220"/>
<info name="alt_title" value="フレイ"/>
<info name="usage" value="Boot with disk 2 in drive A: for gameplay"/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1261568">
@ -786,11 +910,16 @@ PC88VA doujin games (mostly undumped)
</software>
<!-- Dual floppies, should work both on the PC88VA and on the X68000 (usually you just have to switch the first two disks depending on the system) -->
<!-- TODO: move to a shared SW list -->
<!-- TODO: all these .xdf entries wants Disk B as drive A: for 88VA -->
<software name="abunaten" supported="no">
<description>Abunai Tengu Densetsu</description>
<year>1989</year>
<publisher>アリスソフト (Alicesoft)</publisher>
<notes><![CDATA[
Loads N88 BASIC then jumps to lalaland [FDC]
]]></notes>
<info name="release" value="198910xx"/>
<info name="alt_title" value="あぶない天狗伝説 (or あぶないてんぐ伝説 )"/>
@ -820,6 +949,9 @@ PC88VA doujin games (mostly undumped)
<description>Crescent Moon Girl</description>
<year>1989</year>
<publisher>アリスソフト (Alicesoft)</publisher>
<notes><![CDATA[
Loads N88 BASIC then jumps to lalaland [FDC]
]]></notes>
<info name="release" value="198908xx"/>
<info name="alt_title" value="クレセントムーンがぁる"/>
@ -849,6 +981,9 @@ PC88VA doujin games (mostly undumped)
<description>D.P.S - Dream Program System</description>
<year>1989</year>
<publisher>アリスソフト (Alicesoft)</publisher>
<notes><![CDATA[
Loads N88 BASIC then jumps to lalaland [FDC]
]]></notes>
<info name="release" value="198912xx"/>
<info name="alt_title" value="ディー・ピー・エス - ドリームプログラムシステム"/>
@ -873,7 +1008,8 @@ PC88VA doujin games (mostly undumped)
<publisher>アリスソフト (Alicesoft)</publisher>
<info name="release" value="199008xx"/>
<info name="alt_title" value="ディー・ピー・エス SG"/>
<!-- Data disk for dps? -->
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="System" />
<dataarea name="flop" size="1261568">
@ -909,6 +1045,7 @@ PC88VA doujin games (mostly undumped)
<publisher>アリスソフト (Alicesoft)</publisher>
<info name="release" value="199104xx"/>
<info name="alt_title" value="ディー・ピー・エス SG2"/>
<!-- Data disk for dps? -->
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="System" />
@ -945,6 +1082,7 @@ PC88VA doujin games (mostly undumped)
<publisher>アリスソフト (Alicesoft)</publisher>
<info name="release" value="199112xx"/>
<info name="alt_title" value="ディー・ピー・エス SG3"/>
<!-- Data disk for dps? -->
<part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="System" />
@ -979,6 +1117,9 @@ PC88VA doujin games (mostly undumped)
<description>Rance - Hikari wo Motomete</description>
<year>1989</year>
<publisher>アリスソフト (Alicesoft)</publisher>
<notes><![CDATA[
Loads N88 BASIC then jumps to lalaland [FDC]
]]></notes>
<info name="release" value="198907xx"/>
<info name="alt_title" value="ランス 光を求めて"/>
@ -1015,6 +1156,9 @@ PC88VA doujin games (mostly undumped)
<description>Rance 2 - Hangyaku no Shojo-tachi</description>
<year>1990</year>
<publisher>アリスソフト (Alicesoft)</publisher>
<notes><![CDATA[
All disks fail initial bootstrap [FDC]
]]></notes>
<info name="release" value="199005xx"/>
<info name="alt_title" value="ランス2-反逆の少女たち-"/>
<part name="flop1" interface="floppy_5_25">
@ -1067,6 +1211,10 @@ PC88VA doujin games (mostly undumped)
<description>Balloon Breaker</description>
<year>1996</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
Doesn't draw anything [SGP]
Eventually hangs on badly colored [sprites]
]]></notes>
<info name="developer" value="Fredia" />
<info name="alt_title" value="ばる〜んぶ れ〜か〜" />
<part name="flop1" interface="floppy_5_25">
@ -1080,6 +1228,10 @@ PC88VA doujin games (mostly undumped)
<description>Boomering</description>
<year>1996</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
Doesn't draw title screen [SGP]
Needs graphic [OFX/OFY] scroll
]]></notes>
<info name="developer" value="Fredia" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1331888">
@ -1090,8 +1242,14 @@ PC88VA doujin games (mostly undumped)
<software name="harehare" supported="no">
<description>Hare Hare Yukai</description>
<year>19??</year>
<!-- "PC88VA 20th Anniversary" -->
<year>2006</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
Currently punts to PC Engine OS in 24.8 kHz [CRTC] vblank bit
Broken graphics [SGP]
15.7 kHz has doubled height [gfx]
]]></notes>
<info name="developer" value="Shinra" />
<info name="alt_title" value="ハレ晴レユカイ" />
<part name="flop1" interface="floppy_5_25">
@ -1111,6 +1269,10 @@ PC88VA doujin games (mostly undumped)
<description>Hati no Sora de</description>
<year>1994</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
No graphics [SGP]
Throws an (A)bort (R)etry (F)ail during opening [FDC]
]]></notes>
<info name="developer" value="LOKAPALA" />
<info name="alt_title" value="ハティの空で" />
<part name="flop1" interface="floppy_5_25">
@ -1124,6 +1286,10 @@ PC88VA doujin games (mostly undumped)
<description>Saishuu Heiki UPO (Pre-Release)</description>
<year>1992</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
Broken Upyolic logo [ROP]
Black screen, loops on [IDP] vblank bit
]]></notes>
<info name="developer" value="Upyolic Soft" />
<info name="alt_title" value="最終平気UPOプレリリース" />
<part name="flop1" interface="floppy_5_25">
@ -1133,12 +1299,12 @@ PC88VA doujin games (mostly undumped)
</part>
</software>
<!-- According to the guy who posted of this d88, this can be started from V3 BASIC with the command BASIC PACMAN.BAS... to be verified when emulation progresses -->
<software name="pacman" supported="no">
<description>Pac-Man</description>
<year>19??</year>
<publisher>&lt;doujin&gt;</publisher>
<info name="developer" value="Shinra" />
<info name="usage" value="Boot a PC Engine OS disk, then swap with this disk and type BASIC PACMAN.BAS to load" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1331888">
<rom name="pacman.d88" size="1331888" crc="9198eae1" sha1="2abf462b72c29e2ff56ea7c1401836f01b97dfe1"/>
@ -1146,11 +1312,14 @@ PC88VA doujin games (mostly undumped)
</part>
</software>
<!-- Is this the same program as above or a diff one? -->
<!-- autobootable version of above, with PC Engine OS embedded -->
<software name="pacmana" cloneof="pacman" supported="no">
<description>Pac-Man (Alt?)</description>
<description>Pac-Man (auto-bootable)</description>
<year>19??</year>
<publisher>&lt;doujin&gt;</publisher>
<notes><![CDATA[
Punts to PC Engine OS with "abort batch processing" message
]]></notes>
<info name="developer" value="Shinra" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1281968">
@ -1162,6 +1331,7 @@ PC88VA doujin games (mostly undumped)
<!-- PC88 Images which have been patched to work on the VA? -->
<!-- is this legit? -->
<!-- TODO: None of the disks are bootable from V3 Mode, boots from pc8801ma by quick glance so likely belongs to pc8801_flop.xml, move once we have working V2 emulation mode -->
<software name="midgarts" supported="no">
<description>Mid Garts (VA patched?)</description>
<year>19??</year>

View File

@ -347,6 +347,7 @@ void v50_base_device::device_start()
m_internal_io = &space(AS_INTERNAL_IO);
m_tout1_callback.resolve_safe();
m_icu_slave_ack.resolve_safe(0);
set_irq_acknowledge_callback(*m_icu, FUNC(v5x_icu_device::inta_cb));
@ -520,6 +521,7 @@ v50_base_device::v50_base_device(const machine_config &mconfig, device_type type
: nec_common_device(mconfig, type, tag, owner, clock, is_16bit, prefetch_size, prefetch_cycles, chip_type, address_map_constructor(FUNC(v50_base_device::internal_port_map), this))
, device_v5x_interface(mconfig, *this, is_16bit)
, m_tout1_callback(*this)
, m_icu_slave_ack(*this)
, m_OPCN(0)
, m_tout1(false)
, m_intp1(false)

View File

@ -105,7 +105,7 @@ protected:
void OPHA_w(u8 data);
u8 OPSEL_r();
void OPSEL_w(u8 data);
u8 get_pic_ack() { return 0; }
virtual u8 get_pic_ack(offs_t offset) { return 0; }
DECLARE_WRITE_LINE_MEMBER(internal_irq_w);
void tcu_clock_update();
@ -148,6 +148,8 @@ public:
auto tout1_cb() { return m_tout1_callback.bind(); }
auto tout2_cb() { return subdevice<pit8253_device>("tcu")->out_handler<2>(); }
auto icu_slave_ack_cb() { return m_icu_slave_ack.bind(); }
protected:
v50_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool is_16bit, u8 prefetch_size, u8 prefetch_cycles, u32 chip_type);
@ -177,10 +179,20 @@ protected:
u8 OPCN_r();
void OPCN_w(u8 data);
// TODO: non-offset 7 configuration
// Currently used by pc88va only, which uses the canonical IRQ7 for cascading an external PIC to the internal one.
virtual u8 get_pic_ack(offs_t offset) override
{
if (offset == 7)
return m_icu_slave_ack(0);
return 0;
}
private:
DECLARE_WRITE_LINE_MEMBER(tout1_w);
devcb_write_line m_tout1_callback;
devcb_read8 m_icu_slave_ack;
u8 m_OPCN;
bool m_tout1;

View File

@ -676,7 +676,7 @@ void pc8801_state::port40_w(uint8_t data)
if(((m_device_ctrl_data & 0x20) == 0x20) && ((data & 0x20) == 0x00))
m_beeper->set_state(0);
// TODO: send to joyport implementation
// TODO: send to joyport DE-9 implementation
if((m_device_ctrl_data & 0x40) != (data & 0x40))
{
attotime new_time = machine().time();
@ -1592,7 +1592,7 @@ void pc8801mc_state::machine_reset()
m_cdrom_bank = true;
}
// TODO: to joyport DB9 option slot
// TODO: to joyport DE-9 option slot
uint8_t pc8801mk2sr_state::opn_porta_r()
{
if(ioport("BOARD_CONFIG")->read() & 2)

File diff suppressed because it is too large Load Diff

View File

@ -14,115 +14,135 @@
#include "cpu/nec/v5x.h"
#include "cpu/z80/z80.h"
#include "imagedev/floppy.h"
#include "machine/am9517a.h"
#include "machine/bankdev.h"
#include "machine/i8255.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
//#include "machine/upd71071.h"
#include "machine/timer.h"
#include "machine/upd1990a.h"
#include "machine/upd765.h"
#include "machine/bankdev.h"
#include "sound/ymopn.h"
//#include "pc80s31k.h"
#include "pc88va_sgp.h"
#include "emupal.h"
#include "screen.h"
#include "softlist.h"
#include "speaker.h"
#include "formats/pc98fdi_dsk.h"
#include "formats/xdf_dsk.h"
// TODO: for the time being, just disable FDC CPU, it's for PC-8801 compatibility mode anyway.
// the whole FDC device should be converted (it's also used by PC-9801)
#define TEST_SUBFDC 0
class pc88va_state : public driver_device
{
public:
pc88va_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_fdc(*this, "upd765"),
m_fdd(*this, "upd765:%u", 0U),
m_dmac(*this, "dmac"),
m_pic1(*this, "pic8259_master"),
m_pic2(*this, "pic8259_slave"),
m_palram(*this, "palram"),
m_sysbank(*this, "sysbank"),
m_tvram(*this, "tvram"),
m_gvram(*this, "gvram"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
pc88va_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_fdc(*this, "upd765")
, m_fdd(*this, "upd765:%u", 0U)
, m_pic2(*this, "pic8259_slave")
, m_rtc(*this, "rtc")
, m_opna(*this, "opna")
, m_lspeaker(*this, "lspeaker")
, m_rspeaker(*this, "rspeaker")
, m_palram(*this, "palram")
, m_sysbank(*this, "sysbank")
, m_workram(*this, "workram")
, m_tvram(*this, "tvram")
, m_gvram(*this, "gvram")
, m_fb_regs(*this, "fb_regs")
, m_kanji_rom(*this, "kanji")
, m_sgp(*this, "sgp")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
{ }
void pc88va(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
protected:
struct tsp_t
{
uint16_t tvram_vreg_offset = 0;
uint16_t attr_offset = 0;
uint16_t spr_offset = 0;
uint8_t disp_on = 0;
uint8_t spr_on = 0;
uint8_t pitch = 0;
uint8_t line_height = 0;
uint8_t h_line_pos = 0;
uint8_t blink = 0;
uint16_t cur_pos_x = 0, cur_pos_y = 0;
uint8_t curn = 0;
uint8_t curn_blink = 0;
u16 tvram_vreg_offset = 0;
u32 attr_offset = 0;
u32 spr_offset = 0;
u8 spr_mg = 0;
bool disp_on = false;
bool spr_on = false;
u8 pitch = 0;
u8 line_height = 0;
u8 h_line_pos = 0;
u16 blink = 0;
u16 cur_pos_x = 0, cur_pos_y = 0;
u8 curn = 0;
bool curn_blink = false;
bool spwr_define = false;
u8 spwr_offset = 0;
};
struct keyb_t
{
u8 data = 0;
};
keyb_t m_keyb;
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
void palette_init(palette_device &palette) const;
private:
required_device<cpu_device> m_maincpu;
required_device<v50_device> m_maincpu;
required_device<screen_device> m_screen;
required_device<upd765a_device> m_fdc;
required_device_array<floppy_connector, 2> m_fdd;
required_device<am9517a_device> m_dmac;
required_device<pic8259_device> m_pic1;
// required_device<am9517a_device> m_dmac;
// required_device<pic8259_device> m_pic1;
required_device<pic8259_device> m_pic2;
required_device<upd4990a_device> m_rtc;
required_device<ym2608_device> m_opna;
required_device<speaker_device> m_lspeaker;
required_device<speaker_device> m_rspeaker;
required_shared_ptr<uint16_t> m_palram;
required_device<address_map_bank_device> m_sysbank;
required_shared_ptr<uint16_t> m_workram;
required_shared_ptr<uint16_t> m_tvram;
required_shared_ptr<uint16_t> m_gvram;
required_shared_ptr<uint16_t> m_fb_regs;
required_region_ptr<u16> m_kanji_rom;
required_device<pc88va_sgp_device> m_sgp;
std::unique_ptr<uint8_t[]> m_kanjiram;
uint16_t m_bank_reg = 0;
uint16_t m_screen_ctrl_reg = 0;
uint8_t m_timer3_io_reg = 0;
emu_timer *m_t3_mouse_timer = nullptr;
tsp_t m_tsp;
uint16_t m_video_pri_reg[2]{};
uint8_t m_backupram_wp = 0;
uint8_t m_cmd = 0;
uint8_t m_buf_size = 0;
uint8_t m_buf_index = 0;
uint8_t m_buf_ram[16]{};
uint8_t m_portc_test = 0;
uint8_t m_fdc_motor_status[2]{};
bool m_rstmd = false;
/* timers */
emu_timer *m_tc_clear_timer = nullptr;
// FDC
emu_timer *m_fdc_timer = nullptr;
emu_timer *m_motor_start_timer[2]{};
/* floppy state */
uint8_t m_i8255_0_pc = 0;
uint8_t m_i8255_1_pc = 0;
uint8_t m_fdc_mode = 0;
uint8_t m_fdc_irq_opcode = 0;
uint8_t idp_status_r();
void idp_command_w(uint8_t data);
void idp_param_w(uint8_t data);
void palette_ram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t sys_port4_r();
uint8_t m_fdc_ctrl_2 = 0;
bool m_xtmask = false;
TIMER_CALLBACK_MEMBER(t3_mouse_callback);
TIMER_CALLBACK_MEMBER(pc88va_fdc_timer);
TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_0);
TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_1);
DECLARE_WRITE_LINE_MEMBER(tc_w);
DECLARE_WRITE_LINE_MEMBER(fdc_irq);
static void floppy_formats(format_registration &fr);
void pc88va_fdc_update_ready(floppy_image_device *, int);
uint8_t fake_subfdc_r();
uint8_t pc88va_fdc_r(offs_t offset);
void pc88va_fdc_w(offs_t offset, uint8_t data);
uint16_t bios_bank_r();
void bios_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint8_t rom_bank_r();
@ -131,28 +151,18 @@ private:
void backupram_wp_0_w(uint16_t data);
uint8_t kanji_ram_r(offs_t offset);
void kanji_ram_w(offs_t offset, uint8_t data);
uint8_t hdd_status_r();
#if TEST_SUBFDC
uint8_t upd765_tc_r();
void upd765_mc_w(uint8_t data);
#else
uint8_t no_subfdc_r();
#endif
uint8_t pc88va_fdc_r(offs_t offset);
void pc88va_fdc_w(offs_t offset, uint8_t data);
uint16_t sysop_r();
uint16_t screen_ctrl_r();
void screen_ctrl_w(uint16_t data);
void timer3_ctrl_reg_w(uint8_t data);
void video_pri_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint8_t backupram_dsw_r(offs_t offset);
void sys_port1_w(uint8_t data);
uint32_t screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pc88va_vrtc_irq);
uint8_t cpu_8255_c_r();
void cpu_8255_c_w(uint8_t data);
uint8_t fdc_8255_c_r();
void fdc_8255_c_w(uint8_t data);
u8 sys_port5_r();
void sys_port5_w(u8 data);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(vrtc_irq);
uint8_t r232_ctrl_porta_r();
uint8_t r232_ctrl_portb_r();
uint8_t r232_ctrl_portc_r();
@ -160,31 +170,70 @@ private:
void r232_ctrl_portb_w(uint8_t data);
void r232_ctrl_portc_w(uint8_t data);
uint8_t get_slave_ack(offs_t offset);
DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed);
// DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
uint8_t m_fdc_ctrl_2;
TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero);
TIMER_CALLBACK_MEMBER(t3_mouse_callback);
TIMER_CALLBACK_MEMBER(pc88va_fdc_timer);
TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_0);
TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_1);
// uint16_t m_fdc_dma_r();
// void m_fdc_dma_w(uint16_t data);
DECLARE_WRITE_LINE_MEMBER(pc88va_hlda_w);
DECLARE_WRITE_LINE_MEMBER(pc88va_tc_w);
uint8_t fdc_dma_r();
void fdc_dma_w(uint8_t data);
uint8_t dma_memr_cb(offs_t offset);
void dma_memw_cb(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER(fdc_irq);
DECLARE_WRITE_LINE_MEMBER(fdc_drq);
static void floppy_formats(format_registration &fr);
void pc88va_fdc_update_ready(floppy_image_device *, int);
uint16_t m_video_pri_reg[2]{};
u16 m_screen_ctrl_reg = 0;
bool m_dm = false;
bool m_ymmd = false;
u16 m_gfx_ctrl_reg = 0;
u16 m_color_mode = 0;
u8 m_pltm, m_pltp = 0;
u16 m_text_transpen = 0;
bool m_td = false;
bitmap_rgb32 m_graphic_bitmap[2];
u16 screen_ctrl_r();
void screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0);
u16 gfx_ctrl_r();
void gfx_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void video_pri_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void color_mode_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void text_transpen_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void text_control_1_w(u8 data);
u8 m_kanji_cg_line = 0;
u8 m_kanji_cg_jis[2]{};
u8 m_kanji_cg_lr = 0;
u8 kanji_cg_r();
void kanji_cg_raster_w(u8 data);
void kanji_cg_address_w(offs_t offset, u8 data);
void palette_ram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
u8 get_layer_pal_bank(u8 which);
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 which);
void draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base);
void draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height);
void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height);
void draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height);
void draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height);
void draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height);
uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y);
void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit);
// IDP
tsp_t m_tsp;
uint8_t m_cmd = 0;
uint8_t m_buf_size = 0;
uint8_t m_buf_index = 0;
uint8_t m_buf_ram[16]{};
u16 m_vrtc_irq_line = 432;
uint8_t idp_status_r();
void idp_command_w(uint8_t data);
void idp_param_w(uint8_t data);
void tsp_sprite_enable(u32 sprite_number, bool sprite_enable, bool blink_enable);
void execute_sync_cmd();
void execute_dspon_cmd();
void execute_dspdef_cmd();
@ -194,16 +243,44 @@ private:
void execute_emul_cmd();
void execute_spron_cmd();
void execute_sprsw_cmd();
void execute_spwr_cmd(u8 data);
void pc88va_map(address_map &map);
void pc88va_io_map(address_map &map);
void main_map(address_map &map);
void io_map(address_map &map);
void sysbank_map(address_map &map);
void opna_map(address_map &map);
void sgp_map(address_map &map);
void pc88va_z80_io_map(address_map &map);
void pc88va_z80_map(address_map &map);
protected:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
// TODO: stuff backported from PC8801 as QoL that should really be common
private:
uint8_t misc_ctrl_r();
void misc_ctrl_w(uint8_t data);
uint8_t port40_r();
void port40_w(offs_t offset, u8 data);
void rtc_w(offs_t offset, u8 data);
u8 opn_porta_r();
u8 m_device_ctrl_data = 0;
u8 m_misc_ctrl = 0x80;
bool m_sound_irq_enable = false;
bool m_sound_irq_pending = false;
DECLARE_WRITE_LINE_MEMBER(int4_irq_w);
struct mouse_t {
uint8_t phase = 0;
int8_t prev_dx = 0, prev_dy = 0;
uint8_t lx = 0, ly = 0;
attotime time = attotime::never;
};
attotime mouse_limit_hz();
mouse_t m_mouse;
};

403
src/mame/nec/pc88va_sgp.cpp Normal file
View File

@ -0,0 +1,403 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/**************************************************************************************************
NEC SGP ( / Super Graphic Processor)
Unknown part number, used as GPU for PC88VA
TODO:
- timing details
- specifics about what exactly happens in work area when either SGP runs or is idle.
- famista: during gameplay it BITBLT same source to destination 0x00037076
with tp_mode = 3 and pitch = 0 (!?);
- rtype: during gameplay it does transfers with Pitch = 0xfff0, alias for negative draw?
- basic fires a VABOT on loading;
**************************************************************************************************/
#include "emu.h"
#include "pc88va_sgp.h"
#include <iostream>
#define LOG_COMMAND (1U << 2)
#define VERBOSE (LOG_GENERAL)
//#define LOG_OUTPUT_STREAM std::cout
#include "logmacro.h"
#define LOGCOMMAND(...) LOGMASKED(LOG_COMMAND, __VA_ARGS__)
// device type definition
DEFINE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device, "pc88va_sgp", "NEC PC88VA Super Graphic Processor")
pc88va_sgp_device::pc88va_sgp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
device_t(mconfig, PC88VA_SGP, tag, owner, clock),
device_memory_interface(mconfig, *this),
m_data(nullptr)
{
}
device_memory_interface::space_config_vector pc88va_sgp_device::memory_space_config() const
{
return space_config_vector {
std::make_pair(AS_DATA, &m_data_config)
};
}
void pc88va_sgp_device::device_config_complete()
{
m_data_config = address_space_config( "data", ENDIANNESS_LITTLE, 16, 22, 0 );
}
void pc88va_sgp_device::device_start()
{
m_data = &space(AS_DATA);
}
void pc88va_sgp_device::device_reset()
{
}
/****************************************
* I/Os
***************************************/
void pc88va_sgp_device::sgp_io(address_map &map)
{
// TODO: check if readable
map(0x00, 0x03).w(FUNC(pc88va_sgp_device::vdp_address_w));
map(0x04, 0x04).w(FUNC(pc88va_sgp_device::control_w));
map(0x06, 0x06).rw(FUNC(pc88va_sgp_device::status_r), FUNC(pc88va_sgp_device::trigger_w));
}
void pc88va_sgp_device::vdp_address_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_vdp_address[offset]);
}
/*
* ---- -x-- VINTF (1) enable irq on END execution, (0) clear irq
* ---- --x- VABOT suspend SGP execution (1)
*/
void pc88va_sgp_device::control_w(u8 data)
{
if (data)
popmessage("SGP warning write %02x", data);
}
/*
* ---- ---x VBUSY (1) busy flag
*/
u8 pc88va_sgp_device::status_r()
{
return 0;
}
/*
* ---- ---x SGPCA start SGP execution (1)
*/
void pc88va_sgp_device::trigger_w(u8 data)
{
// TODO: under a timer
if (BIT(data, 0))
start_exec();
if (data != 1)
LOG("Warning: SGP trigger write %02x\n", data);
}
void pc88va_sgp_device::start_exec()
{
u32 vdp_pointer = (m_vdp_address[0]) | (m_vdp_address[1] << 16);
// TODO: the SGP should go indefinitely until an END is issued
// for now punt early until we find something that warrants a parallel execution
// boomer is the current upper limit, uses SGP to transfer rows on vertical scrolling.
const u32 end_pointer = vdp_pointer + 0x800;
LOGCOMMAND("SGP: trigger start %08x\n", vdp_pointer);
bool end_issued = false;
while( vdp_pointer < end_pointer )
{
const u16 cur_opcode = m_data->read_word(vdp_pointer);
u16 next_pc = 2;
switch(cur_opcode)
{
// END
case 0x0001:
LOGCOMMAND("SGP: (PC=%08x) END\n", vdp_pointer);
end_issued = true;
break;
// NOP
case 0x0002:
LOGCOMMAND("SGP: (PC=%08x) NOP\n", vdp_pointer);
break;
// SET WORK
case 0x0003:
{
// This sets a work RAM address so that SGP can store internal data
// This buffer needs 58 bytes, and nothing else is known other than
// SGP needing this command issued as first before it can work with
// any meaningful command.
// Speculation is that assuming the host can r/w this area without
// huge penalties it can also observe or even override the
// SGP internals ...
const u16 lower_offset = m_data->read_word(vdp_pointer + 2);
const u16 upper_offset = m_data->read_word(vdp_pointer + 4);
m_work_address = lower_offset | upper_offset << 16;
LOGCOMMAND("SGP: (PC=%08x) SET WORK %08x\n",
vdp_pointer,
m_work_address
);
next_pc += 4;
break;
}
// SET SOURCE
case 0x0004:
// SET DESTINATION
case 0x0005:
{
const bool mode = cur_opcode == 5;
BufferArea *ptr = mode ? &m_dst : &m_src;
/*
* ---- ---- xxxx ---- start dot position
* ---- ---- ---- --xx SCRN_M: pixel mode
* ---- ---- ---- --00 1bpp
* ---- ---- ---- --01 4bpp
* ---- ---- ---- --10 8bpp
* ---- ---- ---- --11 RGB565
*/
const u16 param1 = m_data->read_word(vdp_pointer + 2);
ptr->start_dot = (param1 & 0xf0) >> 4;
ptr->pixel_mode = (param1 & 0x03);
ptr->hsize = m_data->read_word(vdp_pointer + 4) & 0x0fff;
ptr->vsize = m_data->read_word(vdp_pointer + 6) & 0x0fff;
ptr->fb_pitch = m_data->read_word(vdp_pointer + 8) & 0xfffc;
ptr->address = (m_data->read_word(vdp_pointer + 10) & 0xfffe)
| (m_data->read_word(vdp_pointer + 12) << 16);
LOGCOMMAND("SGP: (PC=%08x) SET %s %02x|H %4u|V %4u|Pitch %5u| address %08x\n"
, vdp_pointer
, mode ? "DESTINATION" : "SOURCE "
, param1
, ptr->hsize
, ptr->vsize
, ptr->fb_pitch
, ptr->address
);
next_pc += 12;
break;
}
case 0x0006:
{
const u16 color_code = m_data->read_word(vdp_pointer + 2);
LOGCOMMAND("SGP: (PC=%08x) SET COLOR %04x\n"
, vdp_pointer
, color_code
);
next_pc += 2;
break;
}
// BitBLT
case 0x0007:
// PATBLT
case 0x0008:
{
const bool cmd_mode = cur_opcode == 0x0008;
const u16 draw_mode = m_data->read_word(vdp_pointer + 2);
LOGCOMMAND("SGP: (PC=%08x) %s %04x\n"
, vdp_pointer
, cmd_mode ? "PATBLT" : "BITBLT"
, draw_mode
);
cmd_blit(draw_mode, cmd_mode);
next_pc += 2;
break;
}
// LINE
case 0x0009:
{
// mostly same as above
const u16 draw_mode = m_data->read_word(vdp_pointer + 2);
// documentation omits there's an extra parameter here
// cfr. animefrm, hardcoded to 2 there
const u16 unk_param = m_data->read_word(vdp_pointer + 4);
// in pixels
const u16 h_size = m_data->read_word(vdp_pointer + 6);
const u16 v_size = m_data->read_word(vdp_pointer + 8);
const u16 fb_pitch = m_data->read_word(vdp_pointer + 10) & 0xfffc;
const u32 src_address = (m_data->read_word(vdp_pointer + 12) & 0xfffe)
| (m_data->read_word(vdp_pointer + 14) << 16);
// Note: start dot position and pixel mode set by SET SOURCE
LOGCOMMAND("SGP: (PC=%08x) LINE %04x %04x %04x %04x %04x %08x\n"
, vdp_pointer
, draw_mode
, unk_param
, h_size
, v_size
, fb_pitch
, src_address
);
next_pc += 14;
break;
}
// CLS
case 0x000a:
{
const u32 src_address = (m_data->read_word(vdp_pointer + 2) & 0xfffe)
| (m_data->read_word(vdp_pointer + 4) << 16);
const u32 word_size = (m_data->read_word(vdp_pointer + 6))
| (m_data->read_word(vdp_pointer + 8) << 16);
LOGCOMMAND("SGP: (PC=%08x) CLS %08x %08x\n"
, vdp_pointer
, src_address
, word_size
);
next_pc += 8;
break;
}
// SCAN RIGHT
case 0x000b:
// SCAN LEFT
case 0x000c:
{
// This uses the destination block data to find a specific pixel
// thru the SET COLOR command.
// It updates the horizontal size of destination if the color is found,
// returns 0 if the pixel is at origin, doesn't update if not found.
const u8 mode = cur_opcode == 0x000c;
LOGCOMMAND("SGP: (PC=%08x) %s\n"
, vdp_pointer
, mode ? "SCAN LEFT" : "SCAN RIGHT"
);
break;
}
default:
LOGCOMMAND("SGP: (PC=%08x) %04x???\n", vdp_pointer, cur_opcode);
}
if (end_issued == true)
break;
vdp_pointer += next_pc;
}
if (vdp_pointer >= end_pointer)
LOG("Warning: execution punt without an END issued\n");
}
/****************************************
* Commands
***************************************/
/*
* ---x ---- ---- ---- SF (0) shift source according to destination position
* ---- x--- ---- ---- VD vertical transfer direction (1) negative (0) positive
* ---- -x-- ---- ---- HD horizontal transfer direction (1) negative (0) positive
* ---- --xx ---- ---- TP/MOD
* ---- --00 ---- ---- transfer source as-is
* ---- --01 ---- ---- do not transfer if source is 0 (transparent pen)
* ---- --10 ---- ---- transfer only if destination is 0
* ---- --11 ---- ---- <undocumented>
* ---- ---- ---- xxxx LOGICAL OP
* ---- ---- ---- 0000 0
* ---- ---- ---- 0001 Src AND Dst
* ---- ---- ---- 0010 /Src AND Dst
* ---- ---- ---- 0011 NOP
* ---- ---- ---- 0100 Src AND /Dst
* ---- ---- ---- 0101 Src
* ---- ---- ---- 0110 Src XOR Dst
* ---- ---- ---- 0111 Src OR Dst
* ---- ---- ---- 1000 /(Src OR Dst)
* ---- ---- ---- 1001 /(Src XOR Dst)
* ---- ---- ---- 1010 /Src
* ---- ---- ---- 1011 /Src OR Dst
* ---- ---- ---- 1100 /Dst
* ---- ---- ---- 1101 Src OR /Dst
* ---- ---- ---- 1110 /(Src AND Dst)
* ---- ---- ---- 1111 1
*
* PATBLT is identical to BITBLT except it repeats source copy
* if it exceeds the clipping range.
*/
void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt)
{
const u8 logical_op = draw_mode & 0xf;
const u8 tp_mod = (draw_mode >> 8) & 0x3;
// TODO: boomer title screen
if (is_patblt == true)
{
LOG("PATBLT\n");
// return;
}
// ballbrkr: 6
if (logical_op != 5)
{
LOG("BITBLT logical_op == %d\n", logical_op);
return;
}
if (tp_mod > 1)
{
LOG("BITBLT tp_mod == %d\n", tp_mod);
return;
}
if (m_src.hsize != m_dst.hsize || m_src.vsize != m_dst.vsize)
{
LOG("BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize);
return;
}
if (m_src.pixel_mode == 0 || m_src.pixel_mode == 3 || m_src.pixel_mode != m_dst.pixel_mode)
{
LOG("BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode);
return;
}
for (int yi = 0; yi < m_src.vsize; yi ++)
{
u32 src_address = m_src.address + (yi * m_src.fb_pitch);
u32 dst_address = m_dst.address + (yi * m_dst.fb_pitch);
for (int xi = 0; xi < (m_src.hsize >> 2); xi ++)
{
// TODO: not very efficient, we need a cleaner per-pixel RMW phase
const u16 src_dot = m_data->read_word(src_address);
const u16 dst_dot = m_data->read_word(dst_address);
u16 result = 0;
for (int pixi = 0; pixi < 4; pixi ++)
{
u8 cur_pixel = (src_dot & 0xf);
if (cur_pixel || tp_mod == 0)
result |= (src_dot & 0xf) << (pixi * 4);
else
result |= (dst_dot & 0xf) << (pixi * 4);
}
m_data->write_word(dst_address, result);
src_address += 2;
dst_address += 2;
}
}
}

59
src/mame/nec/pc88va_sgp.h Normal file
View File

@ -0,0 +1,59 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
#ifndef MAME_NEC_PC88VA_SGP_H
#define MAME_NEC_PC88VA_SGP_H
#pragma once
class pc88va_sgp_device :
public device_t,
public device_memory_interface
{
public:
pc88va_sgp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
template <typename... T> pc88va_sgp_device& set_map(T &&... args) { set_addrmap(AS_DATA, std::forward<T>(args)...); return *this; }
void sgp_io(address_map &map);
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_config_complete() override;
virtual space_config_vector memory_space_config() const override;
private:
address_space_config m_data_config;
address_space *m_data;
u16 m_vdp_address[2]{};
u32 m_work_address = 0;
struct BufferArea {
u8 start_dot = 0;
u8 pixel_mode = 0;
u16 hsize = 0;
u16 vsize = 0;
u16 fb_pitch = 0;
u32 address = 0;
};
BufferArea m_src, m_dst;
void vdp_address_w(offs_t offset, u16 data, u16 mem_mask = ~0);
u8 status_r();
void control_w(u8 data);
void trigger_w(u8 data);
void start_exec();
// commands
void cmd_blit(u16 draw_mode, bool is_patblt);
};
DECLARE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device)
#endif // MAME_NEC_PC88VA_SGP_H

1654
src/mame/nec/pc88va_v.cpp Normal file

File diff suppressed because it is too large Load Diff