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

The options menu, the save and load menu, and the screen that loads or saves data on a Controller Pak. More...

Include dependency graph for options.h:

Go to the source code of this file.

Classes

struct  SaveLoadMenuItem
 A row of the save and load menu. More...

Enumerations

enum  {
  OPTIONS_ITEM_BGM , OPTIONS_ITEM_SFX , OPTIONS_ITEM_UNITS , OPTIONS_ITEM_CONTROLLER ,
  OPTIONS_ITEM_SAVE_CONFIGURATION , OPTIONS_ITEM_LOAD_CONFIGURATION , OPTIONS_ITEM_CREDITS , OPTIONS_ITEMS
}
 The items of the options menu. More...
enum  {
  SAVE_LOAD_LOAD_SEASON , SAVE_LOAD_SAVE_SEASON , SAVE_LOAD_LOAD_GHOST , SAVE_LOAD_SAVE_GHOST ,
  SAVE_LOAD_LOAD_OPTIONS , SAVE_LOAD_SAVE_OPTIONS , SAVE_LOAD_CHOICES
}
 The choices of the save and load menu. More...
enum  {
  SAVE_LOAD_LOAD_SEASON_GAME_PAK = SAVE_LOAD_CHOICES , SAVE_LOAD_SAVE_SEASON_GAME_PAK , SAVE_LOAD_LOAD_OPTIONS_GAME_PAK , SAVE_LOAD_SAVE_OPTIONS_GAME_PAK ,
  SAVE_LOAD_ERASE_GAME_PAK , SAVE_LOAD_EXIT , SAVE_LOAD_ROW_HEADING = 0xD , SAVE_LOAD_ROW_SMALL_GAP ,
  SAVE_LOAD_ROW_GAP
}
 The actions of the other rows of the save and load menu, after the SAVE_LOAD_ choices. More...

Functions

void OptionsMenuPostDraw (s32 item)
 Draw the hint of the volume items, and run the screen that loads or saves the configuration while the options menu asks for it.
void SaveGameDataToEeprom (void)
 Write the equipment of both players and the options to the EEPROM of the cartridge, with the whole profile of the first player when the EEPROM fails its checksum.
s32 DrawRumblePakPrompt (s32 anyPlayer)
 Ask the player to put the Rumble Pak back, and wait for A.
s32 IsRumblePakMissing (void)
 Whether a player at this console has no working Rumble Pak in the controller.

Variables

MenuItem g_aOptionsMenuItems [OPTIONS_ITEMS]
 The items of the options menu, by the OPTIONS_ITEM_ values.
MenuItem * g_apOptionsMenuItems []
 The items of the options menu, ending with NULL.
s32 g_dwOptionsChangedNeedsSave
 Whether a setting of the options menu changed since the menu opened, and the game data needs saving to the EEPROM.
u8 g_bSaveLoadMenuInitialized
 Whether the save and load menu, or the screen of the Controller Pak data, is set up.
u8 g_bSaveLoadRumbleSwapPending
 Whether the player swapped the Rumble Pak for the Controller Pak, and is asked to swap it back afterwards.
u8 * g_pPakDataBuffer
 The buffer the data is read into and written from.
u8 g_abSaveLoadSeasonNoteName [16]
 The names of the notes of the save and load menu in the characters of the Controller Pak: "TOP GEAR SEA", "TOP GEAR GHO" and "TOP GEAR OPTIONS".
u8 g_abSaveLoadGhostNoteName [16]
 The Controller Pak note name for a saved ghost car in the save and load menu.
u8 g_abSaveLoadOptionsNoteName [16]
 The Controller Pak note name for saved options in the save and load menu.
u8 g_abSaveLoadNoteExtension [4]
 The extension of the notes, which is empty.
const char * g_apszSaveLoadChoices [SAVE_LOAD_CHOICES]
 The names of the choices of the save and load menu.
u8 g_bSaveLoadChoice
 The choice of the save and load menu, by the SAVE_LOAD_ values.
SaveLoadMenuItem g_aLoadMenuItems []
 The rows of the save and load menu opened from the main menu, for the Game Pak and the Controller Pak.
SaveLoadMenuItem g_aSaveSeasonMenuItems []
 The rows of the save and load menu after a championship race.
SaveLoadMenuItem g_aSaveGhostMenuItems []
 The rows of the save and load menu after a time attack.
u8 g_bSaveLoadMenuCursor
 The row of the save and load menu under the cursor.
u8 g_bSaveLoadStep
 The step of the save and load menu.
u8 g_abPakDataSeasonNoteName [16]
 The same names and extension for the screen of the Controller Pak data, whose options note is the configuration.
u8 g_abPakDataGhostNoteName [16]
 The Controller Pak note name for a saved ghost car on the Pak data screen.
u8 g_abPakDataConfigurationNoteName [16]
 The Controller Pak note name for a saved configuration on the Pak data screen.
u8 g_abPakDataNoteExtension [4]
 The empty extension of the Controller Pak notes on the Pak data screen.
s32 g_bLoadConfigurationPending
 Whether the options menu opens the screen that loads or saves the configuration.
s32 g_bSaveConfigurationPending
 Whether the options menu opens the screen that saves the configuration.
char g_szBgmVolumeTextBuf [0x18]
 The names of the volume items.
char g_szSfxVolumeTextBuf [0x18]
 The text of the sound effects volume item in the options menu.
u8 g_abSavePakIdKnown [2]
 Whether g_aabSavePakIds holds the identity of the Pak of each of the first two players.
u8 g_bSaveLoadDataWasLoaded
 Whether the save and load menu loaded a season or a ghost car.
u8 g_bSaveLoadSkipEepromProbe
 Whether the next EEPROM step of the save and load menu writes without probing and reading the EEPROM again, once the player confirmed the overwrite.
u8 g_bSaveLoadInputEnabled
 Whether the save and load menu takes the input of its choices.
s32 g_dwSaveLoadNoteIndex
 The note the save and load menu found or made.
u8 g_bSaveLoadFadeDelayFrames
 The frames the save and load menu waited once the sounds faded out.
s32 g_dwPakDataNoteIndex
 The note the screen of the Controller Pak data found or made.
u8 g_bPakDataStep
 The step of the screen of the Controller Pak data.
u8 g_bPakDataWaitFrames
 The frames the screen of the Controller Pak data waited once the sounds faded out.

Detailed Description

The options menu, the save and load menu, and the screen that loads or saves data on a Controller Pak.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The items of the options menu.

Enumerator
OPTIONS_ITEM_BGM 

The volume of the music.

OPTIONS_ITEM_SFX 

The volume of the sound effects.

OPTIONS_ITEM_UNITS 

The units of speed, miles or kilometres an hour.

OPTIONS_ITEM_CONTROLLER 

Opens the controller configuration screen.

OPTIONS_ITEM_SAVE_CONFIGURATION 

Saves the settings to a Controller Pak.

OPTIONS_ITEM_LOAD_CONFIGURATION 

Loads the settings from a Controller Pak.

OPTIONS_ITEM_CREDITS 

Starts the credits race.

OPTIONS_ITEMS 

The number of items.

◆ anonymous enum

anonymous enum

The choices of the save and load menu.

Enumerator
SAVE_LOAD_LOAD_SEASON 

Load a championship season.

SAVE_LOAD_SAVE_SEASON 

Save the championship season.

SAVE_LOAD_LOAD_GHOST 

Load a ghost car of time attack.

SAVE_LOAD_SAVE_GHOST 

Save the ghost car of time attack.

SAVE_LOAD_LOAD_OPTIONS 

Load the settings of the options menu.

SAVE_LOAD_SAVE_OPTIONS 

Save the settings of the options menu.

SAVE_LOAD_CHOICES 

The number of choices.

◆ anonymous enum

anonymous enum

The actions of the other rows of the save and load menu, after the SAVE_LOAD_ choices.

Enumerator
SAVE_LOAD_LOAD_SEASON_GAME_PAK 

Load the season from the EEPROM.

SAVE_LOAD_SAVE_SEASON_GAME_PAK 

Save the season to the EEPROM.

SAVE_LOAD_LOAD_OPTIONS_GAME_PAK 

Load the settings and the equipment from the EEPROM.

SAVE_LOAD_SAVE_OPTIONS_GAME_PAK 

Save the settings and the equipment to the EEPROM.

SAVE_LOAD_ERASE_GAME_PAK 

Reset both players and write the defaults to the EEPROM.

SAVE_LOAD_EXIT 

Leave the menu.

SAVE_LOAD_ROW_HEADING 

A heading of 12 pixels, which the cursor skips.

SAVE_LOAD_ROW_SMALL_GAP 

An empty row of 3 pixels, which the cursor skips.

SAVE_LOAD_ROW_GAP 

An empty row of 6 pixels, which the cursor skips.

Function Documentation

◆ OptionsMenuPostDraw()

void OptionsMenuPostDraw ( s32 item)

Draw the hint of the volume items, and run the screen that loads or saves the configuration while the options menu asks for it.

Parameters
itemThe selected item, by the OPTIONS_ITEM_ values.
Ghidra address:
USA: 0x8021196c
Ghidra address:
Asia: 0x802114FC
Ghidra address:
EUR: 0x8021185c
Ghidra address:
JPN: 0x8021174c

◆ SaveGameDataToEeprom()

void SaveGameDataToEeprom ( void )

Write the equipment of both players and the options to the EEPROM of the cartridge, with the whole profile of the first player when the EEPROM fails its checksum.

Ghidra address:
EUR: 0x80211e78
Ghidra address:
JPN: 0x80211d38

◆ DrawRumblePakPrompt()

s32 DrawRumblePakPrompt ( s32 anyPlayer)

Ask the player to put the Rumble Pak back, and wait for A.

Parameters
anyPlayerTake A from either of the first two players rather than the choosing one.
Returns
Whether A was pressed.
Ghidra address:
USA: 0x80214a88
Ghidra address:
Asia: 0x802145E4
Ghidra address:
EUR: 0x80215b54
Ghidra address:
JPN: 0x80215608

◆ IsRumblePakMissing()

s32 IsRumblePakMissing ( void )

Whether a player at this console has no working Rumble Pak in the controller.

Nothing calls it.

Returns
Whether a controller lacks a Rumble Pak.
Ghidra address:
USA: 0x80214cb0
Ghidra address:
Asia: 0x8021480C
Ghidra address:
EUR: 0x80215d7c
Ghidra address:
JPN: 0x80215808

Variable Documentation

◆ g_aOptionsMenuItems

MenuItem g_aOptionsMenuItems[OPTIONS_ITEMS]
extern

The items of the options menu, by the OPTIONS_ITEM_ values.

Ghidra address:
USA: 0x802723dc
Ghidra address:
Asia: 0x80271F2C
Ghidra address:
EUR: 0x802743bc
Ghidra address:
JPN: 0x80273e6c

◆ g_apOptionsMenuItems

MenuItem* g_apOptionsMenuItems[]
extern

The items of the options menu, ending with NULL.

Ghidra address:
USA: 0x80272468
Ghidra address:
Asia: 0x80271FB8
Ghidra address:
EUR: 0x80274420
Ghidra address:
JPN: 0x80273ed0

◆ g_dwOptionsChangedNeedsSave

s32 g_dwOptionsChangedNeedsSave
extern

Whether a setting of the options menu changed since the menu opened, and the game data needs saving to the EEPROM.

Ghidra address:
EUR: 0x80274490
Ghidra address:
JPN: 0x80273f40

◆ g_bSaveLoadMenuInitialized

u8 g_bSaveLoadMenuInitialized
extern

Whether the save and load menu, or the screen of the Controller Pak data, is set up.

Ghidra address:
USA: 0x802724f8
Ghidra address:
Asia: 0x80272048
Ghidra address:
EUR: 0x802744a8
Ghidra address:
JPN: 0x80273f58

◆ g_bSaveLoadRumbleSwapPending

u8 g_bSaveLoadRumbleSwapPending
extern

Whether the player swapped the Rumble Pak for the Controller Pak, and is asked to swap it back afterwards.

Ghidra address:
USA: 0x802724fc
Ghidra address:
Asia: 0x8027204C
Ghidra address:
EUR: 0x802744ac
Ghidra address:
JPN: 0x80273f5c

◆ g_pPakDataBuffer

u8* g_pPakDataBuffer
extern

The buffer the data is read into and written from.

Ghidra address:
USA: 0x80272500
Ghidra address:
Asia: 0x80272050
Ghidra address:
EUR: 0x802744b0
Ghidra address:
JPN: 0x80273f60

◆ g_abSaveLoadSeasonNoteName

u8 g_abSaveLoadSeasonNoteName[16]
extern

The names of the notes of the save and load menu in the characters of the Controller Pak: "TOP GEAR SEA", "TOP GEAR GHO" and "TOP GEAR OPTIONS".

Ghidra address:
USA: 0x80272504
Ghidra address:
Asia: 0x80272054
Ghidra address:
EUR: 0x802744b4
Ghidra address:
JPN: 0x80273f64

◆ g_abSaveLoadGhostNoteName

u8 g_abSaveLoadGhostNoteName[16]
extern

The Controller Pak note name for a saved ghost car in the save and load menu.

Ghidra address:
USA: 0x80272514
Ghidra address:
Asia: 0x80272064
Ghidra address:
EUR: 0x802744c4
Ghidra address:
JPN: 0x80273f74

◆ g_abSaveLoadOptionsNoteName

u8 g_abSaveLoadOptionsNoteName[16]
extern

The Controller Pak note name for saved options in the save and load menu.

Ghidra address:
USA: 0x80272524
Ghidra address:
Asia: 0x80272074
Ghidra address:
EUR: 0x802744d4
Ghidra address:
JPN: 0x80273f84

◆ g_abSaveLoadNoteExtension

u8 g_abSaveLoadNoteExtension[4]
extern

The extension of the notes, which is empty.

Ghidra address:
USA: 0x80272534
Ghidra address:
Asia: 0x80272084
Ghidra address:
EUR: 0x802744e4
Ghidra address:
JPN: 0x80273f94

◆ g_apszSaveLoadChoices

const char* g_apszSaveLoadChoices[SAVE_LOAD_CHOICES]
extern

The names of the choices of the save and load menu.

Ghidra address:
USA: 0x80272538
Ghidra address:
Asia: 0x80272088

◆ g_bSaveLoadChoice

u8 g_bSaveLoadChoice
extern

The choice of the save and load menu, by the SAVE_LOAD_ values.

Ghidra address:
USA: 0x80272550
Ghidra address:
Asia: 0x802720A0

◆ g_aLoadMenuItems

SaveLoadMenuItem g_aLoadMenuItems[]
extern

The rows of the save and load menu opened from the main menu, for the Game Pak and the Controller Pak.

Ghidra address:
EUR: 0x802744e8
Ghidra address:
JPN: 0x80273f98

◆ g_aSaveSeasonMenuItems

SaveLoadMenuItem g_aSaveSeasonMenuItems[]
extern

The rows of the save and load menu after a championship race.

Ghidra address:
EUR: 0x80274568
Ghidra address:
JPN: 0x80274018

◆ g_aSaveGhostMenuItems

SaveLoadMenuItem g_aSaveGhostMenuItems[]
extern

The rows of the save and load menu after a time attack.

Ghidra address:
EUR: 0x80274598
Ghidra address:
JPN: 0x80274048

◆ g_bSaveLoadMenuCursor

u8 g_bSaveLoadMenuCursor
extern

The row of the save and load menu under the cursor.

Ghidra address:
EUR: 0x802745b8
Ghidra address:
JPN: 0x80274068

◆ g_bSaveLoadStep

u8 g_bSaveLoadStep
extern

The step of the save and load menu.

Ghidra address:
USA: 0x80272554
Ghidra address:
Asia: 0x802720A4
Ghidra address:
EUR: 0x802745bc
Ghidra address:
JPN: 0x8027406c

◆ g_abPakDataSeasonNoteName

u8 g_abPakDataSeasonNoteName[16]
extern

The same names and extension for the screen of the Controller Pak data, whose options note is the configuration.

Ghidra address:
USA: 0x80272558
Ghidra address:
Asia: 0x802720A8
Ghidra address:
EUR: 0x802745c0
Ghidra address:
JPN: 0x80274070

◆ g_abPakDataGhostNoteName

u8 g_abPakDataGhostNoteName[16]
extern

The Controller Pak note name for a saved ghost car on the Pak data screen.

Ghidra address:
USA: 0x80272568
Ghidra address:
Asia: 0x802720B8
Ghidra address:
EUR: 0x802745d0
Ghidra address:
JPN: 0x80274080

◆ g_abPakDataConfigurationNoteName

u8 g_abPakDataConfigurationNoteName[16]
extern

The Controller Pak note name for a saved configuration on the Pak data screen.

Ghidra address:
USA: 0x80272578
Ghidra address:
Asia: 0x802720C8
Ghidra address:
EUR: 0x802745e0
Ghidra address:
JPN: 0x80274090

◆ g_abPakDataNoteExtension

u8 g_abPakDataNoteExtension[4]
extern

The empty extension of the Controller Pak notes on the Pak data screen.

Ghidra address:
USA: 0x80272588
Ghidra address:
Asia: 0x802720D8
Ghidra address:
EUR: 0x802745f0
Ghidra address:
JPN: 0x802740a0

◆ g_bLoadConfigurationPending

s32 g_bLoadConfigurationPending
extern

Whether the options menu opens the screen that loads or saves the configuration.

Ghidra address:
USA: 0x803163a0
Ghidra address:
Asia: 0x80315E50
Ghidra address:
EUR: 0x80318080
Ghidra address:
JPN: 0x80316cb0

◆ g_bSaveConfigurationPending

s32 g_bSaveConfigurationPending
extern

Whether the options menu opens the screen that saves the configuration.

Ghidra address:
USA: 0x803163a4
Ghidra address:
Asia: 0x80315E54
Ghidra address:
EUR: 0x80318084
Ghidra address:
JPN: 0x80316cb4

◆ g_szBgmVolumeTextBuf

char g_szBgmVolumeTextBuf[0x18]
extern

The names of the volume items.

Ghidra address:
USA: 0x803163b0
Ghidra address:
Asia: 0x80315E60
Ghidra address:
EUR: 0x80318090
Ghidra address:
JPN: 0x80316cc0

◆ g_szSfxVolumeTextBuf

char g_szSfxVolumeTextBuf[0x18]
extern

The text of the sound effects volume item in the options menu.

Ghidra address:
USA: 0x803163c8
Ghidra address:
Asia: 0x80315E78
Ghidra address:
EUR: 0x803180a8
Ghidra address:
JPN: 0x80316cd8

◆ g_abSavePakIdKnown

u8 g_abSavePakIdKnown[2]
extern

Whether g_aabSavePakIds holds the identity of the Pak of each of the first two players.

Ghidra address:
USA: 0x80316420
Ghidra address:
Asia: 0x80315ED0
Ghidra address:
EUR: 0x80318100
Ghidra address:
JPN: 0x80316d30

◆ g_bSaveLoadDataWasLoaded

u8 g_bSaveLoadDataWasLoaded
extern

Whether the save and load menu loaded a season or a ghost car.

Ghidra address:
USA: 0x80316422
Ghidra address:
Asia: 0x80315ED2
Ghidra address:
EUR: 0x8031810a
Ghidra address:
JPN: 0x80316d32

◆ g_bSaveLoadSkipEepromProbe

u8 g_bSaveLoadSkipEepromProbe
extern

Whether the next EEPROM step of the save and load menu writes without probing and reading the EEPROM again, once the player confirmed the overwrite.

Ghidra address:
EUR: 0x80318110
Ghidra address:
JPN: 0x80316d38

◆ g_bSaveLoadInputEnabled

u8 g_bSaveLoadInputEnabled
extern

Whether the save and load menu takes the input of its choices.

Ghidra address:
USA: 0x80316423
Ghidra address:
Asia: 0x80315ED3
Ghidra address:
EUR: 0x8031810b
Ghidra address:
JPN: 0x80316d33

◆ g_dwSaveLoadNoteIndex

s32 g_dwSaveLoadNoteIndex
extern

The note the save and load menu found or made.

Ghidra address:
USA: 0x80316424
Ghidra address:
Asia: 0x80315ED4
Ghidra address:
EUR: 0x8031810c
Ghidra address:
JPN: 0x80316d34

◆ g_bSaveLoadFadeDelayFrames

u8 g_bSaveLoadFadeDelayFrames
extern

The frames the save and load menu waited once the sounds faded out.

Ghidra address:
USA: 0x80316428
Ghidra address:
Asia: 0x80315ED8
Ghidra address:
EUR: 0x80318111
Ghidra address:
JPN: 0x80316d39

◆ g_dwPakDataNoteIndex

s32 g_dwPakDataNoteIndex
extern

The note the screen of the Controller Pak data found or made.

Ghidra address:
USA: 0x8031642c
Ghidra address:
Asia: 0x80315EDC
Ghidra address:
EUR: 0x80318104
Ghidra address:
JPN: 0x80316d3c

◆ g_bPakDataStep

u8 g_bPakDataStep
extern

The step of the screen of the Controller Pak data.

Ghidra address:
USA: 0x80316430
Ghidra address:
Asia: 0x80315EE0
Ghidra address:
EUR: 0x80318108
Ghidra address:
JPN: 0x80316d40

◆ g_bPakDataWaitFrames

u8 g_bPakDataWaitFrames
extern

The frames the screen of the Controller Pak data waited once the sounds faded out.

Ghidra address:
USA: 0x80316431
Ghidra address:
Asia: 0x80315EE1
Ghidra address:
EUR: 0x80318109
Ghidra address:
JPN: 0x80316d41