Phase E/I: expose evalScript() as a permanent debug API, finalize README

Promotes vpinball_wasm_eval_script from a one-off validation hack to a
supported PinballInstance.evalScript() method (runs arbitrary VBScript
against the live table via the interpreter's own debug-console entry
point) - useful standalone, and it's what confirms the DMD script API
rides the same execution path already proven by real flipper input.

Rewrites the README's Status/Roadmap/Known limitations to reflect
tonight's actual, hands-on-confirmed state: keyboard input, audio, and
VBScript-driven gameplay all verified end-to-end (not just code
review); two more real engine bugs found and fixed (GL back buffer
sized in logical instead of device pixels; back buffer never resynced
on resize, breaking fullscreen); the default table swap and why;
B2S backglass explicitly assessed and declined for now, with the
concrete reasons (no plugin subsystem wired for this build, no test
table to validate against) rather than left as a vague TODO.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-22 18:14:49 +02:00
co-authored by Claude Sonnet 5
parent b8bf9f1510
commit 4638c06b68
5 changed files with 64 additions and 25 deletions
+17 -2
View File
@@ -54,10 +54,10 @@ index 2a18ceb..a033615 100644
class AuditTableCommand : public TableBasedCommand
diff --git a/src/core/EmscriptenBridge.cpp b/src/core/EmscriptenBridge.cpp
new file mode 100644
index 0000000..e6bccde
index 0000000..6e20009
--- /dev/null
+++ b/src/core/EmscriptenBridge.cpp
@@ -0,0 +1,78 @@
@@ -0,0 +1,93 @@
+// license:GPLv3+
+
+// vpinball-wasm: JS-callable entry points for controlling the player's
@@ -133,6 +133,21 @@ index 0000000..e6bccde
+ g_wasmPlayer = nullptr;
+}
+
+// Runs arbitrary VBScript against the running table's script interpreter,
+// via the same ScriptInterpreter::Evaluate() entry point the interpreter's
+// own debug console uses. Useful both as a debug/console hook for consumers
+// and, e.g., to exercise script-driven APIs (like the DMD pixel API) against
+// a table that doesn't itself call them, without needing to author a new
+// .vpx table.
+EMSCRIPTEN_KEEPALIVE
+int vpinball_wasm_eval_script(const char* script)
+{
+ if (g_wasmPlayer == nullptr || g_wasmPlayer->m_scriptInterpreter == nullptr)
+ return 0;
+ g_wasmPlayer->m_scriptInterpreter->Evaluate(script, false);
+ return 1;
+}
+
+} // extern "C"
+
+#endif // __EMSCRIPTEN__