Show HN: Transputer emulator in JavaScript (fast enough to be useful)
a year ago
- #Emulator
- #Transputer
- #Javascript
- Javascript port of a transputer emulator originally written in C.
- Javascript's JIT compiler allows performance closer to C.
- Bitwise operators in Javascript treated as 32-bit signed integers; workaround using >>> 0 for unsigned values.
- Uint8Array used for performance and memory efficiency, especially for large data like a 40MB hard disk drive.
- Base64 encoding used to reduce source code size for drive images.
- Floating-point emulation achieved using Float32Array, Float64Array, and Uint32Array.
- Display uses jsTerm with a custom font based on ECMA-94.
- Emulator preloaded with a full-blown operating system from 1996, featuring multiple drives and a C compiler.
- Commands available for directory listing, memory checks, text editing, and compiling programs.
- Includes a 3D modeler and ray tracer with sample scenes.
- Multitasking example with a clock display.
- Source code available on GitHub.