diff --git a/animations/amphibian.c b/animations/amphibian.c index 4144236..917c3b4 100644 --- a/animations/amphibian.c +++ b/animations/amphibian.c @@ -6,15 +6,7 @@ #include "amphibian.h" -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 aBitmap [2][38][6] PROGMEM = + static const uint8_t aBitmap [2][38][6] PROGMEM = {{{0x00, 0x00, 0x24, 0x00, 0x00, 0x00}, // bit plane 0 {0x00, 0x20, 0x3C, 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, 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) {0x03, 0xC0, 0xC3}, {0x04, 0x19, 0xA7}, @@ -128,6 +120,14 @@ static uint8_t amphibian_getChunk(unsigned char const nBitPlane, {0x06, 0x30, 0xC6}, {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 = {UINT8_MAX, 0, 4, 8, 12, 8, 4, 0}; uint8_t const nOffset = pgm_read_byte(&nOffsetTable[(nFrame >> 1) % 8]); diff --git a/animations/laborlogo.c b/animations/laborlogo.c index 398a10f..743f893 100644 --- a/animations/laborlogo.c +++ b/animations/laborlogo.c @@ -5,69 +5,68 @@ #include "bitmapscroller.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, 0x40, 0x08, 0xEF, 0xFF, 0xFB}, + {0xC0, 0x40, 0x04, 0xDF, 0xFF, 0xFB}, + {0x80, 0x40, 0x03, 0x3F, 0xFF, 0xFD}, + {0x87, 0xFC, 0x00, 0xFF, 0xFF, 0xFD}, + {0x84, 0x0C, 0x00, 0xFF, 0xFF, 0xFD}, + {0x04, 0x00, 0x1F, 0x07, 0xFF, 0xFE}, + {0x04, 0x00, 0x10, 0xF7, 0xFF, 0xFE}, + {0x04, 0x00, 0x10, 0xF7, 0xFF, 0xFE}, + {0xFF, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, + {0xBF, 0xFC, 0x10, 0xF7, 0xFF, 0xFD}, + {0xB0, 0x0C, 0x10, 0xF7, 0xFF, 0xFD}, + {0x80, 0x00, 0x10, 0xF7, 0xFF, 0xFD}, + {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, + {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, + {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, + {0xE0, 0x00, 0x10, 0xF7, 0xFF, 0xF7}, + {0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF}, + {0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF}, + {0xF8, 0x00, 0x10, 0xF7, 0xFF, 0xDF}, + {0xFC, 0x00, 0x10, 0xF7, 0xFF, 0xBF}, + {0xFE, 0x00, 0x1F, 0x07, 0xFF, 0x7F}, + {0xFF, 0x00, 0x00, 0xFF, 0xFE, 0xFF}, + {0xFF, 0x80, 0x00, 0xFF, 0xFD, 0xFF}, + {0xFF, 0xC0, 0x00, 0xFF, 0xF3, 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, - unsigned char const nChunkX, - unsigned char const nChunkY, - unsigned int const nFrame) + unsigned char const nChunkX, + unsigned char const nChunkY, + unsigned int const nFrame) { - assert(nChunkX < 6); - assert(nChunkY < 48); + assert(nChunkX < 6); + assert(nChunkY < 48); - static 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, 0x40, 0x08, 0xEF, 0xFF, 0xFB}, - {0xC0, 0x40, 0x04, 0xDF, 0xFF, 0xFB}, - {0x80, 0x40, 0x03, 0x3F, 0xFF, 0xFD}, - {0x87, 0xFC, 0x00, 0xFF, 0xFF, 0xFD}, - {0x84, 0x0C, 0x00, 0xFF, 0xFF, 0xFD}, - {0x04, 0x00, 0x1F, 0x07, 0xFF, 0xFE}, - {0x04, 0x00, 0x10, 0xF7, 0xFF, 0xFE}, - {0x04, 0x00, 0x10, 0xF7, 0xFF, 0xFE}, - {0xFF, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0x00, 0x80, 0x10, 0xF7, 0xFF, 0xFE}, - {0xBF, 0xFC, 0x10, 0xF7, 0xFF, 0xFD}, - {0xB0, 0x0C, 0x10, 0xF7, 0xFF, 0xFD}, - {0x80, 0x00, 0x10, 0xF7, 0xFF, 0xFD}, - {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, - {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, - {0xC0, 0x00, 0x10, 0xF7, 0xFF, 0xFB}, - {0xE0, 0x00, 0x10, 0xF7, 0xFF, 0xF7}, - {0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF}, - {0xF0, 0x00, 0x10, 0xF7, 0xFF, 0xEF}, - {0xF8, 0x00, 0x10, 0xF7, 0xFF, 0xDF}, - {0xFC, 0x00, 0x10, 0xF7, 0xFF, 0xBF}, - {0xFE, 0x00, 0x1F, 0x07, 0xFF, 0x7F}, - {0xFF, 0x00, 0x00, 0xFF, 0xFE, 0xFF}, - {0xFF, 0x80, 0x00, 0xFF, 0xFD, 0xFF}, - {0xFF, 0xC0, 0x00, 0xFF, 0xF3, 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}}; - - return pgm_read_byte(&aBitmap[nChunkY][nChunkX]); + return pgm_read_byte(&aBitmap[nChunkY][nChunkX]); } void laborlogo() { - bitmap_scroll(48, 48, 2, 400, 75, laborlogo_getChunk); + bitmap_scroll(48, 48, 2, 400, 75, laborlogo_getChunk); } diff --git a/games/breakout/breakout.c b/games/breakout/breakout.c index 81d5a1d..1a1a8a7 100644 --- a/games/breakout/breakout.c +++ b/games/breakout/breakout.c @@ -21,7 +21,7 @@ #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 = {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"))) = { diff --git a/games/snake/snake_game.c b/games/snake/snake_game.c index 2446d0f..ec1d1a3 100644 --- a/games/snake/snake_game.c +++ b/games/snake/snake_game.c @@ -11,7 +11,7 @@ #if defined MENU_SUPPORT && defined GAME_SNAKE // 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}; game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptors"))) = diff --git a/games/space_invaders/invaders2.c b/games/space_invaders/invaders2.c index a60d773..53ffc44 100644 --- a/games/space_invaders/invaders2.c +++ b/games/space_invaders/invaders2.c @@ -12,7 +12,7 @@ void borg_invaders(); #ifdef MENU_SUPPORT // 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 game_descriptor_t invaders_game_descriptor __attribute__((section(".game_descriptors"))) ={ diff --git a/games/tetris/variant_bastet.c b/games/tetris/variant_bastet.c index 506645c..54df1eb 100644 --- a/games/tetris/variant_bastet.c +++ b/games/tetris/variant_bastet.c @@ -257,7 +257,7 @@ static void tetris_bastet_evaluatePieces(tetris_bastet_variant_t *pBastet) #ifdef MENU_SUPPORT // 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 }; game_descriptor_t bastet_game_descriptor __attribute__((section(".game_descriptors"))) = diff --git a/games/tetris/variant_fp.c b/games/tetris/variant_fp.c index f1818a0..6d77d58 100644 --- a/games/tetris/variant_fp.c +++ b/games/tetris/variant_fp.c @@ -21,7 +21,7 @@ #ifdef MENU_SUPPORT // 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 }; game_descriptor_t tetrisfp_game_descriptor __attribute__((section(".game_descriptors"))) = diff --git a/games/tetris/variant_std.c b/games/tetris/variant_std.c index b478f56..76146ae 100644 --- a/games/tetris/variant_std.c +++ b/games/tetris/variant_std.c @@ -34,7 +34,7 @@ #ifdef GAME_TETRIS #ifdef MENU_SUPPORT // 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 }; game_descriptor_t tetris_game_descriptor __attribute__((section(".game_descriptors"))) = diff --git a/scrolltext/font_arial8.c b/scrolltext/font_arial8.c index f473bf3..ceae0a2 100644 --- a/scrolltext/font_arial8.c +++ b/scrolltext/font_arial8.c @@ -1,6 +1,6 @@ #include "font.h" -unsigned int PROGMEM fontIndex_arial8[] = { +unsigned const int PROGMEM fontIndex_arial8[] = { 0, /* */ 2, /* ! */ 4, /* " */ @@ -99,7 +99,7 @@ unsigned int PROGMEM fontIndex_arial8[] = { 878 }; -unsigned char PROGMEM fontData_arial8[] = { +unsigned const char PROGMEM fontData_arial8[] = { 0x00, 0x00, /* */ 0xfc, 0x02, /* # ###### */ 0x1c, 0x00, /* ### */ diff --git a/scrolltext/scrolltext3.c b/scrolltext/scrolltext3.c index 57dbcd1..3ca4c41 100644 --- a/scrolltext/scrolltext3.c +++ b/scrolltext/scrolltext3.c @@ -22,12 +22,12 @@ font fonts[MAX_FONTS]; #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, 2, 3, 3, 2, 2 }; -char default_text[] PROGMEM = SCROLLTEXT_TEXT; +const char default_text[] PROGMEM = SCROLLTEXT_TEXT; char scrolltext_text[SCROLLTEXT_BUFFER_SIZE]; /* Konzept