Performance profiling tools for SNES development.
More...
Go to the source code of this file.
Performance profiling tools for SNES development.
Provides scanline-based timing, visual color-bar profiling, and frame/lag counters.
Quick Start
while (1) {
}
}
int main(void)
Definition main.c:66
void consoleInit(void)
Initialize SNES hardware.
void WaitForVBlank(void)
Wait for next VBlank period.
void setScreenOn(void)
Enable screen display.
Definition console.h:115
Performance profiling tools for SNES development.
void profileColorStart(u16 color)
Start a color-bar profiling section.
#define PROFILE_RED
Definition profile.h:52
void profileInit(void)
Initialize the profiler.
void profileColorEnd(void)
End a color-bar profiling section.
OpenSNES common-case master header.
Build
Add profile to LIB_MODULES:
LIB_MODULES := console sprite dma profile
- Author
- OpenSNES Team
- Copyright
- MIT License
◆ PROFILE_BLUE
◆ PROFILE_CYAN
◆ PROFILE_GREEN
◆ PROFILE_MAGENTA
| #define PROFILE_MAGENTA 5 |
◆ PROFILE_RED
◆ PROFILE_WHITE
◆ PROFILE_YELLOW
◆ profileColorEnd()
| void profileColorEnd |
( |
void | | ) |
|
End a color-bar profiling section.
Clears the fixed color back to black.
◆ profileColorStart()
| void profileColorStart |
( |
u16 | color | ) |
|
Start a color-bar profiling section.
- Parameters
-
| color | One of the PROFILE_* color constants (0-6) |
◆ profileGetFrameCount()
| u16 profileGetFrameCount |
( |
void | | ) |
|
Get total frame count since boot (wraps at 65535).
◆ profileGetLagFrames()
| u16 profileGetLagFrames |
( |
void | | ) |
|
Get lag frame count since boot.
A lag frame occurs when main code doesn't finish before the next NMI.
◆ profileGetScanline()
| u16 profileGetScanline |
( |
void | | ) |
|
Get the current scanline number (0-261 NTSC, 0-311 PAL).
◆ profileInit()
| void profileInit |
( |
void | | ) |
|
Initialize the profiler.
Enables color math so that profileColorStart/End produce visible color bars on the backdrop. Call once after consoleInit(), before setScreenOn().
Sets CGADSUB ($2131) to add fixed color to backdrop.
◆ profileScanlineEnd()
| u16 profileScanlineEnd |
( |
void | | ) |
|
End a scanline-based timing measurement.
- Returns
- Number of scanlines elapsed since profileScanlineStart(). Multiply by 1364 for approximate master cycles (NTSC).
◆ profileScanlineStart()
| void profileScanlineStart |
( |
void | | ) |
|
Start a scanline-based timing measurement.