OldSchool Library
Miscellaneous

Miscellaneous utilities. More...

Macros

#define OSL_BENCH_SLOTS   8
 Number of available benchmark slots.
 
#define OSL_BENCH_SAMPLES   20
 Number of samples used for mean benchmarking.
 
#define OSL_UVRAM_BASE   ((u8*)0x04000000)
 Base address of the UVRAM (Uncached Video RAM) on the PSP.
 
#define OSL_UVRAM_SIZE   (2 << 20)
 Size of the UVRAM (Uncached Video RAM) in bytes.
 
#define OSL_UVRAM_END   ((u8*)((u32)OSL_UVRAM_BASE + OSL_UVRAM_SIZE))
 End address of the UVRAM (Uncached Video RAM) region.
 

Enumerations

enum  {
  OSL_BENCH_INIT = 0 , OSL_BENCH_START , OSL_BENCH_END , OSL_BENCH_GET ,
  OSL_BENCH_GET_LAST , OSL_BENCH_DISPLAY
}
 Enumeration for benchmark actions in OSLib. More...
 

Functions

int oslBenchmarkTestEx (int startend, int slot)
 Does a benchmark action.
 
int oslMeanBenchmarkTestEx (int startend, int slot)
 Same as oslBenchmarkTestEx but does a mean of 20 samples before returning a value.
 
void oslSysBenchmarkDisplay ()
 Displays the system benchmark results on the top-left corner of the screen.
 
void oslVblankInterrupt (int sub, void *parg)
 Handles the VBLANK interrupt.
 
int oslShowSplashScreen1 ()
 Displays the first predefined splash screen.
 
int oslShowSplashScreen2 ()
 Displays the second predefined splash screen.
 

Detailed Description

Miscellaneous utilities.

This section includes various utility functions and definitions that do not fall under other categories.

Macro Definition Documentation

◆ OSL_BENCH_SLOTS

#define OSL_BENCH_SLOTS   8

Number of available benchmark slots.

This macro defines the number of benchmark slots that can be used concurrently. Each slot can hold independent benchmark data, allowing multiple benchmarks to be performed and compared simultaneously.

◆ OSL_BENCH_SAMPLES

#define OSL_BENCH_SAMPLES   20

Number of samples used for mean benchmarking.

This macro defines the number of samples to be averaged when performing a mean benchmark. This helps in obtaining a more accurate and stable benchmark result by averaging multiple measurements.

◆ OSL_UVRAM_BASE

#define OSL_UVRAM_BASE   ((u8*)0x04000000)

Base address of the UVRAM (Uncached Video RAM) on the PSP.

This macro defines the base address of the uncached video RAM on the PSP. This memory region is used for operations that require direct access to video memory without the benefits of CPU caching. It is typically used for graphics operations where cache coherence with the GPU is critical.

◆ OSL_UVRAM_SIZE

#define OSL_UVRAM_SIZE   (2 << 20)

Size of the UVRAM (Uncached Video RAM) in bytes.

This macro defines the size of the uncached video RAM region. The value represents 2 megabytes (2 << 20), which is typically the size allocated for video memory operations that require uncached access on the PSP.

◆ OSL_UVRAM_END

#define OSL_UVRAM_END   ((u8*)((u32)OSL_UVRAM_BASE + OSL_UVRAM_SIZE))

End address of the UVRAM (Uncached Video RAM) region.

This macro calculates the end address of the uncached video RAM region by adding the size of the UVRAM to its base address. It is useful for determining the bounds of the video memory area when performing operations that involve the entire UVRAM.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Enumeration for benchmark actions in OSLib.

This enumeration defines the various actions that can be performed during a benchmark test in OSLib. These actions are used with functions like oslBenchmarkTestEx to control the start, end, and retrieval of benchmark data.

Enumerator
OSL_BENCH_INIT 

Initializes the benchmark. This is typically done at the beginning of the benchmarking process.

OSL_BENCH_START 

Starts the benchmark timer. This marks the beginning of the period you want to measure.

OSL_BENCH_END 

Ends the benchmark timer. This marks the end of the period you want to measure.

OSL_BENCH_GET 

Retrieves the time elapsed between the start and end of the benchmark in microseconds.

OSL_BENCH_GET_LAST 

Retrieves the last benchmark result without starting or ending a new benchmark.

OSL_BENCH_DISPLAY 

Displays the benchmark results. This action is primarily used for debugging and performance analysis.

Function Documentation

◆ oslBenchmarkTestEx()

int oslBenchmarkTestEx ( int startend,
int slot )
extern

Does a benchmark action.

This function performs a benchmarking action, such as starting or stopping a benchmark, or retrieving the elapsed time.

Parameters
startendBenchmark action type (e.g., OSL_BENCH_START, OSL_BENCH_END).
slotBenchmark slot (0-3 for user, 4-7 for system).
Returns
Time elapsed between start and end in microseconds.

◆ oslMeanBenchmarkTestEx()

int oslMeanBenchmarkTestEx ( int startend,
int slot )
extern

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

This function performs a benchmarking action and returns the mean of 20 samples.

Parameters
startendBenchmark action type.
slotBenchmark slot.
Returns
Mean benchmark value.

◆ oslSysBenchmarkDisplay()

void oslSysBenchmarkDisplay ( )
extern

Displays the system benchmark results on the top-left corner of the screen.

This function displays the benchmark results, which can be useful for debugging performance issues.

◆ oslVblankInterrupt()

void oslVblankInterrupt ( int sub,
void * parg )
extern

Handles the VBLANK interrupt.

This function is called during the VBLANK interrupt to perform tasks that need to be synchronized with the vertical blanking period of the display. The function can be used to update frame counters, synchronize rendering, or perform other time-sensitive operations that should occur during the VBLANK period.

Parameters
subA sub-parameter used to provide additional context or configuration for the interrupt handling.
pargA pointer to user-defined data or structure that may be used within the interrupt handler.

◆ oslShowSplashScreen1()

int oslShowSplashScreen1 ( )
extern

Displays the first predefined splash screen.

This function shows the first splash screen provided by the OldSchool Library, typically the OSLib logo. It can be used at the start of your application as an introduction.

Returns
Returns 1 on success, 0 if the splash screen could not be displayed.

◆ oslShowSplashScreen2()

int oslShowSplashScreen2 ( )
extern

Displays the second predefined splash screen.

This function shows the second splash screen provided by the OldSchool Library, typically associated with the Neoflash logo. It can be used at the start of your application as an introduction.

Returns
Returns 1 on success, 0 if the splash screen could not be displayed.