Writing An NES Emulator with Rust and WebAssembly

TL;DR

The Nintendo Entertainment System (NES)

  • CPU 6502(RP2A03), 8bit 1.79MHz
  • PPU Picture Processing Unit RP2C02
  • ROM ProgramROM:32KiB + CharactorROM:8KiB
  • WRAM WorkingRAM 2KiB
  • VRAM VideoRAM 2KiB
  • Color 52color
  • Resolution 256x240pixles
  • Sound Square1/2, Triangle, Noise, DPCM
  • Controller Up, Down, Left, Right, A, B, Start, Select

Emulator Structure

Building WebAssembly with Rust

The Game loop

The CPU

Registers

Memory map

How to emulate CPU

The PPU (Picture Processing Unit)

The game Pad

The Sound

Conclusions

--

--

--

FrontEndEngineer / Embedded Engineer https://github.com/bokuweb

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CountDown Timer in Android

Containers and Dockers For Data Scientist

Deploy your Python applications on AWS with PyCharm Professional

An eloquent way of handling model state

Complicated Simplicity: The curse of modern tech.

Chapter 7 When Estimates and Actuals Differ

Hackathons are better than [insert your favorite holiday]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
bokuweb

bokuweb

FrontEndEngineer / Embedded Engineer https://github.com/bokuweb

More from Medium

My RUST Journey

Building cross platform library with Rust for ios and android

Avoiding using Serde in Rust WebAssembly When Performance Matters

NodeJS Native Module vs WASM