// SPDX-License-Identifier: MIT // Mode 3 zoomed by two from an offset reference point, with OBJs: one in tile 512 (shown) and // one in tile 0 (OBJ tiles 0-511 are not displayed in bitmap modes: GBATEK §LCD OBJ - OAM // Attributes). #include "scene.h" int main(void) { DISPCNT = 0x0080; for (int y = 0; y < 160; y++) for (int x = 0; x < 240; x++) VRAM16[y * 240 + x] = rgb(x / 8, y / 5, (x ^ y) & 31); palette_fill(256, 256, 1); for (int t = 0; t < 16; t++) tile4(0x10000 + t * 32, t); // OBJ tiles 0-15 (hidden) for (int t = 0; t < 16; t++) tile4(0x14000 + t * 32, t); // OBJ tiles 512-527 obj_clear(); obj_set(0, 20 | 0 << 14, 30 | 1 << 14, 512); obj_set(1, 60 | 0 << 14, 100 | 1 << 14, 0); obj_set(2, 100 | 1 << 14, 150 | 2 << 14, 516 | 1 << 12); BGPA(2) = 0x80; BGPD(2) = 0x80; BGPB(2) = 0; BGPC(2) = 0; BGX(2) = 40 << 8; BGY(2) = 30 << 8; DISPCNT = 0x0003 | 0x0400 | 0x1000 | 0x0040; forever(); }