// SPDX-License-Identifier: MIT // Mode 0: four text BGs of every size and both depths, scrolled, with flips and palettes; // two BGs share a priority (BG0 first on ties: GBATEK §LCD I/O BG Control). #include "scene.h" int main(void) { DISPCNT = 0x0080; palette_fill(0, 256, 0); for (int t = 0; t < 64; t++) tile4(0x0000 + t * 32, t); // char base 0, 4 bpp for (int t = 0; t < 64; t++) tile8(0x4000 + t * 64, t); // char base 1, 8 bpp map_text(16, 1, 64, 3); // BG0 256x256 map_text(18, 2, 64, 1); // BG1 512x256, 8 bpp map_text(20, 2, 64, 3); // BG2 256x512 map_text(24, 4, 64, 3); // BG3 512x512 BGCNT(0) = 0x0000 | 16 << 8 | 0 << 14 | 1; BGCNT(1) = 0x0084 | 18 << 8 | 1 << 14 | 2; BGCNT(2) = 0x0000 | 20 << 8 | 2 << 14 | 1; BGCNT(3) = 0x0000 | 24 << 8 | 3 << 14 | 3; BGHOFS(0) = 13; BGVOFS(0) = 7; BGHOFS(1) = 300; BGVOFS(1) = 21; BGHOFS(2) = 5; BGVOFS(2) = 300; BGHOFS(3) = 400; BGVOFS(3) = 450; PAL16[0] = rgb(4, 8, 12); DISPCNT = 0x0F00; forever(); }