Browse Source

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

feature/2015
kju 15 years ago
parent
commit
40a3db9fe8
  1. 28
      display_loop.c
  2. 2
      games/snake/snake_game.c
  3. 3
      games/space_invaders/invaders2.c
  4. 4
      games/tetris/logic.c

28
display_loop.c

@ -23,6 +23,13 @@ volatile unsigned char oldMode, oldOldmode, mode;
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(){
// mcuf_serial_mode();
@ -148,6 +155,27 @@ void display_loop(){
case 43:
menu();
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
#ifdef ANIMATION_OFF

2
games/snake/snake_game.c

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

3
games/space_invaders/invaders2.c

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

4
games/tetris/logic.c

@ -40,6 +40,8 @@ uint16_t tetris_logic_nHighscoreName[NUMHIGHSCORES] EEMEM;
// Tetris icon, MSB is leftmost pixel
void tetris();
#ifdef MENU_SUPPORT
static uint8_t tetris_icon[8] PROGMEM =
{ 0x0f, 0x0f, 0xc3, 0xdb, 0xdb, 0xc3, 0xf0, 0xf0 };
game_descriptor_t tetris_game_descriptor
@ -60,7 +62,7 @@ game_descriptor_t bastet_game_descriptor
bastet_icon,
};
#endif
#endif /*MENU_SUPPORT*/
/***************************
* non-interface functions *

Loading…
Cancel
Save