summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/315_5124.cpp50
-rw-r--r--src/devices/video/315_5124.h2
-rw-r--r--src/devices/video/315_5313.cpp8
-rw-r--r--src/devices/video/cdp1861.cpp24
-rw-r--r--src/devices/video/cdp1862.cpp6
-rw-r--r--src/devices/video/crt9007.cpp32
-rw-r--r--src/devices/video/crt9021.cpp4
-rw-r--r--src/devices/video/crtc_ega.cpp8
-rw-r--r--src/devices/video/ef9340_1.cpp6
-rw-r--r--src/devices/video/ef9345.cpp16
-rw-r--r--src/devices/video/ef9364.cpp8
-rw-r--r--src/devices/video/ef9365.cpp8
-rw-r--r--src/devices/video/gb_lcd.cpp6
-rw-r--r--src/devices/video/gba_lcd.cpp2
-rw-r--r--src/devices/video/hd61830.cpp2
-rw-r--r--src/devices/video/hd63484.cpp8
-rw-r--r--src/devices/video/hp1ll3.cpp2
-rw-r--r--src/devices/video/huc6260.cpp12
-rw-r--r--src/devices/video/huc6261.cpp16
-rw-r--r--src/devices/video/i8244.cpp20
-rw-r--r--src/devices/video/i8244.h1
-rw-r--r--src/devices/video/i82730.cpp12
-rw-r--r--src/devices/video/i8275.cpp22
-rw-r--r--src/devices/video/imagetek_i4100.cpp2
-rw-r--r--src/devices/video/m50458.cpp2
-rw-r--r--src/devices/video/mc6845.cpp8
-rw-r--r--src/devices/video/mos6566.cpp2
-rw-r--r--src/devices/video/ppu2c0x.cpp8
-rw-r--r--src/devices/video/psx.cpp14
-rw-r--r--src/devices/video/scn2674.cpp16
-rw-r--r--src/devices/video/snes_ppu.cpp30
-rw-r--r--src/devices/video/snes_ppu.h4
-rw-r--r--src/devices/video/tms34061.cpp8
-rw-r--r--src/devices/video/tms9928a.cpp8
-rw-r--r--src/devices/video/upd3301.cpp8
-rw-r--r--src/devices/video/upd7220.cpp12
-rw-r--r--src/devices/video/v9938.cpp8
-rw-r--r--src/devices/video/vic4567.cpp10
-rw-r--r--src/devices/video/zeus2.cpp25
-rw-r--r--src/devices/video/zeus2.h4
40 files changed, 220 insertions, 224 deletions
diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp
index 3603e018953..3425cd9875f 100644
--- a/src/devices/video/315_5124.cpp
+++ b/src/devices/video/315_5124.cpp
@@ -294,13 +294,13 @@ void sega315_5124_device::set_frame_timing()
READ8_MEMBER( sega315_5124_device::vcount_read )
{
const int active_scr_start = m_frame_timing[VERTICAL_SYNC] + m_frame_timing[TOP_BLANKING] + m_frame_timing[TOP_BORDER];
- int vpos = m_screen->vpos();
+ int vpos = screen().vpos();
- if (m_screen->hpos() < VCOUNT_CHANGE_HPOS)
+ if (screen().hpos() < VCOUNT_CHANGE_HPOS)
{
vpos--;
if (vpos < 0)
- vpos += m_screen->height();
+ vpos += screen().height();
}
return (vpos - active_scr_start) & 0xff;
@@ -349,7 +349,7 @@ void sega315_5124_device::device_timer(emu_timer &timer, device_timer_id id, int
case TIMER_DRAW:
update_palette();
- draw_scanline( LBORDER_START + LBORDER_WIDTH, param, m_screen->vpos() - param );
+ draw_scanline( LBORDER_START + LBORDER_WIDTH, param, screen().vpos() - param );
break;
case TIMER_LBORDER:
@@ -418,7 +418,7 @@ void sega315_5124_device::device_timer(emu_timer &timer, device_timer_id id, int
void sega315_5124_device::process_line_timer()
{
- const int vpos = m_screen->vpos();
+ const int vpos = screen().vpos();
int vpos_limit = m_frame_timing[VERTICAL_SYNC] + m_frame_timing[TOP_BLANKING]
+ m_frame_timing[TOP_BORDER] + m_frame_timing[ACTIVE_DISPLAY_V]
+ m_frame_timing[BOTTOM_BORDER] + m_frame_timing[BOTTOM_BLANKING];
@@ -462,7 +462,7 @@ void sega315_5124_device::process_line_timer()
if (m_line_counter == 0x00)
{
m_line_counter = m_reg[0x0a];
- m_hint_timer->adjust( m_screen->time_until_pos( vpos, HINT_HPOS ) );
+ m_hint_timer->adjust( screen().time_until_pos( vpos, HINT_HPOS ) );
m_pending_status |= STATUS_HINT;
}
else
@@ -477,19 +477,19 @@ void sega315_5124_device::process_line_timer()
if (vpos == vpos_limit + 1)
{
- m_vint_timer->adjust( m_screen->time_until_pos( vpos, VINT_HPOS ) );
+ m_vint_timer->adjust( screen().time_until_pos( vpos, VINT_HPOS ) );
m_pending_status |= STATUS_VINT;
}
/* Draw borders */
- m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos );
- m_rborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
+ m_lborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START ), vpos );
+ m_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw middle of the border */
/* We need to do this through the regular drawing function */
/* so sprite collisions can occur on the border. */
select_sprites( vpos - (vpos_limit - m_frame_timing[ACTIVE_DISPLAY_V]) );
- m_draw_timer->adjust( m_screen->time_until_pos( vpos, m_draw_time ), vpos_limit - m_frame_timing[ACTIVE_DISPLAY_V] );
+ m_draw_timer->adjust( screen().time_until_pos( vpos, m_draw_time ), vpos_limit - m_frame_timing[ACTIVE_DISPLAY_V] );
return;
}
@@ -506,7 +506,7 @@ void sega315_5124_device::process_line_timer()
if (m_line_counter == 0x00)
{
m_line_counter = m_reg[0x0a];
- m_hint_timer->adjust( m_screen->time_until_pos( vpos, HINT_HPOS ) );
+ m_hint_timer->adjust( screen().time_until_pos( vpos, HINT_HPOS ) );
m_pending_status |= STATUS_HINT;
}
else
@@ -515,12 +515,12 @@ void sega315_5124_device::process_line_timer()
}
/* Draw borders */
- m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos );
- m_rborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
+ m_lborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START ), vpos );
+ m_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw active display */
select_sprites( vpos - vpos_limit );
- m_draw_timer->adjust( m_screen->time_until_pos( vpos, m_draw_time ), vpos_limit );
+ m_draw_timer->adjust( screen().time_until_pos( vpos, m_draw_time ), vpos_limit );
return;
}
@@ -534,18 +534,18 @@ void sega315_5124_device::process_line_timer()
/* Check if we're on the last line of the top border */
if (vpos == vpos_limit + m_frame_timing[TOP_BORDER] - 1)
{
- m_nmi_timer->adjust( m_screen->time_until_pos( vpos, NMI_HPOS ) );
+ m_nmi_timer->adjust( screen().time_until_pos( vpos, NMI_HPOS ) );
}
/* Draw borders */
- m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos );
- m_rborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
+ m_lborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START ), vpos );
+ m_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw middle of the border */
/* We need to do this through the regular drawing function */
/* so sprite collisions can occur on the border. */
select_sprites( vpos - (vpos_limit + m_frame_timing[TOP_BORDER]) );
- m_draw_timer->adjust( m_screen->time_until_pos( vpos, m_draw_time ), vpos_limit + m_frame_timing[TOP_BORDER] );
+ m_draw_timer->adjust( screen().time_until_pos( vpos, m_draw_time ), vpos_limit + m_frame_timing[TOP_BORDER] );
return;
}
@@ -600,7 +600,7 @@ void sega315_5124_device::check_pending_flags()
}
else
{
- hpos = m_screen->hpos();
+ hpos = screen().hpos();
}
if ((m_pending_status & STATUS_HINT) && hpos >= HINT_HPOS)
@@ -721,11 +721,11 @@ WRITE8_MEMBER( sega315_5124_device::register_write )
break;
case 1:
set_display_settings();
- if (m_screen->hpos() <= DISPLAY_DISABLED_HPOS)
+ if (screen().hpos() <= DISPLAY_DISABLED_HPOS)
m_display_disabled = !(m_reg[0x01] & 0x40);
break;
case 8:
- if (m_screen->hpos() <= XSCROLL_HPOS)
+ if (screen().hpos() <= XSCROLL_HPOS)
m_reg8copy = m_reg[0x08];
}
@@ -1602,13 +1602,13 @@ void sega315_5124_device::device_start()
m_frame_timing = (m_is_pal) ? pal_192 : ntsc_192;
/* Make temp bitmap for rendering */
- m_screen->register_screen_bitmap(m_tmpbitmap);
- m_screen->register_screen_bitmap(m_y1_bitmap);
+ screen().register_screen_bitmap(m_tmpbitmap);
+ screen().register_screen_bitmap(m_y1_bitmap);
m_display_timer = timer_alloc(TIMER_LINE);
- m_display_timer->adjust(m_screen->time_until_pos(0, DISPLAY_CB_HPOS), 0, m_screen->scan_period());
+ m_display_timer->adjust(screen().time_until_pos(0, DISPLAY_CB_HPOS), 0, screen().scan_period());
m_pending_flags_timer = timer_alloc(TIMER_FLAGS);
- m_pending_flags_timer->adjust(m_screen->time_until_pos(0, WIDTH - 1), 0, m_screen->scan_period());
+ m_pending_flags_timer->adjust(screen().time_until_pos(0, WIDTH - 1), 0, screen().scan_period());
m_draw_timer = timer_alloc(TIMER_DRAW);
m_lborder_timer = timer_alloc(TIMER_LBORDER);
m_rborder_timer = timer_alloc(TIMER_RBORDER);
diff --git a/src/devices/video/315_5124.h b/src/devices/video/315_5124.h
index 4f2f618caed..ea0f68acb74 100644
--- a/src/devices/video/315_5124.h
+++ b/src/devices/video/315_5124.h
@@ -67,7 +67,7 @@ public:
DECLARE_PALETTE_INIT( sega315_5124 );
- void hcount_latch() { hcount_latch_at_hpos(m_screen->hpos()); };
+ void hcount_latch() { hcount_latch_at_hpos(screen().hpos()); };
void hcount_latch_at_hpos(int hpos);
void stop_timers();
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index c77939f5c1c..12737fe9192 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -1267,7 +1267,7 @@ uint16_t sega315_5313_device::get_hposition()
}
else
{
- value4 = m_screen->hpos();
+ value4 = screen().hpos();
}
return value4;
@@ -1278,7 +1278,7 @@ int sega315_5313_device::get_scanline_counter()
if (!m_use_alt_timing)
return m_scanline_counter;
else
- return m_screen->vpos();
+ return screen().vpos();
}
@@ -2849,7 +2849,7 @@ void sega315_5313_device::vdp_handle_eof()
visarea.set(0, scr_width - 1, 0, m_visible_scanlines - 1);
- m_screen->configure(480, m_total_scanlines, visarea, m_screen->frame_period().attoseconds());
+ screen().configure(480, m_total_scanlines, visarea, screen().frame_period().attoseconds());
}
@@ -2875,7 +2875,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( sega315_5313_device::megadriv_scanline_timer_callb
{
if (param==0)
{
- //printf("where are we? %d %d\n", m_screen->vpos(), screen().hpos());
+ //printf("where are we? %d %d\n", screen().vpos(), screen().hpos());
vdp_handle_eof();
//vdp_clear_bitmap();
}
diff --git a/src/devices/video/cdp1861.cpp b/src/devices/video/cdp1861.cpp
index 0b3101d8352..53d1b4fb658 100644
--- a/src/devices/video/cdp1861.cpp
+++ b/src/devices/video/cdp1861.cpp
@@ -69,7 +69,7 @@ void cdp1861_device::device_start()
m_dma_timer = timer_alloc(TIMER_DMA);
// find devices
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// register for state saving
save_item(NAME(m_disp));
@@ -85,8 +85,8 @@ void cdp1861_device::device_start()
void cdp1861_device::device_reset()
{
- m_int_timer->adjust(m_screen->time_until_pos(SCANLINE_INT_START, 0));
- m_efx_timer->adjust(m_screen->time_until_pos(SCANLINE_EFX_TOP_START, 0));
+ m_int_timer->adjust(screen().time_until_pos(SCANLINE_INT_START, 0));
+ m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_START, 0));
m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_START));
m_disp = 0;
@@ -105,7 +105,7 @@ void cdp1861_device::device_reset()
void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- int scanline = m_screen->vpos();
+ int scanline = screen().vpos();
switch (id)
{
@@ -117,7 +117,7 @@ void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_write_irq(ASSERT_LINE);
}
- m_int_timer->adjust(m_screen->time_until_pos( SCANLINE_INT_END, 0));
+ m_int_timer->adjust(screen().time_until_pos( SCANLINE_INT_END, 0));
}
else
{
@@ -126,7 +126,7 @@ void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_write_irq(CLEAR_LINE);
}
- m_int_timer->adjust(m_screen->time_until_pos(SCANLINE_INT_START, 0));
+ m_int_timer->adjust(screen().time_until_pos(SCANLINE_INT_START, 0));
}
break;
@@ -135,22 +135,22 @@ void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
case SCANLINE_EFX_TOP_START:
m_write_efx(ASSERT_LINE);
- m_efx_timer->adjust(m_screen->time_until_pos(SCANLINE_EFX_TOP_END, 0));
+ m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_END, 0));
break;
case SCANLINE_EFX_TOP_END:
m_write_efx(CLEAR_LINE);
- m_efx_timer->adjust(m_screen->time_until_pos(SCANLINE_EFX_BOTTOM_START, 0));
+ m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_BOTTOM_START, 0));
break;
case SCANLINE_EFX_BOTTOM_START:
m_write_efx(ASSERT_LINE);
- m_efx_timer->adjust(m_screen->time_until_pos(SCANLINE_EFX_BOTTOM_END, 0));
+ m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_BOTTOM_END, 0));
break;
case SCANLINE_EFX_BOTTOM_END:
m_write_efx(CLEAR_LINE);
- m_efx_timer->adjust(m_screen->time_until_pos(SCANLINE_EFX_TOP_START, 0));
+ m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_START, 0));
break;
}
break;
@@ -195,8 +195,8 @@ void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int para
WRITE8_MEMBER( cdp1861_device::dma_w )
{
- int sx = m_screen->hpos() + 4;
- int y = m_screen->vpos();
+ int sx = screen().hpos() + 4;
+ int y = screen().vpos();
int x;
for (x = 0; x < 8; x++)
diff --git a/src/devices/video/cdp1862.cpp b/src/devices/video/cdp1862.cpp
index 498bb4a8584..78985db211c 100644
--- a/src/devices/video/cdp1862.cpp
+++ b/src/devices/video/cdp1862.cpp
@@ -100,7 +100,7 @@ void cdp1862_device::device_start()
m_read_gd.resolve_safe(0);
// find devices
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// init palette
initialize_palette();
@@ -129,8 +129,8 @@ void cdp1862_device::device_reset()
WRITE8_MEMBER( cdp1862_device::dma_w )
{
int rd = 1, bd = 1, gd = 1;
- int sx = m_screen->hpos() + 4;
- int y = m_screen->vpos();
+ int sx = screen().hpos() + 4;
+ int y = screen().vpos();
int x;
if (!m_con)
diff --git a/src/devices/video/crt9007.cpp b/src/devices/video/crt9007.cpp
index 9eba3705e4f..5d85a58df6f 100644
--- a/src/devices/video/crt9007.cpp
+++ b/src/devices/video/crt9007.cpp
@@ -269,8 +269,8 @@ inline void crt9007_device::trigger_interrupt(int line)
inline void crt9007_device::update_cblank_line()
{
- int x = m_screen->hpos();
- int y = m_screen->vpos();
+ int x = screen().hpos();
+ int y = screen().vpos();
// composite blank
int cblank = !(m_hs & m_vs);
@@ -292,12 +292,12 @@ inline void crt9007_device::update_cblank_line()
inline void crt9007_device::update_hsync_timer(int state)
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = state ? m_hsync_start : m_hsync_end;
int next_y = state ? (y + 1) % SCAN_LINES_PER_FRAME : y;
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_hsync_timer->adjust(duration, !state);
}
@@ -311,7 +311,7 @@ inline void crt9007_device::update_vsync_timer(int state)
{
int next_y = state ? m_vsync_start : m_vsync_end;
- attotime duration = m_screen->time_until_pos(next_y, 0);
+ attotime duration = screen().time_until_pos(next_y, 0);
m_vsync_timer->adjust(duration, !state);
}
@@ -324,12 +324,12 @@ inline void crt9007_device::update_vsync_timer(int state)
inline void crt9007_device::update_vlt_timer(int state)
{
// this signal is active during all visible scan lines and during the horizontal trace at vertical retrace
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = state ? m_vlt_end : m_vlt_start;
int next_y = state ? y : ((y == m_vlt_bottom) ? 0 : (y + 1));
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_vlt_timer->adjust(duration, !state);
}
@@ -354,7 +354,7 @@ inline void crt9007_device::update_drb_timer(int state)
{
// this signal is active for 1 full scan line (VLT edge to edge) at the top scan line of each new row
// there is 1 extra DRB signal during the 1st scanline of the vertical retrace interval
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = m_vlt_end;
int next_y = y ? y + 1 : y;
@@ -376,7 +376,7 @@ inline void crt9007_device::update_drb_timer(int state)
}
}
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_drb_timer->adjust(duration, !state);
}
@@ -432,12 +432,12 @@ inline void crt9007_device::recompute_parameters()
//LOG("CRT9007 Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
//LOG("CRT9007 Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- //m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ //screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
- m_hsync_timer->adjust(m_screen->time_until_pos(0, 0));
- m_vsync_timer->adjust(m_screen->time_until_pos(0, 0));
- m_vlt_timer->adjust(m_screen->time_until_pos(0, m_vlt_start), 1);
- m_drb_timer->adjust(m_screen->time_until_pos(0, 0));
+ m_hsync_timer->adjust(screen().time_until_pos(0, 0));
+ m_vsync_timer->adjust(screen().time_until_pos(0, 0));
+ m_vlt_timer->adjust(screen().time_until_pos(0, m_vlt_start), 1);
+ m_drb_timer->adjust(screen().time_until_pos(0, 0));
}
@@ -563,8 +563,8 @@ void crt9007_device::device_clock_changed()
void crt9007_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- int x = m_screen->hpos();
- int y = m_screen->vpos();
+ int x = screen().hpos();
+ int y = screen().vpos();
switch (id)
{
diff --git a/src/devices/video/crt9021.cpp b/src/devices/video/crt9021.cpp
index 5b4d7195cde..a0dabe4d1c3 100644
--- a/src/devices/video/crt9021.cpp
+++ b/src/devices/video/crt9021.cpp
@@ -95,7 +95,7 @@ crt9021_device::crt9021_device(const machine_config &mconfig, const char *tag, d
void crt9021_device::device_start()
{
// register bitmap
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// state saving
save_item(NAME(m_data));
@@ -159,7 +159,7 @@ WRITE_LINE_MEMBER( crt9021_device::ld_sh_w )
// TODO
}
- m_display_cb(m_bitmap, m_screen->vpos(), m_screen->hpos(), m_sr, m_intout);
+ m_display_cb(m_bitmap, screen().vpos(), screen().hpos(), m_sr, m_intout);
}
}
diff --git a/src/devices/video/crtc_ega.cpp b/src/devices/video/crtc_ega.cpp
index b7318d33f99..01ee629ad43 100644
--- a/src/devices/video/crtc_ega.cpp
+++ b/src/devices/video/crtc_ega.cpp
@@ -201,8 +201,8 @@ void crtc_ega_device::recompute_parameters(bool postload)
LOG("CRTC_EGA config screen: HTOTAL: 0x%x VTOTAL: 0x%x MAX_X: 0x%x MAX_Y: 0x%x HSYNC: 0x%x-0x%x VSYNC: 0x%x-0x%x Freq: %ffps\n",
horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, hsync_on_pos, hsync_off_pos - 1, vsync_on_pos, vsync_off_pos - 1, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
- if ( m_screen != nullptr )
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ if (has_screen())
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
m_has_valid_parameters = true;
}
@@ -355,8 +355,8 @@ void crtc_ega_device::handle_line_timer()
/* also update the cursor state now */
update_cursor_state();
- if (m_screen != nullptr)
- m_screen->reset_origin();
+ if (has_screen())
+ screen().reset_origin();
}
if ( m_line_enable_ff )
diff --git a/src/devices/video/ef9340_1.cpp b/src/devices/video/ef9340_1.cpp
index 54c6f651dac..98aa0741c11 100644
--- a/src/devices/video/ef9340_1.cpp
+++ b/src/devices/video/ef9340_1.cpp
@@ -39,10 +39,10 @@ ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag,
void ef9340_1_device::device_start()
{
// Let the screen create our temporary bitmap with the screen's dimensions
- m_screen->register_screen_bitmap(m_tmp_bitmap);
+ screen().register_screen_bitmap(m_tmp_bitmap);
m_line_timer = timer_alloc(TIMER_LINE);
- m_line_timer->adjust( m_screen->time_until_pos(0, 0), 0, m_screen->scan_period() );
+ m_line_timer->adjust( screen().time_until_pos(0, 0), 0, screen().scan_period() );
// register our state
save_item(NAME(m_ef9341.TA));
@@ -81,7 +81,7 @@ void ef9340_1_device::device_timer(emu_timer &timer, device_timer_id id, int par
switch ( id )
{
case TIMER_LINE:
- ef9340_scanline(m_screen->vpos());
+ ef9340_scanline(screen().vpos());
break;
}
}
diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp
index 66adfdfb12d..f3f867d6b1f 100644
--- a/src/devices/video/ef9345.cpp
+++ b/src/devices/video/ef9345.cpp
@@ -145,7 +145,7 @@ void ef9345_device::device_start()
m_videoram = &space(0);
- m_screen_out.allocate(496, m_screen->height());
+ m_screen_out.allocate(496, screen().height());
m_blink_timer->adjust(attotime::from_msec(500), 0, attotime::from_msec(500));
@@ -228,8 +228,8 @@ void ef9345_device::set_busy_flag(int period)
void ef9345_device::draw_char_40(uint8_t *c, uint16_t x, uint16_t y)
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- const int scan_xsize = std::min( m_screen->width() - (x * 8), 8);
- const int scan_ysize = std::min( m_screen->height() - (y * 10), 10);
+ const int scan_xsize = std::min( screen().width() - (x * 8), 8);
+ const int scan_ysize = std::min( screen().height() - (y * 10), 10);
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
@@ -240,8 +240,8 @@ void ef9345_device::draw_char_40(uint8_t *c, uint16_t x, uint16_t y)
void ef9345_device::draw_char_80(uint8_t *c, uint16_t x, uint16_t y)
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- const int scan_xsize = std::min( m_screen->width() - (x * 6), 6);
- const int scan_ysize = std::min( m_screen->height() - (y * 10), 10);
+ const int scan_xsize = std::min( screen().width() - (x * 6), 6);
+ const int scan_ysize = std::min( screen().height() - (y * 10), 10);
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
@@ -265,12 +265,12 @@ void ef9345_device::set_video_mode(void)
uint16_t new_width = (m_char_mode == MODE12x80 || m_char_mode == MODE8x80) ? 492 : 336;
- if (m_screen->width() != new_width)
+ if (screen().width() != new_width)
{
- rectangle visarea = m_screen->visible_area();
+ rectangle visarea = screen().visible_area();
visarea.max_x = new_width - 1;
- m_screen->configure(new_width, m_screen->height(), visarea, m_screen->frame_period().attoseconds());
+ screen().configure(new_width, screen().height(), visarea, screen().frame_period().attoseconds());
}
//border color
diff --git a/src/devices/video/ef9364.cpp b/src/devices/video/ef9364.cpp
index 0bbde3e72d7..bd9d5003448 100644
--- a/src/devices/video/ef9364.cpp
+++ b/src/devices/video/ef9364.cpp
@@ -128,7 +128,7 @@ void ef9364_device::device_start()
palette[0] = rgb_t(0, 0, 0);
palette[1] = rgb_t(255, 255, 255);
- m_screen_out.allocate( bitplane_xres, m_screen->height() );
+ m_screen_out.allocate( bitplane_xres, screen().height() );
cursor_cnt = 0;
cursor_state = 0;
@@ -171,12 +171,12 @@ void ef9364_device::set_video_mode(void)
{
uint16_t new_width = bitplane_xres;
- if (m_screen->width() != new_width)
+ if (screen().width() != new_width)
{
- rectangle visarea = m_screen->visible_area();
+ rectangle visarea = screen().visible_area();
visarea.max_x = new_width - 1;
- m_screen->configure(new_width, m_screen->height(), visarea, m_screen->frame_period().attoseconds());
+ screen().configure(new_width, screen().height(), visarea, screen().frame_period().attoseconds());
}
//border color
diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp
index d2ccde9205c..350305ed042 100644
--- a/src/devices/video/ef9365.cpp
+++ b/src/devices/video/ef9365.cpp
@@ -338,7 +338,7 @@ void ef9365_device::device_start()
palette[i] = rgb_t(255, 255, 255);
}
- m_screen_out.allocate( bitplane_xres, m_screen->height() );
+ m_screen_out.allocate( bitplane_xres, screen().height() );
save_item(NAME(m_border));
save_item(NAME(m_registers));
@@ -472,12 +472,12 @@ void ef9365_device::set_video_mode(void)
{
uint16_t new_width = bitplane_xres;
- if (m_screen->width() != new_width)
+ if (screen().width() != new_width)
{
- rectangle visarea = m_screen->visible_area();
+ rectangle visarea = screen().visible_area();
visarea.max_x = new_width - 1;
- m_screen->configure(new_width, m_screen->height(), visarea, m_screen->frame_period().attoseconds());
+ screen().configure(new_width, screen().height(), visarea, screen().frame_period().attoseconds());
}
//border color
diff --git a/src/devices/video/gb_lcd.cpp b/src/devices/video/gb_lcd.cpp
index 769ac63030c..1ac18932086 100644
--- a/src/devices/video/gb_lcd.cpp
+++ b/src/devices/video/gb_lcd.cpp
@@ -359,7 +359,7 @@ cgb_ppu_device::cgb_ppu_device(const machine_config &mconfig, const char *tag, d
void dmg_ppu_device::common_start()
{
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
save_item(NAME(m_bitmap));
m_oam = make_unique_clear<uint8_t[]>(m_oam_size);
m_vram = make_unique_clear<uint8_t[]>(m_vram_size);
@@ -1268,7 +1268,7 @@ void dmg_ppu_device::update_scanline(uint32_t cycles_to_go)
{
if (m_current_line < 144)
{
- const rectangle &r = m_screen->visible_area();
+ const rectangle &r = screen().visible_area();
rectangle r1(r.min_x, r.max_x, m_current_line, m_current_line);
m_bitmap.fill(0, r1);
}
@@ -1889,7 +1889,7 @@ void cgb_ppu_device::update_scanline(uint32_t cycles_to_go)
{
if (m_current_line < 144)
{
- const rectangle &r1 = m_screen->visible_area();
+ const rectangle &r1 = screen().visible_area();
rectangle r(r1.min_x, r1.max_x, m_current_line, m_current_line);
m_bitmap.fill((!m_gbc_mode) ? 0 : 32767 , r);
}
diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp
index ba63bca0008..53b2bca2124 100644
--- a/src/devices/video/gba_lcd.cpp
+++ b/src/devices/video/gba_lcd.cpp
@@ -1763,7 +1763,7 @@ void gba_lcd_device::device_start()
m_vram = make_unique_clear<uint32_t[]>(0x18000 / 4);
m_oam = make_unique_clear<uint32_t[]>(0x400 / 4);
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
/* create a timer to fire scanline functions */
m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_lcd_device::perform_scan),this));
diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp
index 52fc9c4164b..11c10f3b93b 100644
--- a/src/devices/video/hd61830.cpp
+++ b/src/devices/video/hd61830.cpp
@@ -450,7 +450,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
pixel = m_cursor ? 1 : 0;
}
- if (sy < m_screen->height() && sx < m_screen->width())
+ if (sy < screen().height() && sx < screen().width())
bitmap.pix16(sy, sx) = pixel;
}
}
diff --git a/src/devices/video/hd63484.cpp b/src/devices/video/hd63484.cpp
index 0b383bd927b..189eaa89367 100644
--- a/src/devices/video/hd63484.cpp
+++ b/src/devices/video/hd63484.cpp
@@ -528,10 +528,10 @@ inline void hd63484_device::recompute_parameters()
if (BIT(m_dcr, 13)) vbstart += m_sp[0];
if (BIT(m_dcr, 11)) vbstart += m_sp[2];
- rectangle visarea = m_screen->visible_area();
+ rectangle visarea = screen().visible_area();
visarea.set((m_hsw + m_hds) * ppmc, (m_hsw + m_hds + m_hdw) * ppmc - 1, m_vds, vbstart - 1);
- attoseconds_t frame_period = m_screen->frame_period().attoseconds(); // TODO: use clock() to calculate the frame_period
- m_screen->configure(m_hc * ppmc, m_vc, visarea, frame_period);
+ attoseconds_t frame_period = screen().frame_period().attoseconds(); // TODO: use clock() to calculate the frame_period
+ screen().configure(m_hc * ppmc, m_vc, visarea, frame_period);
}
@@ -1785,7 +1785,7 @@ uint16_t hd63484_device::video_registers_r(int offset)
break;
case 0x80:
- res = m_screen->vpos() & 0xfff; // Raster Count
+ res = screen().vpos() & 0xfff; // Raster Count
break;
default:
diff --git a/src/devices/video/hp1ll3.cpp b/src/devices/video/hp1ll3.cpp
index 21b6a2b4550..ada8f48404d 100644
--- a/src/devices/video/hp1ll3.cpp
+++ b/src/devices/video/hp1ll3.cpp
@@ -508,7 +508,7 @@ READ8_MEMBER( hp1ll3_device::read )
case 0:
data = m_busy ? 1 : 0;
data |= 2;
- data |= (m_screen->vblank() ? 8 : 0);
+ data |= (screen().vblank() ? 8 : 0);
break;
case 2:
diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp
index ec99e8417eb..ee2943896dd 100644
--- a/src/devices/video/huc6260.cpp
+++ b/src/devices/video/huc6260.cpp
@@ -66,8 +66,8 @@ huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, d
void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- int vpos = m_screen->vpos();
- int hpos = m_screen->hpos();
+ int vpos = screen().vpos();
+ int hpos = screen().hpos();
int h = m_last_h;
int v = m_last_v;
uint16_t *bitmap_line = &m_bmp->pix16(v);
@@ -177,7 +177,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
}
}
- m_timer->adjust( m_screen->time_until_pos( v, h ) );
+ m_timer->adjust( screen().time_until_pos( v, h ) );
}
@@ -294,9 +294,9 @@ void huc6260_device::device_reset()
m_pixel_clock = 0;
memset(m_palette, 0x00, sizeof(m_palette));
- m_last_v = m_screen->vpos();
- m_last_h = m_screen->hpos();
- m_timer->adjust( m_screen->time_until_pos( ( m_screen->vpos() + 1 ) % 263, 0 ) );
+ m_last_v = screen().vpos();
+ m_last_h = screen().hpos();
+ m_timer->adjust( screen().time_until_pos( ( screen().vpos() + 1 ) % 263, 0 ) );
}
//-------------------------------------------------
diff --git a/src/devices/video/huc6261.cpp b/src/devices/video/huc6261.cpp
index 9029b57d54f..90c7a7884da 100644
--- a/src/devices/video/huc6261.cpp
+++ b/src/devices/video/huc6261.cpp
@@ -95,8 +95,8 @@ void huc6261_device::apply_pal_offs(uint16_t *pix_data)
void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- int vpos = m_screen->vpos();
- int hpos = m_screen->hpos();
+ int vpos = screen().vpos();
+ int hpos = screen().hpos();
int h = m_last_h;
int v = m_last_v;
uint32_t *bitmap_line = &m_bmp->pix32(v);
@@ -219,7 +219,7 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para
}
}
- m_timer->adjust( m_screen->time_until_pos( v, h ) );
+ m_timer->adjust( screen().time_until_pos( v, h ) );
}
@@ -238,8 +238,8 @@ READ16_MEMBER( huc6261_device::read )
/* Status info */
case 0x00:
{
- uint16_t vpos = m_screen->vpos();
- uint16_t hpos = m_screen->hpos();
+ uint16_t vpos = screen().vpos();
+ uint16_t hpos = screen().hpos();
data = ( vpos << 5 ) | ( m_register & 0x1F);
@@ -455,7 +455,7 @@ void huc6261_device::device_reset()
memset(m_palette, 0, sizeof(m_palette));
- m_last_v = m_screen->vpos();
- m_last_h = m_screen->hpos();
- m_timer->adjust( m_screen->time_until_pos( ( m_screen->vpos() + 1 ) % 263, 0 ) );
+ m_last_v = screen().vpos();
+ m_last_h = screen().hpos();
+ m_timer->adjust( screen().time_until_pos( ( screen().vpos() + 1 ) % 263, 0 ) );
}
diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp
index 8ca44d172a2..de90b4f4937 100644
--- a/src/devices/video/i8244.cpp
+++ b/src/devices/video/i8244.cpp
@@ -136,13 +136,13 @@ i8245_device::i8245_device(const machine_config &mconfig, const char *tag, devic
void i8244_device::device_start()
{
// Let the screen create our temporary bitmap with the screen's dimensions
- m_screen->register_screen_bitmap(m_tmp_bitmap);
+ screen().register_screen_bitmap(m_tmp_bitmap);
m_line_timer = timer_alloc(TIMER_LINE);
- m_line_timer->adjust( m_screen->time_until_pos(1, START_ACTIVE_SCAN ), 0, m_screen->scan_period() );
+ m_line_timer->adjust( screen().time_until_pos(1, START_ACTIVE_SCAN ), 0, screen().scan_period() );
m_hblank_timer = timer_alloc(TIMER_HBLANK);
- m_hblank_timer->adjust( m_screen->time_until_pos(1, END_ACTIVE_SCAN + 18 ), 0, m_screen->scan_period() );
+ m_hblank_timer->adjust( screen().time_until_pos(1, END_ACTIVE_SCAN + 18 ), 0, screen().scan_period() );
m_irq_func.resolve_safe();
m_postprocess_func.resolve_safe();
@@ -209,7 +209,7 @@ PALETTE_INIT_MEMBER(i8244_device, i8244)
void i8244_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- int vpos = m_screen->vpos();
+ int vpos = screen().vpos();
switch ( id )
{
@@ -236,10 +236,10 @@ void i8244_device::device_timer(emu_timer &timer, device_timer_id id, int param,
int i8244_device::get_y_beam()
{
- int y = m_screen->vpos() - m_start_vpos;
+ int y = screen().vpos() - m_start_vpos;
// The Y register becomes 0 only when the VBlank signal is turned off!
- if ( y < 0 || ( y == 0 && m_screen->hpos() < 366+42 ) )
+ if ( y < 0 || ( y == 0 && screen().hpos() < 366+42 ) )
{
y += m_screen_lines;
}
@@ -250,7 +250,7 @@ int i8244_device::get_y_beam()
int i8244_device::get_x_beam()
{
- int x = m_screen->hpos() - START_ACTIVE_SCAN;
+ int x = screen().hpos() - START_ACTIVE_SCAN;
if ( x < 0 )
{
@@ -356,7 +356,7 @@ WRITE8_MEMBER(i8244_device::write)
READ_LINE_MEMBER(i8244_device::vblank)
{
- if ( m_screen->vpos() > m_start_vpos && m_screen->vpos() < m_start_vblank )
+ if ( screen().vpos() > m_start_vpos && screen().vpos() < m_start_vblank )
{
return 0;
}
@@ -366,8 +366,8 @@ READ_LINE_MEMBER(i8244_device::vblank)
READ_LINE_MEMBER(i8244_device::hblank)
{
- int hpos = m_screen->hpos();
- int vpos = m_screen->vpos();
+ int hpos = screen().hpos();
+ int vpos = screen().vpos();
if ( hpos >= START_ACTIVE_SCAN && hpos < END_ACTIVE_SCAN )
{
diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h
index a67652fd1e4..543712883e3 100644
--- a/src/devices/video/i8244.h
+++ b/src/devices/video/i8244.h
@@ -50,7 +50,6 @@ public:
i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- static void set_screen_tag(device_t &device, const char *screen_tag) { downcast<i8244_device &>(device).m_screen_tag = screen_tag; }
template <class Object> static devcb_base &set_irq_cb(device_t &device, Object &&cb) { return downcast<i8244_device &>(device).m_irq_func.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_postprocess_cb(device_t &device, Object &&cb) { return downcast<i8244_device &>(device).m_postprocess_func.set_callback(std::forward<Object>(cb)); }
diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp
index c9a3aee6744..c43e02555a7 100644
--- a/src/devices/video/i82730.cpp
+++ b/src/devices/video/i82730.cpp
@@ -89,7 +89,7 @@ void i82730_device::set_cpu_tag(device_t &device, device_t *owner, const char *t
void i82730_device::device_start()
{
// register bitmap
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// resolve callbacks
m_sint_handler.resolve_safe();
@@ -224,13 +224,13 @@ void i82730_device::mode_set()
// setup screen mode
rectangle visarea(hbrdstrt * 16, hbrdstp * 16 - 1, m_vsyncstp, m_vfldstp + m_margin + 1 + m_lpr - 1);
attoseconds_t period = HZ_TO_ATTOSECONDS(clock() * 16) * line_length * 16 * frame_length;
- m_screen->configure(line_length * 16, frame_length, visarea, period);
+ screen().configure(line_length * 16, frame_length, visarea, period);
// start display is now valid
m_mode_set = true;
// adjust timer for the new mode
- m_row_timer->adjust(m_screen->time_until_pos(0));
+ m_row_timer->adjust(screen().time_until_pos(0));
// output some debug info
if (VERBOSE)
@@ -394,7 +394,7 @@ void i82730_device::load_row()
TIMER_CALLBACK_MEMBER( i82730_device::row_update )
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
if (y == 0)
{
@@ -454,7 +454,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update )
// todo: check ca
// frame interrupt?
- if ((m_screen->frame_number() % m_frame_int_count) == 0)
+ if ((screen().frame_number() % m_frame_int_count) == 0)
m_status |= EONF;
// check interrupts
@@ -465,7 +465,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update )
// vblank
}
- m_row_timer->adjust(m_screen->time_until_pos((y + 1) % m_screen->height()));
+ m_row_timer->adjust(screen().time_until_pos((y + 1) % screen().height()));
}
WRITE_LINE_MEMBER( i82730_device::ca_w )
diff --git a/src/devices/video/i8275.cpp b/src/devices/video/i8275.cpp
index ee146c92519..c962768e17f 100644
--- a/src/devices/video/i8275.cpp
+++ b/src/devices/video/i8275.cpp
@@ -133,7 +133,7 @@ i8275_device::i8275_device(const machine_config &mconfig, const char *tag, devic
void i8275_device::device_start()
{
// get the screen device
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// resolve callbacks
m_display_cb.bind_relative_to(*owner());
@@ -197,8 +197,8 @@ void i8275_device::device_reset()
void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- //int y = m_screen->vpos();
- //int x = m_screen->hpos();
+ //int y = screen().vpos();
+ //int x = screen().hpos();
int rc = m_scanline / SCANLINES_PER_ROW;
int lc = m_scanline % SCANLINES_PER_ROW;
@@ -566,7 +566,7 @@ WRITE8_MEMBER( i8275_device::write )
WRITE8_MEMBER( i8275_device::dack_w )
{
- //LOG("I8275 y %u x %u DACK %04x:%02x %u\n", m_screen->vpos(), m_screen->hpos(), offset, data, m_buffer_idx);
+ //LOG("I8275 y %u x %u DACK %04x:%02x %u\n", screen().vpos(), screen().hpos(), offset, data, m_buffer_idx);
m_write_drq(0);
@@ -631,8 +631,8 @@ WRITE_LINE_MEMBER( i8275_device::lpen_w )
{
if (!m_lpen && state)
{
- m_param[REG_LPEN_COL] = m_screen->hpos() / m_hpixels_per_column;
- m_param[REG_LPEN_ROW] = m_screen->vpos() / SCANLINES_PER_ROW;
+ m_param[REG_LPEN_COL] = screen().hpos() / m_hpixels_per_column;
+ m_param[REG_LPEN_ROW] = screen().vpos() / SCANLINES_PER_ROW;
m_status |= ST_LP;
}
@@ -664,11 +664,11 @@ uint32_t i8275_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
void i8275_device::recompute_parameters()
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
int horiz_pix_total = (CHARACTERS_PER_ROW + HRTC_COUNT) * m_hpixels_per_column;
int vert_pix_total = (CHARACTER_ROWS_PER_FRAME + VRTC_ROW_COUNT) * SCANLINES_PER_ROW;
- attoseconds_t refresh = m_screen->frame_period().attoseconds();
+ attoseconds_t refresh = screen().frame_period().attoseconds();
int max_visible_x = (CHARACTERS_PER_ROW * m_hpixels_per_column) - 1;
int max_visible_y = (CHARACTER_ROWS_PER_FRAME * SCANLINES_PER_ROW) - 1;
@@ -676,10 +676,10 @@ void i8275_device::recompute_parameters()
rectangle visarea;
visarea.set(0, max_visible_x, 0, max_visible_y);
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
int hrtc_on_pos = CHARACTERS_PER_ROW * m_hpixels_per_column;
- m_hrtc_on_timer->adjust(m_screen->time_until_pos(y, hrtc_on_pos), 0, m_screen->scan_period());
+ m_hrtc_on_timer->adjust(screen().time_until_pos(y, hrtc_on_pos), 0, screen().scan_period());
m_irq_scanline = (CHARACTER_ROWS_PER_FRAME - 1) * SCANLINES_PER_ROW;
m_vrtc_scanline = CHARACTER_ROWS_PER_FRAME * SCANLINES_PER_ROW;
@@ -687,7 +687,7 @@ void i8275_device::recompute_parameters()
LOG("irq_y %u vrtc_y %u drq_y %u\n", m_irq_scanline, m_vrtc_scanline, m_vrtc_drq_scanline);
- m_scanline_timer->adjust(m_screen->time_until_pos(0, 0), 0, m_screen->scan_period());
+ m_scanline_timer->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period());
if (DOUBLE_SPACED_ROWS) fatalerror("Double spaced rows not supported!");
}
diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp
index e3ac0953526..40774f7c9ba 100644
--- a/src/devices/video/imagetek_i4100.cpp
+++ b/src/devices/video/imagetek_i4100.cpp
@@ -1069,7 +1069,7 @@ void imagetek_i4100_device::draw_tilemap( screen_device &screen, bitmap_ind16 &b
{
int y;
- bitmap_ind8 &priority_bitmap = m_screen->priority();
+ bitmap_ind8 &priority_bitmap = screen.priority();
int width = big ? 4096 : 2048;
int height = big ? 4096 : 2048;
diff --git a/src/devices/video/m50458.cpp b/src/devices/video/m50458.cpp
index 0b756fbbb47..48128ecb095 100644
--- a/src/devices/video/m50458.cpp
+++ b/src/devices/video/m50458.cpp
@@ -370,7 +370,7 @@ uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
pix |= ((m_shadow_gfx[offset+0] >> (7-(xi & 0x7))) & 1);
/* blinking, VERY preliminary */
- if(tile & 0x800 && m_screen->frame_number() & m_blink)
+ if(tile & 0x800 && screen.frame_number() & m_blink)
pix = 0;
if(yi == 17 && tile & 0x1000) /* underline? */
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index 9b265bc34cb..909f068f687 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -583,8 +583,8 @@ void mc6845_device::recompute_parameters(bool postload)
LOG("M6845 config screen: HTOTAL: %d VTOTAL: %d MAX_X: %d MAX_Y: %d HSYNC: %d-%d VSYNC: %d-%d Freq: %ffps\n",
horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, hsync_on_pos, hsync_off_pos - 1, vsync_on_pos, vsync_off_pos - 1, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
- if ( m_screen != nullptr )
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ if (has_screen())
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
if(!m_reconfigure_cb.isnull())
m_reconfigure_cb(horiz_pix_total, vert_pix_total, visarea, refresh);
@@ -754,8 +754,8 @@ void mc6845_device::handle_line_timer()
/* also update the cursor state now */
update_cursor_state();
- if (m_screen != nullptr)
- m_screen->reset_origin();
+ if (has_screen())
+ screen().reset_origin();
}
else
{
diff --git a/src/devices/video/mos6566.cpp b/src/devices/video/mos6566.cpp
index ab5a4b360e5..e2d2101ccc9 100644
--- a/src/devices/video/mos6566.cpp
+++ b/src/devices/video/mos6566.cpp
@@ -654,7 +654,7 @@ void mos6566_device::device_start()
m_write_aec.resolve_safe();
m_write_k.resolve_safe();
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
for (int i = 0; i < 256; i++)
{
diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp
index ae0d0618af4..2b4aedd0940 100644
--- a/src/devices/video/ppu2c0x.cpp
+++ b/src/devices/video/ppu2c0x.cpp
@@ -230,7 +230,7 @@ void ppu2c0x_device::device_start()
m_scanline_timer = timer_alloc(TIMER_SCANLINE);
/* initialize the scanline handling portion */
- m_scanline_timer->adjust(m_screen->time_until_pos(1));
+ m_scanline_timer->adjust(screen().time_until_pos(1));
m_hblank_timer->adjust(m_cpu->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
m_nmi_timer->adjust(attotime::never);
@@ -522,7 +522,7 @@ void ppu2c0x_device::device_timer(emu_timer &timer, device_timer_id id, int para
/* increment our scanline count */
m_scanline++;
- // logerror("starting scanline %d (MAME %d, beam %d)\n", m_scanline, device->m_screen->vpos(), device->m_screen->hpos());
+ // logerror("starting scanline %d (MAME %d, beam %d)\n", m_scanline, device->screen().vpos(), device->screen().hpos());
/* Note: this is called at the _end_ of each scanline */
if (m_scanline == m_vblank_first_scanline)
@@ -569,7 +569,7 @@ void ppu2c0x_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_hblank_timer->adjust(m_cpu->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
// trigger again at the start of the next scanline
- m_scanline_timer->adjust(m_screen->time_until_pos(next_scanline * m_scan_scale));
+ m_scanline_timer->adjust(screen().time_until_pos(next_scanline * m_scan_scale));
break;
}
}
@@ -1191,7 +1191,7 @@ WRITE8_MEMBER( ppu2c0x_device::write )
#ifdef MAME_DEBUG
if (m_scanline <= BOTTOM_VISIBLE_SCANLINE)
{
- logerror("PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, m_scanline, m_screen->vpos(), m_screen->hpos());
+ logerror("PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, m_scanline, screen().vpos(), screen().hpos());
}
#endif
diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp
index caf81205b35..33e633c61d7 100644
--- a/src/devices/video/psx.cpp
+++ b/src/devices/video/psx.cpp
@@ -120,8 +120,8 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c
void psxgpu_device::DebugMeshInit()
{
- int width = m_screen->width();
- int height = m_screen->height();
+ int width = screen().width();
+ int height = screen().height();
m_debug.b_mesh = 0;
m_debug.b_texture = 0;
@@ -136,8 +136,8 @@ void psxgpu_device::DebugMesh( int n_coordx, int n_coordy )
{
int n_coord;
int n_colour;
- int width = m_screen->width();
- int height = m_screen->height();
+ int width = screen().width();
+ int height = screen().height();
n_coordx += m_n_displaystartx;
n_coordy += n_displaystarty;
@@ -334,8 +334,8 @@ int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap )
if( m_debug.b_texture )
{
- int width = m_screen->width();
- int height = m_screen->height();
+ int width = screen().width();
+ int height = screen().height();
for( n_y = 0; n_y < height; n_y++ )
{
@@ -363,7 +363,7 @@ int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap )
}
p_n_interleave[ n_x ] = p_p_vram[ n_yi ][ n_xi ];
}
- draw_scanline16( bitmap, 0, n_y, width, p_n_interleave, m_screen->palette().pens() );
+ draw_scanline16( bitmap, 0, n_y, width, p_n_interleave, screen().palette().pens() );
}
}
return m_debug.b_texture;
diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp
index 09eba285b3a..7a74bf19ad1 100644
--- a/src/devices/video/scn2674.cpp
+++ b/src/devices/video/scn2674.cpp
@@ -66,7 +66,7 @@ void scn2674_device::device_start()
m_display_cb.bind_relative_to(*owner());
m_intr_cb.resolve_safe();
m_scanline_timer = timer_alloc(TIMER_SCANLINE);
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
save_item(NAME(m_address));
save_item(NAME(m_linecounter));
@@ -604,7 +604,7 @@ WRITE8_MEMBER( scn2674_device::write )
case 2:
m_screen1_l = data;
- if(!m_screen->vblank())
+ if(!screen().vblank())
m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
break;
case 3:
@@ -616,7 +616,7 @@ WRITE8_MEMBER( scn2674_device::write )
m_screen1_h &= 0x3f;
LOG("IR14 - Double 1 overridden %02x\n",m_IR14_double_1);
}
- if(!m_screen->vblank())
+ if(!screen().vblank())
m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
break;
@@ -636,7 +636,7 @@ void scn2674_device::recompute_parameters()
m_hpixels_per_column = m_gfx_enabled ? m_gfx_hpixels_per_column : m_text_hpixels_per_column;
int horiz_pix_total = ((m_IR1_equalizing_constant + (m_IR2_horz_sync_width << 1)) << 1) * m_hpixels_per_column;
int vert_pix_total = m_IR4_rows_per_screen * m_IR0_scanline_per_char_row + m_IR3_vert_front_porch + m_IR3_vert_back_porch + m_IR7_vsync_width;
- attoseconds_t refresh = m_screen->frame_period().attoseconds();
+ attoseconds_t refresh = screen().frame_period().attoseconds();
int max_visible_x = (m_IR5_character_per_row * m_hpixels_per_column) - 1;
int max_visible_y = (m_IR4_rows_per_screen * m_IR0_scanline_per_char_row) - 1;
@@ -650,9 +650,9 @@ void scn2674_device::recompute_parameters()
rectangle visarea;
visarea.set(0, max_visible_x, 0, max_visible_y);
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
- m_scanline_timer->adjust(m_screen->time_until_pos(0, 0), 0, m_screen->scan_period());
+ m_scanline_timer->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period());
}
void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -671,7 +671,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_linecounter++;
- if(m_linecounter >= m_screen->height())
+ if(m_linecounter >= screen().height())
{
m_linecounter = 0;
m_address = (m_screen1_h << 8) | m_screen1_l;
@@ -792,7 +792,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para
dw != 0,
m_gfx_enabled != 0,
charrow == m_IR7_cursor_underline_position,
- m_IR7_cursor_blink && (m_screen->frame_number() & (m_IR7_cursor_rate_divisor ? 0x40 : 0x20)));
+ m_IR7_cursor_blink && (screen().frame_number() & (m_IR7_cursor_rate_divisor ? 0x40 : 0x20)));
address = (address + 1) & 0xffff;
if(address > ((m_IR9_display_buffer_last_address << 10) | 0x3ff))
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index 49ee17c94b4..76bc3d54cd3 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -378,7 +378,7 @@ void snes_ppu_device::device_reset()
m_beam.current_vert = 0;
/* Set STAT78 to NTSC or PAL */
- m_stat78 = (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds()) >= 59.0) ? SNES_NTSC : SNES_PAL;
+ m_stat78 = (ATTOSECONDS_TO_HZ(screen().frame_period().attoseconds()) >= 59.0) ? SNES_NTSC : SNES_PAL;
m_beam.last_visible_line = m_stat78 & SNES_PAL ? 240 : 225;
m_mode = 0;
m_ppu1_version = 1; // 5C77 chip version number, read by STAT77, only '1' is known
@@ -1995,7 +1995,7 @@ void snes_ppu_device::set_latch_hv(int16_t x, int16_t y)
void snes_ppu_device::dynamic_res_change()
{
- rectangle visarea = m_screen->visible_area();
+ rectangle visarea = screen().visible_area();
attoseconds_t refresh;
visarea.min_x = visarea.min_y = 0;
@@ -2012,12 +2012,12 @@ void snes_ppu_device::dynamic_res_change()
if ((m_stat78 & 0x10) == SNES_NTSC)
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_NTSC) * SNES_HTOTAL * SNES_VTOTAL_NTSC;
- m_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
+ screen().configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
}
else
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL;
- m_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
+ screen().configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
}
}
@@ -2060,8 +2060,8 @@ READ8_MEMBER( snes_ppu_device::vram_read )
res = m_vram[offset];
else
{
- uint16_t v = m_screen->vpos();
- uint16_t h = m_screen->hpos();
+ uint16_t v = screen().vpos();
+ uint16_t h = screen().hpos();
uint16_t ls = (((m_stat78 & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1;
if (m_interlace == 2)
@@ -2095,8 +2095,8 @@ WRITE8_MEMBER( snes_ppu_device::vram_write )
m_vram[offset] = data;
else
{
- uint16_t v = m_screen->vpos();
- uint16_t h = m_screen->hpos();
+ uint16_t v = screen().vpos();
+ uint16_t h = screen().hpos();
if (v == 0)
{
if (h <= 4)
@@ -2161,7 +2161,7 @@ READ8_MEMBER( snes_ppu_device::oam_read )
if (!m_screen_disabled)
{
- uint16_t v = m_screen->vpos();
+ uint16_t v = screen().vpos();
if (v < m_beam.last_visible_line)
offset = 0x010c;
@@ -2179,7 +2179,7 @@ WRITE8_MEMBER( snes_ppu_device::oam_write )
if (!m_screen_disabled)
{
- uint16_t v = m_screen->vpos();
+ uint16_t v = screen().vpos();
if (v < m_beam.last_visible_line)
offset = 0x010c;
@@ -2220,8 +2220,8 @@ READ8_MEMBER( snes_ppu_device::cgram_read )
#if 0
if (!m_screen_disabled)
{
- uint16_t v = m_screen->vpos();
- uint16_t h = m_screen->hpos();
+ uint16_t v = screen().vpos();
+ uint16_t h = screen().hpos();
if (v < m_beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2248,8 +2248,8 @@ WRITE8_MEMBER( snes_ppu_device::cgram_write )
// writes to the cgram address
if (!m_screen_disabled)
{
- uint16_t v = m_screen->vpos();
- uint16_t h = m_screen->hpos();
+ uint16_t v = screen().vpos();
+ uint16_t h = screen().hpos();
if (v < m_beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2312,7 +2312,7 @@ uint8_t snes_ppu_device::read(address_space &space, uint32_t offset, uint8_t wri
return m_ppu1_open_bus;
}
case SLHV: /* Software latch for H/V counter */
- set_latch_hv(m_screen->hpos() / m_htmult, m_screen->vpos());
+ set_latch_hv(screen().hpos() / m_htmult, screen().vpos());
return m_openbus_cb(space, 0); /* Return value is meaningless */
case ROAMDATA: /* Read data from OAM (DR) */
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index 2a3ac575edf..a3be6fed5da 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -48,8 +48,8 @@ public:
void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline);
- int16_t current_x() const { return m_screen->hpos() / m_htmult; }
- int16_t current_y() const { return m_screen->vpos(); }
+ int16_t current_x() const { return screen().hpos() / m_htmult; }
+ int16_t current_y() const { return screen().vpos(); }
void set_latch_hv(int16_t x, int16_t y);
uint8_t read(address_space &space, uint32_t offset, uint8_t wrio_bit7);
diff --git a/src/devices/video/tms34061.cpp b/src/devices/video/tms34061.cpp
index e2d47731921..397b412e586 100644
--- a/src/devices/video/tms34061.cpp
+++ b/src/devices/video/tms34061.cpp
@@ -154,7 +154,7 @@ void tms34061_device::update_interrupts()
TIMER_CALLBACK_MEMBER( tms34061_device::interrupt )
{
/* set timer for next frame */
- m_timer->adjust(m_screen->frame_period());
+ m_timer->adjust(screen().frame_period());
/* set the interrupt bit in the status reg */
m_regs[TMS34061_STATUS] |= 1;
@@ -179,7 +179,7 @@ void tms34061_device::register_w(address_space &space, offs_t offset, uint8_t da
/* certain registers affect the display directly */
if ((regnum >= TMS34061_HORENDSYNC && regnum <= TMS34061_DISPSTART) ||
(regnum == TMS34061_CONTROL2))
- m_screen->update_partial(m_screen->vpos());
+ screen().update_partial(screen().vpos());
/* store the hi/lo half */
if (regnum < ARRAY_LENGTH(m_regs))
@@ -203,7 +203,7 @@ void tms34061_device::register_w(address_space &space, offs_t offset, uint8_t da
if (scanline < 0)
scanline += m_regs[TMS34061_VERTOTAL];
- m_timer->adjust(m_screen->time_until_pos(scanline, m_regs[TMS34061_HORSTARTBLNK]));
+ m_timer->adjust(screen().time_until_pos(scanline, m_regs[TMS34061_HORSTARTBLNK]));
break;
/* XY offset: set the X and Y masks */
@@ -264,7 +264,7 @@ uint8_t tms34061_device::register_r(address_space &space, offs_t offset)
/* vertical count register: return the current scanline */
case TMS34061_VERCOUNTER:
- result = (m_screen->vpos()+ m_regs[TMS34061_VERENDBLNK]) % m_regs[TMS34061_VERTOTAL];
+ result = (screen().vpos()+ m_regs[TMS34061_VERENDBLNK]) % m_regs[TMS34061_VERTOTAL];
break;
}
diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp
index 4d32f72274d..242d4a254e1 100644
--- a/src/devices/video/tms9928a.cpp
+++ b/src/devices/video/tms9928a.cpp
@@ -353,8 +353,8 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par
return;
}
- int raw_vpos = m_screen->vpos();
- int vpos = raw_vpos * m_vertical_size / m_screen->height();
+ int raw_vpos = screen().vpos();
+ int vpos = raw_vpos * m_vertical_size / screen().height();
uint16_t BackColour = m_Regs[7] & 15;
uint32_t *p = &m_tmpbmp.pix32(vpos);
@@ -647,7 +647,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par
}
/* Schedule next callback */
- m_line_timer->adjust( m_screen->time_until_pos( ( raw_vpos + 1 ) % m_screen->height() , HORZ_DISPLAY_START ) );
+ m_line_timer->adjust( screen().time_until_pos( ( raw_vpos + 1 ) % screen().height() , HORZ_DISPLAY_START ) );
}
@@ -780,7 +780,7 @@ void tms9928a_device::device_reset()
m_latch = 0;
m_mode = 0;
- m_line_timer->adjust( m_screen->time_until_pos( 0, HORZ_DISPLAY_START ) );
+ m_line_timer->adjust( screen().time_until_pos( 0, HORZ_DISPLAY_START ) );
// TODO: Check clock freq settings in all drivers
if (!m_out_gromclk_cb.isnull() && m_99) m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()/12));
diff --git a/src/devices/video/upd3301.cpp b/src/devices/video/upd3301.cpp
index 424ea81cee8..0117c9e4977 100644
--- a/src/devices/video/upd3301.cpp
+++ b/src/devices/video/upd3301.cpp
@@ -585,12 +585,12 @@ void upd3301_device::reset_counters()
void upd3301_device::update_hrtc_timer(int state)
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = state ? m_h : 0;
int next_y = state ? y : ((y + 1) % ((m_l + m_v) * m_width));
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_hrtc_timer->adjust(duration, !state);
}
@@ -604,7 +604,7 @@ void upd3301_device::update_vrtc_timer(int state)
{
int next_y = state ? (m_l * m_r) : 0;
- attotime duration = m_screen->time_until_pos(next_y, 0);
+ attotime duration = screen().time_until_pos(next_y, 0);
m_vrtc_timer->adjust(duration, !state);
}
@@ -628,7 +628,7 @@ void upd3301_device::recompute_parameters()
LOG("UPD3301 Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
LOG("UPD3301 Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
update_hrtc_timer(0);
update_vrtc_timer(0);
diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp
index 55f161edbe2..1199ffe16f2 100644
--- a/src/devices/video/upd7220.cpp
+++ b/src/devices/video/upd7220.cpp
@@ -338,7 +338,7 @@ inline void upd7220_device::update_vsync_timer(int state)
{
int next_y = state ? m_vs : 0;
- attotime duration = m_screen->time_until_pos(next_y, 0);
+ attotime duration = screen().time_until_pos(next_y, 0);
m_vsync_timer->adjust(duration, !state);
}
@@ -350,12 +350,12 @@ inline void upd7220_device::update_vsync_timer(int state)
inline void upd7220_device::update_hsync_timer(int state)
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = state ? m_hs : 0;
int next_y = state ? y : ((y + 1) % m_al);
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_hsync_timer->adjust(duration, !state);
}
@@ -367,12 +367,12 @@ inline void upd7220_device::update_hsync_timer(int state)
inline void upd7220_device::update_blank_timer(int state)
{
- int y = m_screen->vpos();
+ int y = screen().vpos();
int next_x = state ? (m_hs + m_hbp) : (m_hs + m_hbp + (m_aw << 3));
int next_y = state ? ((y + 1) % (m_vs + m_vbp + m_al + m_vfp - 1)) : y;
- attotime duration = m_screen->time_until_pos(next_y, next_x);
+ attotime duration = screen().time_until_pos(next_y, next_x);
m_hsync_timer->adjust(duration, !state);
}
@@ -421,7 +421,7 @@ inline void upd7220_device::recompute_parameters()
if (m_m)
{
- m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
+ screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
update_hsync_timer(0);
update_vsync_timer(0);
diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp
index 468cc3900db..4d4606ea11d 100644
--- a/src/devices/video/v9938.cpp
+++ b/src/devices/video/v9938.cpp
@@ -193,7 +193,7 @@ void v99x8_device::device_timer(emu_timer &timer, device_timer_id id, int param,
m_pal_ntsc = pal;
configure_pal_ntsc();
}
- //m_screen->reset_origin();
+ //screen().reset_origin();
m_offset_y = position_offset(m_cont_reg[18] >> 4);
set_screen_parameters();
}
@@ -226,7 +226,7 @@ void v99x8_device::configure_pal_ntsc()
m_height = VTOTAL_PAL;
rectangle visible;
visible.set(0, HVISIBLE - 1, VERTICAL_ADJUST * 2, VVISIBLE_PAL * 2 - 1 - VERTICAL_ADJUST * 2);
- m_screen->configure(HTOTAL, VTOTAL_PAL * 2, visible, HZ_TO_ATTOSECONDS(50.158974));
+ screen().configure(HTOTAL, VTOTAL_PAL * 2, visible, HZ_TO_ATTOSECONDS(50.158974));
}
else
{
@@ -234,7 +234,7 @@ void v99x8_device::configure_pal_ntsc()
m_height = VTOTAL_NTSC;
rectangle visible;
visible.set(0, HVISIBLE - 1, VERTICAL_ADJUST * 2, VVISIBLE_NTSC * 2 - 1 - VERTICAL_ADJUST * 2);
- m_screen->configure(HTOTAL, VTOTAL_NTSC * 2, visible, HZ_TO_ATTOSECONDS(59.922743));
+ screen().configure(HTOTAL, VTOTAL_NTSC * 2, visible, HZ_TO_ATTOSECONDS(59.922743));
}
m_vblank_start = m_height - VERTICAL_SYNC - TOP_ERASE; /* Sync + top erase */
}
@@ -571,7 +571,7 @@ void v99x8_device::device_start()
m_vdp_ops_count = 1;
m_vdp_engine = nullptr;
- m_screen->register_screen_bitmap(m_bitmap);
+ screen().register_screen_bitmap(m_bitmap);
// Video RAM is allocated as an own address space
m_vram_space = &space(AS_DATA);
diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp
index de3810b74ee..efec0d795a6 100644
--- a/src/devices/video/vic4567.cpp
+++ b/src/devices/video/vic4567.cpp
@@ -172,8 +172,8 @@ void vic3_device::device_start()
{
int width, height;
- width = m_screen->width();
- height = m_screen->height();
+ width = screen().width();
+ height = screen().height();
m_bitmap = std::make_unique<bitmap_ind16>(width, height);
@@ -1868,7 +1868,7 @@ void vic3_device::draw_bitplanes()
{
int x, y, y1s, offset;
rectangle vis;
- const rectangle &visarea = m_screen->visible_area();
+ const rectangle &visarea = screen().visible_area();
if (VIC3_LINES == 400)
{ /* interlaced! */
@@ -1972,13 +1972,13 @@ void vic3_device::raster_interrupt_gen()
m_rows = new_rows;
m_columns = new_columns;
if (m_type == vic3_type::PAL)
- m_screen->set_visible_area(
+ screen().set_visible_area(
VIC2_STARTVISIBLECOLUMNS + 32,
VIC2_STARTVISIBLECOLUMNS + 32 + m_columns + 16 - 1,
VIC2_STARTVISIBLELINES + 34,
VIC2_STARTVISIBLELINES + 34 + m_rows + 16 - 1);
else
- m_screen->set_visible_area(
+ screen().set_visible_area(
VIC2_STARTVISIBLECOLUMNS + 34,
VIC2_STARTVISIBLECOLUMNS + 34 + m_columns + 16 - 1,
VIC2_STARTVISIBLELINES + 10,
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;
}
diff --git a/src/devices/video/zeus2.h b/src/devices/video/zeus2.h
index 2998d6378d3..2900fdce2e0 100644
--- a/src/devices/video/zeus2.h
+++ b/src/devices/video/zeus2.h
@@ -110,13 +110,11 @@ typedef zeus2_renderer::extent_t z2_poly_extent;
#define MCFG_ZEUS2_FLOAT_MODE(_mode) \
downcast<zeus2_device *>(device)->set_float_mode(_mode);
-class zeus2_device : public device_t
+class zeus2_device : public device_t, public device_video_interface
{
public:
zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- screen_device *m_screen; /* the screen we are acting on */
-
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ32_MEMBER( zeus2_r );
DECLARE_WRITE32_MEMBER( zeus2_w );