diff options
author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2015-07-13 00:30:14 +0200 |
---|---|---|
committer | Gerrit Rockbox <gerrit@rockbox.org> | 2015-09-25 10:23:37 +0200 |
commit | 072d3cb268efc79a1945109bc3d9eefaf437e6c0 (patch) | |
tree | 0bfe51886f6414858dcef48c68f1c6e5a417a9c5 /apps/plugins/pong.c | |
parent | d552ff264833f8ee4885bb89e068615107e6d473 (diff) | |
download | rockbox-072d3cb268efc79a1945109bc3d9eefaf437e6c0.tar.gz rockbox-072d3cb268efc79a1945109bc3d9eefaf437e6c0.zip |
Fix Pong button handling
* allow button combos for QUIT (fixes MPIO_HD300)
* allow quitting during PAUSE mode
Change-Id: Iaf8ffc65cdcfe6c1d25bfbad3e38764eea2664cc
Diffstat (limited to 'apps/plugins/pong.c')
-rw-r--r-- | apps/plugins/pong.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 4ec62e01be..e72584f12f 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c | |||
@@ -631,9 +631,9 @@ static int keys(struct pong *p) | |||
631 | return 2; /* Pause game */ | 631 | return 2; /* Pause game */ |
632 | #endif | 632 | #endif |
633 | 633 | ||
634 | if(key & PONG_QUIT | 634 | if(key == PONG_QUIT |
635 | #ifdef PONG_RC_QUIT | 635 | #ifdef PONG_RC_QUIT |
636 | || key & PONG_RC_QUIT | 636 | || key == PONG_RC_QUIT |
637 | #endif | 637 | #endif |
638 | ) | 638 | ) |
639 | return 0; /* exit game NOW */ | 639 | return 0; /* exit game NOW */ |
@@ -719,13 +719,6 @@ enum plugin_status plugin_start(const void* parameter) | |||
719 | 719 | ||
720 | /* go go go */ | 720 | /* go go go */ |
721 | while(game > 0) { | 721 | while(game > 0) { |
722 | if (game == 2) { /* Game Paused */ | ||
723 | rb->splash(0, "PAUSED"); | ||
724 | while(game == 2) | ||
725 | game = keys(&pong); /* short circuit */ | ||
726 | rb->lcd_clear_display(); | ||
727 | } | ||
728 | |||
729 | if( pong.player[0].iscpu && pong.player[1].iscpu ) { | 722 | if( pong.player[0].iscpu && pong.player[1].iscpu ) { |
730 | if(blink_timer<blink_rate) { | 723 | if(blink_timer<blink_rate) { |
731 | ++blink_timer; | 724 | ++blink_timer; |
@@ -751,6 +744,13 @@ enum plugin_status plugin_start(const void* parameter) | |||
751 | rb->lcd_update(); | 744 | rb->lcd_update(); |
752 | 745 | ||
753 | game = keys(&pong); /* deal with keys */ | 746 | game = keys(&pong); /* deal with keys */ |
747 | |||
748 | if (game == 2) { /* Game Paused */ | ||
749 | rb->splash(0, "PAUSED"); | ||
750 | while(game == 2) | ||
751 | game = keys(&pong); /* short circuit */ | ||
752 | rb->lcd_clear_display(); | ||
753 | } | ||
754 | } | 754 | } |
755 | 755 | ||
756 | /* Turn on backlight timeout (revert to settings) */ | 756 | /* Turn on backlight timeout (revert to settings) */ |