more config options; better default profiles

This commit is contained in:
Hans-Gert Dahmen 2011-10-29 05:59:46 +00:00
parent ceffdd6bbf
commit 9efcc251a7
8 changed files with 57 additions and 24 deletions

View File

@ -13,6 +13,13 @@
#include "../util.h" #include "../util.h"
#include "../scrolltext/scrolltext.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 //hackhack
extern can_addr myaddr; extern can_addr myaddr;
@ -62,7 +69,11 @@ void time_anim(void)
//update time and return if we had no success //update time and return if we had no success
if(time_update() == 0) if(time_update() == 0)
{
strcpy_P(timestring, PSTR("</#time animation timeout"));
scrolltext(timestring);
return; return;
}
//convert the time to a string //convert the time to a string
sprintf_P(timestring, PSTR(">+:p42d50/#%02hi#<;+p42d50/# %02hi#x49y8b255p42d50#:"), lap_time_h, lap_time_m); sprintf_P(timestring, PSTR(">+:p42d50/#%02hi#<;+p42d50/# %02hi#x49y8b255p42d50#:"), lap_time_h, lap_time_m);

View File

@ -5,7 +5,10 @@ comment "Animations"
bool "Joern1" ANIMATION_JOERN1 bool "Joern1" ANIMATION_JOERN1
dep_bool_menu "Snake" ANIMATION_SNAKE $RANDOM_SUPPORT 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 endmenu
bool "Schachbrett" ANIMATION_SCHACHBRETT bool "Schachbrett" ANIMATION_SCHACHBRETT
@ -15,6 +18,7 @@ comment "Animations"
int "FEUER_N" FEUER_N 5 int "FEUER_N" FEUER_N 5
int "FEUER_DIV" FEUER_DIV 44 int "FEUER_DIV" FEUER_DIV 44
int "FEUER_DELAY" FEUER_DELAY 50 int "FEUER_DELAY" FEUER_DELAY 50
int "Fire number of cycles" FIRE_CYCLES 800
endmenu endmenu
dep_bool_menu "Matrix" ANIMATION_MATRIX $RANDOM_SUPPORT 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 "Langton Ant" ANIMATION_LTN_ANT $RANDOM_SUPPORT
dep_bool_menu "Time Display" ANIMATION_TIME $SCROLLTEXT_SUPPORT $LAP_TIME_EXTENSION dep_bool_menu "Time Display" ANIMATION_TIME $SCROLLTEXT_SUPPORT $LAP_TIME_EXTENSION
hex "Time master address (hex)" TIME_MASTER_ADDR 0x00 int "Time master address (int)" TIME_MASTER_ADDR 00
int "Request timeout (ms)" TIME_UPDATE_TIMEOUT 23 int "Request timeout (ms)" TIME_UPDATE_TIMEOUT 50
endmenu endmenu
dep_bool_menu "Bitmap Scroller" ANIMATION_BMSCROLLER y $RANDOM_SUPPORT dep_bool_menu "Bitmap Scroller" ANIMATION_BMSCROLLER y $RANDOM_SUPPORT

View File

@ -1,9 +1,9 @@
/** /**
* Conways Game of life * Conways Game of life
* Author: Daniel Otte * Author: Daniel Otte
* License: GPLv3 * License: GPLv3
* *
* *
*/ */
#include <stdint.h> #include <stdint.h>
@ -33,7 +33,7 @@
/* /*
* last line is for debug information * last line is for debug information
*/ */
#ifdef DEBUG #ifdef DEBUG
#undef YSIZE #undef YSIZE
#define YSIZE (UNUM_ROWS-1) #define YSIZE (UNUM_ROWS-1)
#define DEBUG_ROW (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+4, (v)&(1<<4)); \
DEBUG_BIT((s)*8+5, (v)&(1<<5)); \ DEBUG_BIT((s)*8+5, (v)&(1<<5)); \
DEBUG_BIT((s)*8+6, (v)&(1<<6)); \ 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 #else
#define DEBUG_BIT(s,v) #define DEBUG_BIT(s,v)
#define DEBUG_BYTE(s,v) #define DEBUG_BYTE(s,v)
@ -275,7 +275,7 @@ void gameoflife() {
uint8_t ldbuf_idx = 0; uint8_t ldbuf_idx = 0;
uint16_t cycle; uint16_t cycle;
#ifdef GLIDER_TEST #ifdef GLIDER_TEST
/* initialize with glider */ /* initialize with glider */
coord_t x,y; coord_t x,y;
for(y = YSIZE; y--;) { for(y = YSIZE; y--;) {
@ -287,7 +287,7 @@ void gameoflife() {
#else #else
/* initialize the field with random */ /* initialize the field with random */
pfinit(pf1); pfinit(pf1);
#endif #endif
/* the main part */ /* the main part */
pfprint(pf1); pfprint(pf1);

View File

@ -125,6 +125,9 @@ void schachbrett(unsigned char times){
#ifdef ANIMATION_FEUER #ifdef ANIMATION_FEUER
#ifndef FIRE_CYCLES
#define FIRE_CYCLES 800
#endif
#define FEUER_Y (NUM_ROWS + 3) #define FEUER_Y (NUM_ROWS + 3)
void feuer() void feuer()
{ {
@ -132,7 +135,7 @@ 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<FIRE_CYCLES; t++) {
// diffuse // diffuse
for(y=1; y<FEUER_Y; y++) { for(y=1; y<FEUER_Y; y++) {
for(x=1; x<NUM_COLS-1; x++) { for(x=1; x<NUM_COLS-1; x++) {
@ -147,12 +150,12 @@ void feuer()
for(x=0; x<NUM_COLS; x++) { for(x=0; x<NUM_COLS; x++) {
world[x][FEUER_Y-1] = RANDOM8(); world[x][FEUER_Y-1] = RANDOM8();
}; };
// copy to screen // copy to screen
for(y=0; y<NUM_ROWS; y++) { for(y=0; y<NUM_ROWS; y++) {
for(x=0; x<NUM_COLS; x++) { for(x=0; x<NUM_COLS; x++) {
setpixel( (pixel){x,y}, (world[x][y] >> 5) ); setpixel( (pixel){x,y}, (world[x][y] >> 5) );
} }
}; };
wait(FEUER_DELAY); wait(FEUER_DELAY);

View File

@ -89,7 +89,7 @@ void display_loop(){
#endif #endif
time_anim(); time_anim();
break; break;
#else ANIMATION #else
#ifdef ANIMATION_SCROLLTEXT #ifdef ANIMATION_SCROLLTEXT
break; break;
#endif #endif

View File

@ -27,12 +27,18 @@ game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptor
#define SNAKE_NEWCONTROL #define SNAKE_NEWCONTROL
// limits // limits
#define SNAKE_MAX_LENGTH 64u #ifndef SNAKE_MAX_LENGTH
#define SNAKE_MAX_LENGTH 64u
#endif
#define SNAKE_MAX_APPLES 10 #define SNAKE_MAX_APPLES 10
// delays (in milliseconds) // delays (in milliseconds)
#define SNAKE_CYCLE_DELAY 100 #ifndef SNAKE_CYCLE_DELAY
#define SNAKE_TERMINATION_DELAY 60 #define SNAKE_CYCLE_DELAY 100
#endif
#ifndef SNAKE_TERMINATION_DELAY
#define SNAKE_TERMINATION_DELAY 60
#endif
// colors // colors
#define SNAKE_COLOR_BORDER 3 #define SNAKE_COLOR_BORDER 3

View File

@ -75,13 +75,17 @@ ANIMATION_SCROLLTEXT=y
ANIMATION_SPIRALE=y ANIMATION_SPIRALE=y
ANIMATION_JOERN1=y ANIMATION_JOERN1=y
ANIMATION_SNAKE=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_SCHACHBRETT=y
ANIMATION_FEUER=y ANIMATION_FEUER=y
FEUER_S=30 FEUER_S=30
FEUER_N=5 FEUER_N=5
FEUER_DIV=44 FEUER_DIV=44
FEUER_DELAY=50 FEUER_DELAY=50
FIRE_CYCLES=800
ANIMATION_MATRIX=y ANIMATION_MATRIX=y
MATRIX_STREAMER_NUM=30 MATRIX_STREAMER_NUM=30
MATRIX_CYCLES=500 MATRIX_CYCLES=500
@ -89,8 +93,8 @@ ANIMATION_RANDOM_BRIGHT=y
# ANIMATION_STONEFLY is not set # ANIMATION_STONEFLY is not set
# ANIMATION_FLYINGDOTS is not set # ANIMATION_FLYINGDOTS is not set
ANIMATION_GAMEOFLIFE=y ANIMATION_GAMEOFLIFE=y
GOL_DELAY=30 GOL_DELAY=100
GOL_CYCLES=180 GOL_CYCLES=360
# ANIMATION_BREAKOUT is not set # ANIMATION_BREAKOUT is not set
# ANIMATION_MHERWEG is not set # ANIMATION_MHERWEG is not set
# ANIMATION_LTN_ANT is not set # ANIMATION_LTN_ANT is not set

View File

@ -67,27 +67,32 @@ ANIMATION_SCROLLTEXT=y
ANIMATION_SPIRALE=y ANIMATION_SPIRALE=y
ANIMATION_JOERN1=y ANIMATION_JOERN1=y
ANIMATION_SNAKE=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_SCHACHBRETT=y
ANIMATION_FEUER=y ANIMATION_FEUER=y
FEUER_S=30 FEUER_S=30
FEUER_N=5 FEUER_N=5
FEUER_DIV=47 FEUER_DIV=47
FEUER_DELAY=30 FEUER_DELAY=30
FIRE_CYCLES=200
ANIMATION_MATRIX=y ANIMATION_MATRIX=y
STREAMER_NUM=100 MATRIX_STREAMER_NUM=30
MATRIX_CYCLES=250
ANIMATION_RANDOM_BRIGHT=y ANIMATION_RANDOM_BRIGHT=y
# ANIMATION_STONEFLY is not set # ANIMATION_STONEFLY is not set
# ANIMATION_FLYINGDOTS is not set # ANIMATION_FLYINGDOTS is not set
ANIMATION_GAMEOFLIFE=y ANIMATION_GAMEOFLIFE=y
GOL_DELAY=30 GOL_DELAY=12
GOL_CYCLES=180 GOL_CYCLES=180
# ANIMATION_BREAKOUT is not set # ANIMATION_BREAKOUT is not set
# ANIMATION_MHERWEG is not set # ANIMATION_MHERWEG is not set
# ANIMATION_LTN_ANT is not set # ANIMATION_LTN_ANT is not set
ANIMATION_TIME=y ANIMATION_TIME=y
TIME_MASTER_ADDR=00 TIME_MASTER_ADDR=00
TIME_UPDATE_TIMEOUT=100 TIME_UPDATE_TIMEOUT=23
# ANIMATION_BMSCROLLER is not set # ANIMATION_BMSCROLLER is not set
# ANIMATION_LABORLOGO is not set # ANIMATION_LABORLOGO is not set
# ANIMATION_AMPHIBIAN is not set # ANIMATION_AMPHIBIAN is not set