SNES Console Initialization and Core Functions. More...
#include <snes/types.h>Go to the source code of this file.
Functions | |
| void | consoleInit (void) |
| Initialize SNES hardware. | |
| void | consoleInitEx (u16 options) |
| Initialize console with options. | |
| u8 | getBrightness (void) |
| Get current brightness. | |
| u16 | getFrameCount (void) |
| Get frame counter. | |
| u8 | getRegion (void) |
| Get system region. | |
| u8 | isInVBlank (void) |
| Check if currently in VBlank. | |
| u8 | isPAL (void) |
| Check if PAL system. | |
| u16 | rand (void) |
| Get random 16-bit number. | |
| void | resetFrameCount (void) |
| Reset frame counter. | |
| void | setBrightness (u8 brightness) |
| Set screen brightness. | |
| void | setScreenOff (void) |
| Disable screen display (blank) | |
| void | setScreenOn (void) |
| Enable screen display. | |
| void | srand (u16 seed) |
| Seed random number generator. | |
| void | WaitForVBlank (void) |
| Wait for next VBlank period. | |
SNES Console Initialization and Core Functions.
Provides functions for initializing SNES hardware and core functionality like VBlank synchronization.
Originally from: PVSnesLib (https://github.com/alekmaul/pvsneslib) Author: Alekmaul License: zlib (compatible with MIT) Modifications:
| void consoleInit | ( | void | ) |
Initialize SNES hardware.
Must be called at the start of your program. Performs:
After calling, screen is blanked (black). Call setScreenOn() to enable display after you've set up your graphics.
| void consoleInitEx | ( | u16 | options | ) |
Initialize console with options.
Advanced initialization with configuration options.
| options | Initialization flags (reserved for future use) |
| u8 getBrightness | ( | void | ) |
Get current brightness.
| u16 getFrameCount | ( | void | ) |
Get frame counter.
Returns the number of VBlanks since initialization. Wraps at 65535.
| u8 getRegion | ( | void | ) |
Get system region.
| u8 isInVBlank | ( | void | ) |
Check if currently in VBlank.
| u8 isPAL | ( | void | ) |
| u16 rand | ( | void | ) |
Get random 16-bit number.
Returns a pseudo-random number using a linear feedback shift register.
| void resetFrameCount | ( | void | ) |
Reset frame counter.
Sets frame counter to 0. Useful for timing game events.
| void setBrightness | ( | u8 | brightness | ) |
Set screen brightness.
| brightness | Brightness level (0-15, 0=black, 15=full) |
| void setScreenOff | ( | void | ) |
Disable screen display (blank)
Turns off the display. Use during major VRAM updates that can't complete during VBlank.
| void setScreenOn | ( | void | ) |
Enable screen display.
Turns on the display after initialization or a screen blank. Sets full brightness (15).
| void srand | ( | u16 | seed | ) |
Seed random number generator.
| seed | Initial seed value |
| void WaitForVBlank | ( | void | ) |
Wait for next VBlank period.
Blocks until the PPU enters Vertical Blank. This is essential for:
Call once per frame in your main loop.