port: add extra sleep calls to busy loops; separate sleep into system.c

This commit is contained in:
fgsfds committed 2024-03-09 17:39:41 +01:00
1 parent d11b5705a2
commit 4baae8de0b
8 files changed
+90 -53

No files matched your search

+9
View File
@@ -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;
+2
View File
@@ -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
+1
View File
@@ -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;