diff options
author | Shachar Liberman <lshachar@hotmail.com> | 2006-07-30 03:10:09 +0000 |
---|---|---|
committer | Shachar Liberman <lshachar@hotmail.com> | 2006-07-30 03:10:09 +0000 |
commit | 5360df96ef6f42bed22ea52b48f876920dc16a6a (patch) | |
tree | 4588d6de0a38bff61b92151e85d6501c96ee5995 /apps/plugins | |
parent | 4ccacd4004ff38cd0298d8c59296f90585bfb2d3 (diff) | |
download | rockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.tar.gz rockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.zip |
accept patch FS#4761 - putting the player on hold will now pause games. this should be
fitted to pong and rockblox as well. credit Lukas Sabota for the initial work, and, my very
own first commit!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10365 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/brickmania.c | 6 | ||||
-rwxr-xr-x | apps/plugins/bubbles.c | 6 | ||||
-rw-r--r-- | apps/plugins/pacbox/pacbox.c | 5 | ||||
-rw-r--r-- | apps/plugins/snake.c | 6 | ||||
-rw-r--r-- | apps/plugins/snake2.c | 6 | ||||
-rwxr-xr-x | apps/plugins/spacerocks.c | 6 | ||||
-rw-r--r-- | apps/plugins/wormlet.c | 5 | ||||
-rw-r--r-- | apps/plugins/xobox.c | 8 |
8 files changed, 48 insertions, 0 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 2bd01e74ed..6eb21fe4f8 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c | |||
@@ -1740,6 +1740,12 @@ int game_loop(void) | |||
1740 | int move_button,button; | 1740 | int move_button,button; |
1741 | int button_right,button_left; | 1741 | int button_right,button_left; |
1742 | button=rb->button_get(false); | 1742 | button=rb->button_get(false); |
1743 | |||
1744 | #ifdef HAS_BUTTON_HOLD | ||
1745 | if (rb->button_hold()) | ||
1746 | button = QUIT; | ||
1747 | #endif | ||
1748 | |||
1743 | move_button=rb->button_status(); | 1749 | move_button=rb->button_status(); |
1744 | 1750 | ||
1745 | button_right=((move_button & RIGHT) || (SCROLL_FWD(button))); | 1751 | button_right=((move_button & RIGHT) || (SCROLL_FWD(button))); |
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index f2676f7ff1..11e415867e 100755 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c | |||
@@ -2368,6 +2368,12 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock, | |||
2368 | long start; | 2368 | long start; |
2369 | 2369 | ||
2370 | button = rb->button_get_w_tmo(timeout); | 2370 | button = rb->button_get_w_tmo(timeout); |
2371 | |||
2372 | #ifdef HAS_BUTTON_HOLD | ||
2373 | if (rb->button_hold()) | ||
2374 | button = BUBBLES_START; | ||
2375 | #endif | ||
2376 | |||
2371 | switch(button){ | 2377 | switch(button){ |
2372 | case (BUBBLES_LEFT|BUTTON_REPEAT): | 2378 | case (BUBBLES_LEFT|BUTTON_REPEAT): |
2373 | if(bb->angle > MIN_ANGLE) bb->angle -= 4; | 2379 | if(bb->angle > MIN_ANGLE) bb->angle -= 4; |
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index 7b524a7ee5..d66c6377b9 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c | |||
@@ -283,6 +283,11 @@ static int gameProc( void ) | |||
283 | /* Check the button status */ | 283 | /* Check the button status */ |
284 | status = rb->button_status(); | 284 | status = rb->button_status(); |
285 | 285 | ||
286 | #ifdef HAS_BUTTON_HOLD | ||
287 | if (rb->button_hold()) | ||
288 | status = PACMAN_MENU; | ||
289 | #endif | ||
290 | |||
286 | if ((status & PACMAN_MENU) == PACMAN_MENU | 291 | if ((status & PACMAN_MENU) == PACMAN_MENU |
287 | #ifdef PACMAN_RC_MENU | 292 | #ifdef PACMAN_RC_MENU |
288 | || status == PACMAN_RC_MENU | 293 | || status == PACMAN_RC_MENU |
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 55b3cbf18a..ab8e5f327e 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c | |||
@@ -267,6 +267,12 @@ void game (void) { | |||
267 | rb->sleep(HZ/level); | 267 | rb->sleep(HZ/level); |
268 | 268 | ||
269 | button=rb->button_get(false); | 269 | button=rb->button_get(false); |
270 | |||
271 | #ifdef HAS_BUTTON_HOLD | ||
272 | if (rb->button_hold()) | ||
273 | button = SNAKE_PLAYPAUSE; | ||
274 | #endif | ||
275 | |||
270 | switch (button) { | 276 | switch (button) { |
271 | case SNAKE_UP: | 277 | case SNAKE_UP: |
272 | if (dir!=2) dir=0; | 278 | if (dir!=2) dir=0; |
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index f3dc4bed94..bb89d86cf5 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c | |||
@@ -1113,6 +1113,12 @@ void game (void) | |||
1113 | rb->sleep(HZ/speed); | 1113 | rb->sleep(HZ/speed); |
1114 | 1114 | ||
1115 | button = rb->button_get(false); | 1115 | button = rb->button_get(false); |
1116 | |||
1117 | #ifdef HAS_BUTTON_HOLD | ||
1118 | if (rb->button_hold()) | ||
1119 | button = SNAKE2_PLAYPAUSE; | ||
1120 | #endif | ||
1121 | |||
1116 | switch (button) | 1122 | switch (button) |
1117 | { | 1123 | { |
1118 | case SNAKE2_UP: | 1124 | case SNAKE2_UP: |
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 32ab4bdcda..2cc3db9161 100755 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c | |||
@@ -1525,6 +1525,12 @@ enum plugin_status start_game(void) | |||
1525 | 1525 | ||
1526 | rb->lcd_update(); | 1526 | rb->lcd_update(); |
1527 | button = rb->button_get(false); | 1527 | button = rb->button_get(false); |
1528 | |||
1529 | #ifdef HAS_BUTTON_HOLD | ||
1530 | if (rb->button_hold()) | ||
1531 | game_state = PAUSE_MODE; | ||
1532 | #endif | ||
1533 | |||
1528 | switch(button) | 1534 | switch(button) |
1529 | { | 1535 | { |
1530 | case(AST_PAUSE): | 1536 | case(AST_PAUSE): |
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 1da772dbbc..7dc0ecdf90 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c | |||
@@ -1479,6 +1479,11 @@ static int run(void) | |||
1479 | int i; | 1479 | int i; |
1480 | long cycle_duration=0; | 1480 | long cycle_duration=0; |
1481 | 1481 | ||
1482 | #ifdef HAS_BUTTON_HOLD | ||
1483 | if (rb->button_hold()) | ||
1484 | paused = true; | ||
1485 | #endif | ||
1486 | |||
1482 | switch (button) { | 1487 | switch (button) { |
1483 | case BTN_STARTPAUSE: | 1488 | case BTN_STARTPAUSE: |
1484 | paused = !paused; | 1489 | paused = !paused; |
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 3ae9e22c1e..bf2d96e743 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c | |||
@@ -766,6 +766,14 @@ static int xobox_loop (void) | |||
766 | 766 | ||
767 | while (!quit) { | 767 | while (!quit) { |
768 | end = *rb->current_tick + (CYCLETIME * HZ) / 1000; | 768 | end = *rb->current_tick + (CYCLETIME * HZ) / 1000; |
769 | |||
770 | #ifdef HAS_BUTTON_HOLD | ||
771 | if (rb->button_hold()) { | ||
772 | pause = true; | ||
773 | rb->splash (HZ, true, "PAUSED"); | ||
774 | } | ||
775 | #endif | ||
776 | |||
769 | button = rb->button_get_w_tmo (true); | 777 | button = rb->button_get_w_tmo (true); |
770 | switch (button) { | 778 | switch (button) { |
771 | case UP: | 779 | case UP: |