diff --git a/.gitignore b/.gitignore
index 03785b6..9493eff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,5 +9,6 @@ ipch/
VS_*
# Output Folders
+4J_*/Build/*
libs/
inc/
diff --git a/4JLibs.sln b/4JLibs.sln
index 7f867b1..f6036a6 100644
--- a/4JLibs.sln
+++ b/4JLibs.sln
@@ -67,76 +67,79 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PSVita", "PSVita", "{88A465
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Durango = Debug|Durango
Debug|ORBIS = Debug|ORBIS
- Debug|PS3 = Debug|PS3
- Debug|PSVita = Debug|PSVita
Debug|Windows64 = Debug|Windows64
- Debug|Xbox 360 = Debug|Xbox 360
+ Release|Durango = Release|Durango
Release|ORBIS = Release|ORBIS
- Release|PS3 = Release|PS3
- Release|PSVita = Release|PSVita
Release|Windows64 = Release|Windows64
- Release|Xbox 360 = Release|Xbox 360
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|ORBIS.ActiveCfg = Debug|Win32
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PS3.ActiveCfg = Debug|Win32
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PSVita.ActiveCfg = Debug|Win32
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.ActiveCfg = Debug|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.Build.0 = Debug|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.Deploy.0 = Debug|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|ORBIS.ActiveCfg = Debug|ORBIS
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|ORBIS.Build.0 = Debug|ORBIS
{A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Windows64.ActiveCfg = Debug|x64
{A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Windows64.Build.0 = Debug|x64
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Xbox 360.ActiveCfg = Debug|Win32
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|ORBIS.ActiveCfg = Release|Win32
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|PS3.ActiveCfg = Release|Win32
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|PSVita.ActiveCfg = Release|Win32
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.ActiveCfg = Release|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.Build.0 = Release|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.Deploy.0 = Release|Durango
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|ORBIS.ActiveCfg = Release|ORBIS
+ {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|ORBIS.Build.0 = Release|ORBIS
{A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Windows64.ActiveCfg = Release|x64
{A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Windows64.Build.0 = Release|x64
- {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Xbox 360.ActiveCfg = Release|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|ORBIS.ActiveCfg = Debug|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|PS3.ActiveCfg = Debug|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|PSVita.ActiveCfg = Debug|Win32
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.ActiveCfg = Debug|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.Build.0 = Debug|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.Deploy.0 = Debug|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|ORBIS.ActiveCfg = Debug|ORBIS
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|ORBIS.Build.0 = Debug|ORBIS
{C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Windows64.ActiveCfg = Debug|x64
{C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Windows64.Build.0 = Debug|x64
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Xbox 360.ActiveCfg = Debug|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|ORBIS.ActiveCfg = Release|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|PS3.ActiveCfg = Release|Win32
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|PSVita.ActiveCfg = Release|Win32
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.ActiveCfg = Release|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.Build.0 = Release|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.Deploy.0 = Release|Durango
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|ORBIS.ActiveCfg = Release|ORBIS
+ {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|ORBIS.Build.0 = Release|ORBIS
{C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Windows64.ActiveCfg = Release|x64
{C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Windows64.Build.0 = Release|x64
- {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Xbox 360.ActiveCfg = Release|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|ORBIS.ActiveCfg = Debug|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|PS3.ActiveCfg = Debug|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|PSVita.ActiveCfg = Debug|Win32
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.ActiveCfg = Debug|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Build.0 = Debug|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Deploy.0 = Debug|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|ORBIS.ActiveCfg = Debug|ORBIS
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|ORBIS.Build.0 = Debug|ORBIS
{22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Windows64.ActiveCfg = Debug|x64
{22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Windows64.Build.0 = Debug|x64
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Xbox 360.ActiveCfg = Debug|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|ORBIS.ActiveCfg = Release|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|PS3.ActiveCfg = Release|Win32
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|PSVita.ActiveCfg = Release|Win32
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Durango.ActiveCfg = Release|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Durango.Build.0 = Release|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Durango.Deploy.0 = Release|Durango
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|ORBIS.ActiveCfg = Release|ORBIS
+ {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|ORBIS.Build.0 = Release|ORBIS
{22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Windows64.ActiveCfg = Release|x64
{22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Windows64.Build.0 = Release|x64
- {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Xbox 360.ActiveCfg = Release|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|ORBIS.ActiveCfg = Debug|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|PS3.ActiveCfg = Debug|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|PSVita.ActiveCfg = Debug|Win32
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.ActiveCfg = Debug|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.Build.0 = Debug|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.Deploy.0 = Debug|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|ORBIS.ActiveCfg = Debug|ORBIS
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|ORBIS.Build.0 = Debug|ORBIS
{2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Windows64.ActiveCfg = Debug|x64
{2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Windows64.Build.0 = Debug|x64
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Xbox 360.ActiveCfg = Debug|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|ORBIS.ActiveCfg = Release|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|PS3.ActiveCfg = Release|Win32
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|PSVita.ActiveCfg = Release|Win32
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.ActiveCfg = Release|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.Build.0 = Release|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.Deploy.0 = Release|Durango
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|ORBIS.ActiveCfg = Release|ORBIS
+ {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|ORBIS.Build.0 = Release|ORBIS
{2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Windows64.ActiveCfg = Release|x64
{2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Windows64.Build.0 = Release|x64
- {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Xbox 360.ActiveCfg = Release|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|ORBIS.ActiveCfg = Debug|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|PS3.ActiveCfg = Debug|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|PSVita.ActiveCfg = Debug|Win32
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.ActiveCfg = Debug|Durango
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.Build.0 = Debug|Durango
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.Deploy.0 = Debug|Durango
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|ORBIS.ActiveCfg = Debug|ORBIS
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|ORBIS.Build.0 = Debug|ORBIS
{D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Windows64.ActiveCfg = Debug|x64
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Xbox 360.ActiveCfg = Debug|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|ORBIS.ActiveCfg = Release|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|PS3.ActiveCfg = Release|Win32
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|PSVita.ActiveCfg = Release|Win32
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|Durango.ActiveCfg = Release|Durango
+ {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|ORBIS.ActiveCfg = Release|ORBIS
{D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|Windows64.ActiveCfg = Release|x64
- {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|Xbox 360.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/4J_Input/4J_Input.vcxproj b/4J_Input/4J_Input.vcxproj
index 36a6072..c6c2564 100644
--- a/4J_Input/4J_Input.vcxproj
+++ b/4J_Input/4J_Input.vcxproj
@@ -1,17 +1,25 @@
-
+
Debug
- Win32
+ Durango
+
+
+ Debug
+ ORBIS
Debug
x64
-
+
Release
- Win32
+ Durango
+
+
+ Release
+ ORBIS
Release
@@ -19,107 +27,646 @@
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
-
-
-
-
-
-
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
{A9125E77-A460-46FB-8EF3-2166F8657226}
@@ -127,25 +674,12 @@
My4J_Input
-
- StaticLibrary
- true
- v110
- Unicode
-
StaticLibrary
true
v110
Unicode
-
- StaticLibrary
- false
- v110
- true
- Unicode
-
StaticLibrary
false
@@ -153,18 +687,26 @@
true
Unicode
+
+ v110
+
+
+ v110
+
+
+ Clang
+ StaticLibrary
+
+
+ Clang
+ StaticLibrary
+
-
-
-
-
-
-
@@ -172,32 +714,29 @@
$(ProjectName)_d
$(SolutionDir)\libs\
-
-
- $(ProjectName)_d
-
-
- $(ProjectName)_r
+ Build\$(Platform)\$(Configuration)\
$(ProjectName)_r
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
+
+
+ .a
+ $(ProjectDir);$(SCE_ORBIS_SDK_DIR)\host_tools\lib\clang\include;$(SCE_ORBIS_SDK_DIR)\target\include;$(SCE_ORBIS_SDK_DIR)\target\include_common;
+ Build\$(Platform)\$(Configuration)\
+
+
+ .a
+ $(ProjectDir);$(SCE_ORBIS_SDK_DIR)\host_tools\lib\clang\include;$(SCE_ORBIS_SDK_DIR)\target\include;$(SCE_ORBIS_SDK_DIR)\target\include_common;
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
-
-
Level3
@@ -217,25 +756,6 @@
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
- true
- true
-
-
Level3
@@ -259,6 +779,29 @@
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Orbis;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+ NormalWarnings
+
+
+
+
+ ../Headers/Orbis;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
diff --git a/4J_Input/4J_Input.vcxproj.filters b/4J_Input/4J_Input.vcxproj.filters
index 74305d5..2afc699 100644
--- a/4J_Input/4J_Input.vcxproj.filters
+++ b/4J_Input/4J_Input.vcxproj.filters
@@ -291,6 +291,18 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
@@ -314,5 +326,20 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/4J_Input/Orbis/4J_Input.cpp b/4J_Input/Orbis/4J_Input.cpp
new file mode 100644
index 0000000..b7cda3a
--- /dev/null
+++ b/4J_Input/Orbis/4J_Input.cpp
@@ -0,0 +1,14 @@
+#include "INP_OnScreenKeyboard.h"
+#include "4J_Input.h"
+#include "INP_Main.h"
+
+//str1k3r - to be renamed SelectBackSwapped
+void C_4JInput::SetCircleCrossSwapped(bool swapped)
+{
+ InternalInputManager.m_iSelectBackSwapped = swapped;
+}
+
+bool C_4JInput::IsCircleCrossSwapped()
+{
+ return InternalInputManager.m_iSelectBackSwapped;
+}
\ No newline at end of file
diff --git a/4J_Input/Orbis/INP_ForceFeedback.cpp b/4J_Input/Orbis/INP_ForceFeedback.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Input/Orbis/INP_ForceFeedback.h b/4J_Input/Orbis/INP_ForceFeedback.h
new file mode 100644
index 0000000..737ae6f
--- /dev/null
+++ b/4J_Input/Orbis/INP_ForceFeedback.h
@@ -0,0 +1,5 @@
+#pragma once
+
+class CForceFeedback
+{
+};
\ No newline at end of file
diff --git a/4J_Input/Orbis/INP_Main.cpp b/4J_Input/Orbis/INP_Main.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Input/Orbis/INP_Main.h b/4J_Input/Orbis/INP_Main.h
new file mode 100644
index 0000000..3064a26
--- /dev/null
+++ b/4J_Input/Orbis/INP_Main.h
@@ -0,0 +1,10 @@
+#pragma once
+
+class CInput
+{
+public:
+ bool m_iSelectBackSwapped;
+};
+
+// Singleton
+extern CInput InternalInputManager;
\ No newline at end of file
diff --git a/4J_Input/Orbis/INP_OnScreenKeyboard.cpp b/4J_Input/Orbis/INP_OnScreenKeyboard.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Input/Orbis/INP_OnScreenKeyboard.h b/4J_Input/Orbis/INP_OnScreenKeyboard.h
new file mode 100644
index 0000000..d719bf0
--- /dev/null
+++ b/4J_Input/Orbis/INP_OnScreenKeyboard.h
@@ -0,0 +1,5 @@
+#pragma once
+
+class CKeyboard
+{
+};
\ No newline at end of file
diff --git a/4J_Input/Orbis/LinkedList.cpp b/4J_Input/Orbis/LinkedList.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Input/Orbis/LinkedList.h b/4J_Input/Orbis/LinkedList.h
new file mode 100644
index 0000000..3a5d9d7
--- /dev/null
+++ b/4J_Input/Orbis/LinkedList.h
@@ -0,0 +1,5 @@
+#pragma once
+
+class LinkedList
+{
+};
\ No newline at end of file
diff --git a/4J_Input/Windows64/INP_ForceFeedback.cpp b/4J_Input/Windows64/INP_ForceFeedback.cpp
index 804615c..02fa3b4 100644
--- a/4J_Input/Windows64/INP_ForceFeedback.cpp
+++ b/4J_Input/Windows64/INP_ForceFeedback.cpp
@@ -85,8 +85,8 @@ void CForceFeedback::AddRumble(unsigned int uiPad, WORD leftMotorSpeed, WORD rig
QueryPerformanceCounter(&qwCurrentTime);
pRumble->m_TimeLeft = (m_TicksPerSecond * fSeconds) + qwCurrentTime.QuadPart;
- pRumble->m_RumbleData.wLeftMotorSpeed = leftMotorSpeed;
- pRumble->m_RumbleData.wRightMotorSpeed = rightMotorSpeed;
+ pRumble->m_LowFreqRumble = leftMotorSpeed;
+ pRumble->m_HighFreqRumble = rightMotorSpeed;
pRumble->m_Pad = uiPad;
m_RumbleList.AddToTail(pRumble);
@@ -108,14 +108,15 @@ void CForceFeedback::Tick(void)
LinkedList::_LL_NODE *pRumbleNode = m_RumbleList.m_Head;
while (pRumbleNode)
{
- if (pRumbleNode->GetDataAs()->m_TimeLeft <= qwCurrentTime.QuadPart)
+ RUMBLE_EFFECT *pRumble = pRumbleNode->GetDataAs();
+ SDL_Gamepad* m_pGamepad = SDL_GetGamepadFromPlayerIndex(pRumble->m_Pad);
+
+ if (pRumble->m_TimeLeft <= qwCurrentTime.QuadPart)
{
- RUMBLE_EFFECT *pRumble = pRumbleNode->GetDataAs();
+ pRumble->m_LowFreqRumble = 0;
+ pRumble->m_HighFreqRumble = 0;
- pRumble->m_RumbleData.wLeftMotorSpeed = 0;
- pRumble->m_RumbleData.wRightMotorSpeed = 0;
-
- XInputSetState(pRumble->m_Pad, &pRumble->m_RumbleData);
+ if (m_pGamepad != nullptr) SDL_RumbleGamepad(m_pGamepad, 0, 0, 0);
m_RumbleList.RemoveNode(pRumbleNode);
@@ -127,7 +128,7 @@ void CForceFeedback::Tick(void)
}
else
{
- XInputSetState(pRumbleNode->GetDataAs()->m_Pad, &pRumbleNode->GetDataAs()->m_RumbleData);
+ if (m_pGamepad != nullptr) SDL_RumbleGamepad(m_pGamepad, pRumble->m_LowFreqRumble, pRumble->m_HighFreqRumble, 30000);
pRumbleNode = pRumbleNode->m_Next;
}
}
diff --git a/4J_Input/Windows64/INP_ForceFeedback.h b/4J_Input/Windows64/INP_ForceFeedback.h
index df75a47..1f647e1 100644
--- a/4J_Input/Windows64/INP_ForceFeedback.h
+++ b/4J_Input/Windows64/INP_ForceFeedback.h
@@ -24,6 +24,7 @@ SOFTWARE.
*/
#include "LinkedList.h"
+#include "SDL3\SDL_gamepad.h"
#define MAX_EFFECTS 10
@@ -38,9 +39,10 @@ public:
struct RUMBLE_EFFECT
{
- DWORD m_Pad;
+ int m_Pad;
uint64_t m_TimeLeft;
- XINPUT_VIBRATION m_RumbleData;
+ uint16_t m_LowFreqRumble;
+ uint16_t m_HighFreqRumble;
WORD unk;
};
diff --git a/4J_Input/Windows64/INP_Main.cpp b/4J_Input/Windows64/INP_Main.cpp
index edddb38..fcf8076 100644
--- a/4J_Input/Windows64/INP_Main.cpp
+++ b/4J_Input/Windows64/INP_Main.cpp
@@ -27,10 +27,11 @@ SOFTWARE.
CInput InternalInputManager;
-bool m_SelectBackSwapped = false;
-
CInput::CInput()
{
+ m_Keyboard = CKeyboard();
+ m_bSelectBackSwapped = false;
+
m_uiSigninJoypadMask = 0;
for (int i = 0; i < 4; ++i)
m_bIsMenuDisplayed[i] = 0;
@@ -148,6 +149,11 @@ void CInput::SetJoypadValues(JOYPAD *pThisPad)
pThisPad->m_uiButtons |= _360_JOY_BUTTON_BACK;
}
+ if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_TOUCHPAD))
+ {
+ pThisPad->m_uiButtons |= _PS_JOY_BUTTON_TOUCHPAD;
+ }
+
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_LEFT_STICK))
{
pThisPad->m_uiButtons |= _360_JOY_BUTTON_LTHUMB;
@@ -316,7 +322,21 @@ unsigned int CInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucActi
//str1k3r - renamed to match the Orbis Input lib, why did i rename it cause tism
EControllerType CInput::GetControllerType(int iPad)
{
- return GetControllerName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad)); // str1k3r - magic we return it :shocked:
+ //str1k3r - if the pad is connected then check the type, if we are the same type or we arent connected return the last type
+ if(InternalInputManager.IsPadConnected(iPad))
+ {
+ EControllerType ControllerType = GetControllerName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad));
+
+ if(ControllerType != m_LastControllerType)
+ {
+ m_LastControllerType = ControllerType;
+ return ControllerType;
+ }
+
+ return m_LastControllerType;
+ }
+
+ return m_LastControllerType;
}
void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
@@ -404,12 +424,15 @@ bool CInput::IsPadConnected(int iPad)
void CInput::SetSelectBackSwapped(bool swapped)
{
- m_SelectBackSwapped = swapped;
+ if(m_bSelectBackSwapped != swapped)
+ {
+ m_bSelectBackSwapped = swapped;
+ }
}
bool CInput::IsSelectBackSwapped()
{
- return m_SelectBackSwapped;
+ return m_bSelectBackSwapped;
}
bool CInput::IsPadActive(int iPad)
diff --git a/4J_Input/Windows64/INP_Main.h b/4J_Input/Windows64/INP_Main.h
index 86fe1cd..dfa07a2 100644
--- a/4J_Input/Windows64/INP_Main.h
+++ b/4J_Input/Windows64/INP_Main.h
@@ -169,10 +169,13 @@ public:
unsigned int **m_JoypadMap;
+ bool m_bSelectBackSwapped;
+
bool m_bJoypadMapArrayIsSetup;
unsigned int m_uiSigninJoypadMask;
bool m_bIsMenuDisplayed[MAX_JOYPADS];
+ EControllerType m_LastControllerType;
CForceFeedback m_ForceFeedback;
CKeyboard m_Keyboard;
diff --git a/4J_Input/stdafx.h b/4J_Input/stdafx.h
index cd473ea..694cd67 100644
--- a/4J_Input/stdafx.h
+++ b/4J_Input/stdafx.h
@@ -7,7 +7,16 @@
#include
#include
-#include
+#endif
+
+#ifdef __ORBIS__
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#endif
#ifndef _XBOX
diff --git a/4J_Profile/4J_Profile.vcxproj b/4J_Profile/4J_Profile.vcxproj
index e3822b7..eb81c6c 100644
--- a/4J_Profile/4J_Profile.vcxproj
+++ b/4J_Profile/4J_Profile.vcxproj
@@ -1,17 +1,25 @@
-
+
Debug
- Win32
+ Durango
+
+
+ Debug
+ ORBIS
Debug
x64
-
+
Release
- Win32
+ Durango
+
+
+ Release
+ ORBIS
Release
@@ -19,21 +27,130 @@
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
-
-
-
-
-
-
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
-
-
-
-
-
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
+
+ true
+ true
+ true
+ true
+
{C3833C67-05E4-4D6C-8707-22F95B6939E4}
@@ -41,25 +158,12 @@
My4J_Profile
-
- StaticLibrary
- true
- v110
- Unicode
-
StaticLibrary
true
v110
Unicode
-
- StaticLibrary
- false
- v110
- true
- Unicode
-
StaticLibrary
false
@@ -67,51 +171,62 @@
true
Unicode
+
+ v110
+ StaticLibrary
+
+
+ v110
+ StaticLibrary
+
+
+ Clang
+ StaticLibrary
+
+
+ Clang
+ StaticLibrary
+
-
-
-
-
-
-
-
- $(ProjectName)_d
-
$(ProjectName)_d
$(SolutionDir)\libs\
-
-
- $(ProjectName)_r
+ Build\$(Platform)\$(Configuration)\
$(ProjectName)_r
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
+
+
+ .lib
+ $(Console_SdkRoot)bin;$(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);
+ $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)
+ $(Console_SdkLibPath)
+ $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)
+ $(Console_SdkIncludeRoot)
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
-
-
NotUsing
@@ -130,25 +245,6 @@
true
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
- true
- true
-
-
Level3
@@ -171,6 +267,22 @@
true
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Orbis;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+ NormalWarnings
+
+
diff --git a/4J_Profile/4J_Profile.vcxproj.filters b/4J_Profile/4J_Profile.vcxproj.filters
index 30ffc7a..48f7940 100644
--- a/4J_Profile/4J_Profile.vcxproj.filters
+++ b/4J_Profile/4J_Profile.vcxproj.filters
@@ -36,6 +36,21 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -56,5 +71,17 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
\ No newline at end of file
diff --git a/4J_Profile/Durango/4J_Profile.cpp b/4J_Profile/Durango/4J_Profile.cpp
new file mode 100644
index 0000000..4894a00
--- /dev/null
+++ b/4J_Profile/Durango/4J_Profile.cpp
@@ -0,0 +1,22 @@
+#include "4J_Profile.h"
+#include "PRO_Main.h"
+
+HRESULT C_4JProfile::GetLiveConnectionStatus()
+{
+ return S_OK; //str1k3r - 4J you're strange for this
+}
+
+bool C_4JProfile::IsSystemUIDisplayed()
+{
+ return 0;
+}
+
+bool C_4JProfile::LocaleIsUSorCanada()
+{
+ return InternalProfileManager.m_Sys.LocaleIsUSorCanada();
+}
+
+bool C_4JProfile::LocaleIsChina()
+{
+ return InternalProfileManager.m_Sys.LocaleIsChina();
+}
\ No newline at end of file
diff --git a/4J_Profile/Durango/Durango_PlayerUID.cpp b/4J_Profile/Durango/Durango_PlayerUID.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Profile/Durango/Durango_PlayerUID.h b/4J_Profile/Durango/Durango_PlayerUID.h
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Profile/Durango/PRO_Data.cpp b/4J_Profile/Durango/PRO_Data.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Profile/Durango/PRO_Data.h b/4J_Profile/Durango/PRO_Data.h
new file mode 100644
index 0000000..e69de29
diff --git a/4J_Profile/Durango/PRO_Main.cpp b/4J_Profile/Durango/PRO_Main.cpp
new file mode 100644
index 0000000..61bb5a0
--- /dev/null
+++ b/4J_Profile/Durango/PRO_Main.cpp
@@ -0,0 +1,3 @@
+#include "PRO_Main.h"
+
+CProfile InternalProfileManager;
\ No newline at end of file
diff --git a/4J_Profile/Durango/PRO_Main.h b/4J_Profile/Durango/PRO_Main.h
new file mode 100644
index 0000000..aef4b4f
--- /dev/null
+++ b/4J_Profile/Durango/PRO_Main.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "PRO_Sys.h"
+
+class CProfile
+{
+public:
+ CProfile();
+
+ CSys m_Sys;
+};
+
+// Singleton
+extern CProfile InternalProfileManager;
\ No newline at end of file
diff --git a/4J_Profile/Durango/PRO_Sys.cpp b/4J_Profile/Durango/PRO_Sys.cpp
new file mode 100644
index 0000000..054eb32
--- /dev/null
+++ b/4J_Profile/Durango/PRO_Sys.cpp
@@ -0,0 +1,21 @@
+#include "PRO_Sys.h"
+
+CSys::CSys() {}
+
+//str1k3r - 1:1 to decomp
+bool CSys::LocaleIsUSorCanada()
+{
+ GEOID UserGeoID;
+
+ UserGeoID = GetUserGeoID(GEOCLASS_NATION);
+ return UserGeoID == 39 || UserGeoID == 244;
+}
+
+//str1k3r - missing from TU18 Libs, added in TU19/20
+bool CSys::LocaleIsChina()
+{
+ GEOID UserGeoID;
+
+ UserGeoID = GetUserGeoID(GEOCLASS_NATION);
+ return UserGeoID == 45;
+}
\ No newline at end of file
diff --git a/4J_Profile/Durango/PRO_Sys.h b/4J_Profile/Durango/PRO_Sys.h
new file mode 100644
index 0000000..c9bd269
--- /dev/null
+++ b/4J_Profile/Durango/PRO_Sys.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "4J_Profile.h"
+
+class CSys
+{
+public:
+ CSys();
+
+ // Locale
+ bool LocaleIsUSorCanada();
+ bool LocaleIsChina();
+};
\ No newline at end of file
diff --git a/4J_Profile/Windows64/4J_Profile.cpp b/4J_Profile/Windows64/4J_Profile.cpp
index 1949a61..949fb82 100644
--- a/4J_Profile/Windows64/4J_Profile.cpp
+++ b/4J_Profile/Windows64/4J_Profile.cpp
@@ -90,3 +90,13 @@ void C_4JProfile::SetDebugFullOverride(bool bVal)
{
InternalProfileManager.m_Sys.SetDebugFullOverride(bVal);
}
+
+bool C_4JProfile::LocaleIsUSorCanada()
+{
+ return InternalProfileManager.m_Sys.LocaleIsUSorCanada();
+}
+
+bool C_4JProfile::LocaleIsChina()
+{
+ return InternalProfileManager.m_Sys.LocaleIsChina();
+}
diff --git a/4J_Profile/Windows64/PRO_Main.cpp b/4J_Profile/Windows64/PRO_Main.cpp
index b798091..7b0435d 100644
--- a/4J_Profile/Windows64/PRO_Main.cpp
+++ b/4J_Profile/Windows64/PRO_Main.cpp
@@ -2,12 +2,20 @@
CProfile InternalProfileManager;
+CProfile::CProfile()
+{
+ m_LockedProfile = 0;
+}
+
int CProfile::GetLockedProfile()
{
- return 0;
+ return m_LockedProfile;
}
void CProfile::SetLockedProfile(int iProf)
{
- ;
+ if(m_LockedProfile != iProf)
+ {
+ m_LockedProfile = iProf;
+ }
}
\ No newline at end of file
diff --git a/4J_Profile/Windows64/PRO_Main.h b/4J_Profile/Windows64/PRO_Main.h
index 8d007ed..dad74e9 100644
--- a/4J_Profile/Windows64/PRO_Main.h
+++ b/4J_Profile/Windows64/PRO_Main.h
@@ -6,11 +6,16 @@
class CProfile
{
public:
+ CProfile();
+
int GetLockedProfile();
void SetLockedProfile(int iProf);
CSys m_Sys;
CProfileData m_ProfileData;
+
+private:
+ int m_LockedProfile;
};
// Singleton
diff --git a/4J_Profile/Windows64/PRO_Sys.cpp b/4J_Profile/Windows64/PRO_Sys.cpp
index 554ac86..309a0c3 100644
--- a/4J_Profile/Windows64/PRO_Sys.cpp
+++ b/4J_Profile/Windows64/PRO_Sys.cpp
@@ -2,8 +2,13 @@
#include "4J_Input.h"
bool s_bProfileIsFullVersion = true;
-char fakeGamerTag[16] = "PlayerName";
-wchar_t fakeGamerTagW[16] = L"PlayerName";
+char fakeGamerTag[XUSER_NAME_SIZE] = "PlayerName";
+wchar_t fakeGamerTagW[XUSER_NAME_SIZE] = L"PlayerName";
+
+CSys::CSys()
+{
+ m_iPrimaryPad = 0;
+}
bool CSys::IsSignedIn(int iQuadrant)
{
@@ -69,7 +74,7 @@ void CSys::SetFakeGamertag(char *name)
size_t chars = 0;
strcpy_s(fakeGamerTag, name);
- mbstowcs_s(&chars, fakeGamerTagW, 16, name, _TRUNCATE);
+ mbstowcs_s(&chars, fakeGamerTagW, XUSER_NAME_SIZE, name, _TRUNCATE);
}
char* CSys::GetGamertag(int iPad)
@@ -79,7 +84,7 @@ char* CSys::GetGamertag(int iPad)
return fakeGamerTag;
}
- static char iPadGamertag[32];
+ char iPadGamertag[XUSER_NAME_SIZE];
_snprintf_s(iPadGamertag, sizeof(iPadGamertag), "%s (%d)", fakeGamerTag, iPad);
@@ -93,7 +98,7 @@ wstring CSys::GetDisplayName(int iPad)
return fakeGamerTagW;
}
- wchar_t iPadGamertagW[16];
+ wchar_t iPadGamertagW[XUSER_NAME_SIZE];
_snwprintf_s(iPadGamertagW, _countof(iPadGamertagW), L"%s (%d)", fakeGamerTagW, iPad);
@@ -107,12 +112,17 @@ bool CSys::AllowedToPlayMultiplayer(int iProf)
int CSys::GetPrimaryPad()
{
- return 0;
+ return m_iPrimaryPad;
}
void CSys::SetPrimaryPad(int iPad)
{
- ; //str1k3r - stubbed out
+ m_iPrimaryPad = iPad;
+}
+
+void CSys::SetDebugFullOverride(bool bVal)
+{
+ s_bProfileIsFullVersion = bVal;
}
bool CSys::IsFullVersion()
@@ -120,7 +130,19 @@ bool CSys::IsFullVersion()
return s_bProfileIsFullVersion;
}
-void CSys::SetDebugFullOverride(bool bVal)
+//str1k3r - fun fact this is 1:1 to the Durango lib
+bool CSys::LocaleIsUSorCanada()
{
- s_bProfileIsFullVersion = bVal;
+ GEOID UserGeoID;
+
+ UserGeoID = GetUserGeoID(GEOCLASS_NATION);
+ return UserGeoID == 39 || UserGeoID == 244;
+}
+
+bool CSys::LocaleIsChina()
+{
+ GEOID UserGeoID;
+
+ UserGeoID = GetUserGeoID(GEOCLASS_NATION);
+ return UserGeoID == 45;
}
\ No newline at end of file
diff --git a/4J_Profile/Windows64/PRO_Sys.h b/4J_Profile/Windows64/PRO_Sys.h
index f933baf..4016be3 100644
--- a/4J_Profile/Windows64/PRO_Sys.h
+++ b/4J_Profile/Windows64/PRO_Sys.h
@@ -5,6 +5,8 @@
class CSys
{
public:
+ CSys();
+
// SIGNED IN
bool IsSignedIn(int iQuadrant);
bool IsSignedInLive(int iProf);
@@ -27,4 +29,10 @@ public:
bool IsFullVersion();
void SetDebugFullOverride(bool bVal);
+
+ // LOCALE
+ bool LocaleIsUSorCanada();
+ bool LocaleIsChina();
+
+ int m_iPrimaryPad;
};
\ No newline at end of file
diff --git a/4J_Profile/stdafx.h b/4J_Profile/stdafx.h
index cd473ea..694cd67 100644
--- a/4J_Profile/stdafx.h
+++ b/4J_Profile/stdafx.h
@@ -7,7 +7,16 @@
#include
#include
-#include
+#endif
+
+#ifdef __ORBIS__
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#endif
#ifndef _XBOX
diff --git a/4J_Render/4J_Render.vcxproj b/4J_Render/4J_Render.vcxproj
index 9024c05..784b98b 100644
--- a/4J_Render/4J_Render.vcxproj
+++ b/4J_Render/4J_Render.vcxproj
@@ -1,17 +1,25 @@
-
+
Debug
- Win32
+ Durango
+
+
+ Debug
+ ORBIS
Debug
x64
-
+
Release
- Win32
+ Durango
+
+
+ Release
+ ORBIS
Release
@@ -20,50 +28,173 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
{22938163-5DDB-4D04-883B-07212EB99FAE}
@@ -71,25 +202,12 @@
My4J_Render
-
- StaticLibrary
- true
- v110
- Unicode
-
StaticLibrary
true
v110
Unicode
-
- StaticLibrary
- false
- v110
- true
- Unicode
-
StaticLibrary
false
@@ -97,6 +215,20 @@
true
Unicode
+
+ v110
+
+
+ v110
+
+
+ Clang
+ StaticLibrary
+
+
+ Clang
+ StaticLibrary
+
@@ -116,32 +248,27 @@
$(ProjectName)_d
$(SolutionDir)\libs\
-
-
- $(ProjectName)_d
-
-
- $(ProjectName)_r
+ Build\$(Platform)\$(Configuration)\
$(ProjectName)_r
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
-
-
- Create
- Level3
- Disabled
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
-
-
NotUsing
@@ -164,25 +291,6 @@
./Windows64/shaders/build.bat
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
- true
- true
-
-
Level3
@@ -209,6 +317,22 @@
./Windows64/shaders/build.bat
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Orbis;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+ NormalWarnings
+
+
diff --git a/4J_Render/Windows64/CompiledShaders.h b/4J_Render/Windows64/CompiledShaders.h
index bd16be7..35d3601 100644
--- a/4J_Render/Windows64/CompiledShaders.h
+++ b/4J_Render/Windows64/CompiledShaders.h
@@ -36,4 +36,5 @@ SOFTWARE.
#include "PS_TextureProjection.h"
#include "PS_ForceLOD.h"
#include "PS_ScreenSpace.h"
-#include "PS_ScreenClear.h"
\ No newline at end of file
+#include "PS_ScreenClear.h"
+#include "PS_ScreenGamma.h"
\ No newline at end of file
diff --git a/4J_Render/Windows64/PS_ScreenGamma.h b/4J_Render/Windows64/PS_ScreenGamma.h
new file mode 100644
index 0000000..ef80566
--- /dev/null
+++ b/4J_Render/Windows64/PS_ScreenGamma.h
@@ -0,0 +1,201 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 10.1
+//
+//
+// Buffer Definitions:
+//
+// cbuffer gammaBuff
+// {
+//
+// float4 gammaParams; // Offset: 0 Size: 16
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim HLSL Bind Count
+// ------------------------------ ---------- ------- ----------- -------------- ------
+// screen_sampler_s sampler NA NA s0 1
+// screen_texture texture float4 2d t0 1
+// gammaBuff cbuffer NA NA cb6 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+// TEXCOORD 0 xy 1 NONE float xy
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+//
+ps_4_0
+dcl_constantbuffer CB6[1], immediateIndexed
+dcl_sampler s0, mode_default
+dcl_resource_texture2d (float,float,float,float) t0
+dcl_input_ps linear v1.xy
+dcl_output o0.xyzw
+dcl_temps 1
+sample r0.xyzw, v1.xyxx, t0.xyzw, s0
+mov_sat r0.xyz, r0.xyzx
+mov o0.w, r0.w
+log r0.xyz, r0.xyzx
+mul r0.xyz, r0.xyzx, cb6[0].xxxx
+exp o0.xyz, r0.xyzx
+ret
+// Approximately 7 instruction slots used
+#endif
+
+const BYTE g_main_PS_ScreenGamma[] =
+{
+ 68, 88, 66, 67, 53, 209,
+ 160, 253, 213, 124, 231, 96,
+ 156, 17, 77, 217, 140, 64,
+ 219, 192, 1, 0, 0, 0,
+ 84, 3, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 88, 1, 0, 0, 176, 1,
+ 0, 0, 228, 1, 0, 0,
+ 216, 2, 0, 0, 82, 68,
+ 69, 70, 28, 1, 0, 0,
+ 1, 0, 0, 0, 168, 0,
+ 0, 0, 3, 0, 0, 0,
+ 28, 0, 0, 0, 0, 4,
+ 255, 255, 0, 129, 0, 0,
+ 244, 0, 0, 0, 124, 0,
+ 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0,
+ 0, 0, 1, 0, 0, 0,
+ 141, 0, 0, 0, 2, 0,
+ 0, 0, 5, 0, 0, 0,
+ 4, 0, 0, 0, 255, 255,
+ 255, 255, 0, 0, 0, 0,
+ 1, 0, 0, 0, 13, 0,
+ 0, 0, 156, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6, 0,
+ 0, 0, 1, 0, 0, 0,
+ 1, 0, 0, 0, 115, 99,
+ 114, 101, 101, 110, 95, 115,
+ 97, 109, 112, 108, 101, 114,
+ 95, 115, 0, 115, 99, 114,
+ 101, 101, 110, 95, 116, 101,
+ 120, 116, 117, 114, 101, 0,
+ 103, 97, 109, 109, 97, 66,
+ 117, 102, 102, 0, 171, 171,
+ 156, 0, 0, 0, 1, 0,
+ 0, 0, 192, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 216, 0, 0, 0, 0, 0,
+ 0, 0, 16, 0, 0, 0,
+ 2, 0, 0, 0, 228, 0,
+ 0, 0, 0, 0, 0, 0,
+ 103, 97, 109, 109, 97, 80,
+ 97, 114, 97, 109, 115, 0,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 105,
+ 99, 114, 111, 115, 111, 102,
+ 116, 32, 40, 82, 41, 32,
+ 72, 76, 83, 76, 32, 83,
+ 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108,
+ 101, 114, 32, 49, 48, 46,
+ 49, 0, 73, 83, 71, 78,
+ 80, 0, 0, 0, 2, 0,
+ 0, 0, 8, 0, 0, 0,
+ 56, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0,
+ 0, 0, 15, 0, 0, 0,
+ 68, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 1, 0,
+ 0, 0, 3, 3, 0, 0,
+ 83, 86, 95, 80, 79, 83,
+ 73, 84, 73, 79, 78, 0,
+ 84, 69, 88, 67, 79, 79,
+ 82, 68, 0, 171, 171, 171,
+ 79, 83, 71, 78, 44, 0,
+ 0, 0, 1, 0, 0, 0,
+ 8, 0, 0, 0, 32, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0,
+ 15, 0, 0, 0, 83, 86,
+ 95, 84, 65, 82, 71, 69,
+ 84, 0, 171, 171, 83, 72,
+ 68, 82, 236, 0, 0, 0,
+ 64, 0, 0, 0, 59, 0,
+ 0, 0, 89, 0, 0, 4,
+ 70, 142, 32, 0, 6, 0,
+ 0, 0, 1, 0, 0, 0,
+ 90, 0, 0, 3, 0, 96,
+ 16, 0, 0, 0, 0, 0,
+ 88, 24, 0, 4, 0, 112,
+ 16, 0, 0, 0, 0, 0,
+ 85, 85, 0, 0, 98, 16,
+ 0, 3, 50, 16, 16, 0,
+ 1, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0,
+ 0, 0, 0, 0, 104, 0,
+ 0, 2, 1, 0, 0, 0,
+ 69, 0, 0, 9, 242, 0,
+ 16, 0, 0, 0, 0, 0,
+ 70, 16, 16, 0, 1, 0,
+ 0, 0, 70, 126, 16, 0,
+ 0, 0, 0, 0, 0, 96,
+ 16, 0, 0, 0, 0, 0,
+ 54, 32, 0, 5, 114, 0,
+ 16, 0, 0, 0, 0, 0,
+ 70, 2, 16, 0, 0, 0,
+ 0, 0, 54, 0, 0, 5,
+ 130, 32, 16, 0, 0, 0,
+ 0, 0, 58, 0, 16, 0,
+ 0, 0, 0, 0, 47, 0,
+ 0, 5, 114, 0, 16, 0,
+ 0, 0, 0, 0, 70, 2,
+ 16, 0, 0, 0, 0, 0,
+ 56, 0, 0, 8, 114, 0,
+ 16, 0, 0, 0, 0, 0,
+ 70, 2, 16, 0, 0, 0,
+ 0, 0, 6, 128, 32, 0,
+ 6, 0, 0, 0, 0, 0,
+ 0, 0, 25, 0, 0, 5,
+ 114, 32, 16, 0, 0, 0,
+ 0, 0, 70, 2, 16, 0,
+ 0, 0, 0, 0, 62, 0,
+ 0, 1, 83, 84, 65, 84,
+ 116, 0, 0, 0, 7, 0,
+ 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0,
+ 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+};
diff --git a/4J_Render/Windows64/Renderer.h b/4J_Render/Windows64/Renderer.h
index 18afc05..6ef0266 100644
--- a/4J_Render/Windows64/Renderer.h
+++ b/4J_Render/Windows64/Renderer.h
@@ -61,6 +61,7 @@ public:
int kScreenHeight;
int kScreenWidth;
+ void SetGamma(float gamma);
void UpdateGamma(unsigned short usGamma);
void MatrixMode(int type);
void MatrixSetIdentity();
@@ -415,6 +416,7 @@ public:
ID3D11Buffer *m_alphaTestBuffer;
ID3D11Buffer *m_clearColorBuffer;
ID3D11Buffer *m_forcedLODBuffer;
+ ID3D11Buffer *m_gammaRenderBuffer;
uint64_t dynamicVertexBase;
DWORD dynamicVertexOffset;
ID3D11Buffer *dynamicVertexBuffer;
@@ -456,6 +458,7 @@ public:
ID3D11PixelShader **pixelShaderTable;
ID3D11PixelShader *screenSpacePixelShader;
ID3D11PixelShader *screenClearPixelShader;
+ ID3D11PixelShader *screenGammaPixelShader;
unsigned int *vertexStrideTable;
ID3D11InputLayout **inputLayoutTable;
ID3D11Buffer *quadIndexBuffer;
@@ -492,7 +495,11 @@ public:
std::unordered_map managedRasterizerStates;
bool m_bShouldScreenGrabNextFrame;
bool m_bSuspended;
-
+ unsigned short m_usPreviousGamma;
+ float m_usGamma;
+ ID3D11SamplerState *m_gammaSamplerState;
+ ID3D11Buffer *m_gammaFullscreenBoundsBuffer;
+
// @Patoke add
ID3D11Texture2D *m_backBufferTexture;
};
diff --git a/4J_Render/Windows64/RendererCore.cpp b/4J_Render/Windows64/RendererCore.cpp
index 859cc6b..103b26f 100644
--- a/4J_Render/Windows64/RendererCore.cpp
+++ b/4J_Render/Windows64/RendererCore.cpp
@@ -99,6 +99,7 @@ Renderer::Context::Context(ID3D11Device* device, ID3D11DeviceContext* deviceCont
, m_alphaTestBuffer(NULL)
, m_clearColorBuffer(NULL)
, m_forcedLODBuffer(NULL)
+ , m_gammaRenderBuffer(NULL)
, dynamicVertexBase(0)
, dynamicVertexOffset(0)
, dynamicVertexBuffer(NULL)
@@ -226,6 +227,10 @@ Renderer::Context::Context(ID3D11Device* device, ID3D11DeviceContext* deviceCont
device->CreateBuffer(&cbDesc, &cbData, &m_clearColorBuffer);
device->CreateBuffer(&cbDesc, &cbData, &m_forcedLODBuffer);
+ cbDesc.ByteWidth = sizeof(zero4);
+ cbData.pSysMem = zero4;
+ device->CreateBuffer(&cbDesc, &cbData, &m_gammaRenderBuffer);
+
deviceContext->VSSetConstantBuffers(0, 10, &m_modelViewMatrix);
deviceContext->PSSetConstantBuffers(0, 6, &m_tintColorBuffer);
@@ -411,7 +416,7 @@ void Renderer::CaptureThumbnail(ImageFileBuffer *pngOut)
c.m_pDeviceContext->VSSetShader(screenSpaceVertexShader, NULL, 0);
c.m_pDeviceContext->IASetInputLayout(NULL);
- c.m_pDeviceContext->PSSetShader(screenSpacePixelShader, NULL, 0);
+ c.m_pDeviceContext->PSSetShader(screenSpacePixelShader, NULL, 0);
c.m_pDeviceContext->OMSetBlendState(blendState, NULL, -1);
c.m_pDeviceContext->OMSetDepthStencilState(depthState, 0);
c.m_pDeviceContext->RSSetState(rasterizerState);
@@ -836,7 +841,26 @@ void Renderer::Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain)
m_pDevice->CreateBuffer(&fanIndexDesc, &fanIndexData, &fanIndexBuffer);
delete[] fanIndices;
- InitializeCriticalSection(&Renderer::totalAllocCS);
+ D3D11_SAMPLER_DESC gammaSamplerDesc = {};
+ gammaSamplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
+ gammaSamplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
+ gammaSamplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
+ gammaSamplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
+ gammaSamplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
+ m_pDevice->CreateSamplerState(&gammaSamplerDesc, &m_gammaSamplerState);
+
+ const float fullscreenBounds[4] = { 0.0f, 0.0f, 2.0f, 2.0f };
+ D3D11_BUFFER_DESC boundsDesc = {};
+ boundsDesc.ByteWidth = sizeof(fullscreenBounds);
+ boundsDesc.Usage = D3D11_USAGE_IMMUTABLE;
+ boundsDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ D3D11_SUBRESOURCE_DATA boundsData = { fullscreenBounds };
+ m_pDevice->CreateBuffer(&boundsDesc, &boundsData, &m_gammaFullscreenBoundsBuffer);
+
+ m_usPreviousGamma = 0xFFFF;
+ m_usGamma = 1.0f;
+
+ InitializeCriticalSection(&Renderer::totalAllocCS);
}
ID3D11DeviceContext *Renderer::InitialiseContext(bool fromPresent)
@@ -877,6 +901,70 @@ bool Renderer::IsWidescreen()
return (aspectRatio >= 1.56f);
}
+// PIEBOT: Inspired by CaptureThumbnail
+void Renderer::SetGamma(float gamma)
+{
+ Renderer::Context &c = getContext();
+
+ // @Patoke fix: bind render target to a proper backbuffer texture
+ ID3D11Resource *actualBackBuffer = NULL;
+ mainRenderTargetView->GetResource(&actualBackBuffer);
+
+ // copy the backbuffer contents
+ c.m_pDeviceContext->CopyResource(m_backBufferTexture, actualBackBuffer);
+ actualBackBuffer->Release();
+
+ D3D11_MAPPED_SUBRESOURCE mapped = {};
+ if (SUCCEEDED(c.m_pDeviceContext->Map(c.m_gammaRenderBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped)))
+ {
+ *reinterpret_cast(mapped.pData) = DirectX::XMFLOAT4(gamma, 0.0f, 0.0f, 0.0f);
+ c.m_pDeviceContext->Unmap(c.m_gammaRenderBuffer, 0);
+ }
+
+ ID3D11BlendState *blendState = NULL;
+ ID3D11RasterizerState *rasterizerState = NULL;
+
+ D3D11_BLEND_DESC blendDesc = {};
+ blendDesc.RenderTarget[0].BlendEnable = false;
+ blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
+ blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_ZERO;
+ blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
+ blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
+ blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+ m_pDevice->CreateBlendState(&blendDesc, &blendState);
+
+ D3D11_RASTERIZER_DESC rasterDesc = {};
+ rasterDesc.FillMode = D3D11_FILL_SOLID;
+ rasterDesc.CullMode = D3D11_CULL_NONE;
+ rasterDesc.DepthClipEnable = true;
+ rasterDesc.MultisampleEnable = true;
+ m_pDevice->CreateRasterizerState(&rasterDesc, &rasterizerState);
+
+ c.m_pDeviceContext->VSSetShader(screenSpaceVertexShader, NULL, 0);
+ c.m_pDeviceContext->PSSetShader(screenGammaPixelShader, NULL, 0);
+ c.m_pDeviceContext->IASetInputLayout(NULL);
+ c.m_pDeviceContext->IASetVertexBuffers(0, 0, NULL, NULL, NULL);
+ c.m_pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+ c.m_pDeviceContext->OMSetBlendState(blendState, NULL, 0xFFFFFFFF);
+ c.m_pDeviceContext->RSSetState(rasterizerState);
+
+ blendState->Release();
+ rasterizerState->Release();
+
+ D3D11_VIEWPORT viewport = { 0.0f, 0.0f, (float)backBufferWidth, (float)backBufferHeight, 0.0f, 1.0f };
+ c.m_pDeviceContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
+ c.m_pDeviceContext->RSSetViewports(1, &viewport);
+
+ c.m_pDeviceContext->PSSetShaderResources(0, 1, &mainShaderResourceView);
+ c.m_pDeviceContext->PSSetSamplers(0, 1, &m_gammaSamplerState);
+ c.m_pDeviceContext->VSSetConstantBuffers(9, 1, &m_gammaFullscreenBoundsBuffer);
+ c.m_pDeviceContext->PSSetConstantBuffers(6, 1, &c.m_gammaRenderBuffer);
+
+ c.m_pDeviceContext->Draw(4, 0);
+}
+
void Renderer::Present()
{
PROFILER_SCOPE("Renderer::Present", "Present", MP_MAGENTA);
@@ -948,6 +1036,8 @@ void Renderer::Present()
m_bShouldScreenGrabNextFrame = false;
}
+ SetGamma(m_usGamma);
+
m_pSwapChain->Present(C4JRender::GetVSync(), 0);
++presentCount;
}
@@ -993,6 +1083,7 @@ void Renderer::SetupShaders()
m_pDevice->CreatePixelShader(g_main_PS_ForceLOD, sizeof(g_main_PS_ForceLOD), NULL, &pixelShaderTable[C4JRender::PIXEL_SHADER_TYPE_FORCELOD]);
m_pDevice->CreatePixelShader(g_main_PS_ScreenSpace, sizeof(g_main_PS_ScreenSpace), NULL, &screenSpacePixelShader);
m_pDevice->CreatePixelShader(g_main_PS_ScreenClear, sizeof(g_main_PS_ScreenClear), NULL, &screenClearPixelShader);
+ m_pDevice->CreatePixelShader(g_main_PS_ScreenGamma, sizeof(g_main_PS_ScreenGamma), NULL, &screenGammaPixelShader);
m_pDevice->CreateInputLayout(g_vertex_PTN_Elements_PF3_TF2_CB4_NB4_XW1, 5, g_main_VS_PF3_TF2_CB4_NB4_XW1, sizeof(g_main_VS_PF3_TF2_CB4_NB4_XW1), &inputLayoutTable[C4JRender::VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1]);
m_pDevice->CreateInputLayout(g_vertex_PTN_Elements_Compressed, 2, g_main_VS_Compressed, sizeof(g_main_VS_Compressed), &inputLayoutTable[C4JRender::VERTEX_TYPE_COMPRESSED]);
@@ -1053,7 +1144,15 @@ bool Renderer::Suspended()
return m_bSuspended;
}
-void Renderer::UpdateGamma(unsigned short) {}
+void Renderer::UpdateGamma(unsigned short usGamma)
+{
+ if (usGamma != m_usPreviousGamma)
+ {
+ m_usPreviousGamma = usGamma;
+
+ m_usGamma = 1.0f / (0.5f + (usGamma / 32768.0f) * 1.5f);
+ }
+}
Renderer::Context &Renderer::getContext()
{
diff --git a/4J_Render/Windows64/shaders/build.bat b/4J_Render/Windows64/shaders/build.bat
index 47a8733..7ab240a 100644
--- a/4J_Render/Windows64/shaders/build.bat
+++ b/4J_Render/Windows64/shaders/build.bat
@@ -21,4 +21,5 @@ if not exist %OUT% mkdir %OUT%
%FXC% %OPT% /T ps_4_0 /E main /D TEXTURE_PROJECTION /Fh %OUT%/PS_TextureProjection.h /Vn g_main_PS_TextureProjection main_PS.hlsl
%FXC% %OPT% /T ps_4_0 /E main /D FORCE_LOD /Fh %OUT%/PS_ForceLOD.h /Vn g_main_PS_ForceLOD main_PS.hlsl
%FXC% %OPT% /T ps_4_0 /E PS_ScreenSpace /Fh %OUT%/PS_ScreenSpace.h /Vn g_main_PS_ScreenSpace screen_PS.hlsl
-%FXC% %OPT% /T ps_4_0 /E PS_ScreenClear /Fh %OUT%/PS_ScreenClear.h /Vn g_main_PS_ScreenClear screen_PS.hlsl
\ No newline at end of file
+%FXC% %OPT% /T ps_4_0 /E PS_ScreenClear /Fh %OUT%/PS_ScreenClear.h /Vn g_main_PS_ScreenClear screen_PS.hlsl
+%FXC% %OPT% /T ps_4_0 /E PS_ScreenGamma /Fh %OUT%/PS_ScreenGamma.h /Vn g_main_PS_ScreenGamma screen_PS.hlsl
\ No newline at end of file
diff --git a/4J_Render/Windows64/shaders/screen_PS.hlsl b/4J_Render/Windows64/shaders/screen_PS.hlsl
index 376f487..2083020 100644
--- a/4J_Render/Windows64/shaders/screen_PS.hlsl
+++ b/4J_Render/Windows64/shaders/screen_PS.hlsl
@@ -26,6 +26,11 @@ cbuffer cbuff : register(b4)
float4 clearColour;
};
+cbuffer gammaBuff : register(b6)
+{
+ float4 gammaParams;
+};
+
SamplerState screen_sampler_s : register(s0);
Texture2D screen_texture : register(t0);
@@ -37,4 +42,12 @@ float4 PS_ScreenSpace(float4 position : SV_POSITION, float2 texcoord : TEXCOORD0
float4 PS_ScreenClear(float4 position : SV_POSITION) : SV_TARGET
{
return clearColour;
+}
+
+float4 PS_ScreenGamma(float4 position : SV_POSITION, float2 texcoord : TEXCOORD0) : SV_TARGET
+{
+ float4 colour = screen_texture.Sample(screen_sampler_s, texcoord);
+ float invGamma = gammaParams.x;
+ colour.rgb = pow(saturate(colour.rgb), invGamma);
+ return colour;
}
\ No newline at end of file
diff --git a/4J_Render/stdafx.h b/4J_Render/stdafx.h
index 6084efc..030099e 100644
--- a/4J_Render/stdafx.h
+++ b/4J_Render/stdafx.h
@@ -7,13 +7,22 @@
#include
#include
-#include
#include
#include
#include
#endif
+#ifdef __ORBIS__
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#endif
+
#ifndef _XBOX
#include "extraX64.h"
#endif
diff --git a/4J_Storage/4J_Storage.vcxproj b/4J_Storage/4J_Storage.vcxproj
index a0ad35f..9ea021e 100644
--- a/4J_Storage/4J_Storage.vcxproj
+++ b/4J_Storage/4J_Storage.vcxproj
@@ -1,17 +1,25 @@
-
+
Debug
- Win32
+ Durango
+
+
+ Debug
+ ORBIS
Debug
x64
-
+
Release
- Win32
+ Durango
+
+
+ Release
+ ORBIS
Release
@@ -20,16 +28,37 @@
-
-
-
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
-
-
-
-
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
{2E28BC2E-BF30-4C83-A4D8-C967DD409D70}
@@ -37,25 +66,12 @@
My4J_Storage
-
- StaticLibrary
- true
- v110
- Unicode
-
StaticLibrary
true
v110
Unicode
-
- StaticLibrary
- false
- v110
- true
- Unicode
-
StaticLibrary
false
@@ -63,51 +79,54 @@
true
Unicode
+
+ v110
+
+
+ v110
+
+
+ Clang
+ StaticLibrary
+
+
+ Clang
+ StaticLibrary
+
-
-
-
-
-
-
-
- $(ProjectName)_d
-
$(ProjectName)_d
$(SolutionDir)\libs\
-
-
- $(ProjectName)_r
+ Build\$(Platform)\$(Configuration)\
$(ProjectName)_r
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
+
+
+ Build\$(Platform)\$(Configuration)\
+ .a
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
-
-
NotUsing
@@ -126,25 +145,6 @@
true
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
- true
- true
-
-
Level3
@@ -167,6 +167,22 @@
true
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Durango;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+
+
+
+
+ ../Headers/Orbis;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
+ NormalWarnings
+
+
diff --git a/4J_Storage/stdafx.h b/4J_Storage/stdafx.h
index fbe6752..beb2b07 100644
--- a/4J_Storage/stdafx.h
+++ b/4J_Storage/stdafx.h
@@ -7,11 +7,20 @@
#include
#include
-#include
#include
#endif
+#ifdef __ORBIS__
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#endif
+
#ifndef _XBOX
#include "extraX64.h"
#endif
diff --git a/4J_XTMS/4J_XTMS.vcxproj b/4J_XTMS/4J_XTMS.vcxproj
index 53037d0..96a072e 100644
--- a/4J_XTMS/4J_XTMS.vcxproj
+++ b/4J_XTMS/4J_XTMS.vcxproj
@@ -1,17 +1,25 @@
-
+
Debug
- Win32
+ Durango
+
+
+ Debug
+ ORBIS
Debug
x64
-
+
Release
- Win32
+ Durango
+
+
+ Release
+ ORBIS
Release
@@ -24,25 +32,12 @@
My4J_XTMS
-
- StaticLibrary
- true
- v110
- Unicode
-
StaticLibrary
true
v110
Unicode
-
- StaticLibrary
- false
- v110
- true
- Unicode
-
StaticLibrary
false
@@ -50,43 +45,48 @@
true
Unicode
+
+ v110
+
+
+ v110
+
+
+ Clang
+
+
+ Clang
+
-
-
-
-
-
-
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
$(SolutionDir)\libs\
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
+
+
+ Build\$(Platform)\$(Configuration)\
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
-
-
NotUsing
@@ -103,25 +103,6 @@
true
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- true
- ../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)
- stdafx.h
-
-
- Windows
- true
- true
- true
-
-
Level3
diff --git a/Headers/Windows64/4J_Input.h b/Headers/Windows64/4J_Input.h
index 51081dd..a9503c8 100644
--- a/Headers/Windows64/4J_Input.h
+++ b/Headers/Windows64/4J_Input.h
@@ -1,6 +1,5 @@
#pragma once
-
#define MAP_STYLE_0 0
#define MAP_STYLE_1 1
#define MAP_STYLE_2 2
@@ -36,6 +35,9 @@
#define _360_JOY_BUTTON_RT 0x00400000
#define _360_JOY_BUTTON_LT 0x00800000
+//str1k3r - DualShock 4 / DualSense Touchpad
+#define _PS_JOY_BUTTON_TOUCHPAD _360_JOY_BUTTON_BACK
+
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
#define AXIS_MAP_LX 0
#define AXIS_MAP_LY 1
diff --git a/Headers/Windows64/4J_Profile.h b/Headers/Windows64/4J_Profile.h
index 90d41c9..ed00f24 100644
--- a/Headers/Windows64/4J_Profile.h
+++ b/Headers/Windows64/4J_Profile.h
@@ -82,8 +82,8 @@ public:
bool IsFullVersion();
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
- bool RegionIsNorthAmerica(void);
bool LocaleIsUSorCanada(void);
+ bool LocaleIsChina(void);
HRESULT GetLiveConnectionStatus();
bool IsSystemUIDisplayed();
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
diff --git a/Headers/extraX64.h b/Headers/extraX64.h
index 653b0e1..b907918 100644
--- a/Headers/extraX64.h
+++ b/Headers/extraX64.h
@@ -8,14 +8,14 @@
#define MULTITHREAD_ENABLE
-//const int XUSER_INDEX_ANY = 255;
+const int XUSER_INDEX_ANY = 255;
const int XUSER_INDEX_FOCUS = 254;
#ifdef __PSVITA__
const int XUSER_MAX_COUNT = 1;
const int MINECRAFT_NET_MAX_PLAYERS = 4;
#else
-//const int XUSER_MAX_COUNT = 4;
+const int XUSER_MAX_COUNT = 4;
const int MINECRAFT_NET_MAX_PLAYERS = 8;
#endif
diff --git a/README.md b/README.md
index c3245ba..6c968bb 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,9 @@
# 4JLibs-VS2012
-## WARNING
+# IMPORTANT:
+If you're to use these libs or use code we made in your libs, make sure to credit us in your project's description
+
+## WARNING:
This needs the [Windows 10 SDK](https://learn.microsoft.com/en-us/windows/apps/windows-sdk/downloads#windows-10) to build `4J_Render`.
## Implementation