Display a single static 32x32 sprite. More...
Functions | |
| int | main (void) |
| 4bpp 32x32 sprite tile data (converted by the build from res/) | |
Display a single static 32x32 sprite.
Minimal example showing how to load and display one hardware sprite on the SNES: Kit, the fox-kit courier of the examples. Sprite tile data is DMA'd to VRAM, a 16-color palette is loaded to CGRAM at address 128 (sprite palette 0), and the OBJ size register (OBJSEL, $2101) is configured for small=8x8 / large=32x32 mode.
The sprite is placed at screen center using oamSet(), which writes to the 544-byte OAM buffer that the NMI handler DMAs to the PPU each VBlank. The tile number is calculated from the offset between the OBJSEL name base and the VRAM address where the tile data was loaded.
| int main | ( | void | ) |
4bpp 32x32 sprite tile data (converted by the build from res/)
16-color palette for the 32x32 sprite
Entry point: display a single static 32x32 sprite at screen center.
This is the simplest possible sprite example. It demonstrates the complete pipeline for getting one hardware sprite on screen: