Previous 199869 Revisions Next

r44686 Friday 5th February, 2016 at 14:17:51 UTC by Miodrag Milanović
move some options to ui.ini (nw)
[src/emu]emuopts.cpp emuopts.h
[src/emu/ui]custui.cpp menu.cpp miscmenu.cpp moptions.cpp moptions.h ui.cpp

trunk/src/emu/emuopts.cpp
r253197r253198
178178   { OPTION_DRC_LOG_NATIVE,                             "0",         OPTION_BOOLEAN,    "write DRC native disassembly log" },
179179   { OPTION_BIOS,                                       nullptr,        OPTION_STRING,     "select the system BIOS to use" },
180180   { 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" },
183181   { OPTION_UI,                                          "cabinet",   OPTION_STRING,     "type of UI (simple|cabinet)" },
184182   { 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" },
187183   { OPTION_AUTOBOOT_COMMAND ";ab",                     nullptr,        OPTION_STRING,     "command to execute after machine boot" },
188184   { OPTION_AUTOBOOT_DELAY,                             "2",         OPTION_INTEGER,    "timer delay in sec to trigger command execution on autoboot" },
189185   { OPTION_AUTOBOOT_SCRIPT ";script",                  nullptr,        OPTION_STRING,     "lua script to execute after machine boot" },
trunk/src/emu/emuopts.h
r253197r253198
172172#define OPTION_DRC_LOG_NATIVE       "drc_log_native"
173173#define OPTION_BIOS                 "bios"
174174#define OPTION_CHEAT                "cheat"
175#define OPTION_SKIP_GAMEINFO        "skip_gameinfo"
176#define OPTION_UI_FONT              "uifont"
177175#define OPTION_UI                   "ui"
178176#define OPTION_RAMSIZE              "ramsize"
179177
r253197r253198
183181#define OPTION_COMM_REMOTE_HOST     "comm_remotehost"
184182#define OPTION_COMM_REMOTE_PORT     "comm_remoteport"
185183
186#define OPTION_CONFIRM_QUIT         "confirm_quit"
187#define OPTION_UI_MOUSE             "ui_mouse"
188
189184#define OPTION_AUTOBOOT_COMMAND     "autoboot_command"
190185#define OPTION_AUTOBOOT_DELAY       "autoboot_delay"
191186#define OPTION_AUTOBOOT_SCRIPT      "autoboot_script"
r253197r253198
348343   bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); }
349344   const char *bios() const { return value(OPTION_BIOS); }
350345   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); }
353346   const char *ui() const { return value(OPTION_UI); }
354347   const char *ram_size() const { return value(OPTION_RAMSIZE); }
355348
r253197r253198
358351   const char *comm_localport() const { return value(OPTION_COMM_LOCAL_PORT); }
359352   const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); }
360353   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   
365355   const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); }
366356   int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); }
367357   const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); }
trunk/src/emu/ui/custui.cpp
r253197r253198
3333ui_menu_custom_ui::~ui_menu_custom_ui()
3434{
3535   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);
3737   ui_globals::reset = true;
3838}
3939
40//-------------------------------------------------
40//-------------------------------------------------   
4141//  handle
4242//-------------------------------------------------
4343
r253197r253198
143143   ui_options &moptions = machine.ui().options();
144144#ifdef UI_WINDOWS
145145
146   std::string name(machine.options().ui_font());
146   std::string name(machine.ui().options().ui_font());
147147   list();
148148
149149   m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
r253197r253198
442442   for (int index = 1; index < MUI_RESTORE; index++)
443443   {
444444      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);
446446   }
447447}
448448
trunk/src/emu/ui/menu.cpp
r253197r253198
16131613   snaptext.assign(arts_info[ui_globals::curimage_view].title);
16141614
16151615   // get search path
1616   path_iterator path(machine().options().value(arts_info[ui_globals::curimage_view].path));
1616   path_iterator path(machine().ui().options().value(arts_info[ui_globals::curimage_view].path));
16171617   std::string curpath;
1618   searchstr.assign(machine().options().value(arts_info[ui_globals::curimage_view].path));
1618   searchstr.assign(machine().ui().options().value(arts_info[ui_globals::curimage_view].path));
16191619
16201620   // iterate over path and add path for zipped formats
16211621   while (path.next(curpath))
trunk/src/emu/ui/miscmenu.cpp
r253197r253198
564564   { 0, "DATs info",                                       OPTION_DATS_ENABLED },
565565   { 0, "Cheats",                                          OPTION_CHEAT },
566566   { 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 },
569569   { 0, "Force 4:3 appearance for software snapshot",      OPTION_FORCED4X3 },
570570   { 0, "Use image as background",                         OPTION_USE_BACKGROUND },
571571   { 0, "Skip bios selection menu",                        OPTION_SKIP_BIOS_MENU },
r253197r253198
579579ui_menu_misc_options::ui_menu_misc_options(running_machine &machine, render_container *container) : ui_menu(machine, container)
580580{
581581   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);
583583}
584584
585585ui_menu_misc_options::~ui_menu_misc_options()
586586{
587587   std::string error_string;
588588   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);
590590   ui_globals::reset = true;
591591}
592592
trunk/src/emu/ui/moptions.cpp
r253197r253198
5252   { OPTION_LAST_USED_FILTER,              "",         OPTION_STRING,      "latest used filter" },
5353   { OPTION_LAST_USED_MACHINE,             "",         OPTION_STRING,      "latest used machine" },
5454   { 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" },
5559
5660   // UI options
57   { nullptr,                              nullptr,      OPTION_HEADER,      "UI UI OPTIONS" },
61   { nullptr,                              nullptr,      OPTION_HEADER,      "UI OPTIONS" },
5862   { OPTION_INFOS_SIZE "(0.05-1.00)",      "0.75",         OPTION_FLOAT,      "UI right panel infos text size (0.05 - 1.00)" },
5963   { OPTION_FONT_ROWS "(25-40)",           "30",         OPTION_INTEGER,      "UI font text size (25 - 40)" },
6064   { 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
r253197r253198
7070#define OPTION_UI_DIPSW_COLOR         "ui_dipsw_color"
7171#define OPTION_UI_SLIDER_COLOR        "ui_slider_color"
7272
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
7379class ui_options : public core_options
7480{
7581public:
r253197r253198
131137   const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); }
132138   const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_COLOR); }
133139
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); }
134144private:
135145   static const options_entry s_option_entries[];
136146};
trunk/src/emu/ui/ui.cpp
r253197r253198
361361{
362362   const int maxstate = 4;
363363   int str = machine().options().seconds_to_run();
364   bool show_gameinfo = !machine().options().skip_gameinfo();
364   bool show_gameinfo = !machine().ui().options().skip_gameinfo();
365365   bool show_warnings = true, show_mandatory_fileman = true;
366366   int state;
367367
r253197r253198
497497      m_popup_text_end = 0;
498498
499499   // 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()))
501501   {
502502      INT32 mouse_target_x, mouse_target_y;
503503      bool mouse_button;
r253197r253198
528528{
529529   // allocate the font and messagebox string
530530   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());
532532   return m_font;
533533}
534534
r253197r253198
18631863
18641864void ui_manager::request_quit()
18651865{
1866   if (!machine().options().confirm_quit())
1866   if (!machine().ui().options().confirm_quit())
18671867      machine().schedule_exit();
18681868   else
18691869      set_handler(handler_confirm_quit, 0);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team