How linkfy/gb_emu_1 works
This repository is a Rust Game Boy emulator: a user supplies a ROM and runs it through CPU execution, memory-mapped hardware, video rendering, and audio output, with joypad input during emulation. The CPU instruction module is a useful internal layer beneath the CPU dispatcher. A separate browser script tracks opcode-table progress; the supplied excerpts do not establish how its page is wired. The map reflects shown calls and documented behavior; unsampled implementation details and links are omitted where evidence is limited.
Main entry points: main.rs Emulation loop · memory.rs Memory and controllers · mod.rs CPU · instructions.rs Instruction operations
Components 13
Emulator runtime
- Emulation loop
src/main.rs - ROM loader
src/rom.rs - CPU
src/cpu/mod.rs - Instruction operations
src/cpu/instructions.rs
Emulated hardware
- Memory and controllers
src/memory.rs - Joypad state
src/input.rs - Video processor
src/ppu.rs - Audio processor
src/apu.rs
User interface
- Window and display
src/main.rs - Audio output stream
src/main.rs
Opcode progress viewer
- Opcode progress
html_viewer/progress.js
Other components
- Player
- Browser local storage
Connections 15
- Player → Emulation loop: starts emulator
src/main.rs - Emulation loop → ROM loader: loads ROM
src/main.rs - Emulation loop → CPU: steps CPU
src/main.rs - Emulation loop → Video processor: advances cycles
src/main.rs - Emulation loop → Audio processor: advances cycles
src/main.rs - Emulation loop → Joypad state: reads buttons
src/main.rs - Emulation loop → Memory and controllers: updates joypad
src/main.rs - CPU → Instruction operations: dispatches opcodes
src/cpu/mod.rs - CPU → Memory and controllers: fetches data
src/cpu/mod.rs - Instruction operations → Memory and controllers: reads and writes
src/cpu/instructions.rs - Video processor → Memory and controllers: reads display state
src/ppu.rs - Audio processor → Memory and controllers: reads audio registers
src/apu.rs - Emulation loop → Window and display: presents frames
src/main.rs - Emulation loop → Audio output stream: starts stream
src/main.rs - Opcode progress → Browser local storage: saves progress
html_viewer/progress.js