Decompilation of Paper Mario for N64

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • papermario

    Decompilation of Paper Mario

  • papermario-dx

    Improved Paper Mario (Nintendo 64) game engine prioritising developer experience

  • This is great! I wonder how long until we see GPT-assisted decompilation.

    Taking a peek at the source, it's so interesting to see the a piece of history. For example, this was released in Japan in 2000, then internationally months later. As I recall, there was awareness building around the idea that vibrating controllers (here, the N64 Rumble Pak accessory) cause RSI or carpal tunnel. Since the developers shortened the rumble length outside of Japan, it looks like they were aware as well: https://github.com/nanaian/papermario-dx/blob/main/src/rumbl...

    I wonder what led to this decision being made at the exclusion of the JP release.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • decomp.me

    Collaborative decompilation and reverse engineering website

  • Checkout http://decomp.me - it’s a community built tool used by a lot of video game decompilation projects. You put in the original bytecode, it will attempt a decomp, and then you fiddle with the source (using the same toolchain & flags known/best guessed to be used by original devs) until it matches perfectly. It’s super cool.

  • noclip.website

    A digital museum of video game levels

  • As far as I know, yes.. Besides simple differences like register allocation, it's difficult to prove that your code behaves the same as the target if its nonmatching. It's also just really satisfying when you get a match.

    When doing standard reverse engineering, you might use something like Ghidra or Hex-Rays. This is what the developer of noclip.website [1] did to reimplement a lot of Mario Galaxy code, such as enemy AI.

    [1] https://noclip.website/#smg/AstroGalaxy

  • awesome-decompilation

    A curated list of awesome decompilation resources and projects.

  • Depends on your goal. If it's matching decompilation, probably the former.

    There's been research into the latter but its in early stages. https://github.com/nforest/awesome-decompilation?tab=readme-...

    decomp.me gives us a large database of C(++) <-> target asm to train a model on ;)

  • gcc-papermario

    GCC 2.8.1 with patches to support building Paper Mario

  • SM64 uses SGI's IRIS Development Option (IDO) compiler. And yes, it's unoptimised.

    Paper Mario, however, /does/ use GCC, and it's optimised. Figuring out the compiler version was fairly easy as there's a limited number of options - we know when the game began development, so we looked for releases around that time. The harder parts were figuring out compiler flags (consider all the -f flags affecting code generation; papermario used -fforce-addr) and coming to the terrifying conclusion that the compiler was modified!

    The majority of papermario was built with a modified build of GCC 2.8.1 [1] at -O2. The SDK code (libultra, nusystem) was built with GCC 2.7.2 at -O3. The iQue Player version, i.e. the Chinese release, was built with EGCS.

    [1] https://github.com/pmret/gcc-papermario

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts