Browse Source

more config options; better default profiles

feature/2015
Hans-Gert Dahmen 13 years ago
parent
commit
9efcc251a7
  1. 11
      animations/borg_time.c
  2. 10
      animations/config.in
  3. 14
      animations/gameoflife.c
  4. 9
      animations/programm.c
  5. 2
      display_loop.c
  6. 12
      games/snake/snake_game.c
  7. 10
      profiles/borg-16
  8. 13
      profiles/borg-ls

11
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("</#time animation timeout"));
scrolltext(timestring);
return;
}
//convert the time to a string
sprintf_P(timestring, PSTR(">+:p42d50/#%02hi#<;+p42d50/# %02hi#x49y8b255p42d50#:"), lap_time_h, lap_time_m);

10
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

14
animations/gameoflife.c

@ -1,9 +1,9 @@
/**
* Conways Game of life
* Conways Game of life
* Author: Daniel Otte
* License: GPLv3
*
*
*
*
*/
#include <stdint.h>
@ -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);

9
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<FIRE_CYCLES; t++) {
// diffuse
for(y=1; y<FEUER_Y; y++) {
for(x=1; x<NUM_COLS-1; x++) {
@ -147,12 +150,12 @@ void feuer()
for(x=0; x<NUM_COLS; x++) {
world[x][FEUER_Y-1] = RANDOM8();
};
// copy to screen
for(y=0; y<NUM_ROWS; y++) {
for(x=0; x<NUM_COLS; x++) {
setpixel( (pixel){x,y}, (world[x][y] >> 5) );
}
}
};
wait(FEUER_DELAY);

2
display_loop.c

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

12
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

10
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

13
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

Loading…
Cancel
Save