From 9efcc251a7388d071295fc91af74bc123c352962 Mon Sep 17 00:00:00 2001 From: Hans-Gert Dahmen Date: Sat, 29 Oct 2011 05:59:46 +0000 Subject: [PATCH] more config options; better default profiles --- animations/borg_time.c | 11 +++++++++++ animations/config.in | 10 +++++++--- animations/gameoflife.c | 14 +++++++------- animations/programm.c | 9 ++++++--- display_loop.c | 2 +- games/snake/snake_game.c | 12 +++++++++--- profiles/borg-16 | 10 +++++++--- profiles/borg-ls | 13 +++++++++---- 8 files changed, 57 insertions(+), 24 deletions(-) diff --git a/animations/borg_time.c b/animations/borg_time.c index 200a690..6b08b54 100644 --- a/animations/borg_time.c +++ b/animations/borg_time.c @@ -13,6 +13,13 @@ #include "../util.h" #include "../scrolltext/scrolltext.h" +#ifndef TIME_MASTER_ADDR + #define TIME_MASTER_ADDR 0x00 +#endif +#ifndef TIME_UPDATE_TIMEOUT + #define TIME_UPDATE_TIMEOUT 23 +#endif + //hackhack extern can_addr myaddr; @@ -62,7 +69,11 @@ void time_anim(void) //update time and return if we had no success if(time_update() == 0) + { + strcpy_P(timestring, PSTR("+:p42d50/#%02hi#<;+p42d50/# %02hi#x49y8b255p42d50#:"), lap_time_h, lap_time_m); diff --git a/animations/config.in b/animations/config.in index 5892009..a44bf1c 100644 --- a/animations/config.in +++ b/animations/config.in @@ -5,7 +5,10 @@ comment "Animations" bool "Joern1" ANIMATION_JOERN1 dep_bool_menu "Snake" ANIMATION_SNAKE $RANDOM_SUPPORT - int "Snake delay" SNAKE_DELAY 100 + int "Snake round delay" SNAKE_CYCLE_DELAY 100 + int "Snake termination delay" SNAKE_TERMINATION_DELAY 60 + int "Snake max length" SNAKE_MAX_LENGTH 64 + int "Snake max apples" SNAKE_MAX_APPLES 10 endmenu bool "Schachbrett" ANIMATION_SCHACHBRETT @@ -15,6 +18,7 @@ comment "Animations" int "FEUER_N" FEUER_N 5 int "FEUER_DIV" FEUER_DIV 44 int "FEUER_DELAY" FEUER_DELAY 50 + int "Fire number of cycles" FIRE_CYCLES 800 endmenu dep_bool_menu "Matrix" ANIMATION_MATRIX $RANDOM_SUPPORT @@ -34,8 +38,8 @@ comment "Animations" dep_bool "Langton Ant" ANIMATION_LTN_ANT $RANDOM_SUPPORT dep_bool_menu "Time Display" ANIMATION_TIME $SCROLLTEXT_SUPPORT $LAP_TIME_EXTENSION - hex "Time master address (hex)" TIME_MASTER_ADDR 0x00 - int "Request timeout (ms)" TIME_UPDATE_TIMEOUT 23 + int "Time master address (int)" TIME_MASTER_ADDR 00 + int "Request timeout (ms)" TIME_UPDATE_TIMEOUT 50 endmenu dep_bool_menu "Bitmap Scroller" ANIMATION_BMSCROLLER y $RANDOM_SUPPORT diff --git a/animations/gameoflife.c b/animations/gameoflife.c index 453f058..8906fc4 100644 --- a/animations/gameoflife.c +++ b/animations/gameoflife.c @@ -1,9 +1,9 @@ /** - * Conways Game of life + * Conways Game of life * Author: Daniel Otte * License: GPLv3 - * - * + * + * */ #include @@ -33,7 +33,7 @@ /* * last line is for debug information */ -#ifdef DEBUG +#ifdef DEBUG #undef YSIZE #define YSIZE (UNUM_ROWS-1) #define DEBUG_ROW (UNUM_ROWS-1) @@ -47,7 +47,7 @@ DEBUG_BIT((s)*8+4, (v)&(1<<4)); \ DEBUG_BIT((s)*8+5, (v)&(1<<5)); \ DEBUG_BIT((s)*8+6, (v)&(1<<6)); \ - DEBUG_BIT((s)*8+7, (v)&(1<<7)) + DEBUG_BIT((s)*8+7, (v)&(1<<7)) #else #define DEBUG_BIT(s,v) #define DEBUG_BYTE(s,v) @@ -275,7 +275,7 @@ void gameoflife() { uint8_t ldbuf_idx = 0; uint16_t cycle; -#ifdef GLIDER_TEST +#ifdef GLIDER_TEST /* initialize with glider */ coord_t x,y; for(y = YSIZE; y--;) { @@ -287,7 +287,7 @@ void gameoflife() { #else /* initialize the field with random */ pfinit(pf1); -#endif +#endif /* the main part */ pfprint(pf1); diff --git a/animations/programm.c b/animations/programm.c index cb39679..091179e 100644 --- a/animations/programm.c +++ b/animations/programm.c @@ -125,6 +125,9 @@ void schachbrett(unsigned char times){ #ifdef ANIMATION_FEUER +#ifndef FIRE_CYCLES + #define FIRE_CYCLES 800 +#endif #define FEUER_Y (NUM_ROWS + 3) void feuer() { @@ -132,7 +135,7 @@ void feuer() unsigned int t; unsigned char world[NUM_COLS][FEUER_Y]; // double buffer - for(t=0; t<800; t++) { + for(t=0; t> 5) ); - } + } }; wait(FEUER_DELAY); diff --git a/display_loop.c b/display_loop.c index bce7053..f2eb017 100644 --- a/display_loop.c +++ b/display_loop.c @@ -89,7 +89,7 @@ void display_loop(){ #endif time_anim(); break; -#else ANIMATION +#else #ifdef ANIMATION_SCROLLTEXT break; #endif diff --git a/games/snake/snake_game.c b/games/snake/snake_game.c index a627cb6..aafd1c9 100644 --- a/games/snake/snake_game.c +++ b/games/snake/snake_game.c @@ -27,12 +27,18 @@ game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptor #define SNAKE_NEWCONTROL // limits -#define SNAKE_MAX_LENGTH 64u +#ifndef SNAKE_MAX_LENGTH + #define SNAKE_MAX_LENGTH 64u +#endif #define SNAKE_MAX_APPLES 10 // delays (in milliseconds) -#define SNAKE_CYCLE_DELAY 100 -#define SNAKE_TERMINATION_DELAY 60 +#ifndef SNAKE_CYCLE_DELAY + #define SNAKE_CYCLE_DELAY 100 +#endif +#ifndef SNAKE_TERMINATION_DELAY + #define SNAKE_TERMINATION_DELAY 60 +#endif // colors #define SNAKE_COLOR_BORDER 3 diff --git a/profiles/borg-16 b/profiles/borg-16 index 3fee42c..a93bf45 100644 --- a/profiles/borg-16 +++ b/profiles/borg-16 @@ -75,13 +75,17 @@ ANIMATION_SCROLLTEXT=y ANIMATION_SPIRALE=y ANIMATION_JOERN1=y ANIMATION_SNAKE=y -SNAKE_DELAY=100 +SNAKE_CYCLE_DELAY=100 +SNAKE_TERMINATION_DELAY=60 +SNAKE_MAX_LENGTH=64 +SNAKE_MAX_APPLES=10 ANIMATION_SCHACHBRETT=y ANIMATION_FEUER=y FEUER_S=30 FEUER_N=5 FEUER_DIV=44 FEUER_DELAY=50 +FIRE_CYCLES=800 ANIMATION_MATRIX=y MATRIX_STREAMER_NUM=30 MATRIX_CYCLES=500 @@ -89,8 +93,8 @@ ANIMATION_RANDOM_BRIGHT=y # ANIMATION_STONEFLY is not set # ANIMATION_FLYINGDOTS is not set ANIMATION_GAMEOFLIFE=y -GOL_DELAY=30 -GOL_CYCLES=180 +GOL_DELAY=100 +GOL_CYCLES=360 # ANIMATION_BREAKOUT is not set # ANIMATION_MHERWEG is not set # ANIMATION_LTN_ANT is not set diff --git a/profiles/borg-ls b/profiles/borg-ls index 5230f8e..8f2ebb1 100644 --- a/profiles/borg-ls +++ b/profiles/borg-ls @@ -67,27 +67,32 @@ ANIMATION_SCROLLTEXT=y ANIMATION_SPIRALE=y ANIMATION_JOERN1=y ANIMATION_SNAKE=y -SNAKE_DELAY=50 +SNAKE_CYCLE_DELAY=50 +SNAKE_TERMINATION_DELAY=60 +SNAKE_MAX_LENGTH=64 +SNAKE_MAX_APPLES=10 ANIMATION_SCHACHBRETT=y ANIMATION_FEUER=y FEUER_S=30 FEUER_N=5 FEUER_DIV=47 FEUER_DELAY=30 +FIRE_CYCLES=200 ANIMATION_MATRIX=y -STREAMER_NUM=100 +MATRIX_STREAMER_NUM=30 +MATRIX_CYCLES=250 ANIMATION_RANDOM_BRIGHT=y # ANIMATION_STONEFLY is not set # ANIMATION_FLYINGDOTS is not set ANIMATION_GAMEOFLIFE=y -GOL_DELAY=30 +GOL_DELAY=12 GOL_CYCLES=180 # ANIMATION_BREAKOUT is not set # ANIMATION_MHERWEG is not set # ANIMATION_LTN_ANT is not set ANIMATION_TIME=y TIME_MASTER_ADDR=00 -TIME_UPDATE_TIMEOUT=100 +TIME_UPDATE_TIMEOUT=23 # ANIMATION_BMSCROLLER is not set # ANIMATION_LABORLOGO is not set # ANIMATION_AMPHIBIAN is not set