trunk/src/emu/emuopts.cpp
| r253197 | r253198 | |
| 178 | 178 | { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, |
| 179 | 179 | { OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" }, |
| 180 | 180 | { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, |
| 181 | | { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, |
| 182 | | { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" }, |
| 183 | 181 | { OPTION_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" }, |
| 184 | 182 | { OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" }, |
| 185 | | { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, |
| 186 | | { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" }, |
| 187 | 183 | { OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" }, |
| 188 | 184 | { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, |
| 189 | 185 | { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, |
trunk/src/emu/emuopts.h
| r253197 | r253198 | |
| 172 | 172 | #define OPTION_DRC_LOG_NATIVE "drc_log_native" |
| 173 | 173 | #define OPTION_BIOS "bios" |
| 174 | 174 | #define OPTION_CHEAT "cheat" |
| 175 | | #define OPTION_SKIP_GAMEINFO "skip_gameinfo" |
| 176 | | #define OPTION_UI_FONT "uifont" |
| 177 | 175 | #define OPTION_UI "ui" |
| 178 | 176 | #define OPTION_RAMSIZE "ramsize" |
| 179 | 177 | |
| r253197 | r253198 | |
| 183 | 181 | #define OPTION_COMM_REMOTE_HOST "comm_remotehost" |
| 184 | 182 | #define OPTION_COMM_REMOTE_PORT "comm_remoteport" |
| 185 | 183 | |
| 186 | | #define OPTION_CONFIRM_QUIT "confirm_quit" |
| 187 | | #define OPTION_UI_MOUSE "ui_mouse" |
| 188 | | |
| 189 | 184 | #define OPTION_AUTOBOOT_COMMAND "autoboot_command" |
| 190 | 185 | #define OPTION_AUTOBOOT_DELAY "autoboot_delay" |
| 191 | 186 | #define OPTION_AUTOBOOT_SCRIPT "autoboot_script" |
| r253197 | r253198 | |
| 348 | 343 | bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); } |
| 349 | 344 | const char *bios() const { return value(OPTION_BIOS); } |
| 350 | 345 | bool cheat() const { return bool_value(OPTION_CHEAT); } |
| 351 | | bool skip_gameinfo() const { return bool_value(OPTION_SKIP_GAMEINFO); } |
| 352 | | const char *ui_font() const { return value(OPTION_UI_FONT); } |
| 353 | 346 | const char *ui() const { return value(OPTION_UI); } |
| 354 | 347 | const char *ram_size() const { return value(OPTION_RAMSIZE); } |
| 355 | 348 | |
| r253197 | r253198 | |
| 358 | 351 | const char *comm_localport() const { return value(OPTION_COMM_LOCAL_PORT); } |
| 359 | 352 | const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); } |
| 360 | 353 | const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); } |
| 361 | | |
| 362 | | bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); } |
| 363 | | bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } |
| 364 | | |
| 354 | |
| 365 | 355 | const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); } |
| 366 | 356 | int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); } |
| 367 | 357 | const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); } |
trunk/src/emu/ui/custui.cpp
| r253197 | r253198 | |
| 33 | 33 | ui_menu_custom_ui::~ui_menu_custom_ui() |
| 34 | 34 | { |
| 35 | 35 | std::string error_string; |
| 36 | | machine().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string); |
| 36 | machine().ui().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string); |
| 37 | 37 | ui_globals::reset = true; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | | //------------------------------------------------- |
| 40 | //------------------------------------------------- |
| 41 | 41 | // handle |
| 42 | 42 | //------------------------------------------------- |
| 43 | 43 | |
| r253197 | r253198 | |
| 143 | 143 | ui_options &moptions = machine.ui().options(); |
| 144 | 144 | #ifdef UI_WINDOWS |
| 145 | 145 | |
| 146 | | std::string name(machine.options().ui_font()); |
| 146 | std::string name(machine.ui().options().ui_font()); |
| 147 | 147 | list(); |
| 148 | 148 | |
| 149 | 149 | m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); |
| r253197 | r253198 | |
| 442 | 442 | for (int index = 1; index < MUI_RESTORE; index++) |
| 443 | 443 | { |
| 444 | 444 | strprintf(dec_color, "%x", (UINT32)m_color_table[index].color); |
| 445 | | machine().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); |
| 445 | machine().ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); |
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
trunk/src/emu/ui/miscmenu.cpp
| r253197 | r253198 | |
| 564 | 564 | { 0, "DATs info", OPTION_DATS_ENABLED }, |
| 565 | 565 | { 0, "Cheats", OPTION_CHEAT }, |
| 566 | 566 | { 0, "Show mouse pointer", OPTION_UI_MOUSE }, |
| 567 | | { 0, "Confirm quit from machines", OPTION_CONFIRM_QUIT }, |
| 568 | | { 0, "Skip displaying information's screen at startup", OPTION_SKIP_GAMEINFO }, |
| 567 | { 0, "Confirm quit from machines", OPTION_UI_CONFIRM_QUIT }, |
| 568 | { 0, "Skip displaying information's screen at startup", OPTION_UI_SKIP_GAMEINFO }, |
| 569 | 569 | { 0, "Force 4:3 appearance for software snapshot", OPTION_FORCED4X3 }, |
| 570 | 570 | { 0, "Use image as background", OPTION_USE_BACKGROUND }, |
| 571 | 571 | { 0, "Skip bios selection menu", OPTION_SKIP_BIOS_MENU }, |
| r253197 | r253198 | |
| 579 | 579 | ui_menu_misc_options::ui_menu_misc_options(running_machine &machine, render_container *container) : ui_menu(machine, container) |
| 580 | 580 | { |
| 581 | 581 | for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) |
| 582 | | m_options[d].status = machine.options().bool_value(m_options[d].option); |
| 582 | m_options[d].status = machine.ui().options().bool_value(m_options[d].option); |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | ui_menu_misc_options::~ui_menu_misc_options() |
| 586 | 586 | { |
| 587 | 587 | std::string error_string; |
| 588 | 588 | for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) |
| 589 | | machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); |
| 589 | machine().ui().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); |
| 590 | 590 | ui_globals::reset = true; |
| 591 | 591 | } |
| 592 | 592 | |
trunk/src/emu/ui/moptions.cpp
| r253197 | r253198 | |
| 52 | 52 | { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, |
| 53 | 53 | { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, |
| 54 | 54 | { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, |
| 55 | { OPTION_UI_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, |
| 56 | { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" }, |
| 57 | { OPTION_UI_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, |
| 58 | { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" }, |
| 55 | 59 | |
| 56 | 60 | // UI options |
| 57 | | { nullptr, nullptr, OPTION_HEADER, "UI UI OPTIONS" }, |
| 61 | { nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" }, |
| 58 | 62 | { OPTION_INFOS_SIZE "(0.05-1.00)", "0.75", OPTION_FLOAT, "UI right panel infos text size (0.05 - 1.00)" }, |
| 59 | 63 | { OPTION_FONT_ROWS "(25-40)", "30", OPTION_INTEGER, "UI font text size (25 - 40)" }, |
| 60 | 64 | { OPTION_HIDE_PANELS "(0-3)", "0", OPTION_INTEGER, "UI hide left/right panel in main view (0 = Show all, 1 = hide left, 2 = hide right, 3 = hide both" }, |
trunk/src/emu/ui/moptions.h
| r253197 | r253198 | |
| 70 | 70 | #define OPTION_UI_DIPSW_COLOR "ui_dipsw_color" |
| 71 | 71 | #define OPTION_UI_SLIDER_COLOR "ui_slider_color" |
| 72 | 72 | |
| 73 | #define OPTION_UI_FONT "uifont" |
| 74 | #define OPTION_UI_CONFIRM_QUIT "confirm_quit" |
| 75 | #define OPTION_UI_MOUSE "ui_mouse" |
| 76 | #define OPTION_UI_SKIP_GAMEINFO "skip_gameinfo" |
| 77 | |
| 78 | |
| 73 | 79 | class ui_options : public core_options |
| 74 | 80 | { |
| 75 | 81 | public: |
| r253197 | r253198 | |
| 131 | 137 | const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); } |
| 132 | 138 | const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_COLOR); } |
| 133 | 139 | |
| 140 | bool skip_gameinfo() const { return bool_value(OPTION_UI_SKIP_GAMEINFO); } |
| 141 | const char *ui_font() const { return value(OPTION_UI_FONT); } |
| 142 | bool confirm_quit() const { return bool_value(OPTION_UI_CONFIRM_QUIT); } |
| 143 | bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } |
| 134 | 144 | private: |
| 135 | 145 | static const options_entry s_option_entries[]; |
| 136 | 146 | }; |
trunk/src/emu/ui/ui.cpp
| r253197 | r253198 | |
| 361 | 361 | { |
| 362 | 362 | const int maxstate = 4; |
| 363 | 363 | int str = machine().options().seconds_to_run(); |
| 364 | | bool show_gameinfo = !machine().options().skip_gameinfo(); |
| 364 | bool show_gameinfo = !machine().ui().options().skip_gameinfo(); |
| 365 | 365 | bool show_warnings = true, show_mandatory_fileman = true; |
| 366 | 366 | int state; |
| 367 | 367 | |
| r253197 | r253198 | |
| 497 | 497 | m_popup_text_end = 0; |
| 498 | 498 | |
| 499 | 499 | // display the internal mouse cursor |
| 500 | | if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse())) |
| 500 | if (m_mouse_show || (is_menu_active() && machine().ui().options().ui_mouse())) |
| 501 | 501 | { |
| 502 | 502 | INT32 mouse_target_x, mouse_target_y; |
| 503 | 503 | bool mouse_button; |
| r253197 | r253198 | |
| 528 | 528 | { |
| 529 | 529 | // allocate the font and messagebox string |
| 530 | 530 | if (m_font == nullptr) |
| 531 | | m_font = machine().render().font_alloc(machine().options().ui_font()); |
| 531 | m_font = machine().render().font_alloc(machine().ui().options().ui_font()); |
| 532 | 532 | return m_font; |
| 533 | 533 | } |
| 534 | 534 | |
| r253197 | r253198 | |
| 1863 | 1863 | |
| 1864 | 1864 | void ui_manager::request_quit() |
| 1865 | 1865 | { |
| 1866 | | if (!machine().options().confirm_quit()) |
| 1866 | if (!machine().ui().options().confirm_quit()) |
| 1867 | 1867 | machine().schedule_exit(); |
| 1868 | 1868 | else |
| 1869 | 1869 | set_handler(handler_confirm_quit, 0); |