[WIP] feat: playable Win3.x and Win9.x using js-dos - #4061
Draft
bphenriques wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
draft/WIP. I need to manually review the code, the PR description and the accompanying changes ot the docs.
Add a js-dos player for Windows 3.x / 9x (win3x, win9x)
Closes #3143
Related PR: rommapp/docs#110
Test Titles:
Summary
EmulatorJS (
dosbox-pure) boots DOS games but blank-screens Windows 3.x titles:its WASM build cannot render Windows' SVGA output. This adds
js-dosv8 (DOSBox-Xbackend) as a fourth in-browser player so
win3xandwin9xROMs becomeplayable. DOS stays on EmulatorJS.
Validated locally with Fine Artist and four Magic School Bus titles (all Win16
GUI programs), which run under
js-doswhere EmulatorJS blank-screened.What this adds
frontend/src/v2/views/Player/JsDos.vue, modeled onRuffle.vue(pre-game config panel plus a running stage)./rom/:id/jsdos(plugins/router.tsandv2/router/routes.ts).isJsDosEmulationSupported(@/utils),canPlayJsDos(
useCanPlay), and a dispatch branch inuseGameActionsthat puts js-dosahead of EmulatorJS for
win3xandwin9x.DISABLE_JSDOS(env var plusheartbeat.EMULATION.DISABLE_JSDOS),mirroring
DISABLE_EMULATOR_JSandDISABLE_RUFFLE_RS./assets/jsdos, served same-origin, mirroring how Ruffle vendors its runtime./jsdosthat/ejsalready receives.getDownloadPath(the same bundle the download endpoint serves,no repackaging).
js-dos options set in v1:
url,backend: "dosboxX",pathPrefix(the vendoredemulators, since js-dos otherwise fetches its wasm from a CDN that require-corp
blocks),
autoStart: trueandautoSave: true(matching EmulatorJS defaults,EJS_startOnLoadedand auto-persisted saves), andsetNoCloud(true)(aself-hosted instance does not surface the dos.zone cloud). Every other js-dos
option uses its default.
Scope and non-goals
win3xandwin9x. DOS stays on EmulatorJS. Addingdoslater is aone-line slug addition.
saves (
fsChangestoSaveSchema, so js-dos saves appear in RomM's save UIand are portable) are a tracked follow-up, matching the EmulatorJS save
integration.
image, which is a bundling and docs concern, not code.
Test Plan
Automated
Frontend (from
frontend/):npm run generatethennpm run typecheck: the heartbeat schema gainedDISABLE_JSDOS, so the generatedEmulationDictis regenerated and typechecks.npm run test: new unit testsisJsDosEmulationSupported(utils/index.test.ts): supports win3x and win9x,case-insensitive, rejects dos/flash/snes, respects the
DISABLE_JSDOStoggle,honours a
PLATFORMS_VERSIONSremap onto win3x.useGameActions/index.test.ts): a win3x/win9x gamefull-loads
/rom/:id/jsdosahead of EmulatorJS.npm run build: passes.Backend (from
backend/):uv run pytest tests/endpoints/test_heartbeat.py:DISABLE_JSDOSis presentand boolean in the
EMULATIONpayload.Repo-wide:
trunk fmt && trunk check: clean (ESLint, Prettier, ruff, black, mypy, bandit).Manual (browser, uiVersion v2)
win3xROM launches into/rom/:id/jsdos(not EmulatorJS, not the"not migrated to v2" fallback) and boots, with DOSBox-X rendering Windows.
self.crossOriginIsolated === trueon the player page (COOP/COEP applied).only commit a save to disk when exited to Program Manager, so autoSave captures
it after the app exits, not on the app's Save button. This is guest behavior,
not a player bug.
DISABLE_JSDOS=true, awin3xROM no longer routes to js-dos.Follow-ups
fsChangestoSaveSchema).dosboxConfplusinitFs) and a CD folder-mount recipe(js-dos's DOSBox-X has no
imgmount).win3xvsdos), bundlinga win3x game, and the save-on-exit caveat for apps like Fine Artist.
AI assistance disclosure
This contribution was developed with the assistance of Claude (Anthropic), an AI
coding assistant. I reviewed, tested, and validated the design, implementation,
and tests, and I take responsibility for the change.