summaryrefslogtreecommitdiffstats
path: root/src/devices/video/zeus2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/zeus2.cpp')
-rw-r--r--src/devices/video/zeus2.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp
index 1720d98f582..8b0e4ac07d2 100644
--- a/src/devices/video/zeus2.cpp
+++ b/src/devices/video/zeus2.cpp
@@ -25,6 +25,7 @@ DEFINE_DEVICE_TYPE(ZEUS2, zeus2_device, "zeus2", "Midway Zeus2")
zeus2_device::zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ZEUS2, tag, owner, clock)
+ , device_video_interface(mconfig, *this)
, m_vblank(*this), m_irq(*this), m_atlantis(0)
{
}
@@ -37,13 +38,13 @@ TIMER_CALLBACK_MEMBER(zeus2_device::display_irq_off)
{
m_vblank(CLEAR_LINE);
- //attotime vblank_period = m_screen->time_until_pos(m_zeusbase[0x37] & 0xffff);
+ //attotime vblank_period = screen().time_until_pos(m_zeusbase[0x37] & 0xffff);
///* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
//if (vblank_period == attotime::zero)
- // vblank_period = m_screen->frame_period();
+ // vblank_period = screen().frame_period();
//vblank_timer->adjust(vblank_period);
- vblank_timer->adjust(m_screen->time_until_vblank_start());
+ vblank_timer->adjust(screen().time_until_vblank_start());
//machine().scheduler().timer_set(attotime::from_hz(30000000), timer_expired_delegate(FUNC(zeus2_device::display_irq), this));
}
@@ -51,8 +52,8 @@ TIMER_CALLBACK_MEMBER(zeus2_device::display_irq)
{
m_vblank(ASSERT_LINE);
/* set a timer for the next off state */
- //machine().scheduler().timer_set(m_screen->time_until_pos(0), timer_expired_delegate(FUNC(zeus2_device::display_irq_off), this), 0, this);
- machine().scheduler().timer_set(m_screen->time_until_vblank_end(), timer_expired_delegate(FUNC(zeus2_device::display_irq_off), this), 0, this);
+ //machine().scheduler().timer_set(screen().time_until_pos(0), timer_expired_delegate(FUNC(zeus2_device::display_irq_off), this), 0, this);
+ machine().scheduler().timer_set(screen().time_until_vblank_end(), timer_expired_delegate(FUNC(zeus2_device::display_irq_off), this), 0, this);
//machine().scheduler().timer_set(attotime::from_hz(30000000), timer_expired_delegate(FUNC(zeus2_device::display_irq_off), this));
}
@@ -77,8 +78,6 @@ void zeus2_device::device_start()
/* initialize polygon engine */
poly = auto_alloc(machine(), zeus2_renderer(this));
- //m_screen = machine().first_screen();
- m_screen = downcast<screen_device *>(machine().device("screen"));
m_vblank.resolve_safe();
m_irq.resolve_safe();
@@ -327,7 +326,7 @@ READ32_MEMBER( zeus2_device::zeus2_r )
/* bits $00080000 is tested in a loop until 0 */
/* bit $00000004 is tested for toggling; probably VBLANK */
result = 0x00;
- if (m_screen->vblank())
+ if (screen().vblank())
result |= 0x04;
break;
@@ -346,8 +345,8 @@ READ32_MEMBER( zeus2_device::zeus2_r )
case 0x54:
// VCOUNT upper 16 bits
- //result = (m_screen->vpos() << 16) | m_screen->vpos();
- result = (m_screen->vpos() << 16);
+ //result = (screen().vpos() << 16) | screen().vpos();
+ result = (screen().vpos() << 16);
break;
}
@@ -412,7 +411,7 @@ if (regdata_count[offset] < 256)
/* writes to register $CC need to force a partial update */
// if ((offset & ~1) == 0xcc)
-// m_screen->update_partial(m_screen->vpos());
+// screen().update_partial(screen().vpos());
/* always write to low word? */
m_zeusbase[offset] = data;
@@ -462,7 +461,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
int htotal = (m_zeusbase[0x34] >> 16) << m_yScale;
//rectangle visarea((m_zeusbase[0x33] >> 16) << m_yScale, htotal - 1, 0, (m_zeusbase[0x35] & 0xffff) << m_yScale);
rectangle visarea(0, hor - 1, 0, ver - 1);
- m_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)ZEUS2_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
+ screen().configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)ZEUS2_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
@@ -551,7 +550,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
{
uint32_t temp = m_zeusbase[0x38];
m_zeusbase[0x38] = oldval;
- m_screen->update_partial(m_screen->vpos());
+ screen().update_partial(screen().vpos());
log_fifo = machine().input().code_pressed(KEYCODE_L) | ALWAYS_LOG_FIFO;
m_zeusbase[0x38] = temp;
}