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

The Controller Pak menu, where a player deletes game notes, and the check of the notes of the Pak at start-up. More...

#include <PR/os_cont.h>
#include <PR/ultratypes.h>
#include "sprite.h"
Include dependency graph for pakmenu.h:

Go to the source code of this file.

Classes

struct  DecalCharMap
 The table of the characters of the names of notes, which is copied whole to read one. More...

Macros

#define PAK_NOTES   16
 The notes a Controller Pak holds.
#define GAME_CODE   0x4E475245
#define COMPANY_CODE   0x3544
#define DECAL_CHAR_COUNT   149
 The number of characters in the Japanese Controller Pak note name map.

Typedefs

typedef struct DecalCharMap DecalCharMap
 The table of the characters of the names of notes, which is copied whole to read one.

Enumerations

enum  {
  PAK_MENU_MOUNT , PAK_MENU_READ_DIRECTORY , PAK_MENU_BROWSE , PAK_MENU_CONFIRM_DELETE ,
  PAK_MENU_ERROR , PAK_MENU_DELETE , PAK_MENU_NEW_PAK , PAK_MENU_EXIT ,
  PAK_MENU_FADING_OUT
}
 The states of the Controller Pak menu. More...

Functions

u8 DecalCharToAscii (u8 c)
 The ASCII of a character of the name of a note.
void ProcessPakMenuScreen (void)
 Run one frame of the Controller Pak menu, which draws and runs itself until it fades out to the main menu.
s32 InitPakAndEnumerateFiles (void)
 Mount the Pak of the first controller, read its notes, and check that each belongs to this game.

Variables

Sprite g_texBackground
 The pictures of the menu.
Sprite g_texLogo
 The logo sprite shared by the Controller Pak and other menu screens.
Sprite g_texButtonA
 The A-button prompt sprite shared by menu screens.
Sprite g_texButtonB
 The B-button prompt sprite shared by menu screens.
const DecalCharMap g_szDecalCharMap
 The ASCII of the characters of the names of notes, a space for those it lacks.
u16 g_wPakEmptySlotMask
 The notes the menu found empty, a bit for each.
s32 g_dwPakFreeBlocks
 The free space of the Pak in bytes.
OSPfsState g_aPakDirEntries [PAK_NOTES]
 The notes of the Pak the menu shows.
OSPfsState g_aPakFileStates [PAK_NOTES]
 The notes InitPakAndEnumerateFiles() reads.
OSPfs g_aPakPfs [MAXCONTROLLERS]
 The file system of the Pak of each controller.
s32 gControllerPakState
 The result of the last Controller Pak call.
u8 g_aabSavePakIds [2][32]
 The identity of the Pak each of the first two players saves to, to tell when another Pak is inserted.

Detailed Description

The Controller Pak menu, where a player deletes game notes, and the check of the notes of the Pak at start-up.

Macro Definition Documentation

◆ PAK_NOTES

#define PAK_NOTES   16

The notes a Controller Pak holds.

◆ GAME_CODE

#define GAME_CODE   0x4E475245

The game code of the notes, "NGRE" in ASCII.

◆ COMPANY_CODE

#define COMPANY_CODE   0x3544

The company code of the notes, "5D" in ASCII.

◆ DECAL_CHAR_COUNT

#define DECAL_CHAR_COUNT   149

The number of characters in the Japanese Controller Pak note name map.

Typedef Documentation

◆ DecalCharMap

typedef struct DecalCharMap DecalCharMap

The table of the characters of the names of notes, which is copied whole to read one.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The states of the Controller Pak menu.

Enumerator
PAK_MENU_MOUNT 

Mount the Controller Pak of the first controller.

PAK_MENU_READ_DIRECTORY 

Read the notes and the free space of the Pak.

PAK_MENU_BROWSE 

Move through the notes, with A to delete one and Start to exit.

PAK_MENU_CONFIRM_DELETE 

Prompt for confirmation of the deletion of the selected note.

PAK_MENU_ERROR 

Show an error of the Pak until a button is pressed.

PAK_MENU_DELETE 

Delete the selected note.

PAK_MENU_NEW_PAK 

Report that a new Pak was inserted, then mount it.

PAK_MENU_EXIT 

Start the fade out of the menu.

PAK_MENU_FADING_OUT 

Wait for the fade out, then return to the main menu.

Function Documentation

◆ DecalCharToAscii()

u8 DecalCharToAscii ( u8 c)

The ASCII of a character of the name of a note.

Parameters
cThe character code of the note name.
Returns
The ASCII character, or a space for a code outside the map.
Ghidra address:
USA: 0x80253460
Ghidra address:
Asia: 0x80252FB0
Ghidra address:
EUR: 0x802549c0
Ghidra address:
JPN: 0x802541b0

◆ ProcessPakMenuScreen()

void ProcessPakMenuScreen ( void )

Run one frame of the Controller Pak menu, which draws and runs itself until it fades out to the main menu.

Ghidra address:
USA: 0x802534dc
Ghidra address:
Asia: 0x8025302C
Ghidra address:
EUR: 0x80254a3c
Ghidra address:
JPN: 0x8025422c

◆ InitPakAndEnumerateFiles()

s32 InitPakAndEnumerateFiles ( void )

Mount the Pak of the first controller, read its notes, and check that each belongs to this game.

Returns
0 if a note of another game was found, and 1 otherwise, failures included.
Ghidra address:
USA: 0x80254620
Ghidra address:
Asia: 0x80254170
Ghidra address:
EUR: 0x80255bc0
Ghidra address:
JPN: 0x802554c0

Variable Documentation

◆ g_texBackground

Sprite g_texBackground
extern

The pictures of the menu.

Ghidra address:
USA: 0x8028cb40
Ghidra address:
Asia: 0x8028C690
Ghidra address:
EUR: 0x8028f2a0
Ghidra address:
JPN: 0x8028ecf0

◆ g_texLogo

Sprite g_texLogo
extern

The logo sprite shared by the Controller Pak and other menu screens.

Ghidra address:
USA: 0x8028cb70
Ghidra address:
Asia: 0x8028C6C0
Ghidra address:
EUR: 0x8028f2d0
Ghidra address:
JPN: 0x8028ed20

◆ g_texButtonA

Sprite g_texButtonA
extern

The A-button prompt sprite shared by menu screens.

Ghidra address:
USA: 0x8028d0b0
Ghidra address:
Asia: 0x8028CC00
Ghidra address:
EUR: 0x8028f810
Ghidra address:
JPN: 0x8028f280

◆ g_texButtonB

Sprite g_texButtonB
extern

The B-button prompt sprite shared by menu screens.

Ghidra address:
USA: 0x8028d0e0
Ghidra address:
Asia: 0x8028CC30
Ghidra address:
EUR: 0x8028f840
Ghidra address:
JPN: 0x8028f2b0

◆ g_szDecalCharMap

const DecalCharMap g_szDecalCharMap
extern

The ASCII of the characters of the names of notes, a space for those it lacks.

Ghidra address:
USA: 0x8028dd50
Ghidra address:
Asia: 0x8028D8A0
Ghidra address:
EUR: 0x802904f0
Ghidra address:
JPN: 0x8028ff40

◆ g_wPakEmptySlotMask

u16 g_wPakEmptySlotMask
extern

The notes the menu found empty, a bit for each.

Ghidra address:
USA: 0x8028dd98
Ghidra address:
Asia: 0x8028D8E8
Ghidra address:
EUR: 0x80290538
Ghidra address:
JPN: 0x8028ffdc

◆ g_dwPakFreeBlocks

s32 g_dwPakFreeBlocks
extern

The free space of the Pak in bytes.

Ghidra address:
USA: 0x8036a068
Ghidra address:
Asia: 0x80369B18
Ghidra address:
EUR: 0x8036c568
Ghidra address:
JPN: 0x8036b1d8

◆ g_aPakDirEntries

OSPfsState g_aPakDirEntries[PAK_NOTES]
extern

The notes of the Pak the menu shows.

Ghidra address:
USA: 0x8036a070
Ghidra address:
Asia: 0x80369B20
Ghidra address:
EUR: 0x8036c570
Ghidra address:
JPN: 0x8036b1e0

◆ g_aPakFileStates

OSPfsState g_aPakFileStates[PAK_NOTES]
extern

The notes InitPakAndEnumerateFiles() reads.

Ghidra address:
USA: 0x8036a280
Ghidra address:
Asia: 0x80369D30
Ghidra address:
EUR: 0x8036c780
Ghidra address:
JPN: 0x8036b3f0

◆ g_aPakPfs

OSPfs g_aPakPfs[MAXCONTROLLERS]
extern

The file system of the Pak of each controller.

Ghidra address:
USA: 0x80369ec0
Ghidra address:
Asia: 0x80369970
Ghidra address:
EUR: 0x8036c3c0
Ghidra address:
JPN: 0x8036b030

◆ gControllerPakState

s32 gControllerPakState
extern

The result of the last Controller Pak call.

Ghidra address:
USA: 0x802724f0
Ghidra address:
Asia: 0x80272040
Ghidra address:
EUR: 0x802744a0
Ghidra address:
JPN: 0x80273f50

◆ g_aabSavePakIds

u8 g_aabSavePakIds[2][32]
extern

The identity of the Pak each of the first two players saves to, to tell when another Pak is inserted.

Ghidra address:
USA: 0x803163e0
Ghidra address:
Asia: 0x80315E90
Ghidra address:
EUR: 0x803180c0
Ghidra address:
JPN: 0x80316cf0