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

Scheduler command that replays one controller reading into the game world. More...

#include <controllercmd.h>

Inheritance diagram for ControllerCmd:
Collaboration diagram for ControllerCmd:

Public Member Functions

 ControllerCmd ()
 Start with the reading unset.
 ControllerCmd (const MetControllerReading &reading)
 Record one controller reading to replay.
virtual int CmdID ()
 Report the identifier this class streams itself under.
virtual void Execute ()
 Hand the reading to the world of the running game.
virtual void Print (std::ostream &stream)
 Write {ControllerCmd} to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the reading between the tags CM[ and ]CM.
virtual void restoreGuts (IBStream &stream)
 Read the reading back, discarding the three tag bytes on each side.
Public Member Functions inherited from Sch::Command
 Command ()
 Construct a command that the scheduler has not queued.
virtual ~Command ()
 Release the command.
Public Member Functions inherited from Attachment
 Attachment ()
virtual ~Attachment ()
int Release ()
 Give back one reference and destroy the object once the last one is gone.
virtual void Destroy ()
 Destroy the object.

Static Public Attributes

static int sCmdID
 Identifier the class streams itself under.

Additional Inherited Members

Static Public Member Functions inherited from Sch::Command
static Command * NewCommand (int nCmdID)
 Produce a command of the identified class through the factory list.
Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.
Public Attributes inherited from Sch::Command
int mQueued
 Non-zero while the command sits in the scheduler's queue.
Public Attributes inherited from Attachment
int mRefs

Detailed Description

Scheduler command that replays one controller reading into the game world.

It has Sch::Command as its one base. Its vtable at 0x007dc3c0 runs eight entries and overrides every slot the base declares apart from Attachment::Destroy(). The allocation at 0x0018be70 measures the object at 0x1c bytes, the 0x0c-byte base followed by one sixteen-byte reading.

The static member sCmdID is attested by the RTTI, which records it as the first global of the translation unit in the anonymous-namespace markers of ExitCmd and FuncCmd. Those two classes share the unit with this one and with GrooveWorld, whose routines create all three.

saveGuts() frames the reading between the tags CM[ and ]CM, one byte per character, and restoreGuts() reads six bytes around the reading without checking them.

The destructor at 0x001944e8 is implicitly declared. It stores the base table pointer and runs Attachment's destructor, which is what the compiler generates.

The member is private. Only this class's routines address it.

Constructor & Destructor Documentation

◆ ControllerCmd() [1/2]

ControllerCmd::ControllerCmd ( )
inline

Start with the reading unset.

Inline. NewControllerCmd() expands it for restoreGuts() to fill.

◆ ControllerCmd() [2/2]

ControllerCmd::ControllerCmd ( const MetControllerReading & reading)
inlineexplicit

Record one controller reading to replay.

Inline, with no address of its own. GrooveWorld::OnControllerReading() expands it when it queues a reading.

Parameters
readingThe reading.

Member Function Documentation

◆ CmdID()

virtual int ControllerCmd::CmdID ( )
virtual

Report the identifier this class streams itself under.

Returns
sCmdID.
Ghidra address:
NTSC-U/C: 0x00194598
Ghidra address:
PAL: 0x0019a218

Implements Sch::Command.

◆ Execute()

virtual void ControllerCmd::Execute ( )
virtual

Hand the reading to the world of the running game.

Ghidra address:
NTSC-U/C: 0x00194560
Ghidra address:
PAL: 0x0019a1e0

Implements Sch::Command.

◆ Print()

virtual void ControllerCmd::Print ( std::ostream & stream)
virtual

Write {ControllerCmd} to a diagnostic stream.

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

Reimplemented from Sch::Command.

◆ saveGuts()

virtual void ControllerCmd::saveGuts ( OBStream & stream) const
virtual

Write the reading between the tags CM[ and ]CM.

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

Reimplemented from Sch::Command.

◆ restoreGuts()

virtual void ControllerCmd::restoreGuts ( IBStream & stream)
virtual

Read the reading back, discarding the three tag bytes on each side.

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

Reimplemented from Sch::Command.

Member Data Documentation

◆ sCmdID

int ControllerCmd::sCmdID
static

Identifier the class streams itself under.

The word at 0x0067f238 starts as 2.

Ghidra address:
NTSC-U/C: 0x0067f238
Ghidra address:
PAL: 0x006c0468

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