diff --git a/src/core.cc b/src/core.cc index 19d02da..6778d7c 100644 --- a/src/core.cc +++ b/src/core.cc @@ -17,6 +17,8 @@ #include #include +static void idleImpl(); + // 0x51E234 IdleFunc* _idle_func = NULL; @@ -411,6 +413,10 @@ int coreInit(int a1) gTickerListHead = NULL; gScreenshotKeyCode = KEY_ALT_C; + // SFALL: Set idle function. + // CE: Prevents frying CPU when window is not focused. + inputSetIdleFunc(idleImpl); + return 0; } @@ -4907,3 +4913,8 @@ void convertMouseWheelToArrowKey(int* keyCodePtr) } } } + +static void idleImpl() +{ + SDL_Delay(125); +}