// SPDX-License-Identifier: MIT // Mode 2: BG2 128x128 without wrap (transparent outside), magnified, over BG3 1024x1024 // wrapping and rotated; the backdrop shows where both are transparent. #include "scene.h" int main(void) { DISPCNT = 0x0080; palette_fill(0, 256, 9); for (int t = 0; t < 64; t++) tile8(t * 64, t); volatile u16 *m2 = VRAM16 + 16 * 0x400; // 16x16 entries for (int i = 0; i < 128; i++) m2[i] = ((i * 5) % 64) | (((i * 5 + 1) % 64) << 8); volatile u16 *m3 = VRAM16 + 20 * 0x400; // 128x128 entries = 16 KB for (int i = 0; i < 8192; i++) m3[i] = ((i * 11 + (i >> 6)) % 64) | (((i * 11 + 3) % 64) << 8); BGCNT(2) = 0 << 2 | 16 << 8 | 0 << 14 | 0; BGCNT(3) = 0x2000 | 0 << 2 | 20 << 8 | 3 << 14 | 1; BGPA(2) = 0xB0; BGPB(2) = 0; BGPC(2) = 0; BGPD(2) = 0xB0; BGX(2) = -20 << 8; BGY(2) = -10 << 8; BGPA(3) = 181; BGPB(3) = -181; BGPC(3) = 181; BGPD(3) = 181; BGX(3) = 500 << 8; BGY(3) = 77 << 8; PAL16[0] = rgb(31, 0, 31); DISPCNT = 0x0002 | 0x0C00; forever(); }