- add emscripten_sleep where necessary

This commit is contained in:
Ilya Shurumov 2021-07-09 17:41:03 +06:00 committed by InspirationByte
parent 23a2f86c27
commit 5be653a2dc
3 changed files with 24 additions and 0 deletions

View File

@ -520,6 +520,9 @@ void SendTPage(void)
void SpoolSYNC(void) void SpoolSYNC(void)
{ {
do { do {
#ifdef __EMSCRIPTEN__
emscripten_sleep(0);
#endif // __EMSCRIPTEN__
} while (spoolactive != 0); } while (spoolactive != 0);
} }

View File

@ -553,6 +553,9 @@ void loadsectors(char* addr, int sector, int nsectors)
// ... but wait synchronously // ... but wait synchronously
do { do {
#ifdef __EMSCRIPTEN__
emscripten_sleep(0);
#endif // __EMSCRIPTEN__
} while (load_complete == 0); } while (load_complete == 0);
ShowLoading(); ShowLoading();

View File

@ -0,0 +1,18 @@
#include "platform.h"
#include <libcd.h>
/*
// TEMP
#ifndef EMSCRIPTEN_KEEPALIVE
#define EMSCRIPTEN_KEEPALIVE
#endif // EMSCRIPTEN_KEEPALIVE
*/
extern bool DumpImageFile(const char* data, unsigned int size);
extern "C" {
void EMSCRIPTEN_KEEPALIVE WebLoadCDImage(char* data, int size)
{
PsyX_CDFS_Init_Mem((u_long*)data, size, 0, 0);
}
}