TX-2 / TX-2-simulator

Simulator for the pioneering TX-2 computer
https://tx-2.github.io/
MIT License
21 stars 2 forks source link

Implement a web-based UI (maybe using WASM) #45

Closed jamesyoungman closed 2 years ago

jamesyoungman commented 2 years ago

Is your feature request related to a problem? Please describe. Problem: the current version of the simulator only runs on the console (e.g. Linux terminal). This is not suitable for simulation of important parts of the TX-2 computer. For example the CRT and the light pen. There are also TX-2 console controls which don't have a corresponding thing in the existing CLI code. For example the button that causes a reboot ("CODABO" - count down and blast off) has no UI element.

Describe the solution you'd like Because the simulator is a Rust library that's wholly reactive (that is, it passively waits for you to call ti to tell it to simulate something) it should be straightforward to build this into a WASM executable. The UI elements can be implemented in some mixture of WASM and TypeScript/JavaScript etc.

Describe alternatives you've considered I've also considered implementing the UI in some TUI or SDL, but I believe that a web-based presentation will be accessible to more people. It would be great to get feedback and corrections from people who had worked on the original TX-2. A good way to do this is to make the simulator available to them without some burdensome process of downloading and building source.

Additional context You might find it helpful to refer to the CLI implementation's main loop at cli/src/main.rs.