allow games without menu support, don't include icons then. ugly hack for now.

This commit is contained in:
kju 2010-01-14 01:38:15 +00:00
parent 12db75f1b1
commit 40a3db9fe8
4 changed files with 35 additions and 2 deletions

View File

@ -23,6 +23,13 @@ volatile unsigned char oldMode, oldOldmode, mode;
jmp_buf newmode_jmpbuf; jmp_buf newmode_jmpbuf;
#ifndef MENU_SUPPORT
void snake_game(void);
void tetris(void);
void tetris_bastet(void);
void borg_invaders(void);
#endif
void display_loop(){ void display_loop(){
// mcuf_serial_mode(); // mcuf_serial_mode();
@ -148,6 +155,27 @@ void display_loop(){
case 43: case 43:
menu(); menu();
mode = oldOldmode; mode = oldOldmode;
#else
#ifdef GAME_TETRIS
case 43:
tetris();
break;
#endif
#ifdef GAME_BASTET
case 44:
tetris_bastet();
break;
#endif
#ifdef GAME_SPACE_INVADERS
case 45:
borg_invaders();
break;
#endif
#ifdef GAME_SNAKE
case 46:
snake_game();
break;
#endif
#endif #endif
#ifdef ANIMATION_OFF #ifdef ANIMATION_OFF

View File

@ -18,10 +18,12 @@ static uint8_t icon[8] PROGMEM =
void snake_game(); void snake_game();
#ifdef MENU_SUPPORT
game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptors"))) ={ game_descriptor_t snake_game_descriptor __attribute__((section(".game_descriptors"))) ={
&snake_game, &snake_game,
icon, icon,
}; };
#endif
void snake_game() { void snake_game() {
pixel pixels[64] = {{4, NUM_ROWS-2},{4, NUM_ROWS-3}}; pixel pixels[64] = {{4, NUM_ROWS-2},{4, NUM_ROWS-3}};

View File

@ -14,11 +14,12 @@ static uint8_t icon[8] PROGMEM =
void borg_invaders(); void borg_invaders();
#ifdef MENU_SUPPORT
game_descriptor_t invaders_game_descriptor __attribute__((section(".game_descriptors"))) ={ game_descriptor_t invaders_game_descriptor __attribute__((section(".game_descriptors"))) ={
&borg_invaders, &borg_invaders,
icon, icon,
}; };
#endif
void borg_invaders() void borg_invaders()
{ {

View File

@ -40,6 +40,8 @@ uint16_t tetris_logic_nHighscoreName[NUMHIGHSCORES] EEMEM;
// Tetris icon, MSB is leftmost pixel // Tetris icon, MSB is leftmost pixel
void tetris(); void tetris();
#ifdef MENU_SUPPORT
static uint8_t tetris_icon[8] PROGMEM = static 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
@ -60,7 +62,7 @@ game_descriptor_t bastet_game_descriptor
bastet_icon, bastet_icon,
}; };
#endif #endif
#endif /*MENU_SUPPORT*/
/*************************** /***************************
* non-interface functions * * non-interface functions *