making game starts more convenient if menu support is omitted

This commit is contained in:
Christian Kroll 2011-02-25 04:34:09 +00:00
parent 047abb575c
commit 5bc7b3f52f
1 changed files with 58 additions and 5 deletions

View File

@ -34,7 +34,9 @@ jmp_buf newmode_jmpbuf;
void snake_game(void); void snake_game(void);
void tetris(void); void tetris(void);
void tetris_bastet(void); void tetris_bastet(void);
void tetris_fp(void);
void borg_invaders(void); void borg_invaders(void);
void borg_breakout(unsigned char demomode);
#endif #endif
void display_loop(){ void display_loop(){
@ -48,6 +50,9 @@ void display_loop(){
#endif #endif
for(;;){ for(;;){
#ifndef MENU_SUPPORT
clear_screen(0);
#endif
oldMode = mode; oldMode = mode;
switch(mode++) { switch(mode++) {
@ -56,7 +61,8 @@ void display_loop(){
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);
} }
@ -184,33 +190,80 @@ void display_loop(){
break; break;
#endif #endif
#ifdef MENU_SUPPORT
case 42: case 42:
mode = 1; mode = 1;
break; break;
#ifdef MENU_SUPPORT
case 43: case 43:
menu(); menu();
mode = oldOldmode; mode = oldOldmode;
#else #else
#ifdef GAME_TETRIS #ifdef GAME_TETRIS
case 42:
if (JOYISFIRE)
mode = 43;
else
mode = 1;
break;
case 43: case 43:
waitForFire = 0;
while (JOYISFIRE);
tetris(); tetris();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break; break;
#endif #endif
#ifdef GAME_BASTET #ifdef GAME_BASTET
case 44: case 44:
waitForFire = 0;
while (JOYISFIRE);
tetris_bastet(); tetris_bastet();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif
#ifdef GAME_TETRIS_FP
case 45:
waitForFire = 0;
while (JOYISFIRE);
tetris_fp();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break; break;
#endif #endif
#ifdef GAME_SPACE_INVADERS #ifdef GAME_SPACE_INVADERS
case 45: case 45:
waitForFire = 0;
while (JOYISFIRE);
borg_invaders(); borg_invaders();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break; break;
#endif #endif
#ifdef GAME_SNAKE #ifdef GAME_SNAKE
case 46: case 46:
waitForFire = 0;
while (JOYISFIRE);
snake_game(); snake_game();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif
#ifdef GAME_BREAKOUT
case 47:
waitForFire = 0;
while (JOYISFIRE);
borg_breakout(0);
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break; break;
#endif #endif
#endif #endif