User Tools


    Site Tools

    super_mario_64:title_screen

    Title Screen

    The title screen is displayed from the main level scripts using a combination of Geometry Layout Commands and assembly. The top level script at 108A10 loads the level script at 269EA0 into segment 0x14 and jumps to the beginning of it. The 269EA0 level scripts loads assembly from 21F4C0-269EA0 to RAM 8016F000, 219E00 into segment 0x13, MIO0 block from 26A3A0 (main menu textures) into segment 0x07, and starts a geo layout area from 0x140002D0.

    The geo layout at 0x140002D0 has two interesting commands:

    • 0x0F which is used for perspective
    • 0x18 which is used to load polygons from asm

    The 0x0F command has seven 16-bit signed values which control perspective. For example, one of them is already set at offset 8 within the command: 0x0C80 which controls how close or far the title screen is viewed. Increasing the value at offset 4 to 0x0C00 reveals this title screen:

    The 0x18 command calls the ASM function 8016F670. This function uses two lookup tables stored in segment 0x07 (main menu textures) to determine how to scale the title screen. The first LUT is it 0700C790 and contains a set of XYZ scale values as 32-bit floats for the title to zoom in and bounce. The second LUT is at 0700C880 and contains the XYZ scale values for the zooming out. These zoom values are passed directly to A1,A2,A3 to guScale()/80325924 to set up the scaling matrix. It then references the display list at segment addr 0700B3A0.

    Someone who so desired could change this guScale() call to a guRotateRPY()/80325874 and change the LUT values to rotate from 0.0 to 360.0. A result of changing one of the values would look like this:

    The last piece of the title screen is how long it is displayed for. This is controlled by the 0x03 level script command at 269EEC, before fading out.

    Level Script

    The level script for the title screen starts at 0x269EA0 and is part of the level script data at 269EA0-26A3A0.

    269EA0 [000]: StartLoad 1B 04 0000 
    269EA4 [004]: LoadASM   16 10 0000 8016F000 0021F4C0 00269EA0
    269EB4 [014]: ROM->Seg  17 0C 0013 00219E00 0021F4C0
    269EC0 [020]: MIO0->Seg 18 0C 0007 0026A3A0 0026F420
    269ECC [02C]: EndLoad   1D 04 0000 
    269ED0 [030]: StartArea 1F 08 0100 140002D0 
    269ED8 [038]: EndArea   20 04 0000 
    269EDC [03C]: AllocPool 1E 04 0000 
    269EE0 [040]:           29 04 0100 
    269EE4 [044]: AccumAsm1 11 08 0000 8016F5B0
    269EEC [04C]: Delay03   03 04 004B 
    269EF0 [050]: FadeColor 33 08 0110 00000000 
    269EF8 [058]: Delay03   03 04 0010 

    Geo Layout

    The geo layout for the title screen is defined by the StartArea 0x1F level command above. (seg 140002D0, ROM 26A170)

    26A170: [ 08 00 00 00 00A00078 00A00078 ] // Set screen rendering area
    26A17C: [ 04 00 00 00 ]
    26A180:   [ 0C 00 00 00 ]
    26A184:   [ 04 00 00 00 ]
    26A188:     [ 09 00 00 64 ]
    26A18C:     [ 04 00 00 00 ]
    26A190:       [ 19 00 0001 00000000 ] // Draw solid color background (RGBA)
    26A198:     [ 05 00 00 00 ]
    26A19C:   [ 05 00 00 00 ]
    26A1A0:   [ 0C 01 00 00 ]
    26A1A4:   [ 04 00 00 00 ]
    26A1A8:     [ 0A 00 002D 0080 4000 ]
    26A1B0:     [ 04 00 00 00 ]
    26A1B4:       [ 0F 00 0000 0000 0000 0C80 0000 0000 0000 00000000 ]
    26A1C8:       [ 04 00 00 00 ]
    26A1CC:         [ 18 00 00 00 8016F670 ]
    26A1D4:       [ 05 00 00 00 ]
    26A1D8:     [ 05 00 00 00 ]
    26A1DC:   [ 05 00 00 00 ]
    26A1E0:   [ 0C 00 00 00 ]
    26A1E4:   [ 04 00 00 00 ]
    26A1E8:     [ 18 00 00 00 8016F984 ] // Create display list(s) from the ASM function 0x8016F984
    
    //NOTE: Importing a custom title screen replaces 0x8016F984 with 0x00000000 in the 18 command above.
    Simply replace 0x00000000 back with 0x8016F984 to bring back the TM and copyright graphics.
    
    26A1F0:   [ 05 00 00 00 ]
    26A1F4: [ 05 00 00 00 ]
    26A1F8: [ 01 00 00 00 ] // End geometry layout
    super_mario_64/title_screen.txt · Last modified: by miles