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
141void ppuReset(void);
142
143/*============================================================================
144 * Screen Control
145 *============================================================================*/
146
162void setScreenOn(void);
163
176void setScreenOff(void);
177
202void setBrightness(u8 brightness);
203
232void fadeOut(u8 speed);
233
243void fadeIn(u8 speed);
244
246#define FADE_OUT 0
248#define FADE_IN 1
249
276void fadeStart(u8 direction, u8 speed);
277
289
295
302
303/*============================================================================
304 * VBlank Synchronization
305 *============================================================================*/
306
343void WaitForVBlank(void);
344
352
353/*============================================================================
354 * Frame Counter
355 *============================================================================*/
356
372inline u16 getFrameCount(void) {
373 extern volatile u16 frame_count;
374 return frame_count;
375}
376
383
384/*============================================================================
385 * System Information
386 *============================================================================*/
387
400u8 isPAL(void);
401
402/*============================================================================
403 * Random Number Generation
404 *============================================================================*/
405
422
431void rngSeed(u16 seed);
432
433#endif /* OPENSNES_CONSOLE_H */
u8 getBrightness(void)
Get current brightness.
u8 isInVBlank(void)
Check if currently in VBlank.
u8 fadeRunning(void)
Is a fade started by fadeStart() still running?
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:372
void ppuReset(void)
Put every PPU register, and the library's PPU shadows, back to their power-on state.
u8 fadeStep(void)
Advance the fade started by fadeStart(), one call a frame.
void consoleInit(void)
Initialize SNES hardware.
void WaitForVBlank(void)
Wait for next VBlank period.
u16 rngNext(void)
Next pseudo-random 16-bit number.
void fadeStart(u8 direction, u8 speed)
Start a fade that does not hold the program: the frames are yours.
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.