<?xml version="1.0"?>
<mamelayout version="2">
<!-- define elements -->
<script>
local layout = {}
local board
local first_sq
local enpassant -- en passant possible on next move
local enpassant_pos -- position of the piece to be removed
local port_tags = { ":P7", ":P6", ":P5", ":P4", ":P3", ":P2", ":P1", ":P0" }
local port_values = { }
local ports
local function change_piece_state(pos, new_state)
board[pos.y][pos.x] = new_state
machine:outputs():set_indexed_value("pos", (pos.y * 10) + pos.x, new_state)
end
local function move_piece(from, to)
if board[from.y][from.x] == 0 then
return 0
end
-- ignores move on the same position
if from.y == to.y and from.x == to.x then
change_piece_state(to, board[to.y][to.x])
return 1
end
-- en passant
if enpassant and board[to.y][to.x] == 0 and board[from.y][from.x] == 12 and from.y == 4 and to.y == 3 and from.x ~= to.x and board[to.y + 1][to.x] == 6 then
enpassant_pos = {x = to.x, y = to.y + 1}
elseif enpassant and board[to.y][to.x] == 0 and board[from.y][from.x] == 6 and from.y == 5 and to.y == 6 and from.x ~= to.x and board[to.y - 1][to.x] == 12 then
enpassant_pos = {x = to.x, y = to.y - 1}
end
if board[to.y][to.x] == 0 and from.x == to.x and ((board[from.y][from.x] == 6 and from.y == 2 and to.y == 4) or
(board[from.y][from.x] == 12 and from.y == 7 and to.y == 5)) then
enpassant = true
else
enpassant = false
end
-- promotion
if (to.y == 8 and board[from.y][from.x] == 6) or (to.y == 1 and board[from.y][from.x] == 12) then
change_piece_state(to, board[from.y][from.x] - 4) -- TODO: make this configurable
else
change_piece_state(to, board[from.y][from.x])
end
change_piece_state(from, 0)
return 1
end
function layout.reset()
board =
{{ 3, 5, 4, 2, 1, 4, 5, 3 },
{ 6, 6, 6, 6, 6, 6, 6, 6 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 12,12,12,12,12,12,12,12 },
{ 9,11,10, 8, 7,10,11, 9 }}
for y, row in ipairs(board) do
for x, cell in ipairs(row) do
change_piece_state({x = x, y = y}, board[y][x])
end
end
ports = machine:ioport().ports
first_sq = nil
enpassant = false
enpassant_pos = nil
end
function layout.frame()
local value = ports[":RESET"]:read()
if value & 0x01 == 0x01 then
layout.reset()
return
end
for y, tag in ipairs(port_tags) do
local port = ports[tag]
if not port then
return
end
local newvalue = port:read()
if port_values[y] ~= newvalue then
port_values[y] = newvalue
for x = 8, 1, -1 do
if newvalue & 1 == 1 then
if enpassant_pos and enpassant_pos.x == x and enpassant_pos.y == y then
change_piece_state(enpassant_pos, 0)
enpassant = false
enpassant_pos = nil
return
end
if not first_sq then
if board[y][x] ~= 0 then
first_sq = {x = x, y = y}
machine:outputs():set_indexed_value("pos", (y * 10) + x, board[y][x] | 0x10)
end
else
if move_piece(first_sq, {x = x, y = y}) == 1 then
first_sq = nil
end
end
return
end
newvalue = newvalue >> 1
end
end
end
end
return layout, "risc2500"
</script>
<element name="digit" defstate="0">
<led7seg>
<color red="1.0" green="1.0" blue="1.0" />
</led7seg>
</element>
<element name="led" defstate="1">
<rect state="0">
<color red="0.95" green="0.0" blue="0.0" />
</rect>
<rect state="1">
<color red="0.20" green="0.0" blue="0.0" />
</rect>
</element>
<element name="button" defstate="0">
<rect state="0">
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
<color red="0.0" green="0.0" blue="0.0" />
</rect>
<rect state="1">
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
<color red="0.4" green="0.4" blue="0.4" />
</rect>
</element>
<element name="hl" defstate="0">
<text string=" ">
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
<color red="1.0" green="1.0" blue="1.0" />
</text>
<rect state="1">
<bounds x="0.12" y="0.12" width="0.76" height="0.76" />
<color red="1.0" green="1.0" blue="1.0" />
</rect>
</element>
<element name="text_1"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="1"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_2"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="2"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_3"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="3"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_4"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="4"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_5"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="5"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_6"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="6"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_7"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="7"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_8"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="8"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_a"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="A"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_b"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="B"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_c"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="C"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_d"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="D"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_e"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="E"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_f"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="F"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_g"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="G"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_h"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="H"><color red="0.01" green="0.01" blue="0.01" /></text> </element>
<element name="text_on"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="ON" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_off"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="OFF" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_newgame"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="NEW GAME" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_play"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="PLAY" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_back"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="BACK" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_left"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="←" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_right"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="→" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_menu"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="MENU" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_up"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="↑" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_down"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="↓" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_enter"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="ENTER" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p1"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♚" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p2"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♛" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p3"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♜" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p4"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♝" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p5"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♞" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="text_p6"> <rect><color red="0.63" green="0.63" blue="0.63" /></rect> <text string="♟" > <color red="0.17" green="0.15" blue="0.15" /></text> </element>
<element name="sym_colon"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string=":" state="1"> <color red="1.0" green="1.0" blue="1.0" /></text> </element>
<element name="sym_left"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="←" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_right"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="→" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p1"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♚" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p2"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♛" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p3"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♜" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p4"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♝" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p5"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♞" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_p6"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="♟" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_white"> <rect><color red="0.00" green="0.00" blue="0.00" /></rect> <text string="○" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="sym_black"> <text string="●" state="1"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
<element name="white"><rect><color red="1" green="1" blue="1" /></rect></element>
<element name="black"><rect><color red="0" green="0" blue="0" /></rect></element>
<element name="background"><rect><color red="0.63" green="0.63" blue="0.63" /></rect></element>
<element name="piece" defstate="0">
<text string="♚" state="1"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♛" state="2"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♜" state="3"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♝" state="4"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♞" state="5"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♟" state="6"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♚" state="7"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♛" state="8"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♜" state="9"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♝" state="10"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♞" state="11"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♟" state="12"><color red="0.71" green="0.7" blue="0.69" /></text>
<!-- selected pieces -->
<disk state="17"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="18"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="19"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="20"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="21"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="22"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="23"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="24"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="25"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="26"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="27"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<disk state="28"> <color red="1.00" green="0.25" blue="1.00" /> </disk>
<text string="♚" state="17"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♛" state="18"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♜" state="19"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♝" state="20"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♞" state="21"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♟" state="22"><color red="0.27" green="0.25" blue="0.25" /></text>
<text string="♚" state="23"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♛" state="24"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♜" state="25"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♝" state="26"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♞" state="27"><color red="0.71" green="0.7" blue="0.69" /></text>
<text string="♟" state="28"><color red="0.71" green="0.7" blue="0.69" /></text>
</element>
<!-- build screen -->
<view name="Internal Layout">
<bezel element="background"><bounds x="0" y="0" width="95" height="90" /></bezel>
<bezel element="background"><bounds x="95" y="16" width="60" height="74" /></bezel>
<bezel element="background"><bounds x="95" y="0" width="60" height="4" /></bezel>
<bezel element="background"><bounds x="125" y="0" width="30" height="20" /></bezel>
<bezel element="white"><bounds x="8" y="3" width="80" height="80" /></bezel>
<bezel element="black"><bounds x="8" y="13" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="8" y="33" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="8" y="53" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="8" y="73" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="18" y="3" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="18" y="23" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="18" y="43" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="18" y="63" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="28" y="13" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="28" y="33" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="28" y="53" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="28" y="73" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="38" y="3" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="38" y="23" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="38" y="43" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="38" y="63" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="48" y="13" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="48" y="33" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="48" y="53" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="48" y="73" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="58" y="3" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="58" y="23" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="58" y="43" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="58" y="63" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="68" y="13" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="68" y="33" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="68" y="53" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="68" y="73" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="78" y="3" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="78" y="23" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="78" y="43" width="10" height="10" /></bezel>
<bezel element="black"><bounds x="78" y="63" width="10" height="10" /></bezel>
<bezel element="text_8" ><bounds x="5" y="7" width="2" height="2" /></bezel>
<bezel element="text_7" ><bounds x="5" y="17" width="2" height="2" /></bezel>
<bezel element="text_6" ><bounds x="5" y="27" width="2" height="2" /></bezel>
<bezel element="text_5" ><bounds x="5" y="37" width="2" height="2" /></bezel>
<bezel element="text_4" ><bounds x="5" y="47" width="2" height="2" /></bezel>
<bezel element="text_3" ><bounds x="5" y="57" width="2" height="2" /></bezel>
<bezel element="text_2" ><bounds x="5" y="67" width="2" height="2" /></bezel>
<bezel element="text_1" ><bounds x="5" y="77" width="2" height="2" /></bezel>
<bezel element="text_a" ><bounds x="12" y="84" width="2" height="2" /></bezel>
<bezel element="text_b" ><bounds x="22" y="84" width="2" height="2" /></bezel>
<bezel element="text_c" ><bounds x="32" y="84" width="2" height="2" /></bezel>
<bezel element="text_d" ><bounds x="42" y="84" width="2" height="2" /></bezel>
<bezel element="text_e" ><bounds x="52" y="84" width="2" height="2" /></bezel>
<bezel element="text_f" ><bounds x="62" y="84" width="2" height="2" /></bezel>
<bezel element="text_g" ><bounds x="72" y="84" width="2" height="2" /></bezel>
<bezel element="text_h" ><bounds x="82" y="84" width="2" height="2" /></bezel>
<bezel name="led0" element="led"><bounds x="2" y="77.5" width="2" height="1" /></bezel>
<bezel name="led1" element="led"><bounds x="2" y="67.5" width="2" height="1" /></bezel>
<bezel name="led2" element="led"><bounds x="2" y="57.5" width="2" height="1" /></bezel>
<bezel name="led3" element="led"><bounds x="2" y="47.5" width="2" height="1" /></bezel>
<bezel name="led4" element="led"><bounds x="2" y="37.5" width="2" height="1" /></bezel>
<bezel name="led5" element="led"><bounds x="2" y="27.5" width="2" height="1" /></bezel>
<bezel name="led6" element="led"><bounds x="2" y="17.5" width="2" height="1" /></bezel>
<bezel name="led7" element="led"><bounds x="2" y="7.5" width="2" height="1" /></bezel>
<bezel name="led8" element="led"><bounds x="12.5" y="87" width="1" height="2" /></bezel>
<bezel name="led9" element="led"><bounds x="22.5" y="87" width="1" height="2" /></bezel>
<bezel name="led10" element="led"><bounds x="32.5" y="87" width="1" height="2" /></bezel>
<bezel name="led11" element="led"><bounds x="42.5" y="87" width="1" height="2" /></bezel>
<bezel name="led12" element="led"><bounds x="52.5" y="87" width="1" height="2" /></bezel>
<bezel name="led13" element="led"><bounds x="62.5" y="87" width="1" height="2" /></bezel>
<bezel name="led14" element="led"><bounds x="72.5" y="87" width="1" height="2" /></bezel>
<bezel name="led15" element="led"><bounds x="82.5" y="87" width="1" height="2" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x01"><bounds x="78" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x02"><bounds x="68" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x04"><bounds x="58" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x08"><bounds x="48" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x10"><bounds x="38" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x20"><bounds x="28" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x40"><bounds x="18" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P0" inputmask="0x80"><bounds x="8" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x01"><bounds x="78" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x02"><bounds x="68" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x04"><bounds x="58" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x08"><bounds x="48" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x10"><bounds x="38" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x20"><bounds x="28" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x40"><bounds x="18" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P1" inputmask="0x80"><bounds x="8" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x01"><bounds x="78" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x02"><bounds x="68" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x04"><bounds x="58" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x08"><bounds x="48" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x10"><bounds x="38" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x20"><bounds x="28" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x40"><bounds x="18" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P2" inputmask="0x80"><bounds x="8" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x01"><bounds x="78" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x02"><bounds x="68" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x04"><bounds x="58" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x08"><bounds x="48" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x10"><bounds x="38" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x20"><bounds x="28" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x40"><bounds x="18" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P3" inputmask="0x80"><bounds x="8" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x01"><bounds x="78" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x02"><bounds x="68" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x04"><bounds x="58" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x08"><bounds x="48" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x10"><bounds x="38" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x20"><bounds x="28" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x40"><bounds x="18" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P4" inputmask="0x80"><bounds x="8" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x01"><bounds x="78" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x02"><bounds x="68" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x04"><bounds x="58" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x08"><bounds x="48" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x10"><bounds x="38" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x20"><bounds x="28" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x40"><bounds x="18" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P5" inputmask="0x80"><bounds x="8" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x01"><bounds x="78" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x02"><bounds x="68" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x04"><bounds x="58" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x08"><bounds x="48" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x10"><bounds x="38" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x20"><bounds x="28" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x40"><bounds x="18" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P6" inputmask="0x80"><bounds x="8" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x01"><bounds x="78" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x02"><bounds x="68" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x04"><bounds x="58" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x08"><bounds x="48" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x10"><bounds x="38" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x20"><bounds x="28" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x40"><bounds x="18" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
<bezel element="hl" inputtag="P7" inputmask="0x80"><bounds x="8" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
<bezel name="pos81" element="piece" ><bounds x="8" y="73" width="10" height="10" /></bezel>
<bezel name="pos82" element="piece" ><bounds x="18" y="73" width="10" height="10" /></bezel>
<bezel name="pos83" element="piece" ><bounds x="28" y="73" width="10" height="10" /></bezel>
<bezel name="pos84" element="piece" ><bounds x="38" y="73" width="10" height="10" /></bezel>
<bezel name="pos85" element="piece" ><bounds x="48" y="73" width="10" height="10" /></bezel>
<bezel name="pos86" element="piece" ><bounds x="58" y="73" width="10" height="10" /></bezel>
<bezel name="pos87" element="piece" ><bounds x="68" y="73" width="10" height="10" /></bezel>
<bezel name="pos88" element="piece" ><bounds x="78" y="73" width="10" height="10" /></bezel>
<bezel name="pos71" element="piece" ><bounds x="8" y="63" width="10" height="10" /></bezel>
<bezel name="pos72" element="piece" ><bounds x="18" y="63" width="10" height="10" /></bezel>
<bezel name="pos73" element="piece" ><bounds x="28" y="63" width="10" height="10" /></bezel>
<bezel name="pos74" element="piece" ><bounds x="38" y="63" width="10" height="10" /></bezel>
<bezel name="pos75" element="piece" ><bounds x="48" y="63" width="10" height="10" /></bezel>
<bezel name="pos76" element="piece" ><bounds x="58" y="63" width="10" height="10" /></bezel>
<bezel name="pos77" element="piece" ><bounds x="68" y="63" width="10" height="10" /></bezel>
<bezel name="pos78" element="piece" ><bounds x="78" y="63" width="10" height="10" /></bezel>
<bezel name="pos61" element="piece" ><bounds x="8" y="53" width="10" height="10" /></bezel>
<bezel name="pos62" element="piece" ><bounds x="18" y="53" width="10" height="10" /></bezel>
<bezel name="pos63" element="piece" ><bounds x="28" y="53" width="10" height="10" /></bezel>
<bezel name="pos64" element="piece" ><bounds x="38" y="53" width="10" height="10" /></bezel>
<bezel name="pos65" element="piece" ><bounds x="48" y="53" width="10" height="10" /></bezel>
<bezel name="pos66" element="piece" ><bounds x="58" y="53" width="10" height="10" /></bezel>
<bezel name="pos67" element="piece" ><bounds x="68" y="53" width="10" height="10" /></bezel>
<bezel name="pos68" element="piece" ><bounds x="78" y="53" width="10" height="10" /></bezel>
<bezel name="pos51" element="piece" ><bounds x="8" y="43" width="10" height="10" /></bezel>
<bezel name="pos52" element="piece" ><bounds x="18" y="43" width="10" height="10" /></bezel>
<bezel name="pos53" element="piece" ><bounds x="28" y="43" width="10" height="10" /></bezel>
<bezel name="pos54" element="piece" ><bounds x="38" y="43" width="10" height="10" /></bezel>
<bezel name="pos55" element="piece" ><bounds x="48" y="43" width="10" height="10" /></bezel>
<bezel name="pos56" element="piece" ><bounds x="58" y="43" width="10" height="10" /></bezel>
<bezel name="pos57" element="piece" ><bounds x="68" y="43" width="10" height="10" /></bezel>
<bezel name="pos58" element="piece" ><bounds x="78" y="43" width="10" height="10" /></bezel>
<bezel name="pos41" element="piece" ><bounds x="8" y="33" width="10" height="10" /></bezel>
<bezel name="pos42" element="piece" ><bounds x="18" y="33" width="10" height="10" /></bezel>
<bezel name="pos43" element="piece" ><bounds x="28" y="33" width="10" height="10" /></bezel>
<bezel name="pos44" element="piece" ><bounds x="38" y="33" width="10" height="10" /></bezel>
<bezel name="pos45" element="piece" ><bounds x="48" y="33" width="10" height="10" /></bezel>
<bezel name="pos46" element="piece" ><bounds x="58" y="33" width="10" height="10" /></bezel>
<bezel name="pos47" element="piece" ><bounds x="68" y="33" width="10" height="10" /></bezel>
<bezel name="pos48" element="piece" ><bounds x="78" y="33" width="10" height="10" /></bezel>
<bezel name="pos31" element="piece" ><bounds x="8" y="23" width="10" height="10" /></bezel>
<bezel name="pos32" element="piece" ><bounds x="18" y="23" width="10" height="10" /></bezel>
<bezel name="pos33" element="piece" ><bounds x="28" y="23" width="10" height="10" /></bezel>
<bezel name="pos34" element="piece" ><bounds x="38" y="23" width="10" height="10" /></bezel>
<bezel name="pos35" element="piece" ><bounds x="48" y="23" width="10" height="10" /></bezel>
<bezel name="pos36" element="piece" ><bounds x="58" y="23" width="10" height="10" /></bezel>
<bezel name="pos37" element="piece" ><bounds x="68" y="23" width="10" height="10" /></bezel>
<bezel name="pos38" element="piece" ><bounds x="78" y="23" width="10" height="10" /></bezel>
<bezel name="pos21" element="piece" ><bounds x="8" y="13" width="10" height="10" /></bezel>
<bezel name="pos22" element="piece" ><bounds x="18" y="13" width="10" height="10" /></bezel>
<bezel name="pos23" element="piece" ><bounds x="28" y="13" width="10" height="10" /></bezel>
<bezel name="pos24" element="piece" ><bounds x="38" y="13" width="10" height="10" /></bezel>
<bezel name="pos25" element="piece" ><bounds x="48" y="13" width="10" height="10" /></bezel>
<bezel name="pos26" element="piece" ><bounds x="58" y="13" width="10" height="10" /></bezel>
<bezel name="pos27" element="piece" ><bounds x="68" y="13" width="10" height="10" /></bezel>
<bezel name="pos28" element="piece" ><bounds x="78" y="13" width="10" height="10" /></bezel>
<bezel name="pos11" element="piece" ><bounds x="8" y="3" width="10" height="10" /></bezel>
<bezel name="pos12" element="piece" ><bounds x="18" y="3" width="10" height="10" /></bezel>
<bezel name="pos13" element="piece" ><bounds x="28" y="3" width="10" height="10" /></bezel>
<bezel name="pos14" element="piece" ><bounds x="38" y="3" width="10" height="10" /></bezel>
<bezel name="pos15" element="piece" ><bounds x="48" y="3" width="10" height="10" /></bezel>
<bezel name="pos16" element="piece" ><bounds x="58" y="3" width="10" height="10" /></bezel>
<bezel name="pos17" element="piece" ><bounds x="68" y="3" width="10" height="10" /></bezel>
<bezel name="pos18" element="piece" ><bounds x="78" y="3" width="10" height="10" /></bezel>
<!-- LCD panel -->
<screen index="0"><bounds x="95" y="4.5" width="30" height="4" /></screen>
<bezel name="sym12" element="sym_colon" ><bounds x="107.0" y="9" width="1.5" height="3" /></bezel>
<bezel name="sym13" element="sym_colon" ><bounds x="119.2" y="9" width="1.5" height="3" /></bezel>
<bezel name="digit11" element="digit" ><bounds x="95.9" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit10" element="digit" ><bounds x="98.35" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit9" element="digit" ><bounds x="100.8" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit8" element="digit" ><bounds x="103.25" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit7" element="digit" ><bounds x="105.7" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit6" element="digit" ><bounds x="108.15" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit5" element="digit" ><bounds x="110.6" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit4" element="digit" ><bounds x="113.05" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit3" element="digit" ><bounds x="115.5" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit2" element="digit" ><bounds x="117.95" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit1" element="digit" ><bounds x="120.4" y="9" width="1.6" height="3" /></bezel>
<bezel name="digit0" element="digit" ><bounds x="122.85" y="9" width="1.6" height="3" /></bezel>
<bezel name="sym1" element="sym_right" > <bounds x="121.60" y="12.7" width="3" height="3" /></bezel>
<bezel name="sym2" element="sym_p6" > <bounds x="116.60" y="12.5" width="5" height="3" /></bezel>
<bezel name="sym3" element="sym_p5" > <bounds x="113.75" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym4" element="sym_p4" > <bounds x="110.88" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym6" element="sym_p3" > <bounds x="108.00" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym7" element="sym_p2" > <bounds x="105.13" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym8" element="sym_p1" > <bounds x="102.25" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym9" element="sym_white" > <bounds x="99.00" y="12.5" width="4" height="3" /></bezel>
<bezel name="sym10" element="sym_black" > <bounds x="99.90" y="13.0" width="2.2" height="2.2" /></bezel>
<bezel name="sym11" element="sym_left" > <bounds x="95.40" y="12.7" width="3" height="3" /></bezel>
<!-- right side -->
<bezel element="text_on" ><bounds x="96" y="37" width="8" height="2" /></bezel>
<bezel element="text_off" ><bounds x="107" y="37" width="8" height="2" /></bezel>
<bezel element="text_newgame" ><bounds x="118" y="37" width="8" height="2" /></bezel>
<bezel element="text_play" ><bounds x="129" y="37" width="8" height="2" /></bezel>
<bezel element="text_back" ><bounds x="140" y="37" width="8" height="2" /></bezel>
<bezel element="text_left" ><bounds x="96" y="52" width="7" height="3" /></bezel>
<bezel element="text_right" ><bounds x="105" y="52" width="7" height="3" /></bezel>
<bezel element="text_menu" ><bounds x="114" y="52" width="7" height="2" /></bezel>
<bezel element="text_up" ><bounds x="123" y="51" width="7" height="3" /></bezel>
<bezel element="text_down" ><bounds x="132" y="51" width="7" height="3" /></bezel>
<bezel element="text_enter" ><bounds x="141" y="52" width="7" height="2" /></bezel>
<bezel element="text_p1" ><bounds x="96" y="65" width="7" height="5" /></bezel>
<bezel element="text_p2" ><bounds x="105" y="65" width="7" height="5" /></bezel>
<bezel element="text_p3" ><bounds x="114" y="65" width="7" height="5" /></bezel>
<bezel element="text_p4" ><bounds x="123" y="65" width="7" height="5" /></bezel>
<bezel element="text_p5" ><bounds x="132" y="65" width="7" height="5" /></bezel>
<bezel element="text_p6" ><bounds x="141" y="65" width="7" height="5" /></bezel>
<bezel element="button" inputtag="RESET" inputmask="0x00000001"><bounds x="96" y="40" width="8" height="2" /></bezel>
<bezel element="button" inputtag="P7" inputmask="0x80000000"><bounds x="107" y="40" width="8" height="2" /></bezel>
<bezel element="button" inputtag="P6" inputmask="0x80000000"><bounds x="118" y="40" width="8" height="2" /></bezel>
<bezel element="button" inputtag="P5" inputmask="0x80000000"><bounds x="129" y="40" width="8" height="2" /></bezel>
<bezel element="button" inputtag="P0" inputmask="0x80000000"><bounds x="140" y="40" width="8" height="2" /></bezel>
<bezel element="button" inputtag="P7" inputmask="0x40000000"><bounds x="96" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P6" inputmask="0x40000000"><bounds x="105" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P4" inputmask="0x80000000"><bounds x="114" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P3" inputmask="0x80000000"><bounds x="123" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P2" inputmask="0x80000000"><bounds x="132" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P1" inputmask="0x80000000"><bounds x="141" y="55" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P5" inputmask="0x40000000"><bounds x="96" y="70" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P4" inputmask="0x40000000"><bounds x="105" y="70" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P3" inputmask="0x40000000"><bounds x="114" y="70" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P2" inputmask="0x40000000"><bounds x="123" y="70" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P1" inputmask="0x40000000"><bounds x="132" y="70" width="7" height="2" /></bezel>
<bezel element="button" inputtag="P0" inputmask="0x40000000"><bounds x="141" y="70" width="7" height="2" /></bezel>
</view>
</mamelayout>