Sm64 Color | Codes

Author: [Your Name/Affiliation] Date: [Current Date] Subject: Video Game Reverse Engineering & ROM Hacking Abstract Super Mario 64 (SM64), a landmark title in 3D game design, employs a unique system of hexadecimal color codes to define object palettes, vertex colors, and environmental lighting. This paper examines the structure, application, and practical manipulation of SM64 color codes. We analyze the 16-bit RGBA5551 format used in the game’s binary data, differentiate between geometric and texture-based coloration, and provide a technical guide for modifying these values via ROM hacking. Finally, we discuss the implications for speedrunning (e.g., "Color Codes" as arbitrary code execution triggers) and asset replacement. 1. Introduction Unlike modern game engines that use 24-bit or 32-bit true color, SM64 operates within the constraints of the Nintendo 64’s Reality Coprocessor. Color data is stored in a memory-efficient 16-bit format, directly influencing object rendering, lighting models, and even behavior when corrupted. Understanding these codes allows modders to create palette swaps, custom level aesthetics, and exploit glitches. 2. The SM64 16-Bit Color Format (RGBA5551) The fundamental color unit in SM64’s display lists is a half-word (2 bytes / 16 bits) formatted as follows:

| Object | Hex Value | RGB (5-bit) | Visible Color | |--------|-----------|--------------|----------------| | Red Cap | 0xF800 | 31,0,0 | Bright Red | | Yellow Coin | 0xFFE0 | 31,31,0 | Yellow | | Blue Sky Box | 0x001F | 0,0,31 | Blue | | Green Pipe | 0x03E0 | 0,31,0 | Green | | White Cloud | 0x7FFF | 31,31,31 | White | | Black Shadow | 0x0000 | 0,0,0 | Black (transparent if alpha=0) | sm64 color codes

| Bit Position | 15 | 14-11 | 10-7 | 6-3 | 2-0 | |--------------|----|-------|------|-----|-----| | Component | A | R | G | B | unused? (varies) | Finally, we discuss the implications for speedrunning (e