the cutting room mirror

Super Mario 64 (Nintendo 64)

This article has a talk page!
view on tcrf.net

This page details development materials of Super Mario 64 (Nintendo 64).

Internal Name Oddities#

Missing Mario Segments#

Mario's main model parts (excluding the head and torso) are numbered from 0-14. However, segment 11 just skips over to segment 14, implying segments 12 and 13 were removed. This oddity also exists for his LOD models and for the early backup of Mario that was found. These segments weren't deleted from Luigi, however, and are just vertex-colored variants of the head and torso parts. It's likely they were removed from Mario once the textured versions were completed. The vertex-colored torso can be seen in a 1995 B-Roll clip.

Rainbow Ride#

Rainbow Ride has pretty strange internal names. Its stage folder, as well as commented-out notes in the castle's level script, repeatedly refer to the stage as "fire bubble 2." It's worth noting that Lethal Lava Land is named "Fire Bubble Land" in the Japanese version, and is frequently referred to, internally, as "fire bubble 1." In the file "star," Rainbow Ride is also called "fire_building." This suggests that the course may have been planned as a second lava stage at some point during development.

SM64 Leftovers in Mario Kart 64 Leaked Data#

Unused Lighting#

Unused lighting applied to Mario's model.

In depot/mk64/kimura.lzh/include/system.h, in the MK64 directory from the same leak, there is an unused alternate lighting setup for Mario and Luigi. It works differently from the final: it brightens the center of Mario and darkens the sides, making it appear as though there's a light source pointing directly at Mario's face. This is likely the lighting used in an animation in the 1995 Nintendo 64 B-Roll, which can be seen in this video. There is also early drop shadow rendering code in shade.c; this is the only bit of code in Mario Kart 64's files that is confirmed to have been intended for Super Mario 64.

//#define  LIGHT_X             0
//#define  LIGHT_Y             0
//#define  LIGHT_Z             127

Debug Content#

Game and engine segment memory usage, labelled as CODE and ULIB respectively. Unused Bowser debug action, enabled by DEBUGSW.

In include/project.h in the iQue repo exists preprocessor defines which enable debug features (DEBUGSW, DEVELOP, and VERSION_E3). These debug flags can only be enabled in files which aren't pre-compiled, such as game.c and title.c, as the rest of the codebase was compiled without any debug flags enabled.

Feature

Debug Flags

Description

Frame Advance

DEVELOP

Enter an unused frame advance mode by holding B while unpausing the game. Press down on the D-Pad to advance one frame, and press start to exit frame advance mode. Labelled interally as GM_STILL.

Reset to Title Screen

DEVELOP and DEBUGSW

Press the debug level select button combination (C-Left + C-Right + Z + Start) to exit to the title screen. When the level select is enabled, it will exit to the level select. Otherwise, it will exit to the Mario head. Strangely, the function which performs the check (CheckReset() in the iQue repo) is enabled by DEVELOP, while the call to the function is enabled by DEBUGSW.

Memory Usage

DEVELOP

Prints the amount of memory used by the game segment and engine segment on the level select screen. Labelled as CODE and ULIB respectively.

Toggle Level Select

DEBUGSW or VERSION_E3

Hold the debug level select button combination (C-Left + C-Right + Z + Start) on the title screen to enter the level select. Unlike the unused level select button combination in the decomp (src/menu/title_screen.c:139), this code will actively disable the level select unless the button combination is held.

Bowser Debug

DEBUGSW

Enables unused bowser debugging code (src/game/behaviors/bowser.inc.c:304 in the decomp). If enemy_p0 is non-zero and Bowser is in his idle action, he will enter his debug action, where he waits idle until enemy_p1 is non-zero. Once enemy_p1 is set to a non-zero value, Bowser will set his action to enemy_p2, and reset enemy_p1 to zero.

Message Test

DEBUGSW

Enables a function message_test() in Message/message.sou:895 in the iQue repo. Unfortunately, the code for message_test() was either deleted or lost.

Remote Debug Printing

DEVELOP

Enables remote debug print statements (rmonpf() in the iQue repo) via osSyncPrintf(). As rmonpf() is defined as a macro, all remote debug prints were completely stripped from the final game.

Additionally, include/camera.h defines its own debug flag, CAMDEBUGSW. As the camera code is compiled, we don't know how this flag would be used interally. However, there does exist an unused version of Lakitu, referred to as e_tool_jugem (data/kpathdata.s:112 in the iQue repo). Its behavior script is nearly identical to the Lakitu from the final game's intro cutscene, with the only difference being he doesn't start out completely transparent. Its main object code, labelled as s_tool_jugem is either lost or deleted.

A restoration of the above debug features within the decomp can be found here.

English Shindou Version#

In the directory release/pvt_20031022/eng of the depot folder, which contains the full leak, the file sm.rom is a ROM image of the 1997 Shindou Pak Taiou version with English text. It doesn't seem to be a re-translation of the game, but rather just the Japanese base version compiled with the 1996 version's English text using the LOCALE=LOCALE_US compile option.

A version of Shindou with English text would eventually be released in Super Mario 3D All-Stars, although this patches in the English text real time, rather than the English text being baked into the ROM itself. For consistency, the Super Mario 3D All-Stars version also uses bits of dialog taken from Super Mario 64 DS.

Japanese version

English version

Early Collision Detection#

In the iQue repo, bgcheck.o contains the code for the game's collision detection (src/engine/surface_collision.c in the decomp). This is the final game's collision detection code, compiled to machine code. However, there also exists bgcheck.s, which is an early version of the game's collision detection code which has been compiled to assembly, rather than machine code. Notably, the generated assembly contains part of the original source code in the form of code comments. These comments can then be extracted to restore most of the early collision detection code, complete with variable names, preprocessor directives, and comments. However, only functions are included since only functions generate code, which the compiler then annotates the generated assembly with.

Reconstructing the early bgcheck.c reveals several differences and oddities. The following are the major differences between the early and final collision detection code:

  • Ceiling detection is extremely buggy, leading to many invisible walls.
  • Environmental boxes are unimplemented, with the exception of water boxes. Notably, the toxic gas in Hazy Maze Cave and the mist in Jolly Roger Bay are not yet implemented.
  • The Vanish Cap's ability to walk through walls is not yet implemented.
  • Checks to skip intangible triangles are not yet implemented. This leads to many levels being inaccessible, such as Hazy Maze Cave and Shifting Sand Land. In addition, Big Boo's Haunt will have invisible floors which prevent Mario from falling down to the underground area.
  • Floating-point variables are used for floor and ceiling coordinates. This means the integer overflow responsible for Parallel Universes does not exist at this point in development.
  • The maximum level boundary is in the range of -8191 to 8192, not inclusive. In the final game, the range is -8192 to 8192, inclusive.
  • Floors and ceiling use a buffer of 150 units, while the final game uses a buffer of 78 units. This results in Mario more easily snapping up onto floors.
  • Several helper functions relating to finding floors and ceilings were removed from the final game.
  • Debug code used for the MAPINFO debug page does not exist yet.
  • Commented-out calls to dbPrint and rmonPrintf are present in the wall collision code.
  • Dynamic surfaces, any surface which may move through the level, are not yet divided into cells with static geometry. Thus, every dynamic surface in the level is checked every time an object, or Mario, wants to perform a collision check. This results in nearly unplayable amounts of lag in levels like Big Boo's Haunt and Hazy Maze Cave, particularly in the underground lake.
  • Collision cells do not have their indices checked. Thus, it's theoretically possible to read garbage data and crash the game if an object is far enough out-of-bounds. This bug was fixed in the final game.

Hakken Shita !! Jolly Roger Bay's mist is an environment box, which the early collision detection code treats as a water box. Something's not quite right... No, that's not your browser lagging.