Create maple devices on Linux. Default to 2 VMUs per controller
This commit is contained in:
parent
411baa6b8e
commit
dc5ce8fa8b
|
@ -100,17 +100,19 @@ void mcfg_CreateDevicesFromConfig()
|
||||||
if (numberOfControl > 4)
|
if (numberOfControl > 4)
|
||||||
numberOfControl = 4;
|
numberOfControl = 4;
|
||||||
|
|
||||||
for (int i = 0; i < numberOfControl; i++){
|
for (int i = 0; i < numberOfControl; i++)
|
||||||
|
{
|
||||||
mcfg_Create(MDT_SegaController, i, 5);
|
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)
|
if (settings.input.DCKeyboard && numberOfControl < 4)
|
||||||
mcfg_Create(MDT_Keyboard, numberOfControl++, 5);
|
mcfg_Create(MDT_Keyboard, numberOfControl++, 5);
|
||||||
|
|
||||||
if (settings.input.DCMouse != 0 && numberOfControl < 4)
|
if (settings.input.DCMouse != 0 && numberOfControl < 4)
|
||||||
mcfg_Create(MDT_Mouse, numberOfControl++, 5);
|
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()
|
void mcfg_DestroyDevices()
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "hw/sh4/dyna/blockmanager.h"
|
#include "hw/sh4/dyna/blockmanager.h"
|
||||||
|
#include "hw/maple/maple_cfg.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if defined(TARGET_EMSCRIPTEN)
|
#if defined(TARGET_EMSCRIPTEN)
|
||||||
|
@ -95,32 +96,36 @@ void emit_WriteCodeCache();
|
||||||
|
|
||||||
void os_SetupInput()
|
void os_SetupInput()
|
||||||
{
|
{
|
||||||
#if defined(USE_EVDEV)
|
#if defined(USE_EVDEV)
|
||||||
input_evdev_init();
|
input_evdev_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_JOYSTICK)
|
#if defined(USE_JOYSTICK)
|
||||||
int joystick_device_id = cfgLoadInt("input", "joystick_device_id", JOYSTICK_DEFAULT_DEVICE_ID);
|
int joystick_device_id = cfgLoadInt("input", "joystick_device_id", JOYSTICK_DEFAULT_DEVICE_ID);
|
||||||
if (joystick_device_id < 0) {
|
if (joystick_device_id < 0) {
|
||||||
puts("Legacy Joystick input disabled by config.\n");
|
puts("Legacy Joystick input disabled by config.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int joystick_device_length = snprintf(NULL, 0, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
int joystick_device_length = snprintf(NULL, 0, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
||||||
char* joystick_device = (char*)malloc(joystick_device_length + 1);
|
char* joystick_device = (char*)malloc(joystick_device_length + 1);
|
||||||
sprintf(joystick_device, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
sprintf(joystick_device, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
||||||
joystick_fd = input_joystick_init(joystick_device);
|
joystick_fd = input_joystick_init(joystick_device);
|
||||||
free(joystick_device);
|
free(joystick_device);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SUPPORT_X11)
|
#if defined(SUPPORT_X11)
|
||||||
input_x11_init();
|
input_x11_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_SDL)
|
#if defined(USE_SDL)
|
||||||
input_sdl_init();
|
input_sdl_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if DC_PLATFORM == DC_PLATFORM_DREAMCAST
|
||||||
|
mcfg_CreateDevicesFromConfig();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateInputState(u32 port)
|
void UpdateInputState(u32 port)
|
||||||
|
|
Loading…
Reference in New Issue