wavelength 1.0.0
Loading...
Searching...
No Matches
system.h File Reference
#include <cstring>
#include "os/timer.h"
#include "script/dataarray.h"
Include dependency graph for system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void SystemInit (int argc, char **argv, const char *pszConfigFile)
 Bring up the operating layer from the command line and the configuration file.
void SystemTerminate ()
 Shut down what SystemInit() started, in reverse order, and release the configuration.
void SystemPoll ()
 Service the operating layer once per frame, controllers included.
void SystemSetPadCheck (bool bEnabled)
 Turn the periodic controller connection check of SystemPoll() on or off.
DataArray * SystemConfig ()
 Report the configuration SystemInit() read.
bool UsingCD ()
 Report whether files are read from the disc rather than from the host.
void SetUsingCD (bool bUsingCD)
 Choose whether files are read from the disc rather than from the host.
const char * GetSystemLanguage ()
 Report the language the console is set to.
float SystemMs ()
 Report the milliseconds the system clock has measured since it was last reset.
unsigned long long SystemCycles ()
 Report the cycles the system clock has measured since it was last reset.

Variables

int g_bHostConfig
 Non-zero when the host_config command-line option asked for the script files to come from the host.
Timer gSystemTimer
 The clock SystemMs() reads.
unsigned long long gSystemCycles
 Cycles accumulated across every SystemMs() call since the clock was last reset.

Function Documentation

◆ SystemInit()

void SystemInit ( int argc,
char ** argv,
const char * pszConfigFile )

Bring up the operating layer from the command line and the configuration file.

The configuration file is read before every other subsystem starts, and the system clock is reset along the way.

Parameters
argcThe argument count main() received.
argvThe argument vector main() received.
pszConfigFileThe configuration file to read, relative to the disc root.
Ghidra address:
NTSC-U/C: 0x0028cb38
Ghidra address:
PAL: 0x002964e8

◆ SystemTerminate()

void SystemTerminate ( )

Shut down what SystemInit() started, in reverse order, and release the configuration.

Ghidra address:
NTSC-U/C: 0x0028ccc8
Ghidra address:
PAL: 0x00296678

◆ SystemPoll()

void SystemPoll ( )

Service the operating layer once per frame, controllers included.

Ghidra address:
NTSC-U/C: 0x0028c560
Ghidra address:
PAL: 0x00295ed0

◆ SystemSetPadCheck()

void SystemSetPadCheck ( bool bEnabled)

Turn the periodic controller connection check of SystemPoll() on or off.

The name is inferred.

Parameters
bEnabledWhether SystemPoll() checks which controllers are connected.
Ghidra address:
NTSC-U/C: 0x0028c4c0
Ghidra address:
PAL: 0x00295e10

◆ SystemConfig()

DataArray * SystemConfig ( )

Report the configuration SystemInit() read.

Returns
The root of the configuration.
Ghidra address:
NTSC-U/C: 0x0028c6a0
Ghidra address:
PAL: 0x00296028

◆ UsingCD()

bool UsingCD ( )

Report whether files are read from the disc rather than from the host.

In the PAL build the ignore_cd command line option has the host reported.

Returns
Whether files come from the disc.
Ghidra address:
NTSC-U/C: 0x0028c5a8
Ghidra address:
PAL: 0x00295f18

◆ SetUsingCD()

void SetUsingCD ( bool bUsingCD)

Choose whether files are read from the disc rather than from the host.

Parameters
bUsingCDWhether files come from the disc.
Ghidra address:
NTSC-U/C: 0x0028c5b8
Ghidra address:
PAL: 0x00295f40

◆ GetSystemLanguage()

const char * GetSystemLanguage ( )

Report the language the console is set to.

Returns
The language key, for example "english".
Ghidra address:
NTSC-U/C: 0x0028caf8
Ghidra address:
PAL: 0x002964a8

◆ SystemMs()

float SystemMs ( )
inline

Report the milliseconds the system clock has measured since it was last reset.

The body is here rather than in a source file because the engine expands it inline at most call sites. The address is the one out-of-line copy.

Returns
The elapsed milliseconds.
Ghidra address:
NTSC-U/C: 0x001afae0
Ghidra address:
PAL: 0x001b8880

◆ SystemCycles()

unsigned long long SystemCycles ( )
inline

Report the cycles the system clock has measured since it was last reset.

Every caller expands the body inline, so the image has no out-of-line copy. The name is inferred.

Returns
The elapsed cycles.

Variable Documentation

◆ g_bHostConfig

int g_bHostConfig
extern

Non-zero when the host_config command-line option asked for the script files to come from the host.

Ghidra address:
NTSC-U/C: 0x003b2234
Ghidra address:
PAL: 0x00431108

◆ gSystemTimer

Timer gSystemTimer
extern

The clock SystemMs() reads.

Ghidra address:
NTSC-U/C: 0x00491a10

◆ gSystemCycles

unsigned long long gSystemCycles
extern

Cycles accumulated across every SystemMs() call since the clock was last reset.

Ghidra address:
NTSC-U/C: 0x003b2260
Ghidra address:
PAL: 0x00431140