3 ms·
Show HN: MOS6502 in pure Lua running in WebAssembly
- bayangan 2y agoThis was a fun thing to see after having just finished binging Ben Eaters 6502 breadboard computer series. Since it's printing something out I suppose it also has everything else virtualised, would be cool to be able to provide it some machine code / assembly
- emulationonline 2y agoI networked a 6502 a while ago in order to capture some behavior that isn't well documented. You can interact with it using a wasm-based assembler in your browser. Programs only get 100 cycles to run but that should be plenty if you just want to poke around. https://chiplab.emulationonline.com/6502/ https://chiplab.emulationonline.com/6502/
- NackerHughes 2y agoHow many layers of virtualisation do we need?
- mococa 2y agoAll of them :)
- djmips 2y agoRun it in a browser in Wine on a MAC?
- mococa 2y agoNone of them run in a browser powered by WebAssembly. I created a 2D engine in C++20 based on SDL, in which I can use Lua to create games. Then I thought, “I’ll make a NES emulator,” so I started with its CPU, the 6502.
- djmips 2y agoHave you run https://github.com/Klaus2m5/6502_65C02_functional_tests https://github.com/Klaus2m5/6502_65C02_functional_tests ? See also https://www.righto.com/2012/12/the-6502-overflow-flag-explained.html https://www.righto.com/2012/12/the-6502-overflow-flag-explai... I also note that you have the same code copy/pasted in every ALU operation which might be better expressed in one location for maintenance reasons.
- mococa 2y agoGood call out. Thank you! I will give a try.
- mococa 2y agoI’ve just updated the demo. Check it out here: https://carimbo.run/play/1.0.43/willtobyte/MOS6502/1.0.6/480p/ https://carimbo.run/play/1.0.43/willtobyte/MOS6502/1.0.6/480...