Open8

素のDOSBox-xがemscriptenで動くのか問題

okuokuokuoku

Emscriptenの sdl2-config が使われないのを修正

configure:9043: $? = 0
configure:9045: result: yes
configure:9258: checking for sdl2-config
configure:9281: found /home/oku/repos/emsdk/upstream/emscripten/system/bin/sdl2-config
configure:9294: result: /home/oku/repos/emsdk/upstream/emscripten/system/bin/sdl2-config
configure:9302: checking for SDL2
configure:9313: result: found using pkg-config

なんか --with-sdl2-exec-prefix でパス指定しても pkg-config の結果を使っちゃうので修正。 bashの ${VAR+set} で ifdef VAR 的な用法をしているけど、事前に SDL2_CONFIG を設定しちゃっているので意味がない。

https://github.com/okuoku/dosbox-x/commit/b6a220099bda67b084740f2d85556fa52d7061bf

SDL_CONFIG (SDL1) にも同じ問題があると思うけど検証できないのでとりあえず放置。

okuokuokuoku

デバッグ情報を有効にする

em++: warning: -pthread + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271 [-Wpthreads-mem-growth]
cache:INFO: generating system asset: symbol_lists/7b8e59169606ec520adf3b24bb0dbab0d4286d97.json... (this will be cached in "/home/oku/repos/emsdk/upstream/emscripten/cache/symbol_lists/7b8e59169606ec520adf3b24bb0dbab0d4286d97.json" for subsequent builds)
cache:INFO:  - ok
warning: undefined symbol: _Z11SERIAL_openPKcPP8_COMPORT (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _Z12SERIAL_closeP8_COMPORT (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _Z15SERIAL_sendcharP8_COMPORTc (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _Z17CPU_Core_Full_Runv (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _Z19CPU_Core_Simple_Runv (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _Z24SERIAL_setCommParametersP8_COMPORTicii (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink2InEPNS_19sSharedMMapInput_R2EPNS_19sSharedMMapAudio_R1E (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink3OutEttdbPKcPKjPKhS5_ (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink4InitEb (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink4TermEv (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink7FreeRAMEPv (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN8GameLink8AllocRAMEj (referenced by top-level compiled C/C++ code)
em++: warning: warnings in JS library compilation [-Wjs-compiler]
em++: warning: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations]

リンクは通るけど微妙ぃな。。

https://github.com/okuoku/dosbox-x/commit/54a6c69ff22dddc0370762250ce7dc7841fc0c34

okuokuokuoku

emscripten_sleep を呼んでクラッシュする

元々のasyncifyサポートでやっていた事で、pthread上では多分不要なんじゃないか説。

これと AudioContext の生成を止めたらちゃんと起動した。

マウスが微妙にズレてたりとか色々あるけど。