Mode 3 full-color (256-color, 8bpp) background with assembly DMA loader. More...
Functions | |
| int | main (void) |
| Assembly DMA loader for large 8bpp tile data (defined in data.asm). | |
Mode 3 full-color (256-color, 8bpp) background with assembly DMA loader.
Displays a 256-color background using Mode 3, the highest color-depth tiled mode on the SNES. Each tile is 64 bytes (8 bitplanes), so even a modest tileset exceeds 32 KB and cannot fit in a single ROM bank. The tile data is placed in SUPERFREE sections by the linker, which may assign them to bank $01 or higher. A hand-written assembly DMA loader (loadGraphics in data.asm) uses the linker-provided bank byte (:label) to transfer tile data, tilemap, and palette to VRAM/CGRAM correctly regardless of which bank the data lands in.
This is a direct port of the PVSnesLib "Mode3" example.
| int main | ( | void | ) |
Assembly DMA loader for large 8bpp tile data (defined in data.asm).
Because Mode 3 tile data (64 bytes per 8x8 tile) typically exceeds 32KB, it cannot fit in a single ROM bank. The linker places SUPERFREE sections in whatever bank has space, potentially bank $01 or higher. Post-A6+A7 (v0.19.0) C pointers carry the bank byte natively, and dmaCopyVram / dmaCopyCGram read it from the caller's Kl pointer — no more loadGraphics() ASM stub needed.
Tile/palette/tilemap symbols defined in data.asm (.incbin).
Entry point – load 256-color tileset and display Mode 3 image
Forces blank, DMAs 8bpp tile data (split across two ROM sections to exceed the 32KB bank-0 limit), tilemap, and 256-color palette into VRAM/CGRAM, then configures Mode 3 and turns on the screen. Mode 3 supports a single BG layer with 256 colors per tile (8 bitplanes), the richest color depth in any tiled SNES mode. The tradeoff is that only one BG layer is available (plus a second 4-color direct-color BG that is unused here).