From 5be653a2dc7bec47ccef4452475c1f5c1bba4e9a Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Fri, 9 Jul 2021 17:41:03 +0600 Subject: [PATCH] - add emscripten_sleep where necessary --- src_rebuild/Game/C/spool.c | 3 +++ src_rebuild/Game/C/system.c | 3 +++ .../platform/Emscripten/emscripten_exports.cpp | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 src_rebuild/platform/Emscripten/emscripten_exports.cpp diff --git a/src_rebuild/Game/C/spool.c b/src_rebuild/Game/C/spool.c index ea043679..944fcdf8 100644 --- a/src_rebuild/Game/C/spool.c +++ b/src_rebuild/Game/C/spool.c @@ -520,6 +520,9 @@ void SendTPage(void) void SpoolSYNC(void) { do { +#ifdef __EMSCRIPTEN__ + emscripten_sleep(0); +#endif // __EMSCRIPTEN__ } while (spoolactive != 0); } diff --git a/src_rebuild/Game/C/system.c b/src_rebuild/Game/C/system.c index 5067b205..f18c91be 100644 --- a/src_rebuild/Game/C/system.c +++ b/src_rebuild/Game/C/system.c @@ -553,6 +553,9 @@ void loadsectors(char* addr, int sector, int nsectors) // ... but wait synchronously do { +#ifdef __EMSCRIPTEN__ + emscripten_sleep(0); +#endif // __EMSCRIPTEN__ } while (load_complete == 0); ShowLoading(); diff --git a/src_rebuild/platform/Emscripten/emscripten_exports.cpp b/src_rebuild/platform/Emscripten/emscripten_exports.cpp new file mode 100644 index 00000000..83054d31 --- /dev/null +++ b/src_rebuild/platform/Emscripten/emscripten_exports.cpp @@ -0,0 +1,18 @@ +#include "platform.h" +#include +/* +// 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); + } +}