wavelength 1.0.0
Loading...
Searching...
No Matches
system.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstring>
4
5#include "os/timer.h"
6#include "script/dataarray.h"
7
20void SystemInit(int argc, char **argv, const char *pszConfigFile);
21
22#ifdef VIDEO_STANDARD_PAL
34void SystemInitDnas(int argc, char **argv, const char *pszConfigFile);
35#endif
36
44
52
62void SystemSetPadCheck(bool bEnabled);
63
72
82bool UsingCD();
83
91void SetUsingCD(bool bUsingCD);
92
100extern int g_bHostConfig;
101
109const char *GetSystemLanguage();
110
111#ifdef VIDEO_STANDARD_PAL
118inline bool SystemLanguageIsEnglish() {
119 return strcmp("english", GetSystemLanguage()) == 0;
120}
121#endif
122
128extern Timer gSystemTimer;
129
136extern unsigned long long gSystemCycles;
137
148inline float SystemMs() {
149 gSystemTimer.Split();
150 gSystemCycles += gSystemTimer.GetCycles();
151 // Yes, the binary converts the cycle count as a signed value.
152 return static_cast<float>(static_cast<long long>(gSystemCycles)) * gSystemCycles2Ms;
153}
154
163inline unsigned long long SystemCycles() {
164 gSystemTimer.Split();
165 gSystemCycles += gSystemTimer.GetCycles();
166 return gSystemCycles;
167}
Reference-counted array of script data nodes.
Definition dataarray.h:20
Stopwatch on the EE cycle counter.
Definition timer.h:16
float gSystemCycles2Ms
Milliseconds per EE cycle.
void SystemPoll()
Service the operating layer once per frame, controllers included.
void SetUsingCD(bool bUsingCD)
Choose whether files are read from the disc rather than from the host.
float SystemMs()
Report the milliseconds the system clock has measured since it was last reset.
Definition system.h:148
Timer gSystemTimer
The clock SystemMs() reads.
void SystemInit(int argc, char **argv, const char *pszConfigFile)
Bring up the operating layer from the command line and the configuration file.
unsigned long long gSystemCycles
Cycles accumulated across every SystemMs() call since the clock was last reset.
bool UsingCD()
Report whether files are read from the disc rather than from the host.
DataArray * SystemConfig()
Report the configuration SystemInit() read.
const char * GetSystemLanguage()
Report the language the console is set to.
int g_bHostConfig
Non-zero when the host_config command-line option asked for the script files to come from the host.
void SystemSetPadCheck(bool bEnabled)
Turn the periodic controller connection check of SystemPoll() on or off.
unsigned long long SystemCycles()
Report the cycles the system clock has measured since it was last reset.
Definition system.h:163
void SystemTerminate()
Shut down what SystemInit() started, in reverse order, and release the configuration.