You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To play sound effects and musics, we would use software synthesizer,
here I choose Timidity. When doom and quake target are specified, the
Timidity related data are downloaded and extracted. As previous
dicussion in the issue forum, the web workers are not reaped after
return, thus adding pthread_join to reap them. As I tested, the sound
effects and musics are only playable using the emcc version 3.1.51
which will fetch specific SDL2_mixer library, thus warning the user if
the emcc version is not 3.1.51.
Embed all ELF and their dependencies into single wasm when building with
emcc. Consequently, a ELF executable menu bar can be introduced to select
and run desired ELF programs.
Since we are running the wasm program inside web browser, we have to
yield to the web browser in some interval, so emscripten_set_main_loop_arg
provided by emscripten comes to help. To utilize this function, we have to
update the rv_step function signature. In order to switch running ELF
programs, we have to cancel the browser main loop using
emscripten_cancel_main_loop and do some clean up to recollect memory.
_indirect_rv_halt is introduced to halt the RISC-V instance without
exposing the RISC-V instance.
assets directory will be used to store some required static web files.
assets/html/index.html is a default main page of the ported wasm rv32emu.
In order to switch running ELF programs, we have to delay some time
for finishing emscripten_cancel_main_loop. I set delay to 1 second for now.
TODO: more clean up have to be done, e.g., clear canvas, terminal and
sound thread.
Related to: #75
# When the emcc version is not 3.1.51, the latest SDL2_mixer library is fetched by emcc and music might not be played in the web browser
13
+
SDL_MUSIC_PLAY_AT_EMCC_MAJOR := 3
14
+
SDL_MUSIC_PLAY_AT_EMCC_MINOR := 1
15
+
SDL_MUSIC_PLAY_AT_EMCC_PATCH := 51
16
+
SDL_MUSIC_CANNOT_PLAY_WARNING := Video games music might not be played. You may switch emcc to version $(SDL_MUSIC_PLAY_AT_EMCC_MAJOR).$(SDL_MUSIC_PLAY_AT_EMCC_MINOR).$(SDL_MUSIC_PLAY_AT_EMCC_PATCH)
MIMALLOC_UNSUPPORTED_WARNING := mimalloc is supported after version $(MIMALLOC_SUPPORT_SINCE_MAJOR).$(MIMALLOC_SUPPORT_SINCE_MINOR).$(MIMALLOC_SUPPORT_SINCE_PATCH)
0 commit comments