Skip to content

Mario Raceway (U)

micro500 edited this page Apr 19, 2018 · 16 revisions

Segment 6 file:

Segment 6 is MIO0 encoded

Start End Description
0x0000 0x5568 Display lists
0x5568 0x57B0 Unknown (path?)
0x57B0 0x6750 Path 0 data
0x6750 0x6950 Piranha plant palette
0x6950 0x6990 Piranha plant vertices
0x6990 0x6A28 Piranha plant display lists
0x6A28 0x6A60 Tree vertices
0x6A68 0x6B08 Tree display lists
0x6B08 0x7068 Rotating sign vertices
0x7068 0x9068 Rotating sign texture
0x9068 0x9498 Rotating sign display list
0x9498 0x9518 Object list: item boxes
0x9518 0x9570 Object list: piranha plants
0x9570 0x9650 Object list: trees
0x9650 0x97F8 Surface map table

Segment 6 Display lists:

See Mario Raceway (U) Segment 6

Segment 9:

Segment 9 is not MIO0 encoded

Start End Description
0x0000 0x01F0 Texture file list
0x01F0 0x0300 Section+direction table
Pointer Rom addr File size Texture size Seg5 Addr Name
0F001080 0x642FF0 0x149 0x800 05:000000 Checkerboard
0F00422C 0x64619C 0x124 0x800 05:000800 Gray gradient
0F006798 0x648708 0x125 0x800 05:001000 Pipe
0F009BF0 0x64BB60 0x169 0x800 05:001800 Fence
0F00D498 0x64F408 0x5DE 0x800 05:002000 Green Grass
0F00C5C4 0x64E534 0x23F 0x800 05:002800 Striped grass
0F00EEFC 0x650E6C 0x19E 0x800 05:003000 Flag
0F022020 0x663F90 0x122 0x800 05:003800 Mushroom base
0F022334 0x6642A4 0x162 0x800 05:004000 Mushroom top
0F022144 0x6640B4 0x1EF 0x800 05:004800 Mushroom underneath
0F02584C 0x6677BC 0x1F8 0x800 05:005000 Yellow grass
0F026588 0x6684F8 0x10D 0x800 05:005800 Billboard post
0F029D78 0x66BCE8 0x287 0x1000 05:006000 Luigi’s billboard (left half)
0F02A000 0x66BF70 0x2AF 0x1000 05:007000 Luigi’s billboard (right half)
0F02A2B0 0x66C220 0x2D2 0x1000 05:008000 Mario Star billboard (left half)
0F02A584 0x66C4F4 0x2B1 0x1000 05:009000 Mario Star billboard (right half)
0F02A984 0x66C8F4 0x1A1 0x800 05:00A000 Hat logo
0F02C0F8 0x66E068 0x2A6 0x1000 05:00A800 Nintendo billboard (left half)
0F02C3A0 0x66E310 0x2F7 0x1000 05:00B800 Nintendo billboard (right half)
0F02EB58 0x670AC8 0xFBF 0x1000 05:00C800 Audience
0F0323E4 0x674354 0x46F 0x800 05:00D800 Brick
0F03370C 0x67567C 0x300 0x1000 05:00E000 Road
0F034758 0x6766C8 0x338 0x1000 05:00F000 Road with finish line
0F039A40 0x67B9B0 0x225 0x800 05:010000 Dirt
0F04AF40 0x68CEB0 0x4DF 0x1000 05:010800 Yoshi billboard (left half)
0F04B420 0x68D390 0x4A1 0x1000 05:011800 Yoshi billboard (right half)
0F000000 0x641F70 0x38C 0x1000 05:012800 Shot billboard (left half)
0F00038C 0x6422FC 0x247 0x1000 05:013800 Shot billboard (right half)
0F0229E0 0x664950 0x360 0x1000 05:014800 Koopa Air billboard (left half)
0F022D40 0x664CB0 0x304 0x1000 05:015800 Koopa Air billboard (right half)

Segment 7:

See Mario Raceway (U) Segment 7

Section+Direction table

The table has 17 sections.

The segment address for the table (09:0001F0) is hardcoded as follows:

ROM       RAM          Opcode     Instruction
0xFBE0C   0x802927FC   3C040900:  lui a0, 0x0900
0xFBE20   0x80292810   248401F0:  addiu a0, a0, 0x01F0

Final display list order

The game renders the level in the following order:

  1. 070008E8 - Pipe (high poly)

    OR

    07002D68 - Pipe (low poly)

  2. 07001140 - Big mushroom

  3. 07003508 - Billboard group 2

  4. 07003240 - Billboard group 1 (Luigi's and Koopa Air)

  5. 070014A0 - Audience

  6. Section+Direction display list

  7. 07000450 - Billboard Posts group 2

  8. 07000240 - Billboard Posts group 1

  9. 070000E0 - All fences

  10. 07000160 - Audience flags_

  11. Trees

  12. Piranha plants

  13. Rotating signs

All of the segment 7 addresses in that list are hardcoded:

070008E8 - Pipe (high poly)

ROM       RAM          Opcode     Instruction
0xFA7F8   0x802911E8   3C190700   lui t9, 0x0700
0xFA7FC   0x802911EC   373908E8   ori t9, t9, 0x08e8

07002D68 - Pipe (low poly)

ROM       RAM          Opcode     Instruction
0xFA81C   0x8029120C   3C0A0700   lui t2, 0x0700
0xFA820   0x80291210   354A2D68   ori t2, t2, 0x2D68

07001140 - Big mushroom

ROM       RAM          Opcode     Instruction
0xFA7B4   0x802911A4   3C180700   lui t8, 0x0700
0xFA7B8   0x802911A8   37181140   ori t8, t8, 0x1140

07003240 - Billboard group 1 (Luigi's and Koopa Air)

ROM       RAM          Opcode     Instruction
0xFBDDC   0x802927CC   3C0C0700:  lui t4, 0x0700
0xFBDE0   0x802927D0   358C3240:  ori t4, t4, 0x3240

070014A0 - Audience

ROM       RAM          Opcode     Instruction
0xFBDFC   0x802927EC   3C0F0700:  lui t7, 0x0700
0xFBE00   0x802927F0   35EF14A0:  ori t7, t7, 0x14A0

07000450 - Billboard Posts group 2

ROM       RAM          Opcode     Instruction
0xFBE88   0x80292878   3C0E0700:  lui t6, 0x0700
0xFBE8C   0x8029287C   35CE0450:  ori t6, t6, 0x0450

07000240 - Billboard Posts group 1

ROM       RAM          Opcode     Instruction
0xFBEA8   0x80292898   3C190700:  lui t9, 0x0700
0xFBEAC   0x8029289C   37390240:  ori t9, t9, 0x0240

070000E0 - All fences

ROM       RAM          Opcode     Instruction
0xFBECC   0x802928BC   3C180700:  lui t8, 0x0700
0xFBEE4   0x802928D4   371800E0:  ori t8, t8, 0x00E0

07000160 - Audience flags_

ROM       RAM          Opcode     Instruction
0xFBF00   0x802928F0   3C0D0700:  lui t5, 0x0700
0xFBF04   0x802928F4   35AD0160:  ori t5, t5, 0x0160

Special level objects

Rotating sign

There are two rotating signs. The rotating signs are treated as an object, but the coordinates for each are hardcoded:

Sign 1 X (150 0x43160000)

ROM        RAM          Opcode     Instruction
0x1071FC   0x8029DBEC   3C054316:  lui a1, 0x4316

Sign 1 Y (-1300 0xC4A28000)

ROM        RAM          Opcode     Instruction
0x1071F0   0x8029DBE0   3C07C4A2:  lui a3, 0xC4A2
0x1071F4   0x8029DBE4   34E78000:  ori a3, a3, 0x8000

Sign 1 Z (40 0x42200000)

ROM        RAM          Opcode     Instruction
0x107204   0x8029DBF4   3C064220:  lui a2, 0x4220

Sign 2 X (2520 0x451d8000)

ROM        RAM          Opcode     Instruction
0x107230   0x8029DC20   3C05451D:  lui a1, 0x451D
0x107234   0x8029DC24   34A58000:  ori a1, a1, 0x8000

Sign 2 Y (1240 0x449b0000)

ROM        RAM          Opcode     Instruction
0x107244   0x8029DC34   3C07449B:  lui a3, 0x449B

Sign 2 Z (0 0x00000000)

ROM        RAM          Opcode     Instruction
0x10723C   0x8029DC2C   24060000:  addiu a2, r0, 0

The sign's dlist draws the sign at the origin. The game adds a matrix transform before this dlist which translates and rotates the vertices to be in the correct location.

TODO: Detail the pieces in the display list

The sign's main dlist (06:009330) is hardcoded:

ROM        RAM          Opcode     Instruction
0x10C0B4   0x802A2AA4   3C0A0601:  lui t2, 0x0601
0x10C0B8   0x802A2AA8   254A9330:  addiu t2, t2, -0x6cd0

Trees

Trees have a display list and vertices contained in segment 6. The texture is located at 03:009000. This address is coded in the display list:

06:006AA8: FD500000 03009000

The texture gets loaded from ROM in function XXXXXX. See Piranha Plants

The display list draws a rectangle based at the origin. The vertices for this rectangle are located at (06:006A28). That address is coded in the display list:

06:006AE0: 0400103F 06006A28

The segment address for the tree dlist (06:006A68) is hardcoded:

ROM        RAM          Opcode     Instruction
0x1028D8   0x802992C8   3C180600:  lui t8, 0x0600
0x1028F0   0x802992E0   27186A68:  addiu t8, t8, 0x6A68

Segment 6 also has a list of coordinates of where to put the trees in the level. The segment address for this list (06:009570) is hardcoded:

ROM        RAM          Opcode     Instruction
0x1071CC   0x8029DBBC   3C040601:  lui a0, 0x0601
0x1071D4   0x8029DBC4   24849570:  addiu a0, a0, -0x6a90

Piranha plants

Piranha plants are rendered from a display list in segment 6. The texture is animated from a bank of textures starting at 0x8021E300 (RAM). A pointer to this address is located at 0x802BA058. This pointer is hardcoded:

ROM        RAM          Opcode     Instruction
0x101A58   0x80298448   3C19802C   lui t9,0x802c
0x101B7C   0x8029856C   8F39A058   lw t9,-0x5fa8(t9)

The texture bank is loaded from rom in the function at 0x8029E3B0 (RAM) (0x1079C0 (ROM)). This function loads 9 textures from rom. Each of the rom pointers is hardcoded.

Pointer Rom Addr Name
0F04F45C 0x6913CC Tree
0F056408 0x698378 Piranha plant 1
0F05662C 0x69859C Piranha plant 2
0F05688C 0x6987FC Piranha plant 3
0F056AD0 0x698A40 Piranha plant 4
0F056CF0 0x698C60 Piranha plant 5
0F056EC8 0x698E38 Piranha plant 6
0F057084 0x698FF4 Piranha plant 7
0F057288 0x6991F8 Piranha plant 8
0F057590 0x699500 Piranha plant 9

The function starting at 0x80298410 (RAM) (0x101A20 (ROM)) seems to decide which texture to show.

The textures are 32x64 and stored in the CI8 format. Each texture only represents half of the piranha plant which gets mirrored to display the full plant. The CI8 format requires a palette which gets loaded from segment 6. The segment address for the palette (06:006750) is coded in the dlist:

06:0069D8: FD100000 06006750

The display list draws a rectangle based at the origin. The vertices for this rectangle are located at (06:006950). That address is coded in the display list:

06:006A08: 0400103F 06006950

The segment address for where to find the plants's display list (06006990) is hardcoded:

ROM        RAM          Opcode     Instruction
0x101C78   0x80298668   3C0F0600:  lui t7, 0x0600
0x101C7C   0x8029866C   25EF6990:  addiu t7, t7, 0x6990

Segment 6 also has a list of coordinates of where to put the plants in the level. The segment address for this list (06:009518) is hardcoded:

ROM        RAM          Opcode     Instruction
0x1071D8   0x8029DBC8   3C040601:  lui a0, 0x0601
0x1071E0   0x8029DBD0   24849518:  addiu a0, a0, -0x6ae8

Item boxes

Segment 6 has a list of coordinates of where to put the item boxes in the level. The segment address for this list (06:009498) is hardcoded:

ROM        RAM          Opcode     Instruction
0x1071E4   0x8029DBD4   3C040601:  lui a0, 0x0601
0x1071EC   0x8029DBDC   24849498:  addiu a0, a0, -0x6b68

The 4th value in the coordinates varies between 0 and 2. The purpose of this value is unknown.

Surface map

The segment address for the surface map (06:009650) is hardcoded:

ROM       RAM          Opcode     Instruction
0xFF484   0x80295E74   3C040601:  lui a0, 0x0601
0xFF48C   0x80295E7C   24849650:  addiu a0, a0, -0x69b0
Segment addr Name Surface type Section
070017D8 Track 1 1 - Solid (road) 1
07001770 Track 2 1 - Solid (road) 2
070016D8 Track 3 1 - Solid (road) 3
07001668 Track 4 1 - Solid (road) 4
070014C8 Track 5 1 - Solid (road) 5
07001500 Track 6 1 - Solid (road) 6
07001550 Track 7 1 - Solid (road) 7
07001600 Track 8 1 - Solid (road) 8
07001850 Track 9 1 - Solid (road) 9
07001AF8 Track 10 1 - Solid (road) 10
07001A80 Track 11 1 - Solid (road) 11
07001A08 Track 12 1 - Solid (road) 12
07001988 Track 13 1 - Solid (road) 13
07001890 Track 14 1 - Solid (road) 14
070018B8 Track 15 1 - Solid (road) 15
070018E0 Track 16 1 - Solid (road) 16
07001950 Track 17 1 - Solid (road) 17
07001188 Audience top/sides 255 - Solid (walls) 255
07002A28 All brick walls 255 - Solid (walls) 255
070000E0 All fences 255 - Solid (walls) 255
07005218 Yellow grass (high poly) 8 - Grass 1
070050E8 Yellow grass (high poly) 8 - Grass 2
07004F90 Stripped grass (high poly) 8 - Grass 3
07004EE8 Yellow grass (high poly) 8 - Grass 4
07004E20 Stripped grass (high poly) 8 - Grass 5
070052B8 Yellow grass (high poly) 8 - Grass 4
07005608 Yellow grass (high poly) 8 - Grass 4
07005550 Stripped grass (high poly) 8 - Grass 5
070054B0 Stripped grass (high poly) 8 - Grass 6
07005408 Yellow grass (high poly) 8 - Grass 5
07005368 Yellow grass (high poly) 8 - Grass 6
07004D48 Yellow grass (high poly) 8 - Grass 7
070049E8 Yellow grass (high poly) 8 - Grass 7
07004950 Yellow grass (high poly) 8 - Grass 8
07004870 Stripped grass (high poly) 8 - Grass 7
07004780 Stripped grass (high poly) 8 - Grass 7
070046A0 Yellow grass (high poly) 8 - Grass 9
07004AD8 Stripped grass 8 - Grass 7
07006198 Yellow grass (high poly) 8 - Grass 10
070060F0 Yellow grass (high poly) 8 - Grass 11
070063B0 Yellow grass (high poly) 8 - Grass 12
07005AE0 Yellow grass (high poly) 8 - Grass 13
07005A48 Yellow grass (high poly) 8 - Grass 14
07005970 Yellow grass (high poly) 8 - Grass 15
07005870 Yellow grass (high poly) 8 - Grass 15
07005768 Yellow grass (high poly) 8 - Grass 16
07005BC8 Yellow grass (high poly) 8 - Grass 17
07005ED0 Dirt (high poly) 7 - Dirt/offroad 13
07005F88 Dirt (high poly) 7 - Dirt/offroad 11
07006068 Yellow grass (high poly) 7 - Dirt/offroad 10
07006308 Dirt (high poly) 7 - Dirt/offroad 12
07006490 Dirt (high poly) 7 - Dirt/offroad 11

Before processing that table the game processes the display list for the full big mushroom (07:001140). This is hardcoded at

ROM       RAM          Opcode     Instruction
0xFF44C   0x80295E3C   3C040700:  lui a0, 0x0700
0xFF454   0x80295E44   34841140:  ori a0, a0, 0x1140

Pipe

There are two versions of the pipe included with the level data, a low poly and a high poly version. The low poly version has X sides on the outside and Y on the inside. The high poly version has X sides on the outside and Y sides on the inside. The game chooses which to render when generating the final display list. The function that chooses which pipe to display is located at 0x802911C4 (RAM) (0xFA7D4 (ROM)).

The level data also contains a version of the pipe with the ends capped at 07:006710. This pipe does not appear to ever get rendered.

Clone this wiki locally