A NES emulator written in Odin lucypero.com · 22 points · 0 comments · HN thread...
HN Best 200 @best
A NES emulator written in Odin lucypero.com · 22 points · 0 comments · HN thread
TL;DR The author describes lucyNES, a NES emulator written in Odin over about seven months (June 2024 to January 2025, when the project was paused). It runs Battletoads and hundreds of other games, supports seven mappers, and has partial sound, while the author says the last stretch of accuracy work was the hardest part.
- Development started in late June 2024 and was worked on part-time until a pause in January 2025; the author says it took about seven months to reach its current state.
- Claimed accuracy is enough to run Battletoads and hundreds of other games; features include a debugger view, menu, save states, controller support and a CRT shader toggle.
- Supported mappers are NROM, MMC1, UXROM, CNROM, MMC3, GxROM and AxROM; some mappers are poorly implemented and cause certain games to fail.
- Sound is only partial: most games sound poor and the DMC channel is not implemented.
- The author argues that getting a basic NES emulator working is quick (around 80-90%), but accurate CPU/PPU timing and mapper behavior make the last 10% take most of the effort.
- Odin notes: no automatic integer promotion caused bugs, memory is handled with a per-frame temporary allocator, a global heap and a NES arena, and custom CBOR serialization was needed for bit-field raw unions.
Discussion The thread has no comments yet, so there is no community discussion to summarize at the time of this digest.