diff --git a/include/config.h b/include/config.h index 4cd7f1f80..47a0fcfcc 100644 --- a/include/config.h +++ b/include/config.h @@ -38,17 +38,18 @@ enum CONFIG_INDEX { #define CONFIG_ITEM_DNAS "$DNAS" #define CONFIG_ITEM_CONFIGSOURCE "$ConfigSource" -#define CONFIG_ITEM_OSDLNG "$CustomLanguageValue" -#define CONFIG_ITEM_OSDLNG_SOURCE "$CustomLanguageSource" -#define CONFIG_ITEM_OSDLNG_ENABLE "$CustomLanguageEnable" - +#define CONFIG_ITEM_OSD_SETTINGS_LANGID "$CustomLanguageValue" +#define CONFIG_ITEM_OSD_SETTINGS_SOURCE "$CustomLanguageSource" +#define CONFIG_ITEM_OSD_SETTINGS_ENABLE "$OSDSettingsEnable" +#define CONFIG_ITEM_OSD_SETTINGS_TV_ASP "$OSDAspectRatio" +#define CONFIG_ITEM_OSD_SETTINGS_VMODE "$OSDVideoMode" // Per-Game GSM keys. -Bat- -#define CONFIG_ITEM_GSMSOURCE "$GSMSource" -#define CONFIG_ITEM_ENABLEGSM "$EnableGSM" -#define CONFIG_ITEM_GSMVMODE "$GSMVMode" -#define CONFIG_ITEM_GSMXOFFSET "$GSMXOffset" -#define CONFIG_ITEM_GSMYOFFSET "$GSMYOffset" -#define CONFIG_ITEM_GSMFIELDFIX "$GSMFIELDFix" +#define CONFIG_ITEM_GSMSOURCE "$GSMSource" +#define CONFIG_ITEM_ENABLEGSM "$EnableGSM" +#define CONFIG_ITEM_GSMVMODE "$GSMVMode" +#define CONFIG_ITEM_GSMXOFFSET "$GSMXOffset" +#define CONFIG_ITEM_GSMYOFFSET "$GSMYOffset" +#define CONFIG_ITEM_GSMFIELDFIX "$GSMFIELDFix" // Per-Game CHEAT keys. -Bat- #define CONFIG_ITEM_CHEATSSOURCE "$CheatsSource" diff --git a/include/dialogs.h b/include/dialogs.h index ba0efb2dd..2cebbbb43 100644 --- a/include/dialogs.h +++ b/include/dialogs.h @@ -141,6 +141,8 @@ enum UI_ITEMS { OSD_LANGUAGE_SOURCE, OSD_LANGUAGE_ENABLE, OSD_LANGUAGE_VALUE, + OSD_TVASPECT_VALUE, + OSD_VMODE_VALUE, #ifdef PADEMU PADEMU_GLOBAL_BUTTON, diff --git a/include/opl.h b/include/opl.h index c77e96dd8..ca50f11aa 100644 --- a/include/opl.h +++ b/include/opl.h @@ -151,6 +151,8 @@ extern int gGSMSource; extern int gPadEmuSource; extern int gOSDLanguageValue; +extern int gOSDTVAspectRatio; +extern int gOSDVideOutput; extern int gOSDLanguageEnable; extern int gOSDLanguageSource; diff --git a/lng_tmpl/_base.yml b/lng_tmpl/_base.yml index f2b29e0ff..e32630ec4 100644 --- a/lng_tmpl/_base.yml +++ b/lng_tmpl/_base.yml @@ -657,11 +657,21 @@ gui_strings: - label: LANGUAGE_SIMPL_CHINESE string: SIMPLIFIED CHINESE - label: OSD_SETTINGS - string: OSD settings + string: OSD Settings - label: OSD_SETTINGS_LNG string: OSD Language +- label: HINT_OSD_SETTINGS_LNG + string: Force a custom language configuration - label: ENABLE_LNG - string: Change language + string: Enable +- label: OSD_SETTINGS_TVASPECT + string: Screen Size +- label: FULL_SCREEN + string: Full Screen +- label: OSD_SETTINGS_VMODE + string: Video Mode +- label: SYSTEM_DEFAULT + string: System Default - label: BGM string: Background Music - label: BGM_VOLUME diff --git a/src/dialogs.c b/src/dialogs.c index 7f478e95c..3ab9649d3 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -1032,7 +1032,7 @@ struct UIItem diaOSDConfig[] = { {UI_LABEL, 0, 1, 1, -1, 0, 0, {.label = {NULL, _STR_OSD_SETTINGS}}}, {UI_SPLITTER}, - {UI_LABEL, 0, 1, 1, -1, -50, 0, {.label = {NULL, _STR_SETTINGS_SOURCE}}}, + {UI_LABEL, 0, 1, 1, -1, -40, 0, {.label = {NULL, _STR_SETTINGS_SOURCE}}}, {UI_SPACER}, {UI_ENUM, OSD_LANGUAGE_SOURCE, 1, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, @@ -1043,9 +1043,19 @@ struct UIItem diaOSDConfig[] = { {UI_BOOL, OSD_LANGUAGE_ENABLE, 1, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, - {UI_LABEL, 0, 1, 1, -1, -40, 0, {.label = {NULL, _STR_OSD_SETTINGS_LNG}}}, + {UI_LABEL, 0, 1, 1, -1, -41, 0, {.label = {NULL, _STR_OSD_SETTINGS_LNG}}}, + {UI_SPACER}, + {UI_ENUM, OSD_LANGUAGE_VALUE, 1, 1, _STR_HINT_OSD_SETTINGS_LNG, 0, 0, {.intvalue = {0, 0}}}, + {UI_BREAK}, + + {UI_LABEL, 0, 1, 1, -1, -41, 0, {.label = {NULL, _STR_OSD_SETTINGS_TVASPECT}}}, + {UI_SPACER}, + {UI_ENUM, OSD_TVASPECT_VALUE, 1, 1, -1, 0, 0, {.intvalue = {0, 0}}}, + {UI_BREAK}, + + {UI_LABEL, 0, 1, 1, -1, -41, 0, {.label = {NULL, _STR_OSD_SETTINGS_VMODE}}}, {UI_SPACER}, - {UI_ENUM, OSD_LANGUAGE_VALUE, 1, 1, -1, 0, 0, {.intvalue = {0, 0}}}, + {UI_ENUM, OSD_VMODE_VALUE, 1, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, // buttons diff --git a/src/guigame.c b/src/guigame.c index 664527bb1..8a13125f2 100644 --- a/src/guigame.c +++ b/src/guigame.c @@ -1110,8 +1110,10 @@ void guiGameRemoveGlobalSettings(config_set_t *configGame) configRemoveKey(configGame, CONFIG_ITEM_GSMYOFFSET); configRemoveKey(configGame, CONFIG_ITEM_GSMFIELDFIX); //OSD Language - configRemoveKey(configGame, CONFIG_ITEM_OSDLNG); - configRemoveKey(configGame, CONFIG_ITEM_OSDLNG_ENABLE); + configRemoveKey(configGame, CONFIG_ITEM_OSD_SETTINGS_LANGID); + configRemoveKey(configGame, CONFIG_ITEM_OSD_SETTINGS_TV_ASP); + configRemoveKey(configGame, CONFIG_ITEM_OSD_SETTINGS_VMODE); + configRemoveKey(configGame, CONFIG_ITEM_OSD_SETTINGS_ENABLE); #ifdef PADEMU // PADEMU @@ -1146,9 +1148,11 @@ void guiGameRemoveSettings(config_set_t *configSet) configRemoveKey(configSet, CONFIG_ITEM_CHEATMODE); //OSD Language - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG); - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG_SOURCE); - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG_ENABLE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_LANGID); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_TV_ASP); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_VMODE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_ENABLE); #ifdef PADEMU // PADEMU @@ -1322,26 +1326,35 @@ static int guiGameOSDLanguageUpdater(int modified) // update GUI to display per-game or global settings if changed if (previousSource != gOSDLanguageSource && gOSDLanguageSource == SETTINGS_GLOBAL) { config_set_t *configSet = gameMenuLoadConfig(diaOSDConfig); - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG_SOURCE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE); guiGameLoadOSDLanguageConfig(configSet, configGetByType(CONFIG_GAME)); } else if (previousSource != gOSDLanguageSource && gOSDLanguageSource == SETTINGS_PERGAME) { config_set_t *configSet = gameMenuLoadConfig(diaOSDConfig); - configSetInt(configSet, CONFIG_ITEM_OSDLNG_SOURCE, gOSDLanguageSource); + configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE, gOSDLanguageSource); guiGameLoadOSDLanguageConfig(configSet, configGetByType(CONFIG_GAME)); } diaGetInt(diaOSDConfig, OSD_LANGUAGE_ENABLE, &gOSDLanguageEnable); diaGetInt(diaOSDConfig, OSD_LANGUAGE_VALUE, &gOSDLanguageValue); - + diaGetInt(diaOSDConfig, OSD_TVASPECT_VALUE, &gOSDTVAspectRatio); + diaGetInt(diaOSDConfig, OSD_VMODE_VALUE, &gOSDVideOutput); + diaSetEnabled(diaOSDConfig, OSD_LANGUAGE_VALUE, gOSDLanguageEnable); + diaSetEnabled(diaOSDConfig, OSD_TVASPECT_VALUE, gOSDLanguageEnable); + diaSetEnabled(diaOSDConfig, OSD_VMODE_VALUE, gOSDLanguageEnable); return 0; } void guiGameShowOSDLanguageConfig(int forceGlobal) { - const char *Lngs[] = {_l(_STR_LANGUAGE_JAPANESE), _l(_STR_LANGUAGE_ENGLISH), _l(_STR_LANGUAGE_FRENCH), _l(_STR_LANGUAGE_SPANISH), _l(_STR_LANGUAGE_GERMAN), _l(_STR_LANGUAGE_ITALIAN), _l(_STR_LANGUAGE_DUTCH), _l(_STR_LANGUAGE_PORTUGUESE), NULL}; + /// `_STR_SYSTEM_DEFAULT` MUST BE AT THE END OF THE LIST. ELSE, THE ENUMERATOR VALUES WILL NOT MATCH THE ONES ON OSDCONFIG. BREAKING THIS FEATURE + const char *Lngs[] = {_l(_STR_LANGUAGE_JAPANESE), _l(_STR_LANGUAGE_ENGLISH), _l(_STR_LANGUAGE_FRENCH), _l(_STR_LANGUAGE_SPANISH), _l(_STR_LANGUAGE_GERMAN), _l(_STR_LANGUAGE_ITALIAN), _l(_STR_LANGUAGE_DUTCH), _l(_STR_LANGUAGE_PORTUGUESE), _l(_STR_SYSTEM_DEFAULT), NULL}; const char *sources[] = {_l(_STR_GLOBAL_SETTINGS), _l(_STR_PERGAME_SETTINGS), NULL}; + const char *TV[] = {"4:3", _l(_STR_FULL_SCREEN), "16:9", _l(_STR_SYSTEM_DEFAULT), NULL}; + const char *VMOD[] = {"RGB", "Y Cb/Pb Cr/Pr", _l(_STR_SYSTEM_DEFAULT), NULL}; diaSetEnum(diaOSDConfig, OSD_LANGUAGE_VALUE, Lngs); diaSetEnum(diaOSDConfig, OSD_LANGUAGE_SOURCE, sources); + diaSetEnum(diaOSDConfig, OSD_TVASPECT_VALUE, TV); + diaSetEnum(diaOSDConfig, OSD_VMODE_VALUE, VMOD); forceGlobalOSDLanguage = forceGlobal; diaSetEnabled(diaOSDConfig, OSD_LANGUAGE_SOURCE, !forceGlobalOSDLanguage); @@ -1361,12 +1374,17 @@ void guiGameShowOSDLanguageConfig(int forceGlobal) static int guiGameSaveOSDLanguageGameConfig(config_set_t *configSet, int result) { if (gOSDLanguageSource == SETTINGS_PERGAME) { - if ((result = configSetInt(configSet, CONFIG_ITEM_OSDLNG_SOURCE, gOSDLanguageSource))) - if ((result = configSetInt(configSet, CONFIG_ITEM_OSDLNG_ENABLE, gOSDLanguageEnable))) - result = configSetInt(configSet, CONFIG_ITEM_OSDLNG, gOSDLanguageValue); + if ((result = configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE, gOSDLanguageSource))) + if ((result = configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_ENABLE, gOSDLanguageEnable))) { + configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_LANGID, gOSDLanguageValue); + configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, gOSDTVAspectRatio); + result = configSetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_VMODE, gOSDVideOutput); + } } else { - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG); - configRemoveKey(configSet, CONFIG_ITEM_OSDLNG_ENABLE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_LANGID); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_TV_ASP); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_VMODE); + configRemoveKey(configSet, CONFIG_ITEM_OSD_SETTINGS_ENABLE); } return result; @@ -1375,8 +1393,10 @@ static int guiGameSaveOSDLanguageGameConfig(config_set_t *configSet, int result) void guiGameSaveOSDLanguageGlobalConfig(config_set_t *configGame) { if (gOSDLanguageSource == SETTINGS_GLOBAL) { - configSetInt(configGame, CONFIG_ITEM_OSDLNG_ENABLE, gOSDLanguageEnable); - configSetInt(configGame, CONFIG_ITEM_OSDLNG, gOSDLanguageValue); + configSetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_ENABLE, gOSDLanguageEnable); + configSetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_LANGID, gOSDLanguageValue); + configSetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, gOSDTVAspectRatio); + configSetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_VMODE, gOSDVideOutput); } } @@ -1386,16 +1406,22 @@ static void guiGameLoadOSDLanguageConfig(config_set_t *configSet, config_set_t * gOSDLanguageEnable = 0; gOSDLanguageSource = 0; - configGetInt(configGame, CONFIG_ITEM_OSDLNG_ENABLE, &gOSDLanguageEnable); - configGetInt(configGame, CONFIG_ITEM_OSDLNG, &gOSDLanguageValue); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_ENABLE, &gOSDLanguageEnable); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_LANGID, &gOSDLanguageValue); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, &gOSDTVAspectRatio); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_VMODE, &gOSDVideOutput); // override global with per-game settings if available and selected. if (!forceGlobalOSDLanguage) { - configGetInt(configSet, CONFIG_ITEM_OSDLNG_SOURCE, &gOSDLanguageSource); + configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE, &gOSDLanguageSource); if (gOSDLanguageSource == SETTINGS_PERGAME) { - if (!configGetInt(configSet, CONFIG_ITEM_OSDLNG_ENABLE, &gOSDLanguageEnable)) + if (!configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_ENABLE, &gOSDLanguageEnable)) gOSDLanguageEnable = 0; - if (!configGetInt(configSet, CONFIG_ITEM_OSDLNG, &gOSDLanguageValue)) + if (!configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_LANGID, &gOSDLanguageValue)) gOSDLanguageValue = 0; + if (!configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, &gOSDTVAspectRatio)) + gOSDTVAspectRatio = 0; + if (!configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_VMODE, &gOSDVideOutput)) + gOSDVideOutput = 0; } } diff --git a/src/opl.c b/src/opl.c index ff14c76ab..2f941cc07 100644 --- a/src/opl.c +++ b/src/opl.c @@ -203,6 +203,8 @@ char *gHDDPrefix; char gExportName[32]; int gOSDLanguageValue; +int gOSDTVAspectRatio; +int gOSDVideOutput; int gOSDLanguageEnable; int gOSDLanguageSource; diff --git a/src/supportbase.c b/src/supportbase.c index 462607e6a..5d7b5d84a 100644 --- a/src/supportbase.c +++ b/src/supportbase.c @@ -663,12 +663,16 @@ int sbPrepare(base_game_info_t *game, config_set_t *configSet, int size_cdvdman, } #endif - if (configGetInt(configSet, CONFIG_ITEM_OSDLNG_SOURCE, &gOSDLanguageSource)) { - configGetInt(configSet, CONFIG_ITEM_OSDLNG_ENABLE, &gOSDLanguageEnable); - configGetInt(configSet, CONFIG_ITEM_OSDLNG, &gOSDLanguageValue); + if (configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_SOURCE, &gOSDLanguageSource)) { + configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_ENABLE, &gOSDLanguageEnable); + configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_LANGID, &gOSDLanguageValue); + configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, &gOSDTVAspectRatio); + configGetInt(configSet, CONFIG_ITEM_OSD_SETTINGS_VMODE, &gOSDVideOutput); } else { - configGetInt(configGame, CONFIG_ITEM_OSDLNG_ENABLE, &gOSDLanguageEnable); - configGetInt(configGame, CONFIG_ITEM_OSDLNG, &gOSDLanguageValue); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_ENABLE, &gOSDLanguageEnable); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_LANGID, &gOSDLanguageValue); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_TV_ASP, &gOSDTVAspectRatio); + configGetInt(configGame, CONFIG_ITEM_OSD_SETTINGS_VMODE, &gOSDVideOutput); } *patchindex = i; diff --git a/src/system.c b/src/system.c index ddf06352b..3657ec73a 100644 --- a/src/system.c +++ b/src/system.c @@ -826,8 +826,22 @@ void sysLaunchLoaderElf(const char *filename, const char *mode_str, int size_cdv #define CONFIGPARAMDATA " %d %d %d %d %d %d %d %d %d" ConfigParam PARAM; - GetOsdConfigParam(&PARAM); //get system configuration - PARAM.language = (gOSDLanguageEnable) ? gOSDLanguageValue : PARAM.language; //patch what we care about + GetOsdConfigParam(&PARAM); + if (gOSDLanguageEnable) { // only patch if enabled, and only on config fields wich have not chosen "system default" + if (gOSDLanguageValue >= LANGUAGE_JAPANESE && gOSDLanguageValue <= LANGUAGE_PORTUGUESE) { + PARAM.language = gOSDLanguageValue; + LOG("System Language enforced to %d\n", gOSDLanguageValue); + } + if (gOSDTVAspectRatio >= TV_SCREEN_43 && gOSDTVAspectRatio <= TV_SCREEN_169) { + PARAM.screenType = gOSDTVAspectRatio; + LOG("System screenType enforced to %d\n", gOSDTVAspectRatio); + } + if (gOSDVideOutput == VIDEO_OUTPUT_RGB || gOSDVideOutput == VIDEO_OUTPUT_COMPONENT) { + PARAM.videoOutput = gOSDVideOutput; + LOG("System video output enforced to %d\n", gOSDVideOutput); + } + } + #define CONFIGPARAMDATA_ARGUMENT , PARAM.spdifMode, PARAM.screenType, PARAM.videoOutput, PARAM.japLanguage, PARAM.ps1drvConfig, PARAM.version, PARAM.language, PARAM.timezoneOffset, gOSDLanguageEnable argc = 0;