mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 11:52:32 +01:00
- [Psy-X] fix emscripten firefox slowdown
This commit is contained in:
parent
1e5cfd58e7
commit
55b9a7efbb
@ -301,6 +301,10 @@ void ShowBonusGallery()
|
||||
ReadControllers();
|
||||
VSync(-1);
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
|
||||
if(Pads[0].dirnew & 0x8000)
|
||||
{
|
||||
currentImage--;
|
||||
|
@ -1676,8 +1676,9 @@ void DrawGame(void)
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(0);
|
||||
while ((VSync(-1) - frame) < 2)
|
||||
emscripten_sleep(1);
|
||||
emscripten_sleep(0);
|
||||
#else
|
||||
while ((VSync(-1) - frame) < 2);
|
||||
#endif
|
||||
|
@ -841,7 +841,7 @@ void StopChannel(int channel)
|
||||
if (SpuGetKeyStatus(channels[channel].attr.voice) == 0)
|
||||
break;
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(1);
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
} while (VSync(-1) - vsync < 8);
|
||||
|
||||
|
@ -1026,6 +1026,10 @@ CDTYPE DiscSwapped(char* filename)
|
||||
if(gImitateDiscSwap == 4)
|
||||
g_cdNumFrames = 28;
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
|
||||
if (VSync(-1) - gImitateDiscSwapFrames > g_cdNumFrames)
|
||||
{
|
||||
gImitateDiscSwap++;
|
||||
|
@ -27,11 +27,7 @@ extern int PsyX_Sys_GetVBlankCount();
|
||||
int VSync(int mode)
|
||||
{
|
||||
if (mode < 0)
|
||||
{
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(1);
|
||||
#endif
|
||||
|
||||
{
|
||||
// don't wait but still return vblank count
|
||||
return PsyX_Sys_GetVBlankCount();
|
||||
}
|
||||
|
@ -866,7 +866,7 @@ void PsyX_WaitForTimestep(int count)
|
||||
do
|
||||
{
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(1);
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
}while (g_psxSysCounters[PsxCounter_VBLANK] - swapLastVbl < count);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user