mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 05:16:24 -05:00
Merge pull request #1072 from yuriks/GetSystemTick-advance-time
SVC: Advance time when calling GetSystemTick to escape busy-wait loops
This commit is contained in:
commit
5e3536f66f
1 changed files with 4 additions and 1 deletions
|
@ -755,7 +755,10 @@ static void SleepThread(s64 nanoseconds) {
|
||||||
|
|
||||||
/// This returns the total CPU ticks elapsed since the CPU was powered-on
|
/// This returns the total CPU ticks elapsed since the CPU was powered-on
|
||||||
static s64 GetSystemTick() {
|
static s64 GetSystemTick() {
|
||||||
return (s64)CoreTiming::GetTicks();
|
s64 result = CoreTiming::GetTicks();
|
||||||
|
// Advance time to defeat dumb games (like Cubic Ninja) that busy-wait for the frame to end.
|
||||||
|
Core::g_app_core->AddTicks(150); // Measured time between two calls on a 9.2 o3DS with Ninjhax 1.1b
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a memory block at the specified address with the specified permissions and size
|
/// Creates a memory block at the specified address with the specified permissions and size
|
||||||
|
|
Loading…
Reference in a new issue