some better ifdefs - mostly indent

This commit is contained in:
asklepios 2011-05-09 20:54:01 +00:00
parent 0f31feb6bb
commit a1b1928d46
2 changed files with 21 additions and 18 deletions

View File

@ -24,8 +24,9 @@
#include "mcuf/mcuf.h" #include "mcuf/mcuf.h"
#include "menu/menu.h" #include "menu/menu.h"
#include "pixel.h" #include "pixel.h"
#include "joystick/joystick.h" #ifdef JOYSTICK_SUPPORT
# include "joystick/joystick.h"
#endif
volatile unsigned char oldMode, oldOldmode, mode; volatile unsigned char oldMode, oldOldmode, mode;
@ -61,13 +62,13 @@ void display_loop(){
case 1: case 1:
scrolltext(scrolltext_text); scrolltext(scrolltext_text);
#ifdef RANDOM_SUPPORT # ifdef RANDOM_SUPPORT
{ {
char a[28]; char a[28];
sprintf(a,"</# counter == %lu ", (unsigned long) percnt_get()); sprintf(a,"</# counter == %lu ", (unsigned long) percnt_get());
scrolltext(a); scrolltext(a);
} }
#endif # endif
break; break;
#endif #endif
@ -212,7 +213,7 @@ void display_loop(){
case 43: case 43:
menu(); menu();
mode = oldOldmode; mode = oldOldmode;
#else
case 42: case 42:
if (JOYISFIRE) if (JOYISFIRE)
mode = 43; mode = 43;
@ -225,29 +226,29 @@ void display_loop(){
while (JOYISFIRE); // wait until user released the fire button while (JOYISFIRE); // wait until user released the fire button
wait(25); // wait for button to settle wait(25); // wait for button to settle
#ifdef GAME_TETRIS # ifdef GAME_TETRIS
tetris(); tetris();
#endif # endif
#ifdef GAME_BASTET # ifdef GAME_BASTET
tetris_bastet(); tetris_bastet();
#endif # endif
#ifdef GAME_TETRIS_FP # ifdef GAME_TETRIS_FP
tetris_fp(); tetris_fp();
#endif # endif
#ifdef GAME_SPACE_INVADERS # ifdef GAME_SPACE_INVADERS
borg_invaders(); borg_invaders();
#endif # endif
#ifdef GAME_SNAKE # ifdef GAME_SNAKE
snake_game(); snake_game();
#endif # endif
#ifdef GAME_BREAKOUT # ifdef GAME_BREAKOUT
borg_breakout(0); borg_breakout(0);
#endif # endif
while (JOYISFIRE); // avoid an unwanted restart of the game loop while (JOYISFIRE); // avoid an unwanted restart of the game loop
wait(25); // wait for button to settle wait(25); // wait for button to settle

4
util.c
View File

@ -3,7 +3,9 @@
#include <avr/io.h> #include <avr/io.h>
#include <setjmp.h> #include <setjmp.h>
#include "joystick/joystick.h" #ifdef JOYSTICK_SUPPORT
# include "joystick/joystick.h"
#endif
//this buffer is declared in main //this buffer is declared in main
extern jmp_buf newmode_jmpbuf; extern jmp_buf newmode_jmpbuf;