mirror of
https://github.com/holub/mame
synced 2025-04-09 18:17:44 +03:00
Fixed various issues in internal layouts:
* plugins/layout: Log script errors at warning level rather than verbose level. * microtouch.lay, pntnpuzl.lay: Improved pointer mapping code. * Reordered all layouts to place views after element and group definitions and scripts last. This matches how layout files are interpreted by MAME. * Fixed various errors identified by validating layout files against an XSD schema.
This commit is contained in:
parent
07b62ad614
commit
34a31ac42d
@ -51,7 +51,7 @@ function layout.startplugin()
|
||||
table = table }
|
||||
local script, err = load(script, script, "t", env)
|
||||
if not script then
|
||||
emu.print_verbose("error loading layout script " .. err)
|
||||
emu.print_warning("error loading layout script " .. err)
|
||||
return
|
||||
end
|
||||
local hooks = script()
|
||||
|
@ -106,7 +106,7 @@ license:CC0-1.0
|
||||
</element>
|
||||
|
||||
<element name="L11" defstate="0">
|
||||
<rect STATE="1">
|
||||
<rect state="1">
|
||||
<color red="0.80" green="0.80" blue="0.0" />
|
||||
</rect>
|
||||
</element>
|
||||
|
@ -133,7 +133,7 @@ license:CC0-1.0
|
||||
</element>
|
||||
|
||||
<element name="L11" defstate="0">
|
||||
<rect STATE="1">
|
||||
<rect state="1">
|
||||
<color red="0.80" green="0.80" blue="0.0" />
|
||||
</rect>
|
||||
</element>
|
||||
|
@ -52,7 +52,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -52,7 +52,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -52,7 +52,7 @@ license:CC0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
@ -254,7 +254,7 @@ license:CC0
|
||||
<param name="p" start="0" increment="40"/>
|
||||
<param name="b" start="180" increment="22"/>
|
||||
<repeat count="5">
|
||||
<param name="s" start="~p~" incrment="8"/>
|
||||
<param name="s" start="~p~" increment="8"/>
|
||||
<param name="x" start="~b~" increment="4"/>
|
||||
<repeat count="8">
|
||||
<param name="n" start="~s~" increment="1"/>
|
||||
@ -270,7 +270,7 @@ license:CC0
|
||||
<!-- the rest of the elements tend to be used for 7-segs
|
||||
so render them as both -->
|
||||
<repeat count="12">
|
||||
<param name="s" start="160" incrment="8"/>
|
||||
<param name="s" start="160" increment="8"/>
|
||||
<param name="x" start="280" increment="4"/>
|
||||
<repeat count="8">
|
||||
<param name="n" start="~s~" increment="1"/>
|
||||
|
@ -50,7 +50,7 @@ authors:hap
|
||||
|
||||
<element ref="text_in"><bounds x="1" y="27" width="10" height="4" /></element>
|
||||
<element ref="text_dash"><bounds x="10" y="27" width="4" height="4" /></element>
|
||||
<element ref="ind_r" inputtag="IN.6" inputmask="0x04">><bounds x="13" y="27.8" width="3" height="3" /></element>
|
||||
<element ref="ind_r" inputtag="IN.6" inputmask="0x04"><bounds x="13" y="27.8" width="3" height="3" /></element>
|
||||
|
||||
<element ref="text_out"><bounds x="1" y="31" width="10" height="4" /></element>
|
||||
<element ref="text_dash"><bounds x="10" y="31" width="4" height="4" /></element>
|
||||
|
@ -47,7 +47,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="button-text-play">
|
||||
<rect></rect>
|
||||
<text align="0" valign="0" string="PLAY">
|
||||
<text align="0" string="PLAY">
|
||||
<color red="0.15" green="0.15" blue="0.15" />
|
||||
</text>
|
||||
</element>
|
||||
@ -953,7 +953,7 @@ license:CC0-1.0
|
||||
<bounds x="88" y="0" width="72" height="208" />
|
||||
</element>
|
||||
<element ref="slider-nub">
|
||||
<animate inputtag="AN3" inputmask="0xFF" />
|
||||
<animate inputtag="AN3" mask="0xff" />
|
||||
<bounds state="0" x="90" y="156" width="68" height="6" />
|
||||
<bounds state="255" x="90" y="44" width="68" height="6" />
|
||||
</element>
|
||||
|
@ -13,7 +13,7 @@ Electronics Australia Car Computer
|
||||
<element name="red_led">
|
||||
<disk state="0"><color red="1.0" green="0.0" blue="0.0" /></disk>
|
||||
</element>
|
||||
<element name="red_button" state="0">
|
||||
<element name="red_button" defstate="0">
|
||||
<rect state="0"><color red="0.75" green="0.25" blue="0.25" /></rect>
|
||||
<rect state="1"><color red="1.0" green="0.25" blue="0.25" /></rect>
|
||||
</element>
|
||||
|
@ -44,7 +44,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -44,7 +44,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -28,7 +28,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -103,7 +103,7 @@ copyright-holders:tim lindner
|
||||
<element ref="button_white"><bounds x="281" y="82" width="659" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="281" y="175" width="659" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="34" y="268" width="649" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="0" y="361" width="939" height="6" /></element>11
|
||||
<element ref="button_white"><bounds x="0" y="361" width="939" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="38" y="367" width="155" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="282" y="367" width="230" height="6" /></element>
|
||||
<element ref="button_white"><bounds x="597" y="367" width="44" height="6" /></element>
|
||||
|
@ -130,7 +130,7 @@ license:CC0-1.0
|
||||
<bounds x="303" y="34" width="45" height="28" />
|
||||
</element>
|
||||
|
||||
<element nmae="data_entry_yes_1" ref="data_entry">
|
||||
<element name="data_entry_yes_1" ref="data_entry">
|
||||
<bounds left="350" right="399" top="0" bottom="15" />
|
||||
</element>
|
||||
<element name="data_entry_yes_2" ref="yes">
|
||||
|
@ -89,7 +89,7 @@ license:CC0-1.0
|
||||
</element>
|
||||
<element name="led_23" ref="led">
|
||||
<bounds x="470" y="610" width="10" height="10" />
|
||||
</element>a
|
||||
</element>
|
||||
<element name="led_24" ref="led">
|
||||
<bounds x="10" y="630" width="10" height="10" />
|
||||
</element>
|
||||
|
@ -28,7 +28,7 @@ loosely based on tranz330.lay
|
||||
|
||||
<element name="hl" defstate="0">
|
||||
<rect state="1">
|
||||
<color red="0.0" green="0.0" blue="0.5" alphe="0.2" />
|
||||
<color red="0.0" green="0.0" blue="0.5" alpha="0.2" />
|
||||
</rect>
|
||||
</element>
|
||||
|
||||
|
@ -10,6 +10,12 @@ TODO
|
||||
- monitor bezels
|
||||
-->
|
||||
<mamelayout version="2">
|
||||
<element name="digit" defstate="0">
|
||||
<led7seg>
|
||||
<color red="1.0" green="0.0" blue="0.0" />
|
||||
</led7seg>
|
||||
</element>
|
||||
|
||||
<view name="Graphics 0">
|
||||
<screen index="0">
|
||||
<bounds x="0" y="0" width="1184" height="884" />
|
||||
@ -22,12 +28,6 @@ TODO
|
||||
</screen>
|
||||
</view>
|
||||
|
||||
<element name="digit" defstate="0">
|
||||
<led7seg>
|
||||
<color red="1.0" green="0.0" blue="0.0" />
|
||||
</led7seg>
|
||||
</element>
|
||||
|
||||
<view name="Terminal">
|
||||
<screen index="2">
|
||||
<bounds x="0" y="0" width="800" height="600" />
|
||||
|
@ -355,7 +355,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="lamp_162_1" defstate="0" inputtag="AUX2" inputmask="0x80">
|
||||
<element name="lamp_162_1" defstate="0">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -535,7 +535,7 @@
|
||||
<color red="0.06" green="0.06" blue="0.12"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="lamp_48_1" defstate="0" inputtag="BLACK2" inputmask="0x20">
|
||||
<element name="lamp_48_1" defstate="0">
|
||||
<rect state="1">
|
||||
<color red="0.50" green="0.50" blue="1.00"/>
|
||||
</rect>
|
||||
@ -1575,7 +1575,7 @@
|
||||
<color red="0.12" green="0.12" blue="0.06"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="lamp_22_1" defstate="0" inputtag="BLACK2" inputmask="0x80">
|
||||
<element name="lamp_22_1" defstate="0">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="1.00" blue="0.50"/>
|
||||
</rect>
|
||||
@ -3151,7 +3151,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_196" inputtag="BLACK1" inputmask="0x01">
|
||||
<element name="colour_button_196">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3179,7 +3179,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_197" inputtag="BLACK2" inputmask="0x02">
|
||||
<element name="colour_button_197">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3203,7 +3203,7 @@
|
||||
<color red="0.12" green="0.06" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_198" inputtag="BLACK2" inputmask="0x01">
|
||||
<element name="colour_button_198">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.50" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3223,7 +3223,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_199" inputtag="BLACK2" inputmask="0x04">
|
||||
<element name="colour_button_199">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3247,7 +3247,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_200" inputtag="BLACK2" inputmask="0x08">
|
||||
<element name="colour_button_200">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3271,7 +3271,7 @@
|
||||
<color red="0.12" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_201" inputtag="BLACK2" inputmask="0x10">
|
||||
<element name="colour_button_201">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="0.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3315,7 +3315,7 @@
|
||||
<color red="0.12" green="0.12" blue="0.00"/>
|
||||
</rect>
|
||||
</element>
|
||||
<element name="colour_button_203" inputtag="BLACK2" inputmask="0x40">
|
||||
<element name="colour_button_203">
|
||||
<rect state="1">
|
||||
<color red="1.00" green="1.00" blue="0.00"/>
|
||||
</rect>
|
||||
@ -3732,7 +3732,7 @@
|
||||
<element name="lamp162" ref="lamp_162_1_border" state="0">
|
||||
<bounds x="732" y="3" width="56" height="24"/>
|
||||
</element>
|
||||
<element name="lamp162" ref="lamp_162_1" state="0">
|
||||
<element name="lamp162" ref="lamp_162_1" state="0" inputtag="AUX2" inputmask="0x80">
|
||||
<bounds x="734" y="5" width="52" height="20"/>
|
||||
</element>
|
||||
<element name="lamp156" ref="lamp_156_1_border" state="0">
|
||||
@ -3786,7 +3786,7 @@
|
||||
<element name="lamp48" ref="lamp_48_1_border" state="0">
|
||||
<bounds x="153" y="533" width="64" height="32"/>
|
||||
</element>
|
||||
<element name="lamp48" ref="lamp_48_1" state="0">
|
||||
<element name="lamp48" ref="lamp_48_1" state="0" inputtag="BLACK2" inputmask="0x20">
|
||||
<bounds x="155" y="535" width="60" height="28"/>
|
||||
</element>
|
||||
<element name="lamp204" ref="lamp_204_1_border" state="0">
|
||||
@ -4074,7 +4074,7 @@
|
||||
<element name="lamp22" ref="lamp_22_1_border" state="0">
|
||||
<bounds x="103" y="347" width="56" height="32"/>
|
||||
</element>
|
||||
<element name="lamp22" ref="lamp_22_1" state="0">
|
||||
<element name="lamp22" ref="lamp_22_1" state="0" inputtag="BLACK2" inputmask="0x80">
|
||||
<bounds x="105" y="349" width="52" height="28"/>
|
||||
</element>
|
||||
<element name="lamp123" ref="lamp_123_1_border" state="0">
|
||||
|
@ -5,73 +5,6 @@ authors:hap, Carl
|
||||
-->
|
||||
<mamelayout version="2">
|
||||
|
||||
<script><![CDATA[
|
||||
-- add support for placing wall pieces by clicking between buttons
|
||||
file:set_resolve_tags_callback(
|
||||
function ()
|
||||
local walls = { { 7.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 17.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 27.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 37.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 47.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 57.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 67.5, { 0, 10, 20, 30, 40, 50, 60, 70 } } }
|
||||
|
||||
for num, col in pairs(walls) do
|
||||
for num2, wall in pairs(col[2]) do
|
||||
machine.output:set_indexed_value("colwall", (num * 10) + num2, 0)
|
||||
end
|
||||
end
|
||||
for num, row in pairs(walls) do
|
||||
for num2, wall in pairs(row[2]) do
|
||||
machine.output:set_indexed_value("rowwall", (num * 10) + num2, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local view = file.views["Internal Layout"]
|
||||
local boundsref = view.items["boundsref"]
|
||||
local transform
|
||||
|
||||
view:set_recomputed_callback(
|
||||
function ()
|
||||
transform = boundsref.bounds
|
||||
end)
|
||||
|
||||
view:set_pointer_updated_callback(
|
||||
function (pointertype, id, device, x, y, buttons, pressed, released, clicks)
|
||||
if ((pressed & 0x1) ~= 0) and (1 == buttons) then
|
||||
-- convert to layout units
|
||||
x = (x - transform.x0) / transform.width
|
||||
y = (y - transform.y0) / transform.height
|
||||
|
||||
for num, col in pairs(walls) do
|
||||
if col[1] < x and (col[1] + 2.5) > x then
|
||||
for num2, wall in pairs(col[2]) do
|
||||
if wall < y and (wall + 7.5) > y then
|
||||
local state = machine.output:get_indexed_value("colwall", (num * 10) + num2)
|
||||
machine.output:set_indexed_value("colwall", (num * 10) + num2, (~state) & 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for num, row in pairs(walls) do
|
||||
if row[1] < y and (row[1] + 2.5) > y then
|
||||
for num2, wall in pairs(row[2]) do
|
||||
if wall < x and (wall + 7.5) > x then
|
||||
local state = machine.output:get_indexed_value("rowwall", (num * 10) + num2)
|
||||
machine.output:set_indexed_value("rowwall", (num * 10) + num2, (~state) & 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
]]></script>
|
||||
|
||||
|
||||
<!-- define elements -->
|
||||
|
||||
<element name="empty" />
|
||||
@ -387,4 +320,71 @@ authors:hap, Carl
|
||||
<element ref="hl" inputtag="IN.8" inputmask="0x08"><bounds x="-12.5" y="70" width="7.5" height="7.5" /><color alpha="0.2" /></element>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<script><![CDATA[
|
||||
-- add support for placing wall pieces by clicking between buttons
|
||||
file:set_resolve_tags_callback(
|
||||
function ()
|
||||
local walls = { { 7.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 17.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 27.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 37.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 47.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 57.5, { 0, 10, 20, 30, 40, 50, 60, 70 } },
|
||||
{ 67.5, { 0, 10, 20, 30, 40, 50, 60, 70 } } }
|
||||
|
||||
for num, col in pairs(walls) do
|
||||
for num2, wall in pairs(col[2]) do
|
||||
machine.output:set_indexed_value("colwall", (num * 10) + num2, 0)
|
||||
end
|
||||
end
|
||||
for num, row in pairs(walls) do
|
||||
for num2, wall in pairs(row[2]) do
|
||||
machine.output:set_indexed_value("rowwall", (num * 10) + num2, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local view = file.views["Internal Layout"]
|
||||
local boundsref = view.items["boundsref"]
|
||||
local transform
|
||||
|
||||
view:set_recomputed_callback(
|
||||
function ()
|
||||
transform = boundsref.bounds
|
||||
end)
|
||||
|
||||
view:set_pointer_updated_callback(
|
||||
function (pointertype, id, device, x, y, buttons, pressed, released, clicks)
|
||||
if ((pressed & 0x1) ~= 0) and (1 == buttons) then
|
||||
-- convert to layout units
|
||||
x = (x - transform.x0) / transform.width
|
||||
y = (y - transform.y0) / transform.height
|
||||
|
||||
for num, col in pairs(walls) do
|
||||
if col[1] < x and (col[1] + 2.5) > x then
|
||||
for num2, wall in pairs(col[2]) do
|
||||
if wall < y and (wall + 7.5) > y then
|
||||
local state = machine.output:get_indexed_value("colwall", (num * 10) + num2)
|
||||
machine.output:set_indexed_value("colwall", (num * 10) + num2, (~state) & 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for num, row in pairs(walls) do
|
||||
if row[1] < y and (row[1] + 2.5) > y then
|
||||
for num2, wall in pairs(row[2]) do
|
||||
if wall < x and (wall + 7.5) > x then
|
||||
local state = machine.output:get_indexed_value("rowwall", (num * 10) + num2)
|
||||
machine.output:set_indexed_value("rowwall", (num * 10) + num2, (~state) & 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
]]></script>
|
||||
</mamelayout>
|
||||
|
@ -17,6 +17,12 @@ license:CC0-1.0
|
||||
local btn_field = tsdev:ioport('TOUCH'):field(0x01)
|
||||
local x_field = tsdev:ioport('TOUCH_X'):field(0x3fff)
|
||||
local y_field = tsdev:ioport('TOUCH_Y'):field(0x3fff)
|
||||
local set_field_value = btn_field.set_value
|
||||
local clear_field_value = btn_field.clear_value
|
||||
local x_min = x_field.minvalue
|
||||
local x_max = x_field.maxvalue
|
||||
local y_min = y_field.minvalue
|
||||
local y_max = y_field.maxvalue
|
||||
|
||||
-- for mapping coordinates
|
||||
local view = file.views['Touch-Enabled']
|
||||
@ -30,9 +36,9 @@ license:CC0-1.0
|
||||
local inside = false
|
||||
|
||||
local function release_touch()
|
||||
btn_field:clear_value()
|
||||
x_field:clear_value()
|
||||
y_field:clear_value()
|
||||
clear_field_value(btn_field)
|
||||
clear_field_value(x_field)
|
||||
clear_field_value(y_field)
|
||||
end
|
||||
|
||||
local function recomputed()
|
||||
@ -41,16 +47,28 @@ license:CC0-1.0
|
||||
r = bounds.x1
|
||||
t = bounds.y0
|
||||
b = bounds.y1
|
||||
x_scale = 0x3fff / bounds.width
|
||||
y_scale = 0x3fff / bounds.height
|
||||
x_scale = (x_max - x_min + 1) / bounds.width
|
||||
y_scale = (y_max - y_min + 1) / bounds.height
|
||||
end
|
||||
|
||||
local function check_pointer(x, y)
|
||||
if (x >= l) and (x < r) and (y >= t) and (y < b) then
|
||||
inside = true
|
||||
btn_field:set_value(1)
|
||||
x_field:set_value(floor(0.5 + ((x - l) * x_scale)))
|
||||
y_field:set_value(floor(0.5 + ((y - t) * y_scale)))
|
||||
local ix = x_min + floor(0.0001 + ((x - l) * x_scale))
|
||||
if ix < x_min then
|
||||
ix = x_min
|
||||
elseif ix > x_max then
|
||||
ix = x_max
|
||||
end
|
||||
local iy = y_min + floor(0.0001 + ((y - t) * y_scale))
|
||||
if iy < y_min then
|
||||
iy = y_min
|
||||
elseif iy > y_max then
|
||||
iy = y_max
|
||||
end
|
||||
set_field_value(btn_field, 1)
|
||||
set_field_value(x_field, ix)
|
||||
set_field_value(y_field, iy)
|
||||
elseif inside then
|
||||
inside = false
|
||||
release_touch()
|
||||
|
@ -43,7 +43,7 @@ authors:hap
|
||||
<element name="LED4" ref="led"><bounds x="104" y="18" width="4" height="4" /></element>
|
||||
<element name="LED5" ref="led"><bounds x="113" y="18" width="4" height="4" /></element>
|
||||
|
||||
// mu-plg1-plg2-plg3
|
||||
<!-- mu-plg1-plg2-plg3 -->
|
||||
<element name="LED6" ref="ledr"><bounds x="103" y="26" width="3" height="1" /></element>
|
||||
<element name="LED7" ref="ledr"><bounds x="107" y="26" width="3" height="1" /></element>
|
||||
<element name="LED8" ref="ledr"><bounds x="111" y="26" width="3" height="1" /></element>
|
||||
|
@ -142,11 +142,11 @@
|
||||
<color state="1" red="0.200" green="0.165" blue="0.169"/>
|
||||
</text>
|
||||
</element>
|
||||
<element name="de" align="2">
|
||||
<element name="de">
|
||||
<rect>
|
||||
<color red="0.541" green="0.573" blue="0.580"/>
|
||||
</rect>
|
||||
<text string="DE">
|
||||
<text string="DE" align="2">
|
||||
<color state="0" red="0.514" green="0.533" blue="0.545"/>
|
||||
<color state="1" red="0.200" green="0.165" blue="0.169"/>
|
||||
</text>
|
||||
|
@ -60,10 +60,16 @@ license:CC0-1.0
|
||||
<script><![CDATA[
|
||||
file:set_resolve_tags_callback(
|
||||
function ()
|
||||
-- get the touchscreen I/O port fields - X/Y reversed for rotated screen
|
||||
-- get the touchscreen I/O port fields - X/Y swapped for rotated screen
|
||||
local btn_field = file.device:ioport('IN0'):field(0x10)
|
||||
local x_field = file.device:ioport('TOUCHY'):field(0x7f)
|
||||
local y_field = file.device:ioport('TOUCHX'):field(0x7f)
|
||||
local set_field_value = btn_field.set_value
|
||||
local clear_field_value = btn_field.clear_value
|
||||
local x_min = x_field.minvalue
|
||||
local x_max = x_field.maxvalue
|
||||
local y_min = y_field.minvalue
|
||||
local y_max = y_field.maxvalue
|
||||
|
||||
-- for mapping coordinates
|
||||
local view = file.views['Touch-Enabled']
|
||||
@ -77,9 +83,9 @@ license:CC0-1.0
|
||||
local inside = false
|
||||
|
||||
local function release_touch()
|
||||
btn_field:clear_value()
|
||||
x_field:clear_value()
|
||||
y_field:clear_value()
|
||||
clear_field_value(btn_field)
|
||||
clear_field_value(x_field)
|
||||
clear_field_value(y_field)
|
||||
end
|
||||
|
||||
local function recomputed()
|
||||
@ -88,16 +94,28 @@ license:CC0-1.0
|
||||
r = bounds.x1
|
||||
t = bounds.y0
|
||||
b = bounds.y1
|
||||
x_scale = 0x7f / bounds.width
|
||||
y_scale = 0x7f / bounds.height
|
||||
x_scale = (x_max - x_min + 1) / bounds.width
|
||||
y_scale = (y_max - y_min + 1) / bounds.height
|
||||
end
|
||||
|
||||
local function check_pointer(x, y)
|
||||
if (x >= l) and (x < r) and (y >= t) and (y < b) then
|
||||
inside = true
|
||||
btn_field:set_value(1)
|
||||
x_field:set_value(floor(0.5 + ((x - l) * x_scale)))
|
||||
y_field:set_value(floor(0.5 + ((y - t) * y_scale)))
|
||||
local ix = x_min + floor(0.0001 + ((x - l) * x_scale))
|
||||
if ix < x_min then
|
||||
ix = x_min
|
||||
elseif ix > x_max then
|
||||
ix = x_max
|
||||
end
|
||||
local iy = y_min + floor(0.0001 + ((y - t) * y_scale))
|
||||
if iy < y_min then
|
||||
iy = y_min
|
||||
elseif iy > y_max then
|
||||
iy = y_max
|
||||
end
|
||||
set_field_value(btn_field, 1)
|
||||
set_field_value(x_field, ix)
|
||||
set_field_value(y_field, iy)
|
||||
elseif inside then
|
||||
inside = false
|
||||
release_touch()
|
||||
|
@ -52,7 +52,7 @@ license:CC0-1.0
|
||||
|
||||
<element name="SteppersReel2" defstate="0">
|
||||
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
|
||||
"<color red="1.0" green="1.0" blue="1.0" />
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
<bounds x="0" y="0" width="1" height="1" />
|
||||
</reel>
|
||||
</element>
|
||||
|
@ -106,7 +106,7 @@ license:CC0-1.0
|
||||
</element>
|
||||
<element name="lamp3" ref="HOLD" inputtag="IN0" inputmask="0x0008">
|
||||
<bounds x="1.50" y="3.05" width="0.30" height="0.15" />
|
||||
</element>4
|
||||
</element>
|
||||
<element name="lamp4" ref="HOLD" inputtag="IN0" inputmask="0x0010">
|
||||
<bounds x="1.85" y="3.05" width="0.30" height="0.15" />
|
||||
</element>
|
||||
|
@ -98,7 +98,7 @@ license:CC0-1.0
|
||||
</element>
|
||||
<element name="lamp8" ref="HOLD" inputtag="IN0" inputmask="0x0080">
|
||||
<bounds x="1.85" y="3.05" width="0.30" height="0.15" />
|
||||
</element>4
|
||||
</element>
|
||||
<element name="lamp9" ref="HOLD" inputtag="IN0" inputmask="0x0040">
|
||||
<bounds x="2.20" y="3.05" width="0.30" height="0.15" />
|
||||
</element>
|
||||
|
@ -320,7 +320,7 @@ license:CC0-1.0
|
||||
<element name="lamp7" ref="BET5" inputtag="500d" inputmask="0x02">
|
||||
<bounds x="2.32" y="3.02" width="0.3" height="0.3" />
|
||||
</element>
|
||||
<element name="lamp12" ref="GAMBLE" inputtag="500d" inputmask="0x01"> gamble
|
||||
<element name="lamp12" ref="GAMBLE" inputtag="500d" inputmask="0x01">
|
||||
<bounds x="2.73" y="3.02" width="0.3" height="0.3" />
|
||||
</element>
|
||||
|
||||
@ -339,7 +339,7 @@ license:CC0-1.0
|
||||
<element name="lamp4" ref="5LINES" inputtag="500e" inputmask="0x08">
|
||||
<bounds x="2.32" y="3.43" width="0.3" height="0.3" />
|
||||
</element>
|
||||
<element name="lamp9" ref="TAKE_WIN" inputtag="500e" inputmask="0x20">take win
|
||||
<element name="lamp9" ref="TAKE_WIN" inputtag="500e" inputmask="0x20">
|
||||
<bounds x="2.73" y="3.43" width="0.3" height="0.3" />
|
||||
</element>
|
||||
|
||||
|
@ -3,45 +3,6 @@
|
||||
license:CC0-1.0
|
||||
-->
|
||||
<mamelayout version="2">
|
||||
<!-- Lua script (-plugin layout) -->
|
||||
<!-- this adds support for combining outputs to make an aggregated output -->
|
||||
<script><![CDATA[
|
||||
local ledlamps = {
|
||||
{ 88, 89, 90, 91, 92, 93, 94 },
|
||||
{ 80, 81, 82, 83, 84, 85, 86, 87 },
|
||||
{ 72, 73, 74, 75, 76, 77, 78 },
|
||||
{ 64, 65, 66, 67, 68, 69, 70 } }
|
||||
|
||||
function configure_view(view)
|
||||
local led_items = {
|
||||
view.items["compoundled0"],
|
||||
view.items["compoundled1"],
|
||||
view.items["compoundled2"],
|
||||
view.items["compoundled3"] }
|
||||
view:set_prepare_items_callback(
|
||||
function ()
|
||||
for ledno, lamps in pairs(ledlamps) do
|
||||
local ledstate = 0
|
||||
for bit, lampno in pairs(lamps) do
|
||||
if machine.output:get_indexed_value("lamp", lampno) > 0 then
|
||||
ledstate = ledstate | (1 << (bit - 1))
|
||||
end
|
||||
end
|
||||
if led_items[ledno] ~= nil then
|
||||
led_items[ledno]:set_state(ledstate)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
file:set_resolve_tags_callback(
|
||||
function ()
|
||||
for k, view in pairs(file.views) do
|
||||
configure_view(view)
|
||||
end
|
||||
end)
|
||||
]]></script>
|
||||
|
||||
<element name="£">
|
||||
<text string="£">
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
@ -225,4 +186,43 @@ license:CC0-1.0
|
||||
<bounds x="505" y="250" width="40" height="15"/>
|
||||
</element>
|
||||
</view>
|
||||
|
||||
<!-- Lua script (-plugin layout) -->
|
||||
<!-- this adds support for combining outputs to make an aggregated output -->
|
||||
<script><![CDATA[
|
||||
local ledlamps = {
|
||||
{ 88, 89, 90, 91, 92, 93, 94 },
|
||||
{ 80, 81, 82, 83, 84, 85, 86, 87 },
|
||||
{ 72, 73, 74, 75, 76, 77, 78 },
|
||||
{ 64, 65, 66, 67, 68, 69, 70 } }
|
||||
|
||||
local function configure_view(view)
|
||||
local led_items = {
|
||||
view.items["compoundled0"],
|
||||
view.items["compoundled1"],
|
||||
view.items["compoundled2"],
|
||||
view.items["compoundled3"] }
|
||||
view:set_prepare_items_callback(
|
||||
function ()
|
||||
for ledno, lamps in pairs(ledlamps) do
|
||||
local ledstate = 0
|
||||
for bit, lampno in pairs(lamps) do
|
||||
if machine.output:get_indexed_value("lamp", lampno) > 0 then
|
||||
ledstate = ledstate | (1 << (bit - 1))
|
||||
end
|
||||
end
|
||||
if led_items[ledno] ~= nil then
|
||||
led_items[ledno]:set_state(ledstate)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
file:set_resolve_tags_callback(
|
||||
function ()
|
||||
for k, view in pairs(file.views) do
|
||||
configure_view(view)
|
||||
end
|
||||
end)
|
||||
]]></script>
|
||||
</mamelayout>
|
||||
|
Loading…
Reference in New Issue
Block a user