summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/hd61830.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/hd61830.cpp')
-rw-r--r--src/devices/video/hd61830.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp
index 15e9930721f..d499b873ba3 100644
--- a/src/devices/video/hd61830.cpp
+++ b/src/devices/video/hd61830.cpp
@@ -21,7 +21,6 @@
//**************************************************************************
DEFINE_DEVICE_TYPE(HD61830, hd61830_device, "hd61830", "Hitachi HD61830B LCD Controller")
-decltype(HD61830) HD61830B = HD61830;
// default address map
@@ -80,7 +79,7 @@ hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, d
device_t(mconfig, HD61830, tag, owner, clock),
device_memory_interface(mconfig, *this),
device_video_interface(mconfig, *this),
- m_read_rd(*this),
+ m_read_rd(*this, 0),
m_bf(false),
m_cac(0),
m_blink(0),
@@ -98,10 +97,7 @@ hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, d
void hd61830_device::device_start()
{
// allocate timers
- m_busy_timer = timer_alloc();
-
- // resolve callbacks
- m_read_rd.resolve_safe(0);
+ m_busy_timer = timer_alloc(FUNC(hd61830_device::clear_busy_flag), this);
// register for state saving
save_item(NAME(m_bf));
@@ -135,12 +131,11 @@ void hd61830_device::device_reset()
//-------------------------------------------------
-// device_timer - handler timer events
+// clear_busy_flag -
//-------------------------------------------------
-void hd61830_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(hd61830_device::clear_busy_flag)
{
- // clear busy flag
m_bf = false;
}
@@ -177,7 +172,7 @@ void hd61830_device::set_busy_flag()
// status_r - status register read
//-------------------------------------------------
-READ8_MEMBER( hd61830_device::status_r )
+uint8_t hd61830_device::status_r()
{
LOG("HD61830 Status Read: %s\n", m_bf ? "busy" : "ready");
@@ -189,7 +184,7 @@ READ8_MEMBER( hd61830_device::status_r )
// control_w - instruction register write
//-------------------------------------------------
-WRITE8_MEMBER( hd61830_device::control_w )
+void hd61830_device::control_w(uint8_t data)
{
m_ir = data;
}
@@ -199,7 +194,7 @@ WRITE8_MEMBER( hd61830_device::control_w )
// data_r - data register read
//-------------------------------------------------
-READ8_MEMBER( hd61830_device::data_r )
+uint8_t hd61830_device::data_r()
{
uint8_t data = m_dor;
@@ -217,7 +212,7 @@ READ8_MEMBER( hd61830_device::data_r )
// data_w - data register write
//-------------------------------------------------
-WRITE8_MEMBER( hd61830_device::data_w )
+void hd61830_device::data_w(uint8_t data)
{
if (m_bf)
{
@@ -360,9 +355,9 @@ uint16_t hd61830_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cl
if(y >= 0 && y < bitmap.height())
{
if(((sx * m_hp) + x) >= 0 && ((sx * m_hp) + x) < bitmap.width())
- bitmap.pix16(y, (sx * m_hp) + x) = BIT(data1, x);
+ bitmap.pix(y, (sx * m_hp) + x) = BIT(data1, x);
if(((sx * m_hp) + x + m_hp) >= 0 && ((sx * m_hp) + x + m_hp) < bitmap.width())
- bitmap.pix16(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
+ bitmap.pix(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
}
}
}
@@ -440,7 +435,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
{
// cursor off, character blink
if (!cursor)
- pixel = m_cursor ? pixel : 0;
+ pixel = m_cursor ? 1 : pixel;
// cursor blink
if (cursor && (cl == m_cp))
@@ -454,7 +449,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
}
if (sy < screen().height() && sx < screen().width())
- bitmap.pix16(sy, sx) = pixel;
+ bitmap.pix(sy, sx) = pixel;
}
}
}
@@ -483,8 +478,8 @@ void hd61830_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect
md1 = readbyte(rac2);
md2 = readbyte(rac2+1);
- draw_char(bitmap, cliprect, ma, x, y + rows, md1);
- draw_char(bitmap, cliprect, ma+1, x+1, y + rows, md2);
+ draw_char(bitmap, cliprect, ma + (rows * m_hn), x, y + rows, md1);
+ draw_char(bitmap, cliprect, ma+1 + (rows * m_hn), x+1, y + rows, md2);
ma+=2;
rac1+=2;