diff --git a/mods/Tests/TasRecorder/src/GAMEPAD_ProcessTapRelease.c b/mods/Tests/TasRecorder/src/GAMEPAD_ProcessTapRelease.c index c17558fe0..7f974aa27 100644 --- a/mods/Tests/TasRecorder/src/GAMEPAD_ProcessTapRelease.c +++ b/mods/Tests/TasRecorder/src/GAMEPAD_ProcessTapRelease.c @@ -41,8 +41,15 @@ void DECOMP_GAMEPAD_ProcessTapRelease(struct GamepadSystem *gGamepads) // value pressed hold = buttonArr[currIndex]; - // record - pad->buttonsHeldCurrFrame = buttonArr[currIndex]; + // replay + pad->buttonsHeldCurrFrame = hold; + + // In this order: Up, Down, Left, Right + if ((hold & 1) != 0) pad->stickLY = 0; + if ((hold & 2) != 0) pad->stickLY = 0xFF; + if ((hold & 4) != 0) pad->stickLX = 0; + if ((hold & 8) != 0) pad->stickLX = 0xFF; + } // draw diff --git a/mods/Windows/TasRecorder/OculusTest/main.cpp b/mods/Windows/TasRecorder/OculusTest/main.cpp index 03af02ea1..00ad4465a 100644 --- a/mods/Windows/TasRecorder/OculusTest/main.cpp +++ b/mods/Windows/TasRecorder/OculusTest/main.cpp @@ -30,7 +30,7 @@ int main() int pid; printf("Enter DuckStation PID: "); - scanf("%d\n", &pid); + scanf("%d", &pid); char duckName[100]; sprintf_s(duckName, 100, "duckstation_%d", pid); @@ -43,16 +43,24 @@ int main() HANDLE hFile = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, duckNameT); pBuf = (char*)MapViewOfFile(hFile, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, size); + if (pBuf == 0) + { + printf("Failed to open\n"); + system("pause"); + exit(0); + } + system("cls"); printf("1 - Save\n"); printf("2 - Load\n"); printf("Enter: "); - scanf("%d\n", &pid); + scanf("%d", &pid); // SAVE mode if (pid == 1) { + system("cls"); printf("Saving...\n"); int sizeInt = *(int*)&pBuf[0xfff0]; @@ -66,9 +74,10 @@ int main() else { system("cls"); + printf("Enter File Name: "); char name[100]; - scanf("%s\n", &name[0]); + scanf("%s", &name[0]); FILE* fp; diff --git a/mods/Windows/TasRecorder_Release/Directions.txt b/mods/Windows/TasRecorder_Release/Directions.txt index 0c1703ee2..1c2c063ed 100644 --- a/mods/Windows/TasRecorder_Release/Directions.txt +++ b/mods/Windows/TasRecorder_Release/Directions.txt @@ -1,3 +1,11 @@ +Before Record/Replay +Open DuckStation +Go to Settings +Go to Advanced +Enable "Export Shared Memory" +Close Settings +Close DuckStation + Recording a TAS: Open the modded ROM in DuckStation Play any 1P mode (multiplayer comes later) diff --git a/mods/Windows/TasRecorder_Release/TasRecorder.exe b/mods/Windows/TasRecorder_Release/TasRecorder.exe new file mode 100644 index 000000000..5202ce4c7 Binary files /dev/null and b/mods/Windows/TasRecorder_Release/TasRecorder.exe differ diff --git a/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta b/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta index 4f8a574f8..5a9a40698 100644 Binary files a/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta and b/mods/Windows/TasRecorder_Release/ctr-u_TasRecorder.xdelta differ