wavelength 1.0.0
Loading...
Searching...
No Matches
Joypad.h File Reference
#include "os/JoypadData.h"
#include "os/JoypadMsgSource.h"
#include "utl/Data.h"
#include "utl/MsgSink.h"
Include dependency graph for Joypad.h:

Go to the source code of this file.

Functions

void JoypadConfigInit (DataArray *config)
 Apply the joypad configuration array, the press threshold of every controller.
JoypadData * JoypadGetPlayerData (int iPlayerNum)
 Report the state of a player's controller.
void JoypadSubscribe (MsgSink *sink)
 Send the controller messages to a sink.
void JoypadUnsubscribe (MsgSink *sink)
 Stop sending the controller messages to a sink.
void JoypadAssignPadToPlayer (int iPlayerNum, int iPadNum)
 Give a controller to a player, or take it from its player.
void JoypadInit ()
 Create DirectInput and a DIJoypad for each attached joystick, giving joystick n to player n.
void JoypadTerminate ()
 Release the joysticks and DirectInput.

Variables

const int kNumJoypads = 8
 Number of controllers.
const int kNumPlayers = 4
 Number of players.
JoypadData gJoypadData [kNumJoypads]
 State of each controller.
int gPlayerNumToPadNum [kNumPlayers]
 Controller of each player.
JoypadMsgSource gJoypadMsgSource
 Source of the controller messages.

Function Documentation

◆ JoypadConfigInit()

void JoypadConfigInit ( DataArray * config)

Apply the joypad configuration array, the press threshold of every controller.

Parameters
configThe array.
Ghidra address:
0x1000ed50

◆ JoypadGetPlayerData()

JoypadData * JoypadGetPlayerData ( int iPlayerNum)

Report the state of a player's controller.

Parameters
iPlayerNumThe player.
Returns
The state.
Ghidra address:
0x1000ed90

◆ JoypadSubscribe()

void JoypadSubscribe ( MsgSink * sink)

Send the controller messages to a sink.

Parameters
sinkThe sink.
Ghidra address:
0x1000ee10

◆ JoypadUnsubscribe()

void JoypadUnsubscribe ( MsgSink * sink)

Stop sending the controller messages to a sink.

Parameters
sinkThe sink.
Ghidra address:
0x1000ee20

◆ JoypadAssignPadToPlayer()

void JoypadAssignPadToPlayer ( int iPlayerNum,
int iPadNum )

Give a controller to a player, or take it from its player.

Parameters
iPlayerNumThe player, or -1 for none.
iPadNumThe controller.
Ghidra address:
0x1000ee30

◆ JoypadInit()

void JoypadInit ( )

Create DirectInput and a DIJoypad for each attached joystick, giving joystick n to player n.

Ghidra address:
0x1000b8a0

◆ JoypadTerminate()

void JoypadTerminate ( )

Release the joysticks and DirectInput.

Ghidra address:
0x1000b930

Variable Documentation

◆ kNumJoypads

const int kNumJoypads = 8

Number of controllers.

◆ kNumPlayers

const int kNumPlayers = 4

Number of players.

◆ gJoypadData

JoypadData gJoypadData[kNumJoypads]
extern

State of each controller.

Ghidra address:
0x10040cf0

◆ gPlayerNumToPadNum

int gPlayerNumToPadNum[kNumPlayers]
extern

Controller of each player.

Ghidra address:
0x10040ce0

◆ gJoypadMsgSource

JoypadMsgSource gJoypadMsgSource
extern

Source of the controller messages.

Ghidra address:
0x100410f0