-
Notifications
You must be signed in to change notification settings - Fork 2
Course Paths
Each track (except the battle courses) have a set of paths, used to define the race course and the paths of some objects. Their locations are hardcoded RSP addresses:
Track | Address |
---|---|
0x00 Mario Raceway | 06:005568 |
0x01 Choco Mountain | 06:004480 |
0x02 Bowser's Castle | 06:004F90 |
0x03 Banshee Boardwalk | 06:004578 |
0x04 Yoshi Valley | 06:00D780, 06:00D9C8, 06:00DC18, 06:00DEA8 |
0x05 Frappe Snowland | 06:0034A0 |
0x06 Koopa Troopa Beach | 06:00ADE0 |
0x07 Royal Raceway | 06:00B5B8 |
0x08 Luigi Raceway | 06:00A540 |
0x09 Moo Moo Farm | 06:00EC80 |
0x0A Toad's Turnpike | 06:003B80 |
0x0B Kalimari Desert | 06:006AC8 |
0x0C Sherbet Land | 06:004BF8 |
0x0D Rainbow Road | 06:001D90 |
0x0E Wario Stadium | 06:0056A0 |
0x12 DK's Jungle Parkway | 06:0071F0 |
(XXX why does Yoshi Valley have four?)
The path is an array of points:
struct mk64_3dpoint {
int16_t X, Y, Z;
uint16_t unknown;
};
The path ends when X == 0x8000
. If Y == 0x8000 && Z == 0x8000
, the set ends, otherwise, another path begins.
Each set contains at least two paths. The first has few points (usually fewer than 100), with Y == 0 && unknown == 0
. The second has many points, laid directly on the track, with unknown
gradually increasing, roughly correlated with the area ID. The second seems to be used for tracking each player's progress in the race.
The AI players follow these paths (XXX which ones?) automatically while off-screen, and will teleport back to them if they stray too far.
Some tracks have more than two paths:
- Koopa Troopa Beach has four:
- The first one, whose purpose is unknown
- The second, which defines the main route
- The third, which follows the main route but goes left around the stone turtle; all points have
unknown = 0
- The fourth, which follows the main route but takes the shortcut across the sandbar (to the right of the 3 ramps); all points have
unknown = 7
- No path goes through the tunnel
- Yoshi Valley has four, defining various routes
- The extra paths'
unknown
values are 4 and 7 for all points
- The extra paths'
- Kalimari Desert has a path for the train to follow
- A player can follow this path and complete a lap, but only while using a star. The game won't count the lap otherwise. XXX find the code that does this.
- DK's Jungle Parkway has a path for the boat to follow
At ROM address 0xDD380
is a table with 4 entries per course, containing the RSP addresses of each path. Unused entries are set to 0x800DC778
(which is not an RSP address); at this RAM address is 0x8000 0x0000 0x0000 0x0000
, which marks the end of a path, but should be immediately followed by another path. This table doesn't seem to be used at all? (XXX)