11 int i, j, tx, ty, angle, depth, nframes, backbuf, zoffs;
12 static uint16_t *vram[] = { (uint16_t*)VRAM_LFB_FB0_ADDR, (uint16_t*)VRAM_LFB_FB1_ADDR };
15 uint32_t tun, *tunptr;
17 REG_DISPCNT = 4 | DISPCNT_BG2 | DISPCNT_FB1;
21 cdst = (uint16_t*)CRAM_BG_ADDR;
23 for(i=0; i<256; i++) {
24 *cdst++ = CONV_RGB24_RGB15(csrc[0], csrc[1], csrc[2]);
28 dma_fill16(3, vram[0], 0xffff, 240 * 160 / 2);
29 dma_fill16(3, vram[1], 0xffff, 240 * 160 / 2);
33 backbuf = ++nframes & 1;
39 for(i=0; i<160; i++) {
42 for(j=1; j<240/2; j++) {
48 tx = (angle >> 6) & 0x7f;
49 ty = ((depth >> 7) - zoffs) & 0x7f;
50 pp = tuncross_pixels[(ty << 7) + tx];
55 tx = (angle >> 6) & 0x7f;
56 ty = ((depth >> 7) - zoffs) & 0x7f;
57 pp |= (uint16_t)tuncross_pixels[(ty << 7) + tx] << 8;