- uoffs = tunrot >> 1;
-
- top = vram[backbuf] + 20;
- bot = vram[backbuf] + 159 * 240 / 2 + 20;
- tunptr = tunmap;
- for(i=0; i<80; i++) {
- for(j=0; j<160/2; j++) {
-#ifdef VBLBAR
- if(j == 160/4) {
- tunptr++;
- top++;
- bot++;
- continue;
- }
-#endif
- tun = *tunptr++;
+ /*
+ if(bnstate & KEY_LT) tunrot++;
+ if(bnstate & KEY_RT) tunrot--;
+ */
+ tunrot = nframes;
+
+ tunmat[0] = COS(tunrot);
+ tunmat[1] = -SIN(tunrot);
+ tunmat[2] = SIN(tunrot);
+ tunmat[3] = COS(tunrot);
+ tunx = (128 << 8) - tunmat[0] * 120 + tunmat[1] * -80;
+ tuny = (128 << 8) - tunmat[2] * 120 + tunmat[3] * -80;
+
+ uoffs = tunrot;
+
+ top = vram[backbuf];
+ for(i=0; i<160; i++) {
+ startx = tunx;
+ starty = tuny;
+ for(j=0; j<240/2; j++) {
+ tx = (tunx >> 8) & 0xff;
+ ty = (tuny >> 8) & 0xff;
+ tun = tmap[(ty << 8) + tx];
+
+ tunx += tunmat[0];
+ tuny += tunmat[2];