Now adding mappings for Dreamcast Controller USB during input_sdl_init()

This commit is contained in:
Mike Kosek 2025-01-24 10:55:59 +01:00 committed by flyinghead
parent 4389a3ffa6
commit ce0060126e
1 changed files with 9 additions and 0 deletions

View File

@ -266,6 +266,15 @@ void input_sdl_init()
if (settings.input.keyboardLangId == KeyboardLayout::US)
settings.input.keyboardLangId = detectKeyboardLayout();
barcode.clear();
// Add MacOS and Windows mappings for Dreamcast Controller USB
// Linux mappings are OK by default
// Can be removed once mapping is merged into SDL, see https://github.com/libsdl-org/SDL/pull/12039
#if (defined(__APPLE__) && defined(TARGET_OS_MAC))
SDL_GameControllerAddMapping("0300000009120000072f000000010000,OrangeFox86 Dreamcast Controller USB,crc:3cef,a:b0,b:b1,x:b3,y:b4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,dpdown:h0.4,leftx:a0,lefty:a1,lefttrigger:a2,righttrigger:a5,start:b11");
#elif defined(_WIN32)
SDL_GameControllerAddMapping("0300000009120000072f000000000000,OrangeFox86 Dreamcast Controller USB,crc:baa5,a:b0,b:b1,x:b3,y:b4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,dpdown:h0.4,leftx:a0,lefty:a1,lefttrigger:-a2,righttrigger:-a5,start:b11");
#endif
}
void input_sdl_quit()