Skip to content
0:00 / 0:00

#supermario64#n64#decompilation

FIXING the ENTIRE SM64 Source Code (INSANE N64 performance)

Kaze Emanuar

326K subscribers • 3 videos on Hallway

YouTube
  • Recommended by 8 people: 7 on Hacker News and 1 on Lobsters.
  • Presented by Kaze Emanuar

Intermediate. Assumes working knowledge.

3.2M views4 years ago8 recommendations

Game developmentSystems programmingGame programmingPerformance and optimizationRetro games and consoles

Kaze Emanuar explains how he rewrote and optimized the decompiled Super Mario 64 source code to achieve massive performance gains on real N64 hardware.

Could this bring Luigi back? Patreon: patreon.com/Kazestuff 🎥 twitch.tv/kazesm64 🐦 twitter.com/KazeEmanuar MERCH: kazen64.dashery.com/ Videos Referenced: Walls: youtube.com/watch?v=TSCzC-WECw8 Render blows: youtube.com/watch?v=uYPH-NH3B6k

Why it's here

8 people recommend this

What people say. Recommended as an impressive demonstration of retro game optimization and a deep dive into N64 hardware bottlenecks.

dbremneron Lobsters • Recommends

FIXING the ENTIRE SM64 Source Code (INSANE N64 performance) (2022)

CSMastermindon Hacker News • Recommends

On “Decompilation of Paper Mario for N64”

There's an amazing video about refactoring Mario 64 to reach 30 FPS and render 6x faster on N64: link to this video 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.

alpaca128on Hacker News • Recommends

On “How video games use lookup tables”

Not always, though it might depend on what platform you mean with retro. Kaze Emanuar on YT does a lot of development for the N64 and it feels like half the time he talks about how the memory bus affects all kinds of optimizations. In Mario 64 he replaced the original lookup table for the sine function because an approximation was faster and accurate enough (or rather two approximations for two different purposes). I love that channel, he reworked the entire Mario 64 code 0 to make it run at stable 60FPS...because he wanted his mods to run faster. 0 link to this video

MarioManon Hacker News • Recommends

On “Nintendo 64 Java”

On a related note, Kaze has done a deep dive into optimizing the Super Mario 64 source code for his ROM hacks. Here’s one of his more popular videos on the subject: link to this video

psychphysicon Hacker News • Recommends

On “The model for the coins in Super Mario Odyssey is 65% simpler than in SM Galaxy”

If you like this stuff Kaze Emanuar does loads of neat work with the super mario 64 decompiled code. link to this video Loads of interesting quirks of the N64 to do with slow bus.

psychphysicon Hacker News • Recommends

On “Leaked Wipeout source code leads to near-total rewrite and remaster”

Excellent..more of this please. Super Mario 64 has also had stupendous rewrites from decompiled code I believe. link to this video His videos on the Sine function in sm64 is a fun watch as the limitations make nearly all optimizations justifiable.

rdlwon Hacker News • Recommends

On “The Worlds First FPGA N64”

If anyone is interested in new projects for N64 hardware, Kaze Emanuar has an amazing series about optimizing Super Mario 64 to run incredibly complex romhacks on original hardware. Interestingly, SM64 is usually throttled by memory speed. This means that using 'inline' is detrimental to performance, since making the program larger can cause another read from memory. Here's an overview video, he has many more specific videos about specific topics: link to this video

Wolfbetaon Hacker News • Recommends

On “Super Mario 64 on the Web”

I've recently been enjoying watching this young modder on YouTube optimize all of the original SM64 source code, doubling frame rate, and modding his own Return To Yoshi's Island link to this video

Apofison Hacker News • Recommends

On “I ported thousands of apps to Windows 95 [video]”

If you found the video on Super Mario 64 being published with debug symbols interesting, check this out: After finding out about the debug symbols, a developer took a deeper dive through the codebase and optimized the ever living hell out of to get 60fps+. FIXING the ENTIRE SM64 Source Code (INSANE N64 performance) link to this video

psychphysicon Hacker News • Disputes

On “Ask HN: Publish old projects even though the source code embarrasses you by now?”

Just open source it. No one will judge you by 15 year old code if you have recently produced good code. That's what people will look at. Just look at the face palms at Nintendo HQ despite the amazing game they made link to this video

prophesion Hacker News • Mentions

On “Overhauling Mario 64's code to reach 30 FPS and render 6x faster on N64 [video]”

I think the main thing is that Nintendo had splitscreen multiplayer planned, but performance prevented it. Edit: Got farther into the video and he talks about this at 14:50 ( link to this video )

Thaxllon Hacker News • Mentions

On “Quake on the Game Boy Advance [video]”

Are modern compiler good enough / have good optimization on old hardware so that you don't need to write ASM? I remember that impressive opti on Mario64 and it's using C / GCC: link to this video

kibwenon Hacker News • Mentions

On “Finding the best sine function for Nintendo 64”

Kaze has already done so, and picking the low-hanging fruit results in much greater improvements than the optimizations shown here (which frees up less than one millisecond per frame). Here's the previous video with explanations and video demonstration of their improvements: link to this video

phireon Hacker News • Mentions

On “Finding the best sine function for Nintendo 64”

…s at a time while the memory chips close and reopen rows. Which is why some games can enable a high resolution mode when the memory expansion pack is present. They often don't need the extra 4MB of ram, but simply being able to strategically spread their data across eight different banks instead of four banks can massively improve performance. 1 link to this video…

dharmabon Hacker News • Mentions

On “Ask HN: What's your "it's not stupid if it works" story?”

Similarly, a modder recently found that unrolling loops _hurt_ performance on the N64 because of RAM bus contention: link to this video

echelonon Hacker News • Mentions

On “VR Powered by N64 [video]”

This is what James Lambert does as a follow up when Valve shuts down 1 his "Portal in N64" project 2. James is like Kaze 3 and builds incredible N64 demos 4 and technical videos about them. 1 link 2 link 3 link to this video 4 link