A Deep Dive Into Tremendous Mario 64’s Reminiscence Misadventure

Editorial Team
7 Min Read



Tremendous Mario 64, launched in 1996, is a nostalgic basic for a lot of, however there’s a surprising fact beneath the floor: the sport is reminiscence hungry. Due to the work of modder Kaze Emanuar, we get to see how this legendary Nintendo 64 sport used its 4 megabytes of RAM in ways in which have been, at occasions, surprisingly wasteful.



Emanuar’s investigation begins with the sport’s RAM map, a blueprint of how Tremendous Mario 64 organizes its information at runtime. The Nintendo 64’s 4 megabytes of quick RDRAM needed to maintain all the things: textures, code, music, output buffers and actor states. To place that in perspective that’s roughly the dimensions of a single fashionable smartphone photograph. In ranges just like the Fortress Grounds reminiscence was so tight that including two small textures would crash the sport. But regardless of this constraint Emanuar discovered that vital parts of that valuable reminiscence was wasted as a consequence of coding oversights, unused information and inefficient design selections.


LEGO Tremendous Mario: Mario Kart – Mario & Customary Kart Constructing Set for Adults – DIY Guide Shelf & Room…

  • HERE WE GO! – Velocity down Rainbow Street with the LEGO Tremendous Mario: Mario Kart – Mario & Customary Kart (72037) collectible constructing set for adults 18…
  • DYNAMIC DISPLAY STAND – Place Mario at dramatic racing angles to recreate that excellent drift second or high-speed motion out of your favourite Mario…
  • POSEABLE MARIO FIGURE – The brick-built Mario options movable head and arms, letting you customise his racing pose for the last word show

One of many greatest points is with the body buffers which retailer the visible output at 320×240 with triple buffering. These buffers take up the final half megabyte of reminiscence however embrace black bars on the prime and backside of the display screen to accommodate outdated TVs’ overscan points. These bars are all the time drawn and waste house equal to about three Mario 64 textures. By overlapping the buffers or decreasing the rendered picture to 224×320 the builders might have saved sufficient reminiscence for extra visible particulars however this was missed seemingly as a consequence of time constraints or lack of necessity.

Super Mario 64 Memory Management Flaws
Extra inefficiencies are discovered within the reminiscence format, as programmers manually assigned reminiscence addresses leaving empty areas between information parts. One such hole at 275 kilobytes is equal to about 23 textures price of unused reminiscence. One other 224 kilobyte empty house is equal to 73 textures and seems to be a easy reminiscence allocation error. These voids which whole 93 textures price of house are an enormous waste. If the compiler had been allowed to optimize reminiscence placement, these gaps might have been closed and given room for extra property or smoother efficiency.

Super Mario 64 Memory Management Flaws
The engine factor, which interprets degree and actor scripts, is one other supply of waste. This code takes up an eighth of a megabyte and was written with debugging in thoughts not effectivity. In line with Emanuar, compiling for dimension might minimize this down by half and deleting pointless code (just like the stays of a cancelled split-screen multiplayer mode) might cut back it by one other 50%. This could have given room for dozens of textures or efficiency enhancing methods like reminiscence banking, thus giving the sport a 5% velocity enhance.

Super Mario 64 Memory Management Flaws
Math capabilities, particularly the sine and cosine tables, trigger reminiscence bloat. These tables are essential for 3D rendering and have information for one and 1 / 4 circle rotations. Through the use of round symmetries the desk might have been quartered, saving 12KB – sufficient for 4 new textures and barely dashing up the sport.

Super Mario 64 Memory Management Flaws
One other instance of inefficiency is the music system which takes up 512KB. Tremendous Mario 64 collects notes and devices and mixes them at runtime to create the music. However as a result of they didn’t reuse buffers correctly the sport allocates 4 pattern buffers per notice when only one is required. This makes use of up 51KB of reminiscence which is 17 textures. Emanuar’s personal code confirmed that 18% of the music space (about 31 textures) is unused and crammed with zeros. These audio inefficiencies account for 40 textures price of wasted house.

Super Mario 64 Memory Management Flaws
Essentially the most stunning waste is within the reminiscence pool, which holds geometry, textures and collision information for ranges and actors. Every actor, even easy objects like stationary geometry, is allotted 608 bytes no matter complexity. This uniform allocation is pointless bloat. The sport masses whole reminiscence banks together with irrelevant objects like seaweed or water mines when only one merchandise is required. Later video games like The Legend of Zelda: Ocarina of Time loaded information per room to reduce waste. Uncompiled collision and armature information loaded as soon as and by no means used once more additional bloats the pool with Mario’s armature alone taking on 11.6KB of lifeless reminiscence. Emanuar estimates a 33% discount on this pool’s dimension saving about 483KB or 143 textures price by higher information administration.

Including all of this up, Emanuar believes Tremendous Mario 64 might lose roughly 2 megabytes of its 4 megabyte footprint. It doesn’t fairly match within the PlayStation 1’s 2 megabyte RAM, however the PS1 has separate VRAM for body buffers and CD-based audio storage, so it might be performed with some extra modification. For instance, decreasing the actor pool restrict by 60 objects (with out affecting gameplay) would possibly cut back the sport’s RAM utilization to 1 megabyte, which is excellent for a sport of this scale.
[Source]

Share This Article