00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <math.h>
00023 #include "gfx.h"
00024
00025 typedef struct {
00026 int x;
00027 int y;
00028 } point_t;
00029
00030 #define MAX_POINT 256
00031
00032 main() {
00033 double M_PI;
00034 double a;
00035 int c, i, l;
00036 point_t p[MAX_POINT];
00037
00038 printf("calculating, wait...");
00039
00040 M_PI = 8.0 * atan(1.0);
00041
00042
00043 for (c = 0; c < MAX_POINT; c++) {
00044 a = (M_PI * (double)c) / (double)MAX_POINT;
00045 p[c].x = ((int)(100.0 * cos(a))) + (128 - 8);
00046 p[c].y = ((int)(80.0 * sin(a))) + (96 - 8);
00047
00048 if (c & 8)
00049 putch('.');
00050 }
00051 printf("done!\n");
00052
00053
00054 set_color(15, 1, 1);
00055 set_mode(mode_2);
00056 set_sprite_mode(sprite_large);
00057
00058 fill(MODE2_ATTR, 0xF1, MODE2_MAX);
00059
00060
00061 set_sprite_16(0, (void*)(0x1BBF + 8));
00062
00063 while (!get_trigger(0))
00064 for (c = 0; c < MAX_POINT; c++) {
00065 for (i = 0; i < 8; i++) {
00066 l = (c + (i << 4)) % MAX_POINT;
00067 put_sprite_16(i, p[l].x, p[l].y, 0, i + 2);
00068 }
00069 }
00070
00071 set_mode(mode_0);
00072 }