How caiiiycuk/js-dos works
js-dos is a browser-facing DOS/Windows emulator player. Its main workflow initializes a player, loads a program bundle or configuration, presents a pre-run interface, and runs the emulator with rendering, audio, and input controls. The repository also documents persistence, multiplayer/IPX networking, turbo controls, and editor/settings capabilities. Some subsystem links below are based on README statements or SOURCE INDEX references; unsampled implementations are represented cautiously.
Main entry points: dos-runtime.tsx Emulator runtime · main.tsx Player entry · store.ts Application state · player-api-load.ts Bundle loader
Components 24
Player workflow
- Player entry
src/main.tsx - Bundle loader
src/player-api-load.ts - Pre-run screen
src/window/prerun-window.tsx - Player API
src/player-api.ts
Emulation runtime
- Emulator runtime
src/window/dos/dos-runtime.tsx - Graphics renderer
src/window/dos/render/webgl.ts - Audio output
src/window/dos/sound/audio-node.ts - Touch controls
src/layers/controls/layers-control.ts - Control layer DOM
src/layers/dom/layers.ts
State and integrations
- Application state
src/store.ts - DOS state
src/store/dos.ts - UI state
src/store/ui.ts - Storage progress
src/store/storage.ts - OPFS persistence
src/host/opfs.ts - Bundle storage
src/host/bundle-storage.ts - Local preferences
src/host/lstorage.ts - WebRTC networking
src/webrtcnet/webrtcnet.ts
Interface and controls
- Player interface
src/ui.tsx - Sidebar actions
src/sidebar/sidebar.tsx - Bundle editor
src/frame/editor/editor-fs-frame.tsx - Turbo controls
src/frame/trubo-frame.tsx
Other components
- Player user
- Emulators package
- Browser APIs
Connections 28
- Player user → Player entry: starts player
- Player entry → Application state: creates state
src/main.tsx - Player entry → Bundle loader: loads bundle
src/main.tsx - Player entry → Player interface: renders interface
src/main.tsx - Player entry → OPFS persistence: updates usage
src/main.tsx - Bundle loader → Bundle storage: loads bytes
src/player-api-load.ts - Pre-run screen → Bundle loader: loads bundle
src/window/prerun-window.tsx - Pre-run screen → Player API: saves changes
src/window/prerun-window.tsx - Player interface → Pre-run screen: shows screen
src/ui.tsx - Player interface → Sidebar actions: renders sidebar
src/ui.tsx - Bundle loader → DOS state: updates state
src/player-api-load.ts - Emulator runtime → Emulators package: uses emulator
src/window/dos/dos-runtime.tsx - Emulator runtime → Graphics renderer: renders frames
src/window/dos/dos-runtime.tsx - Emulator runtime → Audio output: outputs audio
src/window/dos/dos-runtime.tsx - Emulator runtime → Touch controls: mounts controls
src/window/dos/dos-runtime.tsx - Touch controls → Control layer DOM: builds overlays
src/layers/controls/layers-control.ts - Application state → DOS state: combines state
src/store.ts - Application state → UI state: combines state
src/store.ts - Application state → Storage progress: combines state
src/store.ts - DOS state → Local preferences: persists settings
src/store/dos.ts - UI state → Local preferences: persists preferences
src/store/ui.ts - Bundle storage → OPFS persistence: caches bundles
src/host/bundle-storage.ts - Bundle storage → Storage progress: reports progress
src/host/bundle-storage.ts - Sidebar actions → OPFS persistence: uses persistence
- Application state → WebRTC networking: integrates networking
src/store.ts - Player user → Bundle editor: edits bundle
- Player user → Turbo controls: adjusts speed
- Emulator runtime → Browser APIs: runs in browser