Skip to content

Commit 1f6595b

Browse files
committed
Add a hack for detecting ps2 joystick.
1 parent afcca1d commit 1f6595b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CMake/platforms/ps2.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@ set(DISABLE_DEMOMODE ON)
33
set(ASAN OFF)
44
set(UBSAN OFF)
55
set(BUILD_TESTING OFF)
6+
set(DISABLE_LTO ON)
67

8+
set(JOY_BUTTON_A 2)
9+
set(JOY_BUTTON_B 1)
10+
set(JOY_BUTTON_X 4)
11+
set(JOY_BUTTON_Y 3)
12+
set(JOY_BUTTON_LEFTSHOULDER 5)
13+
set(JOY_BUTTON_RIGHTSHOULDER 6)
14+
set(JOY_BUTTON_BACK 7)
15+
set(JOY_BUTTON_START 0)
16+
set(JOY_BUTTON_TRIGGERLEFT 8)
17+
set(JOY_BUTTON_TRIGGERRIGHT 9)
18+
19+
set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF)
720
set(DEVILUTIONX_SYSTEM_BZIP2 OFF)
821
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
922
set(PREFILL_PLAYER_NAME ON)

Source/utils/display.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,11 @@ bool SpawnWindow(const char *lpWindowName)
582582
}
583583
#endif
584584

585+
#ifdef PS2
586+
// TODO: ps2 sdl2 dóesn´t report joystick similar to switch
587+
Joystick::Add(0);
588+
#endif
589+
585590
#ifdef USE_SDL1
586591
// On SDL 1, there are no ADDED/REMOVED events.
587592
// Always try to initialize the first joystick.

0 commit comments

Comments
 (0)