diff options
author | 2015-10-09 14:18:05 +0200 | |
---|---|---|
committer | 2015-10-09 14:18:05 +0200 | |
commit | 63844e14f5dca4098937e5895194d8199f9d9780 (patch) | |
tree | af37200a474b66010d08d4cc58d3653c3b12290f /src | |
parent | 8e22b1d22f1e1e616ca5e08f1064cad614387b2e (diff) |
Make screen rotation to be per-screen attribute (nw)
commented validation used to compare it to existing rotation flags
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/screen.c | 15 | ||||
-rw-r--r-- | src/emu/screen.h | 5 | ||||
-rw-r--r-- | src/emu/validity.h | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/emu/screen.c b/src/emu/screen.c index c3bb09e320a..8174c53e209 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -12,6 +12,7 @@ #include "emuopts.h" #include "png.h" #include "rendutil.h" +#include "validity.h" @@ -55,6 +56,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev m_yscale(1.0f), m_palette(*this), m_video_attributes(0), + m_orientation(0), m_container(NULL), m_width(100), m_height(100), @@ -239,6 +241,16 @@ void screen_device::static_set_video_attributes(device_t &device, UINT32 flags) screen.m_video_attributes = flags; } //------------------------------------------------- +// static_set_orientation - set the screen orientation +//------------------------------------------------- + +void screen_device::static_set_orientation(device_t &device, UINT32 orientation) +{ + screen_device &screen = downcast<screen_device &>(device); + screen.m_orientation = orientation; +} + +//------------------------------------------------- // device_validity_check - verify device // configuration //------------------------------------------------- @@ -269,6 +281,9 @@ void screen_device::device_validity_check(validity_checker &valid) const osd_printf_error("Screen does not have palette defined\n"); if (m_palette != NULL && texformat == TEXFORMAT_RGB32) osd_printf_warning("Screen does not need palette defined\n"); + +// if (m_orientation != (valid.driver()->flags & ORIENTATION_MASK) && ((valid.driver()->flags & ORIENTATION_MASK)== ROT180)) +// osd_printf_error("Screen orientation does not match\n"); } diff --git a/src/emu/screen.h b/src/emu/screen.h index f3aab539cce..f0a43310544 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -181,11 +181,13 @@ public: static void static_set_screen_vblank(device_t &device, screen_vblank_delegate callback); static void static_set_palette(device_t &device, const char *tag); static void static_set_video_attributes(device_t &device, UINT32 flags); + static void static_set_orientation(device_t &device, UINT32 orientation); // information getters render_container &container() const { assert(m_container != NULL); return *m_container; } bitmap_ind8 &priority() { return m_priority; } palette_device *palette() { return m_palette; } + UINT32 orientation() { return m_orientation; } // dynamic configuration void configure(int width, int height, const rectangle &visarea, attoseconds_t frame_period); @@ -266,6 +268,7 @@ private: screen_vblank_delegate m_screen_vblank; // screen vblank callback optional_device<palette_device> m_palette; // our palette UINT32 m_video_attributes; // flags describing the video system + UINT32 m_orientation; // screen orientation // internal state render_container * m_container; // pointer to our container @@ -429,6 +432,8 @@ typedef device_type_iterator<&device_creator<screen_device>, screen_device> scre screen_device::static_set_palette(*device, FINDER_DUMMY_TAG); #define MCFG_SCREEN_VIDEO_ATTRIBUTES(_flags) \ screen_device::static_set_video_attributes(*device, _flags); +#define MCFG_SCREEN_ORIENTATION(_orientation) \ + screen_device::static_set_orientation(*device, _orientation); //************************************************************************** diff --git a/src/emu/validity.h b/src/emu/validity.h index acc271a7cae..dd28b419a39 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -39,6 +39,7 @@ public: // getters int errors() const { return m_errors; } int warnings() const { return m_warnings; } + const game_driver *driver() const { return m_current_driver; } // operations void check_driver(const game_driver &driver); |