summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/screen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/screen.h')
-rw-r--r--src/emu/screen.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 27ac6d421be..45374fef1e7 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -173,7 +173,7 @@ public:
screen_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
screen_device(const machine_config &mconfig, const char *tag, device_t *owner, screen_type_enum type)
- : screen_device(mconfig, tag, owner, (u32)0)
+ : screen_device(mconfig, tag, owner, u32(0))
{
set_type(type);
}
@@ -181,6 +181,8 @@ public:
// configuration readers
screen_type_enum screen_type() const { return m_type; }
+ int orientation() const { assert(configured()); return m_orientation; }
+ std::pair<unsigned, unsigned> physical_aspect() const { assert(configured()); return m_phys_aspect; }
int width() const { return m_width; }
int height() const { return m_height; }
const rectangle &visible_area() const { return m_visarea; }
@@ -196,7 +198,10 @@ public:
bool have_screen_update() const { return !m_screen_update_ind16.isnull() && !m_screen_update_rgb32.isnull(); }
// inline configuration helpers
- void set_type(screen_type_enum type) { m_type = type; }
+ void set_type(screen_type_enum type) { assert(!configured()); m_type = type; }
+ void set_orientation(int orientation) { assert(!configured()); m_orientation = orientation; }
+ void set_physical_aspect(unsigned x, unsigned y) { assert(!configured()); m_phys_aspect = std::make_pair(x, y); }
+ void set_native_aspect() { assert(!configured()); m_phys_aspect = std::make_pair(~0U, ~0U); }
void set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
{
m_clock = pixclock;
@@ -274,11 +279,11 @@ public:
int vpos() const;
int hpos() const;
DECLARE_READ_LINE_MEMBER(vblank) const { return (machine().time() < m_vblank_end_time) ? 1 : 0; }
- DECLARE_READ_LINE_MEMBER(hblank) const { int const curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x) ? 1 : 0; }
+ DECLARE_READ_LINE_MEMBER(hblank) const { int const curpos = hpos(); return (curpos < m_visarea.left() || curpos > m_visarea.right()) ? 1 : 0; }
// timing
attotime time_until_pos(int vpos, int hpos = 0) const;
- attotime time_until_vblank_start() const { return time_until_pos(m_visarea.max_y + 1); }
+ attotime time_until_vblank_start() const { return time_until_pos(m_visarea.bottom() + 1); }
attotime time_until_vblank_end() const;
attotime time_until_update() const { return (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
attotime scan_period() const { return attotime(0, m_scantime); }
@@ -317,6 +322,7 @@ private:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const override;
+ virtual void device_config_complete() override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_reset() override;
@@ -334,6 +340,8 @@ private:
// inline configuration data
screen_type_enum m_type; // type of screen
+ int m_orientation; // orientation flags combined with system flags
+ std::pair<unsigned, unsigned> m_phys_aspect; // physical aspect ratio
bool m_oldstyle_vblank_supplied; // MCFG_SCREEN_VBLANK_TIME macro used
attoseconds_t m_refresh; // default refresh period
attoseconds_t m_vblank; // duration of a VBLANK