Skip to content
MegaMech edited this page Aug 6, 2022 · 4 revisions

staff_ghosts.c still needs documentation. As such, we only have a basic understanding of how this file works.

Many of the Mario Kart games contain time trial times recorded by Nintendo staff members. Players can unlock the staff ghost to race against if they receive a fast enough time.

The array: D_802BFB80[2][2][0x8000] contains controller data for course ghosts. Laid out as two blocks containing two sections which contains members the size of 0x8000.

typedef struct {
    u8 button;
    s8 frameDuration;
    s8 stickY;
    s8 stickX;
} StaffGhost;
StaffGhost d_luigi_raceway_staff_ghost[] = {
 // {button, frame,  stickY,  stickX},
    {0x80,       0,       0,       2},
    {0x80,       0,     254,       0},
    {0x80,       2,     254,       1},
    {0x80,      19,     254,       0},
    {0x80,       9,     254,     255},
    {0x80,     163,     254,       0},
    // etc.
};

The code checks that the game mode is time trials and that a course that contains a course ghost was chosen. It supplies button presses to controller seven or eight but uses gPlayerTwo or gPlayerThree which are set to the ghost type (invisible/transparent) and CPU. [needs verification].

Clone this wiki locally