FIXING the ENTIRE SM64 Source Code (INSANE N64 performance)

Kaze Emanuar · 3.2M views · 2022 · 18:20

Open on YouTube

Software performance & optimizationGame history & retro gamingSpeedrunning, glitches & game hackingexplainer

Why Hacker News recommends it

HN loves the deep, hands-on look at N64 hardware quirks such as bus contention and the surprisingly large wins from low-hanging optimizations.

What it is

Kaze Emanuar explains how he rewrote and optimized the Super Mario 64 source code so it runs far faster on real N64 hardware. He covers performance bottlenecks and fixes in detail for his ROM hacks.

Recommended by 7 HN commenters across 7 different months, 2022 to 2025.

What Hacker News said

Strong rec CSMastermind · 2024-01 · 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: [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.

Strong rec alpaca128 · 2024-02 · 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] [this video]

Recommends MarioMan · 2023-01 · 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: [this video]

Recommends psychphysic · 2023-03 · 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. [this video] Loads of interesting quirks of the N64 to do with slow bus.

Recommends psychphysic · 2023-08 · 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. [this video] His videos on the Sine function in sm64 is a fun watch as the limitations make nearly all optimizations justifiable.

Recommends rdlw · 2023-10 · 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: [this video]

Recommends Wolfbeta · 2024-01 · 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 [this video]

Recommends Apofis · 2024-04 · 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) [this video]