Browse Source

Fixed a couple of compile errors with avr-gcc 4.6.1

feature/2015
alu 13 years ago
parent
commit
5265dd318c
  1. 20
      animations/amphibian.c
  2. 113
      animations/laborlogo.c
  3. 2
      games/breakout/breakout.c
  4. 2
      games/snake/snake_game.c
  5. 2
      games/space_invaders/invaders2.c
  6. 2
      games/tetris/variant_bastet.c
  7. 2
      games/tetris/variant_fp.c
  8. 2
      games/tetris/variant_std.c
  9. 4
      scrolltext/font_arial8.c
  10. 4
      scrolltext/scrolltext3.c

20
animations/amphibian.c

@ -6,15 +6,7 @@
#include "amphibian.h" #include "amphibian.h"
static uint8_t amphibian_getChunk(unsigned char const nBitPlane, static const uint8_t aBitmap [2][38][6] PROGMEM =
unsigned char const nChunkX,
unsigned char const nChunkY,
unsigned int const nFrame)
{
assert(nChunkX < 6);
assert(nChunkY < 38);
static uint8_t aBitmap [2][38][6] PROGMEM =
{{{0x00, 0x00, 0x24, 0x00, 0x00, 0x00}, // bit plane 0 {{{0x00, 0x00, 0x24, 0x00, 0x00, 0x00}, // bit plane 0
{0x00, 0x20, 0x3C, 0x00, 0x00, 0x00}, {0x00, 0x20, 0x3C, 0x00, 0x00, 0x00},
{0x07, 0x30, 0x47, 0x00, 0x00, 0x00}, {0x07, 0x30, 0x47, 0x00, 0x00, 0x00},
@ -93,7 +85,7 @@ static uint8_t amphibian_getChunk(unsigned char const nBitPlane,
{0x00, 0x00, 0x60, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x60, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x80, 0x00, 0x00, 0x00}}}; {0x00, 0x00, 0x80, 0x00, 0x00, 0x00}}};
static uint8_t aEye[2][16][3] PROGMEM = static const uint8_t aEye[2][16][3] PROGMEM =
{{{0x07, 0xF0, 0x67}, // frame 1 (bit plane 0) {{{0x07, 0xF0, 0x67}, // frame 1 (bit plane 0)
{0x03, 0xC0, 0xC3}, {0x03, 0xC0, 0xC3},
{0x04, 0x19, 0xA7}, {0x04, 0x19, 0xA7},
@ -128,6 +120,14 @@ static uint8_t amphibian_getChunk(unsigned char const nBitPlane,
{0x06, 0x30, 0xC6}, {0x06, 0x30, 0xC6},
{0x07, 0xF0, 0xFE}}}; {0x07, 0xF0, 0xFE}}};
static uint8_t amphibian_getChunk(unsigned char const nBitPlane,
unsigned char const nChunkX,
unsigned char const nChunkY,
unsigned int const nFrame)
{
assert(nChunkX < 6);
assert(nChunkY < 38);
static uint8_t const nOffsetTable[] PROGMEM = static uint8_t const nOffsetTable[] PROGMEM =
{UINT8_MAX, 0, 4, 8, 12, 8, 4, 0}; {UINT8_MAX, 0, 4, 8, 12, 8, 4, 0};
uint8_t const nOffset = pgm_read_byte(&nOffsetTable[(nFrame >> 1) % 8]); uint8_t const nOffset = pgm_read_byte(&nOffsetTable[(nFrame >> 1) % 8]);

113
animations/laborlogo.c

@ -5,69 +5,68 @@
#include "bitmapscroller.h" #include "bitmapscroller.h"
#include "laborlogo.h" #include "laborlogo.h"
static const uint8_t aBitmap[48][6] PROGMEM =
{{0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF},
{0xFF, 0xFF, 0x00, 0xF8, 0xFF, 0xFF},
{0xFF, 0xF8, 0x00, 0xFF, 0x1F, 0xFF},
{0xFF, 0xF0, 0x00, 0xFF, 0xEF, 0xFF},
{0xFF, 0xC0, 0x00, 0xFF, 0xF3, 0xFF},
{0xFF, 0x80, 0x00, 0xFF, 0xFD, 0xFF},
{0xFF, 0x00, 0x00, 0xFF, 0xFE, 0xFF},
{0xFE, 0x00, 0x03, 0x3F, 0xFF, 0x7F},
{0xFC, 0x00, 0x04, 0xDF, 0xFF, 0xBF},
{0xF8, 0x00, 0x08, 0xEF, 0xFF, 0xDF},
{0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF},
{0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF},
{0xE0, 0xC0, 0x10, 0xF7, 0xFF, 0xF7},
{0xC0, 0xC0, 0x10, 0xF7, 0xFF, 0xFB},
{0xC0, 0x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3, 0xFF},
{0xFF, 0xF0, 0x00, 0xFF, 0xEF, 0xFF},
{0xFF, 0xF8, 0x00, 0xFF, 0x1F, 0xFF},
{0xFF, 0xFF, 0x00, 0xF8, 0xFF, 0xFF},
{0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF}};
static uint8_t laborlogo_getChunk(unsigned char const nBitPlane, static uint8_t laborlogo_getChunk(unsigned char const nBitPlane,
unsigned char const nChunkX, unsigned char const nChunkX,
unsigned char const nChunkY, unsigned char const nChunkY,
unsigned int const nFrame) unsigned int const nFrame)
{ {
assert(nChunkX < 6); assert(nChunkX < 6);
assert(nChunkY < 48); assert(nChunkY < 48);
static uint8_t aBitmap[48][6] PROGMEM = return pgm_read_byte(&aBitmap[nChunkY][nChunkX]);
{{0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF},
{0xFF, 0xFF, 0x00, 0xF8, 0xFF, 0xFF},
{0xFF, 0xF8, 0x00, 0xFF, 0x1F, 0xFF},
{0xFF, 0xF0, 0x00, 0xFF, 0xEF, 0xFF},
{0xFF, 0xC0, 0x00, 0xFF, 0xF3, 0xFF},
{0xFF, 0x80, 0x00, 0xFF, 0xFD, 0xFF},
{0xFF, 0x00, 0x00, 0xFF, 0xFE, 0xFF},
{0xFE, 0x00, 0x03, 0x3F, 0xFF, 0x7F},
{0xFC, 0x00, 0x04, 0xDF, 0xFF, 0xBF},
{0xF8, 0x00, 0x08, 0xEF, 0xFF, 0xDF},
{0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF},
{0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF},
{0xE0, 0xC0, 0x10, 0xF7, 0xFF, 0xF7},
{0xC0, 0xC0, 0x10, 0xF7, 0xFF, 0xFB},
{0xC0, 0x40, 0x08, 0xEF, 0xFF, 0xFB},
{0xC0, 0x40, 0x04, 0xDF, 0xFF, 0xFB},
{0x80, 0x40, 0x03, 0x3F, 0xFF, 0xFD},
{0x87, 0xFC, 0x00, 0xFF, 0xF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F, 0xFF, 0xE0, 0x07, 0xFF, 0xFF}};
return pgm_read_byte(&aBitmap[nChunkY][nChunkX]);
} }
void laborlogo() void laborlogo()
{ {
bitmap_scroll(48, 48, 2, 400, 75, laborlogo_getChunk); bitmap_scroll(48, 48, 2, 400, 75, laborlogo_getChunk);
} }

2
games/breakout/breakout.c

@ -21,7 +21,7 @@
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
//static uint8_t breakout_icon[8] PROGMEM = {0x03, 0x03, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}; /* our Icon */ //static uint8_t breakout_icon[8] PROGMEM = {0x03, 0x03, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}; /* our Icon */
static uint8_t breakout_icon[8] PROGMEM = {0x00, 0x18, 0x18, 0x00, 0x00, 0xff, 0xff, 0x00}; /* our Icon */ static const uint8_t breakout_icon[8] PROGMEM = {0x00, 0x18, 0x18, 0x00, 0x00, 0xff, 0xff, 0x00}; /* our Icon */
game_descriptor_t breakout_game_descriptor __attribute__((section(".game_descriptors"))) = game_descriptor_t breakout_game_descriptor __attribute__((section(".game_descriptors"))) =
{ {

2
games/snake/snake_game.c

@ -11,7 +11,7 @@
#if defined MENU_SUPPORT && defined GAME_SNAKE #if defined MENU_SUPPORT && defined GAME_SNAKE
// snake icon (MSB is leftmost pixel) // snake icon (MSB is leftmost pixel)
static uint8_t icon[8] PROGMEM = static const uint8_t icon[8] PROGMEM =
{0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xad, 0xa1, 0xbf}; {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xad, 0xa1, 0xbf};
game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptors"))) = game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptors"))) =

2
games/space_invaders/invaders2.c

@ -12,7 +12,7 @@ void borg_invaders();
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
// MSB is leftmost pixel // MSB is leftmost pixel
static uint8_t icon[8] PROGMEM = static const uint8_t icon[8] PROGMEM =
{0x66, 0x18, 0x3c, 0x5a, 0xff, 0xbd, 0xa5, 0x18}; // Invaders icon {0x66, 0x18, 0x3c, 0x5a, 0xff, 0xbd, 0xa5, 0x18}; // Invaders icon
game_descriptor_t invaders_game_descriptor __attribute__((section(".game_descriptors"))) ={ game_descriptor_t invaders_game_descriptor __attribute__((section(".game_descriptors"))) ={

2
games/tetris/variant_bastet.c

@ -257,7 +257,7 @@ static void tetris_bastet_evaluatePieces(tetris_bastet_variant_t *pBastet)
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
// Bastet icon, MSB is leftmost pixel // Bastet icon, MSB is leftmost pixel
static uint8_t bastet_icon[8] PROGMEM = static const uint8_t bastet_icon[8] PROGMEM =
{ 0x81, 0xc3, 0xff, 0x99, 0xff, 0xff, 0x66, 0x3c }; { 0x81, 0xc3, 0xff, 0x99, 0xff, 0xff, 0x66, 0x3c };
game_descriptor_t bastet_game_descriptor game_descriptor_t bastet_game_descriptor
__attribute__((section(".game_descriptors"))) = __attribute__((section(".game_descriptors"))) =

2
games/tetris/variant_fp.c

@ -21,7 +21,7 @@
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
// First Person Tetris icon, MSB is leftmost pixel // First Person Tetris icon, MSB is leftmost pixel
static uint8_t tetrisfp_icon[8] PROGMEM = static const uint8_t tetrisfp_icon[8] PROGMEM =
{ 0xee, 0x89, 0xee, 0x88, 0x88, 0x20, 0x2c, 0x6c }; { 0xee, 0x89, 0xee, 0x88, 0x88, 0x20, 0x2c, 0x6c };
game_descriptor_t tetrisfp_game_descriptor game_descriptor_t tetrisfp_game_descriptor
__attribute__((section(".game_descriptors"))) = __attribute__((section(".game_descriptors"))) =

2
games/tetris/variant_std.c

@ -34,7 +34,7 @@
#ifdef GAME_TETRIS #ifdef GAME_TETRIS
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
// Tetris icon, MSB is leftmost pixel // Tetris icon, MSB is leftmost pixel
static uint8_t tetris_icon[8] PROGMEM = static const uint8_t tetris_icon[8] PROGMEM =
{ 0x0f, 0x0f, 0xc3, 0xdb, 0xdb, 0xc3, 0xf0, 0xf0 }; { 0x0f, 0x0f, 0xc3, 0xdb, 0xdb, 0xc3, 0xf0, 0xf0 };
game_descriptor_t tetris_game_descriptor game_descriptor_t tetris_game_descriptor
__attribute__((section(".game_descriptors"))) = __attribute__((section(".game_descriptors"))) =

4
scrolltext/font_arial8.c

@ -1,6 +1,6 @@
#include "font.h" #include "font.h"
unsigned int PROGMEM fontIndex_arial8[] = { unsigned const int PROGMEM fontIndex_arial8[] = {
0, /* */ 0, /* */
2, /* ! */ 2, /* ! */
4, /* " */ 4, /* " */
@ -99,7 +99,7 @@ unsigned int PROGMEM fontIndex_arial8[] = {
878 878
}; };
unsigned char PROGMEM fontData_arial8[] = { unsigned const char PROGMEM fontData_arial8[] = {
0x00, 0x00, /* */ 0x00, 0x00, /* */
0xfc, 0x02, /* # ###### */ 0xfc, 0x02, /* # ###### */
0x1c, 0x00, /* ### */ 0x1c, 0x00, /* ### */

4
scrolltext/scrolltext3.c

@ -22,12 +22,12 @@
font fonts[MAX_FONTS]; font fonts[MAX_FONTS];
#define MAX_SPECIALCOLORS 3 #define MAX_SPECIALCOLORS 3
unsigned char PROGMEM colorTable[MAX_SPECIALCOLORS*NUM_ROWS] = {1, 1, 2, 3, 3, 2, 1, 1, unsigned const char PROGMEM colorTable[MAX_SPECIALCOLORS*NUM_ROWS] = {1, 1, 2, 3, 3, 2, 1, 1,
3, 3, 2, 1, 1, 2, 3, 3, 3, 3, 2, 1, 1, 2, 3, 3,
3, 3, 2, 2, 3, 3, 2, 2 3, 3, 2, 2, 3, 3, 2, 2
}; };
char default_text[] PROGMEM = SCROLLTEXT_TEXT; const char default_text[] PROGMEM = SCROLLTEXT_TEXT;
char scrolltext_text[SCROLLTEXT_BUFFER_SIZE]; char scrolltext_text[SCROLLTEXT_BUFFER_SIZE];
/* Konzept /* Konzept

Loading…
Cancel
Save