Merge pull request #104 from jdgleaver/options-update

Update 'libretro_core_options.h' to v1.3 format
This commit is contained in:
Twinaphex 2019-08-14 16:19:59 +02:00 committed by GitHub
commit bfcf27398c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 264 additions and 218 deletions

View File

@ -1117,7 +1117,7 @@ enum retro_mod
* This may be still be done regardless of the core options
* interface version.
*
* If version is 1 however, core options may instead be set by
* If version is >= 1 however, core options may instead be set by
* passing an array of retro_core_option_definition structs to
* RETRO_ENVIRONMENT_SET_CORE_OPTIONS, or a 2D array of
* retro_core_option_definition structs to RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.
@ -1132,8 +1132,8 @@ enum retro_mod
* GET_VARIABLE.
* This allows the frontend to present these variables to
* a user dynamically.
* This should only be called if RETRO_ENVIRONMENT_GET_ENHANCED_CORE_OPTIONS
* returns an API version of 1.
* This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
* returns an API version of >= 1.
* This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES.
* This should be called the first time as early as
* possible (ideally in retro_set_environment).
@ -1169,8 +1169,6 @@ enum retro_mod
* i.e. it should be feasible to cycle through options
* without a keyboard.
*
* First entry should be treated as a default.
*
* Example entry:
* {
* "foo_option",
@ -1196,8 +1194,8 @@ enum retro_mod
* GET_VARIABLE.
* This allows the frontend to present these variables to
* a user dynamically.
* This should only be called if RETRO_ENVIRONMENT_GET_ENHANCED_CORE_OPTIONS
* returns an API version of 1.
* This should only be called if RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
* returns an API version of >= 1.
* This should be called instead of RETRO_ENVIRONMENT_SET_VARIABLES.
* This should be called the first time as early as
* possible (ideally in retro_set_environment).
@ -2504,8 +2502,20 @@ struct retro_core_option_display
};
/* Maximum number of values permitted for a core option
* NOTE: This may be increased on a core-by-core basis
* if required (doing so has no effect on the frontend) */
* > Note: We have to set a maximum value due the limitations
* of the C language - i.e. it is not possible to create an
* array of structs each containing a variable sized array,
* so the retro_core_option_definition values array must
* have a fixed size. The size limit of 128 is a balancing
* act - it needs to be large enough to support all 'sane'
* core options, but setting it too large may impact low memory
* platforms. In practise, if a core option has more than
* 128 values then the implementation is likely flawed.
* To quote the above API reference:
* "The number of possible options should be very limited
* i.e. it should be feasible to cycle through options
* without a keyboard."
*/
#define RETRO_NUM_CORE_OPTION_VALUES_MAX 128
struct retro_core_option_value

View File

@ -7,6 +7,28 @@
#include <libretro.h>
#include <retro_inline.h>
#ifndef HAVE_NO_LANGEXTRA
#include "libretro_core_options_intl.h"
#endif
/*
********************************
* VERSION: 1.3
********************************
*
* - 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
* - Added HAVE_NO_LANGEXTRA flag to disable translations
* on platforms/compilers without BOM support
* - 1.2: Use core options v1 interface when
* RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
* (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
* - 1.1: Support generation of core options v0 retro_core_option_value
* arrays containing options with a single value
* - 1.0: First commit
*/
#ifdef __cplusplus
extern "C" {
#endif
@ -78,11 +100,11 @@ struct retro_core_option_definition option_defs_us[] = {
"Region",
"Force a specific region.",
{
{ "Auto", NULL },
{ "Auto", NULL },
{ "Japan NTSC", NULL },
{ "Japan PAL", NULL },
{ "US", NULL },
{ "Europe", NULL },
{ "Japan PAL", NULL },
{ "US", NULL },
{ "Europe", NULL },
{ NULL, NULL },
},
"Auto"
@ -104,8 +126,8 @@ struct retro_core_option_definition option_defs_us[] = {
"Show Overscan",
"Crop out the potentially random glitchy video output that would have been hidden by the bezel around the edge of a standard-definition television screen.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
@ -116,12 +138,12 @@ struct retro_core_option_definition option_defs_us[] = {
"Overclock the emulated 68K chip.",
{
{ "disabled", NULL },
{ "+25%", NULL },
{ "+50%", NULL },
{ "+75%", NULL },
{ "+100%", NULL },
{ "+200%", NULL },
{ "+400%", NULL },
{ "+25%", NULL },
{ "+50%", NULL },
{ "+75%", NULL },
{ "+100%", NULL },
{ "+200%", NULL },
{ "+400%", NULL },
{ NULL, NULL },
},
"disabled"
@ -132,7 +154,7 @@ struct retro_core_option_definition option_defs_us[] = {
"Dynamic recompilers",
"Enable dynamic recompilers which help to improve performance. Less accurate than interpreter CPU cores, but much faster.",
{
{ "enabled", NULL },
{ "enabled", NULL },
{ "disabled", NULL },
{ NULL, NULL },
},
@ -145,7 +167,7 @@ struct retro_core_option_definition option_defs_us[] = {
"Enable a low pass audio filter to better simulate the characteristic sound of a Model 1 Genesis. This option is ignored when running Master System and PICO titles. Only the Genesis and its add-on hardware (Sega CD, 32X) employed a physical low pass filter.",
{
{ "disabled", NULL },
{ "low-pass", NULL },
{ "low-pass", NULL },
{ NULL, NULL },
},
"disabled"
@ -181,203 +203,13 @@ struct retro_core_option_definition option_defs_us[] = {
{ NULL, NULL, NULL, {{0}}, NULL },
};
/* RETRO_LANGUAGE_JAPANESE */
/* RETRO_LANGUAGE_FRENCH */
/* RETRO_LANGUAGE_SPANISH */
/* RETRO_LANGUAGE_GERMAN */
/* RETRO_LANGUAGE_ITALIAN */
/* RETRO_LANGUAGE_DUTCH */
/* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
/* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
/* RETRO_LANGUAGE_RUSSIAN */
/* RETRO_LANGUAGE_KOREAN */
/* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
/* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
/* RETRO_LANGUAGE_ESPERANTO */
/* RETRO_LANGUAGE_POLISH */
/* RETRO_LANGUAGE_VIETNAMESE */
/* RETRO_LANGUAGE_ARABIC */
/* RETRO_LANGUAGE_GREEK */
/* RETRO_LANGUAGE_TURKISH */
struct retro_core_option_definition option_defs_tr[] = {
{
"picodrive_input1",
"Giriş cihazı 1",
"Hangi tür kontrolör'ün yuva 1'e takılı olduğunu seçin.",
{
{ "3 button pad", NULL },
{ "6 button pad", NULL },
{ "None", "hiçbiri" },
{ NULL, NULL },
},
"3 button pad"
},
{
"picodrive_input2",
"Giriş cihazı 2",
"Hangi tür kontrolör'ün yuva 2'e takılı olduğunu seçin",
{
{ "3 button pad", NULL },
{ "6 button pad", NULL },
{ "None", "hiçbiri" },
{ NULL, NULL },
},
"3 button pad"
},
{
"picodrive_sprlim",
"Sprite sınırı yok",
"Sprite sınırını kaldırmak için bunu etkinleştirin.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_ramcart",
"Sega CD RAM Kartuşu",
"Oyun verilerini kaydetmek için kullanılan bir MegaCD RAM kartuşunu taklit edin.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_region",
"Bölge",
"Belirli bir bölgeye zorlayın.",
{
{ "Auto", "Otomatik" },
{ "Japan NTSC", "Japonya NTSC" },
{ "Japan PAL", "Japonya PAL" },
{ "US", NULL },
{ "Europe", "Avrupa" },
{ NULL, NULL },
},
"Auto"
},
{
"picodrive_aspect",
"Core tarafından belirlenen en boy oranı",
"Core tarafından sağlanan en boy oranını seçin. RetroArch'ın en boy oranı, Video ayarlarında sağlanan Core olarak ayarlanmalıdır.",
{
{ "PAR", NULL },
{ "4/3", NULL },
{ "CRT", NULL },
{ NULL, NULL },
},
"PAR"
},
{
"picodrive_overscan",
"Tarama Taşmasını Göster",
"Standart tanımlı bir televizyon ekranının kenar çevresinde, çerçeve tarafından gizlenmiş olabilecek rastgele video çıkışını kesin.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_overclk68k",
"68K Hızaşırtma",
"Öykünülmüş 68K yongasına Hızaşırtma uygulayın.",
{
{ "disabled", NULL },
{ "+25%", NULL },
{ "+50%", NULL },
{ "+75%", NULL },
{ "+100%", NULL },
{ "+200%", NULL },
{ "+400%", NULL },
{ NULL, NULL },
},
"disabled"
},
#ifdef DRC_SH2
{
"picodrive_drc",
"Dinamik Yeniden Derleyici",
"Performansı artırmaya yardımcı olan dinamik yeniden derleyicileri etkinleştirin. Tercüman CPU çekirdeğinden daha az hassas, ancak çok daha hızlıdır.",
{
{ "enabled", NULL },
{ "disabled", NULL },
{ NULL, NULL },
},
"enabled"
},
#endif
{
"picodrive_audio_filter",
"Ses Filtresi",
"Model 1 Genesis'in karakteristik sesini daha iyi simüle etmek için düşük geçişli bir ses filtresini etkinleştirin. Master System ve PICO başlıkları kullanılırken bu seçenek yoksayılır. Sadece Genesis ve eklenti donanımı (Sega CD, 32X) fiziksel düşük geçiş filtresi kullanır.",
{
{ "disabled", "devre dışı" },
{ "low-pass", "alçak geçiş" },
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_lowpass_range",
"Alçak geçiş filtresi %",
"Ses düşük geçiş filtresinin kesme frekansını belirtin. Daha yüksek bir değer, yüksek frekans spektrumunun daha geniş bir aralığı azaltıldığı için filtrenin algılanan gücünü arttırır.",
{
{ "5", NULL },
{ "10", NULL },
{ "15", NULL },
{ "20", NULL },
{ "25", NULL },
{ "30", NULL },
{ "35", NULL },
{ "40", NULL },
{ "45", NULL },
{ "50", NULL },
{ "55", NULL },
{ "60", NULL },
{ "65", NULL },
{ "70", NULL },
{ "75", NULL },
{ "80", NULL },
{ "85", NULL },
{ "90", NULL },
{ "95", NULL },
{ NULL, NULL },
},
"60"
},
{ NULL, NULL, NULL, {{0}}, NULL },
};
/*
********************************
* Language Mapping
********************************
*/
#ifndef HAVE_NO_LANGEXTRA
struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
NULL, /* RETRO_LANGUAGE_JAPANESE */
@ -399,6 +231,7 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
NULL, /* RETRO_LANGUAGE_GREEK */
option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
};
#endif
/*
********************************
@ -407,7 +240,8 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
*/
/* Handles configuration/setting of core options.
* Should only be called inside retro_set_environment().
* Should be called as early as possible - ideally inside
* retro_set_environment(), and no later than retro_load_game()
* > We place the function body in the header to avoid the
* necessity of adding more .c files (i.e. want this to
* be as painless as possible for core devs)
@ -420,8 +254,9 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
if (!environ_cb)
return;
if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version == 1))
if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
{
#ifndef HAVE_NO_LANGEXTRA
struct retro_core_options_intl core_options_intl;
unsigned language = 0;
@ -433,6 +268,9 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
core_options_intl.local = option_defs_intl[language];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
#else
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
#endif
}
else
{
@ -491,7 +329,7 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
}
/* Build values string */
if (num_values > 1)
if (num_values > 0)
{
size_t j;
@ -523,7 +361,7 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
variables[i].key = key;
variables[i].value = values_buf[i];
}
/* Set variables */
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);

View File

@ -0,0 +1,198 @@
#ifndef LIBRETRO_CORE_OPTIONS_INTL_H__
#define LIBRETRO_CORE_OPTIONS_INTL_H__
#if defined(_MSC_VER) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#pragma warning(disable:4566)
#endif
#include <libretro.h>
/*
********************************
* VERSION: 1.3
********************************
*
* - 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
* - Added HAVE_NO_LANGEXTRA flag to disable translations
* on platforms/compilers without BOM support
* - 1.2: Use core options v1 interface when
* RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
* (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
* - 1.1: Support generation of core options v0 retro_core_option_value
* arrays containing options with a single value
* - 1.0: First commit
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
********************************
* Core Option Definitions
********************************
*/
/* RETRO_LANGUAGE_JAPANESE */
/* RETRO_LANGUAGE_FRENCH */
/* RETRO_LANGUAGE_SPANISH */
/* RETRO_LANGUAGE_GERMAN */
/* RETRO_LANGUAGE_ITALIAN */
/* RETRO_LANGUAGE_DUTCH */
/* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
/* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
/* RETRO_LANGUAGE_RUSSIAN */
/* RETRO_LANGUAGE_KOREAN */
/* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
/* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
/* RETRO_LANGUAGE_ESPERANTO */
/* RETRO_LANGUAGE_POLISH */
/* RETRO_LANGUAGE_VIETNAMESE */
/* RETRO_LANGUAGE_ARABIC */
/* RETRO_LANGUAGE_GREEK */
/* RETRO_LANGUAGE_TURKISH */
struct retro_core_option_definition option_defs_tr[] = {
{
"picodrive_input1",
"Giriş cihazı 1",
"Hangi tür kontrolör'ün yuva 1'e takılı olduğunu seçin.",
{
{ "3 button pad", NULL },
{ "6 button pad", NULL },
{ "None", "hiçbiri" },
{ NULL, NULL },
},
"3 button pad"
},
{
"picodrive_input2",
"Giriş cihazı 2",
"Hangi tür kontrolör'ün yuva 2'e takılı olduğunu seçin",
{
{ "3 button pad", NULL },
{ "6 button pad", NULL },
{ "None", "hiçbiri" },
{ NULL, NULL },
},
"3 button pad"
},
{
"picodrive_sprlim",
"Sprite sınırı yok",
"Sprite sınırını kaldırmak için bunu etkinleştirin.",
{
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_ramcart",
"Sega CD RAM Kartuşu",
"Oyun verilerini kaydetmek için kullanılan bir MegaCD RAM kartuşunu taklit edin.",
{
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_region",
"Bölge",
"Belirli bir bölgeye zorlayın.",
{
{ "Auto", "Otomatik" },
{ "Japan NTSC", "Japonya NTSC" },
{ "Japan PAL", "Japonya PAL" },
{ "US", NULL },
{ "Europe", "Avrupa" },
{ NULL, NULL },
},
"Auto"
},
{
"picodrive_aspect",
"Core tarafından belirlenen en boy oranı",
"Core tarafından sağlanan en boy oranını seçin. RetroArch'ın en boy oranı, Video ayarlarında sağlanan Core olarak ayarlanmalıdır.",
{
{ NULL, NULL },
},
"PAR"
},
{
"picodrive_overscan",
"Tarama Taşmasını Göster",
"Standart tanımlı bir televizyon ekranının kenar çevresinde, çerçeve tarafından gizlenmiş olabilecek rastgele video çıkışını kesin.",
{
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_overclk68k",
"68K Hızaşırtma",
"Öykünülmüş 68K yongasına Hızaşırtma uygulayın.",
{
{ NULL, NULL },
},
"disabled"
},
#ifdef DRC_SH2
{
"picodrive_drc",
"Dinamik Yeniden Derleyici",
"Performansı artırmaya yardımcı olan dinamik yeniden derleyicileri etkinleştirin. Tercüman CPU çekirdeğinden daha az hassas, ancak çok daha hızlıdır.",
{
{ NULL, NULL },
},
"enabled"
},
#endif
{
"picodrive_audio_filter",
"Ses Filtresi",
"Model 1 Genesis'in karakteristik sesini daha iyi simüle etmek için düşük geçişli bir ses filtresini etkinleştirin. Master System ve PICO başlıkları kullanılırken bu seçenek yoksayılır. Sadece Genesis ve eklenti donanımı (Sega CD, 32X) fiziksel düşük geçiş filtresi kullanır.",
{
{ "disabled", "devre dışı" },
{ "low-pass", "alçak geçiş" },
{ NULL, NULL },
},
"disabled"
},
{
"picodrive_lowpass_range",
"Alçak geçiş filtresi %",
"Ses düşük geçiş filtresinin kesme frekansını belirtin. Daha yüksek bir değer, yüksek frekans spektrumunun daha geniş bir aralığı azaltıldığı için filtrenin algılanan gücünü arttırır.",
{
{ NULL, NULL },
},
"60"
},
{ NULL, NULL, NULL, {{0}}, NULL },
};
#ifdef __cplusplus
}
#endif
#endif