Browse Source

...goto...Peter, how could you...argh\!

feature/2015
Christian Kroll 16 years ago
parent
commit
b832adc6ce
  1. 11
      menu/menu.c

11
menu/menu.c

@ -37,19 +37,19 @@ extern game_descriptor_t _game_descriptors_end__[];
void menu() void menu()
{ {
if (MENU_ITEM_MAX != 0)
{
// don't let WAIT() query fire button to prevent endless circular jumps // don't let WAIT() query fire button to prevent endless circular jumps
waitForFire = 0; waitForFire = 0;
clear_screen(0); clear_screen(0);
// wait as long the fire button is pressed to prevent unwanted selections // wait as long as "fire" is pressed to prevent unwanted selections
while (JOYISFIRE) while (JOYISFIRE)
{ {
wait(MENU_POLL_INTERVAL); wait(MENU_POLL_INTERVAL);
} }
if(MENU_ITEM_MAX == 0) goto end;
// set initial menu item // set initial menu item
static uint8_t miSelection = 0; static uint8_t miSelection = 0;
// scroll in currently selected menu item // scroll in currently selected menu item
@ -104,8 +104,8 @@ void menu()
} }
} }
end:
waitForFire = 1; waitForFire = 1;
}
return; return;
} }
@ -116,7 +116,8 @@ uint8_t menu_getIconPixel(uint8_t item, int8_t x, int8_t y)
if (x < MENU_WIDTH_ICON) if (x < MENU_WIDTH_ICON)
{ {
// return pixel // return pixel
return (0x80 >> x) & pgm_read_word(&_game_descriptors_start__[item].icon[y]); return (0x80 >> x) &
pgm_read_word(&_game_descriptors_start__[item].icon[y]);
} }
else else
{ {

Loading…
Cancel
Save