From 5570955bc58bbe236760b1ec39b3ad3aa903ef8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 23 Aug 2026 12:47:51 +0200 Subject: [PATCH] Fix patches/pinmame/0004: drop duplicate hunk conflicting with 0002 0004 was generated via a plain `git diff` against pinmame's pristine commit, which captured the *cumulative* diff for cpuexec.c - including patch 0002's time_fence stub hunk, not just 0004's own new cpu_run splitting code. Applying 0002 then 0004 in sequence (exactly what setup.sh does) failed: 0004's duplicate hunk expected pre-0002 context that no longer matched. Regenerated by diffing the current tree against a baseline with 0001-0003 already applied (matching the vpinball/0006 patch's existing approach) instead of against pristine directly. Verified: all 4 pinmame patches now apply cleanly in sequence against a fresh pristine checkout, and the result is byte-identical to the working tree that was actually built and tested. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01SoSarxLgY33Kax5UNXcafZ --- ...04-emscripten-cooperative-scheduling.patch | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) 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