diff --git a/core/hw/maple/maple_cfg.cpp b/core/hw/maple/maple_cfg.cpp index f572e387a..753b1ca90 100644 --- a/core/hw/maple/maple_cfg.cpp +++ b/core/hw/maple/maple_cfg.cpp @@ -100,17 +100,19 @@ void mcfg_CreateDevicesFromConfig() if (numberOfControl > 4) numberOfControl = 4; - for (int i = 0; i < numberOfControl; i++){ + for (int i = 0; i < numberOfControl; i++) + { mcfg_Create(MDT_SegaController, i, 5); + + // Default to two VMUs on each controller + mcfg_Create(MDT_SegaVMU, i, 0); + mcfg_Create(MDT_SegaVMU, i, 1); } if (settings.input.DCKeyboard && numberOfControl < 4) mcfg_Create(MDT_Keyboard, numberOfControl++, 5); + if (settings.input.DCMouse != 0 && numberOfControl < 4) mcfg_Create(MDT_Mouse, numberOfControl++, 5); - - // Default to two VMUs on controller 1 - mcfg_Create(MDT_SegaVMU, 0, 0); - mcfg_Create(MDT_SegaVMU, 0, 1); } void mcfg_DestroyDevices() diff --git a/core/linux-dist/main.cpp b/core/linux-dist/main.cpp index af0a2168f..4f72e72ac 100644 --- a/core/linux-dist/main.cpp +++ b/core/linux-dist/main.cpp @@ -13,6 +13,7 @@ #include #include #include "hw/sh4/dyna/blockmanager.h" +#include "hw/maple/maple_cfg.h" #include #if defined(TARGET_EMSCRIPTEN) @@ -95,32 +96,36 @@ void emit_WriteCodeCache(); void os_SetupInput() { - #if defined(USE_EVDEV) - input_evdev_init(); - #endif +#if defined(USE_EVDEV) + input_evdev_init(); +#endif - #if defined(USE_JOYSTICK) - int joystick_device_id = cfgLoadInt("input", "joystick_device_id", JOYSTICK_DEFAULT_DEVICE_ID); - if (joystick_device_id < 0) { - puts("Legacy Joystick input disabled by config.\n"); - } - else - { - int joystick_device_length = snprintf(NULL, 0, JOYSTICK_DEVICE_STRING, joystick_device_id); - char* joystick_device = (char*)malloc(joystick_device_length + 1); - sprintf(joystick_device, JOYSTICK_DEVICE_STRING, joystick_device_id); - joystick_fd = input_joystick_init(joystick_device); - free(joystick_device); - } - #endif +#if defined(USE_JOYSTICK) + int joystick_device_id = cfgLoadInt("input", "joystick_device_id", JOYSTICK_DEFAULT_DEVICE_ID); + if (joystick_device_id < 0) { + puts("Legacy Joystick input disabled by config.\n"); + } + else + { + int joystick_device_length = snprintf(NULL, 0, JOYSTICK_DEVICE_STRING, joystick_device_id); + char* joystick_device = (char*)malloc(joystick_device_length + 1); + sprintf(joystick_device, JOYSTICK_DEVICE_STRING, joystick_device_id); + joystick_fd = input_joystick_init(joystick_device); + free(joystick_device); + } +#endif - #if defined(SUPPORT_X11) - input_x11_init(); - #endif +#if defined(SUPPORT_X11) + input_x11_init(); +#endif - #if defined(USE_SDL) - input_sdl_init(); - #endif +#if defined(USE_SDL) + input_sdl_init(); +#endif + +#if DC_PLATFORM == DC_PLATFORM_DREAMCAST + mcfg_CreateDevicesFromConfig(); +#endif } void UpdateInputState(u32 port)