00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdlib.h>
00022 #include "line.h"
00023
00024 int low[MODE2_HEIGHT];
00025 int high[MODE2_HEIGHT];
00026 u_char *buf;
00027
00028 main() {
00029 int c, l;
00030 u_char i;
00031 surface_t surf;
00032
00033 buf = (u_char*)malloc(MODE2_MAX);
00034 surf.data.ram = buf;
00035
00036 set_color(15, 1, 1);
00037 set_mode(mode_2);
00038 fill(MODE2_ATTR, 0x31, MODE2_MAX);
00039
00040 c = 0;
00041
00042
00043 for (;;) {
00044 memset(buf, MODE2_MAX, 0);
00045 memset(low, MODE2_HEIGHT << 1, 64);
00046 memset(high, MODE2_HEIGHT << 1, 0);
00047
00048
00049 calculate_side(128 + c, c + 20, 40, 180 - c, low, high);
00050 calculate_side(128 + c, c + 20, 255 - c, 96, low, high);
00051 calculate_side(255 - c, 96, 40, 180 - c, low, high);
00052 c = (c + 4) & 63;
00053 i = (c + 15) >> 4;
00054
00055 for (l = 20; l < 180; l++) {
00056 surface_hline(&surf, low[l], l, high[l], DITHER(i, l));
00057 }
00058 vwrite(surf.data.ram, 0, MODE2_MAX);
00059 if (get_trigger(0))
00060 break;
00061 }
00062
00063 set_mode(mode_0);
00064 }