Mode 7 EXTBG: one plane split in two layers, an orb flying between them.
Mode 7 has a single layer — unless SETINI bit 6 (EXTBG) is set. Then BG2 shows the same plane as BG1 (same tilemap, same pixels, same transform), but reads each pixel's bit 7 as a priority bit and bits 0-6 as its colour. Front to back: sprites 3, sprites 2, BG2 pixels with bit 7 set, sprites 1, BG1, sprites 0, BG2 pixels with bit 7 clear. A priority-1 sprite therefore flies over the pixels whose bit 7 is clear and under those whose bit 7 is set, in one and the same Mode 7 plane.
The plane is the city seen from above with the elevated metro over it: the viaducts and the train are drawn with colours 0x81-0x8D, the streets, roofs and canal below with colours 16 and up. An energy orb crosses the screen on its own, over the roofs and under the viaducts; press A to switch EXTBG off (BG1 shown instead: one layer, the orb in front of everything) and on.
- SNES Concepts
- SETINI ($2133) bit 6 through mode7SetExtBg()
- Mode 7 EXTBG priority: BG2's high pixels above priority-1 sprites, its low pixels below every sprite and below BG1 (hence BG2 alone on screen)
- One pixel, two colours: 0x81 is colour 1 on BG2 (7-bit) and colour 129 on BG1 (8-bit), so the palette carries the viaducts' colours twice
- Mode 7 VRAM interleave (dmaCopyVramMode7)
- What to Observe
- The orb passes over the roofs, the streets and the canal, and under the three viaducts and the train — the same Mode 7 plane, split by bit 7 of its pixels.
- Press A: EXTBG off, BG1 on screen, the orb now covers the viaducts too.
- Modules Used
- console, dma, sprite, input, mode7
- See also
- mode7.h (mode7SetExtBg), docs/tutorials/mode7.md