Urgent.News

What's breaking now, across thousands of outlets.

Tech

A NES emulator written in Odin

In late June 2024, an individual began a project to create a NES emulator written in Odin, a simple C-like language. They worked on it in their spare time for several months before taking a break in January 2025 to focus on other tasks. The project, which has been an enjoyable yet challenging experience, took significantly longer than expected to achieve its current state. The emulator is 80-90% complete, with the last 10% remaining as the most difficult part to perfect.

The NES hardware has many intricacies that need emulation for certain games to run correctly. The CPU and PPU (the graphics rendering chip) work in parallel and must communicate accurately for the emulator to function properly. This timing complexity, along with issues related to mappers (implementations of NES cartridges), made the project particularly challenging.

Implementing mappers correctly is crucial for certain games to function, but some mappers are still poorly documented and implemented, causing difficulties in getting some games to run.

The creator of the emulator found Odin to be an ideal language for this project due to its simplicity and strong typing, allowing them to focus on the core functionality without unnecessary complexities. However, Odin's lack of automatic integer promotion and memory management proved to be stumbling blocks. They had to implement their own strategies for memory allocation and handle custom serialization of Odin objects using the CBOR library.

Despite these challenges, Odin's raw unions and bit fields proved to be particularly useful for emulator development.

Currently, the emulator is far from complete. There are several notable gaps to fill, including additional mappers, better memory management strategies, and improved serialization techniques. The creator acknowledges that the project will never truly be finished, but they plan to continue working on it to bring it closer to a "complete" state. Their journey through developing this emulator has provided them with valuable insights into both the NES hardware and the Odin programming language.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at lucypero.com →

More in Tech

What Namespace runners are, and how unit minutes work

Namespace runners are GitHub Actions runners sold by the compute unit rather than the wall-clock minute, where one unit is 1 vCPU plus 2 GB of RAM for a minute, multiplied by 1 on Linux, 2 on Windows…

  • Namespace runners offer unique compute units instead of wall-clock minutes on GitHub Actions
  • Unit equals 1 vCPU + 2 GB RAM per minute, with platform multipliers (1 Linux, 2 Windows, 10 macOS)
  • Team plan includes 100,000 unit minutes, determining wall-clock minutes based on selected machine

I measured DigImg vs TinyPNG vs ShortPixel on the same images (bytes + SSIM)

A smaller image file is useful. A smaller file that visibly damages a logo, screenshot, or photo is not always a win. So instead of comparing marketing claims, I ran the same four source images…

  • DigImg produced smallest file for photographic images but lowest SSIM score
  • Transparent logos tied between TinyPNG, DigImg, and ShortPixel

SLH-DSA changes signature size budgets before it changes the signature model

SLH-DSA changes signature size budgets before it changes the signature model SLH-DSA is a stateless hash-based signature scheme standardized in FIPS 205.

  • SLH-DSA simplifies backup/replication by eliminating signing counter
  • Six parameter sets available, split between small/fast variants
  • Smallest signatures: 7,856 bytes at security level 1

More from Sunday 15 November →