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

Translator from one raw controller reading to one front-end command. More...

#include <metcommandmap.h>

Public Member Functions

 MetCommandMap ()
 Build the five empty held-direction records.
 ~MetCommandMap ()
 Release every record and the vector.
int Translate (const MetControllerReading *pReading, MetScreenCommand *pCommand)
 Translate one controller reading into one front-end command.

Detailed Description

Translator from one raw controller reading to one front-end command.

The class emits no RTTI, so no descriptor, accessor, or vtable in the image bears its name. It declares no allocation operator of its own either, because MetRenderer's constructor allocates it through the tagged allocator with an explicit size rather than through a class operator, so the deallocation-tag lever does not reach it. Its translation unit spans roughly 0x002e33f0 through 0x002e72bc, between MetMemDetectStartup and MetModeScreen, and no literal in that span identifies a file or a function. The name here is therefore inferred from what the class does and is not attested anywhere in the image.

The object is twelve bytes and its one member is a std::vector of five std::map<int, int> records, one per controller index, which remember which analogue directions are held so that a held stick yields one command rather than one per reading. The map's twenty-four byte nodes and the stl_maptree tag the constructor sets fix the record.

The destructor is emitted into MetRenderer's translation unit rather than the class's own, which is what an inline destructor compiles to.

Constructor & Destructor Documentation

◆ MetCommandMap()

MetCommandMap::MetCommandMap ( )

Build the five empty held-direction records.

Ghidra address:
NTSC-U/C: 0x002e33f0
Ghidra address:
PAL: 0x003063b0

◆ ~MetCommandMap()

MetCommandMap::~MetCommandMap ( )
inline

Release every record and the vector.

Inline. The address is its out-of-line copy in MetRenderer's translation unit.

Ghidra address:
NTSC-U/C: 0x00371138
Ghidra address:
PAL: 0x0039fc30

Member Function Documentation

◆ Translate()

int MetCommandMap::Translate ( const MetControllerReading * pReading,
MetScreenCommand * pCommand )

Translate one controller reading into one front-end command.

The command's mPadIndex takes the reading's. A key reading whose mValue is above zero yields command 15 with the reading's mButton. A joy reading dispatches on mButton through a 103-entry table. Buttons 1 through 16 yield a fixed code while pressed and 0 when released, buttons 100 through 103 are the four analogue directions and go through AxisCommand(), and every other button yields -1 and sets mPadIndex to 1. A reading of any other tag leaves mCommand as it was.

Parameters
pReadingThe reading, which is the RawControllerMsg payload rather than the message.
pCommandThe command the reading translates to.
Returns
Non-zero unless the command is -1.
Ghidra address:
NTSC-U/C: 0x002e3738
Ghidra address:
PAL: 0x003066f8

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