Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
port.c File Reference
#include "engine/game.h"
#include <libpad.h>
Include dependency graph for port.c:

Go to the source code of this file.

Functions

s32 pollPadState (u32 port)
 The libpad state of a port while it can be read (0 otherwise); a stable pad gets its actuators aligned.
 
void readPadButtons (s32 port, PadData *data, PadData *record)
 Builds held/pressed/repeated from the raw data (the demo record replaces all but Start)
 
s32 readPad (u16 port, PadData *data)
 Reads one pad (vibration included), or clears its buttons when it is missing.
 
s32 lockPadMode (s32 port, s32 lock)
 Locks or unlocks the analog button of a DualShock, keeping its current mode.
 
s32 alignActuators (u16 port)
 Sends a DualShock its actuator alignment, so setVibration can drive the motors.
 
void updateVibration (u16 port)
 Counts down a pad's vibration timers and stops each motor whose time is up.
 

Function Documentation

◆ pollPadState()

s32 pollPadState ( u32  port)

The libpad state of a port while it can be read (0 otherwise); a stable pad gets its actuators aligned.

< PadSetActAlign sent, not yet stable

< the actuators are aligned

< the actuators are aligned

< PadSetActAlign sent, not yet stable

< the actuators are aligned

< PadSetActAlign sent, not yet stable

Definition at line 8 of file port.c.

Referenced by lockPadMode(), readPad(), and setVibration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPadButtons()

void readPadButtons ( s32  port,
PadData *  data,
PadData *  record 
)

Builds held/pressed/repeated from the raw data (the demo record replaces all but Start)

Definition at line 40 of file port.c.

Referenced by readPad(), and updatePad().

Here is the caller graph for this function:

◆ readPad()

s32 readPad ( u16  port,
PadData *  data 
)

Reads one pad (vibration included), or clears its buttons when it is missing.

Definition at line 144 of file port.c.

Referenced by updatePad().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lockPadMode()

s32 lockPadMode ( s32  port,
s32  lock 
)

Locks or unlocks the analog button of a DualShock, keeping its current mode.

< PadSetActAlign sent, not yet stable

< the actuators are aligned

Definition at line 163 of file port.c.

Here is the call graph for this function:

◆ alignActuators()

s32 alignActuators ( u16  port)

Sends a DualShock its actuator alignment, so setVibration can drive the motors.

Definition at line 187 of file port.c.

Referenced by pollPadState().

Here is the caller graph for this function:

◆ updateVibration()

void updateVibration ( u16  port)

Counts down a pad's vibration timers and stops each motor whose time is up.

Definition at line 203 of file port.c.

Referenced by readPad().

Here is the caller graph for this function: