Synchronization routines for your game.
More...
|
void | oslEndFrame () |
| Call this function when a frame has ended.
|
|
int | oslSyncFrameEx (int frameskip, int max_frameskip, int vsync) |
| Synchronization function with explicit parameters.
|
|
void | oslWaitVSync () |
| Waits for the VSync, synchronizing your game.
|
|
Synchronization routines for your game.
These functions are used to synchronize the game's frame rate and ensure smooth rendering and input handling. They include functions for managing frame skipping and VSync.
◆ oslSetFrameskip
#define oslSetFrameskip |
( |
| val | ) |
|
Value:
int osl_frameskip
Current frameskip setting.
Sets the current fixed frameskipping value.
- Parameters
-
val | 1 enables auto frameskip, 2 or more enables fixed skipping (val-1 frames out of val are skipped). |
◆ oslSetMaxFrameskip
#define oslSetMaxFrameskip |
( |
| val | ) |
|
Value:
int osl_maxFrameskip
Maximum allowed frameskip value.
Sets the maximum frameskip value.
- Parameters
-
val | Maximum frameskip value. |
◆ oslSetVSync
#define oslSetVSync |
( |
| val | ) |
|
Value:
int osl_vsyncEnabled
Indicates whether VSync is enabled.
Sets the VSync parameter.
- Parameters
-
val | VSync parameter value. |
◆ oslSyncFrame
Value:
int oslSyncFrameEx(int frameskip, int max_frameskip, int vsync)
Synchronization function with explicit parameters.
Synchronization function to be called at the end of a frame.
This function synchronizes the frame rate based on the current frameskip and VSync settings.
- Returns
- A boolean value indicating if the game is running late.
◆ oslEndFrame()
Call this function when a frame has ended.
This function should be called just before calling oslSyncFrame or oslWaitVSync. It handles audio synchronization and other end-of-frame tasks.
◆ oslSyncFrameEx()
int oslSyncFrameEx |
( |
int | frameskip, |
|
|
int | max_frameskip, |
|
|
int | vsync ) |
|
extern |
Synchronization function with explicit parameters.
This function is similar to oslSyncFrame but allows you to pass all synchronization parameters directly in one call.
- Parameters
-
frameskip | Frameskip value. |
max_frameskip | Maximum frameskip value. |
vsync | VSync parameter. |
- Returns
- A boolean value indicating if the game is running late.
◆ oslWaitVSync()
Waits for the VSync, synchronizing your game.
This function is a simpler and less efficient method than oslSyncFrame.
◆ osl_quit
Indicates whether the application should exit.
This variable is set to 1 when the user chooses "Exit" from the HOME menu, signaling that the application should clean up resources and quit. Game loops should monitor this variable and exit gracefully when it is set to 1.
◆ osl_standByUnpermitted
int osl_standByUnpermitted |
|
extern |
Controls whether standby mode is permitted.
This variable can be set to 1 to prevent the PSP from entering standby mode. If set to 0, standby mode is allowed.
◆ osl_powerCallback
int(* osl_powerCallback) (int arg1, int arg2, void *common) |
( |
int | arg1, |
|
|
int | arg2, |
|
|
void * | common ) |
|
extern |
Pointer to the power callback function.
This function is called when a power event occurs, such as low battery, power switch action, or other power-related events. The callback receives three parameters: two integers and a void pointer for user-defined data.
- Parameters
-
arg1 | First argument, typically indicating the type of power event. |
arg2 | Second argument, providing additional context or flags related to the event. |
common | A pointer to user-defined data, typically passed when setting up the callback. |
- Returns
- Typically returns 0, but the return value may be used to influence power event handling.
◆ osl_exitCallback
int(* osl_exitCallback) (int arg1, int arg2, void *common) |
( |
int | arg1, |
|
|
int | arg2, |
|
|
void * | common ) |
|
extern |
Pointer to the exit callback function.
This function is executed when the user chooses "Exit" from the HOME menu. By default, it sets osl_quit
to 1. You can override this function to handle exit events in a custom way.
- Parameters
-
arg1 | First argument, usually indicating the reason for the exit request. |
arg2 | Second argument, providing additional context or flags related to the exit request. |
common | A pointer to user-defined data, typically passed when setting up the callback. |
- Returns
- Typically returns 0, but the return value may be used to influence exit event handling.
◆ osl_vblInterruptNumber
int osl_vblInterruptNumber |
|
extern |
The interrupt number for the VBLANK interrupt.
This variable stores the number of the VBLANK interrupt used by OSLib. It is generally set during initialization and used to manage frame synchronization.
◆ osl_maxFrameskip
Maximum allowed frameskip value.
This variable determines the maximum number of frames that can be skipped to maintain a stable frame rate. A higher value may result in a less smooth visual experience but can help the game maintain its target frame rate.
◆ osl_vsyncEnabled
Indicates whether VSync is enabled.
This variable controls the VSync setting for the application. When VSync is enabled, the rendering process is synchronized with the screen refresh rate to prevent screen tearing.
◆ osl_frameskip
Current frameskip setting.
This variable determines how many frames should be skipped between rendering frames. A value of 1 disables frameskipping, while higher values increase the number of frames skipped, potentially improving performance at the cost of smoothness.
◆ osl_vblCount
volatile int osl_vblCount |
|
extern |
Count of VBLANK interrupts.
This volatile variable tracks the number of VBLANK interrupts that have occurred. It is used internally to synchronize rendering with the display's refresh rate.
◆ osl_vblCallCount
volatile int osl_vblCallCount |
|
extern |
Count of VBLANK interrupt calls.
This volatile variable tracks the number of times the VBLANK interrupt has been handled. It is used to ensure that the application correctly responds to each interrupt.
◆ osl_vblankCounterActive
volatile int osl_vblankCounterActive |
|
extern |
Indicates if the VBLANK counter is active.
This volatile variable is set to 1 when the VBLANK counter is actively tracking VBLANK interrupts. It is used internally by OSLib for frame synchronization.
◆ osl_skip
Indicates whether the current frame should be skipped.
This volatile variable is used internally to determine if rendering for the current frame should be skipped based on the frameskip settings and current performance.
◆ osl_currentFrameRate
volatile int osl_currentFrameRate |
|
extern |
Current framerate setting.
This volatile variable stores the current target framerate, typically set to 60 for a standard PSP display. It can be modified to simulate different framerates, such as 50 for PAL games.