mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Reduce amount of read_processor_time() calls.
This commit is contained in:
parent
8c1f651632
commit
c10655ea60
@ -12196,8 +12196,9 @@ static bool framewait(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
idletime += read_processor_time() - start;
|
||||
curr_time = read_processor_time();
|
||||
evt_t tnow = read_processor_time();
|
||||
idletime += tnow - start;
|
||||
curr_time = tnow;
|
||||
vsyncmintime = curr_time;
|
||||
vsyncmaxtime = vsyncwaittime = curr_time + vstb;
|
||||
if (frame_rendered) {
|
||||
|
||||
14
events.cpp
14
events.cpp
@ -25,6 +25,7 @@ static const int pissoff_nojit_value = 256 * CYCLE_UNIT;
|
||||
|
||||
evt_t event_cycles, nextevent, currcycle;
|
||||
int is_syncline;
|
||||
static int syncline_cnt;
|
||||
frame_time_t is_syncline_end;
|
||||
int cycles_to_next_event;
|
||||
int max_cycles_to_next_event;
|
||||
@ -266,6 +267,19 @@ void do_cycles_slow(int cycles_to_add)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (syncline_cnt > 0) {
|
||||
syncline_cnt--;
|
||||
return;
|
||||
}
|
||||
if (is_syncline) {
|
||||
// runs CPU emulation with chipset stopped
|
||||
// when there is free time to do so
|
||||
if (event_check_vsync()) {
|
||||
syncline_cnt = 16;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!currprefs.cpu_thread) {
|
||||
if ((pissoff -= cycles_to_add) >= 0)
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user