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

View File

@ -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)
@ -121,6 +122,10 @@ void os_SetupInput()
#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)