2008-12-04 03:34:55 +00:00
|
|
|
|
|
|
|
#include <setjmp.h>
|
2008-12-05 02:53:09 +00:00
|
|
|
#include <stdio.h>
|
2008-12-04 03:34:55 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "scrolltext/scrolltext.h"
|
|
|
|
#include "animations/programm.h"
|
|
|
|
#include "animations/matrix.h"
|
|
|
|
#include "animations/gameoflife.h"
|
|
|
|
#include "borg_hw/borg_hw.h"
|
|
|
|
#include "can/borg_can.h"
|
|
|
|
#include "random/prng.h"
|
|
|
|
#include "random/persistentCounter.h"
|
|
|
|
#include "mcuf/mcuf.h"
|
|
|
|
#include "menu/menu.h"
|
|
|
|
#include "pixel.h"
|
2009-01-02 02:18:20 +00:00
|
|
|
#include "joystick/joystick.h"
|
2008-12-04 03:34:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
volatile unsigned char oldMode, oldOldmode, mode;
|
|
|
|
|
|
|
|
jmp_buf newmode_jmpbuf;
|
|
|
|
|
|
|
|
void display_loop(){
|
|
|
|
// mcuf_serial_mode();
|
|
|
|
|
2009-02-19 00:46:02 +00:00
|
|
|
mode = setjmp(newmode_jmpbuf);
|
2008-12-04 03:34:55 +00:00
|
|
|
oldOldmode = oldMode;
|
2009-02-19 00:54:57 +00:00
|
|
|
|
2009-01-01 17:06:38 +00:00
|
|
|
#ifdef JOYSTICK_SUPPORT
|
2008-12-04 03:34:55 +00:00
|
|
|
waitForFire = 1;
|
2009-01-01 17:06:38 +00:00
|
|
|
#endif
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
for(;;){
|
|
|
|
oldMode = mode;
|
|
|
|
switch(mode++) {
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SCROLLTEXT
|
|
|
|
case 1:
|
|
|
|
scrolltext(scrolltext_text);
|
2008-12-05 14:17:04 +00:00
|
|
|
|
|
|
|
#ifdef RANDOM_SUPPORT
|
|
|
|
{ char a[14];
|
|
|
|
sprintf(a,"</# counter == %lu ", percnt_get());
|
|
|
|
scrolltext(a);
|
|
|
|
}
|
|
|
|
#endif
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SPIRALE
|
|
|
|
case 2:
|
|
|
|
spirale(5);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_JOERN1
|
|
|
|
case 3:
|
|
|
|
joern1();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SNAKE
|
|
|
|
case 4:
|
|
|
|
snake();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_SCHACHBRETT
|
|
|
|
case 5:
|
2009-02-25 23:49:59 +00:00
|
|
|
schachbrett(10);
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_FEUER
|
|
|
|
case 6:
|
|
|
|
feuer();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_MATRIX
|
|
|
|
case 7:
|
|
|
|
matrix();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_RANDOM_BRIGHT
|
|
|
|
case 8:
|
2009-02-25 23:49:59 +00:00
|
|
|
random_bright(30);
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_GAMEOFLIFE
|
|
|
|
case 9:
|
|
|
|
gameoflife();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2009-06-19 21:09:08 +00:00
|
|
|
#ifdef ANIMATION_MHERWEG
|
2009-02-25 23:49:59 +00:00
|
|
|
case 10:
|
|
|
|
flydots();
|
|
|
|
lines1();
|
|
|
|
dots1();
|
|
|
|
movinglines();
|
|
|
|
checkbox();
|
|
|
|
rectangle1();
|
|
|
|
rectangles();
|
|
|
|
break;
|
2009-06-19 21:09:08 +00:00
|
|
|
#endif
|
2008-12-04 03:34:55 +00:00
|
|
|
case 29:
|
2009-02-18 22:26:46 +00:00
|
|
|
// mode = 1;
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef ANIMATION_TESTS
|
|
|
|
case 31:
|
2009-02-18 22:26:46 +00:00
|
|
|
//test_level1();
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
2009-02-18 22:26:46 +00:00
|
|
|
//test_level2();
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
case 33:
|
2009-02-18 22:26:46 +00:00
|
|
|
//test_level3();
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
case 35:
|
2009-02-18 22:26:46 +00:00
|
|
|
test_palette();
|
|
|
|
test_palette2();
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ANIMATION_OFF
|
|
|
|
case 0xFF:
|
|
|
|
off();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MENU_SUPPORT
|
|
|
|
case 43:
|
|
|
|
menu();
|
|
|
|
mode = oldOldmode;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|