leonardo: fix lockup and add buttonpanel leds (nw)

This commit is contained in:
hap 2020-05-02 23:57:17 +02:00
parent c09370d784
commit 6600710c7a
7 changed files with 86 additions and 79 deletions

View File

@ -462,7 +462,7 @@ void m6801_cpu_device::set_timer_event()
void hd6301x_cpu_device::set_timer_event() void hd6301x_cpu_device::set_timer_event()
{ {
m6801_cpu_device::set_timer_event(); m6801_cpu_device::set_timer_event();
if (OC2D - CTD < m_timer_next) if (OC2D - CTD < OCD - CTD && OC2D - CTD < TOD - CTD)
m_timer_next = OC2D; m_timer_next = OC2D;
} }

View File

@ -42,15 +42,8 @@ Expansion modules released:
- Sparc (SPARClite, Spracklen's) - Sparc (SPARClite, Spracklen's)
TODO: TODO:
- It locks up a short time after you make an input error (eg. on computer's
turn, enter the wrong move so it will give a low pitch error beep, then hold
INS to fast-forward and it will lock up) - happens with leonardoa too, but
after a longer delay. At first glance, it looks like it's caused by inaccurate
6801 timer emulation. It also locks up when you get checkmated, seems to be
the same problem as above.
- OSA module support (softwarelist, devices/bus) - OSA module support (softwarelist, devices/bus)
- OSA PC link (probably uses MCU serial interface) - OSA PC link (probably uses MCU serial interface)
- unsure about white/black/check/end/module/comm leds
- add nvram - add nvram
- finish internal artwork - finish internal artwork
@ -134,13 +127,14 @@ void leo_state::machine_start()
void leo_state::update_display() void leo_state::update_display()
{ {
m_display->matrix_partial(0, 8, 1 << (m_inp_mux & 0xf), m_led_data[0], false); m_display->matrix_partial(0, 8, 1 << (m_inp_mux & 0xf), m_led_data[0], false);
m_display->matrix_partial(8, 3, ~m_inp_mux >> 5 & 7, (~m_inp_mux << 3 & 0x700) | m_led_data[1], true); m_display->matrix_partial(8, 2, 1 << BIT(m_inp_mux, 5), (~m_inp_mux << 2 & 0x300) | m_led_data[1], true);
} }
void leo_state::mux_w(u8 data) void leo_state::mux_w(u8 data)
{ {
// d0-d3: input/chessboard leds mux // d0-d3: input/chessboard led mux
// d5-d7: button leds mux // d5: button led select
// d6,d7: button led data
m_inp_mux = data; m_inp_mux = data;
update_display(); update_display();
@ -150,7 +144,7 @@ void leo_state::mux_w(u8 data)
void leo_state::leds_w(u8 data) void leo_state::leds_w(u8 data)
{ {
// button leds data // button led data
m_led_data[1] = ~data; m_led_data[1] = ~data;
update_display(); update_display();
} }
@ -253,17 +247,17 @@ static INPUT_PORTS_START( leo )
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) // pawn PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) // pawn
PORT_START("IN.2") PORT_START("IN.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) // n PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) // tab/color PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) // tab/color
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) // + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) // +
PORT_START("IN.3") PORT_START("IN.3")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) // freq PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) // function? PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) // function?
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) // sound PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) // sound
PORT_START("IN.4") PORT_START("IN.4")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) // freq PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) // freq sel
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) // stop? PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) // stop?
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) // library? PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) // library?
@ -278,14 +272,16 @@ static INPUT_PORTS_START( leo )
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) // analysis? PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) // analysis?
PORT_START("IN.7") PORT_START("IN.7")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_F) // n PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) // new game PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) // new game
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) // setup? PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) // setup?
PORT_START("IN.8") PORT_START("IN.8")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_L) // low battery PORT_CONFNAME( 0x04, 0x04, "Battery Status" )
PORT_CONFSETTING( 0x00, "Low" )
PORT_CONFSETTING( 0x04, DEF_STR( Normal ) )
INPUT_PORTS_END INPUT_PORTS_END
@ -311,7 +307,7 @@ void leo_state::leo(machine_config &config)
m_board->set_delay(attotime::from_msec(150)); m_board->set_delay(attotime::from_msec(150));
/* video hardware */ /* video hardware */
PWM_DISPLAY(config, m_display).set_size(8+3, 8+3); PWM_DISPLAY(config, m_display).set_size(8+2, 8+2);
config.set_default_layout(layout_saitek_leonardo); config.set_default_layout(layout_saitek_leonardo);
/* sound hardware */ /* sound hardware */

View File

@ -67,7 +67,7 @@ private:
void update_display(); void update_display();
template<int N> void seg_w(u8 data); template<int N> void seg_w(u8 data);
void mux_w(u16 data); void mux_w(u16 data);
u16 input_r(offs_t offset); u16 input_r();
u8 m_inp_mux = 0; u8 m_inp_mux = 0;
u8 m_lcd_select = 0; u8 m_lcd_select = 0;
@ -124,7 +124,7 @@ void mini_state::mux_w(u16 data)
update_display(); update_display();
} }
u16 mini_state::input_r(offs_t offset) u16 mini_state::input_r()
{ {
// D0,D2: switches // D0,D2: switches
u16 data = m_inputs[4]->read() & 5; u16 data = m_inputs[4]->read() & 5;

View File

@ -643,6 +643,10 @@ license:CC0
<bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel> <bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel>
</view> </view>
<view name="Internal Layout (Brikett)">
<group ref="brikett"><bounds x="0" y="0" width="58.5" height="32" /></group>
</view>
<view name="Internal Layout (Board)"> <view name="Internal Layout (Board)">
<bounds left="-13" right="88" top="-1.5" bottom="87.5" /> <bounds left="-13" right="88" top="-1.5" bottom="87.5" />
@ -671,7 +675,4 @@ license:CC0
<bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel> <bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel>
</view> </view>
<view name="Internal Layout (Brikett)">
<group ref="brikett"><bounds x="0" y="0" width="58.5" height="32" /></group>
</view>
</mamelayout> </mamelayout>

View File

@ -640,6 +640,10 @@ license:CC0
<bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel> <bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel>
</view> </view>
<view name="Internal Layout (Brikett)">
<group ref="brikett"><bounds x="0" y="0" width="58.5" height="32" /></group>
</view>
<view name="Internal Layout (Board)"> <view name="Internal Layout (Board)">
<bounds left="-13" right="88" top="-1.5" bottom="87.5" /> <bounds left="-13" right="88" top="-1.5" bottom="87.5" />
@ -668,7 +672,4 @@ license:CC0
<bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel> <bezel element="text_h"><bounds x="77.5" y="84.5" width="2" height="2" /></bezel>
</view> </view>
<view name="Internal Layout (Brikett)">
<group ref="brikett"><bounds x="0" y="0" width="58.5" height="32" /></group>
</view>
</mamelayout> </mamelayout>

View File

@ -9,8 +9,20 @@ license:CC0
<element name="black"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element> <element name="black"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element>
<element name="led" defstate="0"> <element name="led" defstate="0">
<disk state="0"><color red="0.2" green="0" blue="0" /></disk> <rect state="0"><color red="0.15" green="0" blue="0" /></rect>
<disk state="1"><color red="1" green="0" blue="0" /></disk> <rect state="1"><color red="1" green="0" blue="0" /></rect>
</element>
<element name="ledro">
<rect><color red="0.1" green="0.1" blue="0.1" /></rect>
</element>
<element name="ledrr" defstate="0">
<rect state="0"><color red="0" green="0" blue="0" /></rect>
<rect state="1"><color red="1" green="0" blue="0" /></rect>
</element>
<element name="ledrg" defstate="0">
<rect state="0"><color red="0" green="0" blue="0" /></rect>
<rect state="1"><color red="0" green="1" blue="0" /></rect>
</element> </element>
<element name="ledo"> <element name="ledo">
@ -374,7 +386,7 @@ license:CC0
<!-- build screen --> <!-- build screen -->
<view name="Internal Layout"> <view name="Internal Layout">
<bounds left="-13" right="88" top="-1.5" bottom="95.5" /> <bounds left="-13" right="88" top="-1.5" bottom="99" />
<element ref="cblack"><bounds x="-1" y="-1.5" width="89" height="89" /></element> <element ref="cblack"><bounds x="-1" y="-1.5" width="89" height="89" /></element>
<element ref="black"><bounds x="3" y="2.5" width="81" height="81" /></element> <element ref="black"><bounds x="3" y="2.5" width="81" height="81" /></element>
@ -456,42 +468,39 @@ license:CC0
<element name="6.1" ref="ledr" blend="add"><bounds x="67.75" y="84.75" width="1.5" height="1.5" /></element> <element name="6.1" ref="ledr" blend="add"><bounds x="67.75" y="84.75" width="1.5" height="1.5" /></element>
<element name="7.1" ref="ledr" blend="add"><bounds x="77.75" y="84.75" width="1.5" height="1.5" /></element> <element name="7.1" ref="ledr" blend="add"><bounds x="77.75" y="84.75" width="1.5" height="1.5" /></element>
<!-- button panel -->
<element ref="ledro"><bounds x="0" y="90" width="2" height="1" /></element>
<element ref="ledro"><bounds x="0" y="93" width="2" height="1" /></element>
<element ref="ledro"><bounds x="0" y="96" width="2" height="1" /></element>
<element name="8.0" ref="led" blend="add"><bounds x="0.25" y="89" width="1.5" height="1.5" /></element> <element name="8.3" ref="ledrr" blend="add"><bounds x="0" y="90" width="2" height="1" /></element>
<element name="8.1" ref="led" blend="add"><bounds x="2.25" y="89" width="1.5" height="1.5" /></element> <element name="8.5" ref="ledrr" blend="add"><bounds x="0" y="93" width="2" height="1" /></element>
<element name="8.2" ref="led" blend="add"><bounds x="4.25" y="89" width="1.5" height="1.5" /></element> <element name="8.4" ref="ledrr" blend="add"><bounds x="0" y="96" width="2" height="1" /></element>
<element name="8.3" ref="led" blend="add"><bounds x="6.25" y="89" width="1.5" height="1.5" /></element> <element name="9.3" ref="ledrg" blend="add"><bounds x="0" y="90" width="2" height="1" /></element>
<element name="8.4" ref="led" blend="add"><bounds x="8.25" y="89" width="1.5" height="1.5" /></element> <element name="9.5" ref="ledrg" blend="add"><bounds x="0" y="93" width="2" height="1" /></element>
<element name="8.5" ref="led" blend="add"><bounds x="10.25" y="89" width="1.5" height="1.5" /></element> <element name="9.4" ref="ledrg" blend="add"><bounds x="0" y="96" width="2" height="1" /></element>
<element name="8.6" ref="led" blend="add"><bounds x="12.25" y="89" width="1.5" height="1.5" /></element>
<element name="8.7" ref="led" blend="add"><bounds x="14.25" y="89" width="1.5" height="1.5" /></element>
<element name="8.8" ref="led" blend="add"><bounds x="16.25" y="89" width="1.5" height="1.5" /></element>
<element name="8.9" ref="led" blend="add"><bounds x="18.25" y="89" width="1.5" height="1.5" /></element>
<element name="8.10" ref="led" blend="add"><bounds x="20.25" y="89" width="1.5" height="1.5" /></element>
<element name="9.0" ref="led" blend="add"><bounds x="0.25" y="91" width="1.5" height="1.5" /></element> <element ref="ledro"><bounds x="10" y="90" width="2" height="1" /></element>
<element name="9.1" ref="led" blend="add"><bounds x="2.25" y="91" width="1.5" height="1.5" /></element> <element ref="ledro"><bounds x="10" y="93" width="2" height="1" /></element>
<element name="9.2" ref="led" blend="add"><bounds x="4.25" y="91" width="1.5" height="1.5" /></element> <element ref="ledro"><bounds x="10" y="96" width="2" height="1" /></element>
<element name="9.3" ref="led" blend="add"><bounds x="6.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.4" ref="led" blend="add"><bounds x="8.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.5" ref="led" blend="add"><bounds x="10.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.6" ref="led" blend="add"><bounds x="12.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.7" ref="led" blend="add"><bounds x="14.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.8" ref="led" blend="add"><bounds x="16.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.9" ref="led" blend="add"><bounds x="18.25" y="91" width="1.5" height="1.5" /></element>
<element name="9.10" ref="led" blend="add"><bounds x="20.25" y="91" width="1.5" height="1.5" /></element>
<element name="10.0" ref="led" blend="add"><bounds x="0.25" y="93" width="1.5" height="1.5" /></element> <element name="8.6" ref="ledrr" blend="add"><bounds x="10" y="90" width="2" height="1" /></element>
<element name="10.1" ref="led" blend="add"><bounds x="2.25" y="93" width="1.5" height="1.5" /></element> <element name="8.2" ref="ledrr" blend="add"><bounds x="10" y="93" width="2" height="1" /></element>
<element name="10.2" ref="led" blend="add"><bounds x="4.25" y="93" width="1.5" height="1.5" /></element> <element name="8.0" ref="ledrr" blend="add"><bounds x="10" y="96" width="2" height="1" /></element>
<element name="10.3" ref="led" blend="add"><bounds x="6.25" y="93" width="1.5" height="1.5" /></element> <element name="9.6" ref="ledrg" blend="add"><bounds x="10" y="90" width="2" height="1" /></element>
<element name="10.4" ref="led" blend="add"><bounds x="8.25" y="93" width="1.5" height="1.5" /></element> <element name="9.2" ref="ledrg" blend="add"><bounds x="10" y="93" width="2" height="1" /></element>
<element name="10.5" ref="led" blend="add"><bounds x="10.25" y="93" width="1.5" height="1.5" /></element> <element name="9.0" ref="ledrg" blend="add"><bounds x="10" y="96" width="2" height="1" /></element>
<element name="10.6" ref="led" blend="add"><bounds x="12.25" y="93" width="1.5" height="1.5" /></element>
<element name="10.7" ref="led" blend="add"><bounds x="14.25" y="93" width="1.5" height="1.5" /></element> <element name="9.9" ref="led"><bounds x="20" y="90" width="2" height="1" /></element>
<element name="10.8" ref="led" blend="add"><bounds x="16.25" y="93" width="1.5" height="1.5" /></element> <element name="8.9" ref="led"><bounds x="24" y="90" width="2" height="1" /></element>
<element name="10.9" ref="led" blend="add"><bounds x="18.25" y="93" width="1.5" height="1.5" /></element> <element name="9.8" ref="led"><bounds x="20" y="93" width="2" height="1" /></element>
<element name="10.10" ref="led" blend="add"><bounds x="20.25" y="93" width="1.5" height="1.5" /></element> <element name="8.8" ref="led"><bounds x="24" y="93" width="2" height="1" /></element>
<element name="9.1" ref="led"><bounds x="20" y="96" width="2" height="1" /></element>
<element name="8.1" ref="led"><bounds x="24" y="96" width="2" height="1" /></element>
<element ref="ledro"><bounds x="40" y="90" width="2" height="1" /></element>
<element name="8.7" ref="ledrr" blend="add"><bounds x="40" y="90" width="2" height="1" /></element>
<element name="9.7" ref="ledrg" blend="add"><bounds x="40" y="90" width="2" height="1" /></element>
</view> </view>
</mamelayout> </mamelayout>

View File

@ -781,6 +781,21 @@ license:CC0
<group ref="displayc"><bounds x="136.5" y="17.6" width="35" height="40.03" /></group> <group ref="displayc"><bounds x="136.5" y="17.6" width="35" height="40.03" /></group>
</view> </view>
<view name="Internal Layout (Main Unit)">
<bounds left="99" right="171.5" top="17.5" bottom="88" />
<element ref="black"><bounds x="100" y="19" width="35" height="40.75" /></element>
<element ref="blackb"><bounds x="99.5" y="19.5" width="35" height="50" /></element>
<group ref="buttons"><bounds x="100" y="20" width="59" height="69" /></group>
<group ref="displayc"><bounds x="136.5" y="17.6" width="35" height="40.03" /></group>
</view>
<view name="Internal Layout (Screen)">
<group ref="display"><bounds x="20" y="20" width="100" height="114.65" /></group>
<element ref="white"><bounds x="20" y="124.5" width="100" height="2" /></element>
</view>
<view name="Internal Layout (Board)"> <view name="Internal Layout (Board)">
<bounds left="21.5" right="100.5" top="18.5" bottom="88" /> <bounds left="21.5" right="100.5" top="18.5" bottom="88" />
@ -799,19 +814,4 @@ license:CC0
</repeat> </repeat>
</view> </view>
<view name="Internal Layout (Main Unit)">
<bounds left="99" right="171.5" top="17.5" bottom="88" />
<element ref="black"><bounds x="100" y="19" width="35" height="40.75" /></element>
<element ref="blackb"><bounds x="99.5" y="19.5" width="35" height="50" /></element>
<group ref="buttons"><bounds x="100" y="20" width="59" height="69" /></group>
<group ref="displayc"><bounds x="136.5" y="17.6" width="35" height="40.03" /></group>
</view>
<view name="Internal Layout (Screen)">
<group ref="display"><bounds x="20" y="20" width="100" height="114.65" /></group>
<element ref="white"><bounds x="20" y="124.5" width="100" height="2" /></element>
</view>
</mamelayout> </mamelayout>