From c1bddc67a1c66c932fad038913ca49bbcc34b059 Mon Sep 17 00:00:00 2001 From: algestam Date: Thu, 6 Feb 2025 08:45:34 +0100 Subject: emscripten: fixes to get bgfx working (#13255) * Emscripten: Fixes to get BGFX working * Move emscripten specific setup into an #elif statement * Fix indentation * emscripten: remove no longer link option DEMANGLE_SUPPORT --- scripts/genie.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/genie.lua b/scripts/genie.lua index 0376b306139..fab53dafec1 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1170,26 +1170,24 @@ configuration { "asmjs" } "-O" .. _OPTIONS["OPTIMIZE"], "-s USE_SDL=2", "-s USE_SDL_TTF=2", - "--memory-init-file 0", "-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=\"['\\$$ERRNO_CODES']\"", "-s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__ZN15running_machine30emscripten_get_running_machineEv', '__ZN15running_machine17emscripten_get_uiEv', '__ZN15running_machine20emscripten_get_soundEv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey', '__ZN15running_machine15emscripten_saveEPKc', '__ZN15running_machine15emscripten_loadEPKc', '__ZN15running_machine21emscripten_hard_resetEv', '__ZN15running_machine21emscripten_soft_resetEv', '__ZN15running_machine15emscripten_exitEv']\"", "-s EXPORTED_RUNTIME_METHODS=\"['cwrap']\"", "-s ERROR_ON_UNDEFINED_SYMBOLS=0", - "-s USE_WEBGL2=1", - "-s LEGACY_GL_EMULATION=1", - "-s GL_UNSAFE_OPTS=0", + "-s STACK_SIZE=5MB", + "-s MAX_WEBGL_VERSION=2", "--pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js", "--post-js " .. _MAKE.esc(MAME_DIR) .. "scripts/resources/emscripten/emscripten_post.js", "--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/chains@bgfx/chains", "--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/effects@bgfx/effects", "--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/shaders/essl@bgfx/shaders/essl", "--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/bgfx@artwork/bgfx", + "--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/lut-default.png@artwork/lut-default.png", "--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/slot-mask.png@artwork/slot-mask.png", } if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then linkoptions { "-g" .. _OPTIONS["SYMLEVEL"], - "-s DEMANGLE_SUPPORT=1", } end if _OPTIONS["WEBASSEMBLY"] then @@ -1205,11 +1203,12 @@ configuration { "asmjs" } -- define a fixed memory size because allowing memory growth disables asm.js optimizations linkoptions { "-s ALLOW_MEMORY_GROWTH=0", - "-s TOTAL_MEMORY=268435456", + "-s INITIAL_MEMORY=256MB", } else linkoptions { "-s ALLOW_MEMORY_GROWTH=1", + "-s INITIAL_MEMORY=24MB" } end archivesplit_size "20" -- cgit v1.2.3-70-g09d2