RustyNES v0.4.0 - Integration Layer (Milestone 5)
This release completes the functional core of RustyNES by integrating all
previously implemented subsystems (CPU, PPU, APU, Mappers) into a cohesive
NES emulator. The rustynes-core crate provides a hardware-accurate bus
system and console coordinator ready for GUI development.
MILESTONE 5 DELIVERABLES
========================
Bus System (390 lines)
- Complete NES memory map implementation ($0000-$FFFF)
- Internal RAM: 2KB with proper mirroring ($0000-$1FFF)
- PPU registers: $2000-$3FFF with 8-byte mirroring
- APU/IO registers: $4000-$401F
- Cartridge space: $4020-$FFFF (PRG ROM/RAM)
- OAM DMA: Cycle-accurate 513-514 cycle transfers
- Mapper IRQ integration with CPU interrupt handling
Console Coordinator (425 lines)
- CPU/PPU/APU timing synchronization
- PPU: 3 dots per CPU cycle (5.369318 MHz)
- APU: 1 step per CPU cycle (1.789773 MHz)
- Frame timing: 29,780 CPU cycles per NTSC frame
- NMI generation from PPU vblank
- IRQ handling from mapper scanline counters
Input System (386 lines)
- Standard NES controller emulation
- Hardware-accurate shift register protocol
- Strobe latch control ($4016 bit 0)
- 8-button serial read sequence (A/B/Select/Start/Up/Down/Left/Right)
- Open bus behavior ($40 on bits 1-7)
- Two-controller support ($4016/$4017)
Save State Framework (130 lines)
- Format specification with 64-byte header
- Magic number validation ("RNES")
- Version tracking for compatibility
- SHA-256 ROM hash for mismatch detection
- CRC32 integrity verification
- Modular component serialization (ready for Phase 2)
TEST COVERAGE
=============
Total: 398 tests passing (100% pass rate)
By Crate:
- rustynes-cpu: 46 tests (instruction execution, addressing modes, interrupts)
- rustynes-ppu: 83 tests (rendering, timing, registers, sprites)
- rustynes-apu: 150 tests (channels, timing, mixing, DMC)
- rustynes-mappers: 78 tests (NROM, MMC1, UxROM, CNROM, MMC3)
- rustynes-core: 41 tests (bus routing, console timing, input, DMA)
New in v0.4.0:
- Bus tests: 22 (memory map, PPU/APU/controller routing, DMA, mirroring)
- Console tests: 7 (creation, reset, step, frame, ROM loading, timing)
- Input tests: 9 (controller strobe, button states, serial protocol)
- Integration tests: 3 (CPU+PPU+APU synchronization)
DOCUMENTATION
=============
- Comprehensive TODO audit: 8 files corrected from PENDING to COMPLETED
- Test ROM plan: 212 test files inventoried with execution roadmap
- Updated README.md, CHANGELOG.md, ROADMAP.md for consistency
- All TODO files now 100% accurate
TECHNICAL SPECIFICATIONS
========================
- Zero unsafe code across all crates
- Strict clippy pedantic compliance
- MSRV: Rust 1.75+
- Dual-licensed: MIT/Apache-2.0
WHAT'S NEXT (Milestone 6)
=========================
- Desktop GUI with egui/wgpu (rustynes-desktop crate)
- Visual test ROM validation
- Playable MVP release
- Target: 80%+ game compatibility
Phase 1 Progress: 83% complete (5 of 6 milestones)