diff options
author | Vas Crabb <vas@vastheman.com> | 2018-07-26 23:11:02 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-07-26 23:11:02 +1000 |
commit | 9db24aa2e965d8469d000a7429679fd06c048406 (patch) | |
tree | f8169c24d45cd0a51880a0c08830482af1755af1 /src/frontend/mame | |
parent | 884f3a86bb57652c4306a852a6f8560cc746b1ce (diff) |
Better support for screen orientation/geometry:
* Eliminates the need for the horizontal/vertical/LCD/SVG layout files
* Screens can now have orientation and physical aspect ratio specified
* RASTER/VECTOR defaults to 4:3, LCD/SVG defaults to square pixels at config time
* System orientation is applied on top of screen orientation
Automatically generated single-screen views and orientation flags in XML
output now work correctly for systems with multiple screens in different
geometries/orientations, e.g. housemnq, rocnms, stepstag, or netmerc.
The "core rotation options" only interact with system orientation.
Allowing multi-screen systems to work well with one monitor per emulated
screen is a complex topic. System orientation also affects the GFX
viewer while screen orientation doesn't. The orientation displayed in
the system selection menu is from the system orientation.
Let me know if I've broken any systems or use cases.
Also, add save state support for std::array/C array nested to any depth.
Diffstat (limited to 'src/frontend/mame')
-rw-r--r-- | src/frontend/mame/info.cpp | 53 | ||||
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 2 | ||||
-rw-r--r-- | src/frontend/mame/ui/devopt.cpp | 5 | ||||
-rw-r--r-- | src/frontend/mame/ui/info.cpp | 2 |
4 files changed, 31 insertions, 31 deletions
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp index f4e1a01ca68..3e7af8a43c5 100644 --- a/src/frontend/mame/info.cpp +++ b/src/frontend/mame/info.cpp @@ -896,35 +896,32 @@ void info_xml_creator::output_display(device_t &device, machine_flags::type cons } // output the orientation as a string - if (flags) + switch (screendev.orientation()) { - switch (*flags & machine_flags::MASK_ORIENTATION) - { - case ORIENTATION_FLIP_X: - fprintf(m_output, " rotate=\"0\" flipx=\"yes\""); - break; - case ORIENTATION_FLIP_Y: - fprintf(m_output, " rotate=\"180\" flipx=\"yes\""); - break; - case ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y: - fprintf(m_output, " rotate=\"180\""); - break; - case ORIENTATION_SWAP_XY: - fprintf(m_output, " rotate=\"90\" flipx=\"yes\""); - break; - case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X: - fprintf(m_output, " rotate=\"90\""); - break; - case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_Y: - fprintf(m_output, " rotate=\"270\""); - break; - case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y: - fprintf(m_output, " rotate=\"270\" flipx=\"yes\""); - break; - default: - fprintf(m_output, " rotate=\"0\""); - break; - } + case ORIENTATION_FLIP_X: + fprintf(m_output, " rotate=\"0\" flipx=\"yes\""); + break; + case ORIENTATION_FLIP_Y: + fprintf(m_output, " rotate=\"180\" flipx=\"yes\""); + break; + case ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y: + fprintf(m_output, " rotate=\"180\""); + break; + case ORIENTATION_SWAP_XY: + fprintf(m_output, " rotate=\"90\" flipx=\"yes\""); + break; + case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X: + fprintf(m_output, " rotate=\"90\""); + break; + case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_Y: + fprintf(m_output, " rotate=\"270\""); + break; + case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y: + fprintf(m_output, " rotate=\"270\" flipx=\"yes\""); + break; + default: + fprintf(m_output, " rotate=\"0\""); + break; } // output width and height only for games that are not vector diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index edc56ee13b9..894767e0838 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1782,7 +1782,7 @@ void lua_engine::initialize() "height", [](screen_device &sdev) { return sdev.visible_area().height(); }, "width", [](screen_device &sdev) { return sdev.visible_area().width(); }, "orientation", [](screen_device &sdev) { - uint32_t flags = sdev.machine().system().flags & machine_flags::MASK_ORIENTATION; + uint32_t flags = sdev.orientation(); int rotation_angle = 0; switch (flags) { diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp index 562bcc26e2c..2c1ddd9aebd 100644 --- a/src/frontend/mame/ui/devopt.cpp +++ b/src/frontend/mame/ui/devopt.cpp @@ -32,6 +32,9 @@ void menu_device_config::populate(float &customtop, float &custombottom) machine_config &mconfig(const_cast<machine_config &>(machine().config())); machine_config::token const tok(mconfig.begin_configuration(mconfig.root_device())); device_t *const dev = mconfig.device_add(m_option->name(), m_option->devtype(), 0); + for (device_t &d : device_iterator(*dev)) + if (!d.configured()) + d.config_complete(); std::ostringstream str; util::stream_format( @@ -96,7 +99,7 @@ void menu_device_config::populate(float &customtop, float &custombottom) util::stream_format( str, - (machine().system().flags & ORIENTATION_SWAP_XY) + (screen.orientation() & ORIENTATION_SWAP_XY) ? _(" Screen '%1$s': %2$d \xC3\x97 %3$d (V) %4$f\xC2\xA0Hz\n") : _(" Screen '%1$s': %2$d \xC3\x97 %3$d (H) %4$f\xC2\xA0Hz\n"), screen.tag(), diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index fde44227ea3..4a39bc050f5 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -385,7 +385,7 @@ std::string machine_info::game_info_string() const const rectangle &visarea = screen.visible_area(); detail = string_format("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz", visarea.width(), visarea.height(), - (m_machine.system().flags & ORIENTATION_SWAP_XY) ? "V" : "H", + (screen.orientation() & ORIENTATION_SWAP_XY) ? "V" : "H", ATTOSECONDS_TO_HZ(screen.frame_period().attoseconds())); } |