#define XORRGB(x, y, zoom, r, g, b) \
do { \
- int xor = (((x) - fb_width/2) * (zoom) >> 10) ^ (((y) - fb_height/2) * (zoom) >> 10); \
+ int xor = (((x) - fb_width/2) * (zoom) >> 16) ^ (((y) - fb_height/2) * (zoom) >> 16); \
(r) = xor >> 2; \
(g) = xor >> 1; \
(b) = xor; \
uint16_t *fbptr16;
uint32_t *fbptr32;
- xoffs = COS(time_msec >> 5) * fb_width >> 7;
- yoffs = SIN(time_msec >> 4) * fb_height >> 8;
- zoom = ((SIN(time_msec >> 4) + 256) << 1) + 512;
+ xoffs = COS(time_msec >> 3) * fb_width >> 15;
+ yoffs = SIN(time_msec >> 2) * fb_height >> 16;
+ zoom = (SIN(time_msec >> 5) >> 1) + 65536;
switch(fb_bpp) {
case 15:
extern int sinlut[];
-#define SIN(x) sinlut[(x) & 0xff]
-#define COS(x) sinlut[((x) + 64) & 0xff]
+#define SIN(x) sinlut[(x) & 0x3ff]
+#define COS(x) sinlut[((x) + 512) & 0x3ff]
int mask_to_shift(unsigned int mask);
puts("\t.globl sinlut");
puts("_sinlut:");
puts("sinlut:");
- for(i=0; i<256; i++) {
- float x = sin((float)i / 128.0f * M_PI);
- printf("\t.long %d\n", (int)(x * 256.0f));
+ for(i=0; i<1024; i++) {
+ float x = sin((float)i / 512.0f * M_PI);
+ printf("\t.long %d\n", (int)(x * 65536.0f));
}
return 0;
}