diff --git a/build/win32/Cxbx.vcxproj b/build/win32/Cxbx.vcxproj
index 1f0fb073f..1f122c870 100644
--- a/build/win32/Cxbx.vcxproj
+++ b/build/win32/Cxbx.vcxproj
@@ -227,9 +227,9 @@
-
-
-
+
+
+
@@ -239,16 +239,16 @@
-
-
-
-
-
+
+
+
+
+
-
-
+
+
@@ -419,18 +419,8 @@
%(PreprocessorDefinitions)
%(PreprocessorDefinitions)
-
- %(AdditionalIncludeDirectories)
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- %(PreprocessorDefinitions)
-
-
- %(AdditionalIncludeDirectories)
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- %(PreprocessorDefinitions)
-
+
+
%(AdditionalIncludeDirectories)
%(AdditionalIncludeDirectories)
@@ -476,36 +466,21 @@
-
-
- %(AdditionalIncludeDirectories)
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- %(PreprocessorDefinitions)
-
-
- %(AdditionalIncludeDirectories)
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- %(PreprocessorDefinitions)
-
-
-
+
+
+
%(AdditionalIncludeDirectories)
%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+
+
-
- %(AdditionalIncludeDirectories)
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- %(PreprocessorDefinitions)
-
-
+
+
%(AdditionalIncludeDirectories)
%(AdditionalIncludeDirectories)
diff --git a/build/win32/Cxbx.vcxproj.filters b/build/win32/Cxbx.vcxproj.filters
index e6a712e55..4f84615ac 100644
--- a/build/win32/Cxbx.vcxproj.filters
+++ b/build/win32/Cxbx.vcxproj.filters
@@ -109,11 +109,11 @@
Emulator
-
- Emulator
+
+ core\HLE\XAPI\OHCI\XInput
-
- Emulator
+
+ core\HLE\DSOUND\DirectSound
Emulator
@@ -130,23 +130,23 @@
Emulator
-
- Emulator
+
+ core\HLE\XACTENG
-
- Emulator
+
+ core\HLE\XAPI
-
- Emulator
+
+ core\HLE\XGRAPHIC
-
- Emulator
+
+ core\HLE\XAPI\OHCI\XInput
-
- Emulator
+
+ core\HLE\XONLINE
-
- Emulator
+
+ core\HLE
Kernel
@@ -320,11 +320,6 @@
Cross Platform\Win32
-
- Emulator
-
-
-
GUI
@@ -391,11 +386,11 @@
Emulator
-
- Emulator
+
+ core\HLE\XAPI\OHCI\XInput
-
- Emulator
+
+ core\HLE\DSOUND\DirectSound
Emulator
@@ -409,26 +404,26 @@
Emulator
-
- Emulator
+
+ core\HLE\XACTENG
-
- Emulator
+
+ core\HLE\XAPI
-
- Emulator
+
+ core\HLE\XGRAPHIC
-
- Emulator
+
+ core\HLE\XAPI\OHCI\XInput
-
- Emulator
+
+ core\HLE\XONLINE
Emulator
-
- Emulator
+
+ core\HLE
Emulator
@@ -469,8 +464,8 @@
Shared
-
- Emulator
+
+ core\HLE\DSOUND\DirectSound
GUI
@@ -631,9 +626,12 @@
Cross Platform
-
- Emulator
+
+ core\HLE
+
+ core\HLE
+
@@ -767,6 +765,39 @@
{76faeca9-d66f-43fb-9efa-ffb0668f8843}
+
+ {6d7b4608-3bf3-401f-924e-52617798e6b8}
+
+
+ {563da04b-4c54-4c1b-a055-809ce0f5bf97}
+
+
+ {5fcb96a1-736d-4749-ba21-a87dedc72427}
+
+
+ {9b3e7b4d-161e-4eeb-9338-3368e134b439}
+
+
+ {6f4e7159-1112-4a80-9e76-11963812811e}
+
+
+ {f9c6738c-bb93-4de5-b3ae-490f2d80fa74}
+
+
+ {69e32fa9-3fcd-400a-8d45-66b7ec3d555c}
+
+
+ {dd1295ad-f875-47dc-a6bb-d5679452f236}
+
+
+ {c6ea372d-ae98-46eb-917f-009302c000c5}
+
+
+ {c494f79e-ff8e-4b45-b1c3-1da0b4b9ee49}
+
+
+ {6f39b9de-ab9d-4780-b687-2d930f86738e}
+
diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp
index 33c11b791..7d01b5e7c 100644
--- a/src/CxbxKrnl/CxbxKrnl.cpp
+++ b/src/CxbxKrnl/CxbxKrnl.cpp
@@ -56,7 +56,7 @@ namespace xboxkrnl
#include "EmuKrnl.h"
#include "EmuShared.h"
#include "EmuXTL.h"
-#include "HLEIntercept.h"
+#include "core/HLE/Intercept.hpp"
#include "ReservedMemory.h" // For virtual_memory_placeholder
#include "VMManager.h"
#include "CxbxDebugger.h"
diff --git a/src/CxbxKrnl/Emu.cpp b/src/CxbxKrnl/Emu.cpp
index f4ed2de85..f1e9b236f 100644
--- a/src/CxbxKrnl/Emu.cpp
+++ b/src/CxbxKrnl/Emu.cpp
@@ -47,7 +47,7 @@ namespace xboxkrnl
#include "EmuFS.h"
#include "EmuXTL.h"
#include "EmuShared.h"
-#include "HLEIntercept.h"
+#include "core/HLE/Intercept.hpp"
#include "CxbxDebugger.h"
#ifdef _DEBUG
diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp
index 4af439259..83a20d9a3 100644
--- a/src/CxbxKrnl/EmuD3D8.cpp
+++ b/src/CxbxKrnl/EmuD3D8.cpp
@@ -57,7 +57,7 @@ namespace xboxkrnl
#include "EmuXTL.h"
#include "Logging.h"
#include "EmuD3D8Logging.h"
-#include "HLEIntercept.h" // for bLLE_GPU
+#include "core/HLE/Intercept.hpp" // for bLLE_GPU
#include "Cxbx/ResCxbx.h"
#include
diff --git a/src/CxbxKrnl/EmuX86.cpp b/src/CxbxKrnl/EmuX86.cpp
index 6c96923f1..7571ac2eb 100644
--- a/src/CxbxKrnl/EmuX86.cpp
+++ b/src/CxbxKrnl/EmuX86.cpp
@@ -49,7 +49,7 @@
#include "CxbxKrnl.h"
#include "Emu.h" // For EmuLog
#include "EmuX86.h"
-#include "HLEIntercept.h" // for bLLE_GPU
+#include "core/HLE/Intercept.hpp" // for bLLE_GPU
#include
#include "devices\Xbox.h" // For g_PCIBus
diff --git a/src/CxbxKrnl/EmuXTL.h b/src/CxbxKrnl/EmuXTL.h
index d9f9de73a..19a79ddfc 100644
--- a/src/CxbxKrnl/EmuXTL.h
+++ b/src/CxbxKrnl/EmuXTL.h
@@ -38,7 +38,7 @@
namespace XTL
{
- #include "EmuXapi.h"
+ #include "core/HLE/XAPI/Xapi.h"
#include "EmuD3D8.h"
#include "EmuD3D8\Convert.h"
#include "EmuD3D8\VertexBuffer.h"
@@ -46,12 +46,12 @@ namespace XTL
#include "EmuD3D8\VertexShader.h"
#include "EmuD3D8\PixelShader.h"
#include "EmuD3D8\State.h"
- #include "EmuDInput.h"
- #include "EmuDSound.h"
- #include "EmuXOnline.h"
- #include "EmuXG.h"
- #include "EmuXactEng.h"
- #include "EmuXInput.h"
+ #include "core/HLE/XAPI/OHCI/XInput/DInput.h"
+ #include "core/HLE/DSOUND/DirectSound/DirectSound.hpp"
+ #include "core/HLE/XONLINE/XOnline.h"
+ #include "core/HLE/XGRAPHIC/XGraphic.h"
+ #include "core/HLE/XACTENG/XactEng.h"
+ #include "core/HLE/XAPI/OHCI/XInput/XInput.h"
}
extern XTL::IDirect3DDevice *g_pD3DDevice;
diff --git a/src/CxbxKrnl/EmuDSound.cpp b/src/core/HLE/DSOUND/DirectSound/DirectSound.cpp
old mode 100755
new mode 100644
similarity index 99%
rename from src/CxbxKrnl/EmuDSound.cpp
rename to src/core/HLE/DSOUND/DirectSound/DirectSound.cpp
index 7de683c98..53e89ea84
--- a/src/CxbxKrnl/EmuDSound.cpp
+++ b/src/core/HLE/DSOUND/DirectSound/DirectSound.cpp
@@ -9,7 +9,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
-// * Cxbx->Win32->CxbxKrnl->EmuDSound.cpp
+// * src->core->HLE->DSound->DirectSound->DirectSound.cpp
// *
// * This file is part of the Cxbx project.
// *
@@ -45,11 +45,11 @@ namespace xboxkrnl {
#include
#include
-#include "CxbxKrnl.h"
-#include "Emu.h"
-#include "EmuFS.h"
-#include "EmuShared.h"
-#include "EmuXTL.h"
+#include "CxbxKrnl/CxbxKrnl.h"
+#include "CxbxKrnl/Emu.h"
+#include "CxbxKrnl/EmuFS.h"
+#include "CxbxKrnl/EmuShared.h"
+#include "CxbxKrnl/EmuXTL.h"
#include "Common/Settings.hpp"
@@ -220,7 +220,7 @@ static void dsound_thread_worker(LPVOID);
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "An issue has been found. Please report game title and console's output of return result," \
" function, and file name to https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/485"); } return hRet; }
-#include "EmuDSoundInline.hpp"
+#include "DirectSoundInline.hpp"
#ifdef __cplusplus
extern "C" {
diff --git a/src/CxbxKrnl/EmuDSound.h b/src/core/HLE/DSOUND/DirectSound/DirectSound.hpp
old mode 100755
new mode 100644
similarity index 99%
rename from src/CxbxKrnl/EmuDSound.h
rename to src/core/HLE/DSOUND/DirectSound/DirectSound.hpp
index 166ce467e..1d4b8d17a
--- a/src/CxbxKrnl/EmuDSound.h
+++ b/src/core/HLE/DSOUND/DirectSound/DirectSound.hpp
@@ -7,7 +7,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
-// * Cxbx->Win32->CxbxKrnl->EmuDSound.h
+// * src->core->HLE->DSound->DirectSound->DirectSound.h
// *
// * This file is part of the Cxbx project.
// *
diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/core/HLE/DSOUND/DirectSound/DirectSoundInline.hpp
similarity index 99%
rename from src/CxbxKrnl/EmuDSoundInline.hpp
rename to src/core/HLE/DSOUND/DirectSound/DirectSoundInline.hpp
index ff4c1fb36..96663cfdb 100644
--- a/src/CxbxKrnl/EmuDSoundInline.hpp
+++ b/src/core/HLE/DSOUND/DirectSound/DirectSoundInline.hpp
@@ -7,7 +7,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
-// * Cxbx->Win32->CxbxKrnl->EmuDSoundInline.hpp
+// * src->core->HLE->DSound->DirectSound->DirectSoundInline.hpp
// *
// * This file is part of the Cxbx project.
// *
diff --git a/src/CxbxKrnl/HLEIntercept.cpp b/src/core/HLE/Intercept.cpp
similarity index 98%
rename from src/CxbxKrnl/HLEIntercept.cpp
rename to src/core/HLE/Intercept.cpp
index 43ad2ff8e..18ecd3107 100644
--- a/src/CxbxKrnl/HLEIntercept.cpp
+++ b/src/core/HLE/Intercept.cpp
@@ -9,7 +9,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
-// * Cxbx->Win32->CxbxKrnl->HLEIntercept.cpp
+// * src->core->HLE->Intercept.cpp
// *
// * This file is part of the Cxbx project.
// *
@@ -38,18 +38,18 @@
#include
#include // For std::setfill and std::setw
-#include "CxbxKrnl.h"
-#include "Emu.h"
-#include "EmuFS.h"
-#include "EmuXTL.h"
-#include "EmuShared.h"
-#include "CxbxDebugger.h"
+#include "CxbxKrnl/CxbxKrnl.h"
+#include "CxbxKrnl/Emu.h"
+#include "CxbxKrnl/EmuFS.h"
+#include "CxbxKrnl/EmuXTL.h"
+#include "CxbxKrnl/EmuShared.h"
+#include "Common/CxbxDebugger.h"
#include "Logging.h"
#pragma comment(lib, "XbSymbolDatabase.lib")
#include "../../import/XbSymbolDatabase/XbSymbolDatabase.h"
-#include "HLEIntercept.h"
-#include "HLEPatches.h"
-#include "xxhash32.h"
+#include "Intercept.hpp"
+#include "Patches.hpp"
+#include "CxbxKrnl/xxhash32.h"
#include
#include
#include
@@ -60,19 +60,19 @@ std::map g_SymbolAddresses;
bool g_HLECacheUsed = false;
// D3D build version
-uint32 g_BuildVersion = 0;
-
+uint32 g_BuildVersion = 0;
+
bool bLLE_APU = false; // Set this to true for experimental APU (sound) LLE
-bool bLLE_GPU = false; // Set this to true for experimental GPU (graphics) LLE
+bool bLLE_GPU = false; // Set this to true for experimental GPU (graphics) LLE
bool bLLE_USB = false; // Set this to true for experimental USB (input) LLE
bool bLLE_JIT = false; // Set this to true for experimental JIT
void* GetXboxFunctionPointer(std::string functionName)
-{
- void* ptr = GetPatchedFunctionTrampoline(functionName);
- if (ptr != nullptr) {
- return ptr;
- }
+{
+ void* ptr = GetPatchedFunctionTrampoline(functionName);
+ if (ptr != nullptr) {
+ return ptr;
+ }
// If we got here, the function wasn't patched, so we can just look it up the HLE cache
// and return the correct offset
@@ -134,7 +134,7 @@ bool VerifySymbolAddressAgainstXRef(char *SymbolName, xbaddr Address, int XRef)
}
// For XREF_D3DTSS_TEXCOORDINDEX, Kabuki Warriors hits this case
- CxbxPopupMessage(LOG_PREFIX, LOG_LEVEL::WARNING, CxbxMsgDlgIcon_Warn,
+ CxbxPopupMessage(LOG_PREFIX, LOG_LEVEL::WARNING, CxbxMsgDlgIcon_Warn,
"Verification of %s failed : XREF was 0x%.8X while lookup gave 0x%.8X", SymbolName, XRefAddr, Address);
// For XREF_D3DTSS_TEXCOORDINDEX, Kabuki Warriors hits this case
return false;
@@ -266,10 +266,10 @@ void CDECL EmuRegisterSymbol(const char* library_str,
output << "\t*NO PATCH AVAILABLE!*";
}
}
-#endif
-
- output << "\n";
-
+#endif
+
+ output << "\n";
+
g_SymbolAddresses[symbol_str] = func_addr;
printf(output.str().c_str());
}
@@ -316,16 +316,16 @@ uint EmuUpdateLLEStatus(uint32_t XbLibScan)
bLLE_APU = true;
FlagsLLE ^= LLE_APU;
EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE APU.");
- }
-#if 0 // Reenable this when LLE USB actually works
+ }
+#if 0 // Reenable this when LLE USB actually works
if ((FlagsLLE & LLE_USB) == false
&& (XbLibScan & XbSymbolLib_XAPILIB) == 0) {
bLLE_USB = true;
FlagsLLE ^= LLE_USB;
EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE USB.");
- }
+ }
#endif
- ipc_send_gui_update(IPC_UPDATE_GUI::LLE_FLAGS, FlagsLLE);
+ ipc_send_gui_update(IPC_UPDATE_GUI::LLE_FLAGS, FlagsLLE);
return FlagsLLE;
}
@@ -472,8 +472,8 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader)
}
// If the HLE Cache was used, go straight to patching, no need to re-scan
- if (g_HLECacheUsed) {
- EmuInstallPatches();
+ if (g_HLECacheUsed) {
+ EmuInstallPatches();
return;
}
@@ -574,7 +574,7 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader)
std::stringstream cacheAddress;
cacheAddress << std::hex << (*it).second;
WritePrivateProfileString("Symbols", (*it).first.c_str(), cacheAddress.str().c_str(), filename.c_str());
- }
+ }
EmuInstallPatches();
}
diff --git a/src/CxbxKrnl/HLEIntercept.h b/src/core/HLE/Intercept.hpp
similarity index 95%
rename from src/CxbxKrnl/HLEIntercept.h
rename to src/core/HLE/Intercept.hpp
index 17a149593..d1cfe7ab9 100644
--- a/src/CxbxKrnl/HLEIntercept.h
+++ b/src/core/HLE/Intercept.hpp
@@ -7,7 +7,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
-// * Cxbx->Win32->CxbxKrnl->HLEIntercept.h
+// * src->core->HLE->Intercept.hpp
// *
// * This file is part of the Cxbx project.
// *
@@ -31,13 +31,13 @@
// * All rights reserved
// *
// ******************************************************************
-#ifndef HLEINTERCEPT_H
-#define HLEINTERCEPT_H
+#ifndef HLEINTERCEPT_HPP
+#define HLEINTERCEPT_HPP
#include