// SPDX-License-Identifier: MIT // The OBJ rendering budget (GBATEK §LCD OBJ - Overview): lines 0-63 hold thirty 64-wide // normal OBJs (1,920 cycles asked, 1,210 available), lines 80-111 twenty affine 32-wide // OBJs (74 cycles each), some of them off-screen to the right but still costing. #include "scene.h" int main(void) { DISPCNT = 0x0080; palette_fill(256, 256, 40); PAL16[0] = rgb(0, 8, 0); for (int t = 0; t < 1024; t++) tile4(0x10000 + t * 32, t + 2); obj_clear(); obj_affine(0, 256, 0, 0, 256); for (int n = 0; n < 30; n++) obj_set(n, 0 | 0 << 14, (n * 8) % 512 | 3 << 14, n * 4); for (int n = 30; n < 50; n++) obj_set(n, 80 | 0x0100 | 0 << 14, (n == 31 || n == 33 ? 300 : (n - 30) * 12) | 2 << 14, n * 8); DISPCNT = 0x1000 | 0x0040; forever(); }