New working software list items

-------------------------------
svision.xml: Crystball (Euro, USA, earlier) [anonymous]
svision.xml: Treasure Hunter (Euro, USA, 1993) [anonymous]

- svision.xml: corrected ROM dump for tvlink [anonymous]

- svision/svision.cpp: dumped bezel ROM for TV Link [anonymous]

- svision/svis_snd.cpp, svision/svision.cpp: added save state support and other small cleanups
This commit is contained in:
Ivan Vangelista 2023-02-28 18:11:51 +01:00
parent 678b56c7de
commit 4e2db7a5e5
5 changed files with 451 additions and 370 deletions

View file

@ -23,8 +23,8 @@ license:CC0-1.0
<info name="serial" value="SV10033" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10033.bin" size="65536" crc="7e05d84f" sha1="f2b7902b8c522f63858c99caa81d63f4cdcb60cb" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10033.bin" size="0x10000" crc="7e05d84f" sha1="f2b7902b8c522f63858c99caa81d63f4cdcb60cb"/>
</dataarea>
</part>
</software>
@ -36,8 +36,8 @@ license:CC0-1.0
<info name="serial" value="SV10024" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10024.bin" size="65536" crc="c1354952" sha1="bca1c05ebac50a1acd4a8d3b440a29867edc9826" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10024.bin" size="0x10000" crc="c1354952" sha1="bca1c05ebac50a1acd4a8d3b440a29867edc9826"/>
</dataarea>
</part>
</software>
@ -49,8 +49,8 @@ license:CC0-1.0
<info name="serial" value="SV10010" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10010.bin" size="65536" crc="8dbb2c53" sha1="e20ae19d0555dc8d34da8f16d2d7bcce8c9856da" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10010.bin" size="0x10000" crc="8dbb2c53" sha1="e20ae19d0555dc8d34da8f16d2d7bcce8c9856da"/>
</dataarea>
</part>
</software>
@ -60,8 +60,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="balloon fight (usa, europe).bin" size="65536" crc="8188b755" sha1="2d58bb254bb79f47d64f1505336bf736c7b5a4d8" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="balloon fight (usa, europe).bin" size="0x10000" crc="8188b755" sha1="2d58bb254bb79f47d64f1505336bf736c7b5a4d8"/>
</dataarea>
</part>
</software>
@ -73,8 +73,8 @@ license:CC0-1.0
<info name="serial" value="SV10001" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10001.bin" size="65536" crc="0a3db285" sha1="639c69afa4a68236dfea263b51e9c032c1aa71be" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10001.bin" size="0x10000" crc="0a3db285" sha1="639c69afa4a68236dfea263b51e9c032c1aa71be"/>
</dataarea>
</part>
</software>
@ -86,8 +86,8 @@ license:CC0-1.0
<info name="serial" value="SV10023" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10023.bin" size="65536" crc="5e6706b9" sha1="8a97572caa6cd91950bd333bcab5c61d60cf28d2" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10023.bin" size="0x10000" crc="5e6706b9" sha1="8a97572caa6cd91950bd333bcab5c61d60cf28d2"/>
</dataarea>
</part>
</software>
@ -97,8 +97,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="bubbwrld.bin" size="65536" crc="e5c2cfb5" sha1="f47972ea376dce72265d57763b17d35bb50f842d" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="bubbwrld.bin" size="0x10000" crc="e5c2cfb5" sha1="f47972ea376dce72265d57763b17d35bb50f842d"/>
</dataarea>
</part>
</software>
@ -110,8 +110,8 @@ license:CC0-1.0
<info name="serial" value="SV10004" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="sv10004.bin" size="32768" crc="5ecfb674" sha1="13061b97c7b6d74990b766670f59dbf1e7598120" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="sv10004.bin" size="0x8000" crc="5ecfb674" sha1="13061b97c7b6d74990b766670f59dbf1e7598120"/>
</dataarea>
</part>
</software>
@ -121,8 +121,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="cave wonders (usa, europe).bin" size="65536" crc="e0266ce7" sha1="af1232c2e781ac2ae12163dc200815a8579c269d" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="cave wonders (usa, europe).bin" size="0x10000" crc="e0266ce7" sha1="af1232c2e781ac2ae12163dc200815a8579c269d"/>
</dataarea>
</part>
</software>
@ -134,8 +134,8 @@ license:CC0-1.0
<info name="serial" value="SV10017" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10017.bin" size="65536" crc="c92382ce" sha1="70f7589fdf40c851cc34c0a5f644216f3765eb8c" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10017.bin" size="0x10000" crc="c92382ce" sha1="70f7589fdf40c851cc34c0a5f644216f3765eb8c"/>
</dataarea>
</part>
</software>
@ -147,8 +147,8 @@ license:CC0-1.0
<info name="serial" value="SV10016" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10016.bin" size="65536" crc="4a458aa8" sha1="c384062ce1284a4c80e8fbb1ad0e8fa924c6881b" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10016.bin" size="0x10000" crc="4a458aa8" sha1="c384062ce1284a4c80e8fbb1ad0e8fa924c6881b"/>
</dataarea>
</part>
</software>
@ -160,8 +160,8 @@ license:CC0-1.0
<info name="serial" value="SV10038" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10038.bin" size="65536" crc="eded8aec" sha1="eb69fa9df9186a3bf3fd4f8afebdd7a6d022ab38" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10038.bin" size="0x10000" crc="eded8aec" sha1="eb69fa9df9186a3bf3fd4f8afebdd7a6d022ab38"/>
</dataarea>
</part>
</software>
@ -171,8 +171,8 @@ license:CC0-1.0
<year>1993</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="classcas.bin" size="65536" crc="72a96443" sha1="1d45a437dfb8b5833ea56a42a8ed6be5e70686aa" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="classcas.bin" size="0x10000" crc="72a96443" sha1="1d45a437dfb8b5833ea56a42a8ed6be5e70686aa"/>
</dataarea>
</part>
</software>
@ -182,8 +182,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="climber.bin" size="32768" crc="12c45309" sha1="f0b5d83cff1c45c7798da65dd01c3ee0b66e78ac" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="climber.bin" size="0x8000" crc="12c45309" sha1="f0b5d83cff1c45c7798da65dd01c3ee0b66e78ac"/>
</dataarea>
</part>
</software>
@ -193,8 +193,8 @@ license:CC0-1.0
<year>1991</year>
<publisher>GTC Inc</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="crsshigh.bin" size="65536" crc="1e6836a2" sha1="efc3a8065d6eefd0f461c0c86ef66197d761f569" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="crsshigh.bin" size="0x10000" crc="1e6836a2" sha1="efc3a8065d6eefd0f461c0c86ef66197d761f569"/>
</dataarea>
</part>
</software>
@ -204,8 +204,19 @@ license:CC0-1.0
<year>1991</year>
<publisher>Travellmate</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="crystball (usa, europe).bin" size="65536" crc="10dcc110" sha1="f23f53f7486857db36a959a0ecc71b6b688c7af1" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="crystball (usa, europe).bin" size="0x10000" crc="10dcc110" sha1="f23f53f7486857db36a959a0ecc71b6b688c7af1"/>
</dataarea>
</part>
</software>
<software name="crystbala" cloneof="crystbal">
<description>Crystball (Euro, USA, earlier)</description>
<year>1991</year>
<publisher>Travellmate</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="0x10000">
<rom name="crystball (usa, europe, earlier).bin" size="0x10000" crc="a2b50209" sha1="51f7140e53172894c3281cd2425411393d77e0c2"/>
</dataarea>
</part>
</software>
@ -217,8 +228,8 @@ license:CC0-1.0
<info name="serial" value="SV10030" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="sv10030.bin" size="32768" crc="345ca42a" sha1="a5a421bfaad2837a7cee9522a59411c96dcc0827" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="sv10030.bin" size="0x8000" crc="345ca42a" sha1="a5a421bfaad2837a7cee9522a59411c96dcc0827"/>
</dataarea>
</part>
</software>
@ -230,8 +241,8 @@ license:CC0-1.0
<info name="serial" value="SV10040" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10040.bin" size="65536" crc="32ccdf89" sha1="ee68c188c41cf8f12f74458d6dd614afc7b8edbb" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10040.bin" size="0x10000" crc="32ccdf89" sha1="ee68c188c41cf8f12f74458d6dd614afc7b8edbb"/>
</dataarea>
</part>
</software>
@ -241,8 +252,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="dreamwld.bin" size="65536" crc="db0f463f" sha1="0812c859a54161f19e7160fec3c0f56ba0b33db6" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="dreamwld.bin" size="0x10000" crc="db0f463f" sha1="0812c859a54161f19e7160fec3c0f56ba0b33db6"/>
</dataarea>
</part>
</software>
@ -254,8 +265,8 @@ license:CC0-1.0
<info name="serial" value="SV10005" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10005.bin" size="65536" crc="01cb8364" sha1="226e8f14498be513b73f97b5e618a524209c4595" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10005.bin" size="0x10000" crc="01cb8364" sha1="226e8f14498be513b73f97b5e618a524209c4595"/>
</dataarea>
</part>
</software>
@ -265,8 +276,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="earth defender (usa, europe).bin" size="65536" crc="a6cbb074" sha1="8b0550dde96661b9b7317a1d247174ecca813698" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="earth defender (usa, europe).bin" size="0x10000" crc="a6cbb074" sha1="8b0550dde96661b9b7317a1d247174ecca813698"/>
</dataarea>
</part>
</software>
@ -276,8 +287,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="fatal craft (usa, europe).bin" size="65536" crc="917cab48" sha1="9c6282caa6b06c63f53910fdb11b7d0f83d29310" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="fatal craft (usa, europe).bin" size="0x10000" crc="917cab48" sha1="9c6282caa6b06c63f53910fdb11b7d0f83d29310"/>
</dataarea>
</part>
</software>
@ -287,8 +298,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="final combat (usa, europe).bin" size="32768" crc="465d78cd" sha1="ef87ef536bd82c1a9b707ffcb173beef74953cd5" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="final combat (usa, europe).bin" size="0x8000" crc="465d78cd" sha1="ef87ef536bd82c1a9b707ffcb173beef74953cd5"/>
</dataarea>
</part>
</software>
@ -300,8 +311,8 @@ license:CC0-1.0
<info name="serial" value="SV10031" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="fcombata.bin" size="32768" crc="2861de5e" sha1="23efa16603c540e60dc85c7442188a8b76383098" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="fcombata.bin" size="0x8000" crc="2861de5e" sha1="23efa16603c540e60dc85c7442188a8b76383098"/>
</dataarea>
</part>
</software>
@ -313,8 +324,8 @@ license:CC0-1.0
<info name="serial" value="SV10029" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10029.bin" size="65536" crc="b494bc5c" sha1="7739826471d4ac2a69d34bdbd154bb6d748e90cc" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10029.bin" size="0x10000" crc="b494bc5c" sha1="7739826471d4ac2a69d34bdbd154bb6d748e90cc"/>
</dataarea>
</part>
</software>
@ -324,8 +335,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Thin Chen Enterprise</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="galaxy fighter (usa, europe).bin" size="65536" crc="581703be" sha1="721350e7c7761b9be13d2a236ebfc72e51755851" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="galaxy fighter (usa, europe).bin" size="0x10000" crc="581703be" sha1="721350e7c7761b9be13d2a236ebfc72e51755851"/>
</dataarea>
</part>
</software>
@ -337,8 +348,8 @@ license:CC0-1.0
<info name="serial" value="SV10021" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10021.bin" size="65536" crc="cef3f295" sha1="a6b93e0bbb0d037a0fe4b0d8056b6808aea7ae6c" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10021.bin" size="0x10000" crc="cef3f295" sha1="a6b93e0bbb0d037a0fe4b0d8056b6808aea7ae6c"/>
</dataarea>
</part>
</software>
@ -350,8 +361,8 @@ license:CC0-1.0
<info name="serial" value="SV10035" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="happy pairs (usa, europe).bin" size="65536" crc="112f5eed" sha1="d8a78bb3cb492a90464f7a16bb2486566f7d4baa" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="happy pairs (usa, europe).bin" size="0x10000" crc="112f5eed" sha1="d8a78bb3cb492a90464f7a16bb2486566f7d4baa"/>
</dataarea>
</part>
</software>
@ -363,8 +374,8 @@ license:CC0-1.0
<info name="serial" value="SV10027" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10027.bin" size="65536" crc="552afa89" sha1="08dc1bd109986d8745cfa6f1eb3c9731d736255f" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10027.bin" size="0x10000" crc="552afa89" sha1="08dc1bd109986d8745cfa6f1eb3c9731d736255f"/>
</dataarea>
</part>
</software>
@ -376,8 +387,8 @@ license:CC0-1.0
<info name="serial" value="SV10002" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10002.bin" size="65536" crc="6bd7c885" sha1="d9836dfe4f113dca030b0472deb7a8d8bb9065dc" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10002.bin" size="0x10000" crc="6bd7c885" sha1="d9836dfe4f113dca030b0472deb7a8d8bb9065dc"/>
</dataarea>
</part>
</software>
@ -387,8 +398,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Thin Chen Enterprise</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="herohawk.bin" size="65536" crc="99bf6cf5" sha1="690036b386ee57c15e23a64015513a36861bd145" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="herohawk.bin" size="0x10000" crc="99bf6cf5" sha1="690036b386ee57c15e23a64015513a36861bd145"/>
</dataarea>
</part>
</software>
@ -400,8 +411,8 @@ license:CC0-1.0
<info name="serial" value="SV10011" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10011.bin" size="65536" crc="25ddd6e1" sha1="3e5de3350e3bcf75e057b970d7e1c56634699bb1" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10011.bin" size="0x10000" crc="25ddd6e1" sha1="3e5de3350e3bcf75e057b970d7e1c56634699bb1"/>
</dataarea>
</part>
</software>
@ -413,8 +424,8 @@ license:CC0-1.0
<info name="serial" value="SV10018" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10018.bin" size="65536" crc="e856875a" sha1="3412cb0d657c6c79eef71d29c6af06ac3082cb2f" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10018.bin" size="0x10000" crc="e856875a" sha1="3412cb0d657c6c79eef71d29c6af06ac3082cb2f"/>
</dataarea>
</part>
</software>
@ -424,8 +435,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="jacky lucky (usa, europe).bin" size="65536" crc="7d8a607f" sha1="f7311ccca24811aa3595114d50e5c1ac5772b4c9" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="jacky lucky (usa, europe).bin" size="0x10000" crc="7d8a607f" sha1="f7311ccca24811aa3595114d50e5c1ac5772b4c9"/>
</dataarea>
</part>
</software>
@ -437,8 +448,8 @@ license:CC0-1.0
<info name="serial" value="SV10025" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10025.bin" size="65536" crc="aa4372d4" sha1="212f577b0d1df539aadfecdec4e85404e4d57201" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10025.bin" size="0x10000" crc="aa4372d4" sha1="212f577b0d1df539aadfecdec4e85404e4d57201"/>
</dataarea>
</part>
</software>
@ -450,8 +461,8 @@ license:CC0-1.0
<info name="serial" value="SV10036" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10036.bin" size="65536" crc="e9ea3ae0" sha1="b422814b073544b66f2ad86c76bae6403f7a4530" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10036.bin" size="0x10000" crc="e9ea3ae0" sha1="b422814b073544b66f2ad86c76bae6403f7a4530"/>
</dataarea>
</part>
</software>
@ -463,8 +474,8 @@ license:CC0-1.0
<info name="serial" value="SV10043" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10043.bin" size="65536" crc="32e68d6f" sha1="a5c8beecff5444183dfed9e46dd67150c12c8bfd" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10043.bin" size="0x10000" crc="32e68d6f" sha1="a5c8beecff5444183dfed9e46dd67150c12c8bfd"/>
</dataarea>
</part>
</software>
@ -474,8 +485,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="kabi island - gold in island (usa, europe).bin" size="65536" crc="2bc03096" sha1="517154e5340bf221392a99640733b0798c7490ee" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="kabi island - gold in island (usa, europe).bin" size="0x10000" crc="2bc03096" sha1="517154e5340bf221392a99640733b0798c7490ee"/>
</dataarea>
</part>
</software>
@ -485,8 +496,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="kitchenw.bin" size="65536" crc="20225f5c" sha1="d8f095ec94a18f4e006b4fc9480eabe98852a8fe" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="kitchenw.bin" size="0x10000" crc="20225f5c" sha1="d8f095ec94a18f4e006b4fc9480eabe98852a8fe"/>
</dataarea>
</part>
</software>
@ -496,8 +507,8 @@ license:CC0-1.0
<year>1993</year>
<publisher>Thin Chen Enterprise</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="kungfust.bin" size="65536" crc="7daed2eb" sha1="548938179d25ea3a8de45662b3920d8aa5e9ac55" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="kungfust.bin" size="0x10000" crc="7daed2eb" sha1="548938179d25ea3a8de45662b3920d8aa5e9ac55"/>
</dataarea>
</part>
</software>
@ -509,8 +520,8 @@ license:CC0-1.0
<info name="serial" value="SV10007" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10007.bin" size="65536" crc="6f8abaf9" sha1="9f80a72d967d2a35168250ca3da3941164164bfc" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10007.bin" size="0x10000" crc="6f8abaf9" sha1="9f80a72d967d2a35168250ca3da3941164164bfc"/>
</dataarea>
</part>
</software>
@ -522,8 +533,8 @@ license:CC0-1.0
<info name="serial" value="SV10039" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10039.bin" size="65536" crc="e406a91c" sha1="b7aec7d24175bdea1cfccc1359b5ab353e023d44" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10039.bin" size="0x10000" crc="e406a91c" sha1="b7aec7d24175bdea1cfccc1359b5ab353e023d44"/>
</dataarea>
</part>
</software>
@ -536,8 +547,8 @@ license:CC0-1.0
<info name="alt_title" value="麻将擂台" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10012.bin" size="65536" crc="96e2e6d7" sha1="9eef723f67a91fabf3ddda6411204883c50f8574" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10012.bin" size="0x10000" crc="96e2e6d7" sha1="9eef723f67a91fabf3ddda6411204883c50f8574"/>
</dataarea>
</part>
</software>
@ -549,8 +560,8 @@ license:CC0-1.0
<info name="serial" value="SV10020" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10020.bin" size="65536" crc="21864295" sha1="fb6af626a6496907d02a26b9bb5132f4be88bda9" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10020.bin" size="0x10000" crc="21864295" sha1="fb6af626a6496907d02a26b9bb5132f4be88bda9"/>
</dataarea>
</part>
</software>
@ -562,8 +573,8 @@ license:CC0-1.0
<info name="serial" value="SV10019" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10019.bin" size="65536" crc="85dc8111" sha1="4b863616bb9b821adf397f20e0ea043a3daa026a" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10019.bin" size="0x10000" crc="85dc8111" sha1="4b863616bb9b821adf397f20e0ea043a3daa026a"/>
</dataarea>
</part>
</software>
@ -575,8 +586,8 @@ license:CC0-1.0
<info name="serial" value="SV10006" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10006.bin" size="65536" crc="748f9dae" sha1="794ce6fb7084274c680b277a41f269840402e61b" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10006.bin" size="0x10000" crc="748f9dae" sha1="794ce6fb7084274c680b277a41f269840402e61b"/>
</dataarea>
</part>
</software>
@ -588,8 +599,8 @@ license:CC0-1.0
<info name="serial" value="SV10008" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10008.bin" size="65536" crc="1a89ac88" sha1="afa267bcced763cb51599cd5605062530ede1af3" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10008.bin" size="0x10000" crc="1a89ac88" sha1="afa267bcced763cb51599cd5605062530ede1af3"/>
</dataarea>
</part>
</software>
@ -599,8 +610,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="pacificb.bin" size="65536" crc="e5dce795" sha1="453385ec16a50add9b3b8591e954220b679f0439" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="pacificb.bin" size="0x10000" crc="e5dce795" sha1="453385ec16a50add9b3b8591e954220b679f0439"/>
</dataarea>
</part>
</software>
@ -612,8 +623,8 @@ license:CC0-1.0
<info name="serial" value="SV10032" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="sv10032.bin" size="32768" crc="fe5f9774" sha1="9520221d8cfd3bdfb0fb6b7fb9fed66ba027a756" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="sv10032.bin" size="0x8000" crc="fe5f9774" sha1="9520221d8cfd3bdfb0fb6b7fb9fed66ba027a756"/>
</dataarea>
</part>
</software>
@ -625,8 +636,8 @@ license:CC0-1.0
<info name="serial" value="SV10014" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10014.bin" size="65536" crc="531f0b51" sha1="9fa06b4d171d9ade2f9e4a639e80feba15c963f9" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10014.bin" size="0x10000" crc="531f0b51" sha1="9fa06b4d171d9ade2f9e4a639e80feba15c963f9"/>
</dataarea>
</part>
</software>
@ -638,8 +649,8 @@ license:CC0-1.0
<info name="serial" value="SV10037" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10037.bin" size="65536" crc="e11a756c" sha1="7d9672fd2500f2d645d0ca28417fbf9e9bac3045" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10037.bin" size="0x10000" crc="e11a756c" sha1="7d9672fd2500f2d645d0ca28417fbf9e9bac3045"/>
</dataarea>
</part>
</software>
@ -649,8 +660,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="pyramid (usa, europe).bin" size="32768" crc="e0bfe163" sha1="8fab2b0d3e4485e156c78159b92fd70aabc02994" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="pyramid (usa, europe).bin" size="0x8000" crc="e0bfe163" sha1="8fab2b0d3e4485e156c78159b92fd70aabc02994"/>
</dataarea>
</part>
</software>
@ -662,8 +673,8 @@ license:CC0-1.0
<info name="serial" value="SV10041" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10041.bin" size="65536" crc="c36bd216" sha1="fc64336d963b88fc29dd2ea1b987f98a99e725e9" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10041.bin" size="0x10000" crc="c36bd216" sha1="fc64336d963b88fc29dd2ea1b987f98a99e725e9"/>
</dataarea>
</part>
</software>
@ -673,8 +684,8 @@ license:CC0-1.0
<year>1992</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="scaffold.bin" size="65536" crc="46fb22c5" sha1="4fd487ce62c8b7a6f3d4000fcd72f2a269d32fc2" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="scaffold.bin" size="0x10000" crc="46fb22c5" sha1="4fd487ce62c8b7a6f3d4000fcd72f2a269d32fc2"/>
</dataarea>
</part>
</software>
@ -686,8 +697,8 @@ license:CC0-1.0
<info name="serial" value="SV10034" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10034.bin" size="65536" crc="45204dc4" sha1="2b794e22f7d595902c515b3fd617980655a9d994" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10034.bin" size="0x10000" crc="45204dc4" sha1="2b794e22f7d595902c515b3fd617980655a9d994"/>
</dataarea>
</part>
</software>
@ -697,8 +708,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Watera</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sonnyxpr.bin" size="65536" crc="c99b985a" sha1="00724d0275bd4ef77514468d6d04669c93125e32" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sonnyxpr.bin" size="0x10000" crc="c99b985a" sha1="00724d0275bd4ef77514468d6d04669c93125e32"/>
</dataarea>
</part>
</software>
@ -710,8 +721,8 @@ license:CC0-1.0
<info name="serial" value="SV10017" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10017.bin" size="65536" crc="7cd650c8" sha1="a2fa39c871956a27dc3afa74fe368e93ef8ee99a" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10017.bin" size="0x10000" crc="7cd650c8" sha1="a2fa39c871956a27dc3afa74fe368e93ef8ee99a"/>
</dataarea>
</part>
</software>
@ -723,8 +734,8 @@ license:CC0-1.0
<info name="serial" value="SV10009" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10009.bin" size="65536" crc="be9b6f10" sha1="da02d8e119fbd38048f16c78ce9714abf93bbfd6" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10009.bin" size="0x10000" crc="be9b6f10" sha1="da02d8e119fbd38048f16c78ce9714abf93bbfd6"/>
</dataarea>
</part>
</software>
@ -736,8 +747,8 @@ license:CC0-1.0
<info name="serial" value="SV10022" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="sv10022.bin" size="32768" crc="02e2c7ad" sha1="1fa3236ad83984d922893c294ed0d9e432201fb0" offset="000000" />
<dataarea name="rom" size="0x8000">
<rom name="sv10022.bin" size="0x8000" crc="02e2c7ad" sha1="1fa3236ad83984d922893c294ed0d9e432201fb0"/>
</dataarea>
</part>
</software>
@ -749,8 +760,8 @@ license:CC0-1.0
<info name="serial" value="SV10042" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10042.bin" size="65536" crc="59c7ff64" sha1="6c59bc0d14a05b404292de8aba3a7da12d72f355" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10042.bin" size="0x10000" crc="59c7ff64" sha1="6c59bc0d14a05b404292de8aba3a7da12d72f355"/>
</dataarea>
</part>
</software>
@ -762,8 +773,8 @@ license:CC0-1.0
<info name="serial" value="SV10028" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10028.bin" size="65536" crc="181d12dd" sha1="c4d61fcab3e8eb2aedb48b41bac24bf7197a7e21" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10028.bin" size="0x10000" crc="181d12dd" sha1="c4d61fcab3e8eb2aedb48b41bac24bf7197a7e21"/>
</dataarea>
</part>
</software>
@ -775,8 +786,8 @@ license:CC0-1.0
<info name="serial" value="SV10026" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10026.bin" size="65536" crc="3d5f3964" sha1="da884d97fbe7e7aca40dc1b5b0db6d7ff69377e3" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10026.bin" size="0x10000" crc="3d5f3964" sha1="da884d97fbe7e7aca40dc1b5b0db6d7ff69377e3"/>
</dataarea>
</part>
</software>
@ -788,8 +799,8 @@ license:CC0-1.0
<info name="serial" value="SV10015" />
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="sv10015.bin" size="65536" crc="bd004cb7" sha1="386f555fcedaaf9fc4d81ddf59ec0320f42af988" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="sv10015.bin" size="0x10000" crc="bd004cb7" sha1="386f555fcedaaf9fc4d81ddf59ec0320f42af988"/>
</dataarea>
</part>
</software>
@ -799,30 +810,41 @@ license:CC0-1.0
<year>1992</year>
<publisher>Thin Chen Enterprise</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="thundrsh.bin" size="65536" crc="ad147842" sha1="c292dd656860c9048935f52b8a90bba2d6f7fb99" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="thundrsh.bin" size="0x10000" crc="ad147842" sha1="c292dd656860c9048935f52b8a90bba2d6f7fb99"/>
</dataarea>
</part>
</software>
<software name="thunter">
<description>Treasure Hunter (Euro, USA)</description>
<year>199?</year>
<description>Treasure Hunter (Euro, USA, 1993)</description>
<year>1993</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="treasure hunter (usa, europe).bin" size="65536" crc="db35b809" sha1="baf24b026023f44968fd1352637f1c01cbb89f3e" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="treasure hunter (usa, europe, 1993).bin" size="0x10000" crc="69068337" sha1="79873ed0ab3a1472fed3e01b5e35a6735728d91c"/>
</dataarea>
</part>
</software>
<software name="tvlink"> <!-- does anyone know if this is the PAL or NTSC version as 'Quickshot' made one in UK -->
<software name="thuntera" cloneof="thunter">
<description>Treasure Hunter (Euro, USA, 1992)</description>
<year>1992</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="0x10000">
<rom name="treasure hunter (usa, europe).bin" size="0x10000" crc="db35b809" sha1="baf24b026023f44968fd1352637f1c01cbb89f3e"/>
</dataarea>
</part>
</software>
<software name="tvlink"> <!-- TV-Link's dongle cartridge, does anyone know if this is the PAL or NTSC version as 'Quickshot' made one in UK -->
<description>TV-Link</description>
<year>199?</year>
<publisher>Watara</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="32768">
<rom name="tvlink.bin" size="32768" crc="af3ea0dd" sha1="08ea89ec012034cde36919ff94af95b9d8af8aa6" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="9307kba-1.u2" size="0x10000" crc="79b6d290" sha1="79114c470688f972bb79f9a02d28c9450476e4c1"/> <!-- 0xxxxxxxxxxxxxxx = 0x00, but it's confirmed like this-->
</dataarea>
</part>
</software>
@ -832,8 +854,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="untchble.bin" size="65536" crc="db3fe76a" sha1="1cc36699d11dc1ef1a7731ea5f093a23489dd2df" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="untchble.bin" size="0x10000" crc="db3fe76a" sha1="1cc36699d11dc1ef1a7731ea5f093a23489dd2df"/>
</dataarea>
</part>
</software>
@ -843,8 +865,8 @@ license:CC0-1.0
<year>199?</year>
<publisher>Bon Treasure</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="65536">
<rom name="wittycat.bin" size="65536" crc="24a115f9" sha1="f5476f1c663d34c3dda2bc6e9631e6f2dc661e1d" offset="000000" />
<dataarea name="rom" size="0x10000">
<rom name="wittycat.bin" size="0x10000" crc="24a115f9" sha1="f5476f1c663d34c3dda2bc6e9631e6f2dc661e1d"/>
</dataarea>
</part>
</software>
@ -856,8 +878,8 @@ license:CC0-1.0
<publisher>Watara?</publisher>
<part name="cart" interface="svision_cart">
<dataarea name="rom" size="524288">
<rom name="journeytothewest.bin" size="524288" crc="9fb4db9a" sha1="548dd9165edd4bc1d1f2c2b5dc519574b7f43f3b" offset="000000" />
<dataarea name="rom" size="0x80000">
<rom name="journeytothewest.bin" size="0x80000" crc="9fb4db9a" sha1="548dd9165edd4bc1d1f2c2b5dc519574b7f43f3b"/>
</dataarea>
</part>
</software>

View file

@ -9,6 +9,17 @@
#include "emu.h"
#include "svis_snd.h"
// configurable logging
#define LOG_DMA (1U << 1)
#define LOG_NOISE (1U << 2)
//#define VERBOSE (LOG_GENERAL | LOG_DMA | LOG_NOISE)
#include "logmacro.h"
#define LOGDMA(...) LOGMASKED(LOG_DMA, __VA_ARGS__)
#define LOGNOISE(...) LOGMASKED(LOG_NOISE, __VA_ARGS__)
// device type definition
DEFINE_DEVICE_TYPE(SVISION_SND, svision_sound_device, "svision_sound", "Super Vision Custom Sound")
@ -46,6 +57,36 @@ void svision_sound_device::device_start()
memset(m_channel, 0, sizeof(m_channel));
m_mixer_channel = stream_alloc(0, 2, machine().sample_rate());
save_item(STRUCT_MEMBER(m_noise, reg));
save_item(STRUCT_MEMBER(m_noise, on));
save_item(STRUCT_MEMBER(m_noise, right));
save_item(STRUCT_MEMBER(m_noise, left));
save_item(STRUCT_MEMBER(m_noise, play));
save_item(STRUCT_MEMBER(m_noise, state));
save_item(STRUCT_MEMBER(m_noise, volume));
save_item(STRUCT_MEMBER(m_noise, count));
save_item(STRUCT_MEMBER(m_noise, step));
save_item(STRUCT_MEMBER(m_noise, pos));
save_item(STRUCT_MEMBER(m_noise, value));
save_item(STRUCT_MEMBER(m_dma, reg));
save_item(STRUCT_MEMBER(m_dma, on));
save_item(STRUCT_MEMBER(m_dma, right));
save_item(STRUCT_MEMBER(m_dma, left));
save_item(STRUCT_MEMBER(m_dma, ca14to16));
save_item(STRUCT_MEMBER(m_dma, start));
save_item(STRUCT_MEMBER(m_dma, size));
save_item(STRUCT_MEMBER(m_dma, pos));
save_item(STRUCT_MEMBER(m_dma, step));
save_item(STRUCT_MEMBER(m_dma, finished));
save_item(STRUCT_MEMBER(m_channel, reg));
save_item(STRUCT_MEMBER(m_channel, waveform));
save_item(STRUCT_MEMBER(m_channel, volume));
save_item(STRUCT_MEMBER(m_channel, pos));
save_item(STRUCT_MEMBER(m_channel, size));
save_item(STRUCT_MEMBER(m_channel, count));
}
@ -55,8 +96,8 @@ void svision_sound_device::device_start()
void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
auto &left=outputs[0];
auto &right=outputs[1];
auto &left = outputs[0];
auto &right = outputs[1];
for (int i = 0; i < left.samples(); i++)
{
@ -67,7 +108,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector
CHANNEL &channel(m_channel[j]);
if (channel.size != 0)
{
if (channel.on||channel.count)
if (channel.on || channel.count)
{
bool on = false;
switch (channel.waveform)
@ -116,7 +157,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector
m_noise.value = m_noise.state & 0x40 ? 1 : 0;
b1 = (m_noise.state & 0x40) != 0;
b2 = (m_noise.state & 0x20) != 0;
m_noise.state=(m_noise.state<<1)+(b1!=b2?1:0);
m_noise.state = (m_noise.state << 1) + (b1 != b2 ? 1 : 0);
break;
case NOISE::Type::Type14Bit:
default:
@ -132,7 +173,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector
{
uint8_t sample;
int16_t s;
uint16_t addr = m_dma.start + (unsigned) m_dma.pos / 2;
uint16_t const addr = m_dma.start + (unsigned) m_dma.pos / 2;
if (addr >= 0x8000 && addr < 0xc000)
{
sample = ((uint8_t*)m_cartrom->base())[(addr & 0x3fff) | m_dma.ca14to16];
@ -153,7 +194,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector
m_dma.pos += m_dma.step;
if (m_dma.pos >= m_dma.size)
{
m_dma.finished = true;
m_dma.finished = true; // TODO: only ever set, never read?
m_dma.on = false;
m_irq_cb(1);
}
@ -166,7 +207,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, std::vector
void svision_sound_device::sounddma_w(offs_t offset, uint8_t data)
{
logerror("%.6f svision snddma write %04x %02x\n", machine().time().as_double(),offset+0x18,data);
LOGDMA("%.6f svision snddma write %04x %02x\n", machine().time().as_double(), offset + 0x18, data);
m_dma.reg[offset] = data;
switch (offset)
{
@ -196,13 +237,13 @@ void svision_sound_device::sounddma_w(offs_t offset, uint8_t data)
void svision_sound_device::noise_w(offs_t offset, uint8_t data)
{
// logerror("%.6f svision noise write %04x %02x\n",machine.time(),offset+0x28,data);
m_noise.reg[offset]=data;
LOGNOISE("%.6f svision noise write %04x %02x\n", machine().time().as_double(), offset + 0x28, data);
m_noise.reg[offset] = data;
switch (offset)
{
case 0:
m_noise.volume=data&0xf;
m_noise.step= unscaled_clock() / (256.0*machine().sample_rate()*(1+(data>>4)));
m_noise.volume = data & 0xf;
m_noise.step = unscaled_clock() / (256.0 * machine().sample_rate() * (1 + (data >> 4)));
break;
case 1:
m_noise.count = data + 1;
@ -212,11 +253,11 @@ void svision_sound_device::noise_w(offs_t offset, uint8_t data)
m_noise.play = data & 2;
m_noise.right = data & 4;
m_noise.left = data & 8;
m_noise.on = data & 0x10; /* honey bee start */
m_noise.on = data & 0x10; // honey bee start
m_noise.state = 1;
break;
}
m_noise.pos=0.0;
m_noise.pos = 0.0;
}
@ -231,37 +272,36 @@ void svision_sound_device::sound_decrement()
}
void svision_sound_device::soundport_w(int which, int offset, int data)
void svision_sound_device::soundport_w(uint8_t which, offs_t offset, uint8_t data)
{
CHANNEL &channel(m_channel[which]);
uint16_t size;
m_mixer_channel->update();
channel.reg[offset] = data;
m_channel[which].reg[offset] = data;
switch (offset)
{
case 0:
case 1:
size = channel.reg[0] | ((channel.reg[1] & 7) << 8);
size = m_channel[which].reg[0] | ((m_channel[which].reg[1] & 7) << 8);
if (size)
{
// channel.size=(int)(device->machine().sample_rate()*(size<<5)/4e6);
channel.size = (int) (machine().sample_rate() * (size << 5) / unscaled_clock());
// m_channel[which].size = (int) (machine().sample_rate() * (size << 5) / 4e6);
m_channel[which].size = (int) (machine().sample_rate() * (size << 5) / unscaled_clock());
}
else
{
channel.size = 0;
m_channel[which].size = 0;
}
channel.pos = 0;
m_channel[which].pos = 0;
break;
case 2:
channel.on = data & 0x40;
channel.waveform = (data & 0x30) >> 4;
channel.volume = data & 0xf;
m_channel[which].on = data & 0x40;
m_channel[which].waveform = (data & 0x30) >> 4;
m_channel[which].volume = data & 0xf;
break;
case 3:
channel.count = data + 1;
m_channel[which].count = data + 1;
break;
}
}

View file

@ -34,7 +34,7 @@ public:
void noise_w(offs_t offset, uint8_t data);
void sound_decrement();
void soundport_w(int which, int offset, int data);
void soundport_w(uint8_t which, offs_t offset, uint8_t data);
protected:
// device-level overrides
@ -55,13 +55,13 @@ private:
NOISE() : reg{ 0, 0, 0 } { }
uint8_t reg[3];
int on = 0, right = 0, left = 0, play = 0;
uint8_t on = 0, right = 0, left = 0, play = 0;
Type type = Type::Type7Bit;
int state = 0;
int volume = 0;
int count = 0;
int32_t state = 0;
uint8_t volume = 0;
uint16_t count = 0;
double step = 0, pos = 0;
int value = 0; // currently simple random function
uint8_t value = 0; // currently simple random function
};
struct DMA
@ -69,11 +69,11 @@ private:
DMA() : reg{ 0, 0, 0, 0, 0 } { }
uint8_t reg[5];
int on = 0, right = 0, left = 0;
int ca14to16 = 0;
int start = 0, size = 0;
uint8_t on = 0, right = 0, left = 0;
uint32_t ca14to16 = 0;
uint16_t start = 0, size = 0;
double pos = 0, step = 0;
int finished = 0;
uint8_t finished = 0;
};
struct CHANNEL
@ -81,11 +81,11 @@ private:
CHANNEL() : reg{ 0, 0, 0, 0 } { }
uint8_t reg[4];
int on = 0;
int waveform = 0, volume = 0;
int pos = 0;
int size = 0;
int count = 0;
uint8_t on = 0;
uint8_t waveform = 0, volume = 0;
int32_t pos = 0;
int32_t size = 0;
uint16_t count = 0;
};
devcb_write_line m_irq_cb;

View file

@ -1,5 +1,6 @@
// license:GPL-2.0+
// copyright-holders:Peter Trauner
/******************************************************************************
watara supervision handheld
@ -7,7 +8,15 @@
******************************************************************************/
#include "emu.h"
#include "svision.h"
#include "svis_snd.h"
#include "bus/generic/carts.h"
#include "bus/generic/slot.h"
#include "cpu/m6502/m65c02.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "softlist_dev.h"
#include "speaker.h"
@ -15,11 +24,127 @@
#include "svision.lh"
#define MAKE8_RGB32(red3, green3, blue2) ( ( (red3)<<(16+5)) | ( (green3)<<(8+5)) | ( (blue2)<<(0+6)) )
#define MAKE9_RGB32(red3, green3, blue3) ( ( (red3)<<(16+5)) | ( (green3)<<(8+5)) | ( (blue3)<<(0+5)) )
#define MAKE12_RGB32(red4, green4, blue4) ( ( (red4)<<(16+4)) | ((green4)<<(8+4)) | ((blue4)<<(0+4)) )
#define MAKE24_RGB32(red8, green8, blue8) ( (((red8)&0xf8)<<16) | (((green8)&0xf8)<<8) | (((blue8)&0xf8)) )
// configurable logging
#define LOG_REGS (1U << 1)
//#define VERBOSE (LOG_GENERAL | LOG_REGS)
#include "logmacro.h"
#define LOGREGS(...) LOGMASKED(LOG_REGS, __VA_ARGS__)
namespace {
class svision_state : public driver_device
{
public:
svision_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_sound(*this, "custom")
, m_cart(*this, "cartslot")
, m_reg(*this, "reg")
, m_videoram(*this, "videoram")
, m_screen(*this, "screen")
, m_joy(*this, "JOY")
, m_joy2(*this, "JOY2")
, m_palette(*this, "palette")
, m_bank(*this, "bank%u", 1U)
{ }
void svisionp(machine_config &config);
void svisions(machine_config &config);
void tvlinkp(machine_config &config);
void svision(machine_config &config);
void svisionn(machine_config &config);
void svision_base(machine_config &config);
void init_svisions();
void init_svision();
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
required_device<cpu_device> m_maincpu;
required_device<svision_sound_device> m_sound;
required_device<generic_slot_device> m_cart;
required_shared_ptr<uint8_t> m_reg;
required_shared_ptr<uint8_t> m_videoram;
required_device<screen_device> m_screen;
required_ioport m_joy;
optional_ioport m_joy2;
required_device<palette_device> m_palette;
required_memory_bank_array<2> m_bank;
memory_region *m_cart_rom = nullptr;
enum
{
XSIZE = 0x00,
XPOS = 0x02,
YPOS = 0x03,
BANK = 0x26,
};
struct svision_t
{
emu_timer *timer1 = nullptr;
uint8_t timer_shot = 0;
};
struct svision_pet_t
{
uint8_t state = 0;
uint8_t on = 0, clock = 0, data = 0;
uint8_t input = 0;
emu_timer *timer = nullptr;
};
struct tvlink_t
{
uint32_t palette[4]; // 0x40? rgb8
uint8_t palette_on;
};
svision_t m_svision;
svision_pet_t m_pet;
tvlink_t m_tvlink;
bool m_dma_finished = false;
DECLARE_WRITE_LINE_MEMBER(sound_irq_w);
uint8_t regs_r(offs_t offset);
void regs_w(offs_t offset, uint8_t data);
uint8_t tvlink_r(offs_t offset);
void tvlink_w(offs_t offset, uint8_t data);
uint32_t screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(frame_int_w);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
void svision_palette(palette_device &palette) const;
void svisionp_palette(palette_device &palette) const;
void svisionn_palette(palette_device &palette) const;
DECLARE_MACHINE_RESET(tvlink);
uint32_t make8_rgb32(uint8_t red3, uint8_t green3, uint8_t blue2) { return (red3 << (16 + 5)) | (green3 << (8 + 5)) | (blue2 << (0 + 6)); }
uint32_t make9_rgb32(uint8_t red3, uint8_t green3, uint8_t blue3) { return (red3 << (16 + 5)) | (green3 << (8 + 5)) | (blue3 << (0 + 5)); }
uint32_t make12_rgb32(uint8_t red4, uint8_t green4, uint8_t blue4) { return (red4 << (16 + 4)) | (green4 << (8 + 4)) | (blue4 << (0 + 4)); }
uint32_t make24_rgb32(uint8_t red8, uint8_t green8, uint8_t blue8) { return ((red8 & 0xf8) << 16) | ((green8 & 0xf8) << 8) | (blue8 & 0xf8); }
void check_irq();
TIMER_CALLBACK_MEMBER(svision_pet_timer);
TIMER_CALLBACK_MEMBER(svision_timer);
TIMER_DEVICE_CALLBACK_MEMBER(svision_pet_timer_dev);
void svision_mem(address_map &map);
void tvlink_mem(address_map &map);
};
TIMER_CALLBACK_MEMBER(svision_state::svision_pet_timer)
{
@ -76,7 +201,7 @@ TIMER_CALLBACK_MEMBER(svision_state::svision_timer)
check_irq();
}
uint8_t svision_state::svision_r(offs_t offset)
uint8_t svision_state::regs_r(offs_t offset)
{
int data = m_reg[offset];
switch (offset)
@ -123,14 +248,14 @@ uint8_t svision_state::svision_r(offs_t offset)
break;
default:
logerror("%.6f svision read %04x %02x\n", machine().time().as_double(),offset,data);
LOGREGS("%.6f svision read %04x %02x\n", machine().time().as_double(), offset, data);
break;
}
return data;
}
void svision_state::svision_w(offs_t offset, uint8_t data)
void svision_state::regs_w(offs_t offset, uint8_t data)
{
m_reg[offset] = data;
@ -140,16 +265,16 @@ void svision_state::svision_w(offs_t offset, uint8_t data)
case 0x03:
break;
case 0x26: /* bits 5,6 memory management for a000? */
case 0x26: // bits 5,6 memory management for a000?
{
logerror("%.6f svision write %04x %02x\n", machine().time().as_double(), offset, data);
int bank = ((m_reg[0x26] & 0xe0) >> 5) % (m_cart_rom->bytes() / 0x4000);
m_bank1->set_base(m_cart_rom->base() + (bank * 0x4000));
LOGREGS("%.6f svision write %04x %02x\n", machine().time().as_double(), offset, data);
const int bank = ((m_reg[0x26] & 0xe0) >> 5) % (m_cart_rom->bytes() / 0x4000);
m_bank[0]->set_entry(bank);
check_irq();
break;
}
case 0x23: /* delta hero irq routine write */
case 0x23: // delta hero irq routine write
{
int delay = (data == 0) ? 0x100 : data;
delay *= (BIT(m_reg[BANK], 4)) ? 0x4000 : 0x100;
@ -175,7 +300,7 @@ void svision_state::svision_w(offs_t offset, uint8_t data)
break;
default:
logerror("%.6f svision write %04x %02x\n", machine().time().as_double(), offset, data);
LOGREGS("%.6f svision write %04x %02x\n", machine().time().as_double(), offset, data);
break;
}
}
@ -187,12 +312,12 @@ uint8_t svision_state::tvlink_r(offs_t offset)
default:
if (offset >= 0x800 && offset < 0x840)
{
/* strange effects when modifying palette */
return svision_r(offset);
// strange effects when modifying palette
return regs_r(offset);
}
else
{
return svision_r(offset);
return regs_r(offset);
}
}
}
@ -206,44 +331,44 @@ void svision_state::tvlink_w(offs_t offset, uint8_t data)
m_tvlink.palette_on = data & 1;
if (m_tvlink.palette_on)
{
// hack, normally initialising with palette from ram
m_tvlink.palette[0] = MAKE12_RGB32(163/16,172/16,115/16); // these are the tron colors messured from screenshot
m_tvlink.palette[1] = MAKE12_RGB32(163/16,155/16,153/16);
m_tvlink.palette[2] = MAKE12_RGB32(77/16,125/16,73/16);
m_tvlink.palette[3] = MAKE12_RGB32(59/16,24/16,20/16);
// hack, normally initialising with palette from RAM
m_tvlink.palette[0] = make12_rgb32(163 / 16, 172 / 16, 115 / 16); // these are the tron colors measured from screenshot
m_tvlink.palette[1] = make12_rgb32(163 / 16, 155 / 16, 153 / 16);
m_tvlink.palette[2] = make12_rgb32(77 / 16, 125 / 16, 73 / 16);
m_tvlink.palette[3] = make12_rgb32(59 / 16, 24 / 16, 20 / 16);
}
else
{
// cleaner to use colors from compile time palette, or compose from "fixed" palette values
m_tvlink.palette[0]=MAKE12_RGB32(0,0,0);
m_tvlink.palette[1]=MAKE12_RGB32(5*16/256,18*16/256,9*16/256);
m_tvlink.palette[2]=MAKE12_RGB32(48*16/256,76*16/256,100*16/256);
m_tvlink.palette[3]=MAKE12_RGB32(190*16/256,190*16/256,190*16/256);
m_tvlink.palette[0] = make12_rgb32(0, 0, 0);
m_tvlink.palette[1] = make12_rgb32(5 * 16 / 256, 18 * 16 / 256, 9 * 16 / 256);
m_tvlink.palette[2] = make12_rgb32(48 * 16 / 256, 76 * 16 / 256, 100 * 16 / 256);
m_tvlink.palette[3] = make12_rgb32(190 * 16 / 256, 190 * 16 / 256, 190 * 16 / 256);
}
break;
default:
svision_w(offset,data);
regs_w(offset, data);
if (offset >= 0x800 && offset < 0x840)
{
if (offset == 0x803 && data == 0x07)
{
/* tron hack */
// tron hack
m_reg[0x0804] = 0x00;
m_reg[0x0805] = 0x01;
m_reg[0x0806] = 0x00;
m_reg[0x0807] = 0x00;
}
uint16_t c = m_reg[0x800] | (m_reg[0x804] << 8);
m_tvlink.palette[0] = MAKE9_RGB32( (c>>0)&7, (c>>3)&7, (c>>6)&7);
m_tvlink.palette[0] = make9_rgb32((c >> 0) & 7, (c >> 3) & 7, (c >> 6) & 7);
c = m_reg[0x801] | (m_reg[0x805] << 8);
m_tvlink.palette[1] = MAKE9_RGB32( (c>>0)&7, (c>>3)&7, (c>>6)&7);
m_tvlink.palette[1] = make9_rgb32((c >> 0) & 7, (c >> 3) & 7, (c >> 6) & 7);
c = m_reg[0x802] | (m_reg[0x806]<<8);
m_tvlink.palette[2]=MAKE9_RGB32( (c>>0)&7, (c>>3)&7, (c>>6)&7);
m_tvlink.palette[2] = make9_rgb32((c >> 0) & 7, (c >> 3) & 7, (c >> 6) & 7);
c = m_reg[0x803] | (m_reg[0x807]<<8);
m_tvlink.palette[3]=MAKE9_RGB32( (c>>0)&7, (c>>3)&7, (c>>6)&7);
/* writes to palette effect video color immediately */
/* some writes modify other registers, */
/* encoding therefor not known (rgb8 or rgb9) */
m_tvlink.palette[3] = make9_rgb32((c >> 0) & 7, (c >> 3) & 7, (c >> 6) & 7);
/* writes to palette effect video color immediately
some writes modify other registers,
encoding therefor not known (rgb8 or rgb9) */
}
}
}
@ -251,11 +376,11 @@ void svision_state::tvlink_w(offs_t offset, uint8_t data)
void svision_state::svision_mem(address_map &map)
{
map(0x0000, 0x1fff).ram();
map(0x2000, 0x3fff).rw(FUNC(svision_state::svision_r), FUNC(svision_state::svision_w)).share(m_reg);
map(0x2000, 0x3fff).rw(FUNC(svision_state::regs_r), FUNC(svision_state::regs_w)).share(m_reg);
map(0x4000, 0x5fff).ram().share(m_videoram);
map(0x6000, 0x7fff).noprw();
map(0x8000, 0xbfff).bankr(m_bank1);
map(0xc000, 0xffff).bankr(m_bank2);
map(0x8000, 0xbfff).bankr(m_bank[0]);
map(0xc000, 0xffff).bankr(m_bank[1]);
}
void svision_state::tvlink_mem(address_map &map)
@ -264,8 +389,8 @@ void svision_state::tvlink_mem(address_map &map)
map(0x2000, 0x3fff).rw(FUNC(svision_state::tvlink_r), FUNC(svision_state::tvlink_w)).share(m_reg);
map(0x4000, 0x5fff).ram().share(m_videoram);
map(0x6000, 0x7fff).noprw();
map(0x8000, 0xbfff).bankr(m_bank1);
map(0xc000, 0xffff).bankr(m_bank2);
map(0x8000, 0xbfff).bankr(m_bank[0]);
map(0xc000, 0xffff).bankr(m_bank[1]);
}
static INPUT_PORTS_START( svision )
@ -301,7 +426,7 @@ static INPUT_PORTS_START( svisions )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START) PORT_NAME("2nd Start/Pause") PORT_PLAYER(2)
INPUT_PORTS_END
// most games contain their graphics in roms, and have hardware to draw complete rectangular objects
// most games contain their graphics in ROMs, and have hardware to draw complete rectangular objects
// palette in red, green, blue triples
static constexpr rgb_t svision_pens[] =
@ -313,7 +438,7 @@ static constexpr rgb_t svision_pens[] =
{ 74, 107, 101 },
{ 54, 78, 85 }
#else
// grabbed from chris covell's black white pics
// grabbed from Chris Covell's black & white pics
{ 0xe0, 0xe0, 0xe0 },
{ 0xb9, 0xb9, 0xb9 },
{ 0x54, 0x54, 0x54 },
@ -363,9 +488,9 @@ uint32_t svision_state::screen_update_svision(screen_device &screen, bitmap_ind1
const int start_x = 3 - (m_reg[XPOS] & 3);
const int end_x = std::min(163, m_reg[XSIZE] | 3);
uint16_t *line = &bitmap.pix(y, start_x);
for (int x = start_x, i = 0; x < end_x; x+=4, i++)
for (int x = start_x, i = 0; x < end_x; x += 4, i++)
{
uint8_t b = m_videoram[j+i];
uint8_t b = m_videoram[j + i];
for (int pix = 0; pix < 4; pix++)
{
*line = b & 3;
@ -467,10 +592,23 @@ void svision_state::machine_start()
if (m_cart_rom)
{
int num_banks = m_cart_rom->bytes() / 0x4000;
m_bank1->set_base(m_cart_rom->base());
m_bank2->set_base(m_cart_rom->base() + (num_banks - 1) * 0x4000); // bank2 is set to the last bank
const int num_banks = m_cart_rom->bytes() / 0x4000;
m_bank[0]->configure_entries(0, num_banks, m_cart_rom->base(), 0x4000);
m_bank[1]->set_base(m_cart_rom->base() + (num_banks - 1) * 0x4000); // bank2 is set to the last bank
}
save_item(STRUCT_MEMBER(m_svision, timer_shot));
save_item(STRUCT_MEMBER(m_pet, state));
save_item(STRUCT_MEMBER(m_pet, on));
save_item(STRUCT_MEMBER(m_pet, clock));
save_item(STRUCT_MEMBER(m_pet, data));
save_item(STRUCT_MEMBER(m_pet, input));
save_item(STRUCT_MEMBER(m_tvlink, palette));
save_item(STRUCT_MEMBER(m_tvlink, palette_on));
save_item(NAME(m_dma_finished));
}
void svision_state::machine_reset()
@ -488,10 +626,10 @@ MACHINE_RESET_MEMBER(svision_state,tvlink)
memset(m_reg + 0x800, 0xff, 0x40); // normally done from m_tvlink microcontroller
m_reg[0x82a] = 0xdf;
m_tvlink.palette[0] = MAKE24_RGB32(svisionp_pens[0].r(), svisionp_pens[0].g(), svisionp_pens[0].b());
m_tvlink.palette[1] = MAKE24_RGB32(svisionp_pens[1].r(), svisionp_pens[1].g(), svisionp_pens[1].b());
m_tvlink.palette[2] = MAKE24_RGB32(svisionp_pens[2].r(), svisionp_pens[2].g(), svisionp_pens[2].b());
m_tvlink.palette[3] = MAKE24_RGB32(svisionp_pens[3].r(), svisionp_pens[3].g(), svisionp_pens[3].b());
m_tvlink.palette[0] = make24_rgb32(svisionp_pens[0].r(), svisionp_pens[0].g(), svisionp_pens[0].b());
m_tvlink.palette[1] = make24_rgb32(svisionp_pens[1].r(), svisionp_pens[1].g(), svisionp_pens[1].b());
m_tvlink.palette[2] = make24_rgb32(svisionp_pens[2].r(), svisionp_pens[2].g(), svisionp_pens[2].b());
m_tvlink.palette[3] = make24_rgb32(svisionp_pens[3].r(), svisionp_pens[3].g(), svisionp_pens[3].b());
}
void svision_state::svision_base(machine_config &config)
@ -500,7 +638,7 @@ void svision_state::svision_base(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
SVISION_SND(config, m_sound, 4000000, m_maincpu, m_bank1);
SVISION_SND(config, m_sound, 4'000'000, m_maincpu, m_bank[0]);
m_sound->add_route(0, "lspeaker", 0.50);
m_sound->add_route(1, "rspeaker", 0.50);
m_sound->irq_cb().set(FUNC(svision_state::sound_irq_w));
@ -516,7 +654,7 @@ void svision_state::svision(machine_config &config)
{
svision_base(config);
M65C02(config, m_maincpu, 4000000);
M65C02(config, m_maincpu, 4'000'000);
m_maincpu->set_addrmap(AS_PROGRAM, &svision_state::svision_mem);
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
@ -540,7 +678,7 @@ void svision_state::svisionp(machine_config &config)
{
svision(config);
m_maincpu->set_clock(4430000);
m_maincpu->set_clock(4'430'000);
m_screen->set_refresh(HZ_TO_ATTOSECONDS(50));
m_palette->set_init(FUNC(svision_state::svisionp_palette));
}
@ -548,7 +686,7 @@ void svision_state::svisionp(machine_config &config)
void svision_state::svisionn(machine_config &config)
{
svision(config);
m_maincpu->set_clock(3560000/*?*/);
m_maincpu->set_clock(3'560'000); // ?
m_screen->set_refresh(HZ_TO_ATTOSECONDS(60));
m_palette->set_init(FUNC(svision_state::svisionn_palette));
}
@ -568,6 +706,16 @@ ROM_START(svision)
ROM_REGION(0x80000, "maincpu", ROMREGION_ERASE00)
ROM_END
ROM_START(tvlinkp)
ROM_REGION(0x80000, "maincpu", ROMREGION_ERASE00)
ROM_REGION(0x10000, "bezel", 0 )
ROM_LOAD( "9307md_512d.glob", 0x00000, 0x10000, CRC(bc8b981b) SHA1(3328da4fd9462286e8cefe4372ffd17c8f5a229e) )
ROM_END
} // anonymous namespace
/***************************************************************************
Game driver(s)
@ -577,16 +725,15 @@ ROM_END
#define rom_svisions rom_svision
#define rom_svisionn rom_svision
#define rom_svisionp rom_svision
#define rom_tvlinkp rom_svision
// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS
// marketed under a ton of firms and names
CONS(1992, svision, 0, 0, svision, svision, svision_state, init_svision, "Watara", "Super Vision", 0 )
CONS(1992, svision, 0, 0, svision, svision, svision_state, init_svision, "Watara", "Super Vision", MACHINE_SUPPORTS_SAVE )
// svdual 2 connected via communication port
CONS( 1992, svisions, svision, 0, svisions, svisions, svision_state, init_svisions, "Watara", "Super Vision (PeT Communication Simulation)", 0 )
CONS( 1992, svisions, svision, 0, svisions, svisions, svision_state, init_svisions, "Watara", "Super Vision (PeT Communication Simulation)", MACHINE_SUPPORTS_SAVE )
CONS( 1993, svisionp, svision, 0, svisionp, svision, svision_state, init_svision, "Watara", "Super Vision (PAL TV Link Colored)", 0 )
CONS( 1993, svisionn, svision, 0, svisionn, svision, svision_state, init_svision, "Watara", "Super Vision (NTSC TV Link Colored)", 0 )
CONS( 1993, svisionp, svision, 0, svisionp, svision, svision_state, init_svision, "Watara", "Super Vision (PAL TV Link Colored)", MACHINE_SUPPORTS_SAVE )
CONS( 1993, svisionn, svision, 0, svisionn, svision, svision_state, init_svision, "Watara", "Super Vision (NTSC TV Link Colored)", MACHINE_SUPPORTS_SAVE )
// svtvlink (2 supervisions)
// tvlink (pad supervision simulated)
CONS( 199?, tvlinkp, svision, 0, tvlinkp, svision, svision_state, init_svision, "Watara", "TV Link PAL", 0 )
CONS( 199?, tvlinkp, svision, 0, tvlinkp, svision, svision_state, init_svision, "Watara", "TV Link PAL", MACHINE_SUPPORTS_SAVE )

View file

@ -1,128 +0,0 @@
// license:GPL-2.0+
// copyright-holders:Peter Trauner
/*****************************************************************************
*
* includes/svision.h
*
****************************************************************************/
#ifndef MAME_SVISION_SVISION_H
#define MAME_SVISION_SVISION_H
#pragma once
#include "cpu/m6502/m65c02.h"
#include "machine/timer.h"
#include "svis_snd.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
#include "emupal.h"
struct tvlink_t
{
uint32_t palette[4/*0x40?*/]; /* rgb8 */
int palette_on;
};
class svision_state : public driver_device
{
public:
svision_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_sound(*this, "custom")
, m_cart(*this, "cartslot")
, m_reg(*this, "reg")
, m_videoram(*this, "videoram")
, m_screen(*this, "screen")
, m_joy(*this, "JOY")
, m_joy2(*this, "JOY2")
, m_palette(*this, "palette")
, m_bank1(*this, "bank1")
, m_bank2(*this, "bank2")
{ }
void svisionp(machine_config &config);
void svisions(machine_config &config);
void tvlinkp(machine_config &config);
void svision(machine_config &config);
void svisionn(machine_config &config);
void svision_base(machine_config &config);
void init_svisions();
void init_svision();
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
struct svision_t
{
emu_timer *timer1 = nullptr;
int timer_shot = 0;
};
struct svision_pet_t
{
int state = 0;
int on = 0, clock = 0, data = 0;
uint8_t input = 0;
emu_timer *timer = nullptr;
};
DECLARE_WRITE_LINE_MEMBER(sound_irq_w);
uint8_t svision_r(offs_t offset);
void svision_w(offs_t offset, uint8_t data);
uint8_t tvlink_r(offs_t offset);
void tvlink_w(offs_t offset, uint8_t data);
uint32_t screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(frame_int_w);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
void svision_palette(palette_device &palette) const;
void svisionp_palette(palette_device &palette) const;
void svisionn_palette(palette_device &palette) const;
DECLARE_MACHINE_RESET(tvlink);
enum
{
XSIZE = 0x00,
XPOS = 0x02,
YPOS = 0x03,
BANK = 0x26,
};
void check_irq();
TIMER_CALLBACK_MEMBER(svision_pet_timer);
TIMER_CALLBACK_MEMBER(svision_timer);
TIMER_DEVICE_CALLBACK_MEMBER(svision_pet_timer_dev);
void svision_mem(address_map &map);
void tvlink_mem(address_map &map);
required_device<cpu_device> m_maincpu;
required_device<svision_sound_device> m_sound;
required_device<generic_slot_device> m_cart;
required_shared_ptr<uint8_t> m_reg;
required_shared_ptr<uint8_t> m_videoram;
required_device<screen_device> m_screen;
required_ioport m_joy;
optional_ioport m_joy2;
required_device<palette_device> m_palette;
required_memory_bank m_bank1;
required_memory_bank m_bank2;
memory_region *m_cart_rom = nullptr;
svision_t m_svision;
svision_pet_t m_pet;
tvlink_t m_tvlink;
bool m_dma_finished = false;
};
#endif // MAME_SVISION_SVISION_H