diff --git a/programs/games/flpybird/README.md b/programs/games/flpybird/README.md index 4af28dff0..5fae65987 100644 --- a/programs/games/flpybird/README.md +++ b/programs/games/flpybird/README.md @@ -1,6 +1,25 @@ ## Floppy Bird for KolibriOS -* [Forum topic](http://board.kolibrios.org/viewtopic.php?t=4471)
-* [Directory in official KolibriOS Git repository](kolibrios\programs\games\floppybird) +Simple clone of world-famous Flappy Bird game for KolibriOS, written in C. -Showcase \ No newline at end of file +### Links + +* [Forum topic](http://board.kolibrios.org/viewtopic.php?t=4471) + +### Controls + +* Main menu: + * 1 - fast game mode + * 2 - slow game mode +* Game: + * Space - jump +* Game over: + * Space - restart + * Escape - return to main menu + +### Authors + +* zorggish - initial author, all game code +* Burer - rewrite to C, some tweaks + +Showcase \ No newline at end of file diff --git a/programs/games/flpybird/flpybird.c b/programs/games/flpybird/flpybird.c index 713752c1e..6c3f3edd0 100644 --- a/programs/games/flpybird/flpybird.c +++ b/programs/games/flpybird/flpybird.c @@ -6,11 +6,6 @@ // Contributor zorggish - Main code // Contributor Burer - Rewrite to C -#include -#include -#include -#include - #include #include "images.h" @@ -20,25 +15,33 @@ static const char HEADER_STRING[] = "Floppy Bird"; static const char CONTROL_STRING[] = "SPACEBAR TO JUMP"; static const char GAMEOVER_STRING[] = "GAME OVER"; -static const char SPA_KEY_STRING[] = "Press SPACEBAR for Restart"; -static const char ESC_KEY_STRING[] = "Press ESCAPE for Menu"; +static const char SPA_KEY_STRING[] = "PRESS SPACEBAR FOR RESTART"; +static const char ESC_KEY_STRING[] = "PRESS ESCAPE FOR MENU"; static const char FAST_STRING[] = "1 - FAST"; static const char SLOW_STRING[] = "2 - SLOW"; -/* ===== Global const variables ===== */ +/* ===== Global window variables ===== */ -static const int WIN_W = 400; -static const int WIN_H = 376; -static int BORDER_TOP = 24; -static const int BORDER_WIN = 5; +#define WIN_W 400 +#define WIN_H 376 +#define WIN_B 5 +#define WIN_S 10 -/* ===== Game state ===== */ +static int WIN_X; +static int WIN_Y; +static int WIN_T; -typedef enum GameState { - GAMESTATE_MENU, - GAMESTATE_STARTED, - GAMESTATE_GAMEOVER -} GameState; +/* ===== Global game variables ===== */ + +#define GAMESTATE_MENU 0 +#define GAMESTATE_STARTED 1 +#define GAMESTATE_GAMEOVER 2 + +static int game_rng; +static int game_speed = 1; +static int game_pause = 0; +static char game_score[] = "Score: 000"; +static int game_state; /* ===== Bird ===== */ @@ -46,30 +49,21 @@ typedef enum GameState { #define BIRD_H 20 #define BIRD_X 100 -typedef struct Bird { - int prev_y; - int y; - int acceleration; -} Bird; +static int bird_pos; +static int bird_acc; -static void Bird_initialize(Bird* b) { - b->y = WIN_H / 2 + BORDER_TOP; - b->acceleration = 0; - b->prev_y = b->y; +static void Bird_initialize(void) { + bird_pos = (WIN_H + WIN_T) / 2; + bird_acc = 0; } -static void Bird_move(Bird* b) { - if (b->acceleration <= 30) b->acceleration += 2; - b->prev_y = b->y; - b->y += b->acceleration / 10; +static void Bird_move(void) { + bird_acc += (bird_acc <= 30) * 2; // 2 or 0 + bird_pos += bird_acc / 10; } -static void Bird_jump(Bird* b) { - b->acceleration = -50; -} - -static void Bird_draw(const Bird* b) { - _ksys_draw_bitmap(birdImage, BIRD_X, b->y, BIRD_W, BIRD_H); +static void Bird_jump(void) { + bird_acc = -50; } /* ===== Tube ===== */ @@ -78,304 +72,279 @@ static void Bird_draw(const Bird* b) { #define TUBE_GAPHEIGHT 100 #define TUBE_HEADHEIGHT 18 -typedef struct Tube { - int x; - int gapY; -} Tube; +#define tube_num 3 -static void Tube_randomize(Tube* t) { - t->x = WIN_W + 1; - t->gapY = rand() % (WIN_H / 2) + (WIN_H / 2 - TUBE_GAPHEIGHT - BORDER_WIN) / 2; +static int tube_pos[tube_num]; +static int tube_gap[tube_num]; + +static void Tube_randomize(int t) { + int x = game_rng; x ^= x << 13; x ^= x >> 17; x ^= x << 5; game_rng = x; + int r = x & 255u; + if (r >= WIN_H / 2) + r -= 256 - WIN_H / 2; + tube_pos[t] = WIN_W + 1; + tube_gap[t] = r + (WIN_H / 2 - TUBE_GAPHEIGHT - WIN_B) / 2; } -static void Tube_move(Tube* t) { - t->x -= 2; - if (t->x < -TUBE_WIDTH - 2) { +static void Tube_move(int t) { + tube_pos[t] -= 2; + if (tube_pos[t] < -TUBE_WIDTH - 2) Tube_randomize(t); - } } -static void Tube_draw(const Tube* t) { +static void Tube_draw(int t) { /* cleanup */ - int pixels = (WIN_W - (BORDER_WIN + BORDER_WIN)) - (t->x + TUBE_WIDTH + 2); - if (pixels >= -1) { - pixels = (pixels == -1) ? 1 : 2; - _ksys_draw_bar(t->x + TUBE_WIDTH, t->gapY - TUBE_HEADHEIGHT, pixels, TUBE_HEADHEIGHT, 0x00FFFF); - _ksys_draw_bar(t->x + TUBE_WIDTH, t->gapY + TUBE_GAPHEIGHT , pixels, TUBE_HEADHEIGHT, 0x00FFFF); + int pixels = WIN_W - WIN_S - TUBE_WIDTH - tube_pos[t]; + if (pixels > 0) { + if (pixels > 2) + pixels = 2; + _ksys_draw_bar(tube_pos[t] + TUBE_WIDTH, tube_gap[t] - TUBE_HEADHEIGHT, pixels, TUBE_HEADHEIGHT, GAME_PALETTE[0]); + _ksys_draw_bar(tube_pos[t] + TUBE_WIDTH, tube_gap[t] + TUBE_GAPHEIGHT , pixels, TUBE_HEADHEIGHT, GAME_PALETTE[0]); } - if (t->x <= 0) { - _ksys_draw_bar(0, t->gapY - TUBE_HEADHEIGHT, 1, TUBE_HEADHEIGHT, 0x00FFFF); - _ksys_draw_bar(0, t->gapY + TUBE_GAPHEIGHT , 1, TUBE_HEADHEIGHT, 0x00FFFF); + if (tube_pos[t] < 0) { + int w = -tube_pos[t]; + if (w > 2) + w = 2; + _ksys_draw_bar(0, tube_gap[t] - TUBE_HEADHEIGHT, w, TUBE_HEADHEIGHT, GAME_PALETTE[0]); + _ksys_draw_bar(0, tube_gap[t] + TUBE_GAPHEIGHT , w, TUBE_HEADHEIGHT, GAME_PALETTE[0]); } - int offset = t->x >= 0 ? 0 : -t->x; - int trim = (t->x + TUBE_WIDTH >= WIN_W - (BORDER_WIN + BORDER_WIN)) - ? WIN_W - t->x - TUBE_WIDTH - (BORDER_WIN + BORDER_WIN) : 0; + int offset = tube_pos[t] >= 0 ? 0 : -tube_pos[t]; + int trim = (tube_pos[t] + TUBE_WIDTH >= WIN_W - WIN_S) + ? WIN_W - tube_pos[t] - TUBE_WIDTH - WIN_S : 0; + + if (offset >= TUBE_WIDTH + trim) + return; /* top */ - for (int y = 0; y < t->gapY - TUBE_HEADHEIGHT; ++y) - _ksys_draw_bitmap(tubeBodyImage + offset, - t->x + offset, y, TUBE_WIDTH - offset + trim, 1); + for (int y = 0; y < tube_gap[t] - TUBE_HEADHEIGHT; ++y) + ksys_draw_bitmap_palette( + TUBE_BODY_IMAGE + offset, + tube_pos[t] + offset, y, TUBE_WIDTH - offset + trim, 1, 8, GAME_PALETTE, 0 + ); + /* head top */ - for (int y = t->gapY - TUBE_HEADHEIGHT; y < t->gapY; ++y) - _ksys_draw_bitmap(tubeHeadImage + TUBE_WIDTH * (y - (t->gapY - TUBE_HEADHEIGHT)) + offset, - t->x + offset, y, TUBE_WIDTH - offset + trim, 1); + for (int y = tube_gap[t] - TUBE_HEADHEIGHT; y < tube_gap[t]; ++y) + ksys_draw_bitmap_palette( + TUBE_HEAD_IMAGE + TUBE_WIDTH * (y - tube_gap[t] + TUBE_HEADHEIGHT) + offset, + tube_pos[t] + offset, y, TUBE_WIDTH - offset + trim, 1, 8, GAME_PALETTE, 0 + ); /* head down */ - for (int y = t->gapY + TUBE_GAPHEIGHT; y < t->gapY + TUBE_GAPHEIGHT + TUBE_HEADHEIGHT; ++y) - _ksys_draw_bitmap(tubeHeadImage + TUBE_WIDTH * (y - (t->gapY + TUBE_GAPHEIGHT)) + offset, - t->x + offset, y, TUBE_WIDTH - offset + trim, 1); + for (int y = tube_gap[t] + TUBE_GAPHEIGHT; y < tube_gap[t] + TUBE_GAPHEIGHT + TUBE_HEADHEIGHT; ++y) + ksys_draw_bitmap_palette( + TUBE_HEAD_IMAGE + TUBE_WIDTH * (y - tube_gap[t] - TUBE_GAPHEIGHT) + offset, + tube_pos[t] + offset, y, TUBE_WIDTH - offset + trim, 1, 8, GAME_PALETTE, 0 + ); /* down */ - for (int y = t->gapY + TUBE_GAPHEIGHT + TUBE_HEADHEIGHT; y < WIN_H - BORDER_WIN; ++y) - _ksys_draw_bitmap(tubeBodyImage + offset, - t->x + offset, y, TUBE_WIDTH - offset + trim, 1); + for (int y = tube_gap[t] + TUBE_GAPHEIGHT + TUBE_HEADHEIGHT; y < WIN_H - WIN_B; ++y) + ksys_draw_bitmap_palette( + TUBE_BODY_IMAGE + offset, + tube_pos[t] + offset, y, TUBE_WIDTH - offset + trim, 1, 8, GAME_PALETTE, 0 + ); } -/* ===== Globals ===== */ - -static int loopDelay; -static GameState gameState; -static char scoreString[] = "Score: "; -static bool scoreChanged; -static int score; -static Bird bird; -static int tubeNumber; -static Tube tubes[3]; -static int WIN_X; -static int WIN_Y; - /* ===== Functions - Helpers ===== */ - -static void WriteBorderedText(uint32_t x, uint32_t y, uint8_t fontType, uint32_t textColor, - const char *textPtr, uint32_t textLen, uint32_t borderColor, int borderSize) { - - uint32_t bc = ((uint32_t)fontType << 24) | (borderColor & 0x00FFFFFF); - uint32_t tc = ((uint32_t)fontType << 24) | (textColor & 0x00FFFFFF); - - for (int bx = x - borderSize; bx <= x + borderSize; bx++) { - for (int by = y - borderSize; by <= y + borderSize; by++) { - _ksys_draw_text(textPtr, bx, by, textLen, bc); +static void WriteBorderedText(int x, int y, const char* textPtr, int textLen, int fontType) { + for (int bx = x + 2; bx >= x - 2; --bx) { + for (int by = y + 2; by >= y - 2; --by) { + _ksys_draw_text(textPtr, bx, by, textLen, fontType); } } - _ksys_draw_text(textPtr, x, y, textLen, tc); + _ksys_draw_text(textPtr, x, y, textLen, fontType | 0x00FFFFFF); } /* ===== Functions - Game Logic ===== */ -static bool checkCollision(const Tube* t) { - return ((t->x <= (BIRD_X + BIRD_W) && t->x + TUBE_WIDTH >= BIRD_X) - && (bird.y <= t->gapY || bird.y + BIRD_H >= t->gapY + TUBE_GAPHEIGHT)); +static inline int checkCollision(int t) { + return ((tube_pos[t] <= (BIRD_X + BIRD_W) && tube_pos[t] + TUBE_WIDTH >= BIRD_X) + && (bird_pos <= tube_gap[t] || bird_pos + BIRD_H >= tube_gap[t] + TUBE_GAPHEIGHT)) ? 1 : 0; } -static bool checkAddScore(const Tube* t) { - return (((BIRD_X - (t->x + TUBE_WIDTH)) >> 1) == 0); +static inline int checkAddScore(int t) { + int r = tube_pos[t] + TUBE_WIDTH; + return (r + 2 >= BIRD_X) & (r < BIRD_X); } static void updateScoreString(void) { - int temp = score; - int index = 9; - do { - scoreString[index--] = (char)(temp % 10 + '0'); - temp /= 10; - } while (temp > 0); + for (int i = 9; i >= 6; --i) { + if (++game_score[i] <= '9') return; + game_score[i] = '0'; + } } /* ===== Functions - Game Drawing ===== */ -static void drawGameWindow(void) { - BORDER_TOP = _ksys_get_skin_height(); - _ksys_create_window(WIN_X, WIN_Y, WIN_W, WIN_H + BORDER_TOP, HEADER_STRING, 0x00FFFF, 0x34); +static inline void createGameWindow(void) { + _ksys_create_window(WIN_X, WIN_Y, WIN_W, WIN_H + WIN_T, HEADER_STRING, GAME_PALETTE[0], 0x34); } static void redrawGameWindow(void) { /* cleaning the score area */ - if (scoreChanged) - _ksys_draw_bar(8, 8, 122, 18, 0x00FFFF); - if (bird.y > bird.prev_y) - _ksys_draw_bar(BIRD_X, bird.prev_y, BIRD_W, bird.y - bird.prev_y, 0x00FFFF); - else - _ksys_draw_bar(BIRD_X, bird.y + BIRD_H, BIRD_W, bird.prev_y - bird.y, 0x00FFFF); + int move = bird_acc / 10; + if (move < 0) + move = -move; + _ksys_draw_bar(BIRD_X, bird_pos - move, BIRD_W, move * 2 + BIRD_H, GAME_PALETTE[0]); - Bird_draw(&bird); - for (int i = 0; i < tubeNumber; ++i) Tube_draw(&tubes[i]); + ksys_draw_bitmap_palette(BIRD_IMAGE, BIRD_X, bird_pos, BIRD_W, BIRD_H, 8, GAME_PALETTE, 0); - WriteBorderedText(10, 10, 0x81, 0xFFFFFF, scoreString, 0, 0x000000, 2); + Tube_draw(0); Tube_draw(1); Tube_draw(2); + + WriteBorderedText(10, 10, game_score, 0, 0x81000000); } static void drawGameOverWindow(void) { - BORDER_TOP = _ksys_get_skin_height(); - _ksys_create_window(WIN_X, WIN_Y, WIN_W, WIN_H + BORDER_TOP, HEADER_STRING, 0x000000, 0x34); + createGameWindow(); - _ksys_draw_text(GAMEOVER_STRING, 116, 100, 0, 0x82FFFFFF); - _ksys_draw_text( scoreString, 136, 154, 0, 0x81FFFFFF); - _ksys_draw_text( SPA_KEY_STRING, 40, 200, 0, 0x81FFFFFF); - _ksys_draw_text( ESC_KEY_STRING, 70, 230, 0, 0x81FFFFFF); + WriteBorderedText(116, 100, GAMEOVER_STRING, 0, 0x82000000); + WriteBorderedText(136, 157, game_score, 0, 0x81000000); + WriteBorderedText( 40, 207, SPA_KEY_STRING, 0, 0x81000000); + WriteBorderedText( 70, 241, ESC_KEY_STRING, 0, 0x81000000); } static void drawMenuWindow(void) { - BORDER_TOP = _ksys_get_skin_height(); - _ksys_create_window(WIN_X, WIN_Y, WIN_W, WIN_H + BORDER_TOP, HEADER_STRING, 0x00FFFF, 0x34); + createGameWindow(); - WriteBorderedText( 88, 34, 0x04, 0xFFFFFF, HEADER_STRING, 6, 0x000000, 2); - WriteBorderedText(188, 87, 0x04, 0xFFFFFF, HEADER_STRING + 7, 4, 0x000000, 2); + WriteBorderedText( 88, 34, HEADER_STRING, 6, 0x04000000); + WriteBorderedText(188, 87, HEADER_STRING + 7, 4, 0x04000000); - // FAST and SLOW mode buttons - _ksys_define_button(50, 158, WIN_W - (BORDER_WIN + BORDER_WIN + 50) - 1, TUBE_WIDTH - 5, 0x6000000A, 0x00); - _ksys_define_button(50, 240, WIN_W - (BORDER_WIN + BORDER_WIN + 50) - 1, TUBE_WIDTH - 5, 0x6000000B, 0x00); - - rgb_t* pos = &tubeHeadImage[0]; + char* pos = &TUBE_HEAD_IMAGE[0]; for (int x = 50 - 1; x >= 50 - TUBE_HEADHEIGHT; --x) { for (int y = 156; y < 156 + TUBE_WIDTH; ++y) { - _ksys_draw_pixel(x, y, (pos->red << 16) + (pos->green << 8) + (pos->blue)); - _ksys_draw_pixel(x, y + 82, (pos->red << 16) + (pos->green << 8) + (pos->blue)); + ksys_draw_bitmap_palette(pos, x, y , 1, 1, 8, GAME_PALETTE, 0); + ksys_draw_bitmap_palette(pos, x, y + 82, 1, 1, 8, GAME_PALETTE, 0); ++pos; } } - for (int x = 50; x < WIN_W - (BORDER_WIN + BORDER_WIN); ++x) + for (int x = 50; x < WIN_W - WIN_S; ++x) { - _ksys_draw_bitmap(tubeBodyImage, x, 156, 1, TUBE_WIDTH); - _ksys_draw_bitmap(tubeBodyImage, x, 238, 1, TUBE_WIDTH); + ksys_draw_bitmap_palette(TUBE_BODY_IMAGE, x, 156, 1, TUBE_WIDTH, 8, GAME_PALETTE, 0); + ksys_draw_bitmap_palette(TUBE_BODY_IMAGE, x, 238, 1, TUBE_WIDTH, 8, GAME_PALETTE, 0); } - WriteBorderedText(139, 171, 0x82, 0xFFFFFF, FAST_STRING, 0, 0x000000, 2); - WriteBorderedText(139, 253, 0x82, 0xFFFFFF, SLOW_STRING, 0, 0x000000, 2); + WriteBorderedText(139, 171, FAST_STRING, 0, 0x82000000); + WriteBorderedText(139, 253, SLOW_STRING, 0, 0x82000000); // Control hint - WriteBorderedText(100, 322, 0x81, 0xFFFFFF, CONTROL_STRING, 0, 0x000000, 2); + WriteBorderedText(100, 322, CONTROL_STRING, 0, 0x81000000); } /* ===== Functions - Game Main ===== */ static void startGame(void) { - Bird_initialize(&bird); + createGameWindow(); - score = 0; - memset((uint8_t*)scoreString + 6, ' ', 3); - updateScoreString(); + game_score[7] = game_score[8] = game_score[9] = '0'; - tubeNumber = 1; - Tube_randomize(&tubes[0]); + Bird_initialize(); - gameState = GAMESTATE_STARTED; - drawGameWindow(); + const int spacing = (WIN_W + TUBE_WIDTH) / 3; + for (int i = tube_num - 1; i >= 0; --i) { + Tube_randomize(i); + tube_pos[i] = WIN_W + i * spacing; + } + + game_state = GAMESTATE_STARTED; } -int main(int argc, char **argv) { - _ksys_set_key_input_mode(KSYS_KEY_INPUT_MODE_SCANC); +static void frameGame(void) { + Bird_move(); - /* Seed PRNG ? was rtlSrand(kos_GetSystemClock()); */ + /* Processing all tubes */ + for (int i = tube_num - 1; i >= 0; --i) { + /* Adding score */ + if (checkAddScore(i)) { + updateScoreString(); + _ksys_draw_bar(92, 8, 38, 18, GAME_PALETTE[0]); + } + + /* Check collision with bird */ + if (checkCollision(i)) + goto game_over; + + /* Move tube */ + Tube_move(i); + } + + /* Checking bird is too high or low */ + if (bird_pos + BIRD_H > WIN_H - WIN_B || bird_pos < 0) + goto game_over; + + redrawGameWindow(); + return; + + game_over: + game_state = GAMESTATE_GAMEOVER; + drawGameOverWindow(); + return; +} + +int main(void) { + /* Setting RNG seed */ ksys_time_t t = _ksys_get_time(); - srand((unsigned)(t.val)); // ok for simple tube RNG + game_rng = (int)t.val | 1u; /* Centering window */ ksys_pos_t screen = _ksys_screen_size(); WIN_X = (screen.x - WIN_W) / 2; WIN_Y = (screen.y - WIN_H) / 2; + WIN_T = _ksys_get_skin_height(); - gameState = GAMESTATE_MENU; + game_state = GAMESTATE_MENU; for (;;) { - switch (gameState) { - case GAMESTATE_STARTED: { - _ksys_delay(loopDelay); + _ksys_delay(game_speed); - Bird_move(&bird); - - /* Adding new tubes */ - if ((tubeNumber == 1 || tubeNumber == 2) && (tubes[tubeNumber - 1].x < (WIN_W - WIN_W / 3))) - Tube_randomize(&tubes[tubeNumber++]); - - /* Processing all tubes */ - scoreChanged = false; - for (int i = 0; i < tubeNumber; ++i) { - /* Adding score */ - if (checkAddScore(&tubes[i])) { - ++score; - scoreChanged = true; - } - - /* Check collision with bird */ - if (checkCollision(&tubes[i])) { - gameState = GAMESTATE_GAMEOVER; - continue; - } - - /* Move tube */ - Tube_move(&tubes[i]); - } - - if (scoreChanged) updateScoreString(); - - /* Checking bird is too high or low */ - if (bird.y + BIRD_H > WIN_H - (BORDER_WIN - 1) || bird.y < 0) { - gameState = GAMESTATE_GAMEOVER; - continue; - } - - redrawGameWindow(); - - switch (_ksys_check_event()) { - case KSYS_EVENT_REDRAW: - drawGameWindow(); + switch (_ksys_check_event()) { + case KSYS_EVENT_NONE: + if (game_state == GAMESTATE_STARTED) + frameGame(); break; + + case KSYS_EVENT_REDRAW: { + switch (game_state) { + case GAMESTATE_MENU: drawMenuWindow(); break; + case GAMESTATE_STARTED: redrawGameWindow(); break; + case GAMESTATE_GAMEOVER: drawGameOverWindow(); break; + } + break; + } + case KSYS_EVENT_KEY: { ksys_oskey_t k = _ksys_get_key(); - if (k.code == KSYS_SCANCODE_SPACE) - Bird_jump(&bird); - } break; - case KSYS_EVENT_BUTTON: - _ksys_exit(); - break; - } - } break; - - case GAMESTATE_GAMEOVER: - drawGameOverWindow(); - switch (_ksys_wait_event()) { - case KSYS_EVENT_REDRAW: - drawGameOverWindow(); - break; - case KSYS_EVENT_KEY: { - ksys_oskey_t k = _ksys_get_key(); - if (k.code == KSYS_SCANCODE_SPACE) - startGame(); - if (k.code == KSYS_SCANCODE_ESC) { - gameState = GAMESTATE_MENU; - drawMenuWindow(); - } - } break; - case KSYS_EVENT_BUTTON: - _ksys_exit(); - break; - } - break; - - case GAMESTATE_MENU: - switch (_ksys_wait_event()) { - case KSYS_EVENT_REDRAW: - drawMenuWindow(); - break; - - case KSYS_EVENT_KEY: { - ksys_oskey_t k = _ksys_get_key(); - if (k.code == KSYS_SCANCODE_1 || k.code == KSYS_SCANCODE_2) { - loopDelay = k.code - 1; - startGame(); - } - } break; - - case KSYS_EVENT_BUTTON: { - int button = _ksys_get_button(); - if (button >= 0x0A) { - loopDelay = button - 0x09; - startGame(); + switch (game_state) { + case GAMESTATE_MENU: { + unsigned kc = k.code - 49; // 1 or 2 + if (kc <= 1) { + game_speed = kc + 1; + startGame(); + } break; } - _ksys_exit(); - } break; - } break; + case GAMESTATE_STARTED: { + if (k.code == 32) // SPACE + Bird_jump(); + break; + } + case GAMESTATE_GAMEOVER: { + if (k.code == 32) // SPACE + startGame(); + if (k.code == 27) // ESCAPE + { + game_state = GAMESTATE_MENU; + drawMenuWindow(); + } + break; + } + } + break; + } + + case KSYS_EVENT_BUTTON: + _ksys_exit(); + break; } } diff --git a/programs/games/flpybird/images.h b/programs/games/flpybird/images.h index ff174527e..1e263647a 100644 --- a/programs/games/flpybird/images.h +++ b/programs/games/flpybird/images.h @@ -8,154 +8,67 @@ #pragma once -#include - -#include - -#define rgb_hex(rgb) { \ - (uint8_t)((rgb) & 0xFF), \ - (uint8_t)(((rgb)>>8) & 0xFF), \ - (uint8_t)(((rgb)>>16)& 0xFF) \ -} - -static const rgb_t birdImage[] = { - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC08040), - rgb_hex(0xC08040), rgb_hex(0xC08040), rgb_hex(0x608080), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x40C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC08040), rgb_hex(0xE0C080), rgb_hex(0xC08040), - rgb_hex(0xE0C080), rgb_hex(0x806040), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC0DCC0), rgb_hex(0xA06040), - rgb_hex(0x80C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x80C0C0), rgb_hex(0xE0A040), rgb_hex(0xE0E080), rgb_hex(0xE0C080), rgb_hex(0xE0E080), - rgb_hex(0x806040), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC08040), rgb_hex(0xE0C080), rgb_hex(0xA06040), - rgb_hex(0x20C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC06040), rgb_hex(0xE0C080), rgb_hex(0xC0A080), rgb_hex(0xC0A080), rgb_hex(0xA0A080), rgb_hex(0x806040), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC08040), rgb_hex(0xE0C080), rgb_hex(0xE0E080), rgb_hex(0xA06040), - rgb_hex(0x20C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xA06040), rgb_hex(0xC08040), rgb_hex(0x800040), rgb_hex(0x800040), rgb_hex(0xE02080), rgb_hex(0xE060C0), rgb_hex(0x40C0C0), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xA06040), rgb_hex(0xC08040), rgb_hex(0xE0E080), rgb_hex(0xC0DCC0), rgb_hex(0xA06040), - rgb_hex(0x20C0C0), rgb_hex(0x20C0C0), rgb_hex(0xC06040), rgb_hex(0x808080), rgb_hex(0xE02080), rgb_hex(0xE020C0), rgb_hex(0xE02080), rgb_hex(0xE0A0C0), rgb_hex(0x804080), rgb_hex(0x40C0C0), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC08040), rgb_hex(0xE0A040), rgb_hex(0xE0C080), rgb_hex(0xE0E080), rgb_hex(0xFFFBF0), rgb_hex(0x806040), - rgb_hex(0xC06040), rgb_hex(0xC0DCC0), rgb_hex(0x800040), rgb_hex(0xE040C0), rgb_hex(0xE040C0), rgb_hex(0x002040), rgb_hex(0xE0E080), rgb_hex(0xA0A080), rgb_hex(0x404040), rgb_hex(0x404040), - rgb_hex(0x806080), rgb_hex(0x806080), rgb_hex(0xA08080), rgb_hex(0xA06040), rgb_hex(0xE0A040), rgb_hex(0xC08040), rgb_hex(0xE0C080), rgb_hex(0xFFFBF0), rgb_hex(0xC0DCC0), rgb_hex(0xA06040), - rgb_hex(0xC0DCC0), rgb_hex(0xE020C0), rgb_hex(0xE0C080), rgb_hex(0xE0C080), rgb_hex(0xE0E080), rgb_hex(0xE0E000), rgb_hex(0xA0A0A4), rgb_hex(0xC0A080), rgb_hex(0x20A080), rgb_hex(0x40A0C0), - rgb_hex(0x40A0C0), rgb_hex(0x60C0C0), rgb_hex(0x20C0C0), rgb_hex(0xA06040), rgb_hex(0xE0A040), rgb_hex(0xC08040), rgb_hex(0xE0C040), rgb_hex(0xFFFBF0), rgb_hex(0xC0C080), rgb_hex(0x80A040), - rgb_hex(0xC00080), rgb_hex(0xFFFF00), rgb_hex(0xFFFF00), rgb_hex(0xE0E080), rgb_hex(0xC0A040), rgb_hex(0xA0A080), rgb_hex(0x60A080), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x80A080), rgb_hex(0xC08040), rgb_hex(0xE0A040), rgb_hex(0xE0A040), rgb_hex(0xE0C080), rgb_hex(0xFFFBF0), rgb_hex(0xC0C0C0), rgb_hex(0xE0C040), - rgb_hex(0xE0E040), rgb_hex(0xC0E000), rgb_hex(0xC0C080), rgb_hex(0xA0A080), rgb_hex(0xC0C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x40C0C0), rgb_hex(0x80A080), rgb_hex(0xE0A040), rgb_hex(0xE0C080), rgb_hex(0xE0C040), rgb_hex(0xE0E080), rgb_hex(0x80E080), rgb_hex(0xC0E000), rgb_hex(0xE0E080), - rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xC0A080), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x40C0C0), rgb_hex(0xA06040), rgb_hex(0xA0C040), rgb_hex(0xA0A040), rgb_hex(0xA0C080), rgb_hex(0xC0E000), rgb_hex(0xC0E000), rgb_hex(0xE0E080), rgb_hex(0xE0E080), - rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0x40C080), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x60E080), rgb_hex(0xC0DCC0), - rgb_hex(0x00FFFF), rgb_hex(0x80C0C0), rgb_hex(0x606080), rgb_hex(0x606080), rgb_hex(0xA0E040), rgb_hex(0xC0E000), rgb_hex(0xE0E000), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xE0E080), - rgb_hex(0xC0C040), rgb_hex(0x60A040), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC0E080), rgb_hex(0xC0C000), rgb_hex(0xE0E000), - rgb_hex(0xC0DCC0), rgb_hex(0x80A040), rgb_hex(0xA0E040), rgb_hex(0xA0C040), rgb_hex(0xC0E000), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xC0E000), rgb_hex(0xC0C000), - rgb_hex(0x60A040), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xA0A0A4), rgb_hex(0xA0A080), rgb_hex(0xA0E040), rgb_hex(0xC0E000), - rgb_hex(0x80A080), rgb_hex(0xA0C040), rgb_hex(0xC0E000), rgb_hex(0xE0E040), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xC0E000), rgb_hex(0xA0E040), rgb_hex(0x808040), rgb_hex(0x20C0C0), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xC0E080), rgb_hex(0xE0E000), rgb_hex(0xA0A080), rgb_hex(0x80A080), rgb_hex(0xA0C040), - rgb_hex(0xE0E040), rgb_hex(0xE0E040), rgb_hex(0xE0E040), rgb_hex(0xC0E040), rgb_hex(0xC0E000), rgb_hex(0xA0E040), rgb_hex(0x808040), rgb_hex(0xA0C080), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x80A080), rgb_hex(0xA0C000), rgb_hex(0xC0E000), rgb_hex(0xA0E040), rgb_hex(0xA0C040), rgb_hex(0xC0E000), - rgb_hex(0xC0E000), rgb_hex(0xC0E000), rgb_hex(0xC0E000), rgb_hex(0xA0E040), rgb_hex(0x80A040), rgb_hex(0x80C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0xA0C000), rgb_hex(0x6080C0), rgb_hex(0xA0C040), rgb_hex(0xC0E000), rgb_hex(0xC0E000), rgb_hex(0xC0E000), rgb_hex(0xC0E000), - rgb_hex(0xA0C040), rgb_hex(0x80A040), rgb_hex(0x808040), rgb_hex(0xA0C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x80A080), rgb_hex(0xA0C080), rgb_hex(0xC0E000), rgb_hex(0xA0E040), rgb_hex(0xC0E040), rgb_hex(0x808040), rgb_hex(0x808040), rgb_hex(0x808040), - rgb_hex(0xA0C0C0), rgb_hex(0x20C0C0), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0xA0E080), rgb_hex(0x808040), rgb_hex(0xA0A040), rgb_hex(0x808040), rgb_hex(0x808040), rgb_hex(0x80C0C0), rgb_hex(0xA0C0C0), rgb_hex(0x20C0C0), rgb_hex(0x00FFFF), - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF) +static const int GAME_PALETTE[77] = { + // Shared colors + 0x0000FFFF, 0x00E0E080, 0x00C0C080, 0x0080A040, 0x00A0C040, 0x00A0C080, 0x00A0E040, 0x0060A040, + 0x00C0E080, + // Bird-only colors + 0x00C08040, 0x00608080, 0x0040C0C0, 0x00E0C080, 0x00806040, 0x00C0DCC0, 0x00A06040, 0x0080C0C0, + 0x00E0A040, 0x0020C0C0, 0x00C06040, 0x00C0A080, 0x00A0A080, 0x00800040, 0x00E02080, 0x00E060C0, + 0x00808080, 0x00E020C0, 0x00E0A0C0, 0x00804080, 0x00FFFBF0, 0x00E040C0, 0x00002040, 0x00404040, + 0x00806080, 0x00A08080, 0x00E0E000, 0x00A0A0A4, 0x0020A080, 0x0040A0C0, 0x0060C0C0, 0x00E0C040, + 0x00C00080, 0x00FFFF00, 0x00C0A040, 0x0060A080, 0x0080A080, 0x00C0C0C0, 0x00E0E040, 0x00C0E000, + 0x0080E080, 0x00A0A040, 0x0040C080, 0x0060E080, 0x00606080, 0x00C0C040, 0x00C0C000, 0x00808040, + 0x00C0E040, 0x00A0C000, 0x006080C0, 0x00A0C0C0, 0x00A0E080, + // Tube-only colors + 0x00000000, 0x00608040, + 0x0080E040, 0x0080C040, 0x0060A000, 0x0040A000, 0x00408000, 0x00204000, 0x00206000, 0x00200040, + 0x00402000, 0x00608000, 0x00406000, 0x0060C000, 0x00402040 }; -static const rgb_t tubeBodyImage[] = { - rgb_hex(0x00FFFF), rgb_hex(0x00FFFF), rgb_hex(0x000000), rgb_hex(0x608040), rgb_hex(0x80E040), rgb_hex(0xE0E080), rgb_hex(0xA0E040), rgb_hex(0xA0E040), rgb_hex(0x80C040), rgb_hex(0x80C040), - rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x408000), rgb_hex(0x408000), - rgb_hex(0x204000), rgb_hex(0x60A000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x200040), rgb_hex(0x00FFFF), rgb_hex(0x00FFFF) +static const char BIRD_IMAGE[380] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 10, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 9, 12, 9, 12, 13, 0, 0, 0, 0, 0, 0, 14, 15, + 16, 0, 0, 0, 0, 16, 17, 1, 12, 1, 13, 0, 0, 0, 0, 0, 0, 9, 12, 15, + 18, 0, 0, 0, 19, 12, 20, 20, 21, 13, 0, 0, 0, 0, 0, 0, 9, 12, 1, 15, + 18, 0, 0, 15, 9, 22, 22, 23, 24, 11, 0, 0, 0, 0, 0, 15, 9, 1, 14, 15, + 18, 18, 19, 25, 23, 26, 23, 27, 28, 11, 0, 0, 0, 0, 9, 17, 12, 1, 29, 13, + 19, 14, 22, 30, 30, 31, 1, 21, 32, 32, 33, 33, 34, 15, 17, 9, 12, 29, 14, 15, + 14, 26, 12, 12, 1, 35, 36, 20, 37, 38, 38, 39, 18, 15, 17, 9, 40, 29, 2, 3, + 41, 42, 42, 1, 43, 21, 44, 0, 0, 0, 0, 0, 45, 9, 17, 17, 12, 29, 46, 40, + 47, 48, 2, 21, 46, 0, 0, 0, 0, 0, 0, 11, 45, 17, 12, 40, 1, 49, 48, 1, + 1, 1, 20, 0, 0, 0, 0, 0, 0, 0, 0, 11, 15, 4, 50, 5, 48, 48, 1, 1, + 1, 1, 51, 0, 0, 0, 0, 0, 52, 14, 0, 16, 53, 53, 6, 48, 35, 1, 1, 1, + 54, 7, 0, 0, 0, 0, 0, 8, 55, 35, 14, 3, 6, 4, 48, 1, 1, 1, 48, 55, + 7, 0, 0, 0, 0, 0, 36, 21, 6, 48, 45, 4, 48, 47, 1, 1, 48, 6, 56, 18, + 0, 0, 0, 0, 0, 8, 35, 21, 45, 4, 47, 47, 47, 57, 48, 6, 56, 5, 0, 0, + 0, 0, 0, 0, 45, 58, 48, 6, 4, 48, 48, 48, 48, 6, 3, 16, 0, 0, 0, 0, + 0, 0, 0, 58, 59, 4, 48, 48, 48, 48, 4, 3, 56, 60, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 5, 48, 6, 57, 56, 56, 56, 60, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 61, 56, 50, 56, 56, 16, 60, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static const rgb_t tubeHeadImage[] = { - rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), - rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), - rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), - rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), - rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), - rgb_hex(0x402000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x608040), rgb_hex(0x80A040), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), - rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), - rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xC0C080), rgb_hex(0xA0C040), rgb_hex(0x60A040), - rgb_hex(0x60A040), rgb_hex(0xA0C080), rgb_hex(0xA0C080), rgb_hex(0x60A040), rgb_hex(0x60A040), rgb_hex(0x80A040), rgb_hex(0x60A040), rgb_hex(0x60A040), rgb_hex(0x60A040), rgb_hex(0x60A040), - rgb_hex(0x60A040), rgb_hex(0x80A040), rgb_hex(0x80A040), rgb_hex(0x80A040), rgb_hex(0x80A040), rgb_hex(0x608000), rgb_hex(0x406000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x402000), - rgb_hex(0x402000), rgb_hex(0x60C000), rgb_hex(0x60C000), rgb_hex(0x80C040), rgb_hex(0xA0E040), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xE0E080), rgb_hex(0xC0E080), - rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), - rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0x80C040), - rgb_hex(0x80C040), rgb_hex(0xC0E080), rgb_hex(0xC0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80E040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80E040), rgb_hex(0x80E040), - rgb_hex(0x80E040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x408000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x40A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x40A000), rgb_hex(0x204000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x80C040), rgb_hex(0x40A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x80E040), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), rgb_hex(0x40A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0xC0E080), rgb_hex(0xE0E080), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0x80E040), rgb_hex(0x60A000), - rgb_hex(0x60C000), rgb_hex(0x60C000), rgb_hex(0xA0E040), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), rgb_hex(0x60A000), - rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x60A000), rgb_hex(0x206000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x608000), rgb_hex(0x608040), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x406000), - rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x408000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), - rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), - rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), rgb_hex(0x406000), - rgb_hex(0x406000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x406000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x402000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), - rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), - rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), - rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), - rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x204000), rgb_hex(0x206000), rgb_hex(0x206000), rgb_hex(0x402000), - rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), - rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x000000), rgb_hex(0x000000), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), - rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), - rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), - rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040), rgb_hex(0x200040) -}; \ No newline at end of file +static const char TUBE_BODY_IMAGE[50] = { + 0, 0, 62, 63, 64, 1, 6, 6, 65, 65, 65, 65, 64, 66, 66, 64, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 66, 68, 68, 69, 66, 68, 68, 69, 70, 69, 71, 0, 0 +}; + +static const char TUBE_HEAD_IMAGE[900] = { + 71, 71, 71, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 71, 71, 71, 71, 71, + 72, 68, 68, 63, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 7, 7, 5, 5, 7, 7, 3, 7, 7, 7, 7, 7, 3, 3, 3, 3, 73, 74, 69, 69, 72, + 72, 75, 75, 65, 6, 1, 1, 1, 1, 8, 8, 8, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 65, 65, 8, 8, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 65, 64, 66, 68, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 67, 66, 66, 64, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 69, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 70, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 66, 66, 66, 64, 66, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 65, 65, 65, 65, 67, 66, 66, 64, 66, 67, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 76, 64, 64, 8, 1, 64, 64, 64, 64, 66, 75, 75, 6, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 70, 74, 74, 66, 70, 69, 70, 70, 72, + 72, 68, 68, 73, 63, 68, 68, 68, 68, 74, 68, 68, 68, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 70, 70, 70, 74, 70, 70, 70, 70, 72, + 72, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 72, + 71, 71, 71, 71, 62, 62, 62, 62, 62, 62, 62, 62, 62, 71, 71, 62, 62, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71 +};