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

Owner of the front-end world, outside a game session. More...

#include <metagameworld.h>

Inheritance diagram for MetaGameWorld:
Collaboration diagram for MetaGameWorld:

Public Member Functions

 MetaGameWorld ()
 Build the renderer and the cheat detector.
virtual ~MetaGameWorld ()
 Release the cheat detector through its own table, then the renderer through KillRenderer().
virtual void OnControllerReading (int nTag, int nPadIndex, int nButton, float flValue)
 Report a controller reading.
RendererBase * GetRenderer ()
 Report the front-end renderer.
void StartFrontEnd ()
 Start the front end running through RendererBase::Start().
void StopFrontEnd ()
 Stop the front end running through RendererBase::Stop().
int IsAwaitingStart ()
 Report whether the title screen waits for Start, or 0 under the null renderer.
Public Member Functions inherited from RawController
virtual ~RawController ()

Detailed Description

Owner of the front-end world, outside a game session.

Its RTTI descriptor is at 0x00901c90. It has RawController as its one public base at offset 0. The allocation in GameManagerImpl::Start() fixes the object at 0xc bytes. The inherited vptr at +0x00 is followed by two members. Its vtable at 0x00810f58 has three entries and a zero terminator at index 3, the type function at 0x003d45e8, the destructor at 0x003d4790, and the RawController override below.

The world owns the front-end renderer at +0x04 and a cheat detector at +0x08. A controller reading reaches the detector first and then the renderer, as a RawControllerMsg.

GameManagerImpl drives the world through GetRenderer() and StopFrontEnd(). No caller of StartFrontEnd() or IsAwaitingStart() is recovered.

The function at 0x003d4758 is the destructor of InputCheatDetectorMet, re-emitted in this translation unit, and is recorded in that class.

Constructor & Destructor Documentation

◆ MetaGameWorld()

MetaGameWorld::MetaGameWorld ( )

Build the renderer and the cheat detector.

Both members start null. CreateRenderer() runs next, and the detector is then allocated at 8 bytes over g_metCheatSequences.

Ghidra address:
NTSC-U/C: 0x003d3110
Ghidra address:
PAL: 0x0040af90

◆ ~MetaGameWorld()

virtual MetaGameWorld::~MetaGameWorld ( )
virtual

Release the cheat detector through its own table, then the renderer through KillRenderer().

Ghidra address:
NTSC-U/C: 0x003d4790
Ghidra address:
PAL: 0x0040c680

Member Function Documentation

◆ OnControllerReading()

virtual void MetaGameWorld::OnControllerReading ( int nTag,
int nPadIndex,
int nButton,
float flValue )
virtual

Report a controller reading.

Slot 2.

The body forwards all four arguments unchanged to slot 2 of the cheat detector. It then builds a RawControllerMsg on the stack whose reading is the four arguments in parameter order and whose position is Sch::Tick(0), and hands it to the renderer's Dispatch().

Parameters
nTagThe device tag, a four-character code.
nPadIndexThe controller that produced the reading, from 1.
nButtonThe button or axis control number.
flValueThe reading's value.
Ghidra address:
NTSC-U/C: 0x003d3288
Ghidra address:
PAL: 0x0040b108

Implements RawController.

◆ GetRenderer()

RendererBase * MetaGameWorld::GetRenderer ( )

Report the front-end renderer.

An out-of-line accessor with eighteen callers, among them GameManagerImpl::DrawFrame() and the script cheats, several of which cast the result to MetRenderer. The body is byte-identical to every other two-instruction accessor of a pointer at +0x04.

Returns
The renderer.
Ghidra address:
NTSC-U/C: 0x003d4858
Ghidra address:
PAL: 0x0040c748

◆ StartFrontEnd()

void MetaGameWorld::StartFrontEnd ( )

Start the front end running through RendererBase::Start().

No caller is recovered.

Ghidra address:
NTSC-U/C: 0x003d4860
Ghidra address:
PAL: 0x0040c750

◆ StopFrontEnd()

void MetaGameWorld::StopFrontEnd ( )

Stop the front end running through RendererBase::Stop().

GameManagerImpl::OnBeginGameLocal(), GameManagerImpl::OnUnpauseGameSystem(), and GameManagerImpl::Recreate() call it.

Ghidra address:
NTSC-U/C: 0x003d4890
Ghidra address:
PAL: 0x0040c780

◆ IsAwaitingStart()

int MetaGameWorld::IsAwaitingStart ( )

Report whether the title screen waits for Start, or 0 under the null renderer.

The body returns 0 when QueryConfigFlag() reports option 0xcb set, the option that selects MetNullRenderer. Otherwise it converts the renderer back to its MetRenderer and reads the word at +0x60, which MetLogoScreen sets when it begins waiting and clears when Start or Select is pressed. No caller is recovered.

Returns
The word, or 0.
Ghidra address:
NTSC-U/C: 0x003d48c0
Ghidra address:
PAL: 0x0040c7b0

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