Move UI mode key out of SDL options into generic options

This commit is contained in:
Vas Crabb 2015-06-15 12:50:03 +10:00
parent 2f800d2315
commit 8ea36b999d
6 changed files with 42 additions and 22 deletions

View File

@ -17,6 +17,13 @@ extern bool g_print_verbose;
const options_entry osd_options::s_option_entries[] =
{
{ NULL, NULL, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
#ifdef SDLMAME_MACOSX
{ OSDOPTION_UIMODEKEY, "DEL", OPTION_STRING, "Key to toggle keyboard mode" },
#else
{ OSDOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
#endif // SDLMAME_MACOSX
{ NULL, NULL, OPTION_HEADER, "OSD FONT OPTIONS" },
{ OSD_FONT_PROVIDER, OSDOPTVAL_AUTO, OPTION_STRING, "provider for ui font: " },
@ -24,20 +31,17 @@ const options_entry osd_options::s_option_entries[] =
{ OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" },
{ OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" },
// debugging options
{ NULL, NULL, OPTION_HEADER, "OSD DEBUGGING OPTIONS" },
{ OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, OPTION_STRING, "debugger used: " },
{ OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, OPTION_STRING, "specifies the font to use for debugging" },
{ OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", OPTION_FLOAT, "specifies the font size to use for debugging" },
{ OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" },
// performance options
{ NULL, NULL, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" },
{ OSDOPTION_MULTITHREADING ";mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" },
{ OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, OPTION_STRING, "number of processors; this overrides the number the system reports" },
{ OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
// video options
{ NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" },
// OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience
{ OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " },
@ -85,7 +89,6 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" },
#if USE_OPENGL
// OpenGL specific options
{ NULL, NULL, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" },
{ OSDOPTION_GL_FORCEPOW2TEXTURE, "0", OPTION_BOOLEAN, "force power of two textures (default no)" },
{ OSDOPTION_GL_NOTEXTURERECT, "0", OPTION_BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
@ -115,7 +118,6 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 9" },
#endif
// sound options
{ NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" },
{ OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " },
{ OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },

View File

@ -26,6 +26,8 @@
// Defines
//============================================================
#define OSDOPTION_UIMODEKEY "uimodekey"
#define OSDCOMMAND_LIST_MIDI_DEVICES "listmidi"
#define OSDCOMMAND_LIST_NETWORK_ADAPTERS "listnetwork"
@ -54,9 +56,6 @@
#define OSDOPTION_SWITCHRES "switchres"
#define OSDOPTION_SOUND "sound"
#define OSDOPTION_AUDIO_LATENCY "audio_latency"
#define OSDOPTION_FILTER "filter"
#define OSDOPTION_PRESCALE "prescale"
@ -69,6 +68,9 @@
#define OSDOPTION_GL_NOTEXTURERECT "gl_notexturerect"
#define OSDOPTION_GL_FORCEPOW2TEXTURE "gl_forcepow2texture"
#define OSDOPTION_SOUND "sound"
#define OSDOPTION_AUDIO_LATENCY "audio_latency"
#define OSDOPTION_AUDIO_OUTPUT "audio_output"
#define OSDOPTION_AUDIO_EFFECT "audio_effect"
@ -87,6 +89,9 @@ public:
// construction/destruction
osd_options();
// keyboard mapping
const char *ui_mode_key() const { return value(OSDOPTION_UIMODEKEY); }
// debugging options
const char *debugger() const { return value(OSDOPTION_DEBUGGER); }
const char *debugger_font() const { return value(OSDOPTION_DEBUGGER_FONT); }
@ -121,11 +126,7 @@ public:
// full screen options
bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); }
// sound options
const char *sound() const { return value(OSDOPTION_SOUND); }
int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); }
// video options
// accelerated video options
bool filter() const { return bool_value(OSDOPTION_FILTER); }
int prescale() const { return int_value(OSDOPTION_PRESCALE); }
@ -139,6 +140,10 @@ public:
const char *shader_mame(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_SHADER_MAME, index); return value(temp.c_str()); }
const char *shader_screen(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_SHADER_SCREEN, index); return value(temp.c_str()); }
// sound options
const char *sound() const { return value(OSDOPTION_SOUND); }
int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); }
// CoreAudio specific options
const char *audio_output() const { return value(OSDOPTION_AUDIO_OUTPUT); }
const char *audio_effect(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_AUDIO_EFFECT, index); return value(temp.c_str()); }

View File

@ -2067,7 +2067,7 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
input_item_id mameid_code;
input_code ui_code;
input_type_entry *entry;
const char* uimode;
const char* uimode;
char fullmode[64];
// loop over the defaults

View File

@ -48,7 +48,6 @@
#define SDLOPTION_SYNCREFRESH "syncrefresh"
#define SDLOPTION_KEYMAP "keymap"
#define SDLOPTION_KEYMAP_FILE "keymap_file"
#define SDLOPTION_UIMODEKEY "uimodekey"
#define SDLOPTION_SIXAXIS "sixaxis"
#define SDLOPTION_JOYINDEX "joy_idx"
@ -118,7 +117,6 @@ public:
// keyboard mapping
bool keymap() const { return bool_value(SDLOPTION_KEYMAP); }
const char *keymap_file() const { return value(SDLOPTION_KEYMAP_FILE); }
const char *ui_mode_key() const { return value(SDLOPTION_UIMODEKEY); }
// joystick mapping
const char *joy_index(int index) const { std::string temp; return value(strformat(temp, "%s%d", SDLOPTION_JOYINDEX, index).c_str()); }

View File

@ -117,11 +117,6 @@ const options_entry sdl_options::s_option_entries[] =
{ NULL, NULL, OPTION_HEADER, "SDL KEYBOARD MAPPING" },
{ SDLOPTION_KEYMAP, "0", OPTION_BOOLEAN, "enable keymap" },
{ SDLOPTION_KEYMAP_FILE, "keymap.dat", OPTION_STRING, "keymap filename" },
#ifdef SDLMAME_MACOSX
{ SDLOPTION_UIMODEKEY, "DEL", OPTION_STRING, "Key to toggle keyboard mode" },
#else
{ SDLOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
#endif // SDLMAME_MACOSX
// joystick mapping
{ NULL, NULL, OPTION_HEADER, "SDL JOYSTICK MAPPING" },

View File

@ -719,7 +719,11 @@ int wininput_vkey_for_mame_code(input_code code)
void windows_osd_interface::customize_input_type_list(simple_list<input_type_entry> &typelist)
{
//input_item_id mameid_code;
//input_code ui_code;
input_type_entry *entry;
const char* uimode;
char fullmode[64];
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
@ -731,6 +735,22 @@ void windows_osd_interface::customize_input_type_list(simple_list<input_type_ent
entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
// configurable UI mode switch
case IPT_UI_TOGGLE_UI:
uimode = options().ui_mode_key();
if (!strcmp(uimode,"auto"))
{
//mameid_code = lookup_mame_code("ITEM_ID_INSERT");
}
else
{
snprintf(fullmode, 63, "ITEM_ID_%s", uimode);
//mameid_code = lookup_mame_code(fullmode);
}
//ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");