// SPDX-License-Identifier: MIT // Windows: WIN0 over WIN1 over the OBJ window over outside, each region with its own layers // and effect bit; alpha blending BG0 over BG1 shows where effects are on. #include "scene.h" int main(void) { DISPCNT = 0x0080; palette_fill(0, 256, 6); palette_fill(256, 256, 12); for (int t = 0; t < 32; t++) tile4(t * 32, t); map_text(16, 1, 32, 2); map_text(17, 1, 32, 3); BGCNT(0) = 16 << 8 | 0; BGCNT(1) = 17 << 8 | 1; BGHOFS(1) = 3; BGVOFS(1) = 5; for (int t = 0; t < 256; t++) tile4(0x10000 + t * 32, t * 5); obj_clear(); obj_set(0, 90 | 2 << 10 | 0 << 14, 150 | 3 << 14, 0); // OBJ window, 64x64 obj_set(1, 20, 160 | 2 << 14, 64); // a normal OBJ obj_set(2, 110, 20 | 2 << 14, 96 | 1 << 12); WIN0H = 20 << 8 | 120; WIN0V = 10 << 8 | 100; WIN1H = 80 << 8 | 200; WIN1V = 50 << 8 | 150; WININ = 0x21 | (0x12) << 8; // WIN0: BG0 + effects; WIN1: BG1 + OBJ WINOUT = 0x32 | (0x31) << 8; // outside: BG1 + OBJ + effects; OBJ window: BG0 + OBJ + effects BLDCNT = 0x01 | 1 << 6 | 0x02 << 8 | 0x20 << 8; BLDALPHA = 9 | 7 << 8; PAL16[0] = rgb(20, 0, 0); DISPCNT = 0x0300 | 0x1000 | 0x0040 | 0xE000; forever(); }