• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Fixing The Entire Super Mario 64 Source Code (Insane N64 Performance)

Ceallach

Smells like fresh rosebuds
Crazy how unoptimized the original code is.
I think it's a matter of how new this was at the time. Nintendo were doing things no one else was. The type of Z Buffering and anti-aliasing Nintendo were working on in 1994 and 1995 were things no one else in the industry was really doing. Mid-90s Nintendo weren't 2020s Nintendo-they were pioneers and technical innovators. The code was unoptimized because the optimization techniques didn't exist at the time. They were creating this stuff.
 

Rentahamster

Rodent Whores
The benefits from being from the future! That was very interesting. Kaze is a beast.

Crazy how unoptimized the original code is.
It could have been better, but they were limited by the technology of their time, and for the original devs, all this stuff was very new. Not only were the dealing with new hardware, they were creating new rendering software, and were probably under a time constraint too in order to make the launch window.
 

Sophist

Member
Can't watch the video now, have they achieve 60 fps on real console?
From what i have seen in the video, it's more about 40 fps than 60. He used optimization techniques that today compilers are doing automatically (i think nintendo 64 sdk was using gcc 2.x back then).

some stuff he did:
  • replacing switch statements with jump tables.
  • rolling computation on array elements into a loop.
  • implementing basic math operations with cpu instructions.
  • avoiding unnecessary bitshifting/masking.
 

RoadHazard

Gold Member
From what i have seen in the video, it's more about 40 fps than 60. He used optimization techniques that today compilers are doing automatically (i think nintendo 64 sdk was using gcc 2.x back then).

some stuff he did:
  • replacing switch statements with jump tables.
  • rolling computation on array elements into a loop.
  • implementing basic math operations with cpu instructions.
  • avoiding unnecessary bitshifting/masking.

So it gained 10fps? Because the original is 30fps, not 20 like OoT etc. 30 -> 40 (33% improvement) is quite a ways off from 20 -> 60 (200% improvement) like the video thumbnail claims, lol. But still, it's something.
 
Last edited:

Deerock71

Member
A more elegant solution.
light saber GIF by Star Wars
 

Stuart360

Member
It makes you wonder what N64 games would of been like if it had been easy to develop on like this guy is doing.
I bet fog would of been much lower in games, a lot of the 15-20fps games would probably of been 30fps, with a few 60fps games thrown in.
It would of been cool to see a N64 like that compete against PS1. PS1 would still of won of course, but i bet N64 would of done better than it did.
 

sn0man

Member
I think it's a matter of how new this was at the time. Nintendo were doing things no one else was. The type of Z Buffering and anti-aliasing Nintendo were working on in 1994 and 1995 were things no one else in the industry was really doing. Mid-90s Nintendo weren't 2020s Nintendo-they were pioneers and technical innovators. The code was unoptimized because the optimization techniques didn't exist at the time. They were creating this stuff.
Yes for sure. In the video one of the optimizations was to have various subroutines access specific memory to eliminate memory fighting. The video creator even says this was something he could do with the increased RAM of the N64 jumper pack and the N64 as shipped couldn’t benefit from this.
 

ZehDon

Member
I think it's a matter of how new this was at the time. Nintendo were doing things no one else was. The type of Z Buffering and anti-aliasing Nintendo were working on in 1994 and 1995 were things no one else in the industry was really doing. Mid-90s Nintendo weren't 2020s Nintendo-they were pioneers and technical innovators. The code was unoptimized because the optimization techniques didn't exist at the time. They were creating this stuff.
Well said. Nintendo's programmers were on the bleeding edge here; we've got thirty years worth of vetted hindsight to apply. Carmack made mistakes in the original Doom engine, too - but no one knew they were mistakes at the time.

It's worth noting that the creator explains he's using the N64 Expansion Pack - something that Super Mario 64 didn't have access to. This informs a lot of the structural changes, such as giving the CPU and GPU their own memory allocations to free up the memory bus as much as possible - something impossible when Super Mario 64 was first coded.
 

ShadowLag

Member
I just saw this video last night and was going to make a thread about it, but discovered this thread today.

What an absolute madlad this guy is. Who knew that rewriting an actual ROM to run way better on its original target hardware could be just as exciting/cool as creating native PC ports.

Not to mention... the mod he's showcasing in this video is like AAA quality, wtf?
 

Dream-Knife

Banned
Don't modern consoles with unified memory share the same bus? Granted they are APUs now, so I imagine some of the issues are alleviated.
Neat. I wonder if this is possible to implement in other N64 games? A framerate boost would do wonders for many of them.
I'd die for an optimized Perfect Dark if at all possible.
 

STARSBarry

Gold Member
would love to see a physical release of this on a real cartridge.

know it wont happen, but lemme dream...

The issue is it would not run on any N64 without the RAM expansion pack installed... Just like DK64.

in alot of ways this feels like one of those games which have a PS4 Pro optimised mode... if they didn't work on a regular PS4 afterwards.
 
Last edited:
Top Bottom