Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 5447375

Browse files
authored
Merge pull request #1458 from reicast/baka/sdl_controller
SDL: Create the first controller with two VMUs
2 parents 19ca0ed + 3b38afd commit 5447375

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

core/sdl/sdl.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "types.h"
33
#include "cfg/cfg.h"
44
#include "linux-dist/main.h"
5+
#include "hw/maple/maple_devs.h"
6+
#include "hw/maple/maple_cfg.h"
57
#include "sdl/sdl.h"
68
#ifndef GLES
79
#include "khronos/GL3/gl3w.h"
@@ -84,18 +86,26 @@ void input_sdl_init()
8486
ButtonCount = SDL_JoystickNumButtons(JoySDL);
8587
Name = SDL_JoystickName(JoySDL);
8688

87-
printf("SDK: Found '%s' joystick with %d axes and %d buttons\n", Name, AxisCount, ButtonCount);
89+
printf("SDL: Found '%s' joystick with %d axes and %d buttons\n", Name, AxisCount, ButtonCount);
8890

8991
if (Name != NULL && strcmp(Name,"Microsoft X-Box 360 pad")==0)
9092
{
9193
sdl_map_btn = sdl_map_btn_xbox360;
9294
sdl_map_axis = sdl_map_axis_xbox360;
9395
printf("Using Xbox 360 map\n");
9496
}
97+
98+
// Create the first controller with two VMUs
99+
// (only when evdev is not available as it's already configured via evdev then)
100+
// TODO: make this configurable
101+
#ifndef USE_EVDEV
102+
printf("SDL: Creating controller in first port with 2 VMUs");
103+
mcfg_CreateController(0, MDT_SegaVMU, MDT_SegaVMU);
104+
#endif
95105
}
96106
else
97107
{
98-
printf("SDK: No Joystick Found\n");
108+
printf("SDL: No Joystick Found\n");
99109
}
100110

101111
#ifdef TARGET_PANDORA

0 commit comments

Comments
 (0)