9 REG_DISPCNT = DISPCNT_BG2 | 4 | ((x) << 4); \
15 int i, j, tx, ty, angle, depth, nframes, backbuf, zoffs;
16 static uint16_t *vram[] = { (uint16_t*)VRAM_LFB_FB0_ADDR, (uint16_t*)VRAM_LFB_FB1_ADDR };
19 uint32_t tun, *tunptr;
21 REG_DISPCNT = 4 | DISPCNT_BG2 | DISPCNT_FB1;
23 cdst = (uint16_t*)CRAM_BG_ADDR;
25 for(i=0; i<256; i++) {
26 *cdst++ = CONV_RGB24_RGB15(csrc[0], csrc[1], csrc[2]);
32 backbuf = ++nframes & 1;
38 for(i=0; i<160; i++) {
39 for(j=0; j<240/2; j++) {
45 tx = (angle >> 6) & 0x7f;
46 ty = ((depth >> 7) - zoffs) & 0x7f;
47 pp = tuncross_pixels[(ty << 7) + tx];
52 tx = (angle >> 6) & 0x7f;
53 ty = ((depth >> 7) - zoffs) & 0x7f;
54 pp |= (uint16_t)tuncross_pixels[(ty << 7) + tx] << 8;
60 //while(!(REG_DISPSTAT & DISPSTAT_VBLANK));
61 while(REG_VCOUNT < 160);
62 //REG_DISPCNT ^= DISPCNT_FB1;