summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/ControllerConfig.cpp5
-rw-r--r--src/core/Frontend.cpp6
-rw-r--r--src/core/Frontend.h6
-rw-r--r--src/core/MenuScreens.cpp11
-rw-r--r--src/core/MenuScreensCustom.cpp93
-rw-r--r--src/core/Pad.cpp6
-rw-r--r--src/core/Pad.h2
-rw-r--r--src/core/config.h6
-rw-r--r--src/core/re3.cpp99
-rw-r--r--src/skel/crossplatform.h2
-rw-r--r--src/skel/glfw/glfw.cpp8
-rw-r--r--src/skel/win/win.cpp4
12 files changed, 179 insertions, 69 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 83d0f669..e72af7e4 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -354,6 +354,11 @@ uint32 CControllerConfigManager::ms_padButtonsInited = 0;
void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
{
+#ifdef XINPUT
+ // No manual bindings for you, honey.
+ return;
+#endif
+
m_bFirstCapture = true;
uint32 btn = buttons;
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 5e9f6d0d..44e143c8 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -3655,7 +3655,13 @@ CMenuManager::LoadAllTextures()
m_aMenuSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
}
#ifdef MENU_MAP
+ static bool menuOptionAdded = false;
for (int i = 0; i < ARRAY_SIZE(MapFilenames); i++) {
+ if (!menuOptionAdded && RwTextureRead(MapFilenames[i][0], MapFilenames[i][1])) {
+ FrontendOptionSetCursor(MENUPAGE_PAUSE_MENU, 2, false);
+ FrontendOptionAddBuiltinAction("FEG_MAP", MENUACTION_CHANGEMENU, MENUPAGE_MAP, SAVESLOT_NONE);
+ menuOptionAdded = true;
+ }
m_aMapSprites[i].SetTexture(MapFilenames[i][0], MapFilenames[i][1]);
m_aMapSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
}
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 9c666809..5c3523ab 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -235,15 +235,15 @@ enum eMenuScreen
MENUPAGE_KEYBOARD_CONTROLS = 55,
MENUPAGE_MOUSE_CONTROLS = 56,
MENUPAGE_MISSION_RETRY = 57,
+#ifdef CUSTOM_FRONTEND_OPTIONS
+
#ifdef MENU_MAP
MENUPAGE_MAP = 58,
#endif
-#ifdef CUSTOM_FRONTEND_OPTIONS
-
#ifdef GRAPHICS_MENU_OPTIONS
MENUPAGE_GRAPHICS_SETTINGS,
#endif
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
MENUPAGE_DETECT_JOYSTICK,
#endif
diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp
index 7c90ea12..3bd9adf4 100644
--- a/src/core/MenuScreens.cpp
+++ b/src/core/MenuScreens.cpp
@@ -394,9 +394,6 @@ CMenuScreen aScreens[MENUPAGES] = {
{ "FET_PAU", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
MENUACTION_RESUME, "FEM_RES", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_CHANGEMENU, "FEN_STA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
-#ifdef MENU_MAP
- MENUACTION_CHANGEMENU, "FEG_MAP", SAVESLOT_NONE, MENUPAGE_MAP,
-#endif
MENUACTION_CHANGEMENU, "FEP_STA", SAVESLOT_NONE, MENUPAGE_STATS,
MENUACTION_CHANGEMENU, "FEP_BRI", SAVESLOT_NONE, MENUPAGE_BRIEFS,
MENUACTION_CHANGEMENU, "FET_OPT", SAVESLOT_NONE, MENUPAGE_OPTIONS,
@@ -441,14 +438,6 @@ CMenuScreen aScreens[MENUPAGES] = {
},
#endif
-#ifdef MENU_MAP
- // MENUPAGE_MAP
- { "FEG_MAP", 1, MENUPAGE_NONE, MENUPAGE_NONE, 2, 2,
- MENUACTION_UNK110, "", SAVESLOT_NONE, MENUPAGE_NONE, // to prevent cross/enter to go back
- MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
- },
-#endif
-
// MENUPAGE_UNK
{ "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0,
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index 357f136b..ed5b149c 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -1,4 +1,13 @@
#include "common.h"
+#if defined DETECT_JOYSTICK_MENU && defined XINPUT
+#include <windows.h>
+#include <xinput.h>
+#if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1)
+#pragma comment( lib, "Xinput9_1_0.lib" )
+#else
+#pragma comment( lib, "Xinput.lib" )
+#endif
+#endif
#include "platform.h"
#include "crossplatform.h"
#include "Renderer.h"
@@ -186,38 +195,6 @@ void IslandLoadingAfterChange(int8 before, int8 after) {
}
#endif
-#ifdef MORE_LANGUAGES
-void LangPolSelect(int8 action)
-{
- if (action == FEOPTION_ACTION_SELECT) {
- FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
- FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
- FrontEndMenuManager.InitialiseChangedLanguageSettings();
- FrontEndMenuManager.SaveSettings();
- }
-}
-
-void LangRusSelect(int8 action)
-{
- if (action == FEOPTION_ACTION_SELECT) {
- FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
- FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
- FrontEndMenuManager.InitialiseChangedLanguageSettings();
- FrontEndMenuManager.SaveSettings();
- }
-}
-
-void LangJapSelect(int8 action)
-{
- if (action == FEOPTION_ACTION_SELECT) {
- FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
- FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
- FrontEndMenuManager.InitialiseChangedLanguageSettings();
- FrontEndMenuManager.SaveSettings();
- }
-}
-#endif
-
#ifndef MULTISAMPLING
void GraphicsGoBack() {
}
@@ -297,11 +274,13 @@ void ScreenModeAfterChange(int8 before, int8 after)
#endif
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
wchar selectedJoystickUnicode[128];
int cachedButtonNum = -1;
wchar* DetectJoystickDraw(bool* disabled, bool userHovering) {
+
+#if defined RW_GL3 && !defined LIBRW_SDL2
int numButtons;
int found = -1;
const char *joyname;
@@ -332,6 +311,40 @@ wchar* DetectJoystickDraw(bool* disabled, bool userHovering) {
}
}
if (PSGLOBAL(joy1id) == -1)
+#elif defined XINPUT
+ int found = -1;
+ XINPUT_STATE xstate;
+ memset(&xstate, 0, sizeof(XINPUT_STATE));
+ if (userHovering) {
+ for (int i = 0; i <= 3; i++) {
+ if (XInputGetState(i, &xstate) == ERROR_SUCCESS) {
+ if (xstate.Gamepad.bLeftTrigger || xstate.Gamepad.bRightTrigger) {
+ found = i;
+ break;
+ }
+ for (int j = XINPUT_GAMEPAD_DPAD_UP; j != XINPUT_GAMEPAD_Y << 1; j = (j << 1)) {
+ if (xstate.Gamepad.wButtons & j) {
+ found = i;
+ break;
+ }
+ }
+ if (found != -1)
+ break;
+ }
+ }
+ if (found != -1 && CPad::XInputJoy1 != found) {
+ if (CPad::XInputJoy1 != -1 && CPad::XInputJoy1 != found)
+ CPad::XInputJoy2 = CPad::XInputJoy1;
+ else
+ CPad::XInputJoy2 = -1;
+
+ CPad::XInputJoy1 = found;
+ cachedButtonNum = 0; // fake too, because xinput bypass CControllerConfig
+ }
+ }
+ sprintf(gSelectedJoystickName, "%d", CPad::XInputJoy1); // fake, on xinput we only store gamepad ids(thanks MS) so this is a temp variable to be used below
+ if (CPad::XInputJoy1 == -1)
+#endif
AsciiToUnicode("Not found", selectedJoystickUnicode);
else
AsciiToUnicode(gSelectedJoystickName, selectedJoystickUnicode);
@@ -452,11 +465,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
MENUACTION_LANG_GER, "FEL_GER", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS },
MENUACTION_LANG_ITA, "FEL_ITA", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS },
MENUACTION_LANG_SPA, "FEL_SPA", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS },
-#ifdef MORE_LANGUAGES
- MENUACTION_CFO_DYNAMIC, "FEL_POL", { new CCFODynamic(nil, nil, nil, nil, LangPolSelect) },
- MENUACTION_CFO_DYNAMIC, "FEL_RUS", { new CCFODynamic(nil, nil, nil, nil, LangRusSelect) },
- MENUACTION_CFO_DYNAMIC, "FEL_JAP", { new CCFODynamic(nil, nil, nil, nil, LangJapSelect) },
-#endif
+ // CustomFrontendOptionsPopulate will add languages here, if files are found
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
},
@@ -666,7 +675,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
#ifdef GAMEPAD_MENU
MENUACTION_CHANGEMENU, "FET_AGS", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS },
#endif
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
MENUACTION_CHANGEMENU, "FEC_JOD", { nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK },
#endif
MENUACTION_CHANGEMENU, "FET_AMS", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
@@ -791,9 +800,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
{ "FET_PAU", MENUPAGE_DISABLED, MENUPAGE_DISABLED, nil, nil,
MENUACTION_RESUME, "FEM_RES", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
MENUACTION_CHANGEMENU, "FEN_STA", { nil, SAVESLOT_NONE, MENUPAGE_NEW_GAME },
-#ifdef MENU_MAP
- MENUACTION_CHANGEMENU, "FEG_MAP", { nil, SAVESLOT_NONE, MENUPAGE_MAP },
-#endif
+ // CMenuManager::LoadAllTextures will add map here, if MENU_MAP enabled and map textures are found
MENUACTION_CHANGEMENU, "FEP_STA", { nil, SAVESLOT_NONE, MENUPAGE_STATS },
MENUACTION_CHANGEMENU, "FEP_BRI", { nil, SAVESLOT_NONE, MENUPAGE_BRIEFS },
MENUACTION_CHANGEMENU, "FET_OPT", { nil, SAVESLOT_NONE, MENUPAGE_OPTIONS },
@@ -873,7 +880,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
},
#endif
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
// MENUPAGE_DETECT_JOYSTICK
{ "FEC_JOD", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC,
new CCustomScreenLayout({MENUSPRITE_MAINMENU, 40, 60, 20, FONT_BANK, FESCREEN_LEFT_ALIGN, false, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), DetectJoystickGoBack,
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 9bcac613..60bb7a76 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -1028,8 +1028,14 @@ void CPad::AddToPCCheatString(char c)
}
#ifdef XINPUT
+int CPad::XInputJoy1 = 0;
+int CPad::XInputJoy2 = 1;
void CPad::AffectFromXinput(uint32 pad)
{
+ pad = pad == 0 ? XInputJoy1 : XInputJoy2;
+ if (pad == -1) // LoadINIControllerSettings can set it to -1
+ return;
+
XINPUT_STATE xstate;
memset(&xstate, 0, sizeof(XINPUT_STATE));
if (XInputGetState(pad, &xstate) == ERROR_SUCCESS)
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 20a676ef..b37659cd 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -263,6 +263,8 @@ public:
static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize);
#ifdef XINPUT
+ static int XInputJoy1;
+ static int XInputJoy2;
void AffectFromXinput(uint32 pad);
#endif
diff --git a/src/core/config.h b/src/core/config.h
index 79323ef1..73c29f15 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -287,8 +287,8 @@ enum Config {
#if !defined(RW_GL3) && defined(_WIN32)
#define XINPUT
#endif
-#if !defined(_WIN32) && !defined(__SWITCH__)
-#define DONT_TRUST_RECOGNIZED_JOYSTICKS // Then we'll only rely on GLFW gamepad DB, and expect user to enter Controller->Detect joysticks if his joystick isn't on that list.
+#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined __SWITCH__)
+#define DETECT_JOYSTICK_MENU // Then we'll expect user to enter Controller->Detect joysticks if his joystick isn't detected at the start.
#endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
#define KANGAROO_CHEAT
@@ -312,7 +312,6 @@ enum Config {
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
#else
-# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
# ifdef XINPUT
# define GAMEPAD_MENU // Add gamepad menu
@@ -326,6 +325,7 @@ enum Config {
# define CUSTOM_FRONTEND_OPTIONS
# ifdef CUSTOM_FRONTEND_OPTIONS
+# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 62d963ca..720aeb46 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -1,6 +1,14 @@
#include <csignal>
#define WITHWINDOWS
#include "common.h"
+#if defined DETECT_JOYSTICK_MENU && defined XINPUT
+#include <xinput.h>
+#if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1)
+#pragma comment( lib, "Xinput9_1_0.lib" )
+#else
+#pragma comment( lib, "Xinput.lib" )
+#endif
+#endif
#include "Renderer.h"
#include "Credits.h"
#include "Camera.h"
@@ -34,7 +42,7 @@
#include "MBlur.h"
#include "ControllerConfig.h"
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
#include "crossplatform.h"
#endif
@@ -77,16 +85,49 @@ mysrand(unsigned int seed)
#ifdef CUSTOM_FRONTEND_OPTIONS
#include "frontendoption.h"
+#ifdef MORE_LANGUAGES
+void LangPolSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+
+void LangRusSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+
+void LangJapSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+#endif
+
void
CustomFrontendOptionsPopulate(void)
{
// Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h
// These work only if we have neo folder, so they're dynamically added
+ int fd;
#ifdef EXTENDED_PIPELINES
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
- int fd = CFileMgr::OpenFile("neo/neo.txd","r");
+ fd = CFileMgr::OpenFile("neo/neo.txd","r");
if (fd) {
#ifdef GRAPHICS_MENU_OPTIONS
FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false);
@@ -105,6 +146,28 @@ CustomFrontendOptionsPopulate(void)
}
#endif
+ // Add outsourced language translations, if files are found
+#ifdef MORE_LANGUAGES
+ FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, 5, false);
+ fd = CFileMgr::OpenFile("text/polish.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_POL", nil, nil, LangPolSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+
+ fd = CFileMgr::OpenFile("text/russian.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_RUS", nil, nil, LangRusSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+
+ fd = CFileMgr::OpenFile("text/japanese.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_JAP", nil, nil, LangJapSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+#endif
+
}
#endif
@@ -244,9 +307,33 @@ const char *iniKeyboardButtons[] = {"ESC","F1","F2","F3","F4","F5","F6","F7","F8
void LoadINIControllerSettings()
{
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
+#ifdef XINPUT
+ int storedJoy1 = -1;
+ if (ReadIniIfExists("Controller", "JoystickName", &storedJoy1)) {
+ CPad::XInputJoy1 = -1;
+ CPad::XInputJoy2 = -1;
+ XINPUT_STATE xstate;
+ memset(&xstate, 0, sizeof(XINPUT_STATE));
+
+ // Firstly confirm & set joy 1
+ if (XInputGetState(storedJoy1, &xstate) == ERROR_SUCCESS) {
+ CPad::XInputJoy1 = storedJoy1;
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ if (XInputGetState(i, &xstate) == ERROR_SUCCESS) {
+ if (CPad::XInputJoy1 == -1)
+ CPad::XInputJoy1 = i;
+ else if (CPad::XInputJoy2 == -1 && i != CPad::XInputJoy1)
+ CPad::XInputJoy2 = i;
+ }
+ }
+ }
+#else
ReadIniIfExists("Controller", "JoystickName", gSelectedJoystickName, 128);
#endif
+#endif
// force to default GTA behaviour (never overwrite bindings on joy change/initialization) if user init'ed/set bindings before we introduced that
if (!ReadIniIfExists("Controller", "PadButtonsInited", &ControlsManager.ms_padButtonsInited)) {
ControlsManager.ms_padButtonsInited = cfg.category_size("Bindings") != 0 ? 16 : 0;
@@ -343,9 +430,13 @@ void SaveINIControllerSettings()
StoreIni("Bindings", iniControllerActions[i], value, 128);
}
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
+#ifdef XINPUT
+ StoreIni("Controller", "JoystickName", CPad::XInputJoy1);
+#else
StoreIni("Controller", "JoystickName", gSelectedJoystickName, 128);
#endif
+#endif
StoreIni("Controller", "PadButtonsInited", ControlsManager.ms_padButtonsInited);
cfg.write_file("re3.ini");
}
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h
index 8c4fb14c..e5f4c7ba 100644
--- a/src/skel/crossplatform.h
+++ b/src/skel/crossplatform.h
@@ -71,7 +71,7 @@ void CapturePad(RwInt32 padID);
void joysChangeCB(int jid, int event);
#endif
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
extern char gSelectedJoystickName[128];
#endif
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 9643c63b..b413a1ce 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -81,7 +81,7 @@ static psGlobalType PsGlobal;
size_t _dwMemAvailPhys;
RwUInt32 gGameState;
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
char gSelectedJoystickName[128] = "";
#endif
@@ -841,7 +841,7 @@ void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
{
-#ifndef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifndef DETECT_JOYSTICK_MENU
return false;
#else
if (glfwJoystickIsGamepad(i))
@@ -906,7 +906,7 @@ void _InputInitialiseJoys()
if (PSGLOBAL(joy1id) != -1) {
int count;
glfwGetJoystickButtons(PSGLOBAL(joy1id), &count);
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
strcpy(gSelectedJoystickName, glfwGetJoystickName(PSGLOBAL(joy1id)));
#endif
ControlsManager.InitDefaultControlConfigJoyPad(count);
@@ -2150,7 +2150,7 @@ void joysChangeCB(int jid, int event)
if (event == GLFW_CONNECTED && !IsThisJoystickBlacklisted(jid)) {
if (PSGLOBAL(joy1id) == -1) {
PSGLOBAL(joy1id) = jid;
-#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#ifdef DETECT_JOYSTICK_MENU
strcpy(gSelectedJoystickName, glfwGetJoystickName(jid));
#endif
// This is behind LOAD_INI_SETTINGS, because otherwise the Init call below will destroy/overwrite your bindings.
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 3bda4e9d..c00d6075 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -121,6 +121,10 @@ DWORD _dwOperatingSystemVersion;
RwUInt32 gGameState;
CJoySticks AllValidWinJoys;
+#ifdef DETECT_JOYSTICK_MENU
+char gSelectedJoystickName[128] = "";
+#endif
+
// What is that for anyway?
#ifndef IMPROVED_VIDEOMODE
static RwBool defaultFullscreenRes = TRUE;