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

Translator from controller readings to the players of one game world. More...

#include <inputmap.h>

Inheritance diagram for InputMap:
Collaboration diagram for InputMap:

Classes

class  Binding
 One player slot's use of one action. More...

Public Types

enum  Action { kActionRotateLeft = 0x726f744c , kActionRotateRight = 0x726f7452 , kActionPlayback = 0x7062636b }
 Actions other classes enable and disable, as four-character codes. More...

Public Member Functions

 InputMap (Globals *pGlobals, std::vector< Player * > *pPlayers)
 Build the map with no binding and record it in g_pInputMap.
virtual ~InputMap ()
 Clear g_pInputMap and release every binding.
virtual void DispatchPriv (Message *pMsg)
 Pass a RawControllerMsg to OnControllerReading() and ignore every other message.
void DisableEntries ()
 Clear the enable word of every binding.
void EnableEntries ()
 Set the enable word of every binding.
void SetEnabled (int nSlot, int nAction, int nEnabled)
 Set the enable word of every binding of one slot and one action.
void AddBinding (int nDevice, int nPort, int nButton, int nSlot, int nAction, int nExtra)
 Bind one physical control to one slot's action.
void Rebuild ()
 Rebuild mBindingMap from the controller configuration.
void StopAllRiffs ()
 Stop the three riffs of every player at the current song position.
Public Member Functions inherited from MsgSource
virtual ~MsgSource ()
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.

Static Public Member Functions

static InputMap * shared ()
 Report the map that exists.
static int MakeKey (int nDevice, int nPort, int nButton)
 Pack a device, a port, and a button into a key of mBindingMap.

Additional Inherited Members

Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.

Detailed Description

Translator from controller readings to the players of one game world.

It has MsgSource at offset 0 and MsgSink at +0x14. Its two tables are at 0x007cf6c0 and 0x007cf698, the second adjusting this by -20. GrooveWorld creates the one instance with a 0x60-byte allocation and the constructor at 0x00119160. The constructor receives the application and the address of the world's player vector. The instance records itself in g_pInputMap.

Each Binding ties one player slot to one action. mBindingMap keys every physical control, built by MakeKey() from a device, a port, and a button, to the binding it drives. A RawControllerMsg is looked up there and turned into the message its binding's action names. The members are declared in recovered offset order.

Member Enumeration Documentation

◆ Action

Actions other classes enable and disable, as four-character codes.

Enumerator
kActionRotateLeft 

rotL, which sends RotLeftMsg.

kActionRotateRight 

rotR, which sends RotRightMsg.

kActionPlayback 

pbck, which sends PlaybackModeMsg.

Constructor & Destructor Documentation

◆ InputMap()

InputMap::InputMap ( Globals * pGlobals,
std::vector< Player * > * pPlayers )

Build the map with no binding and record it in g_pInputMap.

Parameters
pGlobalsThe application globals.
pPlayersThe world's player vector.
Ghidra address:
NTSC-U/C: 0x00119160
Ghidra address:
PAL: 0x001196c0

◆ ~InputMap()

virtual InputMap::~InputMap ( )
virtual

Clear g_pInputMap and release every binding.

Ghidra address:
NTSC-U/C: 0x001193d0
Ghidra address:
PAL: 0x00119930

Member Function Documentation

◆ DispatchPriv()

virtual void InputMap::DispatchPriv ( Message * pMsg)
virtual

Pass a RawControllerMsg to OnControllerReading() and ignore every other message.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x0011dc20
Ghidra address:
PAL: 0x0011e1a8

Implements MsgSink.

◆ shared()

InputMap * InputMap::shared ( )
static

Report the map that exists.

Returns
g_pInputMap.
Ghidra address:
NTSC-U/C: 0x0011d9a0
Ghidra address:
PAL: 0x0011df28

◆ MakeKey()

int InputMap::MakeKey ( int nDevice,
int nPort,
int nButton )
static

Pack a device, a port, and a button into a key of mBindingMap.

Parameters
nDeviceThe device, a four-character code.
nPortThe one-based port.
nButtonThe button.
Returns
((nDevice << 5 | nPort) << 16) | nButton.
Ghidra address:
NTSC-U/C: 0x0011dc08
Ghidra address:
PAL: 0x0011e190

◆ DisableEntries()

void InputMap::DisableEntries ( )

Clear the enable word of every binding.

Ghidra address:
NTSC-U/C: 0x0011db78
Ghidra address:
PAL: 0x0011e100

◆ EnableEntries()

void InputMap::EnableEntries ( )

Set the enable word of every binding.

Ghidra address:
NTSC-U/C: 0x0011dbc0
Ghidra address:
PAL: 0x0011e148

◆ SetEnabled()

void InputMap::SetEnabled ( int nSlot,
int nAction,
int nEnabled )

Set the enable word of every binding of one slot and one action.

The title is inferred.

Parameters
nSlotThe player slot.
nActionThe action, a four-character code.
nEnabledNon-zero to enable.
Ghidra address:
NTSC-U/C: 0x0011db18
Ghidra address:
PAL: 0x0011e0a0

◆ AddBinding()

void InputMap::AddBinding ( int nDevice,
int nPort,
int nButton,
int nSlot,
int nAction,
int nExtra )

Bind one physical control to one slot's action.

Reuses a binding of the same slot, action, and argument when one exists.

Parameters
nDeviceThe device, a four-character code.
nPortThe one-based port.
nButtonThe button.
nSlotThe player slot.
nActionThe action, a four-character code.
nExtraThe action's configured argument.
Ghidra address:
NTSC-U/C: 0x0011a0f0
Ghidra address:
PAL: 0x0011a650

◆ Rebuild()

void InputMap::Rebuild ( )

Rebuild mBindingMap from the controller configuration.

Empties the map, then binds every slot of each port's ControllerConfig in GlobalSettings to that port's player slot, with the slot's action code and riff index. It then passes GameOptions::mForceFeedback to the world's ForceFeedbackMgr, when the world has one. GameManagerImpl::OnUnpauseGameSystem() and GrooveWorld call it. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0011a230
Ghidra address:
PAL: 0x0011a790

◆ StopAllRiffs()

void InputMap::StopAllRiffs ( )

Stop the three riffs of every player at the current song position.

Sends one StopRiffMsg per player and riff, then clears mRiffActive. The title is inferred.

Ghidra address:
NTSC-U/C: 0x00119dd0
Ghidra address:
PAL: 0x0011a330

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