From c8f9b8cbd374026493720819fb44f00e7728609b Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:48:56 +0500 Subject: [PATCH 1/3] Handle the internal name change for the S3 ViRGE/GX (formerly ViRGE/DX VBE 2.0) --- src/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 972fb82ab..01c13e85e 100644 --- a/src/config.c +++ b/src/config.c @@ -889,7 +889,10 @@ load_video(void) } free_p = 1; } - gfxcard = video_get_video_from_internal_name(p); + if (!strcmp(p, "virge375_vbe20_pci")) /* migrate renamed cards */ + gfxcard = video_get_video_from_internal_name("virge385_pci"); + else + gfxcard = video_get_video_from_internal_name(p); if (free_p) free(p); } From c4af6f4f9b617716e669620d2224150aa89e3efc Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:49:38 +0500 Subject: [PATCH 2/3] Fix a typo in CH Flightstick Pro's internal name --- src/config.c | 4 +++- src/game/joystick_ch_flightstick_pro.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 01c13e85e..98842009b 100644 --- a/src/config.c +++ b/src/config.c @@ -918,7 +918,7 @@ load_input_devices(void) p = config_get_string(cat, "joystick_type", NULL); if (p != NULL) { - if (!strcmp(p, "standard_2button")) + if (!strcmp(p, "standard_2button")) /* migrate renamed types */ joystick_type = joystick_get_from_internal_name("2axis_2button"); else if (!strcmp(p, "standard_4button")) joystick_type = joystick_get_from_internal_name("2axis_4button"); @@ -926,6 +926,8 @@ load_input_devices(void) joystick_type = joystick_get_from_internal_name("2axis_6button"); else if (!strcmp(p, "standard_8button")) joystick_type = joystick_get_from_internal_name("2axis_8button"); + else if (!strcmp(p, "ch_flighstick_pro")) /* fix typo */ + joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); joystick_type = joystick_get_from_internal_name(p); if (!joystick_type) { diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 14bdee7a5..b6cd8911f 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -116,7 +116,7 @@ static void ch_flightstick_pro_a0_over(void *p) const joystick_if_t joystick_ch_flightstick_pro = { "CH Flightstick Pro", - "ch_flighstick_pro", + "ch_flightstick_pro", ch_flightstick_pro_init, ch_flightstick_pro_close, ch_flightstick_pro_read, From b5539d5029b980d9af3f5420c4f85ce7b006af09 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:51:42 +0500 Subject: [PATCH 3/3] Fix joystick type migration not working as intended Map legacy integer-based joystick type options directly --- src/config.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/config.c b/src/config.c index 98842009b..58cd07a56 100644 --- a/src/config.c +++ b/src/config.c @@ -928,21 +928,41 @@ load_input_devices(void) joystick_type = joystick_get_from_internal_name("2axis_8button"); else if (!strcmp(p, "ch_flighstick_pro")) /* fix typo */ joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); + else + joystick_type = joystick_get_from_internal_name(p); - joystick_type = joystick_get_from_internal_name(p); if (!joystick_type) { /* Try to read an integer for backwards compatibility with old configs */ - c = config_get_int(cat, "joystick_type", 8); - switch (c) { - case 0: case 1: case 2: case 3: /* 2-axis joysticks */ - joystick_type = c + 1; - break; - case 4: case 5: case 6: case 7: /* other joysticks */ - joystick_type = c + 3; - break; - default: /* "None" (8) or invalid value */ - joystick_type = 0; - break; + if (!strcmp(p, "0")) /* workaround for config_get_int returning 0 on non-integer data */ + joystick_type = joystick_get_from_internal_name("2axis_2button"); + else { + c = config_get_int(cat, "joystick_type", 8); + switch (c) { + case 1: + joystick_type = joystick_get_from_internal_name("2axis_4button"); + break; + case 2: + joystick_type = joystick_get_from_internal_name("2axis_6button"); + break; + case 3: + joystick_type = joystick_get_from_internal_name("2axis_8button"); + break; + case 4: + joystick_type = joystick_get_from_internal_name("4axis_4button"); + break; + case 5: + joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); + break; + case 6: + joystick_type = joystick_get_from_internal_name("sidewinder_pad"); + break; + case 7: + joystick_type = joystick_get_from_internal_name("thrustmaster_fcs"); + break; + default: + joystick_type = 0; + break; + } } } } else