Browse Source

made some parameters like plasma frame delays configurable

feature/2015
Christian Kroll 13 years ago
parent
commit
131fe546b0
  1. 2
      Doxyfile
  2. 13
      animations/config.in
  3. 34
      animations/fpmath_patterns.c
  4. 16
      profiles/borg-16
  5. 14
      profiles/borg-andre

2
Doxyfile

@ -38,7 +38,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Firmware for the AVR based Borg devices of LABOR e.V."
PROJECT_BRIEF = "Firmware for the AVR based Borg devices of \"Das LABOR e.V.\""
# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not

13
animations/config.in

@ -56,8 +56,17 @@ comment "Animations"
dep_bool "Fairydust" ANIMATION_FAIRYDUST $ANIMATION_BMSCROLLER
endmenu
bool "Plasma" ANIMATION_PLASMA
bool "Psychedelic" ANIMATION_PSYCHEDELIC
mainmenu_option next_comment
comment "Fixed-point math patterns"
bool "Double Buffering" FP_DOUBLE_BUFFERING 1
bool "Plasma" ANIMATION_PLASMA $ANIMATION_FIXEDPOINT
int "Additional Frame Delay (in ms) For Plasma" FP_PLASMA_DELAY 1
bool "Psychedelic" ANIMATION_PSYCHEDELIC $ANIMATION_FIXEDPOINT
int "Additional Frame Delay (in ms) For Psychedelic" FP_PSYCHO_DELAY 15
endmenu
bool "Black Hole" ANIMATION_BLACKHOLE
comment "Special Animations"

34
animations/fpmath_patterns.c

@ -18,20 +18,22 @@
#include "fpmath_patterns.h"
/**
#ifdef DOXYGEN
/**
* Double buffering helps in reducing the effect of visibly redrawing every
* frame. With this option turned on, a frame is rendered into an off-screen
* buffer first and then copied to the actual frame buffer in one piece.
* However, given the borg's graphics architecture, half painted frames may
* still occur, but they are barely noticeable with this option enabled.
*
* Turn this off (#undef DOUBLE_BUFFERING) if you prefer speed over beauty.
* Turn this off if you prefer speed over beauty.
*/
#define DOUBLE_BUFFERING
#define FP_DOUBLE_BUFFERING
#endif DOXYGEN
#ifdef LOW_PRECISION
#undef LOW_PRECISION
#ifdef FP_LOW_PRECISION
#undef FP_LOW_PRECISION
#endif
#if NUM_COLS <= 16 && NUM_ROWS <= 16
@ -49,10 +51,10 @@
* ability to store every interim result as Q23.8. Most operations like
* square root, sine, cosine, multiplication etc. utilize 32 bit types.
*/
#define LOW_PRECISION
#define FP_LOW_PRECISION
#endif
#ifdef LOW_PRECISION
#ifdef FP_LOW_PRECISION
/** This is the type we expect ordinary integers to be. */
typedef int16_t ordinary_int_t;
/** This is the type which we use for fixed-point values. */
@ -328,7 +330,7 @@ typedef unsigned char (*fpmath_pattern_func_t)(unsigned char const x,
fixp_t const t,
void *const r);
#ifdef DOUBLE_BUFFERING
#ifdef FP_DOUBLE_BUFFERING
# define BUFFER pixmap_buffer
#else
# define BUFFER pixmap
@ -351,7 +353,7 @@ static void fixPattern(fixp_t const t_start,
fpmath_pattern_func_t fpPattern,
void *r)
{
#ifdef DOUBLE_BUFFERING
#ifdef FP_DOUBLE_BUFFERING
// double buffering to reduce half painted pictures
unsigned char pixmap_buffer[NUMPLANE][NUM_ROWS][LINEBYTES];
#endif
@ -376,7 +378,7 @@ static void fixPattern(fixp_t const t_start,
}
}
#ifdef DOUBLE_BUFFERING
#ifdef FP_DOUBLE_BUFFERING
memcpy(pixmap, pixmap_buffer, sizeof(pixmap));
#endif
@ -471,7 +473,11 @@ void plasma(void)
#ifndef __AVR__
fixPattern(0, fixScaleUp(75), 0.1 * FIX, 80, fixAnimPlasma, &r);
#else
fixPattern(0, fixScaleUp(60), 0.1 * FIX, 1, fixAnimPlasma, &r);
#ifndef FP_PSYCHO_DELAY
#define FP_PSYCHO_DELAY 1
#endif
fixPattern(0, fixScaleUp(60), 0.1 * FIX,
FP_PSYCHO_DELAY, fixAnimPlasma, &r);
#endif /* __AVR__ */
}
@ -535,7 +541,11 @@ void psychedelic(void)
#ifndef __AVR__
fixPattern(0, fixScaleUp(75), 0.1 * FIX, 80, fixAnimPsychedelic, &r);
#else
fixPattern(0, fixScaleUp(60), 0.1 * FIX, 15, fixAnimPsychedelic, &r);
#ifndef FP_PLASMA_DELAY
#define FP_PLASMA_DELAY 15
#endif
fixPattern(0, fixScaleUp(60), 0.1 * FIX, FP_PLASMA_DELAY,
fixAnimPsychedelic, &r);
#endif /* __AVR__ */
}

16
profiles/borg-16

@ -41,6 +41,7 @@ SCROLLTEXT_BUFFER_SIZE=128
SCROLL_X_SPEED=20
SCROLL_Y_SPEED=20
SCROLLTEXT_TEXT="</#www.das-labor.org"
# RFM12_SUPPORT is not set
JOYSTICK_SUPPORT=y
PARALLEL_JOYSTICK_SUPPORT=y
JOYSTICK_PIN_UP=PINB
@ -54,14 +55,15 @@ JOYSTICK_BIT_RIGHT=3
JOYSTICK_PIN_FIRE=PIND
JOYSTICK_BIT_FIRE=3
# NES_PAD_SUPPORT is not set
# RFM12_JOYSTICK_SUPPORT is not set
# CAN_SUPPORT is not set
MENU_SUPPORT=y
#
# Games
#
# GAME_TETRIS_CORE is not set
# GAME_TETRIS is not set
GAME_TETRIS_CORE=y
GAME_TETRIS=y
# GAME_BASTET is not set
# GAME_TETRIS_FP is not set
GAME_SPACE_INVADERS=y
@ -107,9 +109,17 @@ ANIMATION_BMSCROLLER=y
ANIMATION_LABORLOGO=y
# ANIMATION_AMPHIBIAN is not set
# ANIMATION_LOGO_OOS is not set
# ANIMATION_LOGO_28C3 is not set
ANIMATION_FAIRYDUST=y
#
# Fixed-point math patterns
#
FP_DOUBLE_BUFFERING=y
ANIMATION_PLASMA=y
FP_PLASMA_DELAY=1
ANIMATION_PSYCHEDELIC=y
FP_PSYCHO_DELAY=15
# ANIMATION_BLACKHOLE is not set
ANIMATION_TESTS=y
ANIMATION_OFF=y

14
profiles/borg-andre

@ -38,6 +38,7 @@ SCROLLTEXT_BUFFER_SIZE=128
SCROLL_X_SPEED=20
SCROLL_Y_SPEED=20
SCROLLTEXT_TEXT="</#www.das-labor.org"
# RFM12_SUPPORT is not set
JOYSTICK_SUPPORT=y
PARALLEL_JOYSTICK_SUPPORT=y
JOYSTICK_PIN_UP=PINB
@ -51,6 +52,7 @@ JOYSTICK_BIT_RIGHT=3
JOYSTICK_PIN_FIRE=PIND
JOYSTICK_BIT_FIRE=3
# NES_PAD_SUPPORT is not set
# RFM12_JOYSTICK_SUPPORT is not set
# CAN_SUPPORT is not set
MENU_SUPPORT=y
@ -103,10 +105,18 @@ TIME_UPDATE_TIMEOUT=50
ANIMATION_BMSCROLLER=y
ANIMATION_LABORLOGO=y
ANIMATION_AMPHIBIAN=y
ANIMATION_LOGO_OOS=y
# ANIMATION_LOGO_28C3 is not set
# ANIMATION_LOGO_OOS is not set
ANIMATION_FAIRYDUST=y
#
# Fixed-point math patterns
#
FP_DOUBLE_BUFFERING=y
ANIMATION_PLASMA=y
FP_PLASMA_DELAY=1
ANIMATION_PSYCHEDELIC=y
FP_PSYCHO_DELAY=15
ANIMATION_BLACKHOLE=y
# ANIMATION_TESTS is not set
# ANIMATION_OFF is not set

Loading…
Cancel
Save