Merge pull request #101 from ds22x/master

Update to core options v2 interface & hide some options in various cases
This commit is contained in:
LibretroAdmin 2022-09-26 16:39:34 +02:00 committed by GitHub
commit fbd368c810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2758 additions and 66 deletions

View File

@ -19,6 +19,7 @@
#include "common.h"
#include "path.h"
#include "libretro_core_options.h"
#include "streams/file_stream.h"
#ifdef HAVE_OPENGL
@ -1376,63 +1377,8 @@ void retro_set_environment(retro_environment_t cb)
struct retro_vfs_interface_info vfs_iface_info;
environ_cb = cb;
static const retro_variable values[] =
{
{ "desmume_firmware_language", "Firmware Language; Auto|English|Japanese|French|German|Italian|Spanish" },
{ "desmume_use_external_bios", "Use External BIOS/Firmware (restart); disabled|enabled" },
{ "desmume_boot_into_bios", "Boot Into BIOS (interpreter and external bios only); disabled|enabled"},
{ "desmume_load_to_memory", "Load Game Into Memory (restart); disabled|enabled" },
{ "desmume_num_cores", "CPU Cores; 1|2|3|4" },
#ifdef HAVE_JIT
#if defined(IOS) || defined(ANDROID)
{ "desmume_cpu_mode", "CPU Mode; interpreter|jit" },
#else
{ "desmume_cpu_mode", "CPU Mode (restart); jit|interpreter" },
#endif
{ "desmume_jit_block_size", "JIT Block Size; 12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|0|1|2|3|4|5|6|7|8|9|10|11" },
#else
{ "desmume_cpu_mode", "CPU Mode; interpreter" },
#endif
{ "desmume_advanced_timing", "Enable Advanced Bus-Level Timing; enabled|disabled" },
{ "desmume_frameskip", "Frameskip; 0|1|2|3|4|5|6|7|8|9" },
{ "desmume_internal_resolution", "Internal Resolution; 256x192|512x384|768x576|1024x768|1280x960|1536x1152|1792x1344|2048x1536|2304x1728|2560x1920" },
#ifdef HAVE_OPENGL
{ "desmume_opengl_mode", "OpenGL Rasterizer (restart); disabled|enabled" },
{ "desmume_color_depth", "OpenGL: Color Depth (restart); 16-bit|32-bit"},
{ "desmume_gfx_multisampling", "OpenGL: Multisampling AA; disabled|2|4|8|16|32" },
{ "desmume_gfx_texture_smoothing", "OpenGL: Texture Smoothing; disabled|enabled" },
{ "desmume_opengl_shadow_polygon", "OpenGL: Shadow Polygons; enabled|disabled" },
{ "desmume_opengl_special_zero_alpha", "OpenGL: Special 0 Alpha; enabled|disabled" },
{ "desmume_opengl_nds_depth_calculation", "OpenGL: NDS Depth Calculation; enabled|disabled" },
{ "desmume_opengl_depth_lequal_polygon_facing", "OpenGL: Depth-LEqual Polygon Facing; disabled|enabled" },
#endif
{ "desmume_gfx_highres_interpolate_color", "Soft3D: High-res Color Interpolation; disabled|enabled" },
{ "desmume_gfx_linehack", "Soft3D: Line Hack; enabled|disabled" },
{ "desmume_gfx_txthack", "Soft3D: Texture Hack; disabled|enabled"},
{ "desmume_gfx_edgemark", "Edge Marking; enabled|disabled" },
{ "desmume_gfx_texture_scaling", "Texture Scaling (xBrz); 1|2|4" },
{ "desmume_gfx_texture_deposterize", "Texture Deposterization; disabled|enabled" },
{ "desmume_screens_layout", "Screen Layout; top/bottom|bottom/top|left/right|right/left|top only|bottom only|hybrid/top|hybrid/bottom" },
{ "desmume_screens_gap", "Screen Gap; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100" },
{ "desmume_hybrid_layout_ratio", "Hybrid Layout: Ratio; 3:1|2:1" },
{ "desmume_hybrid_layout_scale", "Hybrid Layout: Scale So Small Screen is 1:1px; disabled|enabled" },
{ "desmume_hybrid_showboth_screens", "Hybrid Layout: Show Both Screens; enabled|disabled"},
{ "desmume_hybrid_cursor_always_smallscreen", "Hybrid Layout: Cursor Always on Small Screen; enabled|disabled"},
{ "desmume_pointer_mouse", "Mouse/Pointer; enabled|disabled" },
{ "desmume_pointer_type", "Pointer Type; mouse|touch" },
{ "desmume_mouse_speed", "Mouse Speed; 1.0|1.5|2.0|0.01|0.02|0.03|0.04|0.05|0.125|0.25|0.5" },
{ "desmume_input_rotation", "Pointer Rotation; 0|90|180|270" },
{ "desmume_pointer_device_l", "Pointer Mode for Left Analog; none|emulated|absolute|pressed" },
{ "desmume_pointer_device_r", "Pointer Mode for Right Analog; none|emulated|absolute|pressed" },
{ "desmume_pointer_device_deadzone", "Emulated Pointer Deadzone Percent; 15|20|25|30|35|0|5|10" },
{ "desmume_pointer_device_acceleration_mod", "Emulated Pointer Acceleration Modifier Percent; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100" },
{ "desmume_pointer_stylus_pressure", "Emulated Stylus Pressure Modifier Percent; 50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|" },
{ "desmume_pointer_colour", "Pointer Colour; white|black|red|blue|yellow"},
{ "desmume_mic_mode", "Microphone Button Noise Type; pattern|random" },
{ 0, 0 }
};
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)values);
bool categoriesSupported;
libretro_set_core_options(environ_cb, &categoriesSupported);
vfs_iface_info.required_interface_version = FILESTREAM_REQUIRED_VFS_VERSION;
vfs_iface_info.iface = NULL;
@ -2400,6 +2346,13 @@ bool retro_load_game(const struct retro_game_info *game)
if (!game)
return false;
#ifndef HAVE_JIT
struct retro_core_option_display option_display;
option_display.visible = false;
option_display.key = "desmume_cpu_mode";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
#endif
#ifdef HAVE_OPENGL
if (opengl_mode)
{
@ -2438,6 +2391,26 @@ bool retro_load_game(const struct retro_game_info *game)
GPU->SetColorFormat(NDSColorFormat_BGR555_Rev);
}
}
else
{
struct retro_core_option_display option_display;
option_display.visible = false;
option_display.key = "desmume_color_depth";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_gfx_multisampling";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_gfx_texture_smoothing";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_opengl_shadow_polygon";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_opengl_special_zero_alpha";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_opengl_nds_depth_calculation";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = "desmume_opengl_depth_lequal_polygon_facing";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
}
#endif
struct retro_input_descriptor desc[] = {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
#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 */
#ifdef __cplusplus
}
#endif
#endif

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).