diff --git a/src/osd/winui/mui_opts.cpp b/src/osd/winui/mui_opts.cpp index 1d189cce99b1e..f6e7bee24ce70 100644 --- a/src/osd/winui/mui_opts.cpp +++ b/src/osd/winui/mui_opts.cpp @@ -1073,17 +1073,32 @@ BOOL GetSortReverse(void) return settings.bool_value( MUIOPTION_SORT_REVERSED); } -const char* GetLanguage(void) +const char* GetLanguage(void) // this is unused I guess { return settings.value( MUIOPTION_LANGUAGE); } -void SetLanguage(const char* lang) +void SetLanguage(const char* lang) // same as above, time to remove it? { std::string error_string; settings.set_value(MUIOPTION_LANGUAGE, lang, OPTION_PRIORITY_CMDLINE,error_string); } +const char* GetLanguageUI(void) +{ + return global.value(OPTION_LANGUAGE); +} + +bool GetEnablePlugins(void) +{ + return global.bool_value(OPTION_PLUGINS); +} + +const char* GetPlugins(void) +{ + return global.value(OPTION_PLUGIN); +} + const char* GetRomDirs(void) { return global.media_path(); diff --git a/src/osd/winui/mui_opts.h b/src/osd/winui/mui_opts.h index 3301303a2daae..7cccc31375af5 100644 --- a/src/osd/winui/mui_opts.h +++ b/src/osd/winui/mui_opts.h @@ -230,6 +230,12 @@ BOOL GetSortReverse(void); const char* GetLanguage(void); void SetLanguage(const char* lang); +const char* GetLanguageUI(void); + +bool GetEnablePlugins(void); + +const char* GetPlugins(void); + const char* GetRomDirs(void); void SetRomDirs(const char* paths); diff --git a/src/osd/winui/winui.cpp b/src/osd/winui/winui.cpp index 64cafc7b6f642..37a24791f1441 100644 --- a/src/osd/winui/winui.cpp +++ b/src/osd/winui/winui.cpp @@ -886,17 +886,23 @@ static DWORD RunMAME(int nGameIndex, const play_options *playopts) time_t start, end; double elapsedtime; int i; - mame_options mame_opts; + //mame_options mame_opts; seems useless.... windows_options global_opts; std::string error_string; // set up MAME options -// mame_opts = mame_options_init(mame_win_options); + // mame_opts = mame_options_init(mame_win_options); // Tell mame were to get the INIs SetDirectories(global_opts); + // set some startup options + global_opts.set_value(OPTION_LANGUAGE, GetLanguageUI(), OPTION_PRIORITY_CMDLINE, error_string); + global_opts.set_value(OPTION_PLUGINS, GetEnablePlugins(), OPTION_PRIORITY_CMDLINE, error_string); + global_opts.set_value(OPTION_PLUGIN, GetPlugins(), OPTION_PRIORITY_CMDLINE, error_string); + // add image specific device options - mame_opts.set_system_name(global_opts, driver_list::driver(nGameIndex).name); + //mame_opts.set_system_name(global_opts, driver_list::driver(nGameIndex).name); + global_opts.set_value(OPTION_SYSTEMNAME, driver_list::driver(nGameIndex).name, OPTION_PRIORITY_CMDLINE, error_string); // set any specified play options if (playopts_apply == 0x57) @@ -932,6 +938,8 @@ static DWORD RunMAME(int nGameIndex, const play_options *playopts) osd_output::push(&winerror); osd.register_options(); mame_machine_manager *manager = mame_machine_manager::instance(global_opts, osd); + load_translation(global_opts); + manager->start_luaengine(); manager->execute(); osd_output::pop(&winerror); global_free(manager);