diff options
Diffstat (limited to 'src/devices/video/hd44352.cpp')
-rw-r--r-- | src/devices/video/hd44352.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/devices/video/hd44352.cpp b/src/devices/video/hd44352.cpp index 7fa4b53f1d0..91e1c0ff305 100644 --- a/src/devices/video/hd44352.cpp +++ b/src/devices/video/hd44352.cpp @@ -7,7 +7,9 @@ ***************************************************************************/ #include "emu.h" -#include "video/hd44352.h" +#include "hd44352.h" + +#include "screen.h" #define LCD_BYTE_INPUT 0x01 #define LCD_BYTE_OUTPUT 0x02 @@ -55,9 +57,7 @@ void hd44352_device::device_validity_check(validity_checker &valid) const void hd44352_device::device_start() { - m_on_cb.resolve_safe(); - - m_on_timer = timer_alloc(ON_TIMER); + m_on_timer = timer_alloc(FUNC(hd44352_device::on_tick), this); m_on_timer->adjust(attotime::from_hz(m_clock/16384), 0, attotime::from_hz(m_clock/16384)); save_item( NAME(m_control_lines)); @@ -112,20 +112,12 @@ void hd44352_device::device_reset() } -//------------------------------------------------- -// device_timer - handler timer events -//------------------------------------------------- -void hd44352_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +TIMER_CALLBACK_MEMBER(hd44352_device::on_tick) { - switch(id) + if (m_control_lines & 0x40) { - case ON_TIMER: - if (m_control_lines & 0x40) - { - m_on_cb(ASSERT_LINE); - m_on_cb(CLEAR_LINE); - } - break; + m_on_cb(ASSERT_LINE); + m_on_cb(CLEAR_LINE); } } @@ -142,6 +134,11 @@ uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitm if (m_control_lines&0x80 && m_lcd_on) { for (int a=0; a<2; a++) + { + // drivers can be arranged as 96x64 or 192x32 when char width is 6 + const unsigned sx = (a * 16 * cw) % screen.width(); + const unsigned sy = (a * 32) % screen.height(); + for (int py=0; py<4; py++) for (int px=0; px<16; px++) if (BIT(m_cursor_status, 4) && px == m_cursor_x && py == m_cursor_y && a == m_cursor_lcd) @@ -152,7 +149,7 @@ uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitm uint8_t d = compute_newval((m_cursor_status>>5) & 0x07, m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48], m_cursor[c]); for (int b=0; b<8; b++) { - bitmap.pix16(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b); + bitmap.pix(sy + py*8 + b, sx + px*cw + c) = BIT(d, 7-b); } } } @@ -163,10 +160,11 @@ uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitm uint8_t d = m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48]; for (int b=0; b<8; b++) { - bitmap.pix16(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b); + bitmap.pix(sy + py*8 + b, sx + px*cw + c) = BIT(d, 7-b); } } } + } } return 0; |