How desmodroid/nes-emulator works
This is a work-in-progress NES emulator whose implemented workflow loads an iNES ROM, connects its cartridge to a simple memory bus, and repeatedly steps a 6502 CPU. The CPU supports implemented official instructions and addressing modes; the bus currently provides mirrored RAM and cartridge reads, while PPU/APU routing and interrupts are not implemented. The graph separates CPU dispatch, addressing, and instruction behavior. Relationships are based on the shown excerpts and README; unsampled behavior is omitted.
Main entry points: bus.cpp Memory bus · main.cpp Emulator runner · cpu.cpp CPU dispatch · cpu_addressing_modes.cpp Addressing modes
Components 9
Emulator runtime
- Emulator runner
main.cpp
6502 CPU
- CPU dispatch
src/cpu.cpp - Addressing modes
src/cpu_addressing_modes.cpp - Instruction behavior
src/cpu_instructions.cpp
ROM and memory
- Memory bus
src/bus.cpp - Cartridge parser
src/cartridge.cpp - Mirrored RAM
include/bus.hpp
Other components
- ROM user
- NES ROM file
Connections 12
- ROM user → Emulator runner: starts with ROM
README.md - Emulator runner → NES ROM file: reads bytes
main.cpp - Emulator runner → Cartridge parser: constructs cartridge
main.cpp - Emulator runner → Memory bus: connects cartridge
main.cpp - Emulator runner → CPU dispatch: resets and steps
main.cpp - CPU dispatch → Addressing modes: dispatches mode
src/cpu.cpp - CPU dispatch → Instruction behavior: executes instruction
src/cpu.cpp - CPU dispatch → Memory bus: fetches opcode
src/cpu.cpp - Addressing modes → Memory bus: reads operands
src/cpu_addressing_modes.cpp - Instruction behavior → Memory bus: reads and writes
src/cpu_instructions.cpp - Memory bus → Mirrored RAM: reads and writes
src/bus.cpp - Memory bus → Cartridge parser: routes cartridge reads
src/bus.cpp