Skip to content

Commit c90fdd0

Browse files
committed
[librertro] Migrate to core options v2
1 parent 5e49005 commit c90fdd0

File tree

2 files changed

+478
-20
lines changed

2 files changed

+478
-20
lines changed

platforms/libretro/libretro.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <math.h>
2626
#include "libretro.h"
2727
#include "gearlynx.h"
28+
#include "libretro_core_options.h"
2829

2930
#ifdef _WIN32
3031
static const char slash = '\\';
@@ -62,6 +63,7 @@ static float current_fps = 60.0f;
6263

6364
static bool allow_up_down = false;
6465
static bool input_updated = false;
66+
static bool categories_supported = false;
6567

6668
static bool libretro_supports_bitmasks;
6769
static int joypad_current[MAX_PADS][JOYPAD_BUTTONS];
@@ -85,7 +87,6 @@ static u8* frame_buffer;
8587

8688
static void set_controller_info(void);
8789
static void update_input(void);
88-
static void set_variabless(void);
8990
static void check_variables(void);
9091

9192
static void fallback_log(enum retro_log_level level, const char *fmt, ...)
@@ -174,7 +175,7 @@ void retro_set_environment(retro_environment_t cb)
174175

175176
environ_cb(RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE, (void*)content_overrides);
176177
set_controller_info();
177-
set_variabless();
178+
libretro_set_core_options(environ_cb, &categories_supported);
178179
}
179180

180181
void retro_init(void)
@@ -537,24 +538,6 @@ static void update_input(void)
537538
}
538539
}
539540

540-
static void set_variabless(void)
541-
{
542-
struct retro_variable vars[] = {
543-
{ "gearlynx_aspect_ratio", "Aspect Ratio; 1:1 PAR|4:3 DAR|16:9 DAR|16:10 DAR" },
544-
{ "gearlynx_rotation", "Screen Rotation; Auto|Left|Right|Disabled" },
545-
{ "gearlynx_console_type", "Console Type; Auto|Lynx I|Lynx II" },
546-
{ "gearlynx_lowpass_filter", "Audio Low-Pass Filter (Hz); 3000|500|1000|1500|2000|2500|3000|3500|4000|4500|5000" },
547-
{ "gearlynx_audio_ch0_volume", "Audio Channel 0 Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
548-
{ "gearlynx_audio_ch1_volume", "Audio Channel 1 Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
549-
{ "gearlynx_audio_ch2_volume", "Audio Channel 2 Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
550-
{ "gearlynx_audio_ch3_volume", "Audio Channel 3 Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
551-
{ "gearlynx_up_down_allowed", "Allow Up+Down / Left+Right; Disabled|Enabled" },
552-
{ NULL }
553-
};
554-
555-
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void *)vars);
556-
}
557-
558541
static void check_variables(void)
559542
{
560543
struct retro_variable var = {0};

0 commit comments

Comments
 (0)