ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::TitleRuntime Class Referencefinal

#include <rex/kernel/title_runtime.h>

Inheritance diagram for rex::kernel::TitleRuntime:
[legend]

Public Member Functions

 TitleRuntime (const ppc::PPCImage &image)
 ~TitleRuntime ()
Result< void > Load ()
Result< void > Launch ()
void Unload ()
bool IsLoaded () const
bool IsRunning () const
u32 GetTitleID () const
std::unique_ptr< rex::filesystem::IXDBFTitleData > GetTitleXDBF () const
rex::kernel::XLanguage GetUserLanguage () const
void SetAudioPaused (bool paused)
bool IsAudioPaused () const
rex::ScopeGuard OnTitleExit (rex::MoveOnlyFunction< void(TitleExitReason)> callback)
GuestMemory & GetGuestMemory () const
kernel::IModuleRegistry & GetModuleRegistry ()
rex::xam::IContentManager & GetContentManager ()
rex::xam::IAchievementManager & GetAchievementManager ()
kernel::IObjectTable & GetObjectTable ()
kernel::IThreadRegistry & GetThreadRegistry ()
kernel::ISystemHeap & GetGuestHeap ()
kernel::ITitleWorkspace & GetGuestWorkspace ()
rex::memory::GuestMembase GetMembase ()
kernel::ITitleExit & GetTitleExit ()
kernel::INotificationBroadcaster & GetNotificationBroadcaster ()
filesystem::IFileSystem & GetFileSystem ()
Result<::PPCFunc * > FindFunction (u32 address) const
TitlePaths & GetTitlePaths ()
RuntimeSettings & GetRuntimeSettings ()
KernelSettings & GetKernelSettings () const

Friends

TitleState & StateOf (const TitleRuntime &runtime)

Additional Inherited Members

Protected Member Functions inherited from rex::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete

Detailed Description

Load maps guest memory and reads the image. Launch attaches the title to the graphics, UI, input and audio systems of an App and starts the main thread. Unload undoes both, so Load and Launch may run again. Tools call Load only. Only one TitleRuntime is loaded at a time.

The service accessors are valid from Load until Unload.

Constructor & Destructor Documentation

◆ TitleRuntime()

rex::kernel::TitleRuntime::TitleRuntime ( const ppc::PPCImage & image)
explicit

Creates an unloaded runtime.

Parameters
imageThe recompiled image the codegen header declares.

◆ ~TitleRuntime()

rex::kernel::TitleRuntime::~TitleRuntime ( )

Unloads the title when it is loaded.

Member Function Documentation

◆ FindFunction()

Result<::PPCFunc * > rex::kernel::TitleRuntime::FindFunction ( u32 address) const
nodiscard

Finds the recompiled function registered at a guest address.

Returns
The function, valid from Load until Unload, or kNotFound when none is registered at the address.

◆ GetKernelSettings()

KernelSettings & rex::kernel::TitleRuntime::GetKernelSettings ( ) const
Returns
The settings, scope "kernel".

◆ GetMembase()

rex::memory::GuestMembase rex::kernel::TitleRuntime::GetMembase ( )

Returns the host base of the title guest memory. It is valid from Load until Unload.

◆ GetRuntimeSettings()

RuntimeSettings & rex::kernel::TitleRuntime::GetRuntimeSettings ( )
Returns
The settings, scope "runtime".

◆ GetTitleID()

u32 rex::kernel::TitleRuntime::GetTitleID ( ) const
Returns
The ID from the image, 0 when not loaded.

◆ GetTitlePaths()

TitlePaths & rex::kernel::TitleRuntime::GetTitlePaths ( )
Returns
The settings, scope "title".

◆ GetTitleXDBF()

std::unique_ptr< rex::filesystem::IXDBFTitleData > rex::kernel::TitleRuntime::GetTitleXDBF ( ) const
nodiscard

Returns the XDBF data of the executable, which reports invalid when the executable has no XDBF section.

◆ GetUserLanguage()

rex::kernel::XLanguage rex::kernel::TitleRuntime::GetUserLanguage ( ) const

Returns the language the kernel reports. English before Load.

◆ IsLoaded()

bool rex::kernel::TitleRuntime::IsLoaded ( ) const
Returns
True between Load and Unload.

◆ IsRunning()

bool rex::kernel::TitleRuntime::IsRunning ( ) const
Returns
True between Launch and Unload.

◆ Launch()

Result< void > rex::kernel::TitleRuntime::Launch ( )
nodiscard

Attaches the title to the graphics, UI, input and audio systems of the app, freezes the settings that cannot change after launch and starts the main thread.

Returns
Ok, or an error. The runtime is unloaded after an error.

◆ Load()

Result< void > rex::kernel::TitleRuntime::Load ( )
nodiscard

Maps guest memory and loads default.xex, its modules, and its content and achievement data.

Returns
Ok, or an error. Nothing stays mapped on an error.

◆ OnTitleExit()

rex::ScopeGuard rex::kernel::TitleRuntime::OnTitleExit ( rex::MoveOnlyFunction< void(TitleExitReason)> callback)
nodiscard

Sets the function called on the thread that exited the title.

Parameters
callbackFunction receiving the reason. A new callback replaces the earlier one.
Returns
The guard. Destroying it removes the callback. It must not be destroyed from inside the callback.

◆ SetAudioPaused()

void rex::kernel::TitleRuntime::SetAudioPaused ( bool paused)

Parks or resumes the audio worker and the XMA decoder.

Parameters
pausedTrue to park.

◆ Unload()

void rex::kernel::TitleRuntime::Unload ( )

Ends every guest thread, saves content and frees guest memory. Does nothing when not loaded. After Launch it must run on the UI thread.


The documentation for this class was generated from the following file: