emscripten: Use MODULARIZE=1

This commit is contained in:
kichikuou
2024-07-30 12:30:50 +09:00
parent c4e8205d6c
commit a6aa50b5cf
2 changed files with 9 additions and 5 deletions
+5 -1
View File
@@ -159,6 +159,8 @@ if (EMSCRIPTEN)
target_link_options(xsystem35 PRIVATE
-sENVIRONMENT=web
-sMODULARIZE=1
-sEXPORT_ES6=1
-sASYNCIFY=1
-sASYNCIFY_IGNORE_INDIRECT=1
-sASYNCIFY_REMOVE=SDL_Delay
@@ -167,7 +169,9 @@ if (EMSCRIPTEN)
-sALLOW_MEMORY_GROWTH=1
-sNO_EXIT_RUNTIME=1
-sEXPORTED_FUNCTIONS=_main,_malloc
-sEXPORTED_RUNTIME_METHODS=getValue,addRunDependency,removeRunDependency)
-sEXPORTED_RUNTIME_METHODS=FS,IDBFS,getValue,addRunDependency,removeRunDependency
--emit-tsd=xsystem35.d.ts
)
elseif (ANDROID)
target_link_libraries(xsystem35 PRIVATE ${ndk_log})
+4 -4
View File
@@ -37,15 +37,15 @@ EM_JS(int, muspcm_reset, (void), {
});
EM_JS(int, muspcm_load_no, (int slot, int no), { // async
return xsystem35.audio.pcm_load(slot, no);
return Asyncify.handleSleep((wakeUp) => xsystem35.audio.pcm_load(slot, no, wakeUp));
});
EM_JS(int, muspcm_load_data, (int slot, uint8_t *buf, uint32_t len), { // async
return xsystem35.audio.pcm_load_data(slot, buf, len);
return Asyncify.handleSleep((wakeUp) => xsystem35.audio.pcm_load_data(slot, buf, len, wakeUp));
});
EM_JS(int, muspcm_load_mixlr, (int slot, int noL, int noR), { // async
return xsystem35.audio.pcm_load_mixlr(slot, noL, noR);
return Asyncify.handleSleep((wakeUp) => xsystem35.audio.pcm_load_mixlr(slot, noL, noR, wakeUp));
});
EM_JS(int, muspcm_unload, (int slot), {
@@ -92,5 +92,5 @@ EM_JS(boolean, muspcm_isplaying, (int slot), {
});
EM_JS(int, muspcm_waitend, (int slot), { // async
return xsystem35.audio.pcm_waitend(slot);
return Asyncify.handleSleep((wakeUp) => xsystem35.audio.pcm_waitend(slot, wakeUp));
});