|
resonance 1.0.1
|
Abstract owner of the process-wide services. More...
#include <globals.h>

Public Member Functions | |
| Globals () | |
| Clear the service pointers. | |
| virtual | ~Globals () |
| virtual int | Run ()=0 |
| Run the game until it exits. | |
| virtual int | ExitInstance ()=0 |
| Tear the game down as it exits. | |
| void | Init () |
| Create every process-wide service. | |
| void | Shutdown () |
| Destroy every process-wide service. | |
| void | CreateSynth () |
| Create the hardware synth. | |
| void | RunMainLoop () |
| Drive the main loop until it stops. | |
| GameManagerImpl * | GetGameManager () |
| Ps2HardSynth * | GetSynth () |
| Sch::Scheduler * | GetWatchdog () |
| Sch::TimeClock * | GetWatchdogTimer () |
| ScriptSink * | GetScriptSink () |
| IOBPreallocMemStream * | GetLog () |
| IOBPreallocMemStream * | GetResetLog () |
| Rewind the shared log stream and report it. | |
| GrooveWorld * | GetWorld () |
| Report the game manager's world. | |
| MetaGameWorld * | GetMetaWorld () |
| Report the game manager's front-end world. | |
| int | GetUnwrittenValue () |
| Forward GameManagerImpl::GetUnwrittenValue(). | |
| int | GetPlayMode () |
| Report the game manager's play mode. | |
| int | GetGameMode () |
| Report the game manager's game mode. | |
| Sch::TickClock * | GetSongClock () |
| Report the song clock of the game manager's world. | |
| PlayMap * | GetPlayMap () |
| Report the play map of the world's level. | |
| int | IsJukeboxMode () |
| Report whether the session is a jukebox session. | |
| LevelData * | GetLevel () |
| Report the world's level. | |
| int | GetTempo () |
| Report the tempo of the song clock's tempo map. | |
Abstract owner of the process-wide services.
Its RTTI descriptor is at 0x0086f5d0. It has no base. The compiler therefore places the vptr after the seven declared pointers, at +0x1c, and the class is 0x20 bytes. The destructor is declared first and takes vtable slot 1 of the table at 0x007cee78; the two pure virtuals follow it in slots 2 and 3, both pointing at the shared pure-virtual handler.
Application is the only class in the image that derives from it, and the names of the two overrides come from the two exception templates the script layer registers, An exception was thrown by the function Application::Run(). and An exception was thrown by the function Application::ExitInstance().
Init() creates every service and Shutdown() destroys them in the reverse order.
Every service pointer is private. Four of them have an accessor of their own, and foreign code reads those four only through the accessor. A scan of all 420 Application::shared() call sites found exactly one direct access to the returned object, the vptr load in main() that dispatches Run(), so no code outside the class reads any of the seven fields and no Application member reads one either. The accessors are themselves the out-of-line copies of inline members, and dozens of call sites inlined their own copy.
Four further accessors forward into the game manager and are not declared yet: 0x00118ce8, 0x00118d18, 0x00118d70, and 0x00118ec8.
| Globals::Globals | ( | ) |
Clear the service pointers.
The synth and the script sink are not cleared, so Shutdown() tests uninitialised memory when it runs before Init().
|
virtual |
|
pure virtual |
|
pure virtual |
| void Globals::Init | ( | ) |
Create every process-wide service.
| void Globals::Shutdown | ( | ) |
Destroy every process-wide service.
The watchdog is flushed first, then each service is destroyed in the reverse of the order Init() created them. The routine is unreferenced in the NTSC-U/C image. The PAL build calls it from Application::ExitInstance() and does not destroy the synth.
| void Globals::CreateSynth | ( | ) |
Create the hardware synth.
| void Globals::RunMainLoop | ( | ) |
Drive the main loop until it stops.
| GameManagerImpl * Globals::GetGameManager | ( | ) |
| Ps2HardSynth * Globals::GetSynth | ( | ) |
| Sch::Scheduler * Globals::GetWatchdog | ( | ) |
| Sch::TimeClock * Globals::GetWatchdogTimer | ( | ) |
| ScriptSink * Globals::GetScriptSink | ( | ) |
| IOBPreallocMemStream * Globals::GetLog | ( | ) |
| IOBPreallocMemStream * Globals::GetResetLog | ( | ) |
Rewind the shared log stream and report it.
LoadRemixMCT's constructor and MetRemixManager::AsyncCallbackDone() use the rewound stream as the destination of a remix payload. The title is inferred.
| GrooveWorld * Globals::GetWorld | ( | ) |
Report the game manager's world.
Reads mGameManager directly rather than through GetGameManager().
| MetaGameWorld * Globals::GetMetaWorld | ( | ) |
Report the game manager's front-end world.
Reads mGameManager directly rather than through GetGameManager(). Two script commands call it.
| int Globals::GetUnwrittenValue | ( | ) |
Forward GameManagerImpl::GetUnwrittenValue().
Reads mGameManager directly. The image records no caller.
| int Globals::GetPlayMode | ( | ) |
Report the game manager's play mode.
| int Globals::GetGameMode | ( | ) |
Report the game manager's game mode.
| Sch::TickClock * Globals::GetSongClock | ( | ) |
Report the song clock of the game manager's world.
The body composes GetWorld() with GrooveWorld::GetSongClock().
| PlayMap * Globals::GetPlayMap | ( | ) |
Report the play map of the world's level.
The body composes GetWorld() with GrooveWorld::GetPlayMap().
| int Globals::IsJukeboxMode | ( | ) |
Report whether the session is a jukebox session.
| LevelData * Globals::GetLevel | ( | ) |
Report the world's level.
The body composes GetWorld() with GrooveWorld::GetLevel().
| int Globals::GetTempo | ( | ) |
Report the tempo of the song clock's tempo map.
Reads Sch::TempoMap::mMicrosecondsPerQuarter through Sch::TickClock::mTempoMap inline, after a finiteness test of song position 0 whose result is discarded. The title is inferred.