coastline 0.0.4
Loading...
Searching...
No Matches
carselect.h File Reference

The car selection screen, which also shows the results of a race and of a season, and the views of the cars on it. More...

#include "common/laptime.h"
#include <PR/gbi.h>
#include <PR/ultratypes.h>
#include "common/model.h"
#include "common/vehicle.h"
#include "racemenu.h"
Include dependency graph for carselect.h:

Go to the source code of this file.

Enumerations

enum  {
  CAR_SELECT_CAR , CAR_SELECT_HANDLING , CAR_SELECT_TRANSMISSION , CAR_SELECT_TIRES ,
  CAR_SELECT_SUSPENSION , CAR_SELECT_DECALS , CAR_SELECT_READY
}
 The steps of choosing a car, by the CAR_SELECT_ values. More...
enum  {
  RESULTS_PAGE_PLAYER_1 , RESULTS_PAGE_PLAYER_2 , RESULTS_PAGE_SEASON , RESULTS_PAGE_MESSAGE ,
  RESULTS_PAGE_END
}
 The pages of the results: the race of each player, the season, and its message. More...
enum  { DECALS_DEFAULT , DECALS_LOAD , DECALS_CUSTOM }
 The decals a player may choose. More...

Functions

void DrawProgressBar (s32 x, s32 y, s32 width, s32 height, f32 fraction)
 Draw a bar: a black frame, a dark green background, and its filling of a fraction in bright green.
s32 IsCarUnlocked (s32 car)
 Whether a car may be chosen: unlocked, on the cartridge, and in the paint shop one of the first nine.
void RenderCameraView (Model *model, Model *secondModel, s32 vehicleIndex, s32 x, s32 y, s32 width, s32 height, f32 slide, s32 hideChoiceMarker, s32 slot, s32 secondSlot, f32 spread, f32 angle)
 Draw a vehicle from its trackside camera in a rectangle of the screen, and a second one beside it, or two models in their place.
void ProcessCarSelectScreen (void)
 Run one frame of the car selection screen, or of the results when g_dwIsReviewMode is set.

Variables

s32 g_dwIsReviewMode
 Whether the screen shows the results of a race instead of choosing a car.
s32 g_bCarSelectInitialized
 Whether the screen has been set up since it was last left.
s32 g_dwCarSelectStartTime
 The time the screen started, in milliseconds.
s32 g_adwCarSelectModelSlots [2]
 The slot of g_aVehicleModelSlots of the car each player sees.
s32 g_adwCarSelectPaintPending [2]
 Whether the model in the slot of each player waits to be painted.
f32 g_afCarSelectSlide [2]
 How far the cars of each player slide on their stage, from 1 or -1 to 0 at rest.
f32 g_afCarSelectAngle [2]
 The turn of the stage of each player, in radians.
MenuItem ** g_aapCarSelectOptions [2]
 The options each player chooses from.
s32 g_anCarSelectCursor [2]
 The option under the cursor of each player.
s32 g_anCarSelectPrevCursor [2]
 The option each player's cursor left, which slides out.
s32 g_anCarSelectOptionCount [2]
 The number of options each player chooses from.
const char * g_apszCarSelectCategory [2]
 The name of the option each player chooses.
s32 g_bCarSelectDone
 Whether every player chose, rather than one leaving.
s8 * g_pScrollSoundBuf
 The sounds of moving the cursor and of choosing, and their lengths.
s32 g_dwTitleRedrawFrames
 The frames the title is still drawn once the screen has faded in.
s32 g_adwCarSelectState [2]
 The step of each player, by the CAR_SELECT_ values.
s32 g_dwPakDialogActive
 The dialog of the controller pak that loads decals: whether it is open, for which player, its result, and whether it is done.
s32 g_dwResultsSeason
 The championship as the results show it: its season, round and flags, the track and the weather of the race.
s32 g_bSeasonResultsShown
 Whether the season results were processed on this screen.
s32 g_dwResultsPage
 The page of the results, by the RESULTS_PAGE_ values.
char g_szResultsBuf [0x58]
 The text of a line of the results.
MenuItem * g_apHandlingOptions []
 The options of the cars, each ending with NULL, and their numbers.
MenuItem * g_apDecalOptions []
 The decals, by the DECALS_ values.
const char * g_apszEngineLayouts []
 The names of the layouts of the engines and of the driven wheels.
const char * g_apszDriveTypes []
 The names of the driven-wheel layouts shown during car selection.
Ambient g_CameraViewAmbientLight
 The lights of the models on the stages.

Detailed Description

The car selection screen, which also shows the results of a race and of a season, and the views of the cars on it.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The steps of choosing a car, by the CAR_SELECT_ values.

Enumerator
CAR_SELECT_CAR 

The choice of the car.

CAR_SELECT_HANDLING 

The choice of the handling.

CAR_SELECT_TRANSMISSION 

The choice of the transmission.

CAR_SELECT_TIRES 

The choice of the tyres.

CAR_SELECT_SUSPENSION 

The choice of the suspension.

CAR_SELECT_DECALS 

The choice of the decals, by the DECALS_ values.

CAR_SELECT_READY 

The player is ready to race.

◆ anonymous enum

anonymous enum

The pages of the results: the race of each player, the season, and its message.

Enumerator
RESULTS_PAGE_PLAYER_1 

The race of the first player.

RESULTS_PAGE_PLAYER_2 

The race of the second player.

RESULTS_PAGE_SEASON 

The standings of the season, skipped outside a championship.

RESULTS_PAGE_MESSAGE 

The message of the season.

RESULTS_PAGE_END 

Past the last page, which exits the screen.

◆ anonymous enum

anonymous enum

The decals a player may choose.

Enumerator
DECALS_DEFAULT 

The default decals of the car.

DECALS_LOAD 

Decals loaded from the Controller Pak.

DECALS_CUSTOM 

The decals painted in the paint shop.

Function Documentation

◆ DrawProgressBar()

void DrawProgressBar ( s32 x,
s32 y,
s32 width,
s32 height,
f32 fraction )

Draw a bar: a black frame, a dark green background, and its filling of a fraction in bright green.

Parameters
xThe left edge, in pixels.
yThe top edge, in pixels.
widthThe width, in pixels.
heightThe height, in pixels.
fractionThe fraction filled, from 0 to 1.
Ghidra address:
USA: 0x8020c460
Ghidra address:
Asia: 0x8020BFF0
Ghidra address:
EUR: 0x8020c240
Ghidra address:
JPN: 0x8020be40

◆ IsCarUnlocked()

s32 IsCarUnlocked ( s32 car)

Whether a car may be chosen: unlocked, on the cartridge, and in the paint shop one of the first nine.

Parameters
carThe index of the car in g_aCarModels.
Returns
Whether it may be chosen.
Ghidra address:
USA: 0x8020c66c
Ghidra address:
Asia: 0x8020C1FC
Ghidra address:
EUR: 0x8020c44c
Ghidra address:
JPN: 0x8020c04c

◆ RenderCameraView()

void RenderCameraView ( Model * model,
Model * secondModel,
s32 vehicleIndex,
s32 x,
s32 y,
s32 width,
s32 height,
f32 slide,
s32 hideChoiceMarker,
s32 slot,
s32 secondSlot,
f32 spread,
f32 angle )

Draw a vehicle from its trackside camera in a rectangle of the screen, and a second one beside it, or two models in their place.

Parameters
modelA model to draw in place of the first car, or NULL.
secondModelA model to draw in place of the second car, or NULL.
vehicleIndexThe vehicle whose camera looks.
xThe left edge of the rectangle, in pixels.
yThe top edge of the rectangle, in pixels.
widthThe width of the rectangle, in pixels.
heightThe height of the rectangle, in pixels.
slideHow far the cars slide apart, as a fraction that the square of moves them by.
hideChoiceMarkerWhether the choice marker of the stage is omitted.
slotThe slot of g_aVehicleModelSlots of the first car.
secondSlotThe slot of g_aVehicleModelSlots of the second car.
spreadThe distance of the slide at its full extent.
angleThe direction the camera faces, in radians.
Ghidra address:
USA: 0x8020c6d0
Ghidra address:
Asia: 0x8020C260
Ghidra address:
EUR: 0x8020c4b0
Ghidra address:
JPN: 0x8020c0bc

◆ ProcessCarSelectScreen()

void ProcessCarSelectScreen ( void )

Run one frame of the car selection screen, or of the results when g_dwIsReviewMode is set.

Ghidra address:
USA: 0x8020d004
Ghidra address:
Asia: 0x8020CB94
Ghidra address:
EUR: 0x8020cde4
Ghidra address:
JPN: 0x8020c9dc

Variable Documentation

◆ g_dwIsReviewMode

s32 g_dwIsReviewMode
extern

Whether the screen shows the results of a race instead of choosing a car.

Ghidra address:
USA: 0x80272074
Ghidra address:
Asia: 0x80271BC4
Ghidra address:
EUR: 0x80274054
Ghidra address:
JPN: 0x80273b00

◆ g_bCarSelectInitialized

s32 g_bCarSelectInitialized
extern

Whether the screen has been set up since it was last left.

Ghidra address:
USA: 0x80272238
Ghidra address:
Asia: 0x80271D88
Ghidra address:
EUR: 0x80274218
Ghidra address:
JPN: 0x80273cc8

◆ g_dwCarSelectStartTime

s32 g_dwCarSelectStartTime
extern

The time the screen started, in milliseconds.

Ghidra address:
USA: 0x80316250
Ghidra address:
Asia: 0x80315D00
Ghidra address:
EUR: 0x80317f30
Ghidra address:
JPN: 0x80316b68

◆ g_adwCarSelectModelSlots

s32 g_adwCarSelectModelSlots[2]
extern

The slot of g_aVehicleModelSlots of the car each player sees.

Ghidra address:
USA: 0x80316258
Ghidra address:
Asia: 0x80315D08
Ghidra address:
EUR: 0x80317f38
Ghidra address:
JPN: 0x80316b70

◆ g_adwCarSelectPaintPending

s32 g_adwCarSelectPaintPending[2]
extern

Whether the model in the slot of each player waits to be painted.

Ghidra address:
JPN: 0x80316b60

◆ g_afCarSelectSlide

f32 g_afCarSelectSlide[2]
extern

How far the cars of each player slide on their stage, from 1 or -1 to 0 at rest.

Ghidra address:
USA: 0x80316260
Ghidra address:
Asia: 0x80315D10
Ghidra address:
EUR: 0x80317f40
Ghidra address:
JPN: 0x80316b78

◆ g_afCarSelectAngle

f32 g_afCarSelectAngle[2]
extern

The turn of the stage of each player, in radians.

Ghidra address:
USA: 0x80316268
Ghidra address:
Asia: 0x80315D18
Ghidra address:
EUR: 0x80317f48
Ghidra address:
JPN: 0x80316b80

◆ g_aapCarSelectOptions

MenuItem** g_aapCarSelectOptions[2]
extern

The options each player chooses from.

Ghidra address:
USA: 0x80316270
Ghidra address:
Asia: 0x80315D20
Ghidra address:
EUR: 0x80317f50
Ghidra address:
JPN: 0x80316b88

◆ g_anCarSelectCursor

s32 g_anCarSelectCursor[2]
extern

The option under the cursor of each player.

Ghidra address:
USA: 0x80316278
Ghidra address:
Asia: 0x80315D28
Ghidra address:
EUR: 0x80317f58
Ghidra address:
JPN: 0x80316b90

◆ g_anCarSelectPrevCursor

s32 g_anCarSelectPrevCursor[2]
extern

The option each player's cursor left, which slides out.

Ghidra address:
USA: 0x80316280
Ghidra address:
Asia: 0x80315D30
Ghidra address:
EUR: 0x80317f60
Ghidra address:
JPN: 0x80316b98

◆ g_anCarSelectOptionCount

s32 g_anCarSelectOptionCount[2]
extern

The number of options each player chooses from.

Ghidra address:
USA: 0x80316288
Ghidra address:
Asia: 0x80315D38
Ghidra address:
EUR: 0x80317f68
Ghidra address:
JPN: 0x80316ba0

◆ g_apszCarSelectCategory

const char* g_apszCarSelectCategory[2]
extern

The name of the option each player chooses.

Ghidra address:
USA: 0x80316290
Ghidra address:
Asia: 0x80315D40
Ghidra address:
EUR: 0x80317f70
Ghidra address:
JPN: 0x80316ba8

◆ g_bCarSelectDone

s32 g_bCarSelectDone
extern

Whether every player chose, rather than one leaving.

Ghidra address:
USA: 0x80316298
Ghidra address:
Asia: 0x80315D48
Ghidra address:
EUR: 0x80317f78
Ghidra address:
JPN: 0x80316bb0

◆ g_pScrollSoundBuf

s8* g_pScrollSoundBuf
extern

The sounds of moving the cursor and of choosing, and their lengths.

Ghidra address:
USA: 0x8031629c
Ghidra address:
Asia: 0x80315D4C
Ghidra address:
EUR: 0x80317f7c
Ghidra address:
JPN: 0x80316bb4

◆ g_dwTitleRedrawFrames

s32 g_dwTitleRedrawFrames
extern

The frames the title is still drawn once the screen has faded in.

It is set to 2 each frame.

Ghidra address:
USA: 0x803162ac
Ghidra address:
Asia: 0x80315D5C
Ghidra address:
EUR: 0x80317f8c
Ghidra address:
JPN: 0x80316bc4

◆ g_adwCarSelectState

s32 g_adwCarSelectState[2]
extern

The step of each player, by the CAR_SELECT_ values.

Ghidra address:
USA: 0x803162b0
Ghidra address:
Asia: 0x80315D60
Ghidra address:
EUR: 0x80317f90
Ghidra address:
JPN: 0x80316bc8

◆ g_dwPakDialogActive

s32 g_dwPakDialogActive
extern

The dialog of the controller pak that loads decals: whether it is open, for which player, its result, and whether it is done.

Ghidra address:
USA: 0x803162b8
Ghidra address:
Asia: 0x80315D68
Ghidra address:
EUR: 0x80317f98
Ghidra address:
JPN: 0x80316bd0

◆ g_dwResultsSeason

s32 g_dwResultsSeason
extern

The championship as the results show it: its season, round and flags, the track and the weather of the race.

Ghidra address:
USA: 0x803162fc
Ghidra address:
Asia: 0x80315DAC
Ghidra address:
EUR: 0x80317fdc
Ghidra address:
JPN: 0x80316c14

◆ g_bSeasonResultsShown

s32 g_bSeasonResultsShown
extern

Whether the season results were processed on this screen.

Ghidra address:
USA: 0x80316310
Ghidra address:
Asia: 0x80315DC0
Ghidra address:
EUR: 0x80317ff0
Ghidra address:
JPN: 0x80316c28

◆ g_dwResultsPage

s32 g_dwResultsPage
extern

The page of the results, by the RESULTS_PAGE_ values.

Ghidra address:
USA: 0x80316314
Ghidra address:
Asia: 0x80315DC4
Ghidra address:
EUR: 0x80317ff4
Ghidra address:
JPN: 0x80316c2c

◆ g_szResultsBuf

char g_szResultsBuf[0x58]
extern

The text of a line of the results.

Ghidra address:
USA: 0x80316318
Ghidra address:
Asia: 0x80315DC8
Ghidra address:
EUR: 0x80317ff8
Ghidra address:
JPN: 0x80316c30

◆ g_apHandlingOptions

MenuItem* g_apHandlingOptions[]
extern

The options of the cars, each ending with NULL, and their numbers.

Ghidra address:
USA: 0x802720b4
Ghidra address:
Asia: 0x80271C04
Ghidra address:
EUR: 0x80274094
Ghidra address:
JPN: 0x80273b40

◆ g_apDecalOptions

MenuItem* g_apDecalOptions[]
extern

The decals, by the DECALS_ values.

Ghidra address:
USA: 0x802721dc
Ghidra address:
Asia: 0x80271D2C
Ghidra address:
EUR: 0x802741bc
Ghidra address:
JPN: 0x80273c68

◆ g_apszEngineLayouts

const char* g_apszEngineLayouts[]
extern

The names of the layouts of the engines and of the driven wheels.

Ghidra address:
USA: 0x80272030
Ghidra address:
Asia: 0x80271B80
Ghidra address:
EUR: 0x80274010
Ghidra address:
JPN: 0x80273ad0

◆ g_apszDriveTypes

const char* g_apszDriveTypes[]
extern

The names of the driven-wheel layouts shown during car selection.

Ghidra address:
USA: 0x8027203c
Ghidra address:
Asia: 0x80271B8C
Ghidra address:
EUR: 0x8027401c
Ghidra address:
JPN: 0x80273adc

◆ g_CameraViewAmbientLight

Ambient g_CameraViewAmbientLight
extern

The lights of the models on the stages.

Ghidra address:
USA: 0x802721f0
Ghidra address:
Asia: 0x80271D40
Ghidra address:
EUR: 0x802741d0
Ghidra address:
JPN: 0x80273c80