feat: add browser PICO-8 player

Add v2 browser playback for .p8 and .p8.png cartridges, backed by the
FAKE-08 WebAssembly runtime, with canvas rendering, audio, fullscreen and
keyboard, gamepad, mouse and touch input. Wires up platform detection,
play actions, routing, localization, gallery navigation, play-session
tracking and lifecycle cleanup.

The runtime is fetched in the emulator stage of docker/Dockerfile, pinned
by source commit and verified with sha256, so it is provisioned the same
way as EmulatorJS, Ruffle and js-dos rather than committed to the repo.

DISABLE_PICO8 gates the player, matching the existing DISABLE_EMULATOR_JS,
DISABLE_RUFFLE_RS and DISABLE_JSDOS toggles.

Based on #4383.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bee
2026-09-08 17:59:52 -04:00
committed by Georges-Antoine Assi
parent 08f294d0fa
commit f50eacfcbd
44 changed files with 1137 additions and 17 deletions

View File

@@ -319,6 +319,7 @@ SYNC_SSH_KNOWN_HOSTS_PATH: Final[str] = _get_env(
DISABLE_EMULATOR_JS: Final[bool] = safe_str_to_bool(_get_env("DISABLE_EMULATOR_JS"))
DISABLE_RUFFLE_RS: Final[bool] = safe_str_to_bool(_get_env("DISABLE_RUFFLE_RS"))
DISABLE_JSDOS: Final[bool] = safe_str_to_bool(_get_env("DISABLE_JSDOS"))
DISABLE_PICO8: Final[bool] = safe_str_to_bool(_get_env("DISABLE_PICO8"))
# FRONTEND
KIOSK_MODE: Final[bool] = safe_str_to_bool(_get_env("KIOSK_MODE"))

View File

@@ -11,6 +11,7 @@ from config import (
DISABLE_EMULATOR_JS,
DISABLE_JSDOS,
DISABLE_LOGS_VIEWER,
DISABLE_PICO8,
DISABLE_RUFFLE_RS,
DISABLE_SETUP_WIZARD,
DISABLE_USERPASS_LOGIN,
@@ -157,6 +158,7 @@ async def heartbeat() -> HeartbeatResponse:
"DISABLE_EMULATOR_JS": DISABLE_EMULATOR_JS,
"DISABLE_RUFFLE_RS": DISABLE_RUFFLE_RS,
"DISABLE_JSDOS": DISABLE_JSDOS,
"DISABLE_PICO8": DISABLE_PICO8,
},
"FRONTEND": {
"DISABLE_USERPASS_LOGIN": DISABLE_USERPASS_LOGIN,

View File

@@ -36,6 +36,7 @@ class EmulationDict(TypedDict):
DISABLE_EMULATOR_JS: bool
DISABLE_RUFFLE_RS: bool
DISABLE_JSDOS: bool
DISABLE_PICO8: bool
class FrontendDict(TypedDict):

View File

@@ -48,6 +48,7 @@ def test_heartbeat(client):
assert isinstance(emulation["DISABLE_EMULATOR_JS"], bool)
assert isinstance(emulation["DISABLE_RUFFLE_RS"], bool)
assert isinstance(emulation["DISABLE_JSDOS"], bool)
assert isinstance(emulation["DISABLE_PICO8"], bool)
assert "FRONTEND" in heartbeat
frontend = heartbeat["FRONTEND"]