mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
add md4330/4332 lcd driver (nw)
This commit is contained in:
parent
b02df00ba0
commit
0617790932
@ -615,6 +615,18 @@ if (VIDEOS["MC6847"]~=null) then
|
||||
}
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
--
|
||||
--@src/devices/video/md4330b.h,VIDEOS["MD4330B"] = true
|
||||
--------------------------------------------------
|
||||
|
||||
if (VIDEOS["MD4330B"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/video/md4330b.cpp",
|
||||
MAME_DIR .. "src/devices/video/md4330b.h",
|
||||
}
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
--
|
||||
--@src/devices/video/mm5445.h,VIDEOS["MM5445"] = true
|
||||
|
@ -328,6 +328,7 @@ VIDEOS["MB90082"] = true
|
||||
VIDEOS["MB_VCU"] = true
|
||||
VIDEOS["MC6845"] = true
|
||||
--VIDEOS["MC6847"] = true
|
||||
--VIDEOS["MD4330B"] = true
|
||||
--VIDEOS["MM5445"] = true
|
||||
--VIDEOS["MSM6222B"] = true
|
||||
--VIDEOS["MSM6255"] = true
|
||||
|
@ -349,6 +349,7 @@ VIDEOS["IMS_CVC"] = true
|
||||
--VIDEOS["MB_VCU"] = true
|
||||
VIDEOS["MC6845"] = true
|
||||
VIDEOS["MC6847"] = true
|
||||
VIDEOS["MD4330B"] = true
|
||||
VIDEOS["MM5445"] = true
|
||||
VIDEOS["MSM6222B"] = true
|
||||
VIDEOS["MSM6255"] = true
|
||||
|
104
src/devices/video/md4330b.cpp
Normal file
104
src/devices/video/md4330b.cpp
Normal file
@ -0,0 +1,104 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
/*
|
||||
|
||||
Mitel MD4330B / MD4332B LCD Driver
|
||||
|
||||
It's a simple shift register CMOS LCD driver.
|
||||
'30 has 30 segments, '32 has 32. The "C" versions are ceramic chips, the "E" are epoxy.
|
||||
|
||||
TODO:
|
||||
- RST pin (asynchronous on MD4332B)
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/md4330b.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(MD4330B, md4330b_device, "md4330b", "Mitel MD4330B LCD Driver")
|
||||
DEFINE_DEVICE_TYPE(MD4332B, md4332b_device, "md4332b", "Mitel MD4332B LCD Driver")
|
||||
|
||||
//-------------------------------------------------
|
||||
// constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
md4330b_device::md4330b_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 qmax) :
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
m_qmax(qmax), m_write_q(*this), m_write_do(*this)
|
||||
{ }
|
||||
|
||||
md4330b_device::md4330b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
md4330b_device(mconfig, MD4330B, tag, owner, clock, 30)
|
||||
{ }
|
||||
|
||||
md4332b_device::md4332b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
md4330b_device(mconfig, MD4332B, tag, owner, clock, 32)
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void md4330b_device::device_start()
|
||||
{
|
||||
// resolve callbacks
|
||||
m_write_q.resolve_safe();
|
||||
m_write_do.resolve_safe();
|
||||
|
||||
// zerofill
|
||||
m_shift = 0;
|
||||
m_clk = 0;
|
||||
m_di = 0;
|
||||
m_do = 0;
|
||||
m_rst = 0;
|
||||
m_tc = 0;
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_shift));
|
||||
save_item(NAME(m_clk));
|
||||
save_item(NAME(m_di));
|
||||
save_item(NAME(m_do));
|
||||
save_item(NAME(m_rst));
|
||||
save_item(NAME(m_tc));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
void md4330b_device::update_q()
|
||||
{
|
||||
u32 out = m_shift;
|
||||
if (m_tc)
|
||||
out = ~out;
|
||||
out &= (1 << m_qmax) - 1;
|
||||
|
||||
m_write_q(0, out);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(md4330b_device::clk_w)
|
||||
{
|
||||
state = (state) ? 1 : 0;
|
||||
|
||||
// shift on rising edge
|
||||
if (state && !m_clk)
|
||||
{
|
||||
// DO pin follows carry out
|
||||
m_do = (m_rst) ? 0 : BIT(m_shift, m_qmax-1);
|
||||
|
||||
if (m_rst)
|
||||
m_shift = 0;
|
||||
else
|
||||
m_shift = (m_shift << 1) | m_di;
|
||||
|
||||
// output
|
||||
update_q();
|
||||
m_write_do(m_do);
|
||||
}
|
||||
|
||||
m_clk = state;
|
||||
}
|
91
src/devices/video/md4330b.h
Normal file
91
src/devices/video/md4330b.h
Normal file
@ -0,0 +1,91 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
/*
|
||||
|
||||
Mitel MD4330B / MD4332B LCD Driver
|
||||
|
||||
*/
|
||||
|
||||
#ifndef MAME_VIDEO_MD4330B_H
|
||||
#define MAME_VIDEO_MD4330B_H
|
||||
|
||||
#pragma once
|
||||
|
||||
// pinout reference
|
||||
|
||||
/*
|
||||
____ ____ ____ ____
|
||||
_T/C 1 |* \_/ | 40 VDD _T/C 1 |* \_/ | 40 VDD
|
||||
DI 2 | | 39 CLK DI 2 | | 39 CLK
|
||||
NC 3 | | 38 RST NC 3 | | 38 RST
|
||||
NC 4 | | 37 DO Q1 4 | | 37 DO
|
||||
Q1 5 | | 36 Q30 Q2 5 | | 36 Q32
|
||||
Q2 6 | | 35 Q29 Q3 6 | | 35 Q31
|
||||
Q3 7 | | 34 Q28 Q4 7 | | 34 Q30
|
||||
Q4 8 | | 33 Q27 Q5 8 | | 33 Q29
|
||||
Q5 9 | | 32 Q26 Q6 9 | | 32 Q28
|
||||
Q6 10 | MD4330BC | 31 Q25 Q7 10 | MD4332BC | 31 Q27
|
||||
Q7 11 | MD4330BE | 30 Q24 Q8 11 | MD4332BE | 30 Q26
|
||||
Q8 12 | | 29 Q23 Q9 12 | | 29 Q25
|
||||
Q9 13 | | 28 Q22 Q10 13 | | 28 Q24
|
||||
Q10 14 | | 27 Q21 Q11 14 | | 27 Q23
|
||||
Q11 15 | | 26 Q20 Q12 15 | | 26 Q22
|
||||
Q12 16 | | 25 Q19 Q13 16 | | 25 Q21
|
||||
Q13 17 | | 24 Q18 Q14 17 | | 24 Q20
|
||||
Q14 18 | | 23 Q17 Q15 18 | | 23 Q19
|
||||
Q15 19 | | 22 Q16 Q16 19 | | 22 Q18
|
||||
VSS 20 |___________| 21 NC VSS 20 |___________| 21 Q17
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class md4330b_device : public device_t
|
||||
{
|
||||
public:
|
||||
md4330b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
// configuration helpers
|
||||
auto write_q() { return m_write_q.bind(); }
|
||||
auto write_do() { return m_write_do.bind(); }
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(clk_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(tc_w) { m_tc = (state) ? 1 : 0; update_q(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(di_w) { m_di = (state) ? 1 : 0; }
|
||||
DECLARE_WRITE_LINE_MEMBER(rst_w) { m_rst = (state) ? 1 : 0; }
|
||||
DECLARE_READ_LINE_MEMBER(do_r) { return m_do; }
|
||||
|
||||
protected:
|
||||
md4330b_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 qmax);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
void update_q();
|
||||
|
||||
const u8 m_qmax; // number of Q pins
|
||||
u32 m_shift;
|
||||
|
||||
// pin state
|
||||
int m_clk;
|
||||
int m_di;
|
||||
int m_do;
|
||||
int m_rst;
|
||||
int m_tc;
|
||||
|
||||
// callbacks
|
||||
devcb_write32 m_write_q;
|
||||
devcb_write_line m_write_do;
|
||||
};
|
||||
|
||||
|
||||
class md4332b_device : public md4330b_device
|
||||
{
|
||||
public:
|
||||
md4332b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
|
||||
};
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(MD4330B, md4330b_device)
|
||||
DECLARE_DEVICE_TYPE(MD4332B, md4332b_device)
|
||||
|
||||
#endif // MAME_VIDEO_MD4330B_H
|
@ -512,6 +512,7 @@ void eag_state::eag2100(machine_config &config)
|
||||
eag(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_clock(6_MHz_XTAL);
|
||||
m_mainmap->set_addrmap(AS_PROGRAM, &eag_state::eag2100_map);
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ TODO:
|
||||
#include "machine/timer.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/volt_reg.h"
|
||||
#include "video/md4330b.h"
|
||||
#include "video/pwm.h"
|
||||
|
||||
#include "screen.h"
|
||||
@ -32,6 +33,7 @@ public:
|
||||
ssystem3_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_dac(*this, "dac"),
|
||||
m_inputs(*this, "IN.%u", 0)
|
||||
@ -46,8 +48,9 @@ protected:
|
||||
private:
|
||||
// devices/pointers
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<md4332b_device> m_lcd;
|
||||
required_device<pwm_display_device> m_display;
|
||||
optional_device<dac_bit_interface> m_dac;
|
||||
required_device<dac_bit_interface> m_dac;
|
||||
required_ioport_array<4> m_inputs;
|
||||
|
||||
// address maps
|
||||
@ -129,6 +132,7 @@ void ssystem3_state::ssystem3(machine_config &config)
|
||||
//NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
||||
|
||||
/* video hardware */
|
||||
MD4332B(config, m_lcd);
|
||||
PWM_DISPLAY(config, m_display).set_size(4, 4);
|
||||
//config.set_default_layout(layout_saitek_ssystem3);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user