OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
console.h
Go to the documentation of this file.
1
43
44#ifndef OPENSNES_CONSOLE_H
45#define OPENSNES_CONSOLE_H
46
47#include <snes/types.h>
48#include <snes/registers.h> /* REG_INIDISP for inline setScreenOn/Off bodies */
49
50/* Removed on 2026-10-05 (1.0 plan, lot C): consoleInitEx, getRegion, rand, srand.
51 * The replacements are in docs/UPGRADING.md; `make check-upgrade` names them. */
52
53/*============================================================================
54 * Initialization
55 *============================================================================*/
56
89void consoleInit(void);
90
91/*============================================================================
92 * Screen Control
93 *============================================================================*/
94
110void setScreenOn(void);
111
124void setScreenOff(void);
125
150void setBrightness(u8 brightness);
151
180void fadeOut(u8 speed);
181
191void fadeIn(u8 speed);
192
199
200/*============================================================================
201 * VBlank Synchronization
202 *============================================================================*/
203
240void WaitForVBlank(void);
241
249
250/*============================================================================
251 * Frame Counter
252 *============================================================================*/
253
269inline u16 getFrameCount(void) {
270 extern volatile u16 frame_count;
271 return frame_count;
272}
273
280
281/*============================================================================
282 * System Information
283 *============================================================================*/
284
297u8 isPAL(void);
298
299/*============================================================================
300 * Random Number Generation
301 *============================================================================*/
302
319
328void rngSeed(u16 seed);
329
330#endif /* OPENSNES_CONSOLE_H */
u8 getBrightness(void)
Get current brightness.
u8 isInVBlank(void)
Check if currently in VBlank.
u8 isPAL(void)
Check if PAL system.
void setScreenOff(void)
Disable screen display (blank).
void fadeIn(u8 speed)
Fade the screen from black (0) up to full brightness (15).
void setBrightness(u8 brightness)
Set screen brightness.
void resetFrameCount(void)
Reset frame counter.
void fadeOut(u8 speed)
Fade the screen from full brightness (15) down to black (0).
void rngSeed(u16 seed)
Seed the generator (the srand() of 0.x, removed 2026-10-05).
u16 getFrameCount(void)
Get frame counter.
Definition console.h:269
void consoleInit(void)
Initialize SNES hardware.
void WaitForVBlank(void)
Wait for next VBlank period.
u16 rngNext(void)
Next pseudo-random 16-bit number.
void setScreenOn(void)
Enable screen display.
unsigned short u16
16-bit unsigned integer (0 to 65535)
Definition types.h:53
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:47
SNES Hardware Register Definitions.
volatile u16 frame_count
Frame counter incremented every VBlank by the NMI handler.
OpenSNES Standard Types.