Create maple devices on Linux. Default to 2 VMUs per controller

This commit is contained in:
Flyinghead 2018-09-24 18:56:24 +02:00
parent 411baa6b8e
commit dc5ce8fa8b
2 changed files with 35 additions and 28 deletions

View File

@ -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()

View File

@ -13,6 +13,7 @@
#include <sys/mman.h>
#include <sys/time.h>
#include "hw/sh4/dyna/blockmanager.h"
#include "hw/maple/maple_cfg.h"
#include <unistd.h>
#if defined(TARGET_EMSCRIPTEN)
@ -95,11 +96,11 @@ void emit_WriteCodeCache();
void os_SetupInput()
{
#if defined(USE_EVDEV)
#if defined(USE_EVDEV)
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);
if (joystick_device_id < 0) {
puts("Legacy Joystick input disabled by config.\n");
@ -112,15 +113,19 @@ void os_SetupInput()
joystick_fd = input_joystick_init(joystick_device);
free(joystick_device);
}
#endif
#endif
#if defined(SUPPORT_X11)
#if defined(SUPPORT_X11)
input_x11_init();
#endif
#endif
#if defined(USE_SDL)
#if defined(USE_SDL)
input_sdl_init();
#endif
#endif
#if DC_PLATFORM == DC_PLATFORM_DREAMCAST
mcfg_CreateDevicesFromConfig();
#endif
}
void UpdateInputState(u32 port)