diff --git a/patches/pinmame/0004-emscripten-cooperative-scheduling.patch b/patches/pinmame/0004-emscripten-cooperative-scheduling.patch index b5c49ff..9cdbf13 100644 --- a/patches/pinmame/0004-emscripten-cooperative-scheduling.patch +++ b/patches/pinmame/0004-emscripten-cooperative-scheduling.patch @@ -1,5 +1,5 @@ diff --git a/src/cpuexec.c b/src/cpuexec.c -index ca7401f..0bfcbe7 100644 +index 07db6a1..0bfcbe7 100644 --- a/src/cpuexec.c +++ b/src/cpuexec.c @@ -466,6 +466,65 @@ void cpu_run(void) @@ -68,41 +68,6 @@ index ca7401f..0bfcbe7 100644 /************************************* -@@ -943,6 +1002,34 @@ void time_fence_exit() - } - } - -+#elif defined(__EMSCRIPTEN__) -+ -+// No cross-thread wait primitive is used here: this build is single-threaded -+// (see vpinball-wasm's README on why pthreads/SharedArrayBuffer are out of -+// scope), and time_fence is purely an *optional* external-clock-sync feature -+// (mirrored by Controller.TimeFence in controller.vbs) - reporting it as -+// unsupported just means the emulator paces itself on its own internal -+// timing instead of syncing to the host's clock, which is what every other -+// platform this library runs on outside of this fence do anyway. -+int time_fence_is_supported() -+{ -+ return 0; -+} -+ -+void time_fence_post() -+{ -+} -+ -+int time_fence_wait(double secs) -+{ -+ (void)secs; -+ return 0; -+} -+ -+void time_fence_exit() -+{ -+} -+ - #else - - #include diff --git a/src/libpinmame/libpinmame.cpp b/src/libpinmame/libpinmame.cpp index 6966d77..755d762 100644 --- a/src/libpinmame/libpinmame.cpp