|
coastline 0.0.4
|
The input of each player, the cheat codes, and the translation of controller data. More...
#include <PR/os_cont.h>#include <PR/ultratypes.h>#include "common/game.h"#include "common/playerinput.h"

Go to the source code of this file.
Classes | |
| struct | CheatCode |
| A cheat: the sequence of button changes that applies it, newest first, ending in 0xFFFF. More... | |
Macros | |
| #define | INPUT_RIGHT 0x0001 |
| #define | INPUT_DOWN 0x0002 |
| #define | INPUT_LEFT 0x0004 |
| #define | INPUT_UP 0x0008 |
| #define | INPUT_A 0x0010 |
| #define | INPUT_B 0x0020 |
| #define | INPUT_C_UP 0x0100 |
| #define | INPUT_C_RIGHT 0x0200 |
| #define | INPUT_C_DOWN 0x0400 |
| #define | INPUT_C_LEFT 0x0800 |
| #define | INPUT_L 0x1000 |
| #define | INPUT_R 0x2000 |
| #define | INPUT_START 0x4000 |
| #define | INPUT_Z 0x8000 |
| #define | INPUT_ACCELERATE 0x00010000 |
| #define | INPUT_REVERSE 0x00020000 |
| #define | INPUT_BRAKE 0x00040000 |
| #define | INPUT_EBRAKE 0x00080000 |
| #define | INPUT_GEAR_UP 0x00100000 |
| #define | INPUT_GEAR_DOWN 0x00200000 |
| #define | INPUT_VIEW_COCKPIT 0x01000000 |
| #define | INPUT_VIEW_TRACKSIDE 0x02000000 |
| #define | INPUT_VIEW_CHASE 0x04000000 |
| #define | INPUT_VIEW_BUMPER 0x08000000 |
| #define | INPUT_VIEWS 0x0F000000 |
| #define | INPUT_RECORDED_ACTIONS 0x003F0000 |
| The actions a recording keeps, with the steering. | |
| #define | CONTROLLER_LAYOUTS 5 |
| The button layouts of the controller screen. | |
Functions | |
| void | CheatToggleRamView (void) |
| Toggle the view of memory. | |
| void | CheatFinishRace (void) |
| Request that the race finish. | |
| void | CheatUnlockTracks0To4 (void) |
| Unlock the first five tracks. | |
| void | CheatUnlockCars0To8 (void) |
| Unlock the first nine cars. | |
| void | CheatSetUnlockBit200 (void) |
| Set bit 9 of the unlocks of the profile. | |
| void | CheatSetUnlockBit1000 (void) |
| Set bit 12 of the unlocks of the profile. | |
| void | CheatSetUnlockBit800 (void) |
| Set bit 11 of the unlocks of the profile. | |
| void | CheatSetUnlockBit400 (void) |
| Set bit 10 of the unlocks of the profile. | |
| void | CheatUnlockTracks5To9 (void) |
| Unlock tracks 5 to 9. | |
| void | CheatSetUnlockBit8000 (void) |
| Set bit 15 of the unlocks of the profile. | |
| void | CheatToggleMultiplayerMode (void) |
| Toggle the multiplayer mode selected by the cheat sequence. | |
| void | CheatToggleBilinearFilter (void) |
| Toggle bilinear texture filtering selected by the cheat sequence. | |
| void | ProcessInputCommandBuffer (PlayerInputState *state) |
| Remember a change of the buttons and apply each cheat whose sequence the latest changes match. | |
| void | TranslateControllerInput (PlayerInputState *state) |
| Read the pad of a player into buttons, race actions for the button layout, and the stick, record the input or replay a recording in its place, and check the cheats. | |
| void | CheckAnalogStickPositive (PlayerInputState *state, s32 *timer, f32 *axis, u32 button) |
| Press a direction when a stick axis passes 0.6, then again after half a second and every 0.2 seconds while the axis stays above 0.3. | |
| void | CheckAnalogStickNegative (PlayerInputState *state, s32 *timer, f32 *axis, u32 button) |
| The same as CheckAnalogStickPositive() for the negative side of an axis. | |
| void | UpdateStickRepeat (PlayerInputState *state) |
| Press the directions of the stick with repeat, as the menus read them. | |
| void | StartControllerRead (void) |
| Start a read of the controllers, unless one is already pending. | |
| void | ReadControllers (void) |
| Wait for a read of the controllers, starting one if none is pending, and fill the pads. | |
| void | UpdateControllerState (void) |
| Read the controllers and turn their state into the input of the players. | |
| void | InitControllersAndPaks (void) |
| Probe the controllers and the Controller and Rumble Paks, running the controller check until each warning is dismissed and the Controller Pak menu while the first player holds start. | |
Variables | |
| CheatCode | g_aCheatCodes [] |
| The cheats, ending with a NULL sequence. | |
| s32 | g_bShowDepthBuffer |
| Whether each frame shows the depth buffer, at the start of memory, in place of the picture. | |
| s32 | g_dwMultiplayerMode |
| Whether the credits race scrolls the credits rather than displaying captions. | |
| s32 | g_bBilinearFiltering |
| Whether textures are filtered. | |
| s32 | g_dwCheatFinishRacePending |
| Set by CheatFinishRace() to finish the race. | |
| s32 | g_dwContReadPending |
| Whether a read of the controllers is started and not yet received. | |
| u8 | g_bPakPort0Initialized |
| Whether InitControllersAndPaks() has mounted the Controller Pak of the first controller. | |
The input of each player, the cheat codes, and the translation of controller data.
| #define INPUT_RIGHT 0x0001 |
The right of the directional pad or the stick.
| #define INPUT_DOWN 0x0002 |
The down of the directional pad or the stick.
| #define INPUT_LEFT 0x0004 |
The left of the directional pad or the stick.
| #define INPUT_UP 0x0008 |
The up of the directional pad or the stick.
| #define INPUT_A 0x0010 |
The A button.
| #define INPUT_B 0x0020 |
The B button.
| #define INPUT_C_UP 0x0100 |
The up C button.
| #define INPUT_C_RIGHT 0x0200 |
The right C button.
| #define INPUT_C_DOWN 0x0400 |
The down C button.
| #define INPUT_C_LEFT 0x0800 |
The left C button.
| #define INPUT_L 0x1000 |
The L trigger.
| #define INPUT_R 0x2000 |
The R trigger.
| #define INPUT_START 0x4000 |
The Start button.
| #define INPUT_Z 0x8000 |
The Z trigger.
| #define INPUT_ACCELERATE 0x00010000 |
Accelerate.
| #define INPUT_REVERSE 0x00020000 |
Drive in reverse.
| #define INPUT_BRAKE 0x00040000 |
Brake.
| #define INPUT_EBRAKE 0x00080000 |
Pull the handbrake.
| #define INPUT_GEAR_UP 0x00100000 |
Shift up a gear.
| #define INPUT_GEAR_DOWN 0x00200000 |
Shift down a gear.
| #define INPUT_VIEW_COCKPIT 0x01000000 |
Choose the view from the cockpit.
| #define INPUT_VIEW_TRACKSIDE 0x02000000 |
Choose the trackside camera.
| #define INPUT_VIEW_CHASE 0x04000000 |
Choose the chase camera.
| #define INPUT_VIEW_BUMPER 0x08000000 |
Choose the view from the bumper.
| #define INPUT_VIEWS 0x0F000000 |
Every bit that chooses a view.
| #define INPUT_RECORDED_ACTIONS 0x003F0000 |
The actions a recording keeps, with the steering.
| #define CONTROLLER_LAYOUTS 5 |
The button layouts of the controller screen.
| void CheatToggleRamView | ( | void | ) |
Toggle the view of memory.
| void CheatFinishRace | ( | void | ) |
Request that the race finish.
| void CheatUnlockTracks0To4 | ( | void | ) |
Unlock the first five tracks.
| void CheatUnlockCars0To8 | ( | void | ) |
Unlock the first nine cars.
| void CheatSetUnlockBit200 | ( | void | ) |
Set bit 9 of the unlocks of the profile.
| void CheatSetUnlockBit1000 | ( | void | ) |
Set bit 12 of the unlocks of the profile.
| void CheatSetUnlockBit800 | ( | void | ) |
Set bit 11 of the unlocks of the profile.
| void CheatSetUnlockBit400 | ( | void | ) |
Set bit 10 of the unlocks of the profile.
| void CheatUnlockTracks5To9 | ( | void | ) |
Unlock tracks 5 to 9.
| void CheatSetUnlockBit8000 | ( | void | ) |
Set bit 15 of the unlocks of the profile.
| void CheatToggleMultiplayerMode | ( | void | ) |
Toggle the multiplayer mode selected by the cheat sequence.
| void CheatToggleBilinearFilter | ( | void | ) |
Toggle bilinear texture filtering selected by the cheat sequence.
| void ProcessInputCommandBuffer | ( | PlayerInputState * | state | ) |
Remember a change of the buttons and apply each cheat whose sequence the latest changes match.
| state | The input of the player. |
| void TranslateControllerInput | ( | PlayerInputState * | state | ) |
Read the pad of a player into buttons, race actions for the button layout, and the stick, record the input or replay a recording in its place, and check the cheats.
| state | The input of the player. |
| void CheckAnalogStickPositive | ( | PlayerInputState * | state, |
| s32 * | timer, | ||
| f32 * | axis, | ||
| u32 | button ) |
Press a direction when a stick axis passes 0.6, then again after half a second and every 0.2 seconds while the axis stays above 0.3.
| state | The input of the player. |
| timer | The time to the next repeat in milliseconds, 0 while the axis is released. |
| axis | The position of the axis, from -1 to 1. |
| button | The direction to press. |
| void CheckAnalogStickNegative | ( | PlayerInputState * | state, |
| s32 * | timer, | ||
| f32 * | axis, | ||
| u32 | button ) |
The same as CheckAnalogStickPositive() for the negative side of an axis.
| state | The input of the player. |
| timer | The time to the next repeat in milliseconds, 0 while the axis is released. |
| axis | The position of the axis, from -1 to 1. |
| button | The direction to press. |
| void UpdateStickRepeat | ( | PlayerInputState * | state | ) |
Press the directions of the stick with repeat, as the menus read them.
| state | The input of the player. |
| void StartControllerRead | ( | void | ) |
Start a read of the controllers, unless one is already pending.
| void ReadControllers | ( | void | ) |
Wait for a read of the controllers, starting one if none is pending, and fill the pads.
| void UpdateControllerState | ( | void | ) |
Read the controllers and turn their state into the input of the players.
| void InitControllersAndPaks | ( | void | ) |
Probe the controllers and the Controller and Rumble Paks, running the controller check until each warning is dismissed and the Controller Pak menu while the first player holds start.
The Windows routine returns without probing controllers.
|
extern |
The cheats, ending with a NULL sequence.
|
extern |
Whether each frame shows the depth buffer, at the start of memory, in place of the picture.
|
extern |
Whether the credits race scrolls the credits rather than displaying captions.
|
extern |
Whether textures are filtered.
|
extern |
Set by CheatFinishRace() to finish the race.
|
extern |
Whether a read of the controllers is started and not yet received.
|
extern |
Whether InitControllersAndPaks() has mounted the Controller Pak of the first controller.