mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Clean up autoconfig stuff a bit, add headers.
This commit is contained in:
parent
02528942ac
commit
99dbd6bd1c
@ -17,7 +17,7 @@ OBJ = frontend/frontend.o \
|
||||
movie.o \
|
||||
gfx/gfx_common.o \
|
||||
input/input_common.o \
|
||||
input/autoconf_builtin.o \
|
||||
input/autoconf/builtin_win.o \
|
||||
core_options.o \
|
||||
patch.o \
|
||||
compat/compat.o \
|
||||
@ -83,7 +83,7 @@ endif
|
||||
libretro ?= -lretro
|
||||
|
||||
LIBS = -lm
|
||||
DEFINES = -I. -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE
|
||||
DEFINES = -I. -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DHAVE_BUILTIN_AUTOCONFIG
|
||||
LDFLAGS = -L. -static-libgcc
|
||||
|
||||
ifeq ($(TDM_GCC),)
|
||||
|
24
input/autoconf/builtin.h
Normal file
24
input/autoconf/builtin.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2013 - pinumbernumber
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef AUTOCONF_BUILTIN_H__
|
||||
#define AUTOCONF_BUILTIN_H__
|
||||
|
||||
#include "input_common.h"
|
||||
#define DECL_BTN(btn, bind) "input_" #btn "_btn = " #bind "\n"
|
||||
#define DECL_AXIS(axis, bind) "input_" #axis "_axis = " #bind "\n"
|
||||
|
||||
#endif
|
||||
|
91
input/autoconf/builtin_win.c
Normal file
91
input/autoconf/builtin_win.c
Normal file
@ -0,0 +1,91 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2013 - pinumbernumber
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "builtin.h"
|
||||
|
||||
#define XINPUT_DEFAULT_BINDS \
|
||||
DECL_BTN(a, 1) \
|
||||
DECL_BTN(b, 0) \
|
||||
DECL_BTN(x, 3) \
|
||||
DECL_BTN(y, 2) \
|
||||
DECL_BTN(start, 6) \
|
||||
DECL_BTN(select, 7) \
|
||||
DECL_BTN(up, h0up) \
|
||||
DECL_BTN(down, h0down) \
|
||||
DECL_BTN(left, h0left) \
|
||||
DECL_BTN(right, h0right) \
|
||||
DECL_BTN(l, 4) \
|
||||
DECL_BTN(r, 5) \
|
||||
DECL_BTN(l3, 8 )\
|
||||
DECL_BTN(r3, 9) \
|
||||
DECL_AXIS(l2, +4) \
|
||||
DECL_AXIS(r2, +5) \
|
||||
DECL_AXIS(l_x_plus, +0) \
|
||||
DECL_AXIS(l_x_minus, -0) \
|
||||
DECL_AXIS(l_y_plus, -1) \
|
||||
DECL_AXIS(l_y_minus, +1) \
|
||||
DECL_AXIS(r_x_plus, +2) \
|
||||
DECL_AXIS(r_x_minus, -2) \
|
||||
DECL_AXIS(r_y_plus, -3) \
|
||||
DECL_AXIS(r_y_minus, +3)
|
||||
|
||||
// Some hardcoded autoconfig information. Will be used for pads with no autoconfig cfg files.
|
||||
const char* const input_builtin_autoconfs[] =
|
||||
{
|
||||
"input_device = \"XInput Controller (Player 1)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 2)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 3)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 4)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"Dual Trigger 3-in-1\" \n"
|
||||
"input_driver = \"dinput\" \n"
|
||||
DECL_BTN(a, 2)
|
||||
DECL_BTN(b, 1)
|
||||
DECL_BTN(x, 3)
|
||||
DECL_BTN(y, 0)
|
||||
DECL_BTN(start, 9)
|
||||
DECL_BTN(select, 8)
|
||||
DECL_BTN(up, h0up)
|
||||
DECL_BTN(down, h0down)
|
||||
DECL_BTN(left, h0left)
|
||||
DECL_BTN(right, h0right)
|
||||
DECL_BTN(l, 4)
|
||||
DECL_BTN(r, 5)
|
||||
DECL_BTN(l2, 6)
|
||||
DECL_BTN(r2, 7)
|
||||
DECL_BTN(l3, 10)
|
||||
DECL_BTN(r3, 11)
|
||||
DECL_AXIS(l_x_plus, +0)
|
||||
DECL_AXIS(l_x_minus, -0)
|
||||
DECL_AXIS(l_y_plus, +1)
|
||||
DECL_AXIS(l_y_minus, -1)
|
||||
DECL_AXIS(r_x_plus, +2)
|
||||
DECL_AXIS(r_x_minus, -2)
|
||||
DECL_AXIS(r_y_plus, +5)
|
||||
DECL_AXIS(r_y_minus, -5),
|
||||
|
||||
NULL
|
||||
};
|
@ -1,80 +0,0 @@
|
||||
#include "input_common.h"
|
||||
|
||||
#define DECL_BTN(btn, bind) "input_" #btn "_btn = " #bind "\n"
|
||||
#define DECL_AXIS(axis, bind) "input_" #axis "_axis = " #bind "\n"
|
||||
|
||||
#define XINPUT_DEFAULT_BINDS \
|
||||
DECL_BTN(a,1)\
|
||||
DECL_BTN(b,0)\
|
||||
DECL_BTN(x,3)\
|
||||
DECL_BTN(y,2)\
|
||||
DECL_BTN(start, 6)\
|
||||
DECL_BTN(select,7)\
|
||||
DECL_BTN(up,h0up)\
|
||||
DECL_BTN(down,h0down)\
|
||||
DECL_BTN(left,h0left)\
|
||||
DECL_BTN(right,h0right)\
|
||||
DECL_BTN(l, 4)\
|
||||
DECL_BTN(r, 5)\
|
||||
DECL_BTN(l3,8)\
|
||||
DECL_BTN(r3,9)\
|
||||
DECL_AXIS(l2, +4)\
|
||||
DECL_AXIS(r2, +5)\
|
||||
DECL_AXIS(l_x_plus, +0)\
|
||||
DECL_AXIS(l_x_minus, -0)\
|
||||
DECL_AXIS(l_y_plus, -1)\
|
||||
DECL_AXIS(l_y_minus, +1)\
|
||||
DECL_AXIS(r_x_plus, +2)\
|
||||
DECL_AXIS(r_x_minus, -2)\
|
||||
DECL_AXIS(r_y_plus, -3)\
|
||||
DECL_AXIS(r_y_minus, +3)
|
||||
|
||||
// Some hardcoded autoconfig information. Will be used for pads with no autoconfig cfg files.
|
||||
const char* const input_builtin_autoconfs[] =
|
||||
{
|
||||
"input_device = \"XInput Controller (Player 1)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 2)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 3)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"XInput Controller (Player 4)\" \n"
|
||||
"input_driver = \"winxinput\" \n"
|
||||
XINPUT_DEFAULT_BINDS,
|
||||
|
||||
"input_device = \"Dual Trigger 3-in-1\" \n"
|
||||
"input_driver = \"dinput\" \n"
|
||||
DECL_BTN(a,2)
|
||||
DECL_BTN(b,1)
|
||||
DECL_BTN(x,3)
|
||||
DECL_BTN(y,0)
|
||||
DECL_BTN(start, 9)
|
||||
DECL_BTN(select,8)
|
||||
DECL_BTN(up,h0up)
|
||||
DECL_BTN(down,h0down)
|
||||
DECL_BTN(left,h0left)
|
||||
DECL_BTN(right,h0right)
|
||||
DECL_BTN(l, 4)
|
||||
DECL_BTN(r, 5)
|
||||
DECL_BTN(l2, 6)
|
||||
DECL_BTN(r2, 7)
|
||||
DECL_BTN(l3,10)
|
||||
DECL_BTN(r3,11)
|
||||
DECL_AXIS(l_x_plus, +0)
|
||||
DECL_AXIS(l_x_minus, -0)
|
||||
DECL_AXIS(l_y_plus, +1)
|
||||
DECL_AXIS(l_y_minus, -1)
|
||||
DECL_AXIS(r_x_plus, +2)
|
||||
DECL_AXIS(r_x_minus, -2)
|
||||
DECL_AXIS(r_y_plus, +5)
|
||||
DECL_AXIS(r_y_minus, -5)
|
||||
,
|
||||
|
||||
NULL
|
||||
};
|
@ -862,10 +862,11 @@ void input_config_autoconfigure_joypad(unsigned index, const char *name, const c
|
||||
return;
|
||||
|
||||
// false = load from both cfg files and internal
|
||||
bool internal_only = (!*g_settings.input.autoconfig_dir);
|
||||
bool internal_only = !*g_settings.input.autoconfig_dir;
|
||||
|
||||
#ifdef HAVE_BUILTIN_AUTOCONFIG
|
||||
// First internal
|
||||
for (size_t i = 0; input_builtin_autoconfs[i] /* array is NULL terminated */; i++)
|
||||
for (size_t i = 0; input_builtin_autoconfs[i]; i++)
|
||||
{
|
||||
config_file_t *conf = config_file_new_from_string(input_builtin_autoconfs[i]);
|
||||
bool success = input_try_autoconfigure_joypad_from_conf(conf, index, name, driver, block_osd_spam);
|
||||
@ -873,6 +874,7 @@ void input_config_autoconfigure_joypad(unsigned index, const char *name, const c
|
||||
if (success)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Now try files
|
||||
if (!internal_only)
|
||||
|
@ -88,7 +88,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
@ -108,7 +108,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
@ -130,7 +130,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;HAVE_ZLIB;WANT_MINIZ;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
@ -154,7 +154,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_ZLIB;WANT_MINIZ;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_ZLIB;WANT_MINIZ;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
@ -254,7 +254,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\input\input_common.c">
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\input\autoconf_builtin.c">
|
||||
<ClCompile Include="..\..\input\autoconf\builtin_win.c">
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\message.c">
|
||||
</ClCompile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user