sbackg: remove driver, merge with ecbackg driver instead

Systems promoted to working
---------------------------
Sensory Backgammon Computer [hap, Sean Riddle]
This commit is contained in:
hap 2024-09-23 20:00:17 +02:00
parent 6c8dff8fb3
commit 10a4b1a6ce
9 changed files with 1003 additions and 287 deletions

View File

@ -428,13 +428,13 @@ void hmcs400_cpu_device::reset_io()
m_d_mask = m_d = 0x000f;
m_write_d(m_d_mask);
for (int i = 0; i < 10; i++)
for (int i = 0; i < 11; i++)
{
// R0-R2 and RA are high-voltage
u8 mask = (i >= 3 && i <= 9) ? 0xf : 0;
m_r_mask[i] = m_r[i] = mask;
m_write_r[i](i, mask);
m_write_r[i](i, mask, 0xf);
}
}
@ -449,7 +449,7 @@ u8 hmcs400_cpu_device::read_r(u8 index)
}
u8 mask = (index == 10) ? 3 : 0xf; // port A is 2-bit
u8 inp = m_read_r[index](index);
u8 inp = m_read_r[index](index, mask);
if (m_read_r[index].isunset())
{
@ -495,7 +495,7 @@ void hmcs400_cpu_device::write_r(u8 index, u8 data)
out = (out & ~pmr_mask) | (m_r_mask[index] & pmr_mask);
}
m_write_r[index](index, out);
m_write_r[index](index, out, 0xf);
}
int hmcs400_cpu_device::read_d(u8 index)

View File

@ -156,8 +156,8 @@ protected:
bool m_standby; // standby mode (SBY opcode)
bool m_stop; // stop mode (STOP opcode)
u8 m_r[10]; // R outputs state
u8 m_r_mask[10];
u8 m_r[11]; // R outputs state
u8 m_r_mask[11];
u16 m_d; // D pins state
u16 m_d_mask;

View File

@ -34,12 +34,12 @@ void hmcs400_cpu_device::pop_stack()
m_ca = BIT(data, 7);
m_st = BIT(data, 15);
}
m_pc = (data & 0x7f00) >> 1 | (data & 0x7f);
m_pc = (~data & 0x7f00) >> 1 | (~data & 0x7f);
}
void hmcs400_cpu_device::push_stack()
{
u16 data = (m_pc << 1 & 0x7f00) | (m_pc & 0x7f) | m_ca << 7 | m_st << 15;
u16 data = (~m_pc << 1 & 0x7f00) | (~m_pc & 0x7f) | m_ca << 7 | m_st << 15;
m_sp = (m_sp | 0x3c0) & 0x3ff;
for (int i = 0; i < 4; i++)

View File

@ -18,8 +18,8 @@ Hardware notes:
- chessboard buttons, 16+4 LEDs, piezo
Royal has 2 LCD panels, Supra has 1 (D12 pin is low), Granada and others have 0.
The LCD panel has 4 7segs and 2 unused segments: an x in the middle, and a white
square under the first digit.
The LCD panel has 4 7segs (no DP) and 2 unused segments: an x in the middle, and
a white square under the first digit.
The 1992 versions by National Telecommunications System Ltd (Granada CXG-347,
Sierra, Seville) have a lower-speed 3.58MHz XTAL, but since none of them have
@ -203,7 +203,8 @@ template<int N>
void royal_state::input_w(u8 data)
{
// R3x,R4x: input mux, LED data
m_inp_mux = (m_inp_mux & ~(0xf << (N*4))) | (data << (N*4));
const u8 shift = 4 * N;
m_inp_mux = (m_inp_mux & ~(0xf << shift)) | (data << shift);
m_led_pwm->write_mx(~m_inp_mux);
}

View File

@ -20,7 +20,7 @@ authors:hap
<element name="triangle">
<image><data><![CDATA[
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="10" height="10">
<path d="M 5,0 10,10 0,10 z" fill="#696663" stroke="none" stroke-width="0" />
<path d="M 5,0 10,10 0,10 z" fill="#000000" stroke="none" stroke-width="0" />
</svg>
]]></data></image>
</element>
@ -39,7 +39,6 @@ authors:hap
<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="cgray"><rect><color red="0.61" green="0.6" blue="0.59" /></rect></element>
<element name="hlbb" defstate="0">
<rect><color alpha="0" /></rect> <!-- force unit square element bounds -->
@ -178,36 +177,36 @@ authors:hap
<element ref="cwhite"><bounds x="0" y="0" width="194" height="157" /></element>
<!-- backdrop -->
<element ref="triangle"><bounds xc="8" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="22" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="36" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="50" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="64" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="78" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="8" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="22" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="36" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="50" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="64" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="78" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="116" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="130" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="144" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="158" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="172" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="186" y="0" width="14.22" height="64" /><orientation rotate="180" /></element>
<element ref="triangle"><bounds xc="116" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="130" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="144" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="158" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="172" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="186" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="8" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="22" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="36" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="50" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="64" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="78" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="8" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="22" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="36" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="50" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="64" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="78" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="116" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="130" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="144" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="158" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="172" y="93" width="14.22" height="64" /></element>
<element ref="triangle"><bounds xc="186" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="116" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="130" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="144" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="158" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="172" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="186" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="cgray"><bounds x="85" y="0" width="3" height="157" /></element>
<element ref="cgray"><bounds x="106" y="0" width="3" height="157" /></element>
<element ref="blackb"><bounds x="85" y="0" width="3" height="157" /><color alpha="0.25" /></element>
<element ref="blackb"><bounds x="106" y="0" width="3" height="157" /><color alpha="0.25" /></element>
<!-- leds -->
<element name="0.4" ref="led"><bounds xc="8" yc="66.5" width="2.25" height="2.25" /></element>
@ -644,22 +643,22 @@ authors:hap
<!-- buttons -->
<element ref="butw" inputtag="IN.4" inputmask="0x01"><bounds x="10" yc="5" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x40"><bounds x="10" yc="10" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.2" inputmask="0x40"><bounds x="10" yc="15" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.2" inputmask="0x04"><bounds x="10" yc="20" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.2" inputmask="0x20"><bounds x="10" yc="25" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x40"><bounds x="10" yc="30" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.2" inputmask="0x08"><bounds x="10" yc="35" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.2" inputmask="0x10"><bounds x="10" yc="40" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.2" inputmask="0x01"><bounds x="10" yc="45" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.2" inputmask="0x02"><bounds x="10" yc="50" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x40"><bounds x="10" yc="55" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x20"><bounds x="10" yc="60" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x10"><bounds x="10" yc="65" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x08"><bounds x="10" yc="70" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x04"><bounds x="10" yc="75" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x02"><bounds x="10" yc="80" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x01"><bounds x="10" yc="85" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x40"><bounds x="10" yc="10" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x40"><bounds x="10" yc="15" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x04"><bounds x="10" yc="20" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x20"><bounds x="10" yc="25" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.2" inputmask="0x40"><bounds x="10" yc="30" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x08"><bounds x="10" yc="35" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x10"><bounds x="10" yc="40" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x01"><bounds x="10" yc="45" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x02"><bounds x="10" yc="50" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x40"><bounds x="10" yc="55" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x20"><bounds x="10" yc="60" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x10"><bounds x="10" yc="65" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x08"><bounds x="10" yc="70" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x04"><bounds x="10" yc="75" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x02"><bounds x="10" yc="80" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.1" inputmask="0x01"><bounds x="10" yc="85" width="8.5" height="1.8" /></element>
</group>

View File

@ -0,0 +1,681 @@
<?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="black2"><rect><color red="0.15" green="0.15" blue="0.15" /></rect></element>
<element name="blackd"><disk><color red="0" green="0" blue="0" /></disk></element>
<element name="lcdm"><rect><color red="0.7" green="0.71" blue="0.72" /></rect></element>
<element name="led" defstate="0">
<disk state="1"><color red="1.0" green="0.1" blue="0.15" /></disk>
<disk state="0"><color red="0.1" green="0.01" blue="0.015" /></disk>
</element>
<element name="triangle">
<image><data><![CDATA[
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="10" height="10">
<path d="M 5,0 10,10 0,10 z" fill="#000000" stroke="none" stroke-width="0" />
</svg>
]]></data></image>
</element>
<element name="text_barw"><text string="BAR"><color red="1" green="1" blue="1" /></text></element>
<element name="text_barb"><text string="BAR"><color red="0" green="0" blue="0" /></text></element>
<repeat count="24">
<param name="i" start="1" increment="1" />
<element name="text_l~i~l"><text string="~i~" align="2"><color red="1" green="1" blue="1" /></text></element>
<element name="text_l~i~r"><text string="~i~" align="1"><color red="0" green="0" blue="0" /></text></element>
</repeat>
<!-- sb board -->
<element name="cblack"><rect><color red="0.25" green="0.65" blue="0.6" /></rect></element>
<element name="cwhite"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
<element name="hlbb" defstate="0">
<rect><color alpha="0" /></rect> <!-- force unit square element bounds -->
<disk state="1">
<bounds xc="0.5" yc="0.5" width="0.76" height="0.76" />
<color red="0" green="0" blue="0" />
</disk>
</element>
<element name="piece" defstate="0">
<rect><color alpha="0" /></rect> <!-- force unit square element bounds -->
<disk state="1">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="1">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<disk state="2">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="2">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<text state="2" string="x2">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.41" green="0.4" blue="0.39" />
</text>
<disk state="3">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="3">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<text state="3" string="x3">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.41" green="0.4" blue="0.39" />
</text>
<disk state="4">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="5">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<text state="5" string="x2">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.81" green="0.8" blue="0.79" />
</text>
<disk state="6">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<text state="6" string="x3">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.81" green="0.8" blue="0.79" />
</text>
</element>
<element name="piece_sel" defstate="0">
<rect><color alpha="0" /></rect> <!-- force unit square element bounds -->
<!-- selected pieces -->
<disk state="7">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="7">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<disk state="8">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="8">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<text state="8" string="x2">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.41" green="0.4" blue="0.39" />
</text>
<disk state="9">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<disk state="9">
<bounds xc="0.5" yc="0.5" width="0.88" height="0.88" />
<color red="1" green="1" blue="1" />
</disk>
<text state="9" string="x3">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.41" green="0.4" blue="0.39" />
</text>
<disk state="10">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" alpha="0.5" />
</disk>
<disk state="11">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<text state="11" string="x2">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.81" green="0.8" blue="0.79" />
</text>
<disk state="12">
<bounds xc="0.5" yc="0.5" width="0.96" height="0.96" />
<color red="0" green="0" blue="0" />
</disk>
<text state="12" string="x3">
<bounds xc="0.5" yc="0.5" width="1" height="0.5" />
<color red="0.81" green="0.8" blue="0.79" />
</text>
</element>
<group name="sb_board">
<bounds x="0" y="0" width="194" height="157" />
<element ref="cblack"><bounds x="0" y="0" width="194" height="157" /></element>
<!-- backdrop -->
<element ref="triangle"><bounds xc="8" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="22" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="36" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="50" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="64" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="78" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="116" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="130" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="144" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="158" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="172" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="186" y="0" width="14.22" height="64" /><orientation rotate="180" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="8" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="22" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="36" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="50" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="64" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="78" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="116" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="130" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="144" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="158" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="triangle"><bounds xc="172" y="93" width="14.22" height="64" /><color alpha="0.5" /></element>
<element ref="triangle"><bounds xc="186" y="93" width="14.22" height="64" /><color alpha="0.25" /></element>
<element ref="blackb"><bounds x="85" y="0" width="3" height="157" /><color alpha="0.25" /></element>
<element ref="blackb"><bounds x="106" y="0" width="3" height="157" /><color alpha="0.25" /></element>
<!-- leds -->
<element name="0.4" ref="led"><bounds xc="8" yc="66.5" width="2.25" height="2.25" /></element>
<element name="1.4" ref="led"><bounds xc="22" yc="66.5" width="2.25" height="2.25" /></element>
<element name="2.4" ref="led"><bounds xc="36" yc="66.5" width="2.25" height="2.25" /></element>
<element name="0.5" ref="led"><bounds xc="50" yc="66.5" width="2.25" height="2.25" /></element>
<element name="1.5" ref="led"><bounds xc="64" yc="66.5" width="2.25" height="2.25" /></element>
<element name="2.5" ref="led"><bounds xc="78" yc="66.5" width="2.25" height="2.25" /></element>
<element name="0.6" ref="led"><bounds xc="116" yc="66.5" width="2.25" height="2.25" /></element>
<element name="1.6" ref="led"><bounds xc="130" yc="66.5" width="2.25" height="2.25" /></element>
<element name="2.6" ref="led"><bounds xc="144" yc="66.5" width="2.25" height="2.25" /></element>
<element name="0.7" ref="led"><bounds xc="158" yc="66.5" width="2.25" height="2.25" /></element>
<element name="1.7" ref="led"><bounds xc="172" yc="66.5" width="2.25" height="2.25" /></element>
<element name="2.7" ref="led"><bounds xc="186" yc="66.5" width="2.25" height="2.25" /></element>
<element name="2.3" ref="led"><bounds xc="8" yc="90.5" width="2.25" height="2.25" /></element>
<element name="1.3" ref="led"><bounds xc="22" yc="90.5" width="2.25" height="2.25" /></element>
<element name="0.3" ref="led"><bounds xc="36" yc="90.5" width="2.25" height="2.25" /></element>
<element name="2.2" ref="led"><bounds xc="50" yc="90.5" width="2.25" height="2.25" /></element>
<element name="1.2" ref="led"><bounds xc="64" yc="90.5" width="2.25" height="2.25" /></element>
<element name="0.2" ref="led"><bounds xc="78" yc="90.5" width="2.25" height="2.25" /></element>
<element name="2.1" ref="led"><bounds xc="116" yc="90.5" width="2.25" height="2.25" /></element>
<element name="1.1" ref="led"><bounds xc="130" yc="90.5" width="2.25" height="2.25" /></element>
<element name="0.1" ref="led"><bounds xc="144" yc="90.5" width="2.25" height="2.25" /></element>
<element name="2.0" ref="led"><bounds xc="158" yc="90.5" width="2.25" height="2.25" /></element>
<element name="1.0" ref="led"><bounds xc="172" yc="90.5" width="2.25" height="2.25" /></element>
<element name="0.0" ref="led"><bounds xc="186" yc="90.5" width="2.25" height="2.25" /></element>
<!-- labels -->
<repeat count="6">
<param name="x" start="2.25" increment="14" />
<param name="i" start="13" increment="1" />
<element ref="text_l~i~l"><bounds x="~x~" yc="66.5" width="4" height="2.5" /><color alpha="0.85" /></element>
</repeat>
<repeat count="6">
<param name="x" start="10.1" increment="14" />
<param name="i" start="24" increment="-1" />
<element ref="text_l~i~r"><bounds x="~x~" yc="66.5" width="4" height="2.5" /><color alpha="0.8" /></element>
</repeat>
<repeat count="6">
<param name="x" start="110.25" increment="14" />
<param name="i" start="19" increment="1" />
<element ref="text_l~i~l"><bounds x="~x~" yc="66.5" width="4" height="2.5" /><color alpha="0.85" /></element>
</repeat>
<repeat count="6">
<param name="x" start="118.1" increment="14" />
<param name="i" start="18" increment="-1" />
<element ref="text_l~i~r"><bounds x="~x~" yc="66.5" width="4" height="2.5" /><color alpha="0.8" /></element>
</repeat>
<repeat count="6">
<param name="x" start="2.25" increment="14" />
<param name="i" start="12" increment="-1" />
<element ref="text_l~i~l"><bounds x="~x~" yc="90.5" width="4" height="2.5" /><color alpha="0.85" /></element>
</repeat>
<repeat count="6">
<param name="x" start="10.1" increment="14" />
<param name="i" start="1" increment="1" />
<element ref="text_l~i~r"><bounds x="~x~" yc="90.5" width="4" height="2.5" /><color alpha="0.8" /></element>
</repeat>
<repeat count="6">
<param name="x" start="110.25" increment="14" />
<param name="i" start="6" increment="-1" />
<element ref="text_l~i~l"><bounds x="~x~" yc="90.5" width="4" height="2.5" /><color alpha="0.85" /></element>
</repeat>
<repeat count="6">
<param name="x" start="118.1" increment="14" />
<param name="i" start="7" increment="1" />
<element ref="text_l~i~r"><bounds x="~x~" yc="90.5" width="4" height="2.5" /><color alpha="0.8" /></element>
</repeat>
<element ref="text_barb"><bounds xc="97" y="13.6" width="3.5" height="12.6" /><color alpha="0.8" /><orientation rotate="270" /></element>
<element ref="text_barw"><bounds xc="97" y="130.8" width="3.5" height="12.6" /><color alpha="0.8" /><orientation rotate="270" /></element>
<!-- lcd (a bit larger than in reality) -->
<element ref="black2"><bounds x="130" yc="78.5" width="42" height="12.06" /></element>
<screen index="0"><bounds x="130.5" yc="78.5" width="41" height="11.06" /></screen>
<element ref="lcdm" blend="multiply"><bounds x="130" yc="78.5" width="42" height="12.06" /></element>
<!-- sensors, pieces -->
<repeat count="5">
<param name="y" start="1" increment="12.6" />
<param name="i" start="10" increment="-1" />
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x001"><bounds xc="8" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x002"><bounds xc="22" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x004"><bounds xc="36" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x008"><bounds xc="50" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x010"><bounds xc="64" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x020"><bounds xc="78" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x040"><bounds xc="116" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x080"><bounds xc="130" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x100"><bounds xc="144" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x200"><bounds xc="158" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x400"><bounds xc="172" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x800"><bounds xc="186" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x1000"><bounds xc="97" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element name="piece_a~i~" ref="piece"><bounds xc="8" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_b~i~" ref="piece"><bounds xc="22" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_c~i~" ref="piece"><bounds xc="36" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_d~i~" ref="piece"><bounds xc="50" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_e~i~" ref="piece"><bounds xc="64" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_f~i~" ref="piece"><bounds xc="78" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_g~i~" ref="piece"><bounds xc="116" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_h~i~" ref="piece"><bounds xc="130" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_i~i~" ref="piece"><bounds xc="144" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_j~i~" ref="piece"><bounds xc="158" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_k~i~" ref="piece"><bounds xc="172" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_l~i~" ref="piece"><bounds xc="186" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_m~i~" ref="piece"><bounds xc="97" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_a~i~" ref="piece_sel"><bounds xc="8" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_b~i~" ref="piece_sel"><bounds xc="22" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_c~i~" ref="piece_sel"><bounds xc="36" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_d~i~" ref="piece_sel"><bounds xc="50" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_e~i~" ref="piece_sel"><bounds xc="64" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_f~i~" ref="piece_sel"><bounds xc="78" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_g~i~" ref="piece_sel"><bounds xc="116" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_h~i~" ref="piece_sel"><bounds xc="130" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_i~i~" ref="piece_sel"><bounds xc="144" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_j~i~" ref="piece_sel"><bounds xc="158" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_k~i~" ref="piece_sel"><bounds xc="172" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_l~i~" ref="piece_sel"><bounds xc="186" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_m~i~" ref="piece_sel"><bounds xc="97" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
</repeat>
<repeat count="5">
<param name="y" start="93" increment="12.6" />
<param name="i" start="5" increment="-1" />
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x001"><bounds xc="8" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x002"><bounds xc="22" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x004"><bounds xc="36" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x008"><bounds xc="50" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x010"><bounds xc="64" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x020"><bounds xc="78" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x040"><bounds xc="116" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x080"><bounds xc="130" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x100"><bounds xc="144" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x200"><bounds xc="158" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x400"><bounds xc="172" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x800"><bounds xc="186" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x1000"><bounds xc="97" y="~y~" width="12.6" height="12.6" /><color alpha="0.04" /></element>
<element name="piece_a~i~" ref="piece"><bounds xc="8" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_b~i~" ref="piece"><bounds xc="22" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_c~i~" ref="piece"><bounds xc="36" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_d~i~" ref="piece"><bounds xc="50" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_e~i~" ref="piece"><bounds xc="64" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_f~i~" ref="piece"><bounds xc="78" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_g~i~" ref="piece"><bounds xc="116" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_h~i~" ref="piece"><bounds xc="130" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_i~i~" ref="piece"><bounds xc="144" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_j~i~" ref="piece"><bounds xc="158" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_k~i~" ref="piece"><bounds xc="172" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_l~i~" ref="piece"><bounds xc="186" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_m~i~" ref="piece"><bounds xc="97" y="~y~" width="12.6" height="12.6" /></element>
<element name="piece_a~i~" ref="piece_sel"><bounds xc="8" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_b~i~" ref="piece_sel"><bounds xc="22" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_c~i~" ref="piece_sel"><bounds xc="36" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_d~i~" ref="piece_sel"><bounds xc="50" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_e~i~" ref="piece_sel"><bounds xc="64" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_f~i~" ref="piece_sel"><bounds xc="78" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_g~i~" ref="piece_sel"><bounds xc="116" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_h~i~" ref="piece_sel"><bounds xc="130" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_i~i~" ref="piece_sel"><bounds xc="144" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_j~i~" ref="piece_sel"><bounds xc="158" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_k~i~" ref="piece_sel"><bounds xc="172" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_l~i~" ref="piece_sel"><bounds xc="186" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></element>
<element name="piece_m~i~" ref="piece_sel"><bounds xc="97" y="~y~" width="12.6" height="12.6" /><color alpha="0.5" /></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_uib2a"><text string="RESET B"><color red="0.01" green="0.01" blue="0.01" /></text></element>
<element name="text_uib2b"><text string="RESET J"><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="62.5" />
<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="61.5" 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="cwhite"><bounds x="1" y="18.5" width="8" height="2.5" /></element>
<element ref="text_uib2a"><bounds x="1.5" y="11.75" width="7" height="2" /></element>
<element ref="text_uib2b"><bounds x="1.5" y="15.25" width="7" height="2" /></element>
<element ref="text_uib3"><bounds x="1.5" y="18.75" width="7" height="2" /></element>
<element ref="hlub" inputtag="BOARD" inputmask="0x01"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="BOARD" inputmask="0x02"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x100"><bounds x="1" y="18.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- spawn -->
<element ref="text_uis1"><bounds x="0" y="24" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="26.5" width="8" height="4" /></element>
<element name="piece_ui1" ref="piece"><bounds xc="3" yc="28.5" width="3.2" height="3.2" /></element>
<element name="piece_ui2" ref="blackd"><bounds xc="7" yc="28.5" width="3.072" height="3.072" /></element> <!-- not ref="piece" -->
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0001"><bounds x="1" y="26.5" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:SPAWN" inputmask="0x0002"><bounds x="5" y="26.5" width="4" height="4" /><color alpha="0.25" /></element>
<!-- hand -->
<element ref="text_uih1"><bounds x="0" y="33.5" width="10" height="2" /></element>
<element ref="cblack"><bounds x="1" y="36" width="8" height="6" /></element>
<element name="piece_ui0" ref="piece"><bounds xc="5" yc="39" width="4.8" height="4.8" /></element>
<element ref="cwhite"><bounds x="1" y="43" width="8" height="2.5" /></element>
<element ref="text_uih2"><bounds x="1.5" y="43.25" width="7" height="2" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x08"><bounds x="1" y="43" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- undo -->
<element ref="text_uiu1"><bounds x="0" y="48.5" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="51" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="3.1" y="51" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="5.2" y="51" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="7.3" y="51" width="1.7" height="6" /></element>
<element ref="text_uiu2a"><bounds x="1" y="52" width="1.7" height="4" /></element>
<element ref="text_uiu2b"><bounds x="3.1" y="52" width="1.7" height="4" /></element>
<element ref="text_uiu2c"><bounds x="5.2" y="52" width="1.7" height="4" /></element>
<element ref="text_uiu2d"><bounds x="7.3" y="52" width="1.7" height="4" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x10"><bounds x="1" y="51" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x20"><bounds x="3.1" y="51" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x40"><bounds x="5.2" y="51" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="board:UI" inputmask="0x80"><bounds x="7.3" y="51" width="1.7" height="6" /><color alpha="0.25" /></element>
<element name="count_ui0" ref="text_uiu3a"><bounds x="0" y="57.5" width="4" height="2" /></element>
<element name="count_ui1" ref="text_uiu3c"><bounds x="6" y="57.5" width="4" height="2" /></element>
<element ref="text_uiu3b"><bounds x="4" y="57.5" width="2" height="2" /></element>
</group>
<!-- buttons -->
<element name="butw" defstate="0">
<rect state="0"><color red="0.81" green="0.8" blue="0.79" /></rect>
<rect state="1"><color red="0.81" green="0.8" blue="0.79" alpha="0.75" /></rect>
</element>
<element name="butb" defstate="0">
<rect state="0"><color red="0.17" green="0.17" blue="0.17" /></rect>
<rect state="1"><color red="0.3" green="0.3" blue="0.3" /></rect>
</element>
<element name="butg" defstate="0">
<rect state="0"><color red="0.25" green="0.65" blue="0.6" /></rect>
<rect state="1"><color red="0.25" green="0.65" blue="0.6" alpha="0.75" /></rect>
</element>
<element name="text_b1a"><text string="NEW" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b1b"><text string="GAME" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b2"><text string="SET UP" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b3"><text string="VERIFY" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b4"><text string="PLAY" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b5a"><text string="TAKE" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b5b"><text string="BACK" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b6a"><text string="BEAR" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b6b"><text string="OFF" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b7a"><text string="GAME" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b7b"><text string="OPTION" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b8"><text string="LEVEL" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b9a"><text string="DOUBLE/" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b9b"><text string="ACCEPT" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b10"><text string="REJECT" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b11a"><text string="ROLL" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_b11b"><text string="DICE" align="2"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="dice_17">
<rect>
<bounds x="0" y="0" width="7" height="7" />
<color alpha="0" />
</rect>
<disk>
<bounds x="1" y="1" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
<disk>
<bounds x="5" y="5" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
</element>
<element name="dice_26">
<rect>
<bounds x="0" y="0" width="7" height="7" />
<color alpha="0" />
</rect>
<disk>
<bounds x="5" y="1" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
<disk>
<bounds x="1" y="5" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
</element>
<element name="dice_35">
<rect>
<bounds x="0" y="0" width="7" height="7" />
<color alpha="0" />
</rect>
<disk>
<bounds x="1" y="3" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
<disk>
<bounds x="5" y="3" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
</element>
<element name="dice_4">
<rect>
<bounds x="0" y="0" width="7" height="7" />
<color alpha="0" />
</rect>
<disk>
<bounds x="3" y="3" width="1" height="1" />
<color red="0.05" green="0.05" blue="0.05" />
</disk>
</element>
<group name="buttons">
<bounds x="0" y="0" width="20" height="90" />
<!-- labels -->
<element ref="text_b1a"><bounds x="0" yc="4.15" width="8.5" height="1.8" /></element>
<element ref="text_b1b"><bounds x="0" yc="5.85" width="8.5" height="1.8" /></element>
<element ref="text_b2"><bounds x="0" yc="10" width="8.5" height="1.8" /></element>
<element ref="text_b3"><bounds x="0" yc="15" width="8.5" height="1.8" /></element>
<element ref="text_b4"><bounds x="0" yc="20" width="8.5" height="1.8" /></element>
<element ref="text_b5a"><bounds x="0" yc="24.15" width="8.5" height="1.8" /></element>
<element ref="text_b5b"><bounds x="0" yc="25.85" width="8.5" height="1.8" /></element>
<element ref="text_b6a"><bounds x="0" yc="29.15" width="8.5" height="1.8" /></element>
<element ref="text_b6b"><bounds x="0" yc="30.85" width="8.5" height="1.8" /></element>
<element ref="text_b7a"><bounds x="0" yc="34.15" width="8.5" height="1.8" /></element>
<element ref="text_b7b"><bounds x="0" yc="35.85" width="8.5" height="1.8" /></element>
<element ref="text_b8"><bounds x="0" yc="40" width="8.5" height="1.8" /></element>
<element ref="text_b9a"><bounds x="0" yc="44.15" width="8.5" height="1.8" /></element>
<element ref="text_b9b"><bounds x="0" yc="45.85" width="8.5" height="1.8" /></element>
<element ref="text_b10"><bounds x="0" yc="50" width="8.5" height="1.8" /></element>
<element ref="text_b11a"><bounds x="0" yc="84.15" width="8.5" height="1.8" /></element>
<element ref="text_b11b"><bounds x="0" yc="85.85" width="8.5" height="1.8" /></element>
<!-- dice icons -->
<element ref="cwhite"> <bounds x="4.75" yc="55" width="3.5" height="3.5" /></element>
<element ref="dice_17"><bounds x="4.75" yc="55" width="3.5" height="3.5" /></element>
<element ref="dice_26"><bounds x="4.75" yc="55" width="3.5" height="3.5" /></element>
<element ref="dice_35"><bounds x="4.75" yc="55" width="3.5" height="3.5" /></element>
<element ref="cwhite"> <bounds x="4.75" yc="60" width="3.5" height="3.5" /></element>
<element ref="dice_17"><bounds x="4.75" yc="60" width="3.5" height="3.5" /></element>
<element ref="dice_26"><bounds x="4.75" yc="60" width="3.5" height="3.5" /></element>
<element ref="dice_4"> <bounds x="4.75" yc="60" width="3.5" height="3.5" /></element>
<element ref="cwhite"> <bounds x="4.75" yc="65" width="3.5" height="3.5" /></element>
<element ref="dice_17"><bounds x="4.75" yc="65" width="3.5" height="3.5" /></element>
<element ref="dice_26"><bounds x="4.75" yc="65" width="3.5" height="3.5" /></element>
<element ref="cwhite"> <bounds x="4.75" yc="70" width="3.5" height="3.5" /></element>
<element ref="dice_26"><bounds x="4.75" yc="70" width="3.5" height="3.5" /></element>
<element ref="dice_4"> <bounds x="4.75" yc="70" width="3.5" height="3.5" /></element>
<element ref="cwhite"> <bounds x="4.75" yc="75" width="3.5" height="3.5" /></element>
<element ref="dice_26"><bounds x="4.75" yc="75" width="3.5" height="3.5" /></element>
<element ref="cwhite"> <bounds x="4.75" yc="80" width="3.5" height="3.5" /></element>
<element ref="dice_4"> <bounds x="4.75" yc="80" width="3.5" height="3.5" /></element>
<!-- buttons -->
<element ref="butw" inputtag="IN.4" inputmask="0x01"><bounds x="10" yc="5" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.3" inputmask="0x40"><bounds x="10" yc="10" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x40"><bounds x="10" yc="15" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x04"><bounds x="10" yc="20" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.0" inputmask="0x20"><bounds x="10" yc="25" width="8.5" height="1.8" /></element>
<element ref="butw" inputtag="IN.2" inputmask="0x40"><bounds x="10" yc="30" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x08"><bounds x="10" yc="35" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x10"><bounds x="10" yc="40" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x01"><bounds x="10" yc="45" width="8.5" height="1.8" /></element>
<element ref="butb" inputtag="IN.0" inputmask="0x02"><bounds x="10" yc="50" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x40"><bounds x="10" yc="55" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x20"><bounds x="10" yc="60" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x10"><bounds x="10" yc="65" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x08"><bounds x="10" yc="70" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x04"><bounds x="10" yc="75" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x02"><bounds x="10" yc="80" width="8.5" height="1.8" /></element>
<element ref="butg" inputtag="IN.1" inputmask="0x01"><bounds x="10" yc="85" width="8.5" height="1.8" /></element>
</group>
<!-- build screen -->
<view name="Internal Layout">
<bounds left="-24.12" right="221.5" top="-2" bottom="159" />
<group ref="sb_board"><bounds x="0" y="0" width="194" height="157" /></group>
<!-- cut edges -->
<element ref="blackb"><bounds x="-1" y="-1" width="2" height="159" /></element>
<element ref="blackb"><bounds x="193" y="-1" width="2" height="159" /></element>
<element ref="blackb"><bounds x="-1" y="-1" width="196" height="2" /></element>
<element ref="blackb"><bounds x="-1" y="156" width="196" height="2" /></element>
<group ref="sb_ui"><bounds x="-21.12" yc="78.5" width="19.375" height="121.094" /></group>
<group ref="buttons"><bounds x="193" yc="78.5" width="27" height="121.5" /></group>
</view>
</mamelayout>

View File

@ -38941,6 +38941,7 @@ ccdelta1
@source:saitek/ecbackg.cpp
ecbackg
sbackgc
@source:saitek/edames.cpp
edames
@ -38985,9 +38986,6 @@ montreux
risc2500
risc2500a
@source:saitek/sbackg.cpp
sbackg
@source:saitek/schess.cpp
schess

View File

@ -3,13 +3,15 @@
// thanks-to:Sean Riddle
/*******************************************************************************
Saitek Electronic Champion Backgammon
Saitek Sensory Backgammon Computer / Electronic Champion Backgammon
NOTE: Before exiting MAME, change the power switch from GO to STOP. Otherwise,
NVRAM won't save properly.
This program got 3rd place in the first Computer Olympiad in 1989 (backgammon
category). It also includes several game variations like Jacquet or Trictrac.
These were supposedly programmed by Eric van Riet Paap (not sure about Sensory,
but pretty certain about Champion). The Champion program got 3rd place in the
first Computer Olympiad in 1989 (backgammon category). It also includes several
game variations like Jacquet or Trictrac.
MAME's sensorboard interface is a bit different compared to chess. Pieces can be
stacked up to 3. Pressing the Bear Off button (Del / Backspace) will optionally
@ -17,18 +19,30 @@ remove the currently held piece. Capturing pieces is disabled, except when hitti
a blot, in which case the piece in hand is swapped with the one on the board.
Hardware notes:
- PCB label: GT4-PE-009
- Hitachi HD6301Y0P @ ~4MHz (LC osc, no XTAL)
Sensory Backgammon Computer (model 680):
- PCB label: GT2-PE-018
- Hitachi HD614085S @ ~5MHz (LC osc, no XTAL)
- LCD with custom segments
- 24 LEDs, 13*2 buttons sensor board, piezo
Electronic Champion Backgammon (model 681):
- PCB label: GT4-PE-009
- Hitachi HD6301Y0P @ ~4MHz (LC osc, no XTAL)
- rest is same as Sensory Backgammon Computer
There's also model 082, it looks nearly identical to model 680, but hardware is
unknown. Handheld Champion Backgammon (model 682) has a HD6301Y0F.
TODO:
- is Sensory Backgammon Computer model 082 on a different MCU?
- if/when MAME supports an exit callback, hook up power-off switch to that
*******************************************************************************/
#include "emu.h"
#include "cpu/hmcs400/hmcs400.h"
#include "cpu/m6800/m6801.h"
#include "machine/sensorboard.h"
#include "sound/dac.h"
@ -39,16 +53,18 @@ TODO:
// internal artwork
#include "saitek_ecbackg.lh"
#include "saitek_sbackgc.lh"
namespace {
class ecbackg_state : public driver_device
// shared base class
class sbackgc_base_state : public driver_device
{
public:
ecbackg_state(const machine_config &mconfig, device_type type, const char *tag) :
sbackgc_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_board(*this, "board"),
m_led_pwm(*this, "led_pwm"),
m_lcd_pwm(*this, "lcd_pwm"),
@ -57,7 +73,7 @@ public:
m_out_lcd(*this, "s%u.%u", 0U, 0U)
{ }
void ecbackg(machine_config &config);
void shared(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(init_board);
DECLARE_INPUT_CHANGED_MEMBER(bear_off);
@ -67,9 +83,7 @@ protected:
virtual void machine_start() override;
virtual void machine_reset() override { m_power = true; }
private:
// devices/pointers
required_device<hd6301y0_cpu_device> m_maincpu;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_led_pwm;
required_device<pwm_display_device> m_lcd_pwm;
@ -79,10 +93,11 @@ private:
bool m_power = false;
u8 m_inp_mux = 0;
u8 m_led_data = 0;
u32 m_lcd_segs = 0;
u8 m_lcd_com = 0;
// I/O handlers
// sensorboard handlers
void init_backgammon();
void init_jacquet();
void init_plakoto();
@ -92,37 +107,80 @@ private:
u8 board_sensor_cb(offs_t offset);
u8 board_r(u8 row);
void standby(int state);
// shared I/O handlers (just the LCD)
void clear_display();
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
template <int N> void lcd_segs_w(u8 data);
template <int N> void lcd_segs_w(offs_t offset, u8 data, u8 mem_mask);
void lcd_com_w(u8 data);
u8 p2_r();
void p2_w(u8 data);
u8 p5_r();
void p6_w(u8 data);
};
void ecbackg_state::machine_start()
void sbackgc_base_state::machine_start()
{
m_out_lcd.resolve();
// register for savestates
save_item(NAME(m_power));
save_item(NAME(m_led_data));
save_item(NAME(m_inp_mux));
save_item(NAME(m_lcd_segs));
save_item(NAME(m_lcd_com));
}
// Sensory Backgammon Computer
class sbackgc_state : public sbackgc_base_state
{
public:
sbackgc_state(const machine_config &mconfig, device_type type, const char *tag) :
sbackgc_base_state(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
void sbackgc(machine_config &config);
private:
required_device<hmcs400_cpu_device> m_maincpu;
// I/O handlers
template <int N> void leds_w(u8 data);
u8 buttons_r();
u8 input1_r();
u16 input2_r();
void control_w(u16 data);
};
// Electronic Champion Backgammon
class ecbackg_state : public sbackgc_base_state
{
public:
ecbackg_state(const machine_config &mconfig, device_type type, const char *tag) :
sbackgc_base_state(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
void ecbackg(machine_config &config);
private:
required_device<hd6301y0_cpu_device> m_maincpu;
// I/O handlers
u8 p2_r();
void p2_w(u8 data);
u8 p5_r();
void p6_w(u8 data);
};
/*******************************************************************************
Sensorboard
*******************************************************************************/
void ecbackg_state::init_backgammon()
void sbackgc_base_state::init_backgammon()
{
// initial position for Backgammon (default)
for (int i = 0; i < 5; i++)
@ -146,7 +204,7 @@ void ecbackg_state::init_backgammon()
}
}
void ecbackg_state::init_jacquet()
void sbackgc_base_state::init_jacquet()
{
// initial position for Jacquet / Trictrac / Moultezim
for (int i = 0; i < 5; i++)
@ -156,7 +214,7 @@ void ecbackg_state::init_jacquet()
}
}
void ecbackg_state::init_plakoto()
void sbackgc_base_state::init_plakoto()
{
// initial position for Plakoto
for (int i = 0; i < 5; i++)
@ -166,7 +224,7 @@ void ecbackg_state::init_plakoto()
}
}
INPUT_CHANGED_MEMBER(ecbackg_state::init_board)
INPUT_CHANGED_MEMBER(sbackgc_base_state::init_board)
{
if (!newval)
return;
@ -197,18 +255,18 @@ INPUT_CHANGED_MEMBER(ecbackg_state::init_board)
m_board->refresh();
}
void ecbackg_state::board_init_cb(u8 data)
void sbackgc_base_state::board_init_cb(u8 data)
{
if (~data & 1)
init_backgammon();
}
u8 ecbackg_state::board_spawn_cb(offs_t offset)
u8 sbackgc_base_state::board_spawn_cb(offs_t offset)
{
return (offset == 1) ? 1 : 4;
}
INPUT_CHANGED_MEMBER(ecbackg_state::bear_off)
INPUT_CHANGED_MEMBER(sbackgc_base_state::bear_off)
{
if (newval && m_inputs[5]->read() & 1)
{
@ -218,7 +276,7 @@ INPUT_CHANGED_MEMBER(ecbackg_state::bear_off)
}
}
u8 ecbackg_state::board_remove_cb()
u8 sbackgc_base_state::board_remove_cb()
{
int handpos = m_board->get_handpos();
@ -241,7 +299,7 @@ u8 ecbackg_state::board_remove_cb()
return 1;
}
u8 ecbackg_state::board_sensor_cb(offs_t offset)
u8 sbackgc_base_state::board_sensor_cb(offs_t offset)
{
u8 x = offset & 0xf;
u8 y = offset >> 4 & 0xf;
@ -303,17 +361,17 @@ u8 ecbackg_state::board_sensor_cb(offs_t offset)
return 3;
}
u8 ecbackg_state::board_r(u8 row)
u8 sbackgc_base_state::board_r(u8 row)
{
u8 data = 0;
// inputs to sensorboard translation table (0xff is invalid)
static const u8 lut_board[4*7] =
{
0xff, 0x1b, 0x19, 0x17, 0x07, 0x09, 0x0b,
0x0c, 0x1a, 0x18, 0x16, 0x06, 0x08, 0x0a,
0x1c, 0x15, 0x13, 0x11, 0x01, 0x03, 0x05,
0xff, 0x14, 0x12, 0x10, 0x00, 0x02, 0x04
0x0c, 0x1a, 0x18, 0x16, 0x06, 0x08, 0x0a,
0x1c, 0x15, 0x13, 0x11, 0x01, 0x03, 0x05,
0xff, 0x14, 0x12, 0x10, 0x00, 0x02, 0x04,
0xff, 0x1b, 0x19, 0x17, 0x07, 0x09, 0x0b
};
for (int i = 0; i < 7; i++)
@ -341,12 +399,18 @@ u8 ecbackg_state::board_r(u8 row)
// LCD
void ecbackg_state::lcd_pwm_w(offs_t offset, u8 data)
void sbackgc_base_state::clear_display()
{
m_lcd_pwm->clear();
m_led_pwm->clear();
}
void sbackgc_base_state::lcd_pwm_w(offs_t offset, u8 data)
{
m_out_lcd[offset & 0x3f][offset >> 6] = data;
}
void ecbackg_state::update_lcd()
void sbackgc_base_state::update_lcd()
{
for (int i = 0; i < 2; i++)
{
@ -358,34 +422,89 @@ void ecbackg_state::update_lcd()
}
template <int N>
void ecbackg_state::lcd_segs_w(u8 data)
void sbackgc_base_state::lcd_segs_w(offs_t offset, u8 data, u8 mem_mask)
{
// P1x, P3x, P4x: LCD segments
const u8 shift = 8 * N;
m_lcd_segs = (m_lcd_segs & ~(0xff << shift)) | (data << shift);
if (mem_mask == 0)
return;
// R3x-R8x: LCD segments (P1x,P3x,P4x on ecbackg)
const u8 width = 32 - count_leading_zeros_32(mem_mask);
const u8 mask = (1 << width) - 1;
const u8 shift = width * N;
m_lcd_segs = (m_lcd_segs & ~(mask << shift)) | ((data & mask) << shift);
update_lcd();
}
void ecbackg_state::lcd_com_w(u8 data)
void sbackgc_base_state::lcd_com_w(u8 data)
{
// P70-P73: LCD common
// R00-R03: LCD common (P70-P73 on ecbackg)
m_lcd_com = data & 0xf;
update_lcd();
}
// misc
// sbackgc-specific
void ecbackg_state::standby(int state)
template <int N>
void sbackgc_state::leds_w(u8 data)
{
// clear display
if (state)
{
m_lcd_pwm->clear();
m_led_pwm->clear();
}
// R1x,R2x: LED data
const u8 shift = 4 * N;
m_led_data = (m_led_data & ~(0xf << shift)) | (data << shift);
m_led_pwm->write_mx(m_led_data);
}
u8 sbackgc_state::buttons_r()
{
u8 data = 0;
for (int i = 0; i < 4; i++)
if (m_inp_mux & m_inputs[i]->read())
data |= 1 << i;
return data;
}
u8 sbackgc_state::input1_r()
{
// R90-R93: multiplexed inputs
// read buttons (high)
u8 data = buttons_r() & 0xc;
// read board
for (int i = 0; i < 4; i++)
if (m_inp_mux & board_r(i))
data |= 1 << i;
return ~data;
}
u16 sbackgc_state::input2_r()
{
// D11,D12: read buttons (low)
u16 data = ~buttons_r() << 11 & 0x1800;
// D13: power switch state
// D15: freq sel (3MHz or 5MHz)
return data | (m_power ? 0x2000 : 0) | 0x800f;
}
void sbackgc_state::control_w(u16 data)
{
// D0-D2: LED select
m_led_pwm->write_my(~data & 7);
// D4-D10: input mux
m_inp_mux = ~data >> 4 & 0x7f;
// D14: speaker out
m_dac->write(BIT(data, 14));
}
// ecbackg-specific
u8 ecbackg_state::p2_r()
{
// P27: power switch state
@ -398,7 +517,7 @@ u8 ecbackg_state::p2_r()
void ecbackg_state::p2_w(u8 data)
{
// P20-P22: led select
// P20-P22: LED select
m_led_pwm->write_my(data & 7);
// P23: speaker out
@ -412,12 +531,12 @@ u8 ecbackg_state::p5_r()
// read buttons
for (int i = 0; i < 5; i++)
if (BIT(bitswap<5>(m_inp_mux,6,5,4,3,0), i))
if (BIT(bitswap<5>(m_inp_mux,6,0,3,5,4), i))
data |= m_inputs[i]->read();
// read board
for (int i = 0; i < 4; i++)
if (BIT(m_inp_mux, i))
if (BIT(bitswap<4>(m_inp_mux,0,3,2,1), i))
data |= board_r(i);
return ~data;
@ -425,7 +544,7 @@ u8 ecbackg_state::p5_r()
void ecbackg_state::p6_w(u8 data)
{
// P60-P67: input mux, led data
// P60-P67: input mux, LED data
m_inp_mux = ~data;
m_led_pwm->write_mx(~data);
}
@ -436,14 +555,8 @@ void ecbackg_state::p6_w(u8 data)
Input Ports
*******************************************************************************/
static INPUT_PORTS_START( ecbackg )
static INPUT_PORTS_START( sbackgc )
PORT_START("IN.0")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Statistics")
PORT_START("IN.1")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, bear_off, 0) PORT_NAME("Bear Off")
PORT_START("IN.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_A) PORT_NAME("Double / Accept")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Reject")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play")
@ -452,7 +565,7 @@ static INPUT_PORTS_START( ecbackg )
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Verify")
PORT_START("IN.3")
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Roll Dice")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Dice 1")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Dice 2")
@ -461,6 +574,12 @@ static INPUT_PORTS_START( ecbackg )
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Dice 5")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Dice 6")
PORT_START("IN.2")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, sbackgc_base_state, bear_off, 0) PORT_NAME("Bear Off")
PORT_START("IN.3")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set Up")
PORT_START("IN.4")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game")
@ -470,12 +589,21 @@ static INPUT_PORTS_START( ecbackg )
PORT_CONFSETTING( 0x01, DEF_STR( Yes ) )
PORT_START("POWER") // needs to be triggered for nvram to work
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, power_off, 0) PORT_NAME("Stop")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, sbackgc_base_state, power_off, 0) PORT_NAME("Stop")
PORT_START("BOARD")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, init_board, 0) PORT_NAME("Board Reset Backgammon")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, init_board, 1) PORT_NAME("Board Reset Jacquet")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, ecbackg_state, init_board, 2) PORT_NAME("Board Reset Plakoto")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, sbackgc_base_state, init_board, 0) PORT_NAME("Board Reset Backgammon")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, sbackgc_base_state, init_board, 1) PORT_NAME("Board Reset Jacquet")
INPUT_PORTS_END
static INPUT_PORTS_START( ecbackg )
PORT_INCLUDE( sbackgc )
PORT_MODIFY("IN.3")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Statistics")
PORT_MODIFY("BOARD")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, sbackgc_base_state, init_board, 2) PORT_NAME("Board Reset Plakoto")
INPUT_PORTS_END
@ -484,13 +612,72 @@ INPUT_PORTS_END
Machine Configs
*******************************************************************************/
void sbackgc_base_state::shared(machine_config &config)
{
// basic machine hardware
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(FUNC(sbackgc_base_state::board_init_cb));
m_board->spawn_cb().set(FUNC(sbackgc_base_state::board_spawn_cb));
m_board->remove_cb().set(FUNC(sbackgc_base_state::board_remove_cb));
m_board->sensor_cb().set(FUNC(sbackgc_base_state::board_sensor_cb));
m_board->set_size(13, 10);
m_board->set_spawnpoints(2);
m_board->set_max_id(6);
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram_enable(true);
// video hardware
PWM_DISPLAY(config, m_lcd_pwm).set_size(2, 24);
m_lcd_pwm->output_x().set(FUNC(sbackgc_base_state::lcd_pwm_w));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/5, 518/5);
screen.set_visarea_full();
PWM_DISPLAY(config, m_led_pwm).set_size(3, 8);
// sound hardware
SPEAKER(config, "speaker").front_center();
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
void sbackgc_state::sbackgc(machine_config &config)
{
shared(config);
// basic machine hardware
HD614085(config, m_maincpu, 5'000'000); // approximation, no XTAL
m_maincpu->nvram_enable_backup(true);
m_maincpu->stop_cb().set(m_maincpu, FUNC(hmcs400_cpu_device::nvram_set_battery));
m_maincpu->stop_cb().append([this](int state) { if (state) clear_display(); });
m_maincpu->write_r<0>().set(FUNC(sbackgc_state::lcd_com_w));
m_maincpu->write_r<1>().set(FUNC(sbackgc_state::leds_w<0>));
m_maincpu->write_r<2>().set(FUNC(sbackgc_state::leds_w<1>));
m_maincpu->write_r<3>().set(FUNC(sbackgc_state::lcd_segs_w<0>));
m_maincpu->write_r<4>().set(FUNC(sbackgc_state::lcd_segs_w<1>));
m_maincpu->write_r<5>().set(FUNC(sbackgc_state::lcd_segs_w<2>));
m_maincpu->write_r<6>().set(FUNC(sbackgc_state::lcd_segs_w<3>));
m_maincpu->write_r<7>().set(FUNC(sbackgc_state::lcd_segs_w<4>));
m_maincpu->write_r<8>().set(FUNC(sbackgc_state::lcd_segs_w<5>));
m_maincpu->read_r<9>().set(FUNC(sbackgc_state::input1_r));
m_maincpu->read_r<10>().set_ioport("IN.4").exor(1);
m_maincpu->write_d().set(FUNC(sbackgc_state::control_w));
m_maincpu->read_d().set(FUNC(sbackgc_state::input2_r));
m_lcd_pwm->set_bri_levels(0.05);
config.set_default_layout(layout_saitek_sbackgc);
}
void ecbackg_state::ecbackg(machine_config &config)
{
shared(config);
// basic machine hardware
HD6301Y0(config, m_maincpu, 4'000'000); // approximation, no XTAL
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(hd6301y0_cpu_device::nvram_set_battery));
m_maincpu->standby_cb().append(FUNC(ecbackg_state::standby));
m_maincpu->standby_cb().append([this](int state) { if (state) clear_display(); });
m_maincpu->out_p1_cb().set(FUNC(ecbackg_state::lcd_segs_w<0>));
m_maincpu->in_p2_cb().set(FUNC(ecbackg_state::p2_r));
m_maincpu->out_p2_cb().set(FUNC(ecbackg_state::p2_w));
@ -500,32 +687,7 @@ void ecbackg_state::ecbackg(machine_config &config)
m_maincpu->out_p6_cb().set(FUNC(ecbackg_state::p6_w));
m_maincpu->out_p7_cb().set(FUNC(ecbackg_state::lcd_com_w));
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(FUNC(ecbackg_state::board_init_cb));
m_board->spawn_cb().set(FUNC(ecbackg_state::board_spawn_cb));
m_board->remove_cb().set(FUNC(ecbackg_state::board_remove_cb));
m_board->sensor_cb().set(FUNC(ecbackg_state::board_sensor_cb));
m_board->set_size(13, 10);
m_board->set_spawnpoints(2);
m_board->set_max_id(6);
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram_enable(true);
// video hardware
PWM_DISPLAY(config, m_lcd_pwm).set_size(2, 24);
m_lcd_pwm->output_x().set(FUNC(ecbackg_state::lcd_pwm_w));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/5, 518/5);
screen.set_visarea_full();
PWM_DISPLAY(config, m_led_pwm).set_size(3, 8);
config.set_default_layout(layout_saitek_ecbackg);
// sound hardware
SPEAKER(config, "speaker").front_center();
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
@ -534,12 +696,20 @@ void ecbackg_state::ecbackg(machine_config &config)
ROM Definitions
*******************************************************************************/
ROM_START( sbackgc )
ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD("1988_gx2_saitek_614085sc72.u1", 0x0000, 0x4000, CRC(0e91d7a1) SHA1(fa147105fa99d01210b53389b8b70031cff6ad66) )
ROM_REGION( 109526, "screen", 0 )
ROM_LOAD("sbackgc.svg", 0, 109526, CRC(183b12fb) SHA1(5a3682d6ff28086c2ab890eee1403c8c3d7d8527) )
ROM_END
ROM_START( ecbackg )
ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD("saitek_89_gx4b_c12_31y0rm79p.u1", 0x0000, 0x4000, CRC(d7278545) SHA1(9ece31cdb237067aeec480c066e0917752697a4d) )
ROM_REGION( 109526, "screen", 0 )
ROM_LOAD("sbackg.svg", 0, 109526, CRC(b8149d74) SHA1(0cc6f1a2c50f53f8d2be73379019d275799d0546) )
ROM_LOAD("ecbackg.svg", 0, 109526, CRC(b8149d74) SHA1(0cc6f1a2c50f53f8d2be73379019d275799d0546) )
ROM_END
} // anonymous namespace
@ -551,4 +721,6 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1988, sbackgc, 0, 0, sbackgc, sbackgc, sbackgc_state, empty_init, "Saitek", "Sensory Backgammon Computer", MACHINE_SUPPORTS_SAVE )
SYST( 1989, ecbackg, 0, 0, ecbackg, ecbackg, ecbackg_state, empty_init, "Saitek", "Electronic Champion Backgammon", MACHINE_SUPPORTS_SAVE )

View File

@ -1,135 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:hap
// thanks-to:Sean Riddle
/*******************************************************************************
Saitek Sensory Backgammon
TODO:
- skeleton driver
Hardware notes:
- x
*******************************************************************************/
#include "emu.h"
#include "cpu/hmcs400/hmcs400.h"
#include "machine/sensorboard.h"
#include "sound/dac.h"
#include "video/pwm.h"
#include "screen.h"
#include "speaker.h"
// internal artwork
//#include "saitek_sbackg.lh"
namespace {
class sbackg_state : public driver_device
{
public:
sbackg_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_board(*this, "board"),
m_led_pwm(*this, "led_pwm"),
m_lcd_pwm(*this, "lcd_pwm"),
m_dac(*this, "dac"),
m_inputs(*this, "IN.%u", 0)
{ }
void sbackg(machine_config &config);
void granada(machine_config &config);
void supra(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(granada_change_cpu_freq);
protected:
virtual void machine_start() override;
private:
// devices/pointers
required_device<hmcs400_cpu_device> m_maincpu;
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_ioport_array<1> m_inputs;
};
void sbackg_state::machine_start()
{
}
/*******************************************************************************
Input Ports
*******************************************************************************/
static INPUT_PORTS_START( sbackg )
PORT_START("IN.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8)
INPUT_PORTS_END
/*******************************************************************************
Machine Configs
*******************************************************************************/
void sbackg_state::sbackg(machine_config &config)
{
// basic machine hardware
HD614085(config, m_maincpu, 5'000'000); // approximation, no XTAL
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->set_delay(attotime::from_msec(150));
//m_board->set_nvram_enable(true);
// video hardware
PWM_DISPLAY(config, m_lcd_pwm).set_size(2, 24);
PWM_DISPLAY(config, m_led_pwm).set_size(6, 8);
//config.set_default_layout(layout_saitek_sbackg);
// sound hardware
SPEAKER(config, "speaker").front_center();
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
/*******************************************************************************
ROM Definitions
*******************************************************************************/
ROM_START( sbackg )
ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD("1988_gx2_saitek_614085sc72.u1", 0x0000, 0x4000, CRC(0e91d7a1) SHA1(fa147105fa99d01210b53389b8b70031cff6ad66) )
ROM_REGION( 109526, "screen", 0 )
ROM_LOAD("sbackg.svg", 0, 109526, CRC(b8149d74) SHA1(0cc6f1a2c50f53f8d2be73379019d275799d0546) )
ROM_END
} // anonymous namespace
/*******************************************************************************
Drivers
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1988, sbackg, 0, 0, sbackg, sbackg, sbackg_state, empty_init, "Saitek", "Sensory Backgammon", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )