// SPDX-License-Identifier: MIT // Mode 1: text BG0 under an affine BG2 (256x256, wrapping), rotated about 30 degrees and // scaled, with a reference point off the origin and a line-by-line walk (PB, PD). #include "scene.h" int main(void) { DISPCNT = 0x0080; palette_fill(0, 256, 3); for (int t = 0; t < 32; t++) tile4(t * 32, t); for (int t = 0; t < 64; t++) tile8(0x8000 + t * 64, t + 7); map_text(8, 1, 32, 3); volatile u16 *m = VRAM16 + 12 * 0x400; // affine map: 32x32 one-byte entries for (int i = 0; i < 512; i++) m[i] = ((i * 3) % 64) | (((i * 3 + 5) % 64) << 8); BGCNT(0) = 8 << 8 | 2; BGCNT(2) = 0x2000 | 2 << 2 | 12 << 8 | 1 << 14 | 1; BGPA(2) = 222; BGPB(2) = 150; BGPC(2) = -128; BGPD(2) = 260; BGX(2) = 0x1234; BGY(2) = -0x2300; DISPCNT = 0x0001 | 0x0500; forever(); }