New working systems

-------------------
Diamond [hap, Berger]
This commit is contained in:
hap 2024-08-12 18:38:28 +02:00
parent d560efa1a3
commit 8b86a6ff78
7 changed files with 729 additions and 119 deletions

View File

@ -0,0 +1,496 @@
<?xml version="1.0"?>
<!--
license:CC0-1.0
authors:hap
-->
<mamelayout version="2">
<!-- define elements -->
<element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
<element name="whitew"><rect><color red="1" green="1" blue="1" /></rect></element>
<element name="lcdm"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="ledr" defstate="0">
<rect state="1"><color red="1.0" green="0.1" blue="0.15" /></rect>
<rect state="0"><color red="1.0" green="0.1" blue="0.15" alpha="0.17" /></rect>
</element>
<element name="text_1"><text string="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_2"><text string="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_3"><text string="3"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_4"><text string="4"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_5"><text string="5"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_6"><text string="6"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_7"><text string="7"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_8"><text string="8"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_a"><text string="A"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b"><text string="B"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_c"><text string="C"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_d"><text string="D"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_e"><text string="E"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_f"><text string="F"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_g"><text string="G"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_h"><text string="H"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<!-- sb board -->
<element name="cblack"><rect><color red="0.41" green="0.4" blue="0.39" /></rect></element>
<element name="cwhite"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
<element name="hlbb" defstate="0">
<text string=" "><bounds x="0" y="0" width="1" height="1" /></text>
<disk state="1">
<bounds x="0.12" y="0.12" width="0.76" height="0.76" />
<color red="0" green="0" blue="0" />
</disk>
</element>
<element name="piece" defstate="0">
<image file="chess/wp.svg" state="1"/>
<image file="chess/wn.svg" state="2"/>
<image file="chess/wb.svg" state="3"/>
<image file="chess/wr.svg" state="4"/>
<image file="chess/wq.svg" state="5"/>
<image file="chess/wk.svg" state="6"/>
<image file="chess/bp.svg" state="7"/>
<image file="chess/bn.svg" state="8"/>
<image file="chess/bb.svg" state="9"/>
<image file="chess/br.svg" state="10"/>
<image file="chess/bq.svg" state="11"/>
<image file="chess/bk.svg" state="12"/>
<!-- selected pieces -->
<image file="chess/wp.svg" state="13"><color alpha="0.5" /></image>
<image file="chess/wn.svg" state="14"><color alpha="0.5" /></image>
<image file="chess/wb.svg" state="15"><color alpha="0.5" /></image>
<image file="chess/wr.svg" state="16"><color alpha="0.5" /></image>
<image file="chess/wq.svg" state="17"><color alpha="0.5" /></image>
<image file="chess/wk.svg" state="18"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="19"><color alpha="0.5" /></image>
<image file="chess/bn.svg" state="20"><color alpha="0.5" /></image>
<image file="chess/bb.svg" state="21"><color alpha="0.5" /></image>
<image file="chess/br.svg" state="22"><color alpha="0.5" /></image>
<image file="chess/bq.svg" state="23"><color alpha="0.5" /></image>
<image file="chess/bk.svg" state="24"><color alpha="0.5" /></image>
</element>
<group name="sb_board">
<bounds x="0" y="0" width="80" height="80" />
<!-- squares (avoid seams) -->
<element ref="cwhite"><bounds x="0" y="0" width="11" height="11" /></element>
<element ref="cblack"><bounds x="10" y="0" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="20" y="0" width="11" height="11" /></element>
<element ref="cblack"><bounds x="30" y="0" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="40" y="0" width="11" height="11" /></element>
<element ref="cblack"><bounds x="50" y="0" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="60" y="0" width="11" height="11" /></element>
<element ref="cblack"><bounds x="70" y="0" width="10" height="11" /></element>
<element ref="cblack"><bounds x="0" y="10" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="10" y="10" width="11" height="11" /></element>
<element ref="cblack"><bounds x="20" y="10" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="30" y="10" width="11" height="11" /></element>
<element ref="cblack"><bounds x="40" y="10" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="50" y="10" width="11" height="11" /></element>
<element ref="cblack"><bounds x="60" y="10" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="70" y="10" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="0" y="20" width="11" height="11" /></element>
<element ref="cblack"><bounds x="10" y="20" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="20" y="20" width="11" height="11" /></element>
<element ref="cblack"><bounds x="30" y="20" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="40" y="20" width="11" height="11" /></element>
<element ref="cblack"><bounds x="50" y="20" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="60" y="20" width="11" height="11" /></element>
<element ref="cblack"><bounds x="70" y="20" width="10" height="11" /></element>
<element ref="cblack"><bounds x="0" y="30" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="10" y="30" width="11" height="11" /></element>
<element ref="cblack"><bounds x="20" y="30" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="30" y="30" width="11" height="11" /></element>
<element ref="cblack"><bounds x="40" y="30" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="50" y="30" width="11" height="11" /></element>
<element ref="cblack"><bounds x="60" y="30" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="70" y="30" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="0" y="40" width="11" height="11" /></element>
<element ref="cblack"><bounds x="10" y="40" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="20" y="40" width="11" height="11" /></element>
<element ref="cblack"><bounds x="30" y="40" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="40" y="40" width="11" height="11" /></element>
<element ref="cblack"><bounds x="50" y="40" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="60" y="40" width="11" height="11" /></element>
<element ref="cblack"><bounds x="70" y="40" width="10" height="11" /></element>
<element ref="cblack"><bounds x="0" y="50" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="10" y="50" width="11" height="11" /></element>
<element ref="cblack"><bounds x="20" y="50" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="30" y="50" width="11" height="11" /></element>
<element ref="cblack"><bounds x="40" y="50" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="50" y="50" width="11" height="11" /></element>
<element ref="cblack"><bounds x="60" y="50" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="70" y="50" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="0" y="60" width="11" height="11" /></element>
<element ref="cblack"><bounds x="10" y="60" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="20" y="60" width="11" height="11" /></element>
<element ref="cblack"><bounds x="30" y="60" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="40" y="60" width="11" height="11" /></element>
<element ref="cblack"><bounds x="50" y="60" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="60" y="60" width="11" height="11" /></element>
<element ref="cblack"><bounds x="70" y="60" width="10" height="11" /></element>
<element ref="cblack"><bounds x="0" y="70" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="10" y="70" width="11" height="10" /></element>
<element ref="cblack"><bounds x="20" y="70" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="30" y="70" width="11" height="10" /></element>
<element ref="cblack"><bounds x="40" y="70" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="50" y="70" width="11" height="10" /></element>
<element ref="cblack"><bounds x="60" y="70" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="70" y="70" width="10" height="10" /></element>
<!-- sensors, pieces -->
<repeat count="8">
<param name="y" start="0" increment="10" />
<param name="i" start="8" increment="-1" />
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x01"><bounds x="0" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x02"><bounds x="10" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x04"><bounds x="20" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x08"><bounds x="30" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x10"><bounds x="40" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x20"><bounds x="50" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x40"><bounds x="60" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x80"><bounds x="70" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element name="piece_a~i~" ref="piece"><bounds x="0" y="~y~" width="10" height="10" /></element>
<element name="piece_b~i~" ref="piece"><bounds x="10" y="~y~" width="10" height="10" /></element>
<element name="piece_c~i~" ref="piece"><bounds x="20" y="~y~" width="10" height="10" /></element>
<element name="piece_d~i~" ref="piece"><bounds x="30" y="~y~" width="10" height="10" /></element>
<element name="piece_e~i~" ref="piece"><bounds x="40" y="~y~" width="10" height="10" /></element>
<element name="piece_f~i~" ref="piece"><bounds x="50" y="~y~" width="10" height="10" /></element>
<element name="piece_g~i~" ref="piece"><bounds x="60" y="~y~" width="10" height="10" /></element>
<element name="piece_h~i~" ref="piece"><bounds x="70" y="~y~" width="10" height="10" /></element>
</repeat>
</group>
<!-- sb ui -->
<element name="hlub" defstate="0">
<rect state="1"><color red="0" green="0" blue="0" /></rect>
</element>
<element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uib2"><text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uib3"><text string="CLEAR"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uis1"><text string="SPAWN:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uih1"><text string="HAND:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uih2"><text string="REMOVE"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uiu1"><text string="UNDO:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uiu2a"><text string=" &lt;&lt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uiu2b"><text string=" &lt; "><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uiu2c"><text string=" &gt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uiu2d"><text string=" &gt;&gt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uiu3b"><text string="/"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uiu3a" defstate="0">
<simplecounter maxstate="999" digits="1" align="2">
<color red="0.81" green="0.8" blue="0.79" />
</simplecounter>
</element>
<element name="text_uiu3c" defstate="0">
<simplecounter maxstate="999" digits="1" align="1">
<color red="0.81" green="0.8" blue="0.79" />
</simplecounter>
</element>
<group name="sb_ui">
<bounds x="0" y="0" width="10" height="80" />
<element ref="cblack"><bounds x="0" y="0" width="10" height="1" /></element>
<element ref="cblack"><bounds x="0" y="7" width="10" height="1" /></element>
<element ref="cblack"><bounds x="0" y="79" width="10" height="1" /></element>
<element ref="text_uit1"><bounds x="0" y="2" width="10" height="2" /></element>
<element ref="text_uit2"><bounds x="0" y="4" width="10" height="2" /></element>
<!-- board -->
<element ref="text_uib1"><bounds x="0" y="9" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="11.5" width="8" height="2.5" /></element>
<element ref="cwhite"><bounds x="1" y="15" width="8" height="2.5" /></element>
<element ref="text_uib2"><bounds x="1.5" y="11.75" width="7" height="2" /></element>
<element ref="text_uib3"><bounds x="1.5" y="15.25" width="7" height="2" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x200"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- spawn -->
<element ref="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="23" width="8" height="12" /></element>
<element ref="cwhite"><bounds x="1" y="36" width="8" height="12" /></element>
<element name="piece_ui1" ref="piece"><bounds x="1" y="23" width="4" height="4" /></element>
<element name="piece_ui2" ref="piece"><bounds x="1" y="27" width="4" height="4" /></element>
<element name="piece_ui3" ref="piece"><bounds x="1" y="31" width="4" height="4" /></element>
<element name="piece_ui4" ref="piece"><bounds x="5" y="23" width="4" height="4" /></element>
<element name="piece_ui5" ref="piece"><bounds x="5" y="27" width="4" height="4" /></element>
<element name="piece_ui6" ref="piece"><bounds x="5" y="31" width="4" height="4" /></element>
<element name="piece_ui7" ref="piece"><bounds x="1" y="36" width="4" height="4" /></element>
<element name="piece_ui8" ref="piece"><bounds x="1" y="40" width="4" height="4" /></element>
<element name="piece_ui9" ref="piece"><bounds x="1" y="44" width="4" height="4" /></element>
<element name="piece_ui10" ref="piece"><bounds x="5" y="36" width="4" height="4" /></element>
<element name="piece_ui11" ref="piece"><bounds x="5" y="40" width="4" height="4" /></element>
<element name="piece_ui12" ref="piece"><bounds x="5" y="44" width="4" height="4" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></element>
<!-- hand -->
<element ref="text_uih1"><bounds x="0" y="51" width="10" height="2" /></element>
<element ref="cblack"><bounds x="1" y="53.5" width="8" height="6" /></element>
<element name="piece_ui0" ref="piece"><bounds x="2" y="53.5" width="6" height="6" /></element>
<element ref="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></element>
<element ref="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- undo -->
<element ref="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></element>
<element ref="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element name="count_ui0" ref="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></element>
<element name="count_ui1" ref="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></element>
<element ref="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></element>
</group>
<!-- buttons -->
<element name="cyan"><rect><color red="0.4" green="0.8" blue="0.8" /></rect></element>
<element name="but" defstate="0">
<rect state="0"><color red="0.155" green="0.15" blue="0.15" /></rect>
<rect state="1"><color red="0.24" green="0.23" blue="0.23" /></rect>
</element>
<element name="butd" defstate="0">
<disk state="0">
<bounds x="0" y="0" width="2.9" height="3.5" />
<color red="0.155" green="0.15" blue="0.15" />
</disk>
<rect state="0">
<bounds x="1.45" y="0" width="4.35" height="3.5" />
<color red="0.155" green="0.15" blue="0.15" />
</rect>
<disk state="1">
<bounds x="0" y="0" width="2.9" height="3.5" />
<color red="0.24" green="0.23" blue="0.23" />
</disk>
<rect state="1">
<bounds x="1.45" y="0" width="4.35" height="3.5" />
<color red="0.24" green="0.23" blue="0.23" />
</rect>
</element>
<element name="text_l1a"><text string="Referee"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l1b"><text string="Print Board"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l2a"><text string="Sound"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l2b"><text string="Print Game"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l3a"><text string="Book Select"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l3b"><text string="Print Moves"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l4a"><text string="Restore"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l4b"><text string="Video"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l5a"><text string="Random"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l5b"><text string="Human"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l6a"><text string="Easy"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l6b"><text string="Replay"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l7a"><text string="Trace Forward"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l7b"><text string="Autoclock"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l8a"><text string="Take Back"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l8b"><text string="Auto/Demo"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_m1a"><text string="Save Game"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m1b"><text string=" "></text></element>
<element name="text_m2a"><text string="Load Game"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m2b"><text string=" "></text></element>
<element name="text_m3a"><text string="Pro-op Save"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m3b"><text string=" "></text></element>
<element name="text_m4a"><text string="Pro-op Delete"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m4b"><text string=" "></text></element>
<element name="text_m5a"><text string="Pro-op Priority"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m5b"><text string=" "></text></element>
<element name="text_m6a"><text string="Pro-op Print"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_m6b"><text string=" "></text></element>
<element name="text_m7a"><text string="Verify"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_m7b"><text string="Setup"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_m8a"><text string="Color"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_m8b"><text string=" "></text></element>
<element name="text_r1a"><text string="New Game"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r1b"><text string=" "></text></element>
<element name="text_r2a"><text string="Clear"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r2b"><text string="Clear Board"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r3a"><text string="Set Level"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r3b"><text string=" "></text></element>
<element name="text_r4a"><text string="Next Best"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r4b"><text string=" "></text></element>
<element name="text_r5a"><text string="Training"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r5b"><text string=""></text></element>
<element name="text_r6a"><text string="Hint"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r6b"><text string=" "></text></element>
<element name="text_r7a"><text string="Info"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r7b"><text string=" "></text></element>
<element name="text_r8a"><text string="Go"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_r8b"><text string=" "></text></element>
<element name="text_p1"><image file="chess/wp.svg"></image></element>
<element name="text_p2"><image file="chess/wn.svg"></image></element>
<element name="text_p3"><image file="chess/wb.svg"></image></element>
<element name="text_p4"><image file="chess/wr.svg"></image></element>
<element name="text_p5"><image file="chess/wq.svg"></image></element>
<element name="text_p6"><image file="chess/wk.svg"></image></element>
<group name="buttons">
<bounds x="0" y="0" width="40" height="80" />
<repeat count="6">
<param name="y" start="14.5" increment="8.05714" />
<param name="i" start="1" increment="1" />
<element ref="text_p~i~"><bounds xc="18" yc="~y~" width="2" height="2" /></element>
<element ref="cyan" blend="multiply"><bounds xc="18" yc="~y~" width="3" height="3" /></element>
</repeat>
<repeat count="8">
<param name="y" start="8.3" increment="8.05714" />
<param name="i" start="1" increment="1" />
<element ref="text_l~i~a"><bounds xc="10" y="~y~" width="10" height="1.5" /></element>
<element ref="text_m~i~a"><bounds xc="18" y="~y~" width="10" height="1.5" /></element>
<element ref="text_r~i~a"><bounds xc="26" y="~y~" width="10" height="1.5" /></element>
</repeat>
<repeat count="8">
<param name="y" start="13.7" increment="8.05714" />
<param name="i" start="1" increment="1" />
<element ref="text_l~i~b"><bounds xc="10" y="~y~" width="10" height="1.5" /></element>
<element ref="text_m~i~b"><bounds xc="18" y="~y~" width="10" height="1.5" /></element>
<element ref="text_r~i~b"><bounds xc="26" y="~y~" width="10" height="1.5" /></element>
</repeat>
<element ref="butd" inputtag="IN.1" inputmask="0x80"><bounds xc="10" y="10.000" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x40"><bounds xc="10" y="18.057" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x20"><bounds xc="10" y="26.114" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x10"><bounds xc="10" y="34.171" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x08"><bounds xc="10" y="42.229" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x04"><bounds xc="10" y="50.286" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x02"><bounds xc="10" y="58.343" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.1" inputmask="0x01"><bounds xc="10" y="66.400" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x80"><bounds xc="18" y="10.000" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x40"><bounds xc="18" y="18.057" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x20"><bounds xc="18" y="26.114" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x10"><bounds xc="18" y="34.171" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x08"><bounds xc="18" y="42.229" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x04"><bounds xc="18" y="50.286" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x02"><bounds xc="18" y="58.343" width="5.65" height="3.6" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x01"><bounds xc="18" y="66.400" width="5.65" height="3.6" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x80"><bounds xc="26" y="10.000" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x40"><bounds xc="26" y="18.057" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x20"><bounds xc="26" y="26.114" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x10"><bounds xc="26" y="34.171" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x08"><bounds xc="26" y="42.229" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x04"><bounds xc="26" y="50.286" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x02"><bounds xc="26" y="58.343" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
<element ref="butd" inputtag="IN.0" inputmask="0x01"><bounds xc="26" y="66.400" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
</group>
<!-- build screen -->
<view name="Internal Layout">
<bounds left="-13" right="114" top="1" bottom="98.891" />
<element ref="whitew"><bounds x="3.125" yc="43" width="110.875" height="81.75" /><color alpha="0.16" /></element>
<element ref="blackb"><bounds x="3.375" yc="43" width="110.875" height="81.25" /></element>
<group ref="sb_board"><bounds x="4" yc="43" width="80" height="80" /></group>
<group ref="sb_ui"><bounds x="-11.5" y="3" width="10" height="80" /></group>
<group ref="buttons"><bounds x="81" y="3" width="40" height="80" /></group>
<!-- chessboard coords -->
<element ref="text_8"><bounds x="1" y="5.3" width="2" height="2" /></element>
<element ref="text_7"><bounds x="1" y="15.3" width="2" height="2" /></element>
<element ref="text_6"><bounds x="1" y="25.3" width="2" height="2" /></element>
<element ref="text_5"><bounds x="1" y="35.3" width="2" height="2" /></element>
<element ref="text_4"><bounds x="1" y="45.3" width="2" height="2" /></element>
<element ref="text_3"><bounds x="1" y="55.3" width="2" height="2" /></element>
<element ref="text_2"><bounds x="1" y="65.3" width="2" height="2" /></element>
<element ref="text_1"><bounds x="1" y="75.3" width="2" height="2" /></element>
<element ref="text_a"><bounds x="6" y="84.25" width="2" height="2" /></element>
<element ref="text_b"><bounds x="16" y="84.25" width="2" height="2" /></element>
<element ref="text_c"><bounds x="26" y="84.25" width="2" height="2" /></element>
<element ref="text_d"><bounds x="36" y="84.25" width="2" height="2" /></element>
<element ref="text_e"><bounds x="46" y="84.25" width="2" height="2" /></element>
<element ref="text_f"><bounds x="56" y="84.25" width="2" height="2" /></element>
<element ref="text_g"><bounds x="66" y="84.25" width="2" height="2" /></element>
<element ref="text_h"><bounds x="76" y="84.25" width="2" height="2" /></element>
<!-- chessboard leds -->
<element name="0.7" ref="ledr"><bounds x="0.25" y="7.5" width="2" height="1" /></element>
<element name="0.6" ref="ledr"><bounds x="0.25" y="17.5" width="2" height="1" /></element>
<element name="0.5" ref="ledr"><bounds x="0.25" y="27.5" width="2" height="1" /></element>
<element name="0.4" ref="ledr"><bounds x="0.25" y="37.5" width="2" height="1" /></element>
<element name="0.3" ref="ledr"><bounds x="0.25" y="47.5" width="2" height="1" /></element>
<element name="0.2" ref="ledr"><bounds x="0.25" y="57.5" width="2" height="1" /></element>
<element name="0.1" ref="ledr"><bounds x="0.25" y="67.5" width="2" height="1" /></element>
<element name="0.0" ref="ledr"><bounds x="0.25" y="77.5" width="2" height="1" /></element>
<element name="1.7" ref="ledr"><bounds x="7.75" y="84.75" width="2" height="1" /></element>
<element name="1.6" ref="ledr"><bounds x="17.75" y="84.75" width="2" height="1" /></element>
<element name="1.5" ref="ledr"><bounds x="27.75" y="84.75" width="2" height="1" /></element>
<element name="1.4" ref="ledr"><bounds x="37.75" y="84.75" width="2" height="1" /></element>
<element name="1.3" ref="ledr"><bounds x="47.75" y="84.75" width="2" height="1" /></element>
<element name="1.2" ref="ledr"><bounds x="57.75" y="84.75" width="2" height="1" /></element>
<element name="1.1" ref="ledr"><bounds x="67.75" y="84.75" width="2" height="1" /></element>
<element name="1.0" ref="ledr"><bounds x="77.75" y="84.75" width="2" height="1" /></element>
<!-- lcd panel -->
<screen index="0"><bounds xc="58.75" y="89" width="25" height="7.891" /></screen>
<element ref="lcdm" blend="multiply"><bounds xc="58.75" y="88" width="30" height="10" /></element>
</view>
</mamelayout>

View File

@ -388,7 +388,7 @@ authors:hap
<bounds x="0" y="0" width="40" height="80" />
<repeat count="6">
<param name="y" start="14.4" increment="8.05714" />
<param name="y" start="14.5" increment="8.05714" />
<param name="i" start="1" increment="1" />
<element ref="blackb"><bounds xc="18" yc="~y~" width="3" height="3" /></element>

View File

@ -297,7 +297,7 @@ authors:hap
<!-- buttons -->
<element name="cyan"><rect><color red="0.5" green="0.8" blue="0.8" /></rect></element>
<element name="cyan"><rect><color red="0.4" green="0.8" blue="0.8" /></rect></element>
<element name="but" defstate="0">
<rect state="0"><color red="0.155" green="0.15" blue="0.15" /></rect>
@ -323,13 +323,13 @@ authors:hap
</rect>
</element>
<element name="text_l1a"><text string="Print Board"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l1a"><text string="Print Board"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l1b"><text string="Interface"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l2a"><text string="Print List"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l2b"><text string="Acc. Time"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l3a"><text string="Print Moves"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l3b"><text string="Print Evaluations"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l4a"><text string="Print Book"><color red="0.8" green="0.3" blue="0.2" /></text></element>
<element name="text_l2a"><text string="Print List"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l2b"><text string="Acc. Time"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l3a"><text string="Print Moves"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l3b"><text string="Print Evaluations"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l4a"><text string="Print Book"><color red="0.8" green="0.25" blue="0.2" /></text></element>
<element name="text_l4b"><text string="Store Game"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l5a"><text string="No/End"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_l5b"><text string="End of Game"><color red="0.81" green="0.8" blue="0.79" /></text></element>
@ -357,7 +357,7 @@ authors:hap
<element name="text_m8a"><text string="Take Back"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_m8b"><text string="Analyze Games"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r1a"><text string="New Game"><color red="0.5" green="0.8" blue="0.8" /></text></element>
<element name="text_r1a"><text string="New Game"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_r1b"><text string=" "></text></element>
<element name="text_r2a"><text string="Verify/Setup"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r2b"><text string=" "></text></element>
@ -371,7 +371,7 @@ authors:hap
<element name="text_r6b"><text string="Next Best"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r7a"><text string="Set Level"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_r7b"><text string=" "></text></element>
<element name="text_r8a"><text string="Go"><color red="0.5" green="0.8" blue="0.8" /></text></element>
<element name="text_r8a"><text string="Go"><color red="0.4" green="0.8" blue="0.8" /></text></element>
<element name="text_r8b"><text string=" "></text></element>
<element name="text_n1b"><text string=" " align="1"></text></element>

View File

@ -35076,6 +35076,7 @@ diablo68a
scorpio68
@source:novag/diamond.cpp
diamond
diamond2
@source:novag/emerclp.cpp

View File

@ -3,27 +3,37 @@
// thanks-to:Berger
/*******************************************************************************
Novag Diamond II (model 38602)
Novag Diamond (model 9303) / Diamond II (model 38602)
Hardware notes:
Diamond:
- PCB label: 100165 REV B
- Hitachi H8/325 MCU (mode 2), 26.601712MHz XTAL
- 32KB EPROM (TC57256AD-12), 128KB SRAM (HM628128ALP-7)
- LCD with 6 7segs and custom segments (same as Novag VIP)
- RJ-12 port for Novag Super System (always 9600 baud)
- piezo, 16 LEDs, button sensors chessboard
Diamond II:
- PCB label: 100208 REV B
- Hitachi H8/325 MCU (mode 2), 32MHz XTAL
- 128KB EPROM (27C010), 128KB SRAM (KM681000BLG-7)
- LCD with 6 7segs and custom segments (same as Sapphire II)
- RJ-12 port for Novag Super System (always 9600 baud)
- piezo, 16 LEDs, button sensors chessboard
- Sapphire II LCD instead of VIP, the rest is the same as Diamond
Diamond II MCU and EPROM are the same as Sapphire II. MCU pin P62 determines
which hardware it runs on, see sapphire.cpp for Sapphire II.
TODO:
- dump/add Diamond(1), the hardware looks very similar judging from PCB photos
- Novag Super System peripherals don't work due to serial clock drift, baud rate
differs a bit between host and client, m6801 serial emulation issue (to work
around it, underclock diamond2 to exactly 31.9488MHz)
around it, underclock diamond to exactly 26.4192MHz, diamond2 to 31.9488MHz)
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
BTANB:
- diamond has the same AT level bug as sapphire (it works fine in diamond2)
*******************************************************************************/
#include "emu.h"
@ -39,15 +49,16 @@ TODO:
#include "speaker.h"
// internal artwork
#include "novag_diamond.lh"
#include "novag_diamond2.lh"
namespace {
class diamond2_state : public driver_device
class diamond_state : public driver_device
{
public:
diamond2_state(const machine_config &mconfig, device_type type, const char *tag) :
diamond_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_memory(*this, "memory"),
@ -63,6 +74,7 @@ public:
m_out_lcd(*this, "s%u.%u", 0U, 0U)
{ }
void diamond(machine_config &config);
void diamond2(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(power_switch);
@ -77,22 +89,24 @@ private:
memory_view m_memory;
memory_share_creator<u8> m_nvram;
required_memory_bank m_rambank;
required_memory_bank m_rombank;
optional_memory_bank m_rombank;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_led_pwm;
required_device<pwm_display_device> m_lcd_pwm;
required_device<dac_1bit_device> m_dac;
required_device<rs232_port_device> m_rs232;
required_ioport_array<3> m_inputs;
output_finder<4, 16> m_out_lcd;
output_finder<4, 10+6> m_out_lcd;
bool m_power = false;
u8 m_inp_mux = 0;
u8 m_led_select = 0;
u8 m_lcd_sclk = 0;
u32 m_lcd_data = 0;
u8 m_lcd_segs2 = 0;
void main_map(address_map &map);
void diamond_map(address_map &map);
void diamond2_map(address_map &map);
// I/O handlers
void standby(int state);
@ -101,24 +115,28 @@ private:
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
void lcd_data_w(u8 data);
void d1_lcd_data_w(u8 data);
void d2_lcd_data_w(u8 data);
void update_leds();
u8 read_buttons();
u8 read_board();
u8 p4_r();
u8 input_r();
u8 input2_r();
void cs_w(u8 data);
void bank_w(u8 data);
void update_leds();
template <int N> void leds_w(u8 data);
void p4_w(u8 data);
void p5_w(u8 data);
void p6_w(u8 data);
u8 p7_r();
void p7_w(u8 data);
};
void diamond2_state::machine_start()
void diamond_state::machine_start()
{
m_out_lcd.resolve();
m_rombank->configure_entries(0, 4, memregion("eprom")->base(), 0x8000);
if (m_rombank)
m_rombank->configure_entries(0, 4, memregion("eprom")->base(), 0x8000);
m_rambank->configure_entries(0, 4, m_nvram, 0x8000);
m_memory.select(0);
@ -128,6 +146,7 @@ void diamond2_state::machine_start()
save_item(NAME(m_led_select));
save_item(NAME(m_lcd_sclk));
save_item(NAME(m_lcd_data));
save_item(NAME(m_lcd_segs2));
}
@ -138,7 +157,7 @@ void diamond2_state::machine_start()
// power
void diamond2_state::standby(int state)
void diamond_state::standby(int state)
{
// clear display
if (state)
@ -148,47 +167,63 @@ void diamond2_state::standby(int state)
}
}
void diamond2_state::set_power(bool power)
void diamond_state::set_power(bool power)
{
// power switch is tied to IRQ2
m_maincpu->set_input_line(INPUT_LINE_IRQ2, power ? ASSERT_LINE : CLEAR_LINE);
m_power = power;
}
INPUT_CHANGED_MEMBER(diamond2_state::power_switch)
INPUT_CHANGED_MEMBER(diamond_state::power_switch)
{
if (newval)
set_power(bool(param));
}
u8 diamond2_state::power_r()
u8 diamond_state::power_r()
{
// P62: forced low (0 = Diamond II, 1 = Sapphire II)
// P66: power switch (IRQ2)
return m_power ? 0xbb : 0xfb;
return m_power ? 0xbf : 0xff;
}
// LCD
void diamond2_state::lcd_pwm_w(offs_t offset, u8 data)
void diamond_state::lcd_pwm_w(offs_t offset, u8 data)
{
m_out_lcd[offset & 0x3f][offset >> 6] = data;
}
void diamond2_state::update_lcd()
void diamond_state::update_lcd()
{
for (int i = 0; i < 4; i++)
{
// LCD common is analog (voltage level)
const u8 com = population_count_32(m_lcd_data >> (16 + (i * 2)) & 3);
u16 segs = (com == 0) ? m_lcd_data : (com == 2) ? ~m_lcd_data : 0;
const u8 shift = m_lcd_pwm->width() & 0x18;
m_lcd_pwm->write_row(i, segs);
// LCD common is analog (voltage level)
const u8 com = population_count_32(m_lcd_data >> (shift + (i * 2)) & 3);
u16 segs = m_lcd_data & ((1 << shift) - 1);
segs |= m_lcd_segs2 << shift; // diamond
m_lcd_pwm->write_row(i, (com == 0) ? segs : (com == 2) ? ~segs : 0);
}
}
void diamond2_state::lcd_data_w(u8 data)
void diamond_state::d1_lcd_data_w(u8 data)
{
// P60,P61: same as diamond2
d2_lcd_data_w(data);
// P62: 3*14015B R
if (data & 4)
m_lcd_data = 0;
// 2 more LCD segments after common
m_lcd_segs2 = m_lcd_data >> 16 & 3;
update_lcd();
}
void diamond_state::d2_lcd_data_w(u8 data)
{
// P60: 3*14015B C (chained)
if (data & 1 && !m_lcd_sclk)
@ -203,12 +238,7 @@ void diamond2_state::lcd_data_w(u8 data)
// misc
void diamond2_state::update_leds()
{
m_led_pwm->matrix(m_led_select, m_inp_mux);
}
u8 diamond2_state::read_buttons()
u8 diamond_state::read_buttons()
{
u8 data = 0;
@ -219,11 +249,11 @@ u8 diamond2_state::read_buttons()
return ~data;
}
u8 diamond2_state::read_board()
u8 diamond_state::read_board()
{
u8 data = 0;
// priority encoded (either a 74148 on diamond, or 2*7421 on diamond2)
// priority encoded (either a 74148 on d1, or 2*7421 on d2)
for (int i = 0; i < 8; i++)
if (BIT(m_inp_mux, i))
data |= (count_leading_zeros_32(m_board->read_rank(i)) - 24) ^ 8;
@ -231,104 +261,120 @@ u8 diamond2_state::read_board()
return ~data;
}
u8 diamond2_state::p4_r()
u8 diamond_state::input_r()
{
// P47: chessboard active
// P71-P73: multiplexed inputs
return (read_buttons() & read_board()) << 1 | 0xf1;
}
u8 diamond_state::input2_r()
{
// P27: chessboard active (P47 on d2)
return read_board() << 4 | 0x7f;
}
void diamond2_state::p4_w(u8 data)
void diamond_state::cs_w(u8 data)
{
// P41: ROM/RAM CS (P63 on d2)
m_memory.select(data & 1);
}
void diamond_state::bank_w(u8 data)
{
// P64,P65: ROM/RAM bankswitch
const u8 bank = data >> 4 & 3;
m_rambank->set_entry(bank);
// only diamond2 has ROM banks
if (m_rombank)
m_rombank->set_entry(bank);
// other: LCD (see above)
}
void diamond_state::update_leds()
{
m_led_pwm->matrix(m_led_select, m_inp_mux);
}
template <int N>
void diamond_state::leds_w(u8 data)
{
// P63/P41,P70: select LEDs
const u8 mask = 1 << N;
m_led_select = (m_led_select & ~mask) | ((data & 1) ? 0 : mask);
update_leds();
}
void diamond_state::p4_w(u8 data)
{
// P40: speaker out
m_dac->write(data & 1);
// P41: select LEDs A-H
m_led_select = (m_led_select & 1) | (~data & 2);
// P42-P45: input mux low
m_inp_mux = (m_inp_mux & 0xf0) | (~data >> 2 & 0xf);
update_leds();
}
void diamond2_state::p5_w(u8 data)
void diamond_state::p5_w(u8 data)
{
// P52-P55: input mux high
m_inp_mux = (m_inp_mux & 0x0f) | (~data << 2 & 0xf0);
update_leds();
}
void diamond2_state::p6_w(u8 data)
{
// P63: ROM/RAM CS
m_memory.select(BIT(data, 3));
// P64,P65: ROM/RAM bankswitch
const u8 bank = data >> 4 & 3;
m_rombank->set_entry(bank);
m_rambank->set_entry(bank);
// other: LCD (see above)
}
u8 diamond2_state::p7_r()
{
// P71-P73: multiplexed inputs
return (read_buttons() & read_board()) << 1 | 0xf1;
}
void diamond2_state::p7_w(u8 data)
{
// P70: select LEDs 1-8
m_led_select = (m_led_select & 2) | (~data & 1);
update_leds();
}
/*******************************************************************************
Address Maps
*******************************************************************************/
void diamond2_state::main_map(address_map &map)
void diamond_state::diamond_map(address_map &map)
{
map(0x8000, 0xffff).view(m_memory);
m_memory[0](0x8000, 0xffff).bankr(m_rombank);
m_memory[0](0x8000, 0xffff).rom().region("eprom", 0);
m_memory[1](0x8000, 0xffff).bankrw(m_rambank);
map(0xff90, 0xff9f).unmaprw(); // reserved for H8 registers
map(0xffb0, 0xffff).unmaprw(); // "
}
void diamond_state::diamond2_map(address_map &map)
{
diamond_map(map);
m_memory[0](0x8000, 0xffff).bankr(m_rombank);
}
/*******************************************************************************
Input Ports
*******************************************************************************/
static INPUT_PORTS_START( diamond2 )
static INPUT_PORTS_START( diamond )
PORT_START("IN.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Go")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Info")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Hint")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Training")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Option 1/2")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Next Best")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Set Level")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Clear / Clear Board")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("New Game")
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Next Best / Take Back / Print Board")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Print Game")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Take Back / Auto/Demo")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Autoclock")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Easy / Replay")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Random / Video")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Restore / Human")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Book Select / Auto/Demo")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Auto Clock")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Moves")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Random / Human")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Restore / Video")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Book Select / Print Moves")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Print Game")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Board")
PORT_START("IN.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Color")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Verify / Setup / Rating")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Verify / Setup")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Pro-op Print / King")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Pro-op Priority / Queen")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Pro-op Delete / Rook")
@ -336,15 +382,34 @@ static INPUT_PORTS_START( diamond2 )
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Load Game / Knight")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Save Game / Pawn")
PORT_START("POWER")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond_state, power_switch, 1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond_state, power_switch, 0)
INPUT_PORTS_END
static INPUT_PORTS_START( diamond2 )
PORT_INCLUDE( diamond )
PORT_MODIFY("IN.0")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Option 1/2")
PORT_MODIFY("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Next Best / Take Back / Print Board")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Print Game")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Random / Video")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Restore / Human")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Book Select / Auto/Demo")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Auto Clock")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Moves")
PORT_MODIFY("IN.2")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Verify / Setup / Rating")
PORT_START("BATT")
PORT_CONFNAME( 0x80, 0x80, "Battery Status" )
PORT_CONFSETTING( 0x00, "Low" )
PORT_CONFSETTING( 0x80, DEF_STR( Normal ) )
PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("POWER")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond2_state, power_switch, 1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond2_state, power_switch, 0)
INPUT_PORTS_END
@ -353,25 +418,26 @@ INPUT_PORTS_END
Machine Configs
*******************************************************************************/
void diamond2_state::diamond2(machine_config &config)
void diamond_state::diamond(machine_config &config)
{
// basic machine hardware
H8325(config, m_maincpu, 32_MHz_XTAL);
H8325(config, m_maincpu, 26.601712_MHz_XTAL);
m_maincpu->set_mode(2);
m_maincpu->set_addrmap(AS_PROGRAM, &diamond2_state::main_map);
m_maincpu->set_addrmap(AS_PROGRAM, &diamond_state::diamond_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery));
m_maincpu->standby_cb().append(FUNC(diamond2_state::standby));
m_maincpu->standby_cb().append(FUNC(diamond_state::standby));
m_maincpu->write_sci_tx<0>().set(m_rs232, FUNC(rs232_port_device::write_txd));
m_maincpu->read_port2().set_ioport("BATT").invert();
m_maincpu->read_port4().set(FUNC(diamond2_state::p4_r));
m_maincpu->write_port4().set(FUNC(diamond2_state::p4_w));
m_maincpu->write_port5().set(FUNC(diamond2_state::p5_w));
m_maincpu->read_port6().set(FUNC(diamond2_state::power_r));
m_maincpu->write_port6().set(FUNC(diamond2_state::p6_w));
m_maincpu->write_port6().append(FUNC(diamond2_state::lcd_data_w));
m_maincpu->read_port7().set(FUNC(diamond2_state::p7_r));
m_maincpu->write_port7().set(FUNC(diamond2_state::p7_w));
m_maincpu->read_port2().set(FUNC(diamond_state::input2_r));
m_maincpu->write_port4().set(FUNC(diamond_state::p4_w));
m_maincpu->write_port4().append(FUNC(diamond_state::cs_w)).bit(1);
m_maincpu->write_port5().set(FUNC(diamond_state::p5_w));
m_maincpu->read_port6().set(FUNC(diamond_state::power_r));
m_maincpu->write_port6().set(FUNC(diamond_state::bank_w));
m_maincpu->write_port6().append(FUNC(diamond_state::leds_w<1>)).bit(3);
m_maincpu->write_port6().append(FUNC(diamond_state::d1_lcd_data_w));
m_maincpu->read_port7().set(FUNC(diamond_state::input_r));
m_maincpu->write_port7().set(FUNC(diamond_state::leds_w<0>)).bit(0);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@ -381,17 +447,17 @@ void diamond2_state::diamond2(machine_config &config)
//m_board->set_nvram_enable(true);
// video hardware
PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 16);
m_lcd_pwm->output_x().set(FUNC(diamond2_state::lcd_pwm_w));
PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 10);
m_lcd_pwm->output_x().set(FUNC(diamond_state::lcd_pwm_w));
m_lcd_pwm->set_bri_levels(0.05);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/5, 671/5);
screen.set_size(1920/3, 606/3);
screen.set_visarea_full();
PWM_DISPLAY(config, m_led_pwm).set_size(2, 8);
config.set_default_layout(layout_novag_diamond2);
config.set_default_layout(layout_novag_diamond);
// rs232 (configure after video)
RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
@ -402,13 +468,52 @@ void diamond2_state::diamond2(machine_config &config)
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
void diamond_state::diamond2(machine_config &config)
{
diamond(config);
// basic machine hardware
m_maincpu->set_clock(32_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &diamond_state::diamond2_map);
m_maincpu->read_port2().set_ioport("BATT").invert();
m_maincpu->read_port4().set(FUNC(diamond_state::input2_r));
m_maincpu->write_port4().set(FUNC(diamond_state::p4_w));
m_maincpu->write_port4().append(FUNC(diamond_state::leds_w<1>)).bit(1); // pin swapped with cs_w
// P62 input is forced low (0 = Diamond II, 1 = Sapphire II)
m_maincpu->read_port6().set(FUNC(diamond_state::power_r)).mask(0xfb);
m_maincpu->write_port6().set(FUNC(diamond_state::bank_w));
m_maincpu->write_port6().append(FUNC(diamond_state::cs_w)).bit(3);
m_maincpu->write_port6().append(FUNC(diamond_state::d2_lcd_data_w));
// video hardware
m_lcd_pwm->set_width(16);
screen_device &screen(*subdevice<screen_device>("screen"));
screen.set_size(1920/3, 671/3);
screen.set_visarea_full();
config.set_default_layout(layout_novag_diamond2);
}
/*******************************************************************************
ROM Definitions
*******************************************************************************/
ROM_START( diamond2 ) // ID = DIAMOND II V1.02
ROM_START( diamond ) // ID = DIAMOND 1.01
ROM_REGION16_BE( 0x8000, "maincpu", 0 )
ROM_LOAD("novag_9303-010052_6433258b47p.u6", 0x0000, 0x8000, CRC(cbc544ee) SHA1(43bc09a296f23f23f6a2656a12a9f8d4519fec10) )
ROM_REGION16_BE( 0x8000, "eprom", 0 )
ROM_LOAD("bk301_26601.u4", 0x0000, 0x8000, CRC(648ebe8f) SHA1(2883f962a0bf17426fd809b9f2c01ce3dec0df1b) )
ROM_REGION( 36256, "screen", 0 )
ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) )
ROM_END
ROM_START( diamond2 ) // ID = DIAMOND II 1.02
ROM_REGION16_BE( 0x8000, "maincpu", 0 )
ROM_LOAD("ihp_7600109_hd6433258c67f.u1", 0x0000, 0x8000, CRC(10970123) SHA1(8f72e756915de6569c3936140c775d24730e9065) )
@ -427,5 +532,7 @@ ROM_END
Drivers
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1997, diamond2, 0, 0, diamond2, diamond2, diamond2_state, empty_init, "Novag Industries", "Diamond II", MACHINE_SUPPORTS_SAVE )
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1994, diamond, 0, 0, diamond, diamond, diamond_state, empty_init, "Novag Industries", "Diamond", MACHINE_SUPPORTS_SAVE )
SYST( 1997, diamond2, 0, 0, diamond2, diamond2, diamond_state, empty_init, "Novag Industries", "Diamond II", MACHINE_SUPPORTS_SAVE )

View File

@ -22,6 +22,9 @@ TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
BTANB:
- it still has the same AT level bug as sapphire (see sapphire.cpp)
*******************************************************************************/
#include "emu.h"

View File

@ -17,6 +17,9 @@ TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
BTANB:
- see note below about so-called H8 bug
================================================================================
Saitek GK 2000 family