Miscellaneous

Functions

int oslBenchmarkTestEx (int startend, int slot)
 
int oslMeanBenchmarkTestEx (int startend, int slot)
 
int oslBenchmarkTest (int startend)
 
void oslSysBenchmarkDisplay ()
 
int oslShowSplashScreen (int splashType)
 

Detailed Description

Miscellaneous.

Function Documentation

int oslBenchmarkTestEx ( int  startend,
int  slot 
)

Does a benchmark action.

Parameters
startend
  • OSL_BENCH_INIT: Initialize the benchmark (done at beginning by OSLib)
  • OSL_BENCH_START: Start the measure from here
  • OSL_BENCH_END: End of a benchmark
  • OSL_BENCH_GET: Get the value (milliseconds between the call to start and end
  • OSL_BENCH_DISPLAY: Avoid
slot0-3: User slots 4-7: System slots (4 contains the CPU load in percent if you multiply its value by 6 and divide by 1000)
Returns
The time elapsed between start and end in microseconds.
int oslMeanBenchmarkTestEx ( int  startend,
int  slot 
)

Same as oslBenchmarkTestEx but does a mean of 20 samples before returning a value.

int oslBenchmarkTest ( int  startend)
inline

Does a benchmark in the slot 0. Easier for testing.

void oslSysBenchmarkDisplay ( )

Displays the system benchmark results on the top-left corner of the screen. Useful for debugging: you know that if the first number approaches or exceeds 16.6 then your game has insufficient performance (for 60 fps).

int oslShowSplashScreen ( int  splashType)
inline

Shows one of the predefined splash screens in OldSchool Library.

Parameters
splashType
  • 1: Shows the OldSchool Library logo. This logo is not very long and can constitute a great introduction to a game. It can be skipped with cross, circle or start buttons.
  • 2: Shows the neoflash logo. Requires and uses the following file: "logo/neoflash.png".
Returns
1 in case of success, 0 otherwise.

Call this function just after having initialized OSLib.

int main(void)
{
//Init oslib.
oslInit(0);
//Show our splash screen
//Begin our game
[...]
    \b Warning: This function tries to load images files located on your memory stick. It will do nothing if they are not present. But if your application is running in kernel mode and you are
    creating an user thread, your thread will not have a default running directory, making this function to always fail! You should always set a working folder (e.g. with sceIoChdir) before calling this
    functions!

    These files can be found in the Resource folder of your OSLib distribution.