diff --git a/mods/Windows/TasRecorder/.gitignore b/mods/Windows/TasRecorder/.gitignore new file mode 100644 index 000000000..51b113743 --- /dev/null +++ b/mods/Windows/TasRecorder/.gitignore @@ -0,0 +1,2 @@ +.vs +x64 \ No newline at end of file diff --git a/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj new file mode 100644 index 000000000..f10284c8b --- /dev/null +++ b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj @@ -0,0 +1,159 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + 16.0 + Win32Proj + {9b5b3d7b-aff4-4129-a606-d96743c6387b} + OculusTest + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)\..\libs\LibOVR_v32\Include;$(SolutionDir)\..\libs\glm_v998 + + + Console + true + $(SolutionDir)\..\libs\LibOVR_v32\Lib\Windows\x64\Release\VS2017 + LibOVR.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)\..\libs\LibOVR_v32\Include;$(SolutionDir)\..\libs\glm_v998 + + + Console + true + true + true + $(SolutionDir)\..\libs\LibOVR_v32\Lib\Windows\x64\Release\VS2017 + LibOVR.lib;%(AdditionalDependencies) + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)\..\libs\LibOVR_v32\Include;$(SolutionDir)\..\libs\glm_v998 + + + Console + true + $(SolutionDir)\..\libs\LibOVR_v32\Lib\Windows\x64\Release\VS2017 + LibOVR.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)\..\libs\LibOVR_v32\Include;$(SolutionDir)\..\libs\glm_v998 + + + Console + true + true + true + $(SolutionDir)\..\libs\LibOVR_v32\Lib\Windows\x64\Release\VS2017 + LibOVR.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.filters b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.filters new file mode 100644 index 000000000..ce0c35ccf --- /dev/null +++ b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.user b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.user new file mode 100644 index 000000000..201b64c33 --- /dev/null +++ b/mods/Windows/TasRecorder/OculusTest/OculusTest.vcxproj.user @@ -0,0 +1,23 @@ + + + + $(SolutionDir)\..\VirtualReality_Release + WindowsLocalDebugger + $(SolutionDir)\..\VirtualReality_Release + + + $(SolutionDir)\..\VirtualReality_Release + WindowsLocalDebugger + $(SolutionDir)\..\VirtualReality_Release + + + $(SolutionDir)\..\VirtualReality_Release + WindowsLocalDebugger + $(SolutionDir)\..\VirtualReality_Release + + + $(SolutionDir)\..\VirtualReality_Release + WindowsLocalDebugger + $(SolutionDir)\..\VirtualReality_Release + + \ No newline at end of file diff --git a/mods/Windows/TasRecorder/OculusTest/main.cpp b/mods/Windows/TasRecorder/OculusTest/main.cpp new file mode 100644 index 000000000..03af02ea1 --- /dev/null +++ b/mods/Windows/TasRecorder/OculusTest/main.cpp @@ -0,0 +1,92 @@ +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +void startVR() +{ + system("vr-screen-cap-CTR.exe"); +} + +int main() +{ + char* pBuf = 0; + int mode = 0; + + HWND console = GetConsoleWindow(); + RECT r; + GetWindowRect(console, &r); //stores the console's current dimensions + MoveWindow(console, r.left, r.top, 480, 240 + 35, TRUE); + + int pid; + printf("Enter DuckStation PID: "); + scanf("%d\n", &pid); + + char duckName[100]; + sprintf_s(duckName, 100, "duckstation_%d", pid); + + TCHAR duckNameT[100]; + swprintf(duckNameT, 100, L"%hs", duckName); + + // 8mb RAM + const unsigned int size = 0x800000; + HANDLE hFile = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, duckNameT); + pBuf = (char*)MapViewOfFile(hFile, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, size); + + system("cls"); + printf("1 - Save\n"); + printf("2 - Load\n"); + printf("Enter: "); + + scanf("%d\n", &pid); + + // SAVE mode + if (pid == 1) + { + printf("Saving...\n"); + + int sizeInt = *(int*)&pBuf[0xfff0]; + FILE* fp = fopen("NewTAS.bin", "wb+"); + fwrite(&pBuf[0x200000], 1, sizeInt * 4, fp); + fclose(fp); + + printf("Saved as NewTAS.bin, you may rename the file\n"); + } + + else + { + system("cls"); + + char name[100]; + scanf("%s\n", &name[0]); + + FILE* fp; + + fp = fopen(name, "rb"); + fseek(fp, 0L, SEEK_END); + int sizeByte = ftell(fp); + fclose(fp); + + fp = fopen(name, "rb"); + fread(&pBuf[0x200000], 1, sizeByte, fp); + fclose(fp); + + *(int*)&pBuf[0xfff4] = 1; + + printf("Loaded %s, Replay Activated\n"); + } + + system("pause"); + exit(0); + return 0; +} \ No newline at end of file diff --git a/mods/Windows/TasRecorder/TasPlayer.sln b/mods/Windows/TasRecorder/TasPlayer.sln new file mode 100644 index 000000000..c185f7270 --- /dev/null +++ b/mods/Windows/TasRecorder/TasPlayer.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32328.378 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OculusTest", "OculusTest\OculusTest.vcxproj", "{9B5B3D7B-AFF4-4129-A606-D96743C6387B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Debug|x64.ActiveCfg = Debug|x64 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Debug|x64.Build.0 = Debug|x64 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Debug|x86.ActiveCfg = Debug|Win32 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Debug|x86.Build.0 = Debug|Win32 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Release|x64.ActiveCfg = Release|x64 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Release|x64.Build.0 = Release|x64 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Release|x86.ActiveCfg = Release|Win32 + {9B5B3D7B-AFF4-4129-A606-D96743C6387B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {78A40A39-829C-4FCF-A32D-B6A41C23B018} + EndGlobalSection +EndGlobal diff --git a/mods/Windows/TasRecorder_Release/Directions.txt b/mods/Windows/TasRecorder_Release/Directions.txt new file mode 100644 index 000000000..0c1703ee2 --- /dev/null +++ b/mods/Windows/TasRecorder_Release/Directions.txt @@ -0,0 +1,18 @@ +Recording a TAS: +Open the modded ROM in DuckStation +Play any 1P mode (multiplayer comes later) +Do NOT close DuckStation before saving +Open TasRecorder.exe at end of session +Press 1 to Save +The file NewTAS.bin will be saved +Wait for completion message +Rename to anything you want + +Replaying a TAS: +Open the modded ROM in DuckStation +Pause the emulator when you see SCEA page +Open TasRecorder.exe +Press 2 to Load +Type NewTAS.bin or whatever name +Wait for completion message +Resume the emulator \ No newline at end of file diff --git a/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta b/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta new file mode 100644 index 000000000..4f8a574f8 Binary files /dev/null and b/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta differ