forked from len0rd/rockbox
CodeBuster: Replace mapping defines with direct use of PLA_* macros.
Add PLA_MENU as a way to exit to menu Add PLA_START as a way to validate a combination git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23938 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
82a6fb0649
commit
c9a11d24eb
1 changed files with 18 additions and 23 deletions
|
@ -34,18 +34,6 @@ PLUGIN_HEADER
|
||||||
const struct button_mapping *plugin_contexts[] =
|
const struct button_mapping *plugin_contexts[] =
|
||||||
{generic_directions, generic_actions};
|
{generic_directions, generic_actions};
|
||||||
|
|
||||||
/* Mapping */
|
|
||||||
#define EXIT PLA_QUIT
|
|
||||||
#define VALIDATE PLA_FIRE
|
|
||||||
#define PREV_PIECE PLA_LEFT
|
|
||||||
#define PREV_PIECE_REPEAT PLA_LEFT_REPEAT
|
|
||||||
#define NEXT_PIECE PLA_RIGHT
|
|
||||||
#define NEXT_PIECE_REPEAT PLA_RIGHT_REPEAT
|
|
||||||
#define PREV_COLOR PLA_UP
|
|
||||||
#define PREV_COLOR_REPEAT PLA_UP_REPEAT
|
|
||||||
#define NEXT_COLOR PLA_DOWN
|
|
||||||
#define NEXT_COLOR_REPEAT PLA_DOWN_REPEAT
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Screen structure:
|
* Screen structure:
|
||||||
* * (guesses_count) lines of guesses,
|
* * (guesses_count) lines of guesses,
|
||||||
|
@ -433,35 +421,42 @@ enum plugin_status plugin_start(const void* parameter) {
|
||||||
while(!stop_game()) {
|
while(!stop_game()) {
|
||||||
draw_board(guess, piece);
|
draw_board(guess, piece);
|
||||||
|
|
||||||
if ((button = get_button()) == VALIDATE) break;
|
button = get_button();
|
||||||
|
if (button == PLA_FIRE || button == PLA_START)
|
||||||
|
break;
|
||||||
|
|
||||||
switch (button) {
|
switch (button) {
|
||||||
|
|
||||||
case EXIT:
|
/* Exit */
|
||||||
|
case PLA_QUIT:
|
||||||
|
case PLA_MENU:
|
||||||
resume = true;
|
resume = true;
|
||||||
main_menu();
|
main_menu();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NEXT_PIECE:
|
/* Next piece */
|
||||||
case NEXT_PIECE_REPEAT:
|
case PLA_RIGHT:
|
||||||
|
case PLA_RIGHT_REPEAT:
|
||||||
piece = (piece + 1) % pieces_count;
|
piece = (piece + 1) % pieces_count;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREV_PIECE:
|
/* Previous piece */
|
||||||
case PREV_PIECE_REPEAT:
|
case PLA_LEFT:
|
||||||
|
case PLA_LEFT_REPEAT:
|
||||||
piece = (piece + pieces_count - 1) % pieces_count;
|
piece = (piece + pieces_count - 1) % pieces_count;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Next color */
|
||||||
case NEXT_COLOR:
|
case PLA_DOWN:
|
||||||
case NEXT_COLOR_REPEAT:
|
case PLA_DOWN_REPEAT:
|
||||||
guesses[guess].pieces[piece] =
|
guesses[guess].pieces[piece] =
|
||||||
(guesses[guess].pieces[piece] + 1)
|
(guesses[guess].pieces[piece] + 1)
|
||||||
% colors_count;
|
% colors_count;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREV_COLOR:
|
/* Previous color */
|
||||||
case PREV_COLOR_REPEAT:
|
case PLA_UP:
|
||||||
|
case PLA_UP_REPEAT:
|
||||||
guesses[guess].pieces[piece] =
|
guesses[guess].pieces[piece] =
|
||||||
(guesses[guess].pieces[piece] + colors_count - 1)
|
(guesses[guess].pieces[piece] + colors_count - 1)
|
||||||
% colors_count;
|
% colors_count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue