summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/nt7534.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/nt7534.cpp')
-rw-r--r--src/devices/video/nt7534.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/devices/video/nt7534.cpp b/src/devices/video/nt7534.cpp
index a10bbbd8575..44c21b6cb0b 100644
--- a/src/devices/video/nt7534.cpp
+++ b/src/devices/video/nt7534.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Felipe Sanches, Sandro Ronco
/***************************************************************************
- NT7534 LCD controller
+ Novatek NT7534 LCD controller
TODO:
- determine video timings and busy flag duration
@@ -10,7 +10,7 @@
***************************************************************************/
#include "emu.h"
-#include "video/nt7534.h"
+#include "nt7534.h"
#define VERBOSE 0
#include "logmacro.h"
@@ -34,6 +34,7 @@ nt7534_device::nt7534_device(const machine_config &mconfig, const char *tag, dev
nt7534_device::nt7534_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
+ , m_pixel_update_cb(*this)
{
}
@@ -43,7 +44,9 @@ nt7534_device::nt7534_device(const machine_config &mconfig, device_type type, co
void nt7534_device::device_start()
{
- m_busy_timer = timer_alloc(TIMER_BUSY);
+ m_busy_timer = timer_alloc(FUNC(nt7534_device::clear_busy_flag), this);
+
+ m_pixel_update_cb.resolve();
// state saving
save_item(NAME(m_busy_flag));
@@ -94,17 +97,12 @@ void nt7534_device::device_reset()
//-------------------------------------------------
-// device_timer - handler timer events
+// clear_busy_flag -
//-------------------------------------------------
-void nt7534_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(nt7534_device::clear_busy_flag)
{
- switch (id)
- {
- case TIMER_BUSY:
- m_busy_flag = false;
- break;
- }
+ m_busy_flag = false;
}
@@ -145,34 +143,34 @@ uint32_t nt7534_device::screen_update(screen_device &screen, bitmap_ind16 &bitma
{
uint8_t py = (y + m_display_start_line - 32) % 65;
uint8_t page = py/8;
- bitmap.pix16(y, x) = BIT(m_ddram[page*132 + px], py%8);
+ bitmap.pix(y, x) = BIT(m_ddram[page*132 + px], py%8);
}
}
return 0;
}
-READ8_MEMBER(nt7534_device::read)
+uint8_t nt7534_device::read(offs_t offset)
{
switch (offset & 0x01)
{
- case 0: return control_read(space, 0);
- case 1: return data_read(space, 0);
+ case 0: return control_read();
+ case 1: return data_read();
}
return 0;
}
-WRITE8_MEMBER(nt7534_device::write)
+void nt7534_device::write(offs_t offset, uint8_t data)
{
switch (offset & 0x01)
{
- case 0: control_write(space, 0, data); break;
- case 1: data_write(space, 0, data); break;
+ case 0: control_write(data); break;
+ case 1: data_write(data); break;
}
}
-WRITE8_MEMBER(nt7534_device::control_write)
+void nt7534_device::control_write(uint8_t data)
{
if (m_data_len == 4)
{
@@ -281,7 +279,7 @@ WRITE8_MEMBER(nt7534_device::control_write)
}
}
-READ8_MEMBER(nt7534_device::control_read)
+uint8_t nt7534_device::control_read()
{
if (m_data_len == 4)
{
@@ -299,7 +297,7 @@ READ8_MEMBER(nt7534_device::control_read)
}
}
-WRITE8_MEMBER(nt7534_device::data_write)
+void nt7534_device::data_write(uint8_t data)
{
// if (m_busy_flag)
// {
@@ -328,7 +326,7 @@ WRITE8_MEMBER(nt7534_device::data_write)
LOG("RAM write %x %x '%c'\n", m_page*132 + m_column, m_dr, isprint(m_dr) ? m_dr : '.');
- if (m_page*132 + m_column < ARRAY_LENGTH(m_ddram))
+ if (m_page*132 + m_column < std::size(m_ddram))
m_ddram[m_page*132 + m_column] = m_dr;
if (m_column < 131)
@@ -337,9 +335,9 @@ WRITE8_MEMBER(nt7534_device::data_write)
set_busy_flag(41);
}
-READ8_MEMBER(nt7534_device::data_read)
+uint8_t nt7534_device::data_read()
{
- if (m_page*132 + m_column >= ARRAY_LENGTH(m_ddram))
+ if (m_page*132 + m_column >= std::size(m_ddram))
return 0;
uint8_t data = m_ddram[m_page*132 + m_column];