1
0
Fork 0
forked from len0rd/rockbox

fix ondio keymaps

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11543 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2006-11-17 03:18:04 +00:00
parent b8365c825b
commit e2a262ee25

View file

@ -54,6 +54,33 @@ PLUGIN_HEADER
#define NUM_COMPRESS 9 #define NUM_COMPRESS 9
#define MAX_SHOTTIME 1000 #define MAX_SHOTTIME 1000
/* keyboard layouts */
#define BUBBLES_LEFT PLA_LEFT
#define BUBBLES_LEFT_REP PLA_LEFT_REPEAT
#define BUBBLES_RIGHT PLA_RIGHT
#define BUBBLES_RIGHT_REP PLA_RIGHT_REPEAT
#define BUBBLES_QUIT PLA_QUIT
#define BUBBLES_START PLA_START
#define BUBBLES_SELECT PLA_FIRE
#define BUBBLES_RESUME PLA_MENU
#if CONFIG_KEYPAD != ONDIO_PAD
#define BUBBLES_LVLINC PLA_UP
#define BUBBLES_LVLINC_REP PLA_UP_REPEAT
#define BUBBLES_LVLDEC PLA_DOWN
#define BUBBLES_LVLDEC_REP PLA_DOWN_REPEAT
#else /* ondio keys */
#define BUBBLES_LVLINC PLA_RIGHT
#define BUBBLES_LVLINC_REP PLA_RIGHT_REPEAT
#define BUBBLES_LVLDEC PLA_LEFT
#define BUBBLES_LVLDEC_REP PLA_LEFT_REPEAT
#endif
/* bubbles will consume height of 10*ROW_HEIGHT+2*(BUBBLE_HEIGHT-1)+BUBBLE_HEIGHT/2 */ /* bubbles will consume height of 10*ROW_HEIGHT+2*(BUBBLE_HEIGHT-1)+BUBBLE_HEIGHT/2 */
/* 24x24 bubbles (iPod Video) */ /* 24x24 bubbles (iPod Video) */
#if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320) #if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320)
@ -2315,23 +2342,23 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
#ifdef HAS_BUTTON_HOLD #ifdef HAS_BUTTON_HOLD
if (rb->button_hold()) if (rb->button_hold())
button = PLA_START; button = BUBBLES_START;
#endif #endif
switch(button){ switch(button){
case PLA_LEFT_REPEAT: case BUBBLES_LEFT_REP:
if(bb->angle > MIN_ANGLE) bb->angle -= 4; if(bb->angle > MIN_ANGLE) bb->angle -= 4;
case PLA_LEFT: /* change angle to the left */ case BUBBLES_LEFT: /* change angle to the left */
if(bb->angle > MIN_ANGLE) bb->angle -= 2; if(bb->angle > MIN_ANGLE) bb->angle -= 2;
break; break;
case PLA_RIGHT_REPEAT: case BUBBLES_RIGHT_REP:
if(bb->angle < MAX_ANGLE) bb->angle += 4; if(bb->angle < MAX_ANGLE) bb->angle += 4;
case PLA_RIGHT: /* change angle to the right */ case BUBBLES_RIGHT: /* change angle to the right */
if(bb->angle < MAX_ANGLE) bb->angle += 2; if(bb->angle < MAX_ANGLE) bb->angle += 2;
break; break;
case PLA_FIRE: /* fire the shot */ case BUBBLES_SELECT: /* fire the shot */
if(!animblock) { if(!animblock) {
bb->elapsedlvl += bb->elapsedshot; bb->elapsedlvl += bb->elapsedshot;
bb->elapsedshot = 0; bb->elapsedshot = 0;
@ -2343,24 +2370,24 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
} }
break; break;
case PLA_START: /* pause the game */ case BUBBLES_START: /* pause the game */
start = *rb->current_tick; start = *rb->current_tick;
rb->splash(1, true, "Paused"); rb->splash(1, true, "Paused");
while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2) while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2)
!= (PLA_START)); != (BUBBLES_START));
bb->startedshot += *rb->current_tick-start; bb->startedshot += *rb->current_tick-start;
bubbles_drawboard(bb); bubbles_drawboard(bb);
rb->lcd_update(); rb->lcd_update();
break; break;
case PLA_MENU: /* save and end the game */ case BUBBLES_RESUME: /* save and end the game */
if(!animblock) { if(!animblock) {
rb->splash(HZ/2, true, "Saving game..."); rb->splash(HZ/2, true, "Saving game...");
bubbles_savegame(bb); bubbles_savegame(bb);
return BB_END; return BB_END;
} }
break; break;
case PLA_QUIT: /* end the game */ case BUBBLES_QUIT: /* end the game */
return BB_END; return BB_END;
case ACTION_UNKNOWN: /* no button pressed */ case ACTION_UNKNOWN: /* no button pressed */
@ -2492,18 +2519,18 @@ static int bubbles(struct game_context* bb) {
/* handle menu button presses */ /* handle menu button presses */
button = pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2); button = pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2);
switch(button){ switch(button){
case PLA_START: /* start playing */ case BUBBLES_START: /* start playing */
bb->level = startlevel; bb->level = startlevel;
startgame = true; startgame = true;
break; break;
case PLA_QUIT: /* quit program */ case BUBBLES_QUIT: /* quit program */
if(showscores) { if(showscores) {
showscores = false; showscores = false;
break; break;
} }
return BB_QUIT; return BB_QUIT;
case PLA_MENU: /* resume game */ case BUBBLES_RESUME: /* resume game */
if(!bubbles_loadgame(bb)) { if(!bubbles_loadgame(bb)) {
rb->splash(HZ*2, true, "Nothing to resume"); rb->splash(HZ*2, true, "Nothing to resume");
} else { } else {
@ -2511,12 +2538,12 @@ static int bubbles(struct game_context* bb) {
} }
break; break;
case PLA_FIRE: /* toggle high scores */ case BUBBLES_SELECT: /* toggle high scores */
showscores = !showscores; showscores = !showscores;
break; break;
case PLA_UP: /* increase starting level */ case BUBBLES_LVLINC: /* increase starting level */
case PLA_UP_REPEAT: case BUBBLES_LVLINC_REP:
if(startlevel >= bb->highlevel) { if(startlevel >= bb->highlevel) {
startlevel = 0; startlevel = 0;
} else { } else {
@ -2524,8 +2551,8 @@ static int bubbles(struct game_context* bb) {
} }
break; break;
case PLA_DOWN: /* decrease starting level */ case BUBBLES_LVLDEC: /* decrease starting level */
case PLA_DOWN_REPEAT: case BUBBLES_LVLDEC_REP:
if(startlevel <= 0) { if(startlevel <= 0) {
startlevel = bb->highlevel; startlevel = bb->highlevel;
} else { } else {