small cleanups

This commit is contained in:
Christian Kroll 2011-02-25 22:57:49 +00:00
parent b3276d75d4
commit 1c3d4978c5
3 changed files with 37 additions and 118 deletions

View File

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

View File

@ -1,41 +1,24 @@
#ifndef PROGRAMM_H_
#define PROGRAMM_H_
void off();
void spirale(unsigned int delay);
void joern1();
void joern2();
void draw_line( unsigned char yabs, signed char delta);
void schachbrett(unsigned char times);
void test1();
void test_level1();
void test_level2();
void test_level3();
void test_levels();
void test_level(unsigned char level);
void test_palette();
void test_palette2();
// randon dots appear and stay
void dots1();
#ifdef ANIMATION_OFF
inline static void off()
{
clear_screen(0);
// rectangle-pattern
void rectangle1();
while(1)
wait(100);
// random rectangles
void rectangles();
}
#endif
// lines show and disappear quickly
void lines1();
// 8x8 rectangle with a cross inside
void checkbox();
// a scanner effect with moving h & v lines
void movinglines();
void snake();
void matrix();
void fadein();
void spirale(unsigned int delay);
void joern1();
void schachbrett(unsigned char times);
void feuer();
void random_bright(unsigned cycles);

View File

@ -173,23 +173,23 @@ void display_loop(){
#ifdef ANIMATION_TESTS
case 31:
test_level1();
test_level(1);
break;
case 32:
test_level2();
test_level(2);
break;
case 33:
test_level3();
test_level(3);
break;
case 35:
test_palette();
test_palette2();
break;
#endif
#ifdef MENU_SUPPORT
case 42:
mode = 1;