Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -774,7 +774,12 @@ static void apply_speed_limiter(void) | ||
{ | { | ||
TimeToWait = (IntegratedDelta > ThisFrameDelta) ? -IntegratedDelta : -ThisFrameDelta; | TimeToWait = (IntegratedDelta > ThisFrameDelta) ? -IntegratedDelta : -ThisFrameDelta; | ||
DebugMessage(M64MSG_VERBOSE, " apply_speed_limiter(): Waiting %ims", (int) TimeToWait); | DebugMessage(M64MSG_VERBOSE, " apply_speed_limiter(): Waiting %ims", (int) TimeToWait); | ||
SDL_Delay((int) TimeToWait); | //SDL_Delay((int) TimeToWait); | ||
|
|||
int StartTime = SDL_GetTicks(); | |||
int EndTime = StartTime + TimeToWait; | |||
while(SDL_GetTicks() <= EndTime); | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Gillou68310
|
|||
|
|||
// recalculate # of milliseconds that have passed since the last video interrupt, | // recalculate # of milliseconds that have passed since the last video interrupt, | ||
// taking into account the time we just waited | // taking into account the time we just waited | ||
CurrentFPSTime = SDL_GetTicks(); | CurrentFPSTime = SDL_GetTicks(); | ||
|
@Gillou68310 Do you think this is something that upstream would take as an optional setting?
There are a lot of times where the core is not taking enough CPU or the CPU utilization is kind of strange. This results in a lot of newer ARM devices underclocking their CPUs which causes slow downs in games.
A busy wait, however battery inefficient it is, seem to fix this situation.
Are you aware of any better way to prevent an android device from underclocking?
I have already tried setting higher thread priority and using a wake lock. Making thread priority high did seem to fix some hiccups I was seeing, at least in my phone. Wake lock seemed to have no effect.