mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Fix Pong button handling
* allow button combos for QUIT (fixes MPIO_HD300) * allow quitting during PAUSE mode Change-Id: Iaf8ffc65cdcfe6c1d25bfbad3e38764eea2664cc
This commit is contained in:
parent
d552ff2648
commit
072d3cb268
1 changed files with 9 additions and 9 deletions
|
@ -631,9 +631,9 @@ static int keys(struct pong *p)
|
||||||
return 2; /* Pause game */
|
return 2; /* Pause game */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(key & PONG_QUIT
|
if(key == PONG_QUIT
|
||||||
#ifdef PONG_RC_QUIT
|
#ifdef PONG_RC_QUIT
|
||||||
|| key & PONG_RC_QUIT
|
|| key == PONG_RC_QUIT
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
return 0; /* exit game NOW */
|
return 0; /* exit game NOW */
|
||||||
|
@ -719,13 +719,6 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
|
|
||||||
/* go go go */
|
/* go go go */
|
||||||
while(game > 0) {
|
while(game > 0) {
|
||||||
if (game == 2) { /* Game Paused */
|
|
||||||
rb->splash(0, "PAUSED");
|
|
||||||
while(game == 2)
|
|
||||||
game = keys(&pong); /* short circuit */
|
|
||||||
rb->lcd_clear_display();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pong.player[0].iscpu && pong.player[1].iscpu ) {
|
if( pong.player[0].iscpu && pong.player[1].iscpu ) {
|
||||||
if(blink_timer<blink_rate) {
|
if(blink_timer<blink_rate) {
|
||||||
++blink_timer;
|
++blink_timer;
|
||||||
|
@ -751,6 +744,13 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
game = keys(&pong); /* deal with keys */
|
game = keys(&pong); /* deal with keys */
|
||||||
|
|
||||||
|
if (game == 2) { /* Game Paused */
|
||||||
|
rb->splash(0, "PAUSED");
|
||||||
|
while(game == 2)
|
||||||
|
game = keys(&pong); /* short circuit */
|
||||||
|
rb->lcd_clear_display();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Turn on backlight timeout (revert to settings) */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue