diff --git a/README.md b/README.md index 1bbc25b..3f6e7f8 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,4 @@ cmake -B build -S . -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release --target bnusio ``` -The compiled dll of TaikoArcadeLoader will be written in the `dist` folder. - -(experimental) To enable `async update` / `async io`, you can add `-DASYNC_UPDATE` or `-DASYNC_IO` into add_definitions in CMakeLists.txt +The compiled dll of TaikoArcadeLoader will be written in the `dist` folder. \ No newline at end of file diff --git a/dist/config.toml b/dist/config.toml index a584cee..fba0b8a 100644 --- a/dist/config.toml +++ b/dist/config.toml @@ -15,7 +15,7 @@ version = "auto" # Patch version # | - JPN39: For use with Taiko JPN 39.06 # | - CHN00: For use with Taiko CHN 00.32 unlock_songs = true - +high_res_timer = true # (experimental) Enable High Resolution Timer, which might improve judgement timing [patches.chn00] # These patches are only available for version CHN00 fix_language = false # Sync test mode language to attract etc diff --git a/src/bnusio.cpp b/src/bnusio.cpp index 7d91a41..da64988 100644 --- a/src/bnusio.cpp +++ b/src/bnusio.cpp @@ -248,7 +248,7 @@ std::condition_variable syncCV; void UpdateLoop () { - LogMessage (LogLevel::WARN, "Using Async Update (experimental)!"); + LogMessage (LogLevel::WARN, "(experimental) Using Async Update!"); std::unique_lock syncLock(syncMtx); while (exited < 120) { syncCV.wait (syncLock); diff --git a/src/dllmain.cpp b/src/dllmain.cpp index b0fbcd5..9d6c166 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -22,6 +22,7 @@ char accessCode1[21] = "00000000000000000001"; char accessCode2[21] = "00000000000000000002"; char chipId1[33] = "00000000000000000000000000000001"; char chipId2[33] = "00000000000000000000000000000002"; +bool highResTimer = true; bool windowed = false; bool autoIme = false; bool jpLayout = false; @@ -150,7 +151,7 @@ DllMain (HMODULE module, const DWORD reason, LPVOID reserved) { LogMessage (LogLevel::INFO, "Loading config..."); #ifdef ASYNC_IO - LogMessage (LogLevel::WARN, "Using Async IO (experimental)!"); + LogMessage (LogLevel::WARN, "(experimental) Using Async IO!"); InitializeKeyboard (); #endif @@ -176,7 +177,10 @@ DllMain (HMODULE module, const DWORD reason, LPVOID reserved) { std::strcat (placeId, countryCode.c_str ()); std::strcat (placeId, "0FF0"); } - if (const auto patches = openConfigSection (config, "patches")) version = readConfigString (patches, "version", version); + if (const auto patches = openConfigSection (config, "patches")) { + version = readConfigString (patches, "version", version); + highResTimer = readConfigBool (patches, "high_res_timer", highResTimer); + } if (const auto emulation = openConfigSection (config, "emulation")) { emulateUsio = readConfigBool (emulation, "usio", emulateUsio); emulateCardReader = readConfigBool (emulation, "card_reader", emulateCardReader); @@ -266,7 +270,9 @@ DllMain (HMODULE module, const DWORD reason, LPVOID reserved) { patches::LayeredFs::Init (); patches::TestMode::Init (); - patches::Timer::Init (); + if (highResTimer) { + patches::Timer::Init (); + } LogMessage (LogLevel::INFO, "==== Finished Loading patches!"); } diff --git a/src/patches/timer.cpp b/src/patches/timer.cpp index 85f738c..5a4d249 100644 --- a/src/patches/timer.cpp +++ b/src/patches/timer.cpp @@ -29,17 +29,17 @@ namespace patches::Timer { NTSTATUS queryStatus = NtQueryTimerResolution(¤tResolution, &minimumResolution, &maximumResolution); if (queryStatus == 0) { bool setHighResolutionTimer = currentResolution > maximumResolution; - LogMessage (LogLevel::INFO, "Timer Resolution current: {}ms maximum: {}ms", currentResolution / 10000.0, maximumResolution / 10000.0); + LogMessage (LogLevel::WARN, "(experimental) Timer Resolution current: {}ms maximum: {}ms", currentResolution / 10000.0, maximumResolution / 10000.0); if (setHighResolutionTimer) { NTSTATUS status = NtSetTimerResolution(maximumResolution, TRUE, ¤tResolution); if (status == 0) { - LogMessage (LogLevel::INFO, "Successfully change Timer resolution to {}ms", maximumResolution / 10000.0); + LogMessage (LogLevel::WARN, "(experimental) Successfully change Timer resolution to {}ms", maximumResolution / 10000.0); } else { - LogMessage (LogLevel::ERROR, "Failed to change Timer resolution, status={}", status); + LogMessage (LogLevel::ERROR, "(experimental) Failed to change Timer resolution, status={}", status); } atexit (Release); } - } else LogMessage (LogLevel::ERROR, "Failed to query Timer resolution, status={}", queryStatus); + } else LogMessage (LogLevel::ERROR, "(experimental) Failed to query Timer resolution, status={}", queryStatus); } } \ No newline at end of file diff --git a/src/patches/versions/JPN39.cpp b/src/patches/versions/JPN39.cpp index bf3c357..fd4d1f4 100644 --- a/src/patches/versions/JPN39.cpp +++ b/src/patches/versions/JPN39.cpp @@ -450,12 +450,12 @@ HOOK (u64, EnsoGameManagerChechEnsoEnd, ASLR (0x1400E2A10), u64 a1, u64 a2, u64 return result; } -HOOK (DWORD*, AcquireMostCompatibleDisplayMode, ASLR (0x14064C870), i64 a1, DWORD *a2, DWORD *a3) { - LogMessage (LogLevel::DEBUG, "AcquireMostCompatibleDisplayMode {:d} {:d} {:f} {:f}", a3[0], a3[1], (float)(int)a3[2], (float)(int)a3[3]); - a3[2] = (DWORD)(int)120.0f; - LogMessage (LogLevel::DEBUG, "AcquireMostCompatibleDisplayMode {:d} {:d} {:f} {:f}", a3[0], a3[1], (float)(int)a3[2], (float)(int)a3[3]); - return originalAcquireMostCompatibleDisplayMode (a1, a2, a3); -} +// HOOK (DWORD*, AcquireMostCompatibleDisplayMode, ASLR (0x14064C870), i64 a1, DWORD *a2, DWORD *a3) { +// LogMessage (LogLevel::DEBUG, "AcquireMostCompatibleDisplayMode {:d} {:d} {:f} {:f}", a3[0], a3[1], (float)(int)a3[2], (float)(int)a3[3]); +// a3[2] = (DWORD)(int)120.0f; +// LogMessage (LogLevel::DEBUG, "AcquireMostCompatibleDisplayMode {:d} {:d} {:f} {:f}", a3[0], a3[1], (float)(int)a3[2], (float)(int)a3[3]); +// return originalAcquireMostCompatibleDisplayMode (a1, a2, a3); +// } HOOK (char, SceneTestModeLoading, ASLR (0x1404793D0), u64 a1, u64 a2, u64 a3) { LogMessage (LogLevel::DEBUG, "Begin SceneTestModeLoading"); @@ -534,7 +534,7 @@ Init () { INSTALL_HOOK (EnsoGraphicManagerPreparing); INSTALL_HOOK (EnsoGameManagerStart); INSTALL_HOOK (EnsoGameManagerChechEnsoEnd); - INSTALL_HOOK (AcquireMostCompatibleDisplayMode); + // INSTALL_HOOK (AcquireMostCompatibleDisplayMode); INSTALL_HOOK (SceneTestModeLoading); // Apply common config patch