mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: add extra sleep calls to busy loops; separate sleep into system.c
This commit is contained in:
1 parent
d11b5705a2
commit
4baae8de0b
8 files changed
+90
-53
No files matched your search
@@ -4,6 +4,9 @@
|
||||
#include "bss.h"
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
#ifndef PLATFORM_N64
|
||||
#include "system.h"
|
||||
#endif
|
||||
|
||||
void frametimeInit(void)
|
||||
{
|
||||
@@ -41,6 +44,12 @@ void frametimeCalculate(void)
|
||||
|
||||
diffframe60 = (g_Vars.lostframetime60t + diffframet + CYCLES_PER_FRAME / 2) / CYCLES_PER_FRAME;
|
||||
diffframe240 = (g_Vars.lostframetime240t + diffframet + CYCLES_PER_FRAME / 2 / 4) / (CYCLES_PER_FRAME / 4);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_TickExtraSleep) {
|
||||
sysSleep(EXTRA_SLEEP_TIME);
|
||||
}
|
||||
#endif
|
||||
} while (g_Vars.mininc60 && diffframe60 < g_Vars.mininc60);
|
||||
|
||||
g_Vars.lostframetime60t = g_Vars.lostframetime60t + diffframet - diffframe60 * CYCLES_PER_FRAME;
|
||||
|
||||
@@ -4722,6 +4722,8 @@ enum weaponnum {
|
||||
#define CROSSHAIR_HEALTH_ON_GREEN 1
|
||||
#define CROSSHAIR_HEALTH_ON_WHITE 2
|
||||
|
||||
#define EXTRA_SLEEP_TIME 1000LL // 100us
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -547,6 +547,7 @@ extern s32 g_BlurFb;
|
||||
extern s32 g_BlurFbCapTimer;
|
||||
extern bool g_BlurFbDirty;
|
||||
extern s32 g_TickRateDiv;
|
||||
extern s32 g_TickExtraSleep;
|
||||
extern s32 g_MusicDisableMpDeath;
|
||||
extern s32 g_BgunGeMuzzleFlashes;
|
||||
extern s32 g_FileAutoSelect;
|
||||
|
||||
Reference in new issue
Block a user