|
@ -7,68 +7,21 @@ |
|
|
#define RANDOM8() (random8()) |
|
|
#define RANDOM8() (random8()) |
|
|
|
|
|
|
|
|
#ifdef ANIMATION_TESTS |
|
|
#ifdef ANIMATION_TESTS |
|
|
void test1(){ |
|
|
|
|
|
unsigned char x,y; |
|
|
|
|
|
|
|
|
|
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
void test_level(unsigned char level){ |
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
for (unsigned char y=NUM_ROWS;y--;){ |
|
|
setpixel((pixel){x,y}, 3); |
|
|
for (unsigned char x=NUM_COLS;x--;){ |
|
|
wait(100); |
|
|
setpixel((pixel){x,y}, level); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_level1(){ |
|
|
|
|
|
unsigned char x,y; |
|
|
|
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
|
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
|
|
|
setpixel((pixel){x,y}, 1); |
|
|
|
|
|
wait(5); |
|
|
wait(5); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
wait(2000); |
|
|
wait(2000); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_level2(){ |
|
|
|
|
|
unsigned char x,y; |
|
|
|
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
|
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
|
|
|
setpixel((pixel){x,y}, 2); |
|
|
|
|
|
wait(5); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
wait(2000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_level3(){ |
|
|
|
|
|
unsigned char x,y; |
|
|
|
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
|
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
|
|
|
setpixel((pixel){x,y}, 3); |
|
|
|
|
|
wait(5); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
wait(2000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_levels(){ |
|
|
|
|
|
unsigned char x,y,b; |
|
|
|
|
|
for(b=1;b<4;b++){ |
|
|
|
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
|
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
|
|
|
setpixel((pixel){x,y}, b); |
|
|
|
|
|
wait(5); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_palette(){ |
|
|
void test_palette(){ |
|
|
unsigned char x,y,b; |
|
|
for (unsigned char y=NUM_ROWS;y--;){ |
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
for (unsigned char x=NUM_COLS;x--;){ |
|
|
b=y%4; |
|
|
setpixel((pixel){x,y}, y%4); |
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
|
|
|
setpixel((pixel){x,y}, b); |
|
|
|
|
|
// wait(1);
|
|
|
// wait(1);
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -76,38 +29,22 @@ void test_palette(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_palette2(){ |
|
|
void test_palette2(){ |
|
|
unsigned char x,y,b; |
|
|
for (unsigned char x=NUM_COLS;x--;){ |
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
for (unsigned char y=NUM_ROWS;y--;){ |
|
|
b=x%4; |
|
|
setpixel((pixel){x,y}, x%4); |
|
|
for (y=0;y<NUM_ROWS;y++){ |
|
|
|
|
|
setpixel((pixel){x,y}, b); |
|
|
|
|
|
// wait(1);
|
|
|
// wait(1);
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
wait(1000); |
|
|
wait(1000); |
|
|
for (x=0;x<NUM_COLS;x++){ |
|
|
for (unsigned char x=NUM_COLS;x--;){ |
|
|
// shift image right
|
|
|
// shift image right
|
|
|
shift_pixmap_l(); |
|
|
shift_pixmap_l(); |
|
|
wait(30); |
|
|
wait(30); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ANIMATION_OFF |
|
|
|
|
|
void off() |
|
|
|
|
|
{ |
|
|
|
|
|
clear_screen(0); |
|
|
|
|
|
|
|
|
|
|
|
while(1) |
|
|
|
|
|
wait(100); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SPIRALE |
|
|
#ifdef ANIMATION_SPIRALE |
|
|
|
|
|
|
|
|
static void walk(cursor_t* cur, unsigned char steps, unsigned int delay){ |
|
|
static void walk(cursor_t* cur, unsigned char steps, unsigned int delay){ |
|
@ -153,6 +90,7 @@ void spirale(unsigned int delay){ |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ANIMATION_JOERN1 |
|
|
#ifdef ANIMATION_JOERN1 |
|
|
void joern1(){ |
|
|
void joern1(){ |
|
|
unsigned char i, j, x; |
|
|
unsigned char i, j, x; |
|
@ -171,6 +109,7 @@ unsigned char i, j, x; |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SCHACHBRETT |
|
|
#ifdef ANIMATION_SCHACHBRETT |
|
|
void schachbrett(unsigned char times){ |
|
|
void schachbrett(unsigned char times){ |
|
|
clear_screen(0); |
|
|
clear_screen(0); |
|
@ -195,7 +134,6 @@ void feuer() |
|
|
unsigned int t; |
|
|
unsigned int t; |
|
|
unsigned char world[NUM_COLS][FEUER_Y]; // double buffer
|
|
|
unsigned char world[NUM_COLS][FEUER_Y]; // double buffer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(t=0; t<800; t++) { |
|
|
for(t=0; t<800; t++) { |
|
|
// diffuse
|
|
|
// diffuse
|
|
|
for(y=1; y<FEUER_Y; y++) { |
|
|
for(y=1; y<FEUER_Y; y++) { |
|
@ -228,8 +166,6 @@ void feuer() |
|
|
/**
|
|
|
/**
|
|
|
* void random_bright(void) |
|
|
* void random_bright(void) |
|
|
* by Daniel Otte |
|
|
* by Daniel Otte |
|
|
* |
|
|
|
|
|
* |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
void random_bright(unsigned cycles){ |
|
|
void random_bright(unsigned cycles){ |
|
|
uint8_t t,x,y; |
|
|
uint8_t t,x,y; |
|
|