chesstrv: add chesspieces (nw)

This commit is contained in:
hap 2019-06-28 22:43:40 +02:00
parent 6fb3031995
commit 4989fc4fbf
4 changed files with 510 additions and 68 deletions

View File

@ -58,7 +58,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char
// set defaults for most common use case (aka chess)
set_size(8, 8);
set_spawnpoints(12);
m_sensordelay = attotime::from_msec(75);
set_delay(attotime::from_msec(75));
}
@ -184,6 +184,20 @@ void sensorboard_device::device_reset()
// public handlers
//-------------------------------------------------
sensorboard_device &sensorboard_device::set_type(sb_type type)
{
m_inductive = (type == INDUCTIVE);
m_magnets = (type == MAGNETS) || m_inductive;
if (type == NOSENSORS)
{
set_mod_enable(false);
set_delay(attotime::never);
}
return *this;
}
u8 sensorboard_device::read_sensor(u8 x, u8 y)
{
if (x >= m_width || y >= m_height)
@ -192,7 +206,7 @@ u8 sensorboard_device::read_sensor(u8 x, u8 y)
u8 live_state = BIT(m_inp_rank[y]->read(), x);
int pos = (y << 4 & 0xf0) | (x & 0x0f);
if (m_magnets || m_inductive)
if (m_magnets)
{
u8 piece = read_piece(x, y);
u8 state = (piece != 0 && pos != m_handpos && pos != m_droppos) ? 1 : 0;
@ -383,7 +397,7 @@ INPUT_CHANGED_MEMBER(sensorboard_device::sensor)
return;
// auto click / sensor delay
if (m_sensordelay != attotime::never && (m_magnets || m_inductive || (pos != m_handpos && ~m_inp_ui->read() & 2)))
if (m_sensordelay != attotime::never && (m_magnets || (pos != m_handpos && ~m_inp_ui->read() & 2)))
{
m_sensorpos = pos;
m_sensortimer->adjust(m_sensordelay);

View File

@ -18,13 +18,14 @@ public:
enum sb_type
{
BUTTONS = 0,
NOSENSORS = 0,
BUTTONS,
MAGNETS,
INDUCTIVE
};
// configuration helpers
sensorboard_device &set_type(sb_type t) { m_magnets = (t == MAGNETS); m_inductive = (t == INDUCTIVE); return *this; } // sensor type
sensorboard_device &set_type(sb_type type); // sensor type
sensorboard_device &set_size(u8 width, u8 height) { m_width = width; m_height = height; return *this; } // board dimensions, max 10 * 10
sensorboard_device &set_spawnpoints(u8 i) { m_maxspawn = i; m_maxid = i; return *this; } // number of piece spawnpoints, max 16
sensorboard_device &set_max_id(u8 i) { m_maxid = i; return *this; } // maximum piece id (if larger than set_spawnpoints)

View File

@ -5,6 +5,7 @@
SciSys Chess Traveler
Hardware notes:
- Fairchild 3870 MCU, label SL90387 (does not use the timer or irq at all)
- 256 bytes RAM(3539)
- 4-digit 7seg led panel
@ -21,7 +22,8 @@ digit DP lights up).
#include "emu.h"
#include "cpu/f8/f8.h"
#include "machine/f3853.h"
#include "machine/timer.h"
#include "video/pwm.h"
#include "machine/sensorboard.h"
// internal artwork
#include "scisys_chesstrv.lh" // clickable
@ -35,9 +37,8 @@ public:
chesstrv_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_keypad(*this, "LINE%u", 1U),
m_delay_display(*this, "delay_display_%u", 0),
m_out_digit(*this, "digit%u", 0U)
m_display(*this, "display"),
m_inputs(*this, "IN.%u", 0)
{ }
void chesstrv(machine_config &config);
@ -48,15 +49,13 @@ protected:
private:
// devices/pointers
required_device<cpu_device> m_maincpu;
required_ioport_array<4> m_keypad;
required_device_array<timer_device, 4> m_delay_display;
output_finder<4> m_out_digit;
required_device<pwm_display_device> m_display;
required_ioport_array<4> m_inputs;
void chesstrv_mem(address_map &map);
void chesstrv_io(address_map &map);
TIMER_DEVICE_CALLBACK_MEMBER(delay_display);
void update_display();
DECLARE_WRITE8_MEMBER(matrix_w);
DECLARE_WRITE8_MEMBER(digit_w);
DECLARE_READ8_MEMBER(input_r);
@ -69,23 +68,23 @@ private:
std::unique_ptr<u8[]> m_ram;
u8 m_ram_address;
u8 m_matrix;
u8 m_inp_mux;
u8 m_7seg_data;
};
void chesstrv_state::machine_start()
{
// resolve handlers
m_out_digit.resolve();
// zerofill
m_ram = make_unique_clear<u8[]>(0x100);
m_ram_address = 0;
m_matrix = 0;
m_inp_mux = 0;
m_7seg_data = 0;
// register for savestates
save_pointer(NAME(m_ram), 0x100);
save_item(NAME(m_ram_address));
save_item(NAME(m_matrix));
save_item(NAME(m_inp_mux));
save_item(NAME(m_7seg_data));
}
@ -96,44 +95,37 @@ void chesstrv_state::machine_start()
// F3870 ports
TIMER_DEVICE_CALLBACK_MEMBER(chesstrv_state::delay_display)
void chesstrv_state::update_display()
{
// clear digits if inactive
if (BIT(m_matrix, 3 - param))
m_out_digit[param] = 0;
m_display->matrix(~m_inp_mux, m_7seg_data);
}
WRITE8_MEMBER(chesstrv_state::digit_w)
{
// digit segments, update display here
for (int i = 0; i < 4; i++)
if (!BIT(m_matrix, 3 - i))
m_out_digit[i] = bitswap<8>(data,0,1,2,3,4,5,6,7) & 0x7f;
// digit segments
m_7seg_data = bitswap<8>(data,0,1,2,3,4,5,6,7) & 0x7f;
update_display();
}
WRITE8_MEMBER(chesstrv_state::matrix_w)
{
// d0-d3: input/digit select (active low)
// they're strobed, so on rising edge, delay them going off to prevent flicker or stuck display
for (int i = 0; i < 4; i++)
if (BIT(~m_matrix & data, 3 - i))
m_delay_display[i]->adjust(attotime::from_msec(20), i);
m_matrix = data;
m_inp_mux = data;
update_display();
}
READ8_MEMBER(chesstrv_state::input_r)
{
u8 data = m_matrix;
u8 data = m_inp_mux;
// d0-d3: multiplexed inputs from d4-d7
for (int i = 0; i < 4; i++)
if (BIT(m_matrix, i+4))
data |= m_keypad[i]->read();
if (BIT(m_inp_mux, i+4))
data |= m_inputs[i]->read();
// d4-d7: multiplexed inputs from d0-d3
for (int i = 0; i < 4; i++)
if (m_matrix & m_keypad[i]->read())
if (m_inp_mux & m_inputs[i]->read())
data |= 1 << (i+4);
return data;
@ -165,25 +157,25 @@ void chesstrv_state::chesstrv_io(address_map &map)
******************************************************************************/
static INPUT_PORTS_START( chesstrv )
PORT_START("LINE1")
PORT_START("IN.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("A 1 / Pawn")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("B 2 / Knight")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("C 3 / Bishop")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("D 4 / Rook")
PORT_START("LINE2")
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("E 5 / Queen")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("F 6 / King")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G 7 / White")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8 / Black")
PORT_START("LINE3")
PORT_START("IN.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LV / CS") // level/clear square
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("FP") // find position
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("EP") // enter position
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("CB") // clear board
PORT_START("LINE4")
PORT_START("IN.3")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE") // clear entry
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MM") // multi move
@ -209,10 +201,13 @@ void chesstrv_state::chesstrv(machine_config &config)
psu.read_b().set(FUNC(chesstrv_state::input_r));
psu.write_b().set(FUNC(chesstrv_state::matrix_w));
/* video hardware */
for (int i = 0; i < 4; i++)
TIMER(config, m_delay_display[i]).configure_generic(FUNC(chesstrv_state::delay_display));
// built-in chessboard is not electronic
sensorboard_device &board(SENSORBOARD(config, "board").set_type(sensorboard_device::NOSENSORS));
board.init_cb().set("board", FUNC(sensorboard_device::preset_chess));
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(4, 7);
m_display->set_segmask(0xf, 0x7f);
config.set_default_layout(layout_scisys_chesstrv);
}

View File

@ -3,7 +3,7 @@
<!-- define elements -->
<element name="black"><rect><color red="0.2" green="0.2" blue="0.2" /></rect></element>
<element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
<element name="white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element>
<element name="button" defstate="0">
@ -46,37 +46,468 @@
<element name="text_l14"><text string="CE"><color red="0.8" green="0.8" blue="0.8" /></text></element>
<element name="text_l15"><text string="ENTER"><color red="0.8" green="0.8" blue="0.8" /></text></element>
<element name="text_cl00">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="A" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl01">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="B" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl02">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="C" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl03">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="D" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl04">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="E" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl05">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="F" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl06">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="G" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl07">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="H" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl10">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="A" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl11">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="B" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl12">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="C" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl13">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="D" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl14">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="E" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl15">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="F" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cl16">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="G" align="1"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cl17">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="H" align="1"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn00">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="8" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn01">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="7" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn02">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="6" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn03">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="5" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn04">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="4" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn05">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="3" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn06">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="2" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn07">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="1" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn10">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="8" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn11">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="7" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn12">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="6" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn13">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="5" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn14">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="4" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn15">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="3" align="2"><color red="0.17" green="0.15" blue="0.15" /></text>
</element>
<element name="text_cn16">
<rect><color red="0.41" green="0.4" blue="0.39" /></rect>
<text string="2" align="2"><color red="0.86" green="0.85" blue="0.84" /></text>
</element>
<element name="text_cn17">
<rect><color red="0.7" green="0.8" blue="0.8" /></rect>
<text string="1" align="2"><color red="0.17" green="0.15" blue="0.15" /></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.7" green="0.8" blue="0.8" /></rect></element>
<element name="hlbb" defstate="0">
<text string=" "><bounds x="0" y="0" width="1" height="1" /></text>
</element>
<element name="piece" defstate="0">
<image file="chess/wp.png" state="1"/>
<image file="chess/wn.png" state="2"/>
<image file="chess/wb.png" state="3"/>
<image file="chess/wr.png" state="4"/>
<image file="chess/wq.png" state="5"/>
<image file="chess/wk.png" state="6"/>
<image file="chess/bp.png" state="7"/>
<image file="chess/bn.png" state="8"/>
<image file="chess/bb.png" state="9"/>
<image file="chess/br.png" state="10"/>
<image file="chess/bq.png" state="11"/>
<image file="chess/bk.png" state="12"/>
<!-- selected pieces -->
<image file="chess/wp.png" state="13"><color alpha="0.5" /></image>
<image file="chess/wn.png" state="14"><color alpha="0.5" /></image>
<image file="chess/wb.png" state="15"><color alpha="0.5" /></image>
<image file="chess/wr.png" state="16"><color alpha="0.5" /></image>
<image file="chess/wq.png" state="17"><color alpha="0.5" /></image>
<image file="chess/wk.png" state="18"><color alpha="0.5" /></image>
<image file="chess/bp.png" state="19"><color alpha="0.5" /></image>
<image file="chess/bn.png" state="20"><color alpha="0.5" /></image>
<image file="chess/bb.png" state="21"><color alpha="0.5" /></image>
<image file="chess/br.png" state="22"><color alpha="0.5" /></image>
<image file="chess/bq.png" state="23"><color alpha="0.5" /></image>
<image file="chess/bk.png" state="24"><color alpha="0.5" /></image>
</element>
<group name="sb_board">
<bounds x="0" y="0" width="80" height="80" />
<!-- squares (avoid seams) -->
<bezel element="cwhite"><bounds x="0" y="0" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="10" y="0" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="20" y="0" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="30" y="0" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="40" y="0" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="50" y="0" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="60" y="0" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="70" y="0" width="10" height="11" /></bezel>
<bezel element="cblack"><bounds x="0" y="10" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="10" y="10" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="20" y="10" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="30" y="10" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="40" y="10" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="50" y="10" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="60" y="10" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="70" y="10" width="10" height="11" /></bezel>
<bezel element="cwhite"><bounds x="0" y="20" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="10" y="20" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="20" y="20" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="30" y="20" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="40" y="20" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="50" y="20" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="60" y="20" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="70" y="20" width="10" height="11" /></bezel>
<bezel element="cblack"><bounds x="0" y="30" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="10" y="30" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="20" y="30" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="30" y="30" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="40" y="30" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="50" y="30" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="60" y="30" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="70" y="30" width="10" height="11" /></bezel>
<bezel element="cwhite"><bounds x="0" y="40" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="10" y="40" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="20" y="40" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="30" y="40" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="40" y="40" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="50" y="40" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="60" y="40" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="70" y="40" width="10" height="11" /></bezel>
<bezel element="cblack"><bounds x="0" y="50" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="10" y="50" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="20" y="50" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="30" y="50" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="40" y="50" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="50" y="50" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="60" y="50" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="70" y="50" width="10" height="11" /></bezel>
<bezel element="cwhite"><bounds x="0" y="60" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="10" y="60" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="20" y="60" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="30" y="60" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="40" y="60" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="50" y="60" width="11" height="11" /></bezel>
<bezel element="cwhite"><bounds x="60" y="60" width="11" height="11" /></bezel>
<bezel element="cblack"><bounds x="70" y="60" width="10" height="11" /></bezel>
<bezel element="cblack"><bounds x="0" y="70" width="11" height="10" /></bezel>
<bezel element="cwhite"><bounds x="10" y="70" width="11" height="10" /></bezel>
<bezel element="cblack"><bounds x="20" y="70" width="11" height="10" /></bezel>
<bezel element="cwhite"><bounds x="30" y="70" width="11" height="10" /></bezel>
<bezel element="cblack"><bounds x="40" y="70" width="11" height="10" /></bezel>
<bezel element="cwhite"><bounds x="50" y="70" width="11" height="10" /></bezel>
<bezel element="cblack"><bounds x="60" y="70" width="11" height="10" /></bezel>
<bezel element="cwhite"><bounds x="70" y="70" width="10" height="10" /></bezel>
<!-- coords -->
<repeat count="4">
<param name="y1" start="7.75" increment="20" />
<param name="y2" start="17.75" increment="20" />
<repeat count="8">
<param name="i" start="0" increment="1" />
<param name="x" start="0.5" increment="10" />
<bezel element="text_cl0~i~"><bounds x="~x~" y="~y1~" width="3" height="2" /></bezel>
<bezel element="text_cl1~i~"><bounds x="~x~" y="~y2~" width="3" height="2" /></bezel>
</repeat>
</repeat>
<repeat count="4">
<param name="x1" start="6" increment="20" />
<param name="x2" start="16" increment="20" />
<repeat count="8">
<param name="i" start="0" increment="1" />
<param name="y" start="7.75" increment="10" />
<bezel element="text_cn0~i~"><bounds x="~x1~" y="~y~" width="3.5" height="2" /></bezel>
<bezel element="text_cn1~i~"><bounds x="~x2~" y="~y~" width="3.5" height="2" /></bezel>
</repeat>
</repeat>
<!-- sensors, pieces -->
<repeat count="8">
<param name="y" start="0" increment="10" />
<param name="i" start="8" increment="-1" />
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x01"><bounds x="0" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x02"><bounds x="10" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x04"><bounds x="20" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x08"><bounds x="30" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x10"><bounds x="40" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x20"><bounds x="50" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x40"><bounds x="60" y="~y~" width="10" height="10" /></bezel>
<bezel element="hlbb" inputtag="board:RANK.~i~" inputmask="0x80"><bounds x="70" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_a~i~" element="piece"><bounds x="0" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_b~i~" element="piece"><bounds x="10" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_c~i~" element="piece"><bounds x="20" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_d~i~" element="piece"><bounds x="30" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_e~i~" element="piece"><bounds x="40" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_f~i~" element="piece"><bounds x="50" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_g~i~" element="piece"><bounds x="60" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_h~i~" element="piece"><bounds x="70" y="~y~" width="10" height="10" /></bezel>
</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">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uib3">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<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">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<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">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<text string=" &lt;&lt;"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2b">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<text string=" &lt; "><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2c">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<text string=" &gt;"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2d">
<rect><color red="0.81" green="0.8" blue="0.79" /></rect>
<text string=" &gt;&gt;"><color red="0.01" green="0.01" blue="0.01" /></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_uiu3b"><text string="/"><color red="0.81" green="0.8" blue="0.79" /></text></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" />
<bezel element="white"><bounds x="0" y="7" width="10" height="1" /></bezel>
<bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel>
<bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel>
<!-- board -->
<bezel element="text_uib1"><bounds x="0" y="9" width="10" height="2" /></bezel>
<bezel element="white"><bounds x="1" y="11.5" width="8" height="2.5" /></bezel>
<bezel element="white"><bounds x="1" y="15" width="8" height="2.5" /></bezel>
<bezel element="text_uib2"><bounds x="1.5" y="11.75" width="7" height="2" /></bezel>
<bezel element="text_uib3"><bounds x="1.5" y="15.25" width="7" height="2" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x200"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></bezel>
<!-- spawn -->
<bezel element="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></bezel>
<bezel element="white"><bounds x="1" y="23" width="8" height="12" /></bezel>
<bezel element="white"><bounds x="1" y="36" width="8" height="12" /></bezel>
<bezel name="piece_ui1" element="piece"><bounds x="1" y="23" width="4" height="4" /></bezel>
<bezel name="piece_ui2" element="piece"><bounds x="1" y="27" width="4" height="4" /></bezel>
<bezel name="piece_ui3" element="piece"><bounds x="1" y="31" width="4" height="4" /></bezel>
<bezel name="piece_ui4" element="piece"><bounds x="5" y="23" width="4" height="4" /></bezel>
<bezel name="piece_ui5" element="piece"><bounds x="5" y="27" width="4" height="4" /></bezel>
<bezel name="piece_ui6" element="piece"><bounds x="5" y="31" width="4" height="4" /></bezel>
<bezel name="piece_ui7" element="piece"><bounds x="1" y="36" width="4" height="4" /></bezel>
<bezel name="piece_ui8" element="piece"><bounds x="1" y="40" width="4" height="4" /></bezel>
<bezel name="piece_ui9" element="piece"><bounds x="1" y="44" width="4" height="4" /></bezel>
<bezel name="piece_ui10" element="piece"><bounds x="5" y="36" width="4" height="4" /></bezel>
<bezel name="piece_ui11" element="piece"><bounds x="5" y="40" width="4" height="4" /></bezel>
<bezel name="piece_ui12" element="piece"><bounds x="5" y="44" width="4" height="4" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></bezel>
<!-- hand -->
<bezel element="text_uih1"><bounds x="0" y="51" width="10" height="2" /></bezel>
<bezel element="cblack"><bounds x="1" y="53.5" width="8" height="6" /></bezel>
<bezel name="piece_ui0" element="piece"><bounds x="2" y="53.5" width="6" height="6" /></bezel>
<bezel element="white"><bounds x="1" y="60.5" width="8" height="2.5" /></bezel>
<bezel element="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></bezel>
<!-- undo -->
<bezel element="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></bezel>
<bezel element="white"><bounds x="1" y="68.5" width="1.7" height="6" /></bezel>
<bezel element="white"><bounds x="3.1" y="68.5" width="1.7" height="6" /></bezel>
<bezel element="white"><bounds x="5.2" y="68.5" width="1.7" height="6" /></bezel>
<bezel element="white"><bounds x="7.3" y="68.5" width="1.7" height="6" /></bezel>
<bezel element="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></bezel>
<bezel element="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></bezel>
<bezel element="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></bezel>
<bezel element="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel>
<bezel element="hlub" inputtag="board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel>
<bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></bezel>
<bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></bezel>
<bezel element="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></bezel>
</group>
<!-- build screen -->
<view name="Internal Layout">
<bounds left="-1" right="32" top="20" bottom="39.3" />
<bounds left="-5.5" right="31.775" top="-12.4" bottom="39.3" />
<bezel name="digit0" element="digit"><bounds x="8" y="21" width="3.4" height="5.1" /></bezel>
<bezel name="digit1" element="digit"><bounds x="11.4" y="21" width="3.4" height="5.1" /></bezel>
<bezel name="digit2" element="digit"><bounds x="16.2" y="21" width="3.4" height="5.1" /></bezel>
<bezel name="digit3" element="digit"><bounds x="19.6" y="21" width="3.4" height="5.1" /></bezel>
<bezel name="digit3" element="digit"><bounds x="8" y="-11.3" width="3.4" height="5.1" /></bezel>
<bezel name="digit2" element="digit"><bounds x="11.4" y="-11.3" width="3.4" height="5.1" /></bezel>
<bezel name="digit1" element="digit"><bounds x="16.2" y="-11.3" width="3.4" height="5.1" /></bezel>
<bezel name="digit0" element="digit"><bounds x="19.6" y="-11.3" width="3.4" height="5.1" /></bezel>
<bezel element="black"><bounds x="-1" y="27.2" width="33" height="0.5" /></bezel>
<bezel element="white"><bounds x="-5.5" y="-4.975" width="37.275" height="32.55" /></bezel>
<bezel element="blackb"><bounds x="-5.5" y="-4.5875" width="5" height="31.775" /></bezel>
<group ref="sb_board"><bounds x="0" y="-4.2" width="31" height="31" /></group>
<group ref="sb_ui"><bounds x="-5" y="-4.975" width="4.06875" height="32.55" /></group>
<!-- button panel -->
<bezel element="button" inputtag="LINE1" inputmask="0x01"><bounds x="0" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE1" inputmask="0x02"><bounds x="4" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE1" inputmask="0x04"><bounds x="8" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE1" inputmask="0x08"><bounds x="12" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE2" inputmask="0x01"><bounds x="16" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE2" inputmask="0x02"><bounds x="20" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE2" inputmask="0x04"><bounds x="24" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE2" inputmask="0x08"><bounds x="28" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.0" inputmask="0x01"><bounds x="0" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.0" inputmask="0x02"><bounds x="4" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.0" inputmask="0x04"><bounds x="8" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.0" inputmask="0x08"><bounds x="12" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.1" inputmask="0x01"><bounds x="16" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.1" inputmask="0x02"><bounds x="20" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.1" inputmask="0x04"><bounds x="24" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.1" inputmask="0x08"><bounds x="28" y="30" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE3" inputmask="0x01"><bounds x="0" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE3" inputmask="0x02"><bounds x="4" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE3" inputmask="0x04"><bounds x="8" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE4" inputmask="0x04"><bounds x="12" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE3" inputmask="0x08"><bounds x="16" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE4" inputmask="0x01"><bounds x="20" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="LINE4" inputmask="0x02"><bounds x="26" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.2" inputmask="0x01"><bounds x="0" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.2" inputmask="0x02"><bounds x="4" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.2" inputmask="0x04"><bounds x="8" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.3" inputmask="0x04"><bounds x="12" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.2" inputmask="0x08"><bounds x="16" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.3" inputmask="0x01"><bounds x="20" y="35" width="3" height="2.2" /></bezel>
<bezel element="button" inputtag="IN.3" inputmask="0x02"><bounds x="26" y="35" width="3" height="2.2" /></bezel>
<bezel element="text_l01a"><bounds x="0.3" y="28.5" width="2.4" height="1.3" /></bezel>
<bezel element="text_l01b"><bounds x="0.3" y="28.5" width="2.4" height="1.3" /></bezel>
@ -103,7 +534,8 @@
<bezel element="text_l06c"><bounds x="20" y="32.3" width="3" height="1.3" /></bezel>
<bezel element="white"><bounds x="25" y="32.55" width="1" height="1" /></bezel>
<bezel element="black"><bounds x="29" y="32.55" width="1" height="1" /></bezel>
<bezel element="white"><bounds x="29" y="32.55" width="1" height="1" /></bezel>
<bezel element="blackb"><bounds x="29.15" y="32.7" width="0.7" height="0.7" /></bezel>
<bezel element="text_l09"><bounds x="-1" y="37.3" width="5" height="1.3" /></bezel>
<bezel element="text_l10"><bounds x="3" y="37.3" width="5" height="1.3" /></bezel>