summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2019-12-06 02:24:49 +0100
committer hap <happppp@users.noreply.github.com>2019-12-06 02:25:10 +0100
commitcc116dc97298912d19731a465ffc2bbd8864b81f (patch)
tree12422fdfb01a46df6b0fd3cf96033f37081a8bd8 /src/mame/drivers
parent41e5fd22e03cd78dd0b3efa7dd24141d14665208 (diff)
added LC7582 LCD Driver (nw)
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/cxg_dominator.cpp47
-rw-r--r--src/mame/drivers/hh_tms1k.cpp1
2 files changed, 44 insertions, 4 deletions
diff --git a/src/mame/drivers/cxg_dominator.cpp b/src/mame/drivers/cxg_dominator.cpp
index 264095a060b..ba27bbf2d96 100644
--- a/src/mame/drivers/cxg_dominator.cpp
+++ b/src/mame/drivers/cxg_dominator.cpp
@@ -19,7 +19,6 @@ It's also used in the newer Mephisto Modena.
TODO:
- artwork
- buttons
-- lcd
******************************************************************************/
@@ -30,7 +29,7 @@ TODO:
#include "sound/dac.h"
#include "sound/volt_reg.h"
#include "video/pwm.h"
-//#include "video/lc7582.h"
+#include "video/lc7582.h"
#include "speaker.h"
// internal artwork
@@ -45,10 +44,13 @@ public:
dominator_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_lcd(*this, "lcd"),
m_display(*this, "display"),
m_board(*this, "board"),
m_dac(*this, "dac"),
- m_inputs(*this, "IN.%u", 0)
+ m_inputs(*this, "IN.%u", 0),
+ m_digits(*this, "digit%u", 0U),
+ m_dp(*this, "dp%u", 0U)
{ }
// machine drivers
@@ -60,15 +62,19 @@ protected:
private:
// devices/pointers
required_device<cpu_device> m_maincpu;
+ required_device<lc7582_device> m_lcd;
required_device<pwm_display_device> m_display;
required_device<sensorboard_device> m_board;
required_device<dac_bit_interface> m_dac;
required_ioport_array<2> m_inputs;
+ output_finder<8> m_digits;
+ output_finder<2> m_dp;
// address maps
void main_map(address_map &map);
// I/O handlers
+ DECLARE_WRITE64_MEMBER(lcd_s_w);
DECLARE_WRITE8_MEMBER(control_w);
DECLARE_WRITE8_MEMBER(leds_w);
DECLARE_READ8_MEMBER(input_r);
@@ -76,6 +82,8 @@ private:
void dominator_state::machine_start()
{
+ m_digits.resolve();
+ m_dp.resolve();
}
@@ -84,11 +92,39 @@ void dominator_state::machine_start()
I/O
******************************************************************************/
+// LCD
+
+WRITE64_MEMBER(dominator_state::lcd_s_w)
+{
+ u8 d[4];
+
+ // 1st digit: S1-S9, unused middle vertical segments
+ // 2nd digit: S10-S18, unused bottom-right diagonal segment
+ // 3rd digit: S21-S27
+ // 4th digit: S28-S34
+ d[0] = bitswap<9>(data >> 0 & 0x1ff, 2,7,5,4,3,1,0,8,6) & 0x7f;
+ d[1] = bitswap<9>(data >> 9 & 0x1ff, 7,6,4,2,0,8,5,3,1) & 0x7f;
+ d[2] = bitswap<7>(data >> 20 & 0x7f, 3,5,1,0,2,6,4);
+ d[3] = bitswap<7>(data >> 27 & 0x7f, 4,2,0,6,5,3,1);
+
+ for (int i = 0; i < 4; i++)
+ m_digits[offset * 4 + i] = d[i];
+
+ // colon: S17 (part of 2nd digit)
+ m_dp[offset] = BIT(data, 16);
+}
+
+
+// TTL
+
WRITE8_MEMBER(dominator_state::control_w)
{
// d0: LC7582 DATA
// d1: LC7582 CLK
// d2: LC7582 CE
+ m_lcd->data_w(BIT(data, 0));
+ m_lcd->clk_w(BIT(data, 1));
+ m_lcd->ce_w(BIT(data, 2));
// d3: speaker out
m_dac->write(BIT(data, 3));
@@ -170,7 +206,7 @@ void dominator_state::dominator(machine_config &config)
R65C02(config, m_maincpu, 4_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &dominator_state::main_map);
- const attotime irq_period = attotime::from_hz(4_MHz_XTAL / 0x4000); // from 4020
+ const attotime irq_period = attotime::from_hz(4_MHz_XTAL / 0x2000); // from 4020
m_maincpu->set_periodic_int(FUNC(dominator_state::nmi_line_pulse), irq_period);
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
@@ -178,6 +214,9 @@ void dominator_state::dominator(machine_config &config)
m_board->set_delay(attotime::from_msec(150));
/* video hardware */
+ LC7582(config, m_lcd, 0);
+ m_lcd->write_segs().set(FUNC(dominator_state::lcd_s_w));
+
PWM_DISPLAY(config, m_display).set_size(10, 8);
//config.set_default_layout(layout_cxg_dominator);
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index 8abea869492..0463f4ac7cb 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -54,6 +54,7 @@
@MP1218 TMS1100 1980, Entex Basketball 2 (6010)
@MP1219 TMS1100 1980, U.S. Games Super Sports-4
@MP1221 TMS1100 1980, Entex Raise The Devil (6011)
+ *MP1231 TMS1100 1983, Tandy 3-in-1 Sports Arena (model 60-2178)
*MP1296 TMS1100? 1982, Entex Black Knight
@MP1312 TMS1100 1983, Gakken FX-Micom R-165/Tandy Radio Shack Science Fair Microcomputer Trainer
*MP1359 TMS1100? 1985, Capsela CRC2000