chessmst: same thing as arb, clicking reset button auto clicks halt button on top of it

This commit is contained in:
hap 2022-07-26 01:44:32 +02:00
parent 777fb68215
commit 52feb2341b
3 changed files with 31 additions and 3 deletions

View File

@ -276,11 +276,11 @@ static INPUT_PORTS_START( arb )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_0) PORT_NAME("New Game / Options / Pawn / 0")
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_F1) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, reset_button, 0)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_CODE(KEYCODE_F1) PORT_NAME("Halt") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, halt_button, 0)
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_F1) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, reset_button, 0)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_CODE(KEYCODE_F1) PORT_NAME("Halt") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, halt_button, 0)
PORT_START("LISTEN") // helper for internal artwork
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER )
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER)
INPUT_PORTS_END

View File

@ -206,6 +206,9 @@ static INPUT_PORTS_START( chessmst )
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Halt") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, halt_button, 0)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, chessmst_state, reset_button, 0)
PORT_START("LISTEN") // helper for internal artwork
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER)
INPUT_PORTS_END

View File

@ -4,6 +4,25 @@ license:CC0
-->
<mamelayout version="2">
<!-- luascript (-plugin layout), for pressing 2 buttons simultaneously -->
<script><![CDATA[
local layout = {}
local prev_state = 0
function layout.frame()
local cur_state = machine.ioport.ports[":LISTEN"]:read() & 1
if cur_state ~= prev_state then
machine.ioport.ports[":IN.1"]:field(0x01):set_value(cur_state)
machine.ioport.ports[":IN.1"]:field(0x02):set_value(cur_state)
end
prev_state = cur_state
end
return layout
]]></script>
<!-- define elements -->
<element name="ledr" defstate="0">
@ -42,6 +61,10 @@ license:CC0
</disk>
</element>
<element name="nothing" defstate="0">
<rect><color alpha="0" /></rect>
</element>
<element name="whitew"><rect><color red="1" green="1" blue="1" /></rect></element>
<element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element>
@ -482,6 +505,8 @@ license:CC0
<element ref="hlb" inputtag="IN.0" inputmask="0x04"><bounds x="118" y="55" width="4" height="4" /></element>
<element ref="hlb" inputtag="IN.0" inputmask="0x02"><bounds x="118" y="62" width="4" height="4" /></element>
<element ref="hlb" inputtag="IN.0" inputmask="0x01"><bounds x="118" y="69" width="4" height="4" /></element>
<element ref="nothing" inputtag="LISTEN" inputmask="0x01"><bounds x="108" y="79" width="4" height="4" /></element>
<element ref="hlb" inputtag="IN.1" inputmask="0x02"><bounds x="108" y="79" width="4" height="4" /></element>
<element ref="hlb" inputtag="IN.1" inputmask="0x01"><bounds x="122" y="79" width="4" height="4" /></element>