Skip to content

resistcorp/rust-emulator-proto

Repository files navigation

About this project

I'm doing it essentially for fun

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

premise

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

setup

  • 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 i will 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

🛠️ dev with www/npm run dev and wasm-pack build

🛠️ Build rust code with wasm-pack build (not autobuilt for now, but it hot-reloads)

Licence

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

📚 resources

🔋 Batteries Included

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published