Driver of the controllers' vibration motors during a song.
More...
#include <forcefeedbackmgr.h>
|
| | ForceFeedbackMgr () |
| | Construct the manager with no controller and the beat pulse's command.
|
| | ~ForceFeedbackMgr () |
| | Delete every controller.
|
| void | Start (const float *pTickDuration, int nTicksPerBar) |
| | Prepare one controller for each player and enable vibration.
|
| void | StopAll () |
| | Withdraw the beat pulse, cancel every effect, and disable vibration.
|
| void | StartMetronome (int nPeriod, int nTick) |
| | Schedule the beat pulse at the first multiple of a period from a tick that still lies ahead.
|
| void | StopMetronome () |
| | Withdraw the beat pulse from the song scheduler.
|
| void | SetBeatEnabled (int nPad, bool bEnabled) |
| | Set whether the beat pulse drives one controller.
|
| void | SetVibration (int nController, int nSmallMotor, int nBigMotor) |
| | Record a controller's motor levels and pass them to its port.
|
| void | PlayBumpEffect (int nController) |
| | Play the bumper effect on a controller while vibration is enabled.
|
| void | PlayCrippleEffect (int nController) |
| | Play the crippler effect on a controller while vibration is enabled.
|
| void | PlayAutocatchEffect (int nController) |
| | Play the autocatcher effect on a controller while vibration is enabled.
|
| void | PlayEffect (int nController, int nEffect) |
| | Cancel every effect of a controller and start one.
|
| void | Pause () |
| | Stop the motors of both ports while the game is paused.
|
| void | Resume () |
| | Read each controller's vibration option again and restore the motors Pause() stopped.
|
| BeatCmd * | GetBeatCmd () |
| const std::vector< std::unique_ptr< Controller > > & | GetControllers () const |
| int | GetEnabled () const |
|
| static constexpr int | kMaxPlayers = 2 |
| | The most players Start() prepares controllers for.
|
| static constexpr int | kPadCount = 2 |
| | The number of controller ports.
|
Driver of the controllers' vibration motors during a song.
The class is not polymorphic and emits no RTTI. The RTTI of the nested BeatCmd, Controller, MotorEffect, and MotorEffect::OffCmd records the name. The one instance is the function-local static of shared(), and TheForceFeedbackMgr addresses it.
Two kinds of vibration run through it. The beat pulse vibrates every enabled controller that plays no effect once a beat, and an effect runs one of three motor patterns on one controller.
◆ Effect
The effects of a controller, indices into Controller::mEffects.
| Enumerator |
|---|
| kEffectCripple | A crippler hit.
|
| kEffectBump | A bumper hit.
|
| kEffectAutocatch | An autocatcher or a capture.
|
| kEffectCount | The number of effects.
|
◆ ForceFeedbackMgr()
| ForceFeedbackMgr::ForceFeedbackMgr |
( |
| ) |
|
Construct the manager with no controller and the beat pulse's command.
- Ghidra address:
- NTSC-U/C: 0x0010c8e0
- Ghidra address:
- PAL: 0x0010e018
◆ ~ForceFeedbackMgr()
| ForceFeedbackMgr::~ForceFeedbackMgr |
( |
| ) |
|
Delete every controller.
- Ghidra address:
- NTSC-U/C: 0x0010c958
- Ghidra address:
- PAL: 0x0010e090
◆ shared()
Report the single instance, constructing it on first use.
- Returns
- The instance.
- Ghidra address:
- NTSC-U/C: 0x0010d290
- Ghidra address:
- PAL: 0x0010e9c8
◆ Start()
| void ForceFeedbackMgr::Start |
( |
const float * | pTickDuration, |
|
|
int | nTicksPerBar ) |
Prepare one controller for each player and enable vibration.
Nothing happens when more than kMaxPlayers players take part, while a demo plays, or when the game configuration disables vibration. Every effect is cancelled and both ports are stopped first. The name is inferred.
- Parameters
-
| pTickDuration | The duration of one tick on the song clock, which the manager retains. |
| nTicksPerBar | The song ticks in one bar. |
- Ghidra address:
- NTSC-U/C: 0x0010ca08
- Ghidra address:
- PAL: 0x0010e140
◆ StopAll()
| void ForceFeedbackMgr::StopAll |
( |
| ) |
|
Withdraw the beat pulse, cancel every effect, and disable vibration.
The name is inferred.
- Ghidra address:
- NTSC-U/C: 0x0010cd58
- Ghidra address:
- PAL: 0x0010e490
◆ StartMetronome()
| void ForceFeedbackMgr::StartMetronome |
( |
int | nPeriod, |
|
|
int | nTick ) |
Schedule the beat pulse at the first multiple of a period from a tick that still lies ahead.
The pulse leads the beat by the configured lead, and every controller is enabled. Nothing happens while vibration is disabled. The name is inferred.
- Parameters
-
| nPeriod | The ticks between two pulses. |
| nTick | The tick the pulse starts from. |
- Ghidra address:
- NTSC-U/C: 0x0010cde8
- Ghidra address:
- PAL: 0x0010e520
◆ StopMetronome()
| void ForceFeedbackMgr::StopMetronome |
( |
| ) |
|
Withdraw the beat pulse from the song scheduler.
The name is inferred.
- Ghidra address:
- NTSC-U/C: 0x0010cf58
- Ghidra address:
- PAL: 0x0010e690
◆ SetBeatEnabled()
| void ForceFeedbackMgr::SetBeatEnabled |
( |
int | nPad, |
|
|
bool | bEnabled ) |
Set whether the beat pulse drives one controller.
Nothing happens while vibration is disabled. The name is inferred.
- Parameters
-
| nPad | The controller. |
| bEnabled | Whether the controller follows the beat pulse. |
- Ghidra address:
- NTSC-U/C: 0x0010cf90
- Ghidra address:
- PAL: 0x0010e6c8
◆ SetVibration()
| void ForceFeedbackMgr::SetVibration |
( |
int | nController, |
|
|
int | nSmallMotor, |
|
|
int | nBigMotor ) |
Record a controller's motor levels and pass them to its port.
The port receives the levels only while the manager is not suspended and the controller's vibration option is on. The name is inferred.
- Parameters
-
| nController | The controller. |
| nSmallMotor | The small motor's state, 0 or 1. |
| nBigMotor | The big motor's level. |
- Ghidra address:
- NTSC-U/C: 0x0010cfb8
- Ghidra address:
- PAL: 0x0010e6f0
◆ PlayBumpEffect()
| void ForceFeedbackMgr::PlayBumpEffect |
( |
int | nController | ) |
|
Play the bumper effect on a controller while vibration is enabled.
- Parameters
-
| nController | The controller. |
- Ghidra address:
- NTSC-U/C: 0x0010d010
- Ghidra address:
- PAL: 0x0010e748
◆ PlayCrippleEffect()
| void ForceFeedbackMgr::PlayCrippleEffect |
( |
int | nController | ) |
|
Play the crippler effect on a controller while vibration is enabled.
- Parameters
-
| nController | The controller. |
- Ghidra address:
- NTSC-U/C: 0x0010d038
- Ghidra address:
- PAL: 0x0010e770
◆ PlayAutocatchEffect()
| void ForceFeedbackMgr::PlayAutocatchEffect |
( |
int | nController | ) |
|
Play the autocatcher effect on a controller while vibration is enabled.
- Parameters
-
| nController | The controller. |
- Ghidra address:
- NTSC-U/C: 0x0010d060
- Ghidra address:
- PAL: 0x0010e798
◆ PlayEffect()
| void ForceFeedbackMgr::PlayEffect |
( |
int | nController, |
|
|
int | nEffect ) |
Cancel every effect of a controller and start one.
The name is inferred.
- Parameters
-
| nController | The controller. |
| nEffect | One of Effect. |
- Ghidra address:
- NTSC-U/C: 0x0010d088
- Ghidra address:
- PAL: 0x0010e7c0
◆ Pause()
| void ForceFeedbackMgr::Pause |
( |
| ) |
|
Stop the motors of both ports while the game is paused.
The name is inferred.
- Ghidra address:
- NTSC-U/C: 0x0010d130
- Ghidra address:
- PAL: 0x0010e868
◆ Resume()
| void ForceFeedbackMgr::Resume |
( |
| ) |
|
Read each controller's vibration option again and restore the motors Pause() stopped.
The name is inferred.
- Ghidra address:
- NTSC-U/C: 0x0010d198
- Ghidra address:
- PAL: 0x0010e8d0
◆ GetBeatCmd()
| BeatCmd * ForceFeedbackMgr::GetBeatCmd |
( |
| ) |
|
|
inline |
- Returns
- The command of the beat pulse.
◆ GetControllers()
| const std::vector< std::unique_ptr< Controller > > & ForceFeedbackMgr::GetControllers |
( |
| ) |
const |
|
inline |
- Returns
- The controllers, one for each player, deleted with the manager.
◆ GetEnabled()
| int ForceFeedbackMgr::GetEnabled |
( |
| ) |
const |
|
inline |
- Returns
- Whether vibration runs, set by Start().
◆ kMaxPlayers
| int ForceFeedbackMgr::kMaxPlayers = 2 |
|
staticconstexpr |
The most players Start() prepares controllers for.
◆ kPadCount
| int ForceFeedbackMgr::kPadCount = 2 |
|
staticconstexpr |
The number of controller ports.
The documentation for this class was generated from the following file: