Decompilation of Paper Mario for N64
papermar.io
papermar.io
The official SDKs have been leaked for decades, so they probably just looked there.
Hopefully they shipped the GPL source with it!
https://youtu.be/t_rzYnXEQlE?si=ZWpp7-74cMdbsdba
The changes were much more extensive than just removing the debug flags.
They were also able to get local coop and a 4 player split screen working which were features originally intended for the game but cut for performance reasons.
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.
But seriously, it's nice to see the number of decomps and disassemblies for old video games we're getting recently. First Super Mario 64 and The Legend of Zelda: Ocarina of Time, now just about every other NES to N64 era Nintendo game you can think of. This will certainly be useful for mods in future.
https://decomp.me/scratch/GImYC https://github.com/pmret/papermario/pull/1019
I mean, my cat too can do that.
Getting tiresome with AI apologetics everywhere.
I can do a bit of decompilation with some mistakes, GPT4 can do more with some mistakes, hexrays can do much more with more accuracy but still makes mistakes. Nothing needs to be 100% perfect.
i insist my cat too can make decompilation mistakes if only i equip her with the keyboard paws
>publishing decompiled code is [not] good practice
I remember specifically that Portal64's developer required you to have the Portal.steam.app in order to build your own N64 version (using his tools/code).
No, Valve's legal team reached out to the creator and became worried when they learned that the project uses libultra from the leaked n64 sdk from Nintendo. To avoid any potential legal problems Valve asked the creator of Portal 64 to shut it down.
>using his tools/code
It required pirating Nintendo's N64 SDK in order to build. These decompilation projects don't require the SDK, but as my my original comment suggests they do contain code that is a derivative work of libraries from the SDK.
All this modern history was mind-blowing... a way-underpriced local CL listing for an N64 (with ALL the old games) has taken me way too far into this reverse-engineered rabbit-hole.
I get why perfect decompilation is a big deal, I'm just wondering if there are other approaches out there besides perfect decompilation in the community at large.
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.
great work btw
I first played Paper Mario on a PAL N64 when I was around 6 or 7 years old, and I recall not being able to get past certain sections because I could barely understand the dialogue. The cartridge had a previous owner who left a completed savefile, so after getting stuck I loaded it and eventually defeated the final boss. I remember the day vividly where I left the console on overnight displaying the "The End" screen because I thought there might be an easter egg - I'd just learned about Totaka's song in Luigi's Mansion (GCN). There is no postgame in Paper Mario, but I always dreamed of one.
In my time in the modding community I've found that I prefer to create documentation and tools for others to express their creativity than create my own, which is why tools like [1] and [2] exist. The decompilation lets users make mods even more flexibly than previous tools, so I hope to see some people build some cool stuff.
I also just love learning about how this game from my childhood works. It feels kinda like archaeology: discovering parts of the engine where hacks were thrown in at the last minute, finding code that was linked against an earlier version of the engine, etc.
[1] https://mamar.nanaian.town/ [2] https://github.com/nanaian/papermario-dx
It was a fantastic game. If you wanna play you’re in for a treat.
Those games lose the interesting stories and character design and mechanics that made the first two so beloved (Super Paper Mario is its own thing), and are heavily criticised by the fanbase as a result. Sticker Star is usually seen as the worst in the series due to the awkward puzzles, bosses where a single arbitrary item is needed to win and the generic characters and settings, but Color Splash and Origami King get their fair share of criticism too.
My advice to anyone reading this is to skip Sticker Star, maybe watch a Let's Play of Color Splash and try out Origami King if you're willing to accept it'll be nothing like the first two.
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.
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 ;)
Now to test emitting.
Where do I donate?
> PC Port?
There's a lot of people interested in playing a PC port of Paper Mario. Unfortunately, making a port isn't our focus. Porting the game isn't why we made the decomp project, and it's not a motivating factor in delving into this game. We have so many exciting goals for the project including decompiling other versions, making modding easier, and further understanding and documenting the codebase; making a port isn't really on our radar.
The things that Kaze Emanuar [1] has pulled off with Mario 64 are amazing.
Already in progress if you want to contribute: https://zelda64.dev/games/mm