SNES System Variables (crt0.asm exports) More...
#include <snes/types.h>Go to the source code of this file.
Variables | |
| volatile u16 | frame_count |
| Frame counter incremented every VBlank by the NMI handler. | |
| volatile u8 | oam_update_flag |
| OAM DMA trigger flag. | |
| u8 | oamMemory [] |
| Hardware OAM buffer (544 bytes at $7E:0300) | |
| volatile u8 | vblank_flag |
| VBlank flag (set by NMI handler each frame) | |
SNES System Variables (crt0.asm exports)
Declares variables defined in crt0.asm that are commonly needed by game code. Including <snes.h> automatically includes this header.
|
extern |
Frame counter incremented every VBlank by the NMI handler.
Counts total frames since boot (including lag frames). Useful for timing, animation, and elapsed-time calculations.
|
extern |
OAM DMA trigger flag.
Set to 1 to request OAM buffer DMA during the next VBlank. The NMI handler clears this after the transfer.
|
extern |
Hardware OAM buffer (544 bytes at $7E:0300)
This buffer is DMA'd to OAM hardware during VBlank by the NMI handler when oam_update_flag is set.
Layout:
|
extern |
VBlank flag (set by NMI handler each frame)
Set to 1 by the NMI handler at the start of each VBlank. WaitForVBlank() polls this flag and clears it.
For manual VBlank timing after heavy computation, clear this flag before calling WaitForVBlank() to avoid using a stale flag: