I'm doing it essentially for fun
I watched One Lone Coder's NES emulator from scratch videos, and it got me going
I do it in rust cause I want to understand the language better. Don't use my code to learn rust, it's not great
I usually do the code on stream at my twitch channel
you should be able to start a live coding experience with node first.js, no install required. hopefully.
Only tested in windows
The SMS (as most early Sega machines) is based on the Zilog 80 processor. First point of order is t oemulate that.
Currently I'm parsing the CSV (adapted from the table available here)file and make boxed lambdas representing each variant (there's around 1000 allowed opcode of lenght 1-4 bytes)
Then we'll need to emulate the VDP but that's going to be easier
- needs wasm-pack
- needs rust nightly for now until I lose the bigint dependency
- needs node >= 16.0 for hot-reload during dev
- we don't have node dependencies but at least
npm iwill tell you if you don't have a node recent enough
again, you should be able to start everything with node first.mjs
on windows, this batch will setup a "usable" live code experience on virtual disk W:
feel free to propose similar ones for other os's
I used the wasm template to kickstart the project. You don't need to know about it but here it is
WTFPL You're free to copy my terrible code and make it even worse. Don't use it on important things though.
If you do make it better I'd like to know, thanks
wasm-bindgenfor communicating between WebAssembly and JavaScript.console_error_panic_hookfor logging panic messages to the developer console.wee_alloc, an allocator optimized for small code size.
