Browse Source

borg_hw_borg16.c: slightly higher contrast for Borg16 (optional)

feature/2015
Christian Kroll 10 years ago
parent
commit
47d9b5e548
  1. 18
      config.in
  2. 4
      profiles/CTDO-Borg
  3. 31
      src/borg_hw/borg_hw_borg16.c
  4. 2
      src/borg_hw/config_borg16.in

18
config.in

@ -6,19 +6,23 @@ comment "General Setup"
#bool 'Prompt for experimental code' CONFIG_EXPERIMENTAL #bool 'Prompt for experimental code' CONFIG_EXPERIMENTAL
choice 'Target MCU' \ choice 'Target MCU' \
"ATmega8 atmega8 \ "ATmega8 atmega8 \
ATmega16 atmega16 \ ATmega16 atmega16 \
ATmega168 atmega168 \ ATmega164 atmega164 \
ATmega168P atmega168p \ ATmega164P atmega164p \
ATmega168 atmega168 \
ATmega168P atmega168p \
ATmega32 atmega32 \ ATmega32 atmega32 \
ATmega324 atmega324 \
ATmega324P atmega324p \
ATmega32U4 atmega32u4 \ ATmega32U4 atmega32u4 \
ATmega328 atmega328 \ ATmega328 atmega328 \
ATmega328p atmega328p \ ATmega328P atmega328p \
ATmega644 atmega644 \ ATmega644 atmega644 \
ATmega644p atmega644p \ ATmega644P atmega644p \
ATmega1280 atmega1280 \ ATmega1280 atmega1280 \
ATmega1284 atmega1284 \ ATmega1284 atmega1284 \
ATmega1284p atmega1284p \ ATmega1284P atmega1284p \
ATmega2560 atmega2560 \ ATmega2560 atmega2560 \
ATmega8515 atmega8515" \ ATmega8515 atmega8515" \
'ATmega32' MCU 'ATmega32' MCU

4
profiles/CTDO-Borg

@ -19,6 +19,7 @@ BORG_HW=HW_BORG_16
# #
# Borg16 port setup # Borg16 port setup
# #
HIGH_CONTRAST=y
UART_SUPPORT=y UART_SUPPORT=y
UART_BAUDRATE_SETTING=19200 UART_BAUDRATE_SETTING=19200
COLPORT1=PORTC COLPORT1=PORTC
@ -86,6 +87,8 @@ GAME_BASTET=y
GAME_TETRIS_FP=y GAME_TETRIS_FP=y
GAME_SPACE_INVADERS=y GAME_SPACE_INVADERS=y
GAME_SNAKE=y GAME_SNAKE=y
# SNAKE_POV_CONTROL is not set
SNAKE_GAME_DELAY=200
GAME_BREAKOUT=y GAME_BREAKOUT=y
GAME_KART=y GAME_KART=y
@ -97,7 +100,6 @@ ANIMATION_SPIRAL=y
SPIRAL_DELAY=5 SPIRAL_DELAY=5
ANIMATION_JOERN1=y ANIMATION_JOERN1=y
ANIMATION_SNAKE=y ANIMATION_SNAKE=y
SNAKE_GAME_DELAY=200
SNAKE_ANIM_DELAY=100 SNAKE_ANIM_DELAY=100
SNAKE_TERMINATION_DELAY=60 SNAKE_TERMINATION_DELAY=60
SNAKE_MAX_LENGTH=64 SNAKE_MAX_LENGTH=64

31
src/borg_hw/borg_hw_borg16.c

@ -33,7 +33,14 @@
#define COLDDR2 DDR(COLPORT2) #define COLDDR2 DDR(COLPORT2)
#define ROWDDR DDR(ROWPORT) #define ROWDDR DDR(ROWPORT)
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) || (__AVR_ATmega1284P__) || defined (__AVR_ATmega1284__) #if defined(__AVR_ATmega164__) || \
defined(__AVR_ATmega164P__) || \
defined(__AVR_ATmega324__) || \
defined(__AVR_ATmega324P__) || \
defined(__AVR_ATmega644__) || \
defined(__AVR_ATmega644P__) || \
defined(__AVR_ATmega1284__) || \
defined(__AVR_ATmega1284P__)
/* more ifdef magic :-( */ /* more ifdef magic :-( */
#define OCR0 OCR0A #define OCR0 OCR0A
#define TIMER0_COMP_vect TIMER0_COMPA_vect #define TIMER0_COMP_vect TIMER0_COMPA_vect
@ -84,7 +91,11 @@ static void nextrow(uint8_t row) {
static void rowshow(unsigned char row, unsigned char plane) { static void rowshow(unsigned char row, unsigned char plane) {
// depending on the currently drawn plane, display the row for a specific // depending on the currently drawn plane, display the row for a specific
// amount of time // amount of time
#ifdef HIGH_CONTRAST
static unsigned char const ocr_table[] = {2, 5, 22};
#else
static unsigned char const ocr_table[] = {3, 4, 22}; static unsigned char const ocr_table[] = {3, 4, 22};
#endif
OCR0 = ocr_table[plane]; OCR0 = ocr_table[plane];
// output data of the current row to the column drivers // output data of the current row to the column drivers
@ -153,7 +164,14 @@ void timer0_off() {
COLPORT2 = 0; COLPORT2 = 0;
ROWPORT = 0; ROWPORT = 0;
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) || (__AVR_ATmega1284P__) || defined (__AVR_ATmega1284__) #if defined(__AVR_ATmega164__) || \
defined(__AVR_ATmega164P__) || \
defined(__AVR_ATmega324__) || \
defined(__AVR_ATmega324P__) || \
defined(__AVR_ATmega644__) || \
defined(__AVR_ATmega644P__) || \
defined(__AVR_ATmega1284__) || \
defined(__AVR_ATmega1284P__)
TCCR0A = 0x00; TCCR0A = 0x00;
TCCR0B = 0x00; TCCR0B = 0x00;
#else #else
@ -175,7 +193,14 @@ static void timer0_on() {
1 0 1 clk/1024 1 0 1 clk/1024
*/ */
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) || (__AVR_ATmega1284P__) || defined (__AVR_ATmega1284__) #if defined(__AVR_ATmega164__) || \
defined(__AVR_ATmega164P__) || \
defined(__AVR_ATmega324__) || \
defined(__AVR_ATmega324P__) || \
defined(__AVR_ATmega644__) || \
defined(__AVR_ATmega644P__) || \
defined(__AVR_ATmega1284__) || \
defined(__AVR_ATmega1284P__)
TCCR0A = 0x02; // CTC Mode TCCR0A = 0x02; // CTC Mode
TCCR0B = 0x04; // clk/256 TCCR0B = 0x04; // clk/256
TCNT0 = 0; // reset timer TCNT0 = 0; // reset timer

2
src/borg_hw/config_borg16.in

@ -17,6 +17,8 @@ comment "Borg16 port setup"
#//das dier sind die individuellen Dateneingänge für die Schieberegister #//das dier sind die individuellen Dateneingänge für die Schieberegister
#define PIN_SHFT1 PD7 #define PIN_SHFT1 PD7
bool "Higher Contrast" HIGH_CONTRAST n
bool "UART Support" UART_SUPPORT n bool "UART Support" UART_SUPPORT n
choice 'Baud Rate' \ choice 'Baud Rate' \
"2400 2400 \ "2400 2400 \

Loading…
Cancel
Save