|
coastline 0.0.4
|
The ghost recording a race replays. More...
#include <PR/ultratypes.h>#include "common/input.h"#include "common/recordingformat.h"#include "common/rle.h"#include "common/vehicle.h"#include "common/vehiclemodel.h"
Go to the source code of this file.
Classes | |
| struct | LastLapBuffer |
| The last lap of a player: the input of each local player over it, and a snapshot of the race at its start, which the instant replay plays from. More... | |
| struct | SaveField |
| A block of variables a snapshot saves, in a list ending in a NULL block. More... | |
Macros | |
| #define | ROM_GHOST_RECORDING ((u32)_ghostRecordingSegmentRomStart) |
| The cartridge offset of the ghost recording, which the race after the splash screens replays. | |
| #define | RECORDING_CAPACITY 0xDE5C |
| The size of the buffer a player's input is recorded into. | |
| #define | LAST_LAP_RECORDING_SIZE 0x3840 |
| The bytes of the recording of each local player's input over the last lap. | |
| #define | g_aLastLapBuffers ((LastLapBuffer *)g_aVehicleModels) |
| Last-lap buffers share vehicle-model storage and descend through slots by local-player index. | |
| #define | LAST_LAP_FIRST_SLOT 3 |
| The slot of g_aLastLapBuffers of the first player; the others count down from it. | |
| #define | PAUSED_CLOCK_STATE_SIZE 0x40 |
| The bytes of the paused clock state. | |
Functions | |
| s32 | SerializeSaveData (SaveField *fields, u8 *buffer, s32 capacity, s32 offset) |
| Copy the variables of a list one after another into a buffer, and report when they overflow it. | |
| s32 | DeserializeSaveData (SaveField *fields, u8 *buffer, s32 offset) |
| Copy the variables of a list back from a buffer SerializeSaveData() filled. | |
| void | SaveRaceSnapshot (LastLapBuffer *buffer) |
| Take a snapshot of the race into the buffer of a last lap. | |
| void | RestoreRaceSnapshot (LastLapBuffer *buffer) |
| Restore the state of the race from a snapshot SaveLastLapSnapshot() took. | |
| void | SaveLastLapSnapshot (Vehicle *vehicle) |
| At the start of the last lap, give each local player a buffer to record the lap into and take a snapshot of the race, which the instant replay starts from. | |
| void | RestoreReplayKeyframeState (void) |
| In the demo, restore the race from a keyframe when the recording of the first vehicle reaches one, then place the trackside camera of the first vehicle anew. | |
Variables | |
| u8 | g_abGhostRecording [] |
| The recorded input of the ghost. | |
| u32 | g_dwGhostRecordingSize |
| The bytes of g_abGhostRecording in use. | |
| u8 | g_abPlaybackRecording [] |
| The buffer the recording a race replays is copied to. | |
| u8 | g_aabInputRecordings [][0xF000] |
| The buffers the input of each local player is recorded into, 0xF000 bytes apart. | |
| s32 | g_dwBestReplayLength |
| The player whose recording the instant replay plays, and the length of that recording. | |
| s32 | g_dwBestReplayPlayer |
| The player whose recording the instant replay plays. | |
| u8 * | g_apReplayGhostPtrs [] |
| The recordings the instant replay gives each local player, and their lengths. | |
| s32 | g_adwReplayGhostSizes [] |
| The lengths of the instant replay recordings of the local players, in bytes. | |
| SaveField | g_aRaceSnapshotFields [] |
| The variables a snapshot of the race saves: the vehicles, the racers, the clocks, the sounds and more. | |
| SaveField | g_aPausedClockFields [] |
| The random seed and the clocks a pause keeps. | |
| u8 | g_abPausedClockState [PAUSED_CLOCK_STATE_SIZE] |
| Where a pause keeps them. | |
| s32 | g_dwReplayKeyframeFrameCount |
| The frames RestoreReplayKeyframeState() has run. | |
| SaveField | g_aReplayKeyframeDescTable1 [] |
| The variables a keyframe of the recording of the demo restores, in the order of the keyframe. | |
| SaveField | g_aReplayKeyframeDescTable2 [] |
| The second group of variables restored from a demo keyframe. | |
| SaveField | g_aReplayKeyframeDescTable3 [] |
| The third group of variables restored from a demo keyframe. | |
The ghost recording a race replays.
| #define ROM_GHOST_RECORDING ((u32)_ghostRecordingSegmentRomStart) |
The cartridge offset of the ghost recording, which the race after the splash screens replays.
| #define RECORDING_CAPACITY 0xDE5C |
The size of the buffer a player's input is recorded into.
| #define LAST_LAP_RECORDING_SIZE 0x3840 |
The bytes of the recording of each local player's input over the last lap.
| #define g_aLastLapBuffers ((LastLapBuffer *)g_aVehicleModels) |
Last-lap buffers share vehicle-model storage and descend through slots by local-player index.
| #define LAST_LAP_FIRST_SLOT 3 |
The slot of g_aLastLapBuffers of the first player; the others count down from it.
| #define PAUSED_CLOCK_STATE_SIZE 0x40 |
The bytes of the paused clock state.
Copy the variables of a list one after another into a buffer, and report when they overflow it.
| fields | The list of variables. |
| buffer | The buffer. |
| capacity | The size of the buffer in bytes. |
| offset | The bytes past the start of each variable to copy from. |
Copy the variables of a list back from a buffer SerializeSaveData() filled.
| fields | The list of variables. |
| buffer | The buffer. |
| offset | The bytes past the start of each variable to copy to. |
| void SaveRaceSnapshot | ( | LastLapBuffer * | buffer | ) |
Take a snapshot of the race into the buffer of a last lap.
| buffer | The buffer of the last lap. |
| void RestoreRaceSnapshot | ( | LastLapBuffer * | buffer | ) |
Restore the state of the race from a snapshot SaveLastLapSnapshot() took.
| buffer | The buffer of the last lap holding the snapshot. |
| void SaveLastLapSnapshot | ( | Vehicle * | vehicle | ) |
At the start of the last lap, give each local player a buffer to record the lap into and take a snapshot of the race, which the instant replay starts from.
| vehicle | The vehicle that reached the lap. |
| void RestoreReplayKeyframeState | ( | void | ) |
In the demo, restore the race from a keyframe when the recording of the first vehicle reaches one, then place the trackside camera of the first vehicle anew.
|
extern |
The recorded input of the ghost.
A Controller Pak or the cartridge fills it.
|
extern |
The bytes of g_abGhostRecording in use.
|
extern |
The buffer the recording a race replays is copied to.
The link script places it, below the frame buffers.
|
extern |
The buffers the input of each local player is recorded into, 0xF000 bytes apart.
The link script places them, below and over the frame buffers.
|
extern |
The player whose recording the instant replay plays, and the length of that recording.
|
extern |
The player whose recording the instant replay plays.
|
extern |
The recordings the instant replay gives each local player, and their lengths.
|
extern |
The lengths of the instant replay recordings of the local players, in bytes.
|
extern |
The variables a snapshot of the race saves: the vehicles, the racers, the clocks, the sounds and more.
|
extern |
The random seed and the clocks a pause keeps.
|
extern |
Where a pause keeps them.
|
extern |
The frames RestoreReplayKeyframeState() has run.
|
extern |
The variables a keyframe of the recording of the demo restores, in the order of the keyframe.
|
extern |
The second group of variables restored from a demo keyframe.
|
extern |
The third group of variables restored from a demo keyframe.