coastline 0.0.4
Loading...
Searching...
No Matches
rumble.h File Reference

The Rumble Paks of the first two controllers. More...

#include <PR/os.h>
#include <PR/os_cont.h>
#include <PR/ultratypes.h>
Include dependency graph for rumble.h:

Go to the source code of this file.

Classes

struct  RumbleProbeState
 The adjacent race-exit flag and Rumble Pak probe timer. More...

Macros

#define RUMBLE_CHANNELS   2
 The controllers whose Rumble Paks the game drives.

Functions

void UpdateRumblePaks (s32 unused)
 Pulse the motors of the Rumble Paks during a race, stop them outside one, and probe for Paks every 64 calls.
void PrepareRumblePaks (void)
 Called before the Rumble Paks are first probed.

Variables

OSPfs g_aContPfs [MAXCONTROLLERS]
 The Pak handle of each controller.
OSMesgQueue g_SiMesgQueue
 The queue of SI events.
u8 g_abRumblePakPresent [MAXCONTROLLERS]
 Whether each controller holds a Rumble Pak.
s16 g_wSerialInterfaceIdle
 Whether the serial interface is free of Controller Pak transfers, so the motors may run.
s16 g_awRumbleActive [RUMBLE_CHANNELS]
 Whether each motor is pulsing.
s16 g_awRumbleMotorOn [RUMBLE_CHANNELS]
 Whether each motor is in the on half of its pulse.
s16 g_awRumbleOnFrames [RUMBLE_CHANNELS]
 The frames each pulse stays on.
s16 g_awRumbleOffFrames [RUMBLE_CHANNELS]
 The frames each pulse stays off.
s16 g_awRumbleCounter [RUMBLE_CHANNELS]
 The frames left in the current half of each pulse.
s16 g_awRumbleFramesLeft [RUMBLE_CHANNELS]
 The frames left before each rumble ends.
RumbleProbeState g_RumbleProbeState
 A shared view of the race-exit flag and probe timer in the original data layout.
u32 g_dwRumbleProbeTimer
 The frames until the next probe for Rumble Paks, modulo 64.

Detailed Description

The Rumble Paks of the first two controllers.

Macro Definition Documentation

◆ RUMBLE_CHANNELS

#define RUMBLE_CHANNELS   2

The controllers whose Rumble Paks the game drives.

Function Documentation

◆ UpdateRumblePaks()

void UpdateRumblePaks ( s32 unused)

Pulse the motors of the Rumble Paks during a race, stop them outside one, and probe for Paks every 64 calls.

The audio thread calls it once per buffer.

Parameters
unusedThe routine never reads it. Its caller passes 0.
Ghidra address:
USA: 0x80260490
Ghidra address:
Asia: 0x8025FFE0
Ghidra address:
EUR: 0x80261970
Ghidra address:
JPN: 0x80261420

◆ PrepareRumblePaks()

void PrepareRumblePaks ( void )

Called before the Rumble Paks are first probed.

It does nothing in the release.

Ghidra address:
USA: 0x802607ac
Ghidra address:
Asia: 0x802602FC
Ghidra address:
EUR: 0x80261cac
Ghidra address:
JPN: 0x8026175c

Variable Documentation

◆ g_aContPfs

OSPfs g_aContPfs[MAXCONTROLLERS]
extern

The Pak handle of each controller.

Ghidra address:
USA: 0x8031a3f8
Ghidra address:
Asia: 0x80319EA8
Ghidra address:
EUR: 0x8031c8f8
Ghidra address:
JPN: 0x8031b528

◆ g_SiMesgQueue

OSMesgQueue g_SiMesgQueue
extern

The queue of SI events.

Ghidra address:
USA: 0x80272d48
Ghidra address:
Asia: 0x80272898
Ghidra address:
EUR: 0x80274f48
Ghidra address:
JPN: 0x80274a18
Ghidra address:
BRD3D: 0x10691000
Ghidra address:
BRGlide: 0x106b8090

◆ g_abRumblePakPresent

u8 g_abRumblePakPresent[MAXCONTROLLERS]
extern

Whether each controller holds a Rumble Pak.

The start of the system checks all four; the rumble reads the first RUMBLE_CHANNELS.

Ghidra address:
USA: 0x8031b1e8
Ghidra address:
Asia: 0x8031AC98
Ghidra address:
EUR: 0x8031d6e8
Ghidra address:
JPN: 0x8031c318
Ghidra address:
BRD3D: 0x106c06a0
Ghidra address:
BRGlide: 0x106e7730

◆ g_wSerialInterfaceIdle

s16 g_wSerialInterfaceIdle
extern

Whether the serial interface is free of Controller Pak transfers, so the motors may run.

Ghidra address:
USA: 0x802a4be8
Ghidra address:
Asia: 0x802A4738
Ghidra address:
EUR: 0x802a7370
Ghidra address:
JPN: 0x802a6e10
Ghidra address:
BRD3D: 0x100b5d90
Ghidra address:
BRGlide: 0x100b5598

◆ g_awRumbleActive

s16 g_awRumbleActive[RUMBLE_CHANNELS]
extern

Whether each motor is pulsing.

Ghidra address:
USA: 0x802a4bec
Ghidra address:
Asia: 0x802A473C
Ghidra address:
EUR: 0x802a7374
Ghidra address:
JPN: 0x802a6e14
Ghidra address:
BRD3D: 0x11782ba8
Ghidra address:
BRGlide: 0x117a5f08

◆ g_awRumbleMotorOn

s16 g_awRumbleMotorOn[RUMBLE_CHANNELS]
extern

Whether each motor is in the on half of its pulse.

Ghidra address:
USA: 0x802a4bf0
Ghidra address:
Asia: 0x802A4740
Ghidra address:
EUR: 0x802a7378
Ghidra address:
JPN: 0x802a6e18
Ghidra address:
BRD3D: 0x11782bac
Ghidra address:
BRGlide: 0x117a5f0c

◆ g_awRumbleOnFrames

s16 g_awRumbleOnFrames[RUMBLE_CHANNELS]
extern

The frames each pulse stays on.

Ghidra address:
USA: 0x802a4bf4
Ghidra address:
Asia: 0x802A4744
Ghidra address:
EUR: 0x802a737c
Ghidra address:
JPN: 0x802a6e1c
Ghidra address:
BRD3D: 0x11782bb0
Ghidra address:
BRGlide: 0x117a5f10

◆ g_awRumbleOffFrames

s16 g_awRumbleOffFrames[RUMBLE_CHANNELS]
extern

The frames each pulse stays off.

Ghidra address:
USA: 0x802a4bf8
Ghidra address:
Asia: 0x802A4748
Ghidra address:
EUR: 0x802a7380
Ghidra address:
JPN: 0x802a6e20
Ghidra address:
BRD3D: 0x11782bb4
Ghidra address:
BRGlide: 0x117a5f14

◆ g_awRumbleCounter

s16 g_awRumbleCounter[RUMBLE_CHANNELS]
extern

The frames left in the current half of each pulse.

Ghidra address:
USA: 0x802a4bfc
Ghidra address:
Asia: 0x802A474C
Ghidra address:
EUR: 0x802a7384
Ghidra address:
JPN: 0x802a6e24
Ghidra address:
BRD3D: 0x11782bb8
Ghidra address:
BRGlide: 0x117a5f18

◆ g_awRumbleFramesLeft

s16 g_awRumbleFramesLeft[RUMBLE_CHANNELS]
extern

The frames left before each rumble ends.

Ghidra address:
USA: 0x802a4c00
Ghidra address:
Asia: 0x802A4750
Ghidra address:
EUR: 0x802a7388
Ghidra address:
JPN: 0x802a6e28
Ghidra address:
BRD3D: 0x11782bbc
Ghidra address:
BRGlide: 0x117a5f1c

◆ g_RumbleProbeState

RumbleProbeState g_RumbleProbeState
extern

A shared view of the race-exit flag and probe timer in the original data layout.

Ghidra address:
USA: 0x802a4c04
Ghidra address:
Asia: 0x802A4754
Ghidra address:
EUR: 0x802a738c
Ghidra address:
JPN: 0x802a6e2c

◆ g_dwRumbleProbeTimer

u32 g_dwRumbleProbeTimer
extern

The frames until the next probe for Rumble Paks, modulo 64.

Ghidra address:
USA: 0x802a4c08
Ghidra address:
Asia: 0x802A4758
Ghidra address:
EUR: 0x802a7390
Ghidra address:
JPN: 0x802a6e30