Hasty Briefsbeta

Bilingual

Making Nintendo DS ROMs with Rust

3 hours ago
  • #ROM Development
  • #Rust
  • #Nintendo DS
  • The project initially aimed to make games with Rust for Game Boy Color but shifted to Nintendo DS due to technical challenges.
  • LLVM lacks a backend for Game Boy Color's CPU, leading to a messy workaround involving C code conversion.
  • Switched focus to Game Boy Advance but encountered hardware issues (yellowed case, corroded batteries).
  • Found Nintendo DS Lite but had to buy a charger; top screen was cracked.
  • Limited resources for making Nintendo DS ROMs with Rust, mostly finding unrelated rust issues with cartridges.
  • Followed similar steps to compiling GBA ROMs: build object, link, make executable, create ROM.
  • Used BlocksDS for building ROMs and programming; considered making bindgen crate for nds library.
  • Targeted ARM9 processor for game development; set up project with cargo init --lib and configured cargo.toml.
  • Required nightly Rust for building with -Zbuild-std=core; used release builds to avoid bloated debug builds.
  • Added placeholder panic handler and main function in lib.rs for nostd environment.
  • Linked using arm-none-eabi-gcc from BlocksDS, utilizing nds library and dsarm9 specs file.
  • Final step involved using ndstool to create ROM from ARM9 executable and prebuilt ARM7 executable.
  • Explored using Rust stdlib with a small allocator leveraging malloc from C library included with libnds.