Privatize m_screen and other variables of device_video_interface (nw)

This commit is contained in:
AJR 2018-01-05 10:47:21 -05:00
parent c25b98226d
commit aa45e908bb
93 changed files with 456 additions and 460 deletions

View File

@ -95,7 +95,7 @@ macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig,
m_vram(nullptr), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram(nullptr), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, SEDISPLAY_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, SEDISPLAY_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -118,7 +118,7 @@ void macpds_sedisplay_device::device_start()
m_macpds->install_device(0xc10000, 0xc2ffff, read16_delegate(FUNC(macpds_sedisplay_device::sedisplay_r), this), write16_delegate(FUNC(macpds_sedisplay_device::sedisplay_w), this)); m_macpds->install_device(0xc10000, 0xc2ffff, read16_delegate(FUNC(macpds_sedisplay_device::sedisplay_r), this), write16_delegate(FUNC(macpds_sedisplay_device::sedisplay_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(879, 0), 0); m_timer->adjust(screen().time_until_pos(879, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -145,7 +145,7 @@ void macpds_sedisplay_device::device_timer(emu_timer &timer, device_timer_id tid
m_macpds->set_irq_line(M68K_IRQ_2, ASSERT_LINE); m_macpds->set_irq_line(M68K_IRQ_2, ASSERT_LINE);
} }
m_timer->adjust(m_screen->time_until_pos(879, 0), 0); m_timer->adjust(screen().time_until_pos(879, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -79,7 +79,7 @@ jmfb_device::jmfb_device(const machine_config &mconfig, device_type type, const
m_is824(is824), m_is824(is824),
m_assembled_tag(util::string_format("%s:%s", tag, GC48_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, GC48_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :

View File

@ -73,7 +73,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, M2HIRES_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, M2HIRES_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -100,7 +100,7 @@ void nubus_m2hires_device::device_start()
m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2hires_device::m2hires_r), this), write32_delegate(FUNC(nubus_m2hires_device::m2hires_w), this)); m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2hires_device::m2hires_r), this), write32_delegate(FUNC(nubus_m2hires_device::m2hires_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -128,7 +128,7 @@ void nubus_m2hires_device::device_timer(emu_timer &timer, device_timer_id tid, i
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -75,7 +75,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, M2VIDEO_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, M2VIDEO_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -102,7 +102,7 @@ void nubus_m2video_device::device_start()
m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2video_device::m2video_r), this), write32_delegate(FUNC(nubus_m2video_device::m2video_w), this)); m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2video_device::m2video_r), this), write32_delegate(FUNC(nubus_m2video_device::m2video_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -130,7 +130,7 @@ void nubus_m2video_device::device_timer(emu_timer &timer, device_timer_id tid, i
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -76,7 +76,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, RADIUSTPD_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, RADIUSTPD_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -104,7 +104,7 @@ void nubus_radiustpd_device::device_start()
m_nubus->install_device(slotspace+0x980000, slotspace+0x9effff, read32_delegate(FUNC(nubus_radiustpd_device::radiustpd_r), this), write32_delegate(FUNC(nubus_radiustpd_device::radiustpd_w), this)); m_nubus->install_device(slotspace+0x980000, slotspace+0x9effff, read32_delegate(FUNC(nubus_radiustpd_device::radiustpd_r), this), write32_delegate(FUNC(nubus_radiustpd_device::radiustpd_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -132,7 +132,7 @@ void nubus_radiustpd_device::device_timer(emu_timer &timer, device_timer_id tid,
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -78,7 +78,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device
m_assembled_tag(util::string_format("%s:%s", tag, SPEC8S3_SCREEN_NAME)), m_assembled_tag(util::string_format("%s:%s", tag, SPEC8S3_SCREEN_NAME)),
m_vbl_pending(false), m_parameter(0) m_vbl_pending(false), m_parameter(0)
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -104,7 +104,7 @@ void nubus_spec8s3_device::device_start()
m_nubus->install_device(slotspace+0xd0000, slotspace+0xfffff, read32_delegate(FUNC(nubus_spec8s3_device::spec8s3_r), this), write32_delegate(FUNC(nubus_spec8s3_device::spec8s3_w), this)); m_nubus->install_device(slotspace+0xd0000, slotspace+0xfffff, read32_delegate(FUNC(nubus_spec8s3_device::spec8s3_r), this), write32_delegate(FUNC(nubus_spec8s3_device::spec8s3_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(767, 0), 0); m_timer->adjust(screen().time_until_pos(767, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -135,7 +135,7 @@ void nubus_spec8s3_device::device_timer(emu_timer &timer, device_timer_id tid, i
m_vbl_pending = true; m_vbl_pending = true;
} }
m_timer->adjust(m_screen->time_until_pos(767, 0), 0); m_timer->adjust(screen().time_until_pos(767, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -92,7 +92,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device
m_width(0), m_height(0), m_patofsx(0), m_patofsy(0), m_vram_addr(0), m_vram_src(0), m_width(0), m_height(0), m_patofsx(0), m_patofsy(0), m_vram_addr(0), m_vram_src(0),
m_palette(*this, "palette") m_palette(*this, "palette")
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -117,7 +117,7 @@ void nubus_specpdq_device::device_start()
m_nubus->install_device(slotspace+0x400000, slotspace+0xfbffff, read32_delegate(FUNC(nubus_specpdq_device::specpdq_r), this), write32_delegate(FUNC(nubus_specpdq_device::specpdq_w), this)); m_nubus->install_device(slotspace+0x400000, slotspace+0xfbffff, read32_delegate(FUNC(nubus_specpdq_device::specpdq_r), this), write32_delegate(FUNC(nubus_specpdq_device::specpdq_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(843, 0), 0); m_timer->adjust(screen().time_until_pos(843, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -145,7 +145,7 @@ void nubus_specpdq_device::device_timer(emu_timer &timer, device_timer_id tid, i
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(843, 0), 0); m_timer->adjust(screen().time_until_pos(843, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -76,7 +76,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig,
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, WSPORTRAIT_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, WSPORTRAIT_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -103,7 +103,7 @@ void nubus_wsportrait_device::device_start()
m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_wsportrait_device::wsportrait_r), this), write32_delegate(FUNC(nubus_wsportrait_device::wsportrait_w), this)); m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_wsportrait_device::wsportrait_r), this), write32_delegate(FUNC(nubus_wsportrait_device::wsportrait_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(869, 0), 0); m_timer->adjust(screen().time_until_pos(869, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -128,7 +128,7 @@ void nubus_wsportrait_device::device_timer(emu_timer &timer, device_timer_id tid
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(869, 0), 0); m_timer->adjust(screen().time_until_pos(869, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -76,7 +76,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, XCEED30HR_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, XCEED30HR_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -102,7 +102,7 @@ void nubus_xceed30hr_device::device_start()
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this)); m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -130,7 +130,7 @@ void nubus_xceed30hr_device::device_timer(emu_timer &timer, device_timer_id tid,
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -70,7 +70,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, CB264SE30_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, CB264SE30_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -96,7 +96,7 @@ void nubus_cb264se30_device::device_start()
m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this)); m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -124,7 +124,7 @@ void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid,
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -72,7 +72,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, XCEEDMC30_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, XCEEDMC30_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -98,7 +98,7 @@ void nubus_xceedmc30_device::device_start()
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this)); m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -126,7 +126,7 @@ void nubus_xceedmc30_device::device_timer(emu_timer &timer, device_timer_id tid,
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -75,7 +75,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, PROCOLOR816_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, PROCOLOR816_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -102,7 +102,7 @@ void nubus_procolor816_device::device_start()
m_nubus->install_device(slotspace+0xf00000, slotspace+0xff7fff, read32_delegate(FUNC(nubus_procolor816_device::procolor816_r), this), write32_delegate(FUNC(nubus_procolor816_device::procolor816_w), this)); m_nubus->install_device(slotspace+0xf00000, slotspace+0xff7fff, read32_delegate(FUNC(nubus_procolor816_device::procolor816_r), this), write32_delegate(FUNC(nubus_procolor816_device::procolor816_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -130,7 +130,7 @@ void nubus_procolor816_device::device_timer(emu_timer &timer, device_timer_id ti
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(479, 0), 0); m_timer->adjust(screen().time_until_pos(479, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -70,7 +70,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_typ
m_vram32(nullptr), m_vbl_disable(0), m_toggle(0), m_timer(nullptr), m_protstate(0), m_vram32(nullptr), m_vbl_disable(0), m_toggle(0), m_timer(nullptr), m_protstate(0),
m_assembled_tag(util::string_format("%s:%s", tag, LVIEW_SCREEN_NAME)) m_assembled_tag(util::string_format("%s:%s", tag, LVIEW_SCREEN_NAME))
{ {
m_screen_tag = m_assembled_tag.c_str(); static_set_screen(*this, m_assembled_tag.c_str());
} }
//------------------------------------------------- //-------------------------------------------------
@ -97,7 +97,7 @@ void nubus_lview_device::device_start()
m_nubus->install_device(slotspace+0xb0000, slotspace+0xbffff, read32_delegate(FUNC(nubus_lview_device::lview_r), this), write32_delegate(FUNC(nubus_lview_device::lview_w), this)); m_nubus->install_device(slotspace+0xb0000, slotspace+0xbffff, read32_delegate(FUNC(nubus_lview_device::lview_r), this), write32_delegate(FUNC(nubus_lview_device::lview_w), this));
m_timer = timer_alloc(0, nullptr); m_timer = timer_alloc(0, nullptr);
m_timer->adjust(m_screen->time_until_pos(599, 0), 0); m_timer->adjust(screen().time_until_pos(599, 0), 0);
} }
//------------------------------------------------- //-------------------------------------------------
@ -123,7 +123,7 @@ void nubus_lview_device::device_timer(emu_timer &timer, device_timer_id tid, int
raise_slot_irq(); raise_slot_irq();
} }
m_timer->adjust(m_screen->time_until_pos(599, 0), 0); m_timer->adjust(screen().time_until_pos(599, 0), 0);
} }
/*************************************************************************** /***************************************************************************

View File

@ -93,7 +93,7 @@ sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig,
{ {
// Workaround for failed validation that occurs when running on a driver // Workaround for failed validation that occurs when running on a driver
// with Sega Scope emulation, which adds 2 screens (left/right lenses). // with Sega Scope emulation, which adds 2 screens (left/right lenses).
m_screen_tag = ":screen"; static_set_screen(*this, ":screen");
} }
@ -150,10 +150,10 @@ uint8_t sms_light_phaser_device::peripheral_r()
int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int lgun_y ) int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int lgun_y )
{ {
const int r_x_r = LGUN_RADIUS * LGUN_RADIUS; const int r_x_r = LGUN_RADIUS * LGUN_RADIUS;
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
rectangle aim_area; rectangle aim_area;
int beam_x = m_screen->hpos(); int beam_x = screen().hpos();
int beam_y = m_screen->vpos(); int beam_y = screen().vpos();
int beam_x_orig = beam_x; int beam_x_orig = beam_x;
int beam_y_orig = beam_y; int beam_y_orig = beam_y;
int dy, result = 1; int dy, result = 1;
@ -256,14 +256,14 @@ int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int
} }
} }
timer->adjust(m_screen->time_until_pos(beam_y, beam_x)); timer->adjust(screen().time_until_pos(beam_y, beam_x));
return result; return result;
} }
uint16_t sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos) uint16_t sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos)
{ {
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
int offset_x = (scaled_hpos * (visarea.max_x - visarea.min_x)) / 255; int offset_x = (scaled_hpos * (visarea.max_x - visarea.min_x)) / 255;
return visarea.min_x + offset_x; return visarea.min_x + offset_x;
} }
@ -271,7 +271,7 @@ uint16_t sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos)
uint16_t sms_light_phaser_device::screen_vpos_nonscaled(int scaled_vpos) uint16_t sms_light_phaser_device::screen_vpos_nonscaled(int scaled_vpos)
{ {
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
int offset_y = (scaled_vpos * (visarea.max_y - visarea.min_y)) / 255; int offset_y = (scaled_vpos * (visarea.max_y - visarea.min_y)) / 255;
return visarea.min_y + offset_y; return visarea.min_y + offset_y;
} }

View File

@ -27,7 +27,7 @@ void tms340x0_device::line(uint16_t op)
m_st |= STBIT_P; m_st |= STBIT_P;
TEMP() = (op & 0x80) ? 1 : 0; /* boundary value depends on the algorithm */ TEMP() = (op & 0x80) ? 1 : 0; /* boundary value depends on the algorithm */
LOGGFX(("%08X(%3d):LINE (%d,%d)-(%d,%d)\n", m_pc, m_screen->vpos(), DADDR_X(), DADDR_Y(), DADDR_X() + DYDX_X(), DADDR_Y() + DYDX_Y())); LOGGFX(("%08X(%3d):LINE (%d,%d)-(%d,%d)\n", m_pc, screen().vpos(), DADDR_X(), DADDR_Y(), DADDR_X() + DYDX_X(), DADDR_Y() + DYDX_Y()));
} }
if (COUNT() > 0) if (COUNT() > 0)
@ -835,7 +835,7 @@ void tms340x0_device::pixblt_b_l(uint16_t op)
int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5;
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT B,L (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT B,L (%dx%d) depth=%d\n", m_pc, screen().vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
(this->*s_pixblt_b_op_table[ix])(1); (this->*s_pixblt_b_op_table[ix])(1);
@ -847,7 +847,7 @@ void tms340x0_device::pixblt_b_xy(uint16_t op)
int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5;
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT B,XY (%d,%d) (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT B,XY (%d,%d) (%dx%d) depth=%d\n", m_pc, screen().vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
(this->*s_pixblt_b_op_table[ix])(0); (this->*s_pixblt_b_op_table[ix])(0);
@ -860,7 +860,7 @@ void tms340x0_device::pixblt_l_l(uint16_t op)
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int pbh = (IOREG(REG_CONTROL) >> 8) & 1;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT L,L (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT L,L (%dx%d) depth=%d\n", m_pc, screen().vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
if (!pbh) if (!pbh)
@ -876,7 +876,7 @@ void tms340x0_device::pixblt_l_xy(uint16_t op)
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int pbh = (IOREG(REG_CONTROL) >> 8) & 1;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT L,XY (%d,%d) (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT L,XY (%d,%d) (%dx%d) depth=%d\n", m_pc, screen().vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
if (!pbh) if (!pbh)
@ -892,7 +892,7 @@ void tms340x0_device::pixblt_xy_l(uint16_t op)
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int pbh = (IOREG(REG_CONTROL) >> 8) & 1;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT XY,L (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT XY,L (%dx%d) depth=%d\n", m_pc, screen().vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
if (!pbh) if (!pbh)
@ -908,7 +908,7 @@ void tms340x0_device::pixblt_xy_xy(uint16_t op)
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int pbh = (IOREG(REG_CONTROL) >> 8) & 1;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT XY,XY (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):PIXBLT XY,XY (%dx%d) depth=%d\n", m_pc, screen().vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
if (!pbh) if (!pbh)
@ -923,7 +923,7 @@ void tms340x0_device::fill_l(uint16_t op)
int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5;
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):FILL L (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):FILL L (%dx%d) depth=%d\n", m_pc, screen().vpos(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
(this->*s_fill_op_table[ix])(1); (this->*s_fill_op_table[ix])(1);
@ -935,7 +935,7 @@ void tms340x0_device::fill_xy(uint16_t op)
int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5;
int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f;
int ix = trans | (rop << 1) | (psize << 6); int ix = trans | (rop << 1) | (psize << 6);
if (!P_FLAG()) LOGGFX(("%08X(%3d):FILL XY (%d,%d) (%dx%d) depth=%d\n", m_pc, m_screen->vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); if (!P_FLAG()) LOGGFX(("%08X(%3d):FILL XY (%d,%d) (%dx%d) depth=%d\n", m_pc, screen().vpos(), DADDR_X(), DADDR_Y(), DYDX_X(), DYDX_Y(), IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32));
m_pixel_op = s_pixel_op_table[rop]; m_pixel_op = s_pixel_op_table[rop];
m_pixel_op_timing = s_pixel_op_timing_table[rop]; m_pixel_op_timing = s_pixel_op_timing_table[rop];
(this->*s_fill_op_table[ix])(0); (this->*s_fill_op_table[ix])(0);

View File

@ -849,7 +849,7 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback )
int master; int master;
/* fetch the core timing parameters */ /* fetch the core timing parameters */
const rectangle &current_visarea = m_screen->visible_area(); const rectangle &current_visarea = screen().visible_area();
enabled = SMART_IOREG(DPYCTL) & 0x8000; enabled = SMART_IOREG(DPYCTL) & 0x8000;
master = (m_is_34020 || (SMART_IOREG(DPYCTL) & 0x2000)); master = (m_is_34020 || (SMART_IOREG(DPYCTL) & 0x2000));
vsblnk = SMART_IOREG(VSBLNK); vsblnk = SMART_IOREG(VSBLNK);
@ -857,8 +857,8 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback )
vtotal = SMART_IOREG(VTOTAL); vtotal = SMART_IOREG(VTOTAL);
if (!master) if (!master)
{ {
vtotal = std::min(m_screen->height() - 1, vtotal); vtotal = std::min(screen().height() - 1, vtotal);
vcount = m_screen->vpos(); vcount = screen().vpos();
} }
/* update the VCOUNT */ /* update the VCOUNT */
@ -916,13 +916,13 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback )
/* because many games play with the HEBLNK/HSBLNK for effects, we don't change /* because many games play with the HEBLNK/HSBLNK for effects, we don't change
if they are the only thing that has changed, unless they are stable for a couple if they are the only thing that has changed, unless they are stable for a couple
of frames */ of frames */
int current_width = m_screen->width(); int current_width = screen().width();
int current_height = m_screen->height(); int current_height = screen().height();
if (width != current_width || height != current_height || visarea.min_y != current_visarea.min_y || visarea.max_y != current_visarea.max_y || if (width != current_width || height != current_height || visarea.min_y != current_visarea.min_y || visarea.max_y != current_visarea.max_y ||
(m_hblank_stable > 2 && (visarea.min_x != current_visarea.min_x || visarea.max_x != current_visarea.max_x))) (m_hblank_stable > 2 && (visarea.min_x != current_visarea.min_x || visarea.max_x != current_visarea.max_x)))
{ {
m_screen->configure(width, height, visarea, refresh); screen().configure(width, height, visarea, refresh);
} }
m_hblank_stable++; m_hblank_stable++;
} }
@ -939,7 +939,7 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback )
/* force a partial update within the visible area */ /* force a partial update within the visible area */
if (vcount >= current_visarea.min_y && vcount <= current_visarea.max_y && (!m_scanline_ind16_cb.isnull() || !m_scanline_rgb32_cb.isnull())) if (vcount >= current_visarea.min_y && vcount <= current_visarea.max_y && (!m_scanline_ind16_cb.isnull() || !m_scanline_rgb32_cb.isnull()))
m_screen->update_partial(vcount); screen().update_partial(vcount);
/* if we are in the visible area, increment DPYADR by DUDATE */ /* if we are in the visible area, increment DPYADR by DUDATE */
if (vcount >= veblnk && vcount < vsblnk) if (vcount >= veblnk && vcount < vsblnk)
@ -975,7 +975,7 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback )
/* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */ /* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */
/* but helps ensure that masters are updated first before slaves */ /* but helps ensure that masters are updated first before slaves */
m_scantimer->adjust(m_screen->time_until_pos(vcount) + attotime(0, !master), vcount); m_scantimer->adjust(screen().time_until_pos(vcount) + attotime(0, !master), vcount);
} }
@ -1210,7 +1210,7 @@ WRITE16_MEMBER( tms34010_device::io_register_w )
break; break;
} }
LOGCONTROLREGS("%s: %s = %04X (%d)\n", machine().describe_context(), ioreg_name[offset], IOREG(offset), m_screen->vpos()); LOGCONTROLREGS("%s: %s = %04X (%d)\n", machine().describe_context(), ioreg_name[offset], IOREG(offset), screen().vpos());
} }
@ -1245,7 +1245,7 @@ WRITE16_MEMBER( tms34020_device::io_register_w )
oldreg = IOREG(offset); oldreg = IOREG(offset);
IOREG(offset) = data; IOREG(offset) = data;
LOGCONTROLREGS("%s: %s = %04X (%d)\n", machine().describe_context(), ioreg020_name[offset], IOREG(offset), m_screen->vpos()); LOGCONTROLREGS("%s: %s = %04X (%d)\n", machine().describe_context(), ioreg020_name[offset], IOREG(offset), screen().vpos());
switch (offset) switch (offset)
{ {
@ -1408,9 +1408,9 @@ READ16_MEMBER( tms34010_device::io_register_r )
{ {
case REG_HCOUNT: case REG_HCOUNT:
/* scale the horizontal position from screen width to HTOTAL */ /* scale the horizontal position from screen width to HTOTAL */
result = m_screen->hpos(); result = screen().hpos();
total = IOREG(REG_HTOTAL) + 1; total = IOREG(REG_HTOTAL) + 1;
result = result * total / m_screen->width(); result = result * total / screen().width();
/* offset by the HBLANK end */ /* offset by the HBLANK end */
result += IOREG(REG_HEBLNK); result += IOREG(REG_HEBLNK);
@ -1449,9 +1449,9 @@ READ16_MEMBER( tms34020_device::io_register_r )
{ {
case REG020_HCOUNT: case REG020_HCOUNT:
/* scale the horizontal position from screen width to HTOTAL */ /* scale the horizontal position from screen width to HTOTAL */
result = m_screen->hpos(); result = screen().hpos();
total = IOREG(REG020_HTOTAL) + 1; total = IOREG(REG020_HTOTAL) + 1;
result = result * total / m_screen->width(); result = result * total / screen().width();
/* offset by the HBLANK end */ /* offset by the HBLANK end */
result += IOREG(REG020_HEBLNK); result += IOREG(REG020_HEBLNK);

View File

@ -143,9 +143,9 @@ READ8_MEMBER( k053252_device::read )
/* VCT read-back */ /* VCT read-back */
// TODO: correct? // TODO: correct?
case 0x0e: case 0x0e:
return ((m_screen->vpos()-m_vc) >> 8) & 1; return ((screen().vpos()-m_vc) >> 8) & 1;
case 0x0f: case 0x0f:
return (m_screen->vpos()-m_vc) & 0xff; return (screen().vpos()-m_vc) & 0xff;
default: default:
//popmessage("Warning: k053252 read %02x, contact MAMEdev",offset); //popmessage("Warning: k053252 read %02x, contact MAMEdev",offset);
break; break;
@ -171,7 +171,7 @@ void k053252_device::res_change()
visarea.max_x = m_offsx + m_hc - m_hfp - m_hbp - 8*(m_hsw) - 1; visarea.max_x = m_offsx + m_hc - m_hfp - m_hbp - 8*(m_hsw) - 1;
visarea.max_y = m_offsy + m_vc - m_vfp - m_vbp - (m_vsw) - 1; visarea.max_y = m_offsy + m_vc - m_vfp - m_vbp - (m_vsw) - 1;
m_screen->configure(m_hc, m_vc, visarea, refresh); screen().configure(m_hc, m_vc, visarea, refresh);
if (m_slave_screen.found()) if (m_slave_screen.found())
m_slave_screen->configure(m_hc, m_vc, visarea, refresh); m_slave_screen->configure(m_hc, m_vc, visarea, refresh);

View File

@ -485,7 +485,7 @@ void laserdisc_device::set_slider_speed(int32_t tracks_per_vsync)
update_slider_pos(); update_slider_pos();
// if 0, set the time to 0 // if 0, set the time to 0
attotime vsyncperiod = m_screen->frame_period(); attotime vsyncperiod = screen().frame_period();
if (tracks_per_vsync == 0) if (tracks_per_vsync == 0)
m_attospertrack = 0; m_attospertrack = 0;
@ -792,7 +792,7 @@ void laserdisc_device::init_disc()
void laserdisc_device::init_video() void laserdisc_device::init_video()
{ {
// register for VBLANK callbacks // register for VBLANK callbacks
m_screen->register_vblank_callback(vblank_state_delegate(&laserdisc_device::vblank_state_changed, this)); screen().register_vblank_callback(vblank_state_delegate(&laserdisc_device::vblank_state_changed, this));
// allocate palette for applying brightness/contrast/gamma // allocate palette for applying brightness/contrast/gamma
m_videopalette = palette_t::alloc(256); m_videopalette = palette_t::alloc(256);

View File

@ -186,7 +186,7 @@ s2636_device::s2636_device(const machine_config &mconfig, const char *tag, devic
void s2636_device::device_start() void s2636_device::device_start()
{ {
m_bitmap.resize(m_screen->width(), m_screen->height()); m_bitmap.resize(screen().width(), screen().height());
save_item(NAME(m_bitmap)); save_item(NAME(m_bitmap));
@ -218,8 +218,8 @@ void s2636_device::device_start()
bitmap_ind16 const &s2636_device::update(const rectangle &cliprect) bitmap_ind16 const &s2636_device::update(const rectangle &cliprect)
{ {
m_vrst = true; m_vrst = true;
m_screen_line = m_screen->visible_area().min_y; m_screen_line = screen().visible_area().min_y;
while (m_screen_line <= m_screen->visible_area().max_y) while (m_screen_line <= screen().visible_area().max_y)
render_next_line(); render_next_line();
return m_bitmap; return m_bitmap;
@ -246,7 +246,7 @@ void s2636_device::render_next_line()
assert(m_screen_line < m_bitmap.height()); assert(m_screen_line < m_bitmap.height());
// pre-clear the line for convenience // pre-clear the line for convenience
rectangle const &vis_area = m_screen->visible_area(); rectangle const &vis_area = screen().visible_area();
uint16_t *const row = &m_bitmap.pix16(m_screen_line); uint16_t *const row = &m_bitmap.pix16(m_screen_line);
m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0); m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0);
@ -459,7 +459,7 @@ void s2636_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
{ {
if (m_registers[REG_SND_PERIOD]) if (m_registers[REG_SND_PERIOD])
{ {
m_sample_cnt = (machine().sample_rate() * (m_registers[REG_SND_PERIOD] + 1) * m_screen->scan_period()).seconds(); m_sample_cnt = (machine().sample_rate() * (m_registers[REG_SND_PERIOD] + 1) * screen().scan_period()).seconds();
m_sound_lvl = !m_sound_lvl; m_sound_lvl = !m_sound_lvl;
} }
else else

View File

@ -108,7 +108,7 @@ void cdp1864_device::device_start()
m_hsync_timer = timer_alloc(TIMER_HSYNC); m_hsync_timer = timer_alloc(TIMER_HSYNC);
// find devices // find devices
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// register for state saving // register for state saving
save_item(NAME(m_disp)); save_item(NAME(m_disp));
@ -128,8 +128,8 @@ void cdp1864_device::device_start()
void cdp1864_device::device_reset() void cdp1864_device::device_reset()
{ {
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));
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));
m_dma_timer->adjust(clocks_to_attotime(CDP1864_CYCLES_DMA_START)); m_dma_timer->adjust(clocks_to_attotime(CDP1864_CYCLES_DMA_START));
m_disp = 0; m_disp = 0;
@ -148,7 +148,7 @@ void cdp1864_device::device_reset()
void cdp1864_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void cdp1864_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) switch (id)
{ {
@ -160,7 +160,7 @@ void cdp1864_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_write_irq(ASSERT_LINE); 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 else
{ {
@ -169,7 +169,7 @@ void cdp1864_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_write_irq(CLEAR_LINE); 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; break;
@ -178,22 +178,22 @@ void cdp1864_device::device_timer(emu_timer &timer, device_timer_id id, int para
{ {
case SCANLINE_EFX_TOP_START: case SCANLINE_EFX_TOP_START:
m_write_efx(ASSERT_LINE); 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; break;
case SCANLINE_EFX_TOP_END: case SCANLINE_EFX_TOP_END:
m_write_efx(CLEAR_LINE); 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; break;
case SCANLINE_EFX_BOTTOM_START: case SCANLINE_EFX_BOTTOM_START:
m_write_efx(ASSERT_LINE); 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; break;
case SCANLINE_EFX_BOTTOM_END: case SCANLINE_EFX_BOTTOM_END:
m_write_efx(CLEAR_LINE); 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;
} }
break; break;
@ -339,8 +339,8 @@ WRITE8_MEMBER( cdp1864_device::tone_latch_w )
WRITE8_MEMBER( cdp1864_device::dma_w ) WRITE8_MEMBER( cdp1864_device::dma_w )
{ {
int rdata = 1, bdata = 1, gdata = 1; int rdata = 1, bdata = 1, gdata = 1;
int sx = m_screen->hpos() + 4; int sx = screen().hpos() + 4;
int y = m_screen->vpos(); int y = screen().vpos();
if (!m_con) if (!m_con)
{ {

View File

@ -177,7 +177,7 @@ inline void cdp1869_device::update_prd_changed_timer()
int start = SCANLINE_PREDISPLAY_START_PAL; int start = SCANLINE_PREDISPLAY_START_PAL;
int end = SCANLINE_PREDISPLAY_END_PAL; int end = SCANLINE_PREDISPLAY_END_PAL;
int next_state; int next_state;
int scanline = m_screen->vpos(); int scanline = screen().vpos();
int next_scanline; int next_scanline;
if (is_ntsc()) if (is_ntsc())
@ -207,7 +207,7 @@ inline void cdp1869_device::update_prd_changed_timer()
next_state = CLEAR_LINE; next_state = CLEAR_LINE;
} }
attotime duration = m_screen->time_until_pos(next_scanline); attotime duration = screen().time_until_pos(next_scanline);
m_prd_timer->adjust(duration, next_state); m_prd_timer->adjust(duration, next_state);
} }

View File

@ -737,7 +737,7 @@ device_memory_interface::space_config_vector mos6560_device::memory_space_config
void mos6560_device::device_start() void mos6560_device::device_start()
{ {
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// resolve callbacks // resolve callbacks
m_read_potx.resolve_safe(0xff); m_read_potx.resolve_safe(0xff);
@ -769,7 +769,7 @@ void mos6560_device::device_start()
// allocate timers // allocate timers
m_line_timer = timer_alloc(TIMER_LINE); m_line_timer = timer_alloc(TIMER_LINE);
m_line_timer->adjust(m_screen->scan_period(), 0, m_screen->scan_period()); m_line_timer->adjust(screen().scan_period(), 0, screen().scan_period());
// initialize sound // initialize sound
sound_start(); sound_start();

View File

@ -291,12 +291,12 @@ void mos7360_device::device_start()
m_timer2 = timer_alloc(TIMER_ID_2); m_timer2 = timer_alloc(TIMER_ID_2);
m_timer3 = timer_alloc(TIMER_ID_3); m_timer3 = timer_alloc(TIMER_ID_3);
m_line_timer = timer_alloc(TIMER_LINE); m_line_timer = timer_alloc(TIMER_LINE);
m_line_timer->adjust(m_screen->scan_period(), 0, m_screen->scan_period()); m_line_timer->adjust(screen().scan_period(), 0, screen().scan_period());
m_frame_timer = timer_alloc(TIMER_FRAME); m_frame_timer = timer_alloc(TIMER_FRAME);
m_frame_timer->adjust(m_screen->frame_period(), 0, m_screen->frame_period()); m_frame_timer->adjust(screen().frame_period(), 0, screen().frame_period());
// allocate screen bitmap // allocate screen bitmap
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// create sound stream // create sound stream
m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate()); m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());

View File

@ -294,13 +294,13 @@ void sega315_5124_device::set_frame_timing()
READ8_MEMBER( sega315_5124_device::vcount_read ) 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]; 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--; vpos--;
if (vpos < 0) if (vpos < 0)
vpos += m_screen->height(); vpos += screen().height();
} }
return (vpos - active_scr_start) & 0xff; 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: case TIMER_DRAW:
update_palette(); update_palette();
draw_scanline( LBORDER_START + LBORDER_WIDTH, param, m_screen->vpos() - param ); draw_scanline( LBORDER_START + LBORDER_WIDTH, param, screen().vpos() - param );
break; break;
case TIMER_LBORDER: 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() 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] 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[TOP_BORDER] + m_frame_timing[ACTIVE_DISPLAY_V]
+ m_frame_timing[BOTTOM_BORDER] + m_frame_timing[BOTTOM_BLANKING]; + 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) if (m_line_counter == 0x00)
{ {
m_line_counter = m_reg[0x0a]; 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; m_pending_status |= STATUS_HINT;
} }
else else
@ -477,19 +477,19 @@ void sega315_5124_device::process_line_timer()
if (vpos == vpos_limit + 1) 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; m_pending_status |= STATUS_VINT;
} }
/* Draw borders */ /* Draw borders */
m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos ); m_lborder_timer->adjust( 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_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw middle of the border */ /* Draw middle of the border */
/* We need to do this through the regular drawing function */ /* We need to do this through the regular drawing function */
/* so sprite collisions can occur on the border. */ /* so sprite collisions can occur on the border. */
select_sprites( vpos - (vpos_limit - m_frame_timing[ACTIVE_DISPLAY_V]) ); 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; return;
} }
@ -506,7 +506,7 @@ void sega315_5124_device::process_line_timer()
if (m_line_counter == 0x00) if (m_line_counter == 0x00)
{ {
m_line_counter = m_reg[0x0a]; 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; m_pending_status |= STATUS_HINT;
} }
else else
@ -515,12 +515,12 @@ void sega315_5124_device::process_line_timer()
} }
/* Draw borders */ /* Draw borders */
m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos ); m_lborder_timer->adjust( 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_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw active display */ /* Draw active display */
select_sprites( vpos - vpos_limit ); 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; return;
} }
@ -534,18 +534,18 @@ void sega315_5124_device::process_line_timer()
/* Check if we're on the last line of the top border */ /* Check if we're on the last line of the top border */
if (vpos == vpos_limit + m_frame_timing[TOP_BORDER] - 1) 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 */ /* Draw borders */
m_lborder_timer->adjust( m_screen->time_until_pos( vpos, LBORDER_START ), vpos ); m_lborder_timer->adjust( 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_rborder_timer->adjust( screen().time_until_pos( vpos, LBORDER_START + LBORDER_WIDTH + 256 ), vpos );
/* Draw middle of the border */ /* Draw middle of the border */
/* We need to do this through the regular drawing function */ /* We need to do this through the regular drawing function */
/* so sprite collisions can occur on the border. */ /* so sprite collisions can occur on the border. */
select_sprites( vpos - (vpos_limit + m_frame_timing[TOP_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; return;
} }
@ -600,7 +600,7 @@ void sega315_5124_device::check_pending_flags()
} }
else else
{ {
hpos = m_screen->hpos(); hpos = screen().hpos();
} }
if ((m_pending_status & STATUS_HINT) && hpos >= HINT_HPOS) if ((m_pending_status & STATUS_HINT) && hpos >= HINT_HPOS)
@ -721,11 +721,11 @@ WRITE8_MEMBER( sega315_5124_device::register_write )
break; break;
case 1: case 1:
set_display_settings(); set_display_settings();
if (m_screen->hpos() <= DISPLAY_DISABLED_HPOS) if (screen().hpos() <= DISPLAY_DISABLED_HPOS)
m_display_disabled = !(m_reg[0x01] & 0x40); m_display_disabled = !(m_reg[0x01] & 0x40);
break; break;
case 8: case 8:
if (m_screen->hpos() <= XSCROLL_HPOS) if (screen().hpos() <= XSCROLL_HPOS)
m_reg8copy = m_reg[0x08]; 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; m_frame_timing = (m_is_pal) ? pal_192 : ntsc_192;
/* Make temp bitmap for rendering */ /* Make temp bitmap for rendering */
m_screen->register_screen_bitmap(m_tmpbitmap); screen().register_screen_bitmap(m_tmpbitmap);
m_screen->register_screen_bitmap(m_y1_bitmap); screen().register_screen_bitmap(m_y1_bitmap);
m_display_timer = timer_alloc(TIMER_LINE); 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 = 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_draw_timer = timer_alloc(TIMER_DRAW);
m_lborder_timer = timer_alloc(TIMER_LBORDER); m_lborder_timer = timer_alloc(TIMER_LBORDER);
m_rborder_timer = timer_alloc(TIMER_RBORDER); m_rborder_timer = timer_alloc(TIMER_RBORDER);

View File

@ -67,7 +67,7 @@ public:
DECLARE_PALETTE_INIT( sega315_5124 ); 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 hcount_latch_at_hpos(int hpos);
void stop_timers(); void stop_timers();

View File

@ -1267,7 +1267,7 @@ uint16_t sega315_5313_device::get_hposition()
} }
else else
{ {
value4 = m_screen->hpos(); value4 = screen().hpos();
} }
return value4; return value4;
@ -1278,7 +1278,7 @@ int sega315_5313_device::get_scanline_counter()
if (!m_use_alt_timing) if (!m_use_alt_timing)
return m_scanline_counter; return m_scanline_counter;
else 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); 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) 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_handle_eof();
//vdp_clear_bitmap(); //vdp_clear_bitmap();
} }

View File

@ -69,7 +69,7 @@ void cdp1861_device::device_start()
m_dma_timer = timer_alloc(TIMER_DMA); m_dma_timer = timer_alloc(TIMER_DMA);
// find devices // find devices
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// register for state saving // register for state saving
save_item(NAME(m_disp)); save_item(NAME(m_disp));
@ -85,8 +85,8 @@ void cdp1861_device::device_start()
void cdp1861_device::device_reset() void cdp1861_device::device_reset()
{ {
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));
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));
m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_START)); m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_START));
m_disp = 0; 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) 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) 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_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 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_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; break;
@ -135,22 +135,22 @@ void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int para
{ {
case SCANLINE_EFX_TOP_START: case SCANLINE_EFX_TOP_START:
m_write_efx(ASSERT_LINE); 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; break;
case SCANLINE_EFX_TOP_END: case SCANLINE_EFX_TOP_END:
m_write_efx(CLEAR_LINE); 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; break;
case SCANLINE_EFX_BOTTOM_START: case SCANLINE_EFX_BOTTOM_START:
m_write_efx(ASSERT_LINE); 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; break;
case SCANLINE_EFX_BOTTOM_END: case SCANLINE_EFX_BOTTOM_END:
m_write_efx(CLEAR_LINE); 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;
} }
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 ) WRITE8_MEMBER( cdp1861_device::dma_w )
{ {
int sx = m_screen->hpos() + 4; int sx = screen().hpos() + 4;
int y = m_screen->vpos(); int y = screen().vpos();
int x; int x;
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)

View File

@ -100,7 +100,7 @@ void cdp1862_device::device_start()
m_read_gd.resolve_safe(0); m_read_gd.resolve_safe(0);
// find devices // find devices
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// init palette // init palette
initialize_palette(); initialize_palette();
@ -129,8 +129,8 @@ void cdp1862_device::device_reset()
WRITE8_MEMBER( cdp1862_device::dma_w ) WRITE8_MEMBER( cdp1862_device::dma_w )
{ {
int rd = 1, bd = 1, gd = 1; int rd = 1, bd = 1, gd = 1;
int sx = m_screen->hpos() + 4; int sx = screen().hpos() + 4;
int y = m_screen->vpos(); int y = screen().vpos();
int x; int x;
if (!m_con) if (!m_con)

View File

@ -269,8 +269,8 @@ inline void crt9007_device::trigger_interrupt(int line)
inline void crt9007_device::update_cblank_line() inline void crt9007_device::update_cblank_line()
{ {
int x = m_screen->hpos(); int x = screen().hpos();
int y = m_screen->vpos(); int y = screen().vpos();
// composite blank // composite blank
int cblank = !(m_hs & m_vs); 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) 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_x = state ? m_hsync_start : m_hsync_end;
int next_y = state ? (y + 1) % SCAN_LINES_PER_FRAME : y; 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); 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; 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); 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) 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 // 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_x = state ? m_vlt_end : m_vlt_start;
int next_y = state ? y : ((y == m_vlt_bottom) ? 0 : (y + 1)); 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); 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 // 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 // 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_x = m_vlt_end;
int next_y = y ? y + 1 : y; 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); 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 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); //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_hsync_timer->adjust(screen().time_until_pos(0, 0));
m_vsync_timer->adjust(m_screen->time_until_pos(0, 0)); m_vsync_timer->adjust(screen().time_until_pos(0, 0));
m_vlt_timer->adjust(m_screen->time_until_pos(0, m_vlt_start), 1); m_vlt_timer->adjust(screen().time_until_pos(0, m_vlt_start), 1);
m_drb_timer->adjust(m_screen->time_until_pos(0, 0)); 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) void crt9007_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
int x = m_screen->hpos(); int x = screen().hpos();
int y = m_screen->vpos(); int y = screen().vpos();
switch (id) switch (id)
{ {

View File

@ -95,7 +95,7 @@ crt9021_device::crt9021_device(const machine_config &mconfig, const char *tag, d
void crt9021_device::device_start() void crt9021_device::device_start()
{ {
// register bitmap // register bitmap
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// state saving // state saving
save_item(NAME(m_data)); save_item(NAME(m_data));
@ -159,7 +159,7 @@ WRITE_LINE_MEMBER( crt9021_device::ld_sh_w )
// TODO // 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);
} }
} }

View File

@ -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", 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)); 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 ) if (has_screen())
m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh); screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
m_has_valid_parameters = true; m_has_valid_parameters = true;
} }
@ -355,8 +355,8 @@ void crtc_ega_device::handle_line_timer()
/* also update the cursor state now */ /* also update the cursor state now */
update_cursor_state(); update_cursor_state();
if (m_screen != nullptr) if (has_screen())
m_screen->reset_origin(); screen().reset_origin();
} }
if ( m_line_enable_ff ) if ( m_line_enable_ff )

View File

@ -39,10 +39,10 @@ ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag,
void ef9340_1_device::device_start() void ef9340_1_device::device_start()
{ {
// Let the screen create our temporary bitmap with the screen's dimensions // 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 = 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 // register our state
save_item(NAME(m_ef9341.TA)); 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 ) switch ( id )
{ {
case TIMER_LINE: case TIMER_LINE:
ef9340_scanline(m_screen->vpos()); ef9340_scanline(screen().vpos());
break; break;
} }
} }

View File

@ -145,7 +145,7 @@ void ef9345_device::device_start()
m_videoram = &space(0); 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)); 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) 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 rgb_t *palette = m_palette->palette()->entry_list_raw();
const int scan_xsize = std::min( m_screen->width() - (x * 8), 8); const int scan_xsize = std::min( screen().width() - (x * 8), 8);
const int scan_ysize = std::min( m_screen->height() - (y * 10), 10); const int scan_ysize = std::min( screen().height() - (y * 10), 10);
for(int i = 0; i < scan_ysize; i++) for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++) 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) 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 rgb_t *palette = m_palette->palette()->entry_list_raw();
const int scan_xsize = std::min( m_screen->width() - (x * 6), 6); const int scan_xsize = std::min( screen().width() - (x * 6), 6);
const int scan_ysize = std::min( m_screen->height() - (y * 10), 10); const int scan_ysize = std::min( screen().height() - (y * 10), 10);
for(int i = 0; i < scan_ysize; i++) for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++) 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; 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; 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 //border color

View File

@ -128,7 +128,7 @@ void ef9364_device::device_start()
palette[0] = rgb_t(0, 0, 0); palette[0] = rgb_t(0, 0, 0);
palette[1] = rgb_t(255, 255, 255); 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_cnt = 0;
cursor_state = 0; cursor_state = 0;
@ -171,12 +171,12 @@ void ef9364_device::set_video_mode(void)
{ {
uint16_t new_width = bitplane_xres; 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; 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 //border color

View File

@ -338,7 +338,7 @@ void ef9365_device::device_start()
palette[i] = rgb_t(255, 255, 255); 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_border));
save_item(NAME(m_registers)); save_item(NAME(m_registers));
@ -472,12 +472,12 @@ void ef9365_device::set_video_mode(void)
{ {
uint16_t new_width = bitplane_xres; 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; 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 //border color

View File

@ -359,7 +359,7 @@ cgb_ppu_device::cgb_ppu_device(const machine_config &mconfig, const char *tag, d
void dmg_ppu_device::common_start() void dmg_ppu_device::common_start()
{ {
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
save_item(NAME(m_bitmap)); save_item(NAME(m_bitmap));
m_oam = make_unique_clear<uint8_t[]>(m_oam_size); m_oam = make_unique_clear<uint8_t[]>(m_oam_size);
m_vram = make_unique_clear<uint8_t[]>(m_vram_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) 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); rectangle r1(r.min_x, r.max_x, m_current_line, m_current_line);
m_bitmap.fill(0, r1); 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) 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); rectangle r(r1.min_x, r1.max_x, m_current_line, m_current_line);
m_bitmap.fill((!m_gbc_mode) ? 0 : 32767 , r); m_bitmap.fill((!m_gbc_mode) ? 0 : 32767 , r);
} }

View File

@ -1763,7 +1763,7 @@ void gba_lcd_device::device_start()
m_vram = make_unique_clear<uint32_t[]>(0x18000 / 4); m_vram = make_unique_clear<uint32_t[]>(0x18000 / 4);
m_oam = make_unique_clear<uint32_t[]>(0x400 / 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 */ /* create a timer to fire scanline functions */
m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_lcd_device::perform_scan),this)); m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_lcd_device::perform_scan),this));

View File

@ -450,7 +450,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
pixel = m_cursor ? 1 : 0; 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; bitmap.pix16(sy, sx) = pixel;
} }
} }

View File

@ -528,10 +528,10 @@ inline void hd63484_device::recompute_parameters()
if (BIT(m_dcr, 13)) vbstart += m_sp[0]; if (BIT(m_dcr, 13)) vbstart += m_sp[0];
if (BIT(m_dcr, 11)) vbstart += m_sp[2]; 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); 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 attoseconds_t frame_period = screen().frame_period().attoseconds(); // TODO: use clock() to calculate the frame_period
m_screen->configure(m_hc * ppmc, m_vc, visarea, 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; break;
case 0x80: case 0x80:
res = m_screen->vpos() & 0xfff; // Raster Count res = screen().vpos() & 0xfff; // Raster Count
break; break;
default: default:

View File

@ -508,7 +508,7 @@ READ8_MEMBER( hp1ll3_device::read )
case 0: case 0:
data = m_busy ? 1 : 0; data = m_busy ? 1 : 0;
data |= 2; data |= 2;
data |= (m_screen->vblank() ? 8 : 0); data |= (screen().vblank() ? 8 : 0);
break; break;
case 2: case 2:

View File

@ -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) void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
int vpos = m_screen->vpos(); int vpos = screen().vpos();
int hpos = m_screen->hpos(); int hpos = screen().hpos();
int h = m_last_h; int h = m_last_h;
int v = m_last_v; int v = m_last_v;
uint16_t *bitmap_line = &m_bmp->pix16(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; m_pixel_clock = 0;
memset(m_palette, 0x00, sizeof(m_palette)); memset(m_palette, 0x00, sizeof(m_palette));
m_last_v = m_screen->vpos(); m_last_v = screen().vpos();
m_last_h = m_screen->hpos(); m_last_h = screen().hpos();
m_timer->adjust( m_screen->time_until_pos( ( m_screen->vpos() + 1 ) % 263, 0 ) ); m_timer->adjust( screen().time_until_pos( ( screen().vpos() + 1 ) % 263, 0 ) );
} }
//------------------------------------------------- //-------------------------------------------------

View File

@ -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) void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
int vpos = m_screen->vpos(); int vpos = screen().vpos();
int hpos = m_screen->hpos(); int hpos = screen().hpos();
int h = m_last_h; int h = m_last_h;
int v = m_last_v; int v = m_last_v;
uint32_t *bitmap_line = &m_bmp->pix32(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 */ /* Status info */
case 0x00: case 0x00:
{ {
uint16_t vpos = m_screen->vpos(); uint16_t vpos = screen().vpos();
uint16_t hpos = m_screen->hpos(); uint16_t hpos = screen().hpos();
data = ( vpos << 5 ) | ( m_register & 0x1F); data = ( vpos << 5 ) | ( m_register & 0x1F);
@ -455,7 +455,7 @@ void huc6261_device::device_reset()
memset(m_palette, 0, sizeof(m_palette)); memset(m_palette, 0, sizeof(m_palette));
m_last_v = m_screen->vpos(); m_last_v = screen().vpos();
m_last_h = m_screen->hpos(); m_last_h = screen().hpos();
m_timer->adjust( m_screen->time_until_pos( ( m_screen->vpos() + 1 ) % 263, 0 ) ); m_timer->adjust( screen().time_until_pos( ( screen().vpos() + 1 ) % 263, 0 ) );
} }

View File

@ -136,13 +136,13 @@ i8245_device::i8245_device(const machine_config &mconfig, const char *tag, devic
void i8244_device::device_start() void i8244_device::device_start()
{ {
// Let the screen create our temporary bitmap with the screen's dimensions // 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 = 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 = 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_irq_func.resolve_safe();
m_postprocess_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) 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 ) 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 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! // 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; y += m_screen_lines;
} }
@ -250,7 +250,7 @@ int i8244_device::get_y_beam()
int i8244_device::get_x_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 ) if ( x < 0 )
{ {
@ -356,7 +356,7 @@ WRITE8_MEMBER(i8244_device::write)
READ_LINE_MEMBER(i8244_device::vblank) 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; return 0;
} }
@ -366,8 +366,8 @@ READ_LINE_MEMBER(i8244_device::vblank)
READ_LINE_MEMBER(i8244_device::hblank) READ_LINE_MEMBER(i8244_device::hblank)
{ {
int hpos = m_screen->hpos(); int hpos = screen().hpos();
int vpos = m_screen->vpos(); int vpos = screen().vpos();
if ( hpos >= START_ACTIVE_SCAN && hpos < END_ACTIVE_SCAN ) if ( hpos >= START_ACTIVE_SCAN && hpos < END_ACTIVE_SCAN )
{ {

View File

@ -50,7 +50,6 @@ public:
i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers // 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_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)); } 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)); }

View File

@ -89,7 +89,7 @@ void i82730_device::set_cpu_tag(device_t &device, device_t *owner, const char *t
void i82730_device::device_start() void i82730_device::device_start()
{ {
// register bitmap // register bitmap
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// resolve callbacks // resolve callbacks
m_sint_handler.resolve_safe(); m_sint_handler.resolve_safe();
@ -224,13 +224,13 @@ void i82730_device::mode_set()
// setup screen mode // setup screen mode
rectangle visarea(hbrdstrt * 16, hbrdstp * 16 - 1, m_vsyncstp, m_vfldstp + m_margin + 1 + m_lpr - 1); 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; 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 // start display is now valid
m_mode_set = true; m_mode_set = true;
// adjust timer for the new mode // 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 // output some debug info
if (VERBOSE) if (VERBOSE)
@ -394,7 +394,7 @@ void i82730_device::load_row()
TIMER_CALLBACK_MEMBER( i82730_device::row_update ) TIMER_CALLBACK_MEMBER( i82730_device::row_update )
{ {
int y = m_screen->vpos(); int y = screen().vpos();
if (y == 0) if (y == 0)
{ {
@ -454,7 +454,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update )
// todo: check ca // todo: check ca
// frame interrupt? // frame interrupt?
if ((m_screen->frame_number() % m_frame_int_count) == 0) if ((screen().frame_number() % m_frame_int_count) == 0)
m_status |= EONF; m_status |= EONF;
// check interrupts // check interrupts
@ -465,7 +465,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update )
// vblank // 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 ) WRITE_LINE_MEMBER( i82730_device::ca_w )

View File

@ -133,7 +133,7 @@ i8275_device::i8275_device(const machine_config &mconfig, const char *tag, devic
void i8275_device::device_start() void i8275_device::device_start()
{ {
// get the screen device // get the screen device
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
// resolve callbacks // resolve callbacks
m_display_cb.bind_relative_to(*owner()); 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) void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
//int y = m_screen->vpos(); //int y = screen().vpos();
//int x = m_screen->hpos(); //int x = screen().hpos();
int rc = m_scanline / SCANLINES_PER_ROW; int rc = m_scanline / SCANLINES_PER_ROW;
int lc = 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 ) 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); m_write_drq(0);
@ -631,8 +631,8 @@ WRITE_LINE_MEMBER( i8275_device::lpen_w )
{ {
if (!m_lpen && state) if (!m_lpen && state)
{ {
m_param[REG_LPEN_COL] = m_screen->hpos() / m_hpixels_per_column; m_param[REG_LPEN_COL] = screen().hpos() / m_hpixels_per_column;
m_param[REG_LPEN_ROW] = m_screen->vpos() / SCANLINES_PER_ROW; m_param[REG_LPEN_ROW] = screen().vpos() / SCANLINES_PER_ROW;
m_status |= ST_LP; 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() 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 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; 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_x = (CHARACTERS_PER_ROW * m_hpixels_per_column) - 1;
int max_visible_y = (CHARACTER_ROWS_PER_FRAME * SCANLINES_PER_ROW) - 1; int max_visible_y = (CHARACTER_ROWS_PER_FRAME * SCANLINES_PER_ROW) - 1;
@ -676,10 +676,10 @@ void i8275_device::recompute_parameters()
rectangle visarea; rectangle visarea;
visarea.set(0, max_visible_x, 0, max_visible_y); 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; 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_irq_scanline = (CHARACTER_ROWS_PER_FRAME - 1) * SCANLINES_PER_ROW;
m_vrtc_scanline = CHARACTER_ROWS_PER_FRAME * 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); 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!"); if (DOUBLE_SPACED_ROWS) fatalerror("Double spaced rows not supported!");
} }

View File

@ -1069,7 +1069,7 @@ void imagetek_i4100_device::draw_tilemap( screen_device &screen, bitmap_ind16 &b
{ {
int y; int y;
bitmap_ind8 &priority_bitmap = m_screen->priority(); bitmap_ind8 &priority_bitmap = screen.priority();
int width = big ? 4096 : 2048; int width = big ? 4096 : 2048;
int height = big ? 4096 : 2048; int height = big ? 4096 : 2048;

View File

@ -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); pix |= ((m_shadow_gfx[offset+0] >> (7-(xi & 0x7))) & 1);
/* blinking, VERY preliminary */ /* blinking, VERY preliminary */
if(tile & 0x800 && m_screen->frame_number() & m_blink) if(tile & 0x800 && screen.frame_number() & m_blink)
pix = 0; pix = 0;
if(yi == 17 && tile & 0x1000) /* underline? */ if(yi == 17 && tile & 0x1000) /* underline? */

View File

@ -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", 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)); 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 ) if (has_screen())
m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh); screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
if(!m_reconfigure_cb.isnull()) if(!m_reconfigure_cb.isnull())
m_reconfigure_cb(horiz_pix_total, vert_pix_total, visarea, refresh); 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 */ /* also update the cursor state now */
update_cursor_state(); update_cursor_state();
if (m_screen != nullptr) if (has_screen())
m_screen->reset_origin(); screen().reset_origin();
} }
else else
{ {

View File

@ -654,7 +654,7 @@ void mos6566_device::device_start()
m_write_aec.resolve_safe(); m_write_aec.resolve_safe();
m_write_k.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++) for (int i = 0; i < 256; i++)
{ {

View File

@ -230,7 +230,7 @@ void ppu2c0x_device::device_start()
m_scanline_timer = timer_alloc(TIMER_SCANLINE); m_scanline_timer = timer_alloc(TIMER_SCANLINE);
/* initialize the scanline handling portion */ /* 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_hblank_timer->adjust(m_cpu->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
m_nmi_timer->adjust(attotime::never); 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 */ /* increment our scanline count */
m_scanline++; 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 */ /* Note: this is called at the _end_ of each scanline */
if (m_scanline == m_vblank_first_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 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 // 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; break;
} }
} }
@ -1191,7 +1191,7 @@ WRITE8_MEMBER( ppu2c0x_device::write )
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
if (m_scanline <= BOTTOM_VISIBLE_SCANLINE) 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 #endif

View File

@ -120,8 +120,8 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c
void psxgpu_device::DebugMeshInit() void psxgpu_device::DebugMeshInit()
{ {
int width = m_screen->width(); int width = screen().width();
int height = m_screen->height(); int height = screen().height();
m_debug.b_mesh = 0; m_debug.b_mesh = 0;
m_debug.b_texture = 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_coord;
int n_colour; int n_colour;
int width = m_screen->width(); int width = screen().width();
int height = m_screen->height(); int height = screen().height();
n_coordx += m_n_displaystartx; n_coordx += m_n_displaystartx;
n_coordy += n_displaystarty; n_coordy += n_displaystarty;
@ -334,8 +334,8 @@ int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap )
if( m_debug.b_texture ) if( m_debug.b_texture )
{ {
int width = m_screen->width(); int width = screen().width();
int height = m_screen->height(); int height = screen().height();
for( n_y = 0; n_y < height; n_y++ ) 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 ]; 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; return m_debug.b_texture;

View File

@ -66,7 +66,7 @@ void scn2674_device::device_start()
m_display_cb.bind_relative_to(*owner()); m_display_cb.bind_relative_to(*owner());
m_intr_cb.resolve_safe(); m_intr_cb.resolve_safe();
m_scanline_timer = timer_alloc(TIMER_SCANLINE); 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_address));
save_item(NAME(m_linecounter)); save_item(NAME(m_linecounter));
@ -604,7 +604,7 @@ WRITE8_MEMBER( scn2674_device::write )
case 2: case 2:
m_screen1_l = data; m_screen1_l = data;
if(!m_screen->vblank()) if(!screen().vblank())
m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1; m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
break; break;
case 3: case 3:
@ -616,7 +616,7 @@ WRITE8_MEMBER( scn2674_device::write )
m_screen1_h &= 0x3f; m_screen1_h &= 0x3f;
LOG("IR14 - Double 1 overridden %02x\n",m_IR14_double_1); 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; m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
break; 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; 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 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; 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_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; 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; rectangle visarea;
visarea.set(0, max_visible_x, 0, max_visible_y); 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) 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++; m_linecounter++;
if(m_linecounter >= m_screen->height()) if(m_linecounter >= screen().height())
{ {
m_linecounter = 0; m_linecounter = 0;
m_address = (m_screen1_h << 8) | m_screen1_l; 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, dw != 0,
m_gfx_enabled != 0, m_gfx_enabled != 0,
charrow == m_IR7_cursor_underline_position, 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; address = (address + 1) & 0xffff;
if(address > ((m_IR9_display_buffer_last_address << 10) | 0x3ff)) if(address > ((m_IR9_display_buffer_last_address << 10) | 0x3ff))

View File

@ -378,7 +378,7 @@ void snes_ppu_device::device_reset()
m_beam.current_vert = 0; m_beam.current_vert = 0;
/* Set STAT78 to NTSC or PAL */ /* 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_beam.last_visible_line = m_stat78 & SNES_PAL ? 240 : 225;
m_mode = 0; m_mode = 0;
m_ppu1_version = 1; // 5C77 chip version number, read by STAT77, only '1' is known 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() void snes_ppu_device::dynamic_res_change()
{ {
rectangle visarea = m_screen->visible_area(); rectangle visarea = screen().visible_area();
attoseconds_t refresh; attoseconds_t refresh;
visarea.min_x = visarea.min_y = 0; visarea.min_x = visarea.min_y = 0;
@ -2012,12 +2012,12 @@ void snes_ppu_device::dynamic_res_change()
if ((m_stat78 & 0x10) == SNES_NTSC) if ((m_stat78 & 0x10) == SNES_NTSC)
{ {
refresh = HZ_TO_ATTOSECONDS(DOTCLK_NTSC) * SNES_HTOTAL * SNES_VTOTAL_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 else
{ {
refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL; 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]; res = m_vram[offset];
else else
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
uint16_t h = m_screen->hpos(); uint16_t h = screen().hpos();
uint16_t ls = (((m_stat78 & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1; uint16_t ls = (((m_stat78 & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1;
if (m_interlace == 2) if (m_interlace == 2)
@ -2095,8 +2095,8 @@ WRITE8_MEMBER( snes_ppu_device::vram_write )
m_vram[offset] = data; m_vram[offset] = data;
else else
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
uint16_t h = m_screen->hpos(); uint16_t h = screen().hpos();
if (v == 0) if (v == 0)
{ {
if (h <= 4) if (h <= 4)
@ -2161,7 +2161,7 @@ READ8_MEMBER( snes_ppu_device::oam_read )
if (!m_screen_disabled) if (!m_screen_disabled)
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
if (v < m_beam.last_visible_line) if (v < m_beam.last_visible_line)
offset = 0x010c; offset = 0x010c;
@ -2179,7 +2179,7 @@ WRITE8_MEMBER( snes_ppu_device::oam_write )
if (!m_screen_disabled) if (!m_screen_disabled)
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
if (v < m_beam.last_visible_line) if (v < m_beam.last_visible_line)
offset = 0x010c; offset = 0x010c;
@ -2220,8 +2220,8 @@ READ8_MEMBER( snes_ppu_device::cgram_read )
#if 0 #if 0
if (!m_screen_disabled) if (!m_screen_disabled)
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
uint16_t h = m_screen->hpos(); uint16_t h = screen().hpos();
if (v < m_beam.last_visible_line && h >= 128 && h < 1096) if (v < m_beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff; offset = 0x1ff;
@ -2248,8 +2248,8 @@ WRITE8_MEMBER( snes_ppu_device::cgram_write )
// writes to the cgram address // writes to the cgram address
if (!m_screen_disabled) if (!m_screen_disabled)
{ {
uint16_t v = m_screen->vpos(); uint16_t v = screen().vpos();
uint16_t h = m_screen->hpos(); uint16_t h = screen().hpos();
if (v < m_beam.last_visible_line && h >= 128 && h < 1096) if (v < m_beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff; 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; return m_ppu1_open_bus;
} }
case SLHV: /* Software latch for H/V counter */ 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 */ return m_openbus_cb(space, 0); /* Return value is meaningless */
case ROAMDATA: /* Read data from OAM (DR) */ case ROAMDATA: /* Read data from OAM (DR) */

View File

@ -48,8 +48,8 @@ public:
void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline); void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline);
int16_t current_x() const { return m_screen->hpos() / m_htmult; } int16_t current_x() const { return screen().hpos() / m_htmult; }
int16_t current_y() const { return m_screen->vpos(); } int16_t current_y() const { return screen().vpos(); }
void set_latch_hv(int16_t x, int16_t y); void set_latch_hv(int16_t x, int16_t y);
uint8_t read(address_space &space, uint32_t offset, uint8_t wrio_bit7); uint8_t read(address_space &space, uint32_t offset, uint8_t wrio_bit7);

View File

@ -154,7 +154,7 @@ void tms34061_device::update_interrupts()
TIMER_CALLBACK_MEMBER( tms34061_device::interrupt ) TIMER_CALLBACK_MEMBER( tms34061_device::interrupt )
{ {
/* set timer for next frame */ /* 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 */ /* set the interrupt bit in the status reg */
m_regs[TMS34061_STATUS] |= 1; 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 */ /* certain registers affect the display directly */
if ((regnum >= TMS34061_HORENDSYNC && regnum <= TMS34061_DISPSTART) || if ((regnum >= TMS34061_HORENDSYNC && regnum <= TMS34061_DISPSTART) ||
(regnum == TMS34061_CONTROL2)) (regnum == TMS34061_CONTROL2))
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
/* store the hi/lo half */ /* store the hi/lo half */
if (regnum < ARRAY_LENGTH(m_regs)) 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) if (scanline < 0)
scanline += m_regs[TMS34061_VERTOTAL]; 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; break;
/* XY offset: set the X and Y masks */ /* 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 */ /* vertical count register: return the current scanline */
case TMS34061_VERCOUNTER: 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; break;
} }

View File

@ -353,8 +353,8 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par
return; return;
} }
int raw_vpos = m_screen->vpos(); int raw_vpos = screen().vpos();
int vpos = raw_vpos * m_vertical_size / m_screen->height(); int vpos = raw_vpos * m_vertical_size / screen().height();
uint16_t BackColour = m_Regs[7] & 15; uint16_t BackColour = m_Regs[7] & 15;
uint32_t *p = &m_tmpbmp.pix32(vpos); 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 */ /* 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_latch = 0;
m_mode = 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 // 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)); if (!m_out_gromclk_cb.isnull() && m_99) m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()/12));

View File

@ -585,12 +585,12 @@ void upd3301_device::reset_counters()
void upd3301_device::update_hrtc_timer(int state) 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_x = state ? m_h : 0;
int next_y = state ? y : ((y + 1) % ((m_l + m_v) * m_width)); 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); 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; 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); 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 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); 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_hrtc_timer(0);
update_vrtc_timer(0); update_vrtc_timer(0);

View File

@ -338,7 +338,7 @@ inline void upd7220_device::update_vsync_timer(int state)
{ {
int next_y = state ? m_vs : 0; 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); 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) 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_x = state ? m_hs : 0;
int next_y = state ? y : ((y + 1) % m_al); 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); 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) 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_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; 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); m_hsync_timer->adjust(duration, !state);
} }
@ -421,7 +421,7 @@ inline void upd7220_device::recompute_parameters()
if (m_m) 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_hsync_timer(0);
update_vsync_timer(0); update_vsync_timer(0);

View File

@ -193,7 +193,7 @@ void v99x8_device::device_timer(emu_timer &timer, device_timer_id id, int param,
m_pal_ntsc = pal; m_pal_ntsc = pal;
configure_pal_ntsc(); configure_pal_ntsc();
} }
//m_screen->reset_origin(); //screen().reset_origin();
m_offset_y = position_offset(m_cont_reg[18] >> 4); m_offset_y = position_offset(m_cont_reg[18] >> 4);
set_screen_parameters(); set_screen_parameters();
} }
@ -226,7 +226,7 @@ void v99x8_device::configure_pal_ntsc()
m_height = VTOTAL_PAL; m_height = VTOTAL_PAL;
rectangle visible; rectangle visible;
visible.set(0, HVISIBLE - 1, VERTICAL_ADJUST * 2, VVISIBLE_PAL * 2 - 1 - VERTICAL_ADJUST * 2); 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 else
{ {
@ -234,7 +234,7 @@ void v99x8_device::configure_pal_ntsc()
m_height = VTOTAL_NTSC; m_height = VTOTAL_NTSC;
rectangle visible; rectangle visible;
visible.set(0, HVISIBLE - 1, VERTICAL_ADJUST * 2, VVISIBLE_NTSC * 2 - 1 - VERTICAL_ADJUST * 2); 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 */ 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_ops_count = 1;
m_vdp_engine = nullptr; 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 // Video RAM is allocated as an own address space
m_vram_space = &space(AS_DATA); m_vram_space = &space(AS_DATA);

View File

@ -172,8 +172,8 @@ void vic3_device::device_start()
{ {
int width, height; int width, height;
width = m_screen->width(); width = screen().width();
height = m_screen->height(); height = screen().height();
m_bitmap = std::make_unique<bitmap_ind16>(width, height); m_bitmap = std::make_unique<bitmap_ind16>(width, height);
@ -1868,7 +1868,7 @@ void vic3_device::draw_bitplanes()
{ {
int x, y, y1s, offset; int x, y, y1s, offset;
rectangle vis; rectangle vis;
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
if (VIC3_LINES == 400) if (VIC3_LINES == 400)
{ /* interlaced! */ { /* interlaced! */
@ -1972,13 +1972,13 @@ void vic3_device::raster_interrupt_gen()
m_rows = new_rows; m_rows = new_rows;
m_columns = new_columns; m_columns = new_columns;
if (m_type == vic3_type::PAL) if (m_type == vic3_type::PAL)
m_screen->set_visible_area( screen().set_visible_area(
VIC2_STARTVISIBLECOLUMNS + 32, VIC2_STARTVISIBLECOLUMNS + 32,
VIC2_STARTVISIBLECOLUMNS + 32 + m_columns + 16 - 1, VIC2_STARTVISIBLECOLUMNS + 32 + m_columns + 16 - 1,
VIC2_STARTVISIBLELINES + 34, VIC2_STARTVISIBLELINES + 34,
VIC2_STARTVISIBLELINES + 34 + m_rows + 16 - 1); VIC2_STARTVISIBLELINES + 34 + m_rows + 16 - 1);
else else
m_screen->set_visible_area( screen().set_visible_area(
VIC2_STARTVISIBLECOLUMNS + 34, VIC2_STARTVISIBLECOLUMNS + 34,
VIC2_STARTVISIBLECOLUMNS + 34 + m_columns + 16 - 1, VIC2_STARTVISIBLECOLUMNS + 34 + m_columns + 16 - 1,
VIC2_STARTVISIBLELINES + 10, VIC2_STARTVISIBLELINES + 10,

View File

@ -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) 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_t(mconfig, ZEUS2, tag, owner, clock)
, device_video_interface(mconfig, *this)
, m_vblank(*this), m_irq(*this), m_atlantis(0) , 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); 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 zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
//if (vblank_period == attotime::zero) //if (vblank_period == attotime::zero)
// vblank_period = m_screen->frame_period(); // vblank_period = screen().frame_period();
//vblank_timer->adjust(vblank_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)); //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); m_vblank(ASSERT_LINE);
/* set a timer for the next off state */ /* 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(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_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)); //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 */ /* initialize polygon engine */
poly = auto_alloc(machine(), zeus2_renderer(this)); 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_vblank.resolve_safe();
m_irq.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 */ /* bits $00080000 is tested in a loop until 0 */
/* bit $00000004 is tested for toggling; probably VBLANK */ /* bit $00000004 is tested for toggling; probably VBLANK */
result = 0x00; result = 0x00;
if (m_screen->vblank()) if (screen().vblank())
result |= 0x04; result |= 0x04;
break; break;
@ -346,8 +345,8 @@ READ32_MEMBER( zeus2_device::zeus2_r )
case 0x54: case 0x54:
// VCOUNT upper 16 bits // VCOUNT upper 16 bits
//result = (m_screen->vpos() << 16) | m_screen->vpos(); //result = (screen().vpos() << 16) | screen().vpos();
result = (m_screen->vpos() << 16); result = (screen().vpos() << 16);
break; break;
} }
@ -412,7 +411,7 @@ if (regdata_count[offset] < 256)
/* writes to register $CC need to force a partial update */ /* writes to register $CC need to force a partial update */
// if ((offset & ~1) == 0xcc) // if ((offset & ~1) == 0xcc)
// m_screen->update_partial(m_screen->vpos()); // screen().update_partial(screen().vpos());
/* always write to low word? */ /* always write to low word? */
m_zeusbase[offset] = data; 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; 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((m_zeusbase[0x33] >> 16) << m_yScale, htotal - 1, 0, (m_zeusbase[0x35] & 0xffff) << m_yScale);
rectangle visarea(0, hor - 1, 0, ver - 1); 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 = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x; zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0; 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]; uint32_t temp = m_zeusbase[0x38];
m_zeusbase[0x38] = oldval; 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; log_fifo = machine().input().code_pressed(KEYCODE_L) | ALWAYS_LOG_FIFO;
m_zeusbase[0x38] = temp; m_zeusbase[0x38] = temp;
} }

View File

@ -110,13 +110,11 @@ typedef zeus2_renderer::extent_t z2_poly_extent;
#define MCFG_ZEUS2_FLOAT_MODE(_mode) \ #define MCFG_ZEUS2_FLOAT_MODE(_mode) \
downcast<zeus2_device *>(device)->set_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: public:
zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 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); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ32_MEMBER( zeus2_r ); DECLARE_READ32_MEMBER( zeus2_r );
DECLARE_WRITE32_MEMBER( zeus2_w ); DECLARE_WRITE32_MEMBER( zeus2_w );

View File

@ -47,12 +47,14 @@ public:
// getters // getters
screen_device &screen() const { return *m_screen; } screen_device &screen() const { return *m_screen; }
bool has_screen() const { return m_screen != nullptr; }
protected: protected:
// optional operation overrides // optional operation overrides
virtual void interface_validity_check(validity_checker &valid) const override; virtual void interface_validity_check(validity_checker &valid) const override;
virtual void interface_pre_start() override; virtual void interface_pre_start() override;
private:
// configuration state // configuration state
bool m_screen_required; // is a screen required? bool m_screen_required; // is a screen required?
const char * m_screen_tag; // configured tag for the target screen const char * m_screen_tag; // configured tag for the target screen

View File

@ -396,10 +396,10 @@ READ16_MEMBER(atari_vad_device::control_read)
// also sets bit 0x4000 if we're in VBLANK // also sets bit 0x4000 if we're in VBLANK
if (offset == 0) if (offset == 0)
{ {
int result = m_screen->vpos(); int result = screen().vpos();
if (result > 255) if (result > 255)
result = 255; result = 255;
if (result > m_screen->visible_area().max_y) if (result > screen().visible_area().max_y)
result |= 0x4000; result |= 0x4000;
return result; return result;
} }
@ -523,8 +523,8 @@ void atari_vad_device::device_reset()
memset(m_control, 0, sizeof(m_control)); memset(m_control, 0, sizeof(m_control));
// start the timers // start the timers
m_tilerow_update_timer->adjust(m_screen->time_until_pos(0)); m_tilerow_update_timer->adjust(screen().time_until_pos(0));
m_eof_timer->adjust(m_screen->time_until_pos(0)); m_eof_timer->adjust(screen().time_until_pos(0));
} }
@ -643,7 +643,7 @@ void atari_vad_device::internal_control_write(offs_t offset, uint16_t newword)
// set the scanline interrupt here // set the scanline interrupt here
case 0x03: case 0x03:
if (oldword != newword || !m_scanline_int_timer->enabled()) if (oldword != newword || !m_scanline_int_timer->enabled())
m_scanline_int_timer->adjust(m_screen->time_until_pos(newword & 0x1ff)); m_scanline_int_timer->adjust(screen().time_until_pos(newword & 0x1ff));
break; break;
// latch enable // latch enable
@ -651,7 +651,7 @@ void atari_vad_device::internal_control_write(offs_t offset, uint16_t newword)
// check for palette banking // check for palette banking
if (m_palette_bank != (((newword & 0x0400) >> 10) ^ 1)) if (m_palette_bank != (((newword & 0x0400) >> 10) ^ 1))
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
m_palette_bank = ((newword & 0x0400) >> 10) ^ 1; m_palette_bank = ((newword & 0x0400) >> 10) ^ 1;
} }
//if ((oldword & ~0x0080) != (newword & ~0x0080)) printf("Latch control = %04X\n", newword); //if ((oldword & ~0x0080) != (newword & ~0x0080)) printf("Latch control = %04X\n", newword);
@ -746,7 +746,7 @@ void atari_vad_device::update_parameter(uint16_t newword)
void atari_vad_device::update_tilerow(emu_timer &timer, int scanline) void atari_vad_device::update_tilerow(emu_timer &timer, int scanline)
{ {
// skip if out of bounds, or not enabled // skip if out of bounds, or not enabled
if (scanline <= m_screen->visible_area().max_y && (m_control[0x0a] & 0x2000) != 0 && m_alpha_tilemap != nullptr) if (scanline <= screen().visible_area().max_y && (m_control[0x0a] & 0x2000) != 0 && m_alpha_tilemap != nullptr)
{ {
// iterate over non-visible alpha tiles in this row // iterate over non-visible alpha tiles in this row
int offset = scanline / 8 * 64 + 48 + 2 * (scanline % 8); int offset = scanline / 8 * 64 + 48 + 2 * (scanline % 8);
@ -755,7 +755,7 @@ void atari_vad_device::update_tilerow(emu_timer &timer, int scanline)
// force an update if we have data // force an update if we have data
if (scanline > 0 && ((data0 | data1) & 15) != 0) if (scanline > 0 && ((data0 | data1) & 15) != 0)
m_screen->update_partial(scanline - 1); screen().update_partial(scanline - 1);
// write the data // write the data
if ((data0 & 15) != 0) if ((data0 & 15) != 0)
@ -766,9 +766,9 @@ void atari_vad_device::update_tilerow(emu_timer &timer, int scanline)
// update the timer to go off at the start of the next row // update the timer to go off at the start of the next row
scanline += ((m_control[0x0a] & 0x2000) != 0) ? 1 : 8; scanline += ((m_control[0x0a] & 0x2000) != 0) ? 1 : 8;
if (scanline >= m_screen->height()) if (scanline >= screen().height())
scanline = 0; scanline = 0;
timer.adjust(m_screen->time_until_pos(scanline), scanline); timer.adjust(screen().time_until_pos(scanline), scanline);
} }
@ -794,7 +794,7 @@ void atari_vad_device::eof_update(emu_timer &timer)
m_playfield_tilemap->set_scrolly(0, m_pf0_yscroll); m_playfield_tilemap->set_scrolly(0, m_pf0_yscroll);
if (m_playfield2_tilemap != nullptr) if (m_playfield2_tilemap != nullptr)
m_playfield2_tilemap->set_scrolly(0, m_pf1_yscroll);*/ m_playfield2_tilemap->set_scrolly(0, m_pf1_yscroll);*/
timer.adjust(m_screen->time_until_pos(0)); timer.adjust(screen().time_until_pos(0));
// use this for debugging the video controller values // use this for debugging the video controller values
#if 0 #if 0

View File

@ -987,7 +987,7 @@ WRITE32_MEMBER( n64_periphs::dp_reg_w )
TIMER_CALLBACK_MEMBER(n64_periphs::vi_scanline_callback) TIMER_CALLBACK_MEMBER(n64_periphs::vi_scanline_callback)
{ {
signal_rcp_interrupt(VI_INTERRUPT); signal_rcp_interrupt(VI_INTERRUPT);
vi_scanline_timer->adjust(m_screen->time_until_pos(vi_intr)); vi_scanline_timer->adjust(screen().time_until_pos(vi_intr));
} }
// Video Interface // Video Interface
@ -1000,7 +1000,7 @@ void n64_periphs::vi_recalculate_resolution()
int width = ((vi_xscale & 0x00000fff) * (x_end - x_start)) / 0x400; int width = ((vi_xscale & 0x00000fff) * (x_end - x_start)) / 0x400;
int height = ((vi_yscale & 0x00000fff) * (y_end - y_start)) / 0x400; int height = ((vi_yscale & 0x00000fff) * (y_end - y_start)) / 0x400;
rectangle visarea = m_screen->visible_area(); rectangle visarea = screen().visible_area();
// DACRATE is the quarter pixel clock and period will be for a field, not a frame // DACRATE is the quarter pixel clock and period will be for a field, not a frame
attoseconds_t period = (vi_hsync & 0xfff) * (vi_vsync & 0xfff) * HZ_TO_ATTOSECONDS(DACRATE_NTSC) / 2; attoseconds_t period = (vi_hsync & 0xfff) * (vi_vsync & 0xfff) * HZ_TO_ATTOSECONDS(DACRATE_NTSC) / 2;
@ -1026,7 +1026,7 @@ void n64_periphs::vi_recalculate_resolution()
visarea.max_x = width - 1; visarea.max_x = width - 1;
visarea.max_y = height - 1; visarea.max_y = height - 1;
m_screen->configure((vi_hsync & 0x00000fff)>>2, (vi_vsync & 0x00000fff), visarea, period); screen().configure((vi_hsync & 0x00000fff)>>2, (vi_vsync & 0x00000fff), visarea, period);
} }
READ32_MEMBER( n64_periphs::vi_reg_r ) READ32_MEMBER( n64_periphs::vi_reg_r )
@ -1051,7 +1051,7 @@ READ32_MEMBER( n64_periphs::vi_reg_r )
break; break;
case 0x10/4: // VI_CURRENT_REG case 0x10/4: // VI_CURRENT_REG
ret = (m_screen->vpos() & 0x3FE) + field; ret = (screen().vpos() & 0x3FE) + field;
break; break;
case 0x14/4: // VI_BURST_REG case 0x14/4: // VI_BURST_REG
@ -1123,7 +1123,7 @@ WRITE32_MEMBER( n64_periphs::vi_reg_w )
case 0x0c/4: // VI_INTR_REG case 0x0c/4: // VI_INTR_REG
vi_intr = data; vi_intr = data;
vi_scanline_timer->adjust(m_screen->time_until_pos(vi_intr)); vi_scanline_timer->adjust(screen().time_until_pos(vi_intr));
break; break;
case 0x10/4: // VI_CURRENT_REG case 0x10/4: // VI_CURRENT_REG

View File

@ -92,7 +92,7 @@ void nb1414m4_device::fill(uint16_t dst, uint8_t tile, uint8_t pal, uint8_t *vra
void nb1414m4_device::insert_coin_msg(uint8_t *vram) void nb1414m4_device::insert_coin_msg(uint8_t *vram)
{ {
int credit_count = (vram[0xf] & 0xff); int credit_count = (vram[0xf] & 0xff);
uint8_t fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ uint8_t fl_cond = screen().frame_number() & 0x10; /* for insert coin "flickering" */
uint16_t dst; uint16_t dst;
if(credit_count == 0) if(credit_count == 0)
@ -112,7 +112,7 @@ void nb1414m4_device::insert_coin_msg(uint8_t *vram)
void nb1414m4_device::credit_msg(uint8_t *vram) void nb1414m4_device::credit_msg(uint8_t *vram)
{ {
int credit_count = (vram[0xf] & 0xff); int credit_count = (vram[0xf] & 0xff);
uint8_t fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ uint8_t fl_cond = screen().frame_number() & 0x10; /* for insert coin "flickering" */
uint16_t dst; uint16_t dst;
dst = ((m_data[0x023]<<8)|(m_data[0x024]&0xff)) & 0x3fff; dst = ((m_data[0x023]<<8)|(m_data[0x024]&0xff)) & 0x3fff;

View File

@ -348,7 +348,7 @@ void antic_device::device_start()
m_gtia = machine().device<gtia_device>(m_gtia_tag); m_gtia = machine().device<gtia_device>(m_gtia_tag);
assert(m_gtia); assert(m_gtia);
m_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height()); m_bitmap = std::make_unique<bitmap_ind16>(screen().width(), screen().height());
m_cclk_expand = make_unique_clear<uint32_t[]>(21 * 256); m_cclk_expand = make_unique_clear<uint32_t[]>(21 * 256);
@ -385,7 +385,7 @@ void antic_device::device_start()
LOG(("atari prio_init\n")); LOG(("atari prio_init\n"));
prio_init(); prio_init();
for (int i = 0; i < m_screen->height(); i++) for (int i = 0; i < screen().height(); i++)
m_video[i] = auto_alloc_clear(machine(), <VIDEO>()); m_video[i] = auto_alloc_clear(machine(), <VIDEO>());
/* save states */ /* save states */
@ -1841,7 +1841,7 @@ void antic_device::linerefresh()
uint16_t *color_lookup = m_gtia->get_color_lookup(); uint16_t *color_lookup = m_gtia->get_color_lookup();
/* increment the scanline */ /* increment the scanline */
if( ++m_scanline == m_screen->height() ) if( ++m_scanline == screen().height() )
{ {
/* and return to the top if the frame was complete */ /* and return to the top if the frame was complete */
m_scanline = 0; m_scanline = 0;
@ -1943,7 +1943,7 @@ void antic_device::linerefresh()
#define ANTIC_TIME_FROM_CYCLES(cycles) \ #define ANTIC_TIME_FROM_CYCLES(cycles) \
(attotime)(m_screen->scan_period() * (cycles) / CYCLES_PER_LINE) (attotime)(screen().scan_period() * (cycles) / CYCLES_PER_LINE)
void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
@ -1966,7 +1966,7 @@ void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param,
int antic_device::cycle() int antic_device::cycle()
{ {
return m_screen->hpos() * CYCLES_PER_LINE / m_screen->width(); return screen().hpos() * CYCLES_PER_LINE / screen().width();
} }
TIMER_CALLBACK_MEMBER( antic_device::issue_dli ) TIMER_CALLBACK_MEMBER( antic_device::issue_dli )
@ -2217,7 +2217,7 @@ void antic_device::scanline_dma(int param)
/* produce empty scanlines until vblank start */ /* produce empty scanlines until vblank start */
m_modelines = VBL_START + 1 - m_scanline; m_modelines = VBL_START + 1 - m_scanline;
if( m_modelines < 0 ) if( m_modelines < 0 )
m_modelines = m_screen->height() - m_scanline; m_modelines = screen().height() - m_scanline;
LOG((" JVB $%04x\n", m_dpage|m_doffs)); LOG((" JVB $%04x\n", m_dpage|m_doffs));
} }
else else
@ -2370,7 +2370,7 @@ void antic_device::generic_interrupt(int button_count)
m_gtia->button_interrupt(button_count, m_djoy_b.read_safe(0)); m_gtia->button_interrupt(button_count, m_djoy_b.read_safe(0));
/* do nothing new for the rest of the frame */ /* do nothing new for the rest of the frame */
m_modelines = m_screen->height() - VBL_START; m_modelines = screen().height() - VBL_START;
m_render1 = 0; m_render1 = 0;
m_render2 = 0; m_render2 = 0;
m_render3 = 0; m_render3 = 0;

View File

@ -343,7 +343,7 @@ void atari_motion_objects_device::device_start()
// allocate a timer to periodically force update // allocate a timer to periodically force update
m_force_update_timer = timer_alloc(TID_FORCE_UPDATE); m_force_update_timer = timer_alloc(TID_FORCE_UPDATE);
m_force_update_timer->adjust(m_screen->time_until_pos(0)); m_force_update_timer->adjust(screen().time_until_pos(0));
// register for save states // register for save states
save_item(NAME(m_bank)); save_item(NAME(m_bank));
@ -378,11 +378,11 @@ void atari_motion_objects_device::device_timer(emu_timer &timer, device_timer_id
{ {
case TID_FORCE_UPDATE: case TID_FORCE_UPDATE:
if (param > 0) if (param > 0)
m_screen->update_partial(param - 1); screen().update_partial(param - 1);
param += 64; param += 64;
if (param >= m_screen->visible_area().max_y) if (param >= screen().visible_area().max_y)
param = 0; param = 0;
timer.adjust(m_screen->time_until_pos(param), param); timer.adjust(screen().time_until_pos(param), param);
break; break;
} }
} }

View File

@ -102,8 +102,8 @@ WRITE8_MEMBER(atari_rle_objects_device::control_write)
return; return;
// force a partial update first // force a partial update first
int scanline = m_screen->vpos(); int scanline = screen().vpos();
m_screen->update_partial(scanline); screen().update_partial(scanline);
// if the erase flag was set, erase the front map // if the erase flag was set, erase the front map
if ((oldbits & ATARIRLE_CONTROL_ERASE) != 0) if ((oldbits & ATARIRLE_CONTROL_ERASE) != 0)
@ -197,7 +197,7 @@ void atari_rle_objects_device::device_start()
m_ram.set(*share, 2); m_ram.set(*share, 2);
// register a VBLANK callback // register a VBLANK callback
m_screen->register_vblank_callback(vblank_state_delegate(&atari_rle_objects_device::vblank_callback, this)); screen().register_vblank_callback(vblank_state_delegate(&atari_rle_objects_device::vblank_callback, this));
// build and allocate the generic tables // build and allocate the generic tables
build_rle_tables(); build_rle_tables();
@ -223,7 +223,7 @@ void atari_rle_objects_device::device_start()
m_objectcount = count_objects(); m_objectcount = count_objects();
// set up a cliprect // set up a cliprect
m_cliprect = m_screen->visible_area(); m_cliprect = screen().visible_area();
if (m_rightclip != 0) if (m_rightclip != 0)
{ {
m_cliprect.min_x = m_leftclip; m_cliprect.min_x = m_leftclip;
@ -247,16 +247,16 @@ void atari_rle_objects_device::device_start()
prescan_rle(objnum); prescan_rle(objnum);
// register the bitmaps with the target screen // register the bitmaps with the target screen
m_screen->register_screen_bitmap(m_vram[0][0]); screen().register_screen_bitmap(m_vram[0][0]);
m_screen->register_screen_bitmap(m_vram[0][1]); screen().register_screen_bitmap(m_vram[0][1]);
m_vram[0][0].fill(0); m_vram[0][0].fill(0);
m_vram[0][1].fill(0); m_vram[0][1].fill(0);
// allocate alternate bitmaps if needed // allocate alternate bitmaps if needed
if (m_vrammask.mask() != 0) if (m_vrammask.mask() != 0)
{ {
m_screen->register_screen_bitmap(m_vram[1][0]); screen().register_screen_bitmap(m_vram[1][0]);
m_screen->register_screen_bitmap(m_vram[1][1]); screen().register_screen_bitmap(m_vram[1][1]);
m_vram[1][0].fill(0); m_vram[1][0].fill(0);
m_vram[1][1].fill(0); m_vram[1][1].fill(0);
} }
@ -548,7 +548,7 @@ void atari_rle_objects_device::draw_rle(bitmap_ind16 &bitmap, const rectangle &c
if (hflip) if (hflip)
scaled_xoffs = ((xscale * info.width) >> 12) - scaled_xoffs; scaled_xoffs = ((xscale * info.width) >> 12) - scaled_xoffs;
//if (clip.min_y == m_screen->visible_area().min_y) //if (clip.min_y == screen().visible_area().min_y)
//logerror(" Sprite: c=%04X l=%04X h=%d X=%4d (o=%4d w=%3d) Y=%4d (o=%4d h=%d) s=%04X\n", //logerror(" Sprite: c=%04X l=%04X h=%d X=%4d (o=%4d w=%3d) Y=%4d (o=%4d h=%d) s=%04X\n",
// code, color, hflip, // code, color, hflip,
// x, -scaled_xoffs, (xscale * info.width) >> 12, // x, -scaled_xoffs, (xscale * info.width) >> 12,
@ -980,7 +980,7 @@ void atari_rle_objects_device::hilite_object(bitmap_ind16 &bitmap, int hilite)
int ey = sy + scaled_height - 1; int ey = sy + scaled_height - 1;
// left edge clip // left edge clip
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
if (sx < visarea.min_x) if (sx < visarea.min_x)
sx = visarea.min_x; sx = visarea.min_x;
if (sx > visarea.max_x) if (sx > visarea.max_x)

View File

@ -140,7 +140,7 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli
{ {
{ {
int draw = 0; int draw = 0;
if (!flash || (m_screen->frame_number() & 1)) if (!flash || (screen().frame_number() & 1))
{ {
if (m_priority_type == 0) // most cases if (m_priority_type == 0) // most cases
{ {

View File

@ -627,7 +627,7 @@ READ16_MEMBER( deco16ic_device::pf2_data_r )
WRITE16_MEMBER( deco16ic_device::pf_control_w ) WRITE16_MEMBER( deco16ic_device::pf_control_w )
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
COMBINE_DATA(&m_pf12_control[offset]); COMBINE_DATA(&m_pf12_control[offset]);
} }

View File

@ -191,7 +191,7 @@ void decospr_device::device_reset()
void decospr_device::alloc_sprite_bitmap() void decospr_device::alloc_sprite_bitmap()
{ {
m_screen->register_screen_bitmap(m_sprite_bitmap); screen().register_screen_bitmap(m_sprite_bitmap);
} }
template<class _BitmapClass> template<class _BitmapClass>
@ -248,7 +248,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
w = y & 0x0800; w = y & 0x0800;
if (!(flash && (m_screen->frame_number() & 1))) if (!(flash && (screen().frame_number() & 1)))
{ {
x = spriteram[offs + 2]; x = spriteram[offs + 2];
@ -363,7 +363,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
colour, colour,
fx,fy, fx,fy,
x,ypos, x,ypos,
m_screen->priority(),pri,m_transpen); screen().priority(),pri,m_transpen);
else else
m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect, m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect,
sprite - multi * inc, sprite - multi * inc,
@ -382,7 +382,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
colour, colour,
fx,fy, fx,fy,
!flipscreen ? x-16 : x+16,ypos, !flipscreen ? x-16 : x+16,ypos,
m_screen->priority(),pri,m_transpen); screen().priority(),pri,m_transpen);
else else
m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect, m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect,
(sprite - multi * inc)-mult2, (sprite - multi * inc)-mult2,
@ -432,7 +432,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
x = spriteram[offs+1]; x = spriteram[offs+1];
if (!((y&0x2000) && (m_screen->frame_number() & 1))) if (!((y&0x2000) && (screen().frame_number() & 1)))
{ {
if (!m_sprite_bitmap.valid()) if (!m_sprite_bitmap.valid())
colour = (spriteram[offs+2] >>0) & 0x1f; colour = (spriteram[offs+2] >>0) & 0x1f;
@ -487,7 +487,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
colour, colour,
fx,fy, fx,fy,
x + mult * (w-xx),ypos, x + mult * (w-xx),ypos,
m_screen->priority(),pri,m_transpen); screen().priority(),pri,m_transpen);
} }
ypos -= 512; // wrap-around y ypos -= 512; // wrap-around y
@ -499,7 +499,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
colour, colour,
fx,fy, fx,fy,
x + mult * (w-xx),ypos, x + mult * (w-xx),ypos,
m_screen->priority(),pri,m_transpen); screen().priority(),pri,m_transpen);
} }
} }

View File

@ -79,22 +79,21 @@ void fuukivid_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,
{ {
// as we're likely framebuffered (sprites are delayed by 2-3 frames, at least on FG3, and doing rasters on sprites causes glitches) we // as we're likely framebuffered (sprites are delayed by 2-3 frames, at least on FG3, and doing rasters on sprites causes glitches) we
// only draw the sprites when MAME wants to draw the final screen line. Ideally we should framebuffer them instead. // only draw the sprites when MAME wants to draw the final screen line. Ideally we should framebuffer them instead.
if (cliprect.max_y != m_screen->visible_area().max_y) if (cliprect.max_y != screen.visible_area().max_y)
return; return;
rectangle spriteclip = m_screen->visible_area(); rectangle spriteclip = screen.visible_area();
int offs; int offs;
gfx_element *gfx = m_gfxdecode->gfx(0); gfx_element *gfx = m_gfxdecode->gfx(0);
bitmap_ind8 &priority_bitmap = screen.priority(); bitmap_ind8 &priority_bitmap = screen.priority();
const rectangle &visarea = screen.visible_area();
uint16_t *spriteram16 = m_sprram.get(); uint16_t *spriteram16 = m_sprram.get();
if (tilebank) spriteram16 = m_sprram_old2.get(); // so that FG3 uses the buffered RAM if (tilebank) spriteram16 = m_sprram_old2.get(); // so that FG3 uses the buffered RAM
int max_x = visarea.max_x + 1; int max_x = spriteclip.max_x + 1;
int max_y = visarea.max_y + 1; int max_y = spriteclip.max_y + 1;
/* Draw them backwards, for pdrawgfx */ /* Draw them backwards, for pdrawgfx */
for ( offs = (0x2000 - 8) / 2; offs >=0; offs -= 8 / 2 ) for ( offs = (0x2000 - 8) / 2; offs >=0; offs -= 8 / 2 )

View File

@ -112,10 +112,10 @@ const tiny_rom_entry *gic_device::device_rom_region() const
void gic_device::device_start() void gic_device::device_start()
{ {
// Let the screen create our temporary bitmap with the screen's dimensions // Let the screen create our temporary bitmap with the screen's dimensions
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
m_vblank_timer = timer_alloc(TIMER_VBLANK); m_vblank_timer = timer_alloc(TIMER_VBLANK);
m_vblank_timer->adjust( m_screen->time_until_pos(1, END_ACTIVE_SCAN + 18 ), 0, m_screen->scan_period() ); m_vblank_timer->adjust( screen().time_until_pos(1, END_ACTIVE_SCAN + 18 ), 0, screen().scan_period() );
// allocate the audio stream // allocate the audio stream
m_stream = stream_alloc( 0, 1, clock()/(2*228) ); m_stream = stream_alloc( 0, 1, clock()/(2*228) );

View File

@ -57,7 +57,6 @@ public:
gic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); gic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers // static configuration helpers
static void set_screen_tag(device_t &device, const char *screen_tag) { downcast<gic_device &>(device).m_screen_tag = screen_tag; }
template <typename Obj> static void set_ram(device_t &device, Obj &&cb) { downcast<gic_device &>(device).m_ram.set_callback(std::forward<Obj>(cb)); } template <typename Obj> static void set_ram(device_t &device, Obj &&cb) { downcast<gic_device &>(device).m_ram.set_callback(std::forward<Obj>(cb)); }
DECLARE_PALETTE_INIT(gic); DECLARE_PALETTE_INIT(gic);

View File

@ -1213,7 +1213,7 @@ void k001005_device::device_start()
m_fifo = std::make_unique<uint32_t[]>(0x800); m_fifo = std::make_unique<uint32_t[]>(0x800);
m_renderer = auto_alloc(machine(), k001005_renderer(*this, *m_screen, m_k001006)); m_renderer = auto_alloc(machine(), k001005_renderer(*this, screen(), m_k001006));
save_pointer(NAME(m_ram[0].get()), 0x140000); save_pointer(NAME(m_ram[0].get()), 0x140000);
save_pointer(NAME(m_ram[1].get()), 0x140000); save_pointer(NAME(m_ram[1].get()), 0x140000);

View File

@ -113,7 +113,7 @@ TILE_GET_INFO_MEMBER(k037122_device::tile_info_layer1)
void k037122_device::tile_draw( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) void k037122_device::tile_draw( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{ {
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen.visible_area();
if (m_reg[0xc] & 0x10000) if (m_reg[0xc] & 0x10000)
{ {

View File

@ -1118,7 +1118,7 @@ void k053247_device::device_start()
if (VERBOSE) if (VERBOSE)
{ {
if (m_screen->format() == BITMAP_FORMAT_RGB32) if (screen().format() == BITMAP_FORMAT_RGB32)
{ {
if (!palette().shadows_enabled() || !palette().hilights_enabled()) if (!palette().shadows_enabled() || !palette().hilights_enabled())
popmessage("driver missing SHADOWS or HIGHLIGHTS flag"); popmessage("driver missing SHADOWS or HIGHLIGHTS flag");

View File

@ -186,7 +186,7 @@ public:
// for Escape Kids (GX975) // for Escape Kids (GX975)
if ( objset1 & 8 ) // Check only "Bit #3 is '1'?" if ( objset1 & 8 ) // Check only "Bit #3 is '1'?"
{ {
int screenwidth = m_screen->width(); int screenwidth = screen().width();
zoomx = zoomx>>1; // Fix sprite width to HALF size zoomx = zoomx>>1; // Fix sprite width to HALF size
ox = (ox>>1) + 1; // Fix sprite draw position ox = (ox>>1) + 1; // Fix sprite draw position
@ -415,7 +415,7 @@ public:
color, color,
fx,fy, fx,fy,
sx,sy, sx,sy,
m_screen->priority(),primask, screen().priority(),primask,
whichtable); whichtable);
} }
else else
@ -426,7 +426,7 @@ public:
fx,fy, fx,fy,
sx,sy, sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4, (zw << 16) >> 4,(zh << 16) >> 4,
m_screen->priority(),primask, screen().priority(),primask,
whichtable); whichtable);
} }
@ -439,7 +439,7 @@ public:
color, color,
fx,!fy, fx,!fy,
sx,sy, sx,sy,
m_screen->priority(),primask, screen().priority(),primask,
whichtable); whichtable);
} }
else else
@ -450,7 +450,7 @@ public:
fx,!fy, fx,!fy,
sx,sy, sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4, (zw << 16) >> 4,(zh << 16) >> 4,
m_screen->priority(),primask, screen().priority(),primask,
whichtable); whichtable);
} }
} }

View File

@ -420,7 +420,7 @@ void k053250_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int
void k053250_device::dma(int limiter) void k053250_device::dma(int limiter)
{ {
int current_frame = m_screen->frame_number(); int current_frame = screen().frame_number();
if (limiter && current_frame == m_frame) if (limiter && current_frame == m_frame)
return; // make sure we only do DMA transfer once per frame return; // make sure we only do DMA transfer once per frame

View File

@ -53,10 +53,10 @@ READ8_MEMBER( k1ge_device::read )
switch( offset ) switch( offset )
{ {
case 0x008: /* RAS.H */ case 0x008: /* RAS.H */
data = m_screen->hpos() >> 2; data = screen().hpos() >> 2;
break; break;
case 0x009: /* RAS.V */ case 0x009: /* RAS.V */
data = m_screen->vpos(); data = screen().vpos();
break; break;
} }
return data; return data;
@ -737,7 +737,7 @@ TIMER_CALLBACK_MEMBER( k1ge_device::hblank_on_timer_callback )
TIMER_CALLBACK_MEMBER( k1ge_device::timer_callback ) TIMER_CALLBACK_MEMBER( k1ge_device::timer_callback )
{ {
int y = m_screen->vpos(); int y = screen().vpos();
/* Check for start of VBlank */ /* Check for start of VBlank */
if ( y >= 152 ) if ( y >= 152 )
@ -772,7 +772,7 @@ TIMER_CALLBACK_MEMBER( k1ge_device::timer_callback )
{ {
m_hblank_pin_w(1); m_hblank_pin_w(1);
} }
m_hblank_on_timer->adjust( m_screen->time_until_pos(y, 480 ) ); m_hblank_on_timer->adjust( screen().time_until_pos(y, 480 ) );
} }
} }
@ -782,7 +782,7 @@ TIMER_CALLBACK_MEMBER( k1ge_device::timer_callback )
draw( y - 1 ); draw( y - 1 );
} }
m_timer->adjust( m_screen->time_until_pos(( y + 1 ) % K1GE_SCREEN_HEIGHT, 0 ) ); m_timer->adjust( screen().time_until_pos(( y + 1 ) % K1GE_SCREEN_HEIGHT, 0 ) );
} }
@ -804,7 +804,7 @@ void k1ge_device::device_start()
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::timer_callback), this)); m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::timer_callback), this));
m_hblank_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::hblank_on_timer_callback), this)); m_hblank_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::hblank_on_timer_callback), this));
m_vram = make_unique_clear<uint8_t[]>(0x4000); m_vram = make_unique_clear<uint8_t[]>(0x4000);
m_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height() ); m_bitmap = std::make_unique<bitmap_ind16>(screen().width(), screen().height() );
save_pointer(NAME(m_vram.get()), 0x4000); save_pointer(NAME(m_vram.get()), 0x4000);
save_item(NAME(m_wba_h)); save_item(NAME(m_wba_h));
@ -858,7 +858,7 @@ void k1ge_device::device_reset()
m_vram[0x7e0] = 0x52; /* RESET */ m_vram[0x7e0] = 0x52; /* RESET */
m_vram[0x7e2] = 0x00; /* MODE */ m_vram[0x7e2] = 0x00; /* MODE */
m_timer->adjust( m_screen->time_until_pos(( m_screen->vpos() + 1 ) % K1GE_SCREEN_HEIGHT, 0 ) ); m_timer->adjust( screen().time_until_pos(( screen().vpos() + 1 ) % K1GE_SCREEN_HEIGHT, 0 ) );
} }

View File

@ -86,7 +86,7 @@ void kaneko_pandora_device::device_start()
m_spriteram = std::make_unique<uint8_t[]>(0x1000); m_spriteram = std::make_unique<uint8_t[]>(0x1000);
m_sprites_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height()); m_sprites_bitmap = std::make_unique<bitmap_ind16>(screen().width(), screen().height());
save_item(NAME(m_clear_bitmap)); save_item(NAME(m_clear_bitmap));
save_item(NAME(m_bg_pen)); save_item(NAME(m_bg_pen));
@ -222,9 +222,9 @@ void kaneko_pandora_device::eof( )
// the games can disable the clearing of the sprite bitmap, to leave sprite trails // the games can disable the clearing of the sprite bitmap, to leave sprite trails
if (m_clear_bitmap) if (m_clear_bitmap)
m_sprites_bitmap->fill(m_bg_pen, m_screen->visible_area()); m_sprites_bitmap->fill(m_bg_pen, screen().visible_area());
kaneko_pandora_device::draw(*m_sprites_bitmap, m_screen->visible_area()); kaneko_pandora_device::draw(*m_sprites_bitmap, screen().visible_area());
} }
/***************************************************************************** /*****************************************************************************

View File

@ -77,7 +77,7 @@ void kaneko16_sprite_device::device_start()
{ {
m_first_sprite = std::make_unique<struct kan_tempsprite[]>(0x400); m_first_sprite = std::make_unique<struct kan_tempsprite[]>(0x400);
m_sprites_regs = make_unique_clear<uint16_t[]>(0x20/2); m_sprites_regs = make_unique_clear<uint16_t[]>(0x20/2);
m_screen->register_screen_bitmap(m_sprites_bitmap); screen().register_screen_bitmap(m_sprites_bitmap);
save_item(NAME(m_sprite_flipx)); save_item(NAME(m_sprite_flipx));
save_item(NAME(m_sprite_flipy)); save_item(NAME(m_sprite_flipy));
@ -215,12 +215,12 @@ int kaneko16_sprite_device::kaneko16_parse_sprite_type012(int i, struct kan_temp
if (m_sprite_flipy) if (m_sprite_flipy)
{ {
s->yoffs -= m_sprites_regs[0x2/2]; s->yoffs -= m_sprites_regs[0x2/2];
s->yoffs -= m_screen->visible_area().min_y<<6; s->yoffs -= screen().visible_area().min_y<<6;
} }
else else
{ {
s->yoffs -= m_sprites_regs[0x2/2]; s->yoffs -= m_sprites_regs[0x2/2];
s->yoffs += m_screen->visible_area().min_y<<6; s->yoffs += screen().visible_area().min_y<<6;
} }
return ( (attr & 0x2000) ? USE_LATCHED_XY : 0 ) | return ( (attr & 0x2000) ? USE_LATCHED_XY : 0 ) |
@ -353,7 +353,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const r
in a temp buffer, then draw the buffer's contents from last in a temp buffer, then draw the buffer's contents from last
to first. */ to first. */
int max = (m_screen->width() > 0x100) ? (0x200<<6) : (0x100<<6); int max = (screen().width() > 0x100) ? (0x200<<6) : (0x100<<6);
int i = 0; int i = 0;
struct kan_tempsprite *s = m_first_sprite.get(); struct kan_tempsprite *s = m_first_sprite.get();

View File

@ -523,9 +523,9 @@ void mcd212_device::set_display_parameters(int channel, uint8_t value)
void mcd212_device::update_visible_area() void mcd212_device::update_visible_area()
{ {
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = screen().visible_area();
rectangle visarea1; rectangle visarea1;
attoseconds_t period = m_screen->frame_period().attoseconds(); attoseconds_t period = screen().frame_period().attoseconds();
int width = 0; int width = 0;
if((m_channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (m_channel[0].csrw & MCD212_CSR1W_ST)) if((m_channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (m_channel[0].csrw & MCD212_CSR1W_ST))
@ -542,7 +542,7 @@ void mcd212_device::update_visible_area()
visarea1.min_y = visarea.min_y; visarea1.min_y = visarea.min_y;
visarea1.max_y = visarea.max_y; visarea1.max_y = visarea.max_y;
m_screen->configure(width, 302, visarea1, period); screen().configure(width, 302, visarea1, period);
} }
uint32_t mcd212_device::get_screen_width() uint32_t mcd212_device::get_screen_width()
@ -1427,7 +1427,7 @@ WRITE16_MEMBER( mcd212_device::regs_w )
TIMER_CALLBACK_MEMBER( mcd212_device::perform_scan ) TIMER_CALLBACK_MEMBER( mcd212_device::perform_scan )
{ {
int scanline = m_screen->vpos(); int scanline = screen().vpos();
if(1) if(1)
{ {
@ -1472,7 +1472,7 @@ TIMER_CALLBACK_MEMBER( mcd212_device::perform_scan )
} }
} }
} }
m_scan_timer->adjust(m_screen->time_until_pos(( scanline + 1 ) % 302, 0)); m_scan_timer->adjust(screen().time_until_pos(( scanline + 1 ) % 302, 0));
} }
void mcd212_device::device_reset() void mcd212_device::device_reset()
@ -1529,10 +1529,10 @@ mcd212_device::mcd212_device(const machine_config &mconfig, const char *tag, dev
void mcd212_device::device_start() void mcd212_device::device_start()
{ {
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcd212_device::perform_scan), this)); m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcd212_device::perform_scan), this));
m_scan_timer->adjust(m_screen->time_until_pos(0, 0)); m_scan_timer->adjust(screen().time_until_pos(0, 0));
save_item(NAME(m_region_flag_0)); save_item(NAME(m_region_flag_0));
save_item(NAME(m_region_flag_1)); save_item(NAME(m_region_flag_1));

View File

@ -127,7 +127,7 @@ nick_device::nick_device(const machine_config &mconfig, const char *tag, device_
void nick_device::device_start() void nick_device::device_start()
{ {
m_screen->register_screen_bitmap(m_bitmap); screen().register_screen_bitmap(m_bitmap);
calc_visible_clocks(ENTERPRISE_SCREEN_WIDTH); calc_visible_clocks(ENTERPRISE_SCREEN_WIDTH);
// initialize palette // initialize palette
@ -138,7 +138,7 @@ void nick_device::device_start()
// allocate timers // allocate timers
m_timer_scanline = timer_alloc(); m_timer_scanline = timer_alloc();
m_timer_scanline->adjust(m_screen->time_until_pos(0, 0), 0, m_screen->scan_period()); m_timer_scanline->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period());
// state saving // state saving
save_item(NAME(m_scanline_count)); save_item(NAME(m_scanline_count));
@ -184,7 +184,7 @@ void nick_device::device_reset()
void nick_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void nick_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
int scanline = m_screen->vpos(); int scanline = screen().vpos();
if (scanline < ENTERPRISE_SCREEN_HEIGHT) if (scanline < ENTERPRISE_SCREEN_HEIGHT)
{ {
@ -1012,7 +1012,7 @@ void nick_device::do_line()
if (m_virq && !(m_LPT.MB & NICK_MB_VIRQ)) if (m_virq && !(m_LPT.MB & NICK_MB_VIRQ))
{ {
m_timer_scanline->adjust(m_screen->time_until_pos(0, 0), 0, m_screen->scan_period()); m_timer_scanline->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period());
} }
m_virq = (m_LPT.MB & NICK_MB_VIRQ) ? 1 : 0; m_virq = (m_LPT.MB & NICK_MB_VIRQ) ? 1 : 0;

View File

@ -1025,7 +1025,7 @@ WRITE32_MEMBER( powervr2_device::startrender_w )
//if(sanitycount>2000) //if(sanitycount>2000)
// break; // break;
} }
// printf("ISP START %d %d\n",sanitycount,m_screen->vpos()); // printf("ISP START %d %d\n",sanitycount,screen().vpos());
/* Fire ISP irq after a set amount of time TODO: timing of this */ /* Fire ISP irq after a set amount of time TODO: timing of this */
endofrender_timer_isp->adjust(state->m_maincpu->cycles_to_attotime(sanitycount*25 + 500000)); // hacky end of render delay for Capcom games, otherwise they works at ~1/10 speed endofrender_timer_isp->adjust(state->m_maincpu->cycles_to_attotime(sanitycount*25 + 500000)); // hacky end of render delay for Capcom games, otherwise they works at ~1/10 speed
break; break;
@ -1208,8 +1208,8 @@ WRITE32_MEMBER( powervr2_device::spg_vblank_int_w )
// vbin_timer->adjust(attotime::never); // vbin_timer->adjust(attotime::never);
// vbout_timer->adjust(attotime::never); // vbout_timer->adjust(attotime::never);
// vbin_timer->adjust(m_screen->time_until_pos(spg_vblank_int & 0x3ff)); // vbin_timer->adjust(screen().time_until_pos(spg_vblank_int & 0x3ff));
// vbout_timer->adjust(m_screen->time_until_pos((spg_vblank_int >> 16) & 0x3ff)); // vbout_timer->adjust(screen().time_until_pos((spg_vblank_int >> 16) & 0x3ff));
} }
READ32_MEMBER( powervr2_device::spg_control_r ) READ32_MEMBER( powervr2_device::spg_control_r )
@ -1327,22 +1327,22 @@ WRITE32_MEMBER( powervr2_device::pal_ram_ctrl_w )
READ32_MEMBER( powervr2_device::spg_status_r ) READ32_MEMBER( powervr2_device::spg_status_r )
{ {
uint32_t fieldnum = (m_screen->frame_number() & 1) ? 1 : 0; uint32_t fieldnum = (screen().frame_number() & 1) ? 1 : 0;
int32_t spg_hbstart = spg_hblank & 0x3ff; int32_t spg_hbstart = spg_hblank & 0x3ff;
int32_t spg_hbend = (spg_hblank >> 16) & 0x3ff; int32_t spg_hbend = (spg_hblank >> 16) & 0x3ff;
int32_t spg_vbstart = spg_vblank & 0x3ff; int32_t spg_vbstart = spg_vblank & 0x3ff;
int32_t spg_vbend = (spg_vblank >> 16) & 0x3ff; int32_t spg_vbend = (spg_vblank >> 16) & 0x3ff;
uint32_t vsync = ((m_screen->vpos() >= spg_vbstart) || (m_screen->vpos() < spg_vbend)) ? 0 : 1; uint32_t vsync = ((screen().vpos() >= spg_vbstart) || (screen().vpos() < spg_vbend)) ? 0 : 1;
uint32_t hsync = ((m_screen->hpos() >= spg_hbstart) || (m_screen->hpos() < spg_hbend)) ? 0 : 1; uint32_t hsync = ((screen().hpos() >= spg_hbstart) || (screen().hpos() < spg_hbend)) ? 0 : 1;
/* FIXME: following is just a wild guess */ /* FIXME: following is just a wild guess */
uint32_t blank = ((m_screen->vpos() >= spg_vbstart) || (m_screen->vpos() < spg_vbend) | uint32_t blank = ((screen().vpos() >= spg_vbstart) || (screen().vpos() < spg_vbend) |
(m_screen->hpos() >= spg_hbstart) || (m_screen->hpos() < spg_hbend)) ? 0 : 1; (screen().hpos() >= spg_hbstart) || (screen().hpos() < spg_hbend)) ? 0 : 1;
if(vo_control & 4) { blank^=1; } if(vo_control & 4) { blank^=1; }
if(vo_control & 2) { vsync^=1; } if(vo_control & 2) { vsync^=1; }
if(vo_control & 1) { hsync^=1; } if(vo_control & 1) { hsync^=1; }
return (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (m_screen->vpos() & 0x3ff); return (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (screen().vpos() & 0x3ff);
} }
@ -1570,7 +1570,7 @@ void powervr2_device::update_screen_format()
attoseconds_t refresh = HZ_TO_ATTOSECONDS(pclk) * spg_hsize * spg_vsize; attoseconds_t refresh = HZ_TO_ATTOSECONDS(pclk) * spg_hsize * spg_vsize;
rectangle visarea = m_screen->visible_area(); rectangle visarea = screen().visible_area();
visarea.min_x = spg_hbend; visarea.min_x = spg_hbend;
visarea.max_x = spg_hbstart - 1; visarea.max_x = spg_hbstart - 1;
@ -1587,7 +1587,7 @@ void powervr2_device::update_screen_format()
if(visarea.min_y > visarea.max_y) if(visarea.min_y > visarea.max_y)
visarea.min_y = visarea.max_y; visarea.min_y = visarea.max_y;
m_screen->configure(spg_hsize, spg_vsize, visarea, refresh ); screen().configure(spg_hsize, spg_vsize, visarea, refresh );
} }
@ -1686,35 +1686,35 @@ WRITE32_MEMBER( powervr2_device::sb_pdapro_w )
TIMER_CALLBACK_MEMBER(powervr2_device::transfer_opaque_list_irq) TIMER_CALLBACK_MEMBER(powervr2_device::transfer_opaque_list_irq)
{ {
// printf("OPLST %d\n",m_screen->vpos()); // printf("OPLST %d\n",screen().vpos());
irq_cb(EOXFER_OPLST_IRQ); irq_cb(EOXFER_OPLST_IRQ);
} }
TIMER_CALLBACK_MEMBER(powervr2_device::transfer_opaque_modifier_volume_list_irq) TIMER_CALLBACK_MEMBER(powervr2_device::transfer_opaque_modifier_volume_list_irq)
{ {
// printf("OPMV %d\n",m_screen->vpos()); // printf("OPMV %d\n",screen().vpos());
irq_cb(EOXFER_OPMV_IRQ); irq_cb(EOXFER_OPMV_IRQ);
} }
TIMER_CALLBACK_MEMBER(powervr2_device::transfer_translucent_list_irq) TIMER_CALLBACK_MEMBER(powervr2_device::transfer_translucent_list_irq)
{ {
// printf("TRLST %d\n",m_screen->vpos()); // printf("TRLST %d\n",screen().vpos());
irq_cb(EOXFER_TRLST_IRQ); irq_cb(EOXFER_TRLST_IRQ);
} }
TIMER_CALLBACK_MEMBER(powervr2_device::transfer_translucent_modifier_volume_list_irq) TIMER_CALLBACK_MEMBER(powervr2_device::transfer_translucent_modifier_volume_list_irq)
{ {
// printf("TRMV %d\n",m_screen->vpos()); // printf("TRMV %d\n",screen().vpos());
irq_cb(EOXFER_TRMV_IRQ); irq_cb(EOXFER_TRMV_IRQ);
} }
TIMER_CALLBACK_MEMBER(powervr2_device::transfer_punch_through_list_irq) TIMER_CALLBACK_MEMBER(powervr2_device::transfer_punch_through_list_irq)
{ {
// printf("PTLST %d\n",m_screen->vpos()); // printf("PTLST %d\n",screen().vpos());
irq_cb(EOXFER_PTLST_IRQ); irq_cb(EOXFER_PTLST_IRQ);
} }
@ -1803,7 +1803,7 @@ void powervr2_device::process_ta_fifo()
#endif #endif
/* Process transfer FIFO done irqs here */ /* Process transfer FIFO done irqs here */
/* FIXME: timing of these */ /* FIXME: timing of these */
//printf("%d %d\n",tafifo_listtype,m_screen->vpos()); //printf("%d %d\n",tafifo_listtype,screen().vpos());
switch (tafifo_listtype) switch (tafifo_listtype)
{ {
case 0: machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(powervr2_device::transfer_opaque_list_irq), this)); break; case 0: machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(powervr2_device::transfer_opaque_list_irq), this)); break;
@ -3364,14 +3364,14 @@ TIMER_CALLBACK_MEMBER(powervr2_device::vbin)
irq_cb(VBL_IN_IRQ); irq_cb(VBL_IN_IRQ);
//popmessage("VII %d VOI %d VI %d VO %d VS %d",spg_vblank_int & 0x3ff,(spg_vblank_int >> 16) & 0x3ff,spg_vblank & 0x3ff,(spg_vblank >> 16) & 0x3ff,(spg_load >> 16) & 0x3ff); //popmessage("VII %d VOI %d VI %d VO %d VS %d",spg_vblank_int & 0x3ff,(spg_vblank_int >> 16) & 0x3ff,spg_vblank & 0x3ff,(spg_vblank >> 16) & 0x3ff,(spg_load >> 16) & 0x3ff);
// vbin_timer->adjust(m_screen->time_until_pos(spg_vblank_int & 0x3ff)); // vbin_timer->adjust(screen().time_until_pos(spg_vblank_int & 0x3ff));
} }
TIMER_CALLBACK_MEMBER(powervr2_device::vbout) TIMER_CALLBACK_MEMBER(powervr2_device::vbout)
{ {
irq_cb(VBL_OUT_IRQ); irq_cb(VBL_OUT_IRQ);
// vbout_timer->adjust(m_screen->time_until_pos((spg_vblank_int >> 16) & 0x3ff)); // vbout_timer->adjust(screen().time_until_pos((spg_vblank_int >> 16) & 0x3ff));
} }
TIMER_CALLBACK_MEMBER(powervr2_device::hbin) TIMER_CALLBACK_MEMBER(powervr2_device::hbin)
@ -3399,20 +3399,20 @@ TIMER_CALLBACK_MEMBER(powervr2_device::hbin)
next_y = spg_hblank_int & 0x3ff; next_y = spg_hblank_int & 0x3ff;
} }
hbin_timer->adjust(m_screen->time_until_pos(scanline, ((spg_hblank_int >> 16) & 0x3ff)-1)); hbin_timer->adjust(screen().time_until_pos(scanline, ((spg_hblank_int >> 16) & 0x3ff)-1));
} }
TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_video) TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_video)
{ {
printf("VIDEO END %d\n",m_screen->vpos()); printf("VIDEO END %d\n",screen().vpos());
// endofrender_timer_video->adjust(attotime::never); // endofrender_timer_video->adjust(attotime::never);
} }
TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_tsp) TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_tsp)
{ {
printf("TSP END %d\n",m_screen->vpos()); printf("TSP END %d\n",screen().vpos());
// endofrender_timer_tsp->adjust(attotime::never); // endofrender_timer_tsp->adjust(attotime::never);
// endofrender_timer_video->adjust(attotime::from_usec(500) ); // endofrender_timer_video->adjust(attotime::from_usec(500) );
@ -3424,7 +3424,7 @@ TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_isp)
irq_cb(EOR_TSP_IRQ); // TSP end of render irq_cb(EOR_TSP_IRQ); // TSP end of render
irq_cb(EOR_VIDEO_IRQ); // VIDEO end of render irq_cb(EOR_VIDEO_IRQ); // VIDEO end of render
// printf("ISP END %d\n",m_screen->vpos()); // printf("ISP END %d\n",screen().vpos());
endofrender_timer_isp->adjust(attotime::never); endofrender_timer_isp->adjust(attotime::never);
// endofrender_timer_tsp->adjust(attotime::from_usec(500) ); // endofrender_timer_tsp->adjust(attotime::from_usec(500) );
@ -3773,9 +3773,9 @@ void powervr2_device::device_reset()
renderselect= -1; renderselect= -1;
grabsel=0; grabsel=0;
// vbout_timer->adjust(m_screen->time_until_pos((spg_vblank_int >> 16) & 0x3ff)); // vbout_timer->adjust(screen().time_until_pos((spg_vblank_int >> 16) & 0x3ff));
// vbin_timer->adjust(m_screen->time_until_pos(spg_vblank_int & 0x3ff)); // vbin_timer->adjust(screen().time_until_pos(spg_vblank_int & 0x3ff));
hbin_timer->adjust(m_screen->time_until_pos(0, ((spg_hblank_int >> 16) & 0x3ff)-1)); hbin_timer->adjust(screen().time_until_pos(0, ((spg_hblank_int >> 16) & 0x3ff)-1));
scanline = 0; scanline = 0;
next_y = 0; next_y = 0;

View File

@ -433,7 +433,7 @@ void segaic16_video_device::set_display_enable(int enable)
enable = (enable != 0); enable = (enable != 0);
if (m_display_enable != enable) if (m_display_enable != enable)
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
m_display_enable = enable; m_display_enable = enable;
} }
} }
@ -1047,7 +1047,7 @@ TIMER_CALLBACK_MEMBER( segaic16_video_device::tilemap_16b_latch_values )
} }
/* set a timer to do this again next frame */ /* set a timer to do this again next frame */
info->latch_timer->adjust(m_screen->time_until_pos(261), param); info->latch_timer->adjust(screen().time_until_pos(261), param);
} }
@ -1227,7 +1227,7 @@ void segaic16_video_device::tilemap_set_bank(int which, int banknum, int offset)
if (info->bank[banknum] != offset) if (info->bank[banknum] != offset)
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
info->bank[banknum] = offset; info->bank[banknum] = offset;
machine().tilemap().mark_all_dirty(); machine().tilemap().mark_all_dirty();
} }
@ -1249,7 +1249,7 @@ void segaic16_video_device::tilemap_set_flip(int which, int flip)
flip = (flip != 0); flip = (flip != 0);
if (info->flip != flip) if (info->flip != flip)
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
info->flip = flip; info->flip = flip;
info->textmap->set_flip(flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); info->textmap->set_flip(flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
for (pagenum = 0; pagenum < info->numpages; pagenum++) for (pagenum = 0; pagenum < info->numpages; pagenum++)
@ -1272,7 +1272,7 @@ void segaic16_video_device::tilemap_set_rowscroll(int which, int enable)
enable = (enable != 0); enable = (enable != 0);
if (info->rowscroll != enable) if (info->rowscroll != enable)
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
info->rowscroll = enable; info->rowscroll = enable;
} }
} }
@ -1292,7 +1292,7 @@ void segaic16_video_device::tilemap_set_colscroll(int which, int enable)
enable = (enable != 0); enable = (enable != 0);
if (info->colscroll != enable) if (info->colscroll != enable)
{ {
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
info->colscroll = enable; info->colscroll = enable;
} }
} }
@ -1328,7 +1328,7 @@ WRITE16_MEMBER( segaic16_video_device::textram_w )
{ {
/* certain ranges need immediate updates */ /* certain ranges need immediate updates */
if (offset >= 0xe80/2) if (offset >= 0xe80/2)
m_screen->update_partial(m_screen->vpos()); screen().update_partial(screen().vpos());
COMBINE_DATA(&m_textram[offset]); COMBINE_DATA(&m_textram[offset]);
m_bg_tilemap[0].textmap->mark_tile_dirty(offset); m_bg_tilemap[0].textmap->mark_tile_dirty(offset);

View File

@ -399,12 +399,12 @@ void sknsspr_device::skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cl
if (sprite_flip&2) if (sprite_flip&2)
{ {
xflip ^= 1; xflip ^= 1;
sx = m_screen->visible_area().max_x+1 - sx; sx = screen().visible_area().max_x+1 - sx;
} }
if (sprite_flip&1) if (sprite_flip&1)
{ {
yflip ^= 1; yflip ^= 1;
sy = m_screen->visible_area().max_y+1 - sy; sy = screen().visible_area().max_y+1 - sy;
} }
/* Palette linking */ /* Palette linking */

View File

@ -407,7 +407,7 @@ void tc0780fpa_device::device_start()
m_texture = std::make_unique<uint8_t[]>(0x400000); m_texture = std::make_unique<uint8_t[]>(0x400000);
m_poly_fifo = std::make_unique<uint16_t[]>(POLY_FIFO_SIZE); m_poly_fifo = std::make_unique<uint16_t[]>(POLY_FIFO_SIZE);
m_renderer = std::make_unique<tc0780fpa_renderer>(*this, *m_screen, m_texture.get()); m_renderer = std::make_unique<tc0780fpa_renderer>(*this, screen(), m_texture.get());
save_pointer(NAME(m_texture.get()), 0x400000); save_pointer(NAME(m_texture.get()), 0x400000);
save_pointer(NAME(m_poly_fifo.get()), POLY_FIFO_SIZE); save_pointer(NAME(m_poly_fifo.get()), POLY_FIFO_SIZE);

View File

@ -415,9 +415,9 @@ void tia_video_device::device_start()
m_vsync_cb.resolve(); m_vsync_cb.resolve();
int cx = m_screen->width(); int cx = screen().width();
screen_height = m_screen->height(); screen_height = screen().height();
helper[0] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT); helper[0] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
helper[1] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT); helper[1] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
helper[2] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT); helper[2] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
@ -1022,8 +1022,8 @@ WRITE8_MEMBER( tia_video_device::VSYNC_w )
if ( curr_y > 5 ) if ( curr_y > 5 )
update_bitmap( update_bitmap(
m_screen->width(), screen().width(),
m_screen->height()); screen().height());
if ( !m_vsync_cb.isnull() ) { if ( !m_vsync_cb.isnull() ) {
m_vsync_cb(0, curr_y, 0xFFFF ); m_vsync_cb(0, curr_y, 0xFFFF );

View File

@ -166,7 +166,7 @@ void uv201_device::device_reset()
void uv201_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void uv201_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) switch (id)
{ {
@ -244,7 +244,7 @@ void uv201_device::initialize_palette()
int uv201_device::get_field_vpos() int uv201_device::get_field_vpos()
{ {
int vpos = m_screen->vpos(); int vpos = screen().vpos();
if (vpos >= SCREEN_HEIGHT) if (vpos >= SCREEN_HEIGHT)
{ {
@ -262,7 +262,7 @@ int uv201_device::get_field_vpos()
int uv201_device::get_field() int uv201_device::get_field()
{ {
return m_screen->vpos() < SCREEN_HEIGHT; return screen().vpos() < SCREEN_HEIGHT;
} }
@ -274,8 +274,8 @@ void uv201_device::set_y_interrupt()
{ {
int scanline = ((m_cmd & COMMAND_YINT_H_O) << 1) | m_y_int; int scanline = ((m_cmd & COMMAND_YINT_H_O) << 1) | m_y_int;
m_timer_y_odd->adjust(m_screen->time_until_pos(scanline), 0, m_screen->frame_period()); m_timer_y_odd->adjust(screen().time_until_pos(scanline), 0, screen().frame_period());
//m_timer_y_even->adjust(m_screen->time_until_pos(scanline + SCREEN_HEIGHT), 0, m_screen->frame_period()); //m_timer_y_even->adjust(screen().time_until_pos(scanline + SCREEN_HEIGHT), 0, screen().frame_period());
} }
@ -285,11 +285,11 @@ void uv201_device::set_y_interrupt()
void uv201_device::do_partial_update() void uv201_device::do_partial_update()
{ {
int vpos = m_screen->vpos(); int vpos = screen().vpos();
if (LOG) logerror("Partial screen update at scanline %u\n", vpos); if (LOG) logerror("Partial screen update at scanline %u\n", vpos);
m_screen->update_partial(vpos); screen().update_partial(vpos);
} }
@ -464,7 +464,7 @@ WRITE_LINE_MEMBER( uv201_device::ext_int_w )
if (!state && (m_cmd & COMMAND_FRZ)) if (!state && (m_cmd & COMMAND_FRZ))
{ {
m_freeze_y = get_field_vpos(); m_freeze_y = get_field_vpos();
m_freeze_x = m_screen->hpos(); m_freeze_x = screen().hpos();
} }
} }

View File

@ -216,7 +216,7 @@ READ8_MEMBER( zx8301_device::data_r )
if (m_vda) if (m_vda)
{ {
m_cpu->spin_until_time(m_screen->time_until_pos(256, 0)); m_cpu->spin_until_time(screen().time_until_pos(256, 0));
} }
return readbyte(offset); return readbyte(offset);
@ -233,7 +233,7 @@ WRITE8_MEMBER( zx8301_device::data_w )
if (m_vda) if (m_vda)
{ {
m_cpu->spin_until_time(m_screen->time_until_pos(256, 0)); m_cpu->spin_until_time(screen().time_until_pos(256, 0));
} }
writebyte(offset, data); writebyte(offset, data);