OldSchool Library
Dialogs

Functions to display Sony's dialogs. More...

Macros

#define OSL_DIALOG_CANCEL   1
 Dialog result indicating the user canceled the dialog.
 
#define OSL_DIALOG_OK   0
 Dialog result indicating the user confirmed the dialog.
 
#define OSL_DIALOG_NONE   0
 No dialog is currently active.
 
#define OSL_DIALOG_MESSAGE   1
 Message dialog type.
 
#define OSL_DIALOG_ERROR   2
 Error dialog type.
 
#define OSL_DIALOG_NETCONF   3
 Network configuration dialog type.
 
#define OSL_DIALOG_OSK   4
 On-screen keyboard dialog type.
 
#define OSL_DIALOG_SAVELOAD   5
 Save/Load dialog type.
 
#define OSL_DIALOG_BROWSER   6
 Browser dialog type.
 
#define OSL_DIALOG_STATUS_NONE   PSP_UTILITY_DIALOG_NONE
 No dialog is currently active.
 
#define OSL_DIALOG_STATUS_INIT   PSP_UTILITY_DIALOG_INIT
 The dialog is currently being initialized.
 
#define OSL_DIALOG_STATUS_VISIBLE   PSP_UTILITY_DIALOG_VISIBLE
 The dialog is visible and ready for use.
 
#define OSL_DIALOG_STATUS_QUIT   PSP_UTILITY_DIALOG_QUIT
 The dialog has been canceled and should be shut down.
 
#define OSL_DIALOG_STATUS_FINISHED   PSP_UTILITY_DIALOG_FINISHED
 The dialog has successfully shut down.
 

Functions

int oslDialogDrawAndWait (int dialogType)
 Universal routine which draws the current dialog (of the given dialog type) and waits for the user to finish interacting with it.
 
int oslDialogIsActive ()
 Tests whether any of the ERROR, MESSAGE, or NETCONF dialogs is currently active.
 
int oslInitMessageDialog (const char *message, int enableYesno)
 Initializes a Message Dialog.
 
int oslInitErrorDialog (const unsigned int error)
 Initializes an Error Dialog.
 
void oslDrawDialog ()
 Draws the current dialog to the screen.
 
int oslGetDialogType ()
 Returns the current dialog type.
 
int oslGetDialogStatus ()
 Returns the current dialog status.
 
int oslGetDialogButtonPressed ()
 Returns the button pressed in the dialog (only for message dialogs with enableYesno == 1).
 
int oslInitNetDialog ()
 Initializes the network configuration dialog.
 
int oslDialogGetResult ()
 Gets the dialog result (either OSL_DIALOG_CANCEL or OSL_DIALOG_OK).
 
void oslEndDialog ()
 Ends the current dialog.
 

Detailed Description

Functions to display Sony's dialogs.

This module provides various functions and definitions for handling Sony's PSP dialogs, such as message dialogs, error dialogs, and network configuration dialogs.

Function Documentation

◆ oslDialogDrawAndWait()

int oslDialogDrawAndWait ( int dialogType)

Universal routine which draws the current dialog (of the given dialog type) and waits for the user to finish interacting with it.

Parameters
dialogTypeThe type of dialog to be drawn.
Returns
int Returns 0 on success, or an error code (<0) on failure.

◆ oslDialogIsActive()

int oslDialogIsActive ( )

Tests whether any of the ERROR, MESSAGE, or NETCONF dialogs is currently active.

Returns
int Returns 1 if a dialog is active, or 0 if no dialog is active.

◆ oslInitMessageDialog()

int oslInitMessageDialog ( const char * message,
int enableYesno )

Initializes a Message Dialog.

Parameters
messageText shown in the message dialog.
enableYesnoIf set to 1, the dialog will have Yes/No options.
Returns
int Returns 0 on success, or an error code (<0) on failure.

◆ oslInitErrorDialog()

int oslInitErrorDialog ( const unsigned int error)

Initializes an Error Dialog.

Parameters
errorError code to be displayed in the dialog.
Returns
int Returns 0 on success, or an error code (<0) on failure.

◆ oslDrawDialog()

void oslDrawDialog ( )

Draws the current dialog to the screen.

After drawing, check if the user has closed it by calling oslGetDialogStatus. If the dialog is closed, remember to call oslEndDialog.

if (oslGetDialogStatus() == PSP_UTILITY_DIALOG_NONE){
// The user closed the dialog
}
int oslGetDialogStatus()
Returns the current dialog status.
void oslDrawDialog()
Draws the current dialog to the screen.
void oslEndDialog()
Ends the current dialog.

◆ oslGetDialogType()

int oslGetDialogType ( )

Returns the current dialog type.

Returns
int The type of the current dialog.

◆ oslGetDialogStatus()

int oslGetDialogStatus ( )

Returns the current dialog status.

Returns
int The status of the current dialog.

◆ oslGetDialogButtonPressed()

int oslGetDialogButtonPressed ( )

Returns the button pressed in the dialog (only for message dialogs with enableYesno == 1).

Returns
int The button pressed (e.g., OSL_DIALOG_OK or OSL_DIALOG_CANCEL).

◆ oslInitNetDialog()

int oslInitNetDialog ( )

Initializes the network configuration dialog.

Returns
int Returns 0 on success, or an error code (<0) on failure.

◆ oslDialogGetResult()

int oslDialogGetResult ( )

Gets the dialog result (either OSL_DIALOG_CANCEL or OSL_DIALOG_OK).

Returns
int The result of the dialog.