resonance 1.0.1
Loading...
Searching...
No Matches
GlobalSettings Class Reference

Settings shared by every player and saved to the memory card apart from any persona. More...

#include <globalsettings.h>

Collaboration diagram for GlobalSettings:

Public Member Functions

void * operator new (size_t nSize)
 Allocate an instance from the tagged heap under the tag GlobalSettings.
void operator delete (void *pBlock)
 Release an instance to the tagged heap.
 GlobalSettings ()
 Start with the default mappings, options, and keyboard macros, the address 127.0.0.2, the port 2000, and one memory-card location, 1.
virtual ~GlobalSettings ()
virtual void Save (OBStream &stream)
 Write the settings.
virtual void Load (IBStream &stream)
 Read the settings back.
void SetMacros (std::vector< HxStr > macros)
 Replace the keyboard macros with a list.
void Print (std::ostream &stream)
 Write the address, the port, the four mapping labels, and the tutorial flag to a stream.
void operator= (const GlobalSettings &other)
 Copy another instance's settings, except the memory-card locations.

Static Public Member Functions

static GlobalSettings * shared ()
 Report the instance.
static void Create ()
 Allocate the instance.
static void Destroy ()
 Delete the instance and clear the pointer shared() reports.

Public Attributes

ControllerConfig mControllers [kControllerCount]
 The four controller mappings.
GameOptions mGameOptions
 The game options.
int mTutorialComplete
 Non-zero once the tutorial is complete, labelled by Print().
std::vector< MemcardConnectState > mCardSlots
 The memory-card locations.
int mRequiredSaveSpace
 The free space the game needs on the first card.
int mMinimumFreeClusters
 The free space a remix save needs.
int mPersonaMinimumFreeClusters
 The free space a persona save needs.
int mTeamFreqUnlocked
 Non-zero to offer the team FreQ identities instead of the pre-fab ones.

Static Public Attributes

static constexpr int kControllerCount = 4
 The number of controller mappings.

Detailed Description

Settings shared by every player and saved to the memory card apart from any persona.

It is a leaf class with no base. Following the g++ 2.x layout for a class with no base, the vptr sits after the data at +0x7c. The allocation in Create() fixes the object at 0x80 bytes. The vtable at 0x007db970 runs the type function at 0x0018b948, the destructor, Save(), and Load().

The one instance lives at 0x0067ea38. MetRenderer's constructor creates it through Create(), and about a hundred routines reach it through shared().

The translation unit spans 0x00187c00 to 0x0018bc28. Besides the members below, it holds template library emissions (0x00188e88, 0x00189060, 0x0018a158, 0x0018a840, 0x0018adb8, 0x0018b0e8, 0x0018b528, and 0x0018bc28), copies of routines defined elsewhere, and the printer at 0x00187c60, which writes a network server record rather than this class. None of those is declared here.

Constructor & Destructor Documentation

◆ GlobalSettings()

GlobalSettings::GlobalSettings ( )

Start with the default mappings, options, and keyboard macros, the address 127.0.0.2, the port 2000, and one memory-card location, 1.

Ghidra address:
NTSC-U/C: 0x00187d00
Ghidra address:
PAL: 0x0018d588

◆ ~GlobalSettings()

virtual GlobalSettings::~GlobalSettings ( )
virtual
Ghidra address:
NTSC-U/C: 0x00188370
Ghidra address:
PAL: 0x0018dc90

Member Function Documentation

◆ operator new()

void * GlobalSettings::operator new ( size_t nSize)

Allocate an instance from the tagged heap under the tag GlobalSettings.

Parameters
nSizeThe object size, which the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x0018b988
Ghidra address:
PAL: 0x00191418

◆ operator delete()

void GlobalSettings::operator delete ( void * pBlock)

Release an instance to the tagged heap.

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x0018b9a8
Ghidra address:
PAL: 0x00191438

◆ Save()

virtual void GlobalSettings::Save ( OBStream & stream)
virtual

Write the settings.

Slot 2. The record version 4 comes first, then the address, the port, the four mappings, the options, the macro count and the keyboard macros, and the tutorial flag.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001885d0
Ghidra address:
PAL: 0x0018df28

◆ Load()

virtual void GlobalSettings::Load ( IBStream & stream)
virtual

Read the settings back.

Slot 3. A record older than version 2 has another string where the port belongs, which is discarded in favour of the default port. A version 0 record has one mapping. A record older than version 3 has an older macro list, which SkipLegacyMacros() discards. Only a version 4 record has the tutorial flag.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x001887d0
Ghidra address:
PAL: 0x0018e128

◆ shared()

GlobalSettings * GlobalSettings::shared ( )
static

Report the instance.

Returns
The instance, or null outside the lifetime of the front-end renderer.
Ghidra address:
NTSC-U/C: 0x0018b9c8
Ghidra address:
PAL: 0x00191458

◆ Create()

void GlobalSettings::Create ( )
static

Allocate the instance.

Ghidra address:
NTSC-U/C: 0x0018b9d8
Ghidra address:
PAL: 0x00191468

◆ Destroy()

void GlobalSettings::Destroy ( )
static

Delete the instance and clear the pointer shared() reports.

Ghidra address:
NTSC-U/C: 0x0018ba48
Ghidra address:
PAL: 0x001914d8

◆ SetMacros()

void GlobalSettings::SetMacros ( std::vector< HxStr > macros)

Replace the keyboard macros with a list.

The list arrives by value. Only as many macros as the list has are replaced. The image has no caller.

Parameters
macrosThe macros.
Ghidra address:
NTSC-U/C: 0x00188cc0
Ghidra address:
PAL: 0x0018e6a0

◆ Print()

void GlobalSettings::Print ( std::ostream & stream)

Write the address, the port, the four mapping labels, and the tutorial flag to a stream.

The image has no caller.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x0018ba90
Ghidra address:
PAL: 0x00191520

◆ operator=()

void GlobalSettings::operator= ( const GlobalSettings & other)

Copy another instance's settings, except the memory-card locations.

Exactly twelve macros are copied, whatever either list holds, and the routine returns nothing. The image has no caller.

Parameters
otherThe settings to copy.
Ghidra address:
NTSC-U/C: 0x0018bb50
Ghidra address:
PAL: 0x001915e0

Member Data Documentation

◆ kControllerCount

int GlobalSettings::kControllerCount = 4
staticconstexpr

The number of controller mappings.

◆ mControllers

ControllerConfig GlobalSettings::mControllers[kControllerCount]

The four controller mappings.

InputMap::Rebuild() reads them. +0x00

◆ mGameOptions

GameOptions GlobalSettings::mGameOptions

The game options.

+0x30

◆ mTutorialComplete

int GlobalSettings::mTutorialComplete

Non-zero once the tutorial is complete, labelled by Print().

+0x5c

◆ mCardSlots

std::vector<MemcardConnectState> GlobalSettings::mCardSlots

The memory-card locations.

MetStageFinishScreen's slot 5 and FirstCardSlotName() read them. +0x60

◆ mRequiredSaveSpace

int GlobalSettings::mRequiredSaveSpace

The free space the game needs on the first card.

Starts at 256, or 128 in the PAL build. +0x6c

MinimumSaveSpaceMCT seeds its measurement from it, and MetMemDetectScreen raises the no-space message when the reported requirement equals it.

◆ mMinimumFreeClusters

int GlobalSettings::mMinimumFreeClusters

The free space a remix save needs.

Starts at 60. MetRemixTypeScreen::OnExitFinished() (0x00363920) raises warn_remix_no_space when the first card slot's MemcardConnectState::mFree is below it. The name is inferred from that comparison and from the matching kSaveFileMinimumFreeClusters. +0x70

◆ mPersonaMinimumFreeClusters

int GlobalSettings::mPersonaMinimumFreeClusters

The free space a persona save needs.

Starts at 24, or 2 in the PAL build. +0x74

Public because MetPersonaSaverScreen::OnConnectState() and OnPersonasSaved() compare the target card's MemcardConnectState::mFree against it and write it into the copy warning, and the image has no accessor.

◆ mTeamFreqUnlocked

int GlobalSettings::mTeamFreqUnlocked

Non-zero to offer the team FreQ identities instead of the pre-fab ones.

Starts at 0. +0x78

Public because MetFreqMakerAssetManager::GetIdentityList() reads it directly, and the image has no accessor. The name is inferred from that one use.


The documentation for this class was generated from the following file: