summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2019-06-30 20:39:38 +0200
committer hap <happppp@users.noreply.github.com>2019-06-30 20:39:52 +0200
commit4acf604089513be82f07e2afc88be27ab807ff00 (patch)
tree3856066d3d63c8d81bf6535cf96ee70457a2ce2e
parent2826bee8c9011704dee07e0a1d18d1e06d7e9a32 (diff)
sforte: improve lcd_data_w (nw)
-rw-r--r--src/mame/drivers/novag_sexpert.cpp38
-rw-r--r--src/mame/layout/novag_sforte.lay34
-rw-r--r--src/mame/layout/tascr30.lay16
3 files changed, 49 insertions, 39 deletions
diff --git a/src/mame/drivers/novag_sexpert.cpp b/src/mame/drivers/novag_sexpert.cpp
index c25f6e72779..2990a4e3448 100644
--- a/src/mame/drivers/novag_sexpert.cpp
+++ b/src/mame/drivers/novag_sexpert.cpp
@@ -18,9 +18,6 @@ I/O via TTL, hardware design was very awkward.
Super Forte is very similar, just a cheaper plastic case and chessboard buttons
instead of magnet sensors.
-TODO:
-- sforte lcd_data_w implementation is wrong, especially led handling
-
******************************************************************************/
#include "emu.h"
@@ -160,6 +157,9 @@ public:
// machine drivers
void sforte(machine_config &config);
+protected:
+ virtual void machine_start() override;
+
private:
// address maps
void sforte_map(address_map &map);
@@ -167,8 +167,17 @@ private:
// I/O handlers
virtual DECLARE_WRITE8_MEMBER(lcd_control_w) override;
virtual DECLARE_WRITE8_MEMBER(lcd_data_w) override;
+
+ TIMER_CALLBACK_MEMBER(beep) { m_beeper->set_state(param); }
+ emu_timer *m_beeptimer;
};
+void sforte_state::machine_start()
+{
+ sexpert_state::machine_start();
+ m_beeptimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sforte_state::beep),this));
+}
+
/******************************************************************************
@@ -278,23 +287,24 @@ WRITE8_MEMBER(sforte_state::lcd_control_w)
// LCD pins: same as sexpert
sexpert_state::lcd_control_w(space, offset, data);
+ lcd_data_w(space, 0, m_lcd_data); // refresh inp mux
}
WRITE8_MEMBER(sforte_state::lcd_data_w)
{
- // d0-d2: input mux/led select
- m_inp_mux = 1 << (data & 7);
+ // d0-d2: 74145 to input mux/led select
+ // 74145 D from lcd control d2 (HD44780 E)
+ m_inp_mux = 1 << ((m_lcd_control << 1 & 8) | (data & 7));
- // if lcd is disabled, misc control
- if (~m_lcd_control & 4)
- {
- // d5,d6: led data, but not both at same time?
- m_led_data = ((data & 0x60) != 0x60) ? (data >> 5 & 3) : 0;
- update_display();
+ // d5,d6: led data
+ m_led_data = ~data >> 5 & 3;
+ update_display();
- // d7: enable beeper
- m_beeper->set_state(data >> 7 & 1);
- }
+ // d7: enable beeper
+ // capacitor for noise filter (sound glitches otherwise)
+ u8 param = data >> 7 & 1;
+ if (param != m_beeptimer->param())
+ m_beeptimer->adjust(attotime::from_msec(1), param);
// LCD pins: same as sexpert
sexpert_state::lcd_data_w(space, offset, data);
diff --git a/src/mame/layout/novag_sforte.lay b/src/mame/layout/novag_sforte.lay
index 86a08917bcf..3b1bd194ea7 100644
--- a/src/mame/layout/novag_sforte.lay
+++ b/src/mame/layout/novag_sforte.lay
@@ -432,23 +432,23 @@
<!-- chessboard leds -->
- <bezel name="7.1" element="ledr"><bounds x="1" y="7.5" width="2" height="1" /></bezel>
- <bezel name="6.1" element="ledr"><bounds x="1" y="17.5" width="2" height="1" /></bezel>
- <bezel name="5.1" element="ledr"><bounds x="1" y="27.5" width="2" height="1" /></bezel>
- <bezel name="4.1" element="ledr"><bounds x="1" y="37.5" width="2" height="1" /></bezel>
- <bezel name="3.1" element="ledr"><bounds x="1" y="47.5" width="2" height="1" /></bezel>
- <bezel name="2.1" element="ledr"><bounds x="1" y="57.5" width="2" height="1" /></bezel>
- <bezel name="1.1" element="ledr"><bounds x="1" y="67.5" width="2" height="1" /></bezel>
- <bezel name="0.1" element="ledr"><bounds x="1" y="77.5" width="2" height="1" /></bezel>
-
- <bezel name="7.0" element="ledr"><bounds x="8.5" y="84" width="1" height="2" /></bezel>
- <bezel name="6.0" element="ledr"><bounds x="18.5" y="84" width="1" height="2" /></bezel>
- <bezel name="5.0" element="ledr"><bounds x="28.5" y="84" width="1" height="2" /></bezel>
- <bezel name="4.0" element="ledr"><bounds x="38.5" y="84" width="1" height="2" /></bezel>
- <bezel name="3.0" element="ledr"><bounds x="48.5" y="84" width="1" height="2" /></bezel>
- <bezel name="2.0" element="ledr"><bounds x="58.5" y="84" width="1" height="2" /></bezel>
- <bezel name="1.0" element="ledr"><bounds x="68.5" y="84" width="1" height="2" /></bezel>
- <bezel name="0.0" element="ledr"><bounds x="78.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="7.0" element="ledr"><bounds x="1" y="7.5" width="2" height="1" /></bezel>
+ <bezel name="6.0" element="ledr"><bounds x="1" y="17.5" width="2" height="1" /></bezel>
+ <bezel name="5.0" element="ledr"><bounds x="1" y="27.5" width="2" height="1" /></bezel>
+ <bezel name="4.0" element="ledr"><bounds x="1" y="37.5" width="2" height="1" /></bezel>
+ <bezel name="3.0" element="ledr"><bounds x="1" y="47.5" width="2" height="1" /></bezel>
+ <bezel name="2.0" element="ledr"><bounds x="1" y="57.5" width="2" height="1" /></bezel>
+ <bezel name="1.0" element="ledr"><bounds x="1" y="67.5" width="2" height="1" /></bezel>
+ <bezel name="0.0" element="ledr"><bounds x="1" y="77.5" width="2" height="1" /></bezel>
+
+ <bezel name="7.1" element="ledr"><bounds x="8.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="6.1" element="ledr"><bounds x="18.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="5.1" element="ledr"><bounds x="28.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="4.1" element="ledr"><bounds x="38.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="3.1" element="ledr"><bounds x="48.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="2.1" element="ledr"><bounds x="58.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="1.1" element="ledr"><bounds x="68.5" y="84" width="1" height="2" /></bezel>
+ <bezel name="0.1" element="ledr"><bounds x="78.5" y="84" width="1" height="2" /></bezel>
<!-- lcd panel -->
diff --git a/src/mame/layout/tascr30.lay b/src/mame/layout/tascr30.lay
index 180f01fb6f8..b709e453870 100644
--- a/src/mame/layout/tascr30.lay
+++ b/src/mame/layout/tascr30.lay
@@ -247,14 +247,14 @@
<param name="y" start="1" increment="10" />
<param name="i" start="8" increment="-1" />
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x01"><bounds x="1" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x02"><bounds x="11" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x04"><bounds x="21" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x08"><bounds x="31" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x10"><bounds x="41" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x20"><bounds x="51" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x40"><bounds x="61" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
- <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x80"><bounds x="71" y="~y~" width="10" height="10" /><color alpha="0.1" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x01"><bounds x="1" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x02"><bounds x="11" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x04"><bounds x="21" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x08"><bounds x="31" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x10"><bounds x="41" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x20"><bounds x="51" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x40"><bounds x="61" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
+ <bezel element="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x80"><bounds x="71" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel>
<bezel name="piece_a~i~" element="piece"><bounds x="1" y="~y~" width="10" height="10" /></bezel>
<bezel name="piece_b~i~" element="piece"><bounds x="11" y="~y~" width="10" height="10" /></bezel>