$ show 100thCoin/AccuracyCoin
AccuracyCoin is a comprehensive NES ROM-based test suite designed to verify the accuracy of NES emulators and hardware implementations. Containing 141 individual tests covering CPU instructions, PPU rendering, APU sound, timing behaviors, and hardware quirks, it serves as a valuable tool for emulator developers seeking to ensure their implementations match the behavior of original NES hardware (specifically targeting RP2A03G CPU and RP2C02G PPU revisions). The application features a navigable test menu accessible via standard NES controller inputs, allowing users to select and run specific tests, skip problematic tests, and view detailed pass/fail results with error codes. A distinctive debug menu, activated by the Select button, provides real-time inspection of memory contents including CPU registers and specific RAM regions, facilitating troubleshooting without external debugging tools. Each test is meticulously crafted to isolate specific hardware behaviors, often employing cycle-accurate timing techniques to probe edge cases and timing-dependent phenomena. What sets AccuracyCoin apart is its sophisticated approach to handling hardware variations - many tests acknowledge multiple valid behaviors that different NES revisions or implementations might exhibit, assigning success codes rather than simple pass/fail outcomes. This nuanced verification approach, combined with the comprehensive coverage of NES subsystems and the thoughtful design of the test harness and debug utilities, makes it a standout resource in the NES homebrew and emulator development communities.
The LLM identified 3 files worth highlighting for reuse:
A reusable test harness for NES homebrew applications that provides menu navigation with D-pad controls, test selection via A button, test skipping via B button, page-based organization of tests, and automatic result reporting. Demonstrates clean separation of test logic from presentation layer and efficient state management for NES applications with limited resources.
A debug system that displays memory values on screen when Select is pressed, showing CPU registers, specific memory ranges ($20-$2F, $50-$6F), and a larger memory block ($500-$5FF) in hexadecimal format. Shows clever use of NES PPU for text rendering without external debugging tools, allowing runtime inspection of memory state during test execution.
A framework for handling tests with multiple valid behavioral outcomes, where different implementations of NES hardware may exhibit different but equally correct behaviors. The system assigns success codes to tests and displays them on the results screen, allowing emulators to pass if they exhibit any of the valid behaviors. Demonstrates sophisticated test design that accommodates hardware variations while maintaining strict verification criteria.