General routines to initialize and terminate the library.
More...
|
void | oslInit (int flags) |
| Initializes the library.
|
|
void | oslQuit () |
| Exits the application immediately.
|
|
void | oslHandleLoadNoFailError (const char *filename) |
| Handles errors when a file fails to load in "no fail" mode.
|
|
|
int | osl_intraInit |
| Indicates if the internal initialization process of OSLib is complete.
|
|
int | osl_noFail |
| Controls the "no fail" mode in OSLib.
|
|
void(* | osl_noFailCallback )(const char *filename, u32 reserved) |
| Pointer to the callback function used when a file load operation fails in "no fail" mode.
|
|
General routines to initialize and terminate the library.
These functions are responsible for setting up and tearing down the OSLib environment. Initialization typically involves configuring system settings and allocating necessary resources, while termination handles cleanup and resource deallocation.
◆ oslSetQuitOnLoadFailure
#define oslSetQuitOnLoadFailure |
( |
| enabled | ) |
|
Value:
int osl_noFail
Controls the "no fail" mode in OSLib.
Sets the "no fail" mode.
In this mode, if OSLib cannot load a file (for example, an image), it will display a message indicating the name of the missing file and then quit immediately.
- Parameters
-
enabled | Enables or disables the no-fail feature. |
◆ oslSetQuitOnLoadFailureCallback
#define oslSetQuitOnLoadFailureCallback |
( |
| function | ) |
|
Value:
void(* osl_noFailCallback)(const char *filename, u32 reserved)
Pointer to the callback function used when a file load operation fails in "no fail" mode.
Sets the function to call in case of failure to load something.
The default behavior is to display a message box. This function allows you to override that behavior with your custom function.
- Parameters
-
function | Function pointer to be called on load failure. |
◆ oslSetExitCallback
#define oslSetExitCallback |
( |
| function | ) |
|
Value:
int(* osl_exitCallback)(int arg1, int arg2, void *common)
Pointer to the exit callback function.
Sets an exit callback.
This function is executed when the user chooses "Exit" from the HOME menu. By default, this callback sets osl_quit to true, indicating that the application should quit. You can provide your custom callback function to handle the exit process.
- Parameters
-
function | Function pointer to be executed as the exit callback. |
◆ OSL_INITFLAGS
Flags for oslInit function.
These flags control specific aspects of the initialization process.
Enumerator |
---|
OSL_IF_USEOWNCALLBACKS | Do not set up the standard callbacks. You'll have to provide them by yourself as shown in almost all PSPSDK samples.
|
OSL_IF_NOVBLANKIRQ | Do not reserve the VBLANK IRQ. You should set up your own VBL handler, which should call oslVblankNextFrame() if osl_vblankCounterActive is TRUE, else oslSyncFrame(Ex) will not work properly.
|
◆ oslInit()
void oslInit |
( |
int | flags | ) |
|
|
extern |
Initializes the library.
This function initializes the OSLib environment. The flags parameter is used to control specific initialization options, which are primarily intended for advanced users.
- Parameters
-
flags | Can be formed of one or more of the values from the OSL_INITFLAGS enumeration (ORed together). |
◆ oslQuit()
Exits the application immediately.
This function terminates the application and returns to the XMB (PSP main menu) or to the calling application (e.g., IRShell).
◆ oslHandleLoadNoFailError()
void oslHandleLoadNoFailError |
( |
const char * | filename | ) |
|
|
extern |
Handles errors when a file fails to load in "no fail" mode.
This function is called internally by OSLib when a file fails to load and "no fail" mode is enabled. It invokes the callback function specified by osl_noFailCallback
if one is set, or displays a default error message and quits the application.
- Parameters
-
filename | The name of the file that failed to load. |
◆ osl_intraInit
Indicates if the internal initialization process of OSLib is complete.
This variable is used internally by OSLib to track the state of the library's initialization. It is set to 1 when the initialization is complete and 0 otherwise.
◆ osl_noFail
Controls the "no fail" mode in OSLib.
This variable is used to enable or disable the "no fail" mode, which automatically quits the application with an error message if a file cannot be loaded.
- 0: "No fail" mode is disabled.
- 1: "No fail" mode is enabled.
◆ osl_noFailCallback
void(* osl_noFailCallback) (const char *filename, u32 reserved) |
( |
const char * | filename, |
|
|
u32 | reserved ) |
|
extern |
Pointer to the callback function used when a file load operation fails in "no fail" mode.
This function is called whenever a file fails to load while "no fail" mode is enabled. The callback function receives the name of the file that failed to load and a reserved parameter that can be used for additional context.
- Parameters
-
filename | The name of the file that failed to load. |
reserved | Reserved parameter for additional context (usually not used). |