Enable LLE USB + add SDL submodule

This commit is contained in:
ergo720 2018-12-24 00:27:30 +01:00
parent c24f83f9b4
commit 0fc2a7c3b2
14 changed files with 37 additions and 17 deletions

4
.gitmodules vendored
View File

@ -13,3 +13,7 @@
[submodule "import/simpleini"]
path = import/simpleini
url = https://github.com/brofield/simpleini
[submodule "import\\SDL2"]
path = import\\SDL2
url = https://github.com/spurious/SDL-mirror
branch = release-2.0.9

View File

@ -5,6 +5,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcxproj", "{E7A72D3D-5810-4078-A243-348B59726365}"
ProjectSection(ProjectDependencies) = postProject
{EFA81330-D410-4232-9A0C-1D8B91B6FFFF} = {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
{B8D9AFC2-B38F-4714-846D-8A2754F076C9} = {B8D9AFC2-B38F-4714-846D-8A2754F076C9}
{2171C0E8-4915-49B9-AC23-A484FA08C126} = {2171C0E8-4915-49B9-AC23-A484FA08C126}
EndProjectSection
@ -26,6 +27,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XbSymbolDatabase", "..\..\i
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxVSBC", "CxbxVSBC.vcxproj", "{EFA81330-D410-4232-9A0C-1D8B91B6FFFF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "..\..\import\SDL2\VisualC\SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -100,6 +103,16 @@ Global
{EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|Win32.Build.0 = Release|Win32
{EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|x64.ActiveCfg = Release|x64
{EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|x64.Build.0 = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Any CPU.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Any CPU.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -50,9 +50,9 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\import\DirectX8\include;$(IncludePath)</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\import\DirectX8\include;..\..\import\SDL2\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\import\DirectX8\lib;$(LibraryPath)</LibraryPath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\import\DirectX8\include;$(IncludePath)</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\import\DirectX8\include;..\..\import\SDL2\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\import\DirectX8\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -95,7 +95,7 @@
<AdditionalIncludeDirectories>Include\Win32\Cxbx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>legacy_stdio_definitions.lib;d3d9.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr9.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx9.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>legacy_stdio_definitions.lib;d3d9.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr9.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx9.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(Configuration)\;..\..\import\distorm\lib\Win32\;..\..\import\glew-2.0.0\lib\Release\Win32\;..\..\import\DirectX9\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -165,7 +165,7 @@
<AdditionalIncludeDirectories>Include\Win32\Cxbx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>legacy_stdio_definitions.lib;d3d9.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr9.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx9.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>legacy_stdio_definitions.lib;d3d9.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr9.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx9.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(Configuration)\;..\..\import\distorm\lib\Win32\;..\..\import\glew-2.0.0\lib\Release\Win32\;..\..\import\DirectX9\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>

1
import/SDL2 Submodule

@ -0,0 +1 @@
Subproject commit 8a812a24270dc19824a666b3c9b7fdd8f8829891

View File

@ -588,6 +588,7 @@ BEGIN
POPUP "&LLE (Experimental)", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "LLE &GPU", ID_EMULATION_LLE_GPU,MFT_STRING,MFS_ENABLED
MENUITEM "LLE &USB", ID_EMULATION_LLE_USB,MFT_STRING,MFS_ENABLED
END
POPUP "Hacks", 65535,MFT_STRING,MFS_ENABLED
BEGIN

View File

@ -33,7 +33,7 @@
// * All rights reserved
// *
// ******************************************************************
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
#define _XBOXKRNL_DEFEXTRN_
#define LOG_PREFIX CXBXR_MODULE::SDL2

View File

@ -36,7 +36,7 @@
#ifndef INPUTCONFIG_H_
#define INPUTCONFIG_H_
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
#include <vector>
#include <atomic>
#include "SDL.h"

View File

@ -34,7 +34,7 @@
// *
// ******************************************************************
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
#include "SDL2_Device.h"
#include <assert.h>

View File

@ -36,7 +36,7 @@
#ifndef SDL2DEVICE_H_
#define SDL2DEVICE_H_
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
#include "InputConfig.h"

View File

@ -344,7 +344,7 @@ void EmuUpdateLLEStatus(uint32_t XbLibScan)
FlagsLLE ^= LLE_APU;
EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE APU.");
}
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
if ((FlagsLLE & LLE_USB) == false
&& (XbLibScan & XbSymbolLib_XAPILIB) == 0) {
bLLE_USB = true;

View File

@ -1365,7 +1365,7 @@ __declspec(noreturn) void CxbxKrnlInit
g_EmuShared->GetFlagsLLE(&CxbxLLE_Flags);
bLLE_APU = (CxbxLLE_Flags & LLE_APU) > 0;
bLLE_GPU = (CxbxLLE_Flags & LLE_GPU) > 0;
//bLLE_USB = (CxbxLLE_Flags & LLE_USB) > 0; // Reenable this when LLE USB actually works
bLLE_USB = (CxbxLLE_Flags & LLE_USB) > 0; // Reenable this when LLE USB actually works
bLLE_JIT = (CxbxLLE_Flags & LLE_JIT) > 0;
}
@ -1549,7 +1549,7 @@ __declspec(noreturn) void CxbxKrnlInit
InitializeListHead(&KiWaitInListHead);
if (bLLE_USB) {
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
int ret;
g_InputDeviceManager = new InputDeviceManager;
ret = g_InputDeviceManager->EnumSdl2Devices();

View File

@ -355,7 +355,7 @@ void XidGamepad::UsbXid_HandleControl(XboxDeviceState* dev, USBPacket* p,
// If the buffer has the correct length the full input data is transferred."
if (value == 0x0100) {
if (length <= m_XidState->in_state.bLength) {
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
SDL2Devices* controller = g_InputDeviceManager->FindDeviceFromXboxPort(m_Port);
if (controller != nullptr) {
controller->ReadButtonState(&m_XidState->in_state.wButtons, m_XidState->in_state.bAnalogButtons,
@ -484,7 +484,7 @@ void XidGamepad::UsbXid_HandleData(XboxDeviceState* dev, USBPacket* p)
switch (p->Pid) {
case USB_TOKEN_IN: {
if (p->Endpoint->Num == 2) {
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
SDL2Devices* controller = g_InputDeviceManager->FindDeviceFromXboxPort(m_Port);
if (controller != nullptr) {
bool ret;
@ -498,7 +498,7 @@ void XidGamepad::UsbXid_HandleData(XboxDeviceState* dev, USBPacket* p)
#endif
p->Status = USB_RET_NAK;
}
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
}
else {
p->Status = USB_RET_STALL;

View File

@ -316,6 +316,7 @@
#define ID_EMULATION_LLE_APU 40039
#define ID_EMULATION_LLE_GPU 40040
#define ID_EMULATION_LLE_JIT 40041
#define ID_EMULATION_LLE_USB 40042
#define ID_SETTINGS_CONFIG_CONTROLLER 40046
#define ID_SETTINGS_CONFIG_VIDEO 40047
#define ID_SETTINGS_CONFIG_AUDIO 40048

View File

@ -1221,7 +1221,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
RefreshMenus();
}
break;
#if 0 // Reenable this when LLE USB actually works
#if 1 // Reenable this when LLE USB actually works
case ID_EMULATION_LLE_USB:
{
g_Settings->m_core.FlagsLLE = g_Settings->m_core.FlagsLLE ^ LLE_USB;
@ -1710,8 +1710,8 @@ void WndMain::RefreshMenus()
chk_flag = (g_Settings->m_core.FlagsLLE & LLE_GPU) ? MF_CHECKED : MF_UNCHECKED;
CheckMenuItem(settings_menu, ID_EMULATION_LLE_GPU, chk_flag);
//chk_flag = (g_Settings->m_core.FlagsLLE & LLE_USB) ? MF_CHECKED : MF_UNCHECKED; // Reenable this when LLE USB actually works
//CheckMenuItem(settings_menu, ID_EMULATION_LLE_USB, chk_flag);
chk_flag = (g_Settings->m_core.FlagsLLE & LLE_USB) ? MF_CHECKED : MF_UNCHECKED; // Reenable this when LLE USB actually works
CheckMenuItem(settings_menu, ID_EMULATION_LLE_USB, chk_flag);
chk_flag = (g_Settings->m_hacks.DisablePixelShaders) ? MF_CHECKED : MF_UNCHECKED;
CheckMenuItem(settings_menu, ID_HACKS_DISABLEPIXELSHADERS, chk_flag);