summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/crt9007.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/crt9007.cpp')
-rw-r--r--src/devices/video/crt9007.cpp178
1 files changed, 81 insertions, 97 deletions
diff --git a/src/devices/video/crt9007.cpp b/src/devices/video/crt9007.cpp
index 3a32da74f44..6bbafceebae 100644
--- a/src/devices/video/crt9007.cpp
+++ b/src/devices/video/crt9007.cpp
@@ -476,42 +476,19 @@ crt9007_device::crt9007_device(const machine_config &mconfig, const char *tag, d
//-------------------------------------------------
-// device_resolve_objects - resolve objects that
-// may be needed for other devices to set
-// initial conditions at start time
-//-------------------------------------------------
-
-void crt9007_device::device_resolve_objects()
-{
- // resolve callbacks
- m_write_int.resolve_safe();
- m_write_dmar.resolve_safe();
- m_write_hs.resolve_safe();
- m_write_vs.resolve_safe();
- m_write_vlt.resolve_safe();
- m_write_curs.resolve_safe();
- m_write_drb.resolve_safe();
- m_write_wben.resolve_safe();
- m_write_cblank.resolve_safe();
- m_write_slg.resolve_safe();
- m_write_sld.resolve_safe();
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void crt9007_device::device_start()
{
// allocate timers
- m_hsync_timer = timer_alloc(TIMER_HSYNC);
- m_vsync_timer = timer_alloc(TIMER_VSYNC);
- m_vlt_timer = timer_alloc(TIMER_VLT);
- m_curs_timer = timer_alloc(TIMER_CURS);
- m_drb_timer = timer_alloc(TIMER_DRB);
- m_dma_timer = timer_alloc(TIMER_DMA);
- m_frame_timer = timer_alloc(TIMER_FRAME);
+ m_hsync_timer = timer_alloc(FUNC(crt9007_device::hsync_update), this);
+ m_vsync_timer = timer_alloc(FUNC(crt9007_device::vsync_update), this);
+ m_vlt_timer = timer_alloc(FUNC(crt9007_device::vlt_update), this);
+ m_curs_timer = timer_alloc(FUNC(crt9007_device::cursor_update), this);
+ m_drb_timer = timer_alloc(FUNC(crt9007_device::drb_update), this);
+ m_dma_timer = timer_alloc(FUNC(crt9007_device::dma_update), this);
+ m_frame_timer = timer_alloc(FUNC(crt9007_device::frame_update), this);
// save state
save_item(NAME(m_reg));
@@ -605,100 +582,97 @@ void crt9007_device::device_clock_changed()
//-------------------------------------------------
-// device_timer - handle timer events
+// timer events
//-------------------------------------------------
-void crt9007_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(crt9007_device::hsync_update)
{
- int x = screen().hpos();
- int y = screen().vpos();
+ m_hs = bool(param);
- switch (id)
- {
- case TIMER_HSYNC:
- m_hs = bool(param);
+ LOG("CRT9007 y %03u x %04u : HS %u\n", screen().vpos(), screen().hpos(), m_hs);
- LOG("CRT9007 y %03u x %04u : HS %u\n", y, x, m_hs);
+ m_write_hs(m_hs);
- m_write_hs(m_hs);
+ update_cblank_line();
- update_cblank_line();
-
- update_hsync_timer(m_hs);
- break;
+ update_hsync_timer(m_hs);
+}
- case TIMER_VSYNC:
- m_vs = bool(param);
+TIMER_CALLBACK_MEMBER(crt9007_device::vsync_update)
+{
+ m_vs = bool(param);
- LOG("CRT9007 y %03u x %04u : VS %u\n", y, x, m_vs);
+ LOG("CRT9007 y %03u x %04u : VS %u\n", screen().vpos(), screen().hpos(), m_vs);
- m_write_vs(m_vs);
+ m_write_vs(m_vs);
- if (m_vs)
- {
- // reset all other bits except Light Pen Update to logic 0
- m_status &= (STATUS_LIGHT_PEN_UPDATE | STATUS_INTERRUPT_PENDING);
- }
- else
- {
- trigger_interrupt(IE_VERTICAL_RETRACE);
+ if (m_vs)
+ {
+ // reset all other bits except Light Pen Update to logic 0
+ m_status &= (STATUS_LIGHT_PEN_UPDATE | STATUS_INTERRUPT_PENDING);
+ }
+ else
+ {
+ trigger_interrupt(IE_VERTICAL_RETRACE);
- update_cblank_line();
- }
+ update_cblank_line();
+ }
- update_vsync_timer(m_vs);
- break;
+ update_vsync_timer(m_vs);
+}
- case TIMER_VLT:
- m_vlt = bool(param);
+TIMER_CALLBACK_MEMBER(crt9007_device::vlt_update)
+{
+ m_vlt = bool(param);
- LOG("CRT9007 y %03u x %04u : VLT %u\n", y, x, m_vlt);
+ LOG("CRT9007 y %03u x %04u : VLT %u\n", screen().vpos(), screen().hpos(), m_vlt);
- m_write_vlt(m_vlt);
+ m_write_vlt(m_vlt);
- update_vlt_timer(m_vlt);
- break;
+ update_vlt_timer(m_vlt);
+}
- case TIMER_CURS:
- LOG("CRT9007 y %03u x %04u : CURS %u\n", y, x, param);
+TIMER_CALLBACK_MEMBER(crt9007_device::cursor_update)
+{
+ LOG("CRT9007 y %03u x %04u : CURS %u\n", screen().vpos(), screen().hpos(), param);
- m_write_curs(param);
+ m_write_curs(param);
- update_curs_timer(param);
- break;
+ update_curs_timer(param);
+}
- case TIMER_DRB:
- m_drb = bool(param);
+TIMER_CALLBACK_MEMBER(crt9007_device::drb_update)
+{
+ m_drb = bool(param);
- LOG("CRT9007 y %03u x %04u : DRB %u\n", y, x, m_drb);
+ LOG("CRT9007 y %03u x %04u : DRB %u\n", screen().vpos(), screen().hpos(), m_drb);
- m_write_drb(m_drb);
+ m_write_drb(m_drb);
- if (!m_drb && !DMA_DISABLE)
- {
- // start DMA burst sequence
- m_dma_count = CHARACTERS_PER_DATA_ROW;
- m_dma_burst = DMA_BURST_COUNT ? (DMA_BURST_COUNT * 4) : CHARACTERS_PER_DATA_ROW;
- m_dma_delay = DMA_BURST_DELAY;
- m_dmar = true;
-
- LOG("CRT9007 DMAR 1\n");
- m_write_dmar(ASSERT_LINE);
- }
-
- update_drb_timer(m_drb);
- break;
+ if (!m_drb && !DMA_DISABLE)
+ {
+ // start DMA burst sequence
+ m_dma_count = CHARACTERS_PER_DATA_ROW;
+ m_dma_burst = DMA_BURST_COUNT ? (DMA_BURST_COUNT * 4) : CHARACTERS_PER_DATA_ROW;
+ m_dma_delay = DMA_BURST_DELAY;
+ m_dmar = true;
+
+ LOG("CRT9007 DMAR 1\n");
+ m_write_dmar(ASSERT_LINE);
+ }
- case TIMER_DMA:
- readbyte(AUXILIARY_ADDRESS_2);
+ update_drb_timer(m_drb);
+}
- update_dma_timer();
- break;
+TIMER_CALLBACK_MEMBER(crt9007_device::dma_update)
+{
+ readbyte(AUXILIARY_ADDRESS_2);
+ update_dma_timer();
+}
- case TIMER_FRAME:
- trigger_interrupt(IE_FRAME_TIMER);
- break;
- }
+TIMER_CALLBACK_MEMBER(crt9007_device::frame_update)
+{
+ trigger_interrupt(IE_FRAME_TIMER);
}
@@ -976,3 +950,13 @@ void crt9007_device::set_character_width(unsigned value)
if (started())
recompute_parameters();
}
+
+
+//-------------------------------------------------
+// cursor_active - is cursor active at location
+//-------------------------------------------------
+
+bool crt9007_device::cursor_active(unsigned x, unsigned y)
+{
+ return (x == HORIZONTAL_CURSOR && y == VERTICAL_CURSOR);
+}