Skip to content

Commit

Permalink
publish: 6.22.30
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Jul 23, 2019
1 parent 7a9b47b commit b0eefc0
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
30 changes: 22 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
cmake_minimum_required(VERSION 3.6)

set(ASYNCIFY OFF)
set(EMTERPRETIFY ON)

if(${EMSCRIPTEN})
set(OPT_FLAG "-O3")
set(USE_PORTS "-s USE_ZLIB=1")
set(CMAKE_C_FLAGS "-Oz -w -Werror=return-type ${USE_PORTS}")
set(CMAKE_C_FLAGS "${OPT_FLAG} -w -Werror=return-type ${USE_PORTS}")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${USE_PORTS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
${USE_PORTS} \
-Oz \
${OPT_FLAG} \
-s TOTAL_STACK=1MB \
-s MALLOC=emmalloc \
--emit-symbol-map \
-s EXIT_RUNTIME=1 \
-s ASSERTIONS=0 \
-s SAFE_HEAP=0 \
-s TOTAL_MEMORY=67108864 \
-s ALLOW_MEMORY_GROWTH=1 \
-s TOTAL_STACK=1MB \
-s MALLOC=emmalloc \
-s INVOKE_RUN=0 \
-s MODULARIZE=1 \
-s EXPORT_NAME='WDOSBOX' \
-s FORCE_FILESYSTEM=1 \
-s ASYNCIFY \
-s EXTRA_EXPORTED_RUNTIME_METHODS=\"['getMemory', 'addRunDependency', 'removeRunDependency','FS', 'FS_createPath', 'FS_createPreloadedFile', \
'FS_createDataFile', 'lengthBytesUTF8', 'stringToUTF8', 'UTF16ToString']\" \
-s NO_EXIT_RUNTIME=1 \
-s ERROR_ON_UNDEFINED_SYMBOLS=0")
add_definitions(-DEMSCRIPTEN)
# -s ASYNCIFY_IGNORE_INDIRECT \
# -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s EMTERPRETIFY_WHITELIST=@${CMAKE_CURRENT_LIST_DIR}/js-dos-cpp/emterpretify.txt \

if(ASYNCIFY)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ASYNCIFY")
# -s ASYNCIFY_IGNORE_INDIRECT \
elseif(EMTERPRETIFY)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s EMTERPRETIFY_WHITELIST=@${CMAKE_CURRENT_LIST_DIR}/js-dos-cpp/emterpretify.txt")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type -Wno-deprecated")
add_definitions(-DDEBUG -DEMSCRIPTEN_KEEPALIVE=)
Expand All @@ -35,7 +43,13 @@ else()
endif()

add_definitions(-DHAVE_CONFIG_H -DGET_X86_FUNCTIONS -DJSDOS)
add_definitions(-DEMTERPRETER_SYNC)

if(ASYNCIFY)
add_definitions(-DEMTERPRETER_SYNC -DASYNCIFY -Demscripten_sleep_with_yield=emscripten_sleep)
elseif(EMTERPRETIFY)
add_definitions(-DEMTERPRETER_SYNC)
endif()


include(
"${CMAKE_CURRENT_LIST_DIR}/3rd-party/3rd-party.cmake"
Expand Down
10 changes: 5 additions & 5 deletions dist/docs/api/js-dos-ts/js-dos-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ gulpfile.js --> generateBuildInfo
```
export const Build = {
version: "6.22.29 (e54c8c8bec01ad1a072f1b0f430cc492)",
jsVersion: "0465870325e768eb26cc06b00d920fc94314efc7",
jsSize: 197174,
wasmVersion: "c22105169b59875d7b46cd156a6e7c17",
wasmSize: 2851969,
version: "6.22.30 (a7b59eaf2e131f1b5328a04f3c33a613)",
jsVersion: "7a9b47b1c3ba95d95d4d2bb58b9248ae603f7479",
jsSize: 502767,
wasmVersion: "8ec72e090a255b8554388f6b0d12602c",
wasmSize: 2297225,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ Bitu DEBUG_Loop(void) {
PIC_runIRQs();
#if defined(JSDOS)
#if defined(EMTERPRETER_SYNC)
emscripten_sleep(1);
emscripten_sleep_with_yield(1);
#endif
#else
SDL_Delay(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ class WGET : public Program {
/* Emscripten won't allow a sync fetch:
* https://kripken.github.io/emscripten-site/docs/api_reference/fetch.html#synchronous-fetches
* The program instead waits for these to be called, looping and calling
* emscripten_sleep().
* emscripten_sleep_with_yield().
*/
bool WGET::fetchsuccess = false, WGET::fetchdone = false;
void WGET::downloadSucceeded(emscripten_fetch_t *fetch) {
Expand Down Expand Up @@ -1598,7 +1598,7 @@ void WGET::Run(void) {
attr.onerror = downloadFailed;
fetchdone = false;
emscripten_fetch_t *fetch = emscripten_fetch(&attr, url.c_str());
while (!fetchdone) emscripten_sleep(10);
while (!fetchdone) emscripten_sleep_with_yield(10);
if (fetchsuccess) {
Bit16u fhandle;
if (!DOS_CreateFile(outname.c_str(),OPEN_WRITE,&fhandle)) {
Expand Down
10 changes: 8 additions & 2 deletions dreamlayers-em-dosbox-em-dosbox-svn-sdl2/src/dosbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,15 @@ bool doHeapOperation() {


#if defined(EMTERPRETER_SYNC) && defined(EMSCRIPTEN)
#if defined(ASYNCIFY)
bool isNormalState = EM_ASM_INT((
return Asyncify.state === 0 ? 1 : 0;
)) == 1;
#else
bool isNormalState = EM_ASM_INT((
return EmterpreterAsync.state === 0 ? 1 : 0;
)) == 1;
#endif

if (!isNormalState) {
return false;
Expand Down Expand Up @@ -204,7 +210,7 @@ static Bitu Normal_Loop(void) {
if (SDL_TICKS_PASSED(ticksEntry, last_sleep + 10)) {
if (nosleep_lock == 0) {
last_sleep = ticksEntry;
emscripten_sleep(1);
emscripten_sleep_with_yield(1);
ticksEntry = GetTicks();
} else if (SDL_TICKS_PASSED(ticksEntry, last_sleep + 2000) &&
!SDL_TICKS_PASSED(ticksEntry, last_loop + 200)) {
Expand Down Expand Up @@ -409,7 +415,7 @@ static Bitu Normal_Loop(void) {
#elif defined(EMTERPRETER_SYNC)
if (nosleep_lock == 0) {
last_sleep = ticksNew;
emscripten_sleep(1);
emscripten_sleep_with_yield(1);
}
#endif
ticksDone -= GetTicks() - ticksNew;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ static void GUI_StartUp(Section * sec) {
}
if (exit_splash) break;
#if defined(JSDOS) && defined(EMTERPRETER_SYNC)
emscripten_sleep(1);
emscripten_sleep_with_yield(1);
#endif

if (ct<1) {
Expand Down
10 changes: 5 additions & 5 deletions js-dos-ts/js-dos-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// gulpfile.js --> generateBuildInfo

export const Build = {
version: "6.22.29 (e54c8c8bec01ad1a072f1b0f430cc492)",
jsVersion: "0465870325e768eb26cc06b00d920fc94314efc7",
jsSize: 197174,
wasmVersion: "c22105169b59875d7b46cd156a6e7c17",
wasmSize: 2851969,
version: "6.22.30 (a7b59eaf2e131f1b5328a04f3c33a613)",
jsVersion: "7a9b47b1c3ba95d95d4d2bb58b9248ae603f7479",
jsSize: 502767,
wasmVersion: "8ec72e090a255b8554388f6b0d12602c",
wasmSize: 2297225,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-dos",
"version": "6.22.29",
"version": "6.22.30",
"description": "Easiest API to run dos programs in browser",
"main": "dist/js-dos.js",
"types": "dist/typescript/js-dos.ts",
Expand Down

0 comments on commit b0eefc0

Please sign in to comment.