Merge pull request #106 from ds22x/master

Update to core options v2 interface
This commit is contained in:
LibretroAdmin 2022-09-28 00:02:59 +02:00 committed by GitHub
commit 7c25d64d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1851 additions and 357 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2018 The RetroArch team
/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_inline.h).

View File

@ -59,7 +59,6 @@ static bool option_sndInterpolation = true;
static bool option_useBios = false;
static bool option_colorizerHack = false;
static bool option_forceRTCenable = false;
static bool option_showAdvancedOptions = false;
static double option_sndFiltering = 0.5;
static unsigned option_gbPalette = 0;
static bool option_lcdfilter = false;
@ -510,7 +509,8 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
libretro_set_core_options(environ_cb);
bool categoriesSupported;
libretro_set_core_options(environ_cb, &categoriesSupported);
}
void retro_get_system_info(struct retro_system_info *info)
@ -1205,39 +1205,6 @@ static void update_variables(bool startup)
else
ifb_filter_func = NULL;
var.key = "vbam_show_advanced_options";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
bool newval = (!strcmp(var.value, "enabled")) ? true : false;
if ((option_showAdvancedOptions != newval) || startup) {
option_showAdvancedOptions = newval;
struct retro_core_option_display option_display;
unsigned i;
char options[][13] = {
"vbam_sound_1",
"vbam_sound_2",
"vbam_sound_3",
"vbam_sound_4",
"vbam_sound_5",
"vbam_sound_6",
"vbam_layer_1",
"vbam_layer_2",
"vbam_layer_3",
"vbam_layer_4",
"vbam_layer_5",
"vbam_layer_6",
"vbam_layer_7",
"vbam_layer_8"
};
option_display.visible = option_showAdvancedOptions;
for (i = 0; i < (sizeof(options) / sizeof(options[0])); i++) {
option_display.key = options[i];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
}
}
}
// Hide some core options depending on rom image type
if (startup) {
unsigned i;

View File

@ -13,9 +13,10 @@
/*
********************************
* VERSION: 1.3
* VERSION: 2.0
********************************
*
* - 2.0: Add support for core options v2 interface
* - 1.3: Move translations to libretro_core_options_intl.h
* - libretro_core_options_intl.h includes BOM and utf-8
* fix for MSVC 2010-2013
@ -48,31 +49,43 @@ extern "C" {
* - Will be used as a fallback for any missing entries in
* frontend language definition */
struct retro_core_option_definition option_defs_us[] = {
{
"vbam_solarsensor",
"Solar Sensor Level",
"Adjusts simulated solar level in Boktai games. L2/R2 buttons can also be used to quickly change levels.",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
struct retro_core_option_v2_category option_cats_us[] = {
{
"system",
"System",
"Configure system options."
},
{
"video",
"Video",
"Configure video options."
},
{
"audio",
"Audio",
"Configure audio options."
},
{
"input",
"Input",
"Configure input options."
},
{
"advanced",
"Advanced options",
"Configure advanced options which can enable or disable sound channels and graphics layers."
},
{ NULL, NULL, NULL },
};
struct retro_core_option_v2_definition option_defs_us[] = {
{
"vbam_usebios",
"Use Official BIOS (If Available)",
NULL,
"Use official BIOS when available. Core needs to be restarted for changes to apply.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -83,7 +96,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_forceRTCenable",
"Force-Enable RTC",
NULL,
"Forces the internal real-time clock to be enabled regardless of rom. Usuable for rom patches that requires clock to be enabled (aka Pokemon).",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -91,10 +107,124 @@ struct retro_core_option_definition option_defs_us[] = {
},
"disabled"
},
{
"vbam_gbHardware",
"(GB) Emulated Hardware (Needs Restart)",
NULL,
"Sets the Game Boy hardware type to emulate. Restart core to apply.",
NULL,
"system",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Enable Colorizer Hack (Needs Restart)",
NULL,
"Allows Colorizer hacked GB games (e.g. DX patched games) to normally run in GBC/GBA hardware type. This also disables the use of bios file. NOT RECOMMENDED for use on non-colorized games.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_palettes",
"(GB) Color Palette",
NULL,
"Set Game Boy palettes to use.",
NULL,
"video",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_showborders",
"(GB) Show Borders",
NULL,
"When enabled, if loaded content is SGB compatible, this will show the border from the game if available.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Color Correction",
NULL,
"Applies color correction which fixes colors in some games.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_lcdfilter",
"LCD Color Filter",
NULL,
"Darkens the onscreen colors by applying a screen filter.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_interframeblending",
"Interframe Blending",
NULL,
"Simulates LCD ghosting effects. 'Smart' attempts to detect screen flickering, and only performs a 50:50 mix on affected pixels, while 'Motion Blur' mimics natural LCD response times by combining multiple buffered frames. 'Smart' blending is required when playing games that aggressively exploit LCD ghosting for transparency effects (Wave Race, Chikyuu Kaihou Gun ZAS, F-Zero, the Boktai series...).",
NULL,
"video",
{
{ "disabled", NULL },
{ "smart", "Smart" },
{ "motion blur", "Motion Blur" },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_soundinterpolation",
"Sound Interpolation",
NULL,
"Enable or disable sound filtering.",
NULL,
"audio",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -105,7 +235,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_soundfiltering",
"Sound Filtering",
NULL,
"Sets the amount of filtering to use. Higher value reduces higher frequencies.",
NULL,
"audio",
{
{ "0", NULL },
{ "1", NULL },
@ -122,100 +255,13 @@ struct retro_core_option_definition option_defs_us[] = {
},
"5"
},
{
"vbam_palettes",
"(GB) Color Palette",
"Set Game Boy palettes to use.",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_gbHardware",
"(GB) Emulated Hardware (Needs Restart)",
"Sets the Game Boy hardware type to emulate. Restart core to apply.",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Enable Colorizer Hack (Needs Restart)",
"Allows Colorizer hacked GB games (e.g. DX patched games) to normally run in GBC/GBA hardware type. This also disables the use of bios file. NOT RECOMMENDED for use on non-colorized games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_showborders",
"(GB) Show Borders",
"When enabled, if loaded content is SGB compatible, this will show the border from the game if available.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Color Correction",
"Applies color correction which fixes colors in some games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_lcdfilter",
"LCD Color Filter",
"Darkens the onscreen colors by applying a screen filter.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_interframeblending",
"Interframe Blending",
"Simulates LCD ghosting effects. 'Smart' attempts to detect screen flickering, and only performs a 50:50 mix on affected pixels, while 'Motion Blur' mimics natural LCD response times by combining multiple buffered frames. 'Smart' blending is required when playing games that aggressively exploit LCD ghosting for transparency effects (Wave Race, Chikyuu Kaihou Gun ZAS, F-Zero, the Boktai series...).",
{
{ "disabled", NULL },
{ "smart", "Smart" },
{ "motion blur", "Motion Blur" },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_turboenable",
"Enable Turbo Buttons",
NULL,
"Enable or disable gamepad turbo buttons.",
NULL,
"input",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -226,7 +272,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_turbodelay",
"Turbo Delay (in frames)",
NULL,
"Repeat rate of turbo triggers in frames. Higher value triggers more.",
NULL,
"input",
{
{ "1", NULL },
{ "2", NULL },
@ -247,10 +296,36 @@ struct retro_core_option_definition option_defs_us[] = {
},
"3"
},
{
"vbam_solarsensor",
"Solar Sensor Level",
NULL,
"Adjusts simulated solar level in Boktai games. L2/R2 buttons can also be used to quickly change levels.",
NULL,
"input",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
{
"vbam_astick_deadzone",
"Sensors Deadzone (%)",
NULL,
"Set deadzone (in percent) of analog sticks.",
NULL,
"input",
{
{ "0", NULL },
{ "5", NULL },
@ -266,7 +341,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_gyro_sensitivity",
"Sensor Sensitivity (Gyroscope) (%)",
NULL,
"Default bind is left analog. Used to adjust sensitivity level for gyro-enabled games.",
NULL,
"input",
{
{ "10", NULL },
{ "15", NULL },
@ -298,7 +376,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_tilt_sensitivity",
"Sensor Sensitivity (Tilt) (%)",
NULL,
"Default bind is right analog. Used to adjust sensitivity level for gyro-enabled games.",
NULL,
"input",
{
{ "10", NULL },
{ "15", NULL },
@ -330,18 +411,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_swap_astick",
"Swap Left/Right Analog",
NULL,
"Swaps left and right analog stick function for gyro and tilt.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_show_advanced_options",
"Show Advanced Options",
"Show advanced options which can enable or disable sound channels and graphics layers.",
NULL,
"input",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -352,7 +425,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_1",
"Sound Channel 1",
NULL,
"Enables or disables tone & sweep sound channel.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -363,7 +439,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_2",
"Sound Channel 2",
NULL,
"Enables or disables tone sound channel.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -374,7 +453,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_3",
"Sound Channel 3",
NULL,
"Enables or disables wave output sound channel.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -385,7 +467,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_4",
"Sound Channel 4",
NULL,
"Enables or disables noise audio channel.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -396,7 +481,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_5",
"Sound DMA Channel A",
NULL,
"Enables or disables DMA sound channel A.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -407,7 +495,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_sound_6",
"Sound DMA Channel B",
NULL,
"Enables or disables DMA sound channel B.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -418,7 +509,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_1",
"Show Background Layer 1",
NULL,
"Shows or hides background layer 1.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -429,7 +523,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_2",
"Show Background Layer 2",
NULL,
"Shows or hides background layer 2.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -440,7 +537,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_3",
"Show Background Layer 3",
NULL,
"Shows or hides background layer 3.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -451,7 +551,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_4",
"Show Background Layer 4",
NULL,
"Shows or hides background layer 4.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -462,7 +565,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_5",
"Show Sprite Layer",
NULL,
"Shows or hides sprite layer.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -473,7 +579,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_6",
"Show Window Layer 1",
NULL,
"Shows or hides window layer 1.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -484,7 +593,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_7",
"Show Window Layer 2",
NULL,
"Shows or hides window layer 2.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -495,7 +607,10 @@ struct retro_core_option_definition option_defs_us[] = {
{
"vbam_layer_8",
"Show Sprite Window Layer",
NULL,
"Shows or hides sprite window layer.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -503,8 +618,12 @@ struct retro_core_option_definition option_defs_us[] = {
},
"enabled"
},
{ NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
};
{ NULL, NULL, NULL, {{0}}, NULL }
struct retro_core_options_v2 options_us = {
option_cats_us,
option_defs_us
};
/*
@ -514,8 +633,8 @@ struct retro_core_option_definition option_defs_us[] = {
*/
#ifndef HAVE_NO_LANGEXTRA
struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
&options_us, /* RETRO_LANGUAGE_ENGLISH */
NULL, /* RETRO_LANGUAGE_JAPANESE */
NULL, /* RETRO_LANGUAGE_FRENCH */
NULL, /* RETRO_LANGUAGE_SPANISH */
@ -533,7 +652,7 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
NULL, /* RETRO_LANGUAGE_VIETNAMESE */
NULL, /* RETRO_LANGUAGE_ARABIC */
NULL, /* RETRO_LANGUAGE_GREEK */
option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
&options_tr, /* RETRO_LANGUAGE_TURKISH */
};
#endif
@ -551,39 +670,61 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
* be as painless as possible for core devs)
*/
static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
bool *categories_supported)
{
unsigned version = 0;
unsigned version = 0;
#ifndef HAVE_NO_LANGEXTRA
unsigned language = 0;
#endif
if (!environ_cb)
if (!environ_cb || !categories_supported)
return;
if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
*categories_supported = false;
if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
version = 0;
if (version >= 2)
{
#ifndef HAVE_NO_LANGEXTRA
struct retro_core_options_intl core_options_intl;
unsigned language = 0;
struct retro_core_options_v2_intl core_options_intl;
core_options_intl.us = option_defs_us;
core_options_intl.us = &options_us;
core_options_intl.local = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
(language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
core_options_intl.local = option_defs_intl[language];
core_options_intl.local = options_intl[language];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
*categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
&core_options_intl);
#else
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
*categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
&options_us);
#endif
}
else
{
size_t i;
size_t i, j;
size_t option_index = 0;
size_t num_options = 0;
struct retro_core_option_definition
*option_v1_defs_us = NULL;
#ifndef HAVE_NO_LANGEXTRA
size_t num_options_intl = 0;
struct retro_core_option_v2_definition
*option_defs_intl = NULL;
struct retro_core_option_definition
*option_v1_defs_intl = NULL;
struct retro_core_options_intl
core_options_v1_intl;
#endif
struct retro_variable *variables = NULL;
char **values_buf = NULL;
/* Determine number of options */
/* Determine total number of options */
while (true)
{
if (option_defs_us[num_options].key)
@ -592,86 +733,187 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
break;
}
/* Allocate arrays */
variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
values_buf = (char **)calloc(num_options, sizeof(char *));
if (!variables || !values_buf)
goto error;
/* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
if (version >= 1)
{
const char *key = option_defs_us[i].key;
const char *desc = option_defs_us[i].desc;
const char *default_value = option_defs_us[i].default_value;
struct retro_core_option_value *values = option_defs_us[i].values;
size_t buf_len = 3;
size_t default_index = 0;
/* Allocate US array */
option_v1_defs_us = (struct retro_core_option_definition *)
calloc(num_options + 1, sizeof(struct retro_core_option_definition));
values_buf[i] = NULL;
if (desc)
/* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
{
size_t num_values = 0;
struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
struct retro_core_option_value *option_values = option_def_us->values;
struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
/* Determine number of values */
option_v1_def_us->key = option_def_us->key;
option_v1_def_us->desc = option_def_us->desc;
option_v1_def_us->info = option_def_us->info;
option_v1_def_us->default_value = option_def_us->default_value;
/* Values must be copied individually... */
while (option_values->value)
{
option_v1_values->value = option_values->value;
option_v1_values->label = option_values->label;
option_values++;
option_v1_values++;
}
}
#ifndef HAVE_NO_LANGEXTRA
if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
(language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
options_intl[language])
option_defs_intl = options_intl[language]->definitions;
if (option_defs_intl)
{
/* Determine number of intl options */
while (true)
{
if (values[num_values].value)
{
/* Check if this is the default value */
if (default_value)
if (strcmp(values[num_values].value, default_value) == 0)
default_index = num_values;
buf_len += strlen(values[num_values].value);
num_values++;
}
if (option_defs_intl[num_options_intl].key)
num_options_intl++;
else
break;
}
/* Build values string */
if (num_values > 0)
/* Allocate intl array */
option_v1_defs_intl = (struct retro_core_option_definition *)
calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
/* Copy parameters from option_defs_intl array */
for (i = 0; i < num_options_intl; i++)
{
size_t j;
struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
struct retro_core_option_value *option_values = option_def_intl->values;
struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
buf_len += num_values - 1;
buf_len += strlen(desc);
option_v1_def_intl->key = option_def_intl->key;
option_v1_def_intl->desc = option_def_intl->desc;
option_v1_def_intl->info = option_def_intl->info;
option_v1_def_intl->default_value = option_def_intl->default_value;
values_buf[i] = (char *)calloc(buf_len, sizeof(char));
if (!values_buf[i])
goto error;
strcpy(values_buf[i], desc);
strcat(values_buf[i], "; ");
/* Default value goes first */
strcat(values_buf[i], values[default_index].value);
/* Add remaining values */
for (j = 0; j < num_values; j++)
/* Values must be copied individually... */
while (option_values->value)
{
if (j != default_index)
{
strcat(values_buf[i], "|");
strcat(values_buf[i], values[j].value);
}
option_v1_values->value = option_values->value;
option_v1_values->label = option_values->label;
option_values++;
option_v1_values++;
}
}
}
variables[i].key = key;
variables[i].value = values_buf[i];
core_options_v1_intl.us = option_v1_defs_us;
core_options_v1_intl.local = option_v1_defs_intl;
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
#else
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
#endif
}
else
{
/* Allocate arrays */
variables = (struct retro_variable *)calloc(num_options + 1,
sizeof(struct retro_variable));
values_buf = (char **)calloc(num_options, sizeof(char *));
if (!variables || !values_buf)
goto error;
/* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
{
const char *key = option_defs_us[i].key;
const char *desc = option_defs_us[i].desc;
const char *default_value = option_defs_us[i].default_value;
struct retro_core_option_value *values = option_defs_us[i].values;
size_t buf_len = 3;
size_t default_index = 0;
values_buf[i] = NULL;
if (desc)
{
size_t num_values = 0;
/* Determine number of values */
while (true)
{
if (values[num_values].value)
{
/* Check if this is the default value */
if (default_value)
if (strcmp(values[num_values].value, default_value) == 0)
default_index = num_values;
buf_len += strlen(values[num_values].value);
num_values++;
}
else
break;
}
/* Build values string */
if (num_values > 0)
{
buf_len += num_values - 1;
buf_len += strlen(desc);
values_buf[i] = (char *)calloc(buf_len, sizeof(char));
if (!values_buf[i])
goto error;
strcpy(values_buf[i], desc);
strcat(values_buf[i], "; ");
/* Default value goes first */
strcat(values_buf[i], values[default_index].value);
/* Add remaining values */
for (j = 0; j < num_values; j++)
{
if (j != default_index)
{
strcat(values_buf[i], "|");
strcat(values_buf[i], values[j].value);
}
}
}
}
variables[option_index].key = key;
variables[option_index].value = values_buf[i];
option_index++;
}
/* Set variables */
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
}
/* Set variables */
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
error:
/* Clean up */
if (option_v1_defs_us)
{
free(option_v1_defs_us);
option_v1_defs_us = NULL;
}
#ifndef HAVE_NO_LANGEXTRA
if (option_v1_defs_intl)
{
free(option_v1_defs_intl);
option_v1_defs_intl = NULL;
}
#endif
if (values_buf)
{
for (i = 0; i < num_options; i++)

View File

@ -73,31 +73,43 @@ extern "C" {
/* RETRO_LANGUAGE_TURKISH */
struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_solarsensor",
"Solar Sensör Seviyesi",
"Boktai oyunlarında simüle güneş seviyesini ayarlar. L2 / R2 düğmeleri ayrıca seviyeleri hızlıca değiştirmek için de kullanılabilir.",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
struct retro_core_option_v2_category option_cats_tr[] = {
{
"system",
NULL,
NULL,
},
{
"video",
NULL,
NULL,
},
{
"audio",
NULL,
NULL,
},
{
"input",
NULL,
NULL,
},
{
"advanced",
NULL,
NULL,
},
{ NULL, NULL, NULL },
};
struct retro_core_option_v2_definition option_defs_tr[] = {
{
"vbam_usebios",
"Resmi BIOS'u kullanın (Varsa)",
NULL,
"Mümkün olduğunda resmi BIOS kullanın. Değişikliklerin uygulanabilmesi için çekirdeğin yeniden başlatılması gerekiyor.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -108,7 +120,92 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_forceRTCenable",
"RTC'yi Etkinleştir",
NULL,
"RAM'den bağımsız olarak dahili gerçek zamanlı saati etkinleştirmeye zorlar. Saatin etkinleştirilmesini gerektiren rom yamalar için kullanılabilir (Pokemon gibi).",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbHardware",
"(GB) Öykünülmüş Donanım (Yeniden Başlatılması Gerekiyor)",
NULL,
"Game Boy donanım tipini taklit edecek şekilde ayarlar. Uygulamak için çekirdeği yeniden başlatın.",
NULL,
"system",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Colorizer Hack'i Etkinleştir (Yeniden Başlatılması Gerekiyor)",
NULL,
"Colorizer'ın saldırıya uğramış GB oyunlarının (örn. DX yamalı oyunlar) normalde GBC / GBA donanım türünde çalışmasına izin verir. Bu ayrıca bios dosyasının kullanımını da devre dışı bırakır. Renklendirilmemiş oyunlarda kullanılması tavsiye edilmez.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_palettes",
"(GB) Renk Paleti",
NULL,
"Game Boy paletlerini kullanmak için ayarlayın.",
NULL,
"video",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_showborders",
"(GB) Sınırları Göster",
NULL,
"Etkinleştirildiğinde, yüklü içerik SGB uyumluysa, bu durum oyundaki sınırı gösterir.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Renk Düzeltme",
NULL,
"Bazı oyunlarda renkleri düzelten renk düzeltmesini uygular.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -119,7 +216,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_soundinterpolation",
"Ses Enterpolasyonu",
NULL,
"Ses filtresini etkinleştirin veya devre dışı bırakın.",
NULL,
"audio",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -130,7 +230,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_soundfiltering",
"Ses Filtreleme",
NULL,
"Kullanılacak filtreleme miktarını ayarlar. Yüksek değer, yüksek frekansları azaltır.",
NULL,
"audio",
{
{ "0", NULL },
{ "1", NULL },
@ -147,77 +250,13 @@ struct retro_core_option_definition option_defs_tr[] = {
},
"5"
},
{
"vbam_palettes",
"(GB) Renk Paleti",
"Game Boy paletlerini kullanmak için ayarlayın.",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_gbHardware",
"(GB) Öykünülmüş Donanım (Yeniden Başlatılması Gerekiyor)",
"Game Boy donanım tipini taklit edecek şekilde ayarlar. Uygulamak için çekirdeği yeniden başlatın.",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Colorizer Hack'i Etkinleştir (Yeniden Başlatılması Gerekiyor)",
"Colorizer'ın saldırıya uğramış GB oyunlarının (örn. DX yamalı oyunlar) normalde GBC / GBA donanım türünde çalışmasına izin verir. Bu ayrıca bios dosyasının kullanımını da devre dışı bırakır. Renklendirilmemiş oyunlarda kullanılması tavsiye edilmez.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_showborders",
"(GB) Sınırları Göster",
"Etkinleştirildiğinde, yüklü içerik SGB uyumluysa, bu durum oyundaki sınırı gösterir.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Renk Düzeltme",
"Bazı oyunlarda renkleri düzelten renk düzeltmesini uygular.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_turboenable",
"Turbo Düğmelerini Etkinleştir",
NULL,
"Gamepad turbo düğmelerini etkinleştirin veya devre dışı bırakın.",
NULL,
"input",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -228,7 +267,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_turbodelay",
"Turbo Gecikme (kare cinsinden)",
NULL,
"Karelerde turbo tetikleyicilerin oranını tekrarlayın. Daha yüksek değer daha fazla tetikler.",
NULL,
"input",
{
{ "1", NULL },
{ "2", NULL },
@ -249,10 +291,36 @@ struct retro_core_option_definition option_defs_tr[] = {
},
"3"
},
{
"vbam_solarsensor",
"Solar Sensör Seviyesi",
NULL,
"Boktai oyunlarında simüle güneş seviyesini ayarlar. L2 / R2 düğmeleri ayrıca seviyeleri hızlıca değiştirmek için de kullanılabilir.",
NULL,
"input",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
{
"vbam_astick_deadzone",
"Sensörlerin Ölü Bölgesi (%)",
NULL,
"Analog çubukların ölü bölgesini (yüzde olarak) ayarlayın.",
NULL,
"input",
{
{ "0", NULL },
{ "5", NULL },
@ -268,7 +336,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_gyro_sensitivity",
"Sensör Hassasiyeti (Jiroskop) (%)",
NULL,
"Varsayılan konumlandırma, sol analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.",
NULL,
"input",
{
{ "10", NULL },
{ "15", NULL },
@ -300,7 +371,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_tilt_sensitivity",
"Sensör Hassasiyeti (Eğim) (%)",
NULL,
"Varsayılan konumlandırma sağ analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.",
NULL,
"input",
{
{ "10", NULL },
{ "15", NULL },
@ -332,18 +406,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_swap_astick",
"Sol / Sağ Analog Değiştirme",
NULL,
"Döndürme ve eğme için sola ve sağa analog çubuk işlevini değiştirir.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_show_advanced_options",
"Gelişmiş Ayarları Göster",
"Ses kanallarını ve grafik katmanlarını etkinleştirebilen veya devre dışı bırakabilen gelişmiş seçenekleri gösterin.",
NULL,
"input",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -354,7 +420,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_1",
"Ses Kanalı 1",
NULL,
"Tonlu ve tarama ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -365,7 +434,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_2",
"Ses Kanalı 2",
NULL,
"Tonlu ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -376,7 +448,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_3",
"Ses Kanalı 3",
NULL,
"Dalga çıkışı ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -387,7 +462,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_4",
"Ses Kanalı 4",
NULL,
"Gürültü ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -398,7 +476,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_5",
"DMA Ses Kanalı A",
NULL,
"DMA ses kanalı A'yı etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -409,7 +490,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_sound_6",
"DMA Ses Kanalı B",
NULL,
"DMA ses kanalı B'yi etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -420,7 +504,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_1",
"Arka Plan Katmanını Göster 1",
NULL,
"1. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -431,7 +518,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_2",
"Arka Plan Katmanını Göster 2",
NULL,
"2. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -442,7 +532,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_3",
"Arka Plan Katmanını Göster 3",
NULL,
"3. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -453,7 +546,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_4",
"Arka Plan Katmanını Göster 4",
NULL,
"4. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -464,7 +560,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_5",
"Sprite Katmanını Göster",
NULL,
"Sprite katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -475,7 +574,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_6",
"Pencere Katmanını Göster 1",
NULL,
"Pencere katmanı 1'i gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -486,7 +588,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_7",
"Pencere Katmanını Göster 2",
NULL,
"Pencere katmanı 2'yi gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -497,7 +602,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{
"vbam_layer_8",
"Sprite Pencere Katmanını Göster",
NULL,
"Sprite pencere katmanını gösterir veya gizler.",
NULL,
"advanced",
{
{ "disabled", NULL },
{ "enabled", NULL },
@ -505,8 +613,12 @@ struct retro_core_option_definition option_defs_tr[] = {
},
"enabled"
},
{ NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
};
{ NULL, NULL, NULL, {{0}}, NULL }
struct retro_core_options_v2 options_tr = {
option_cats_tr,
option_defs_tr
};
#ifdef __cplusplus