summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorShachar Liberman <lshachar@hotmail.com>2006-07-30 03:10:09 +0000
committerShachar Liberman <lshachar@hotmail.com>2006-07-30 03:10:09 +0000
commit5360df96ef6f42bed22ea52b48f876920dc16a6a (patch)
tree4588d6de0a38bff61b92151e85d6501c96ee5995 /apps/plugins
parent4ccacd4004ff38cd0298d8c59296f90585bfb2d3 (diff)
downloadrockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.zip
rockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.tar.gz
rockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.tar.bz2
rockbox-5360df96ef6f42bed22ea52b48f876920dc16a6a.tar.xz
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.c6
-rwxr-xr-xapps/plugins/bubbles.c6
-rw-r--r--apps/plugins/pacbox/pacbox.c5
-rw-r--r--apps/plugins/snake.c6
-rw-r--r--apps/plugins/snake2.c6
-rwxr-xr-xapps/plugins/spacerocks.c6
-rw-r--r--apps/plugins/wormlet.c5
-rw-r--r--apps/plugins/xobox.c8
8 files changed, 48 insertions, 0 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 2bd01e7..6eb21fe 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1740,6 +1740,12 @@ int game_loop(void)
int move_button,button;
int button_right,button_left;
button=rb->button_get(false);
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ button = QUIT;
+#endif
+
move_button=rb->button_status();
button_right=((move_button & RIGHT) || (SCROLL_FWD(button)));
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index f2676f7..11e4158 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,
long start;
button = rb->button_get_w_tmo(timeout);
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ button = BUBBLES_START;
+#endif
+
switch(button){
case (BUBBLES_LEFT|BUTTON_REPEAT):
if(bb->angle > MIN_ANGLE) bb->angle -= 4;
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 7b524a7..d66c637 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -283,6 +283,11 @@ static int gameProc( void )
/* Check the button status */
status = rb->button_status();
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ status = PACMAN_MENU;
+#endif
+
if ((status & PACMAN_MENU) == PACMAN_MENU
#ifdef PACMAN_RC_MENU
|| status == PACMAN_RC_MENU
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index 55b3cbf..ab8e5f3 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -267,6 +267,12 @@ void game (void) {
rb->sleep(HZ/level);
button=rb->button_get(false);
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ button = SNAKE_PLAYPAUSE;
+#endif
+
switch (button) {
case SNAKE_UP:
if (dir!=2) dir=0;
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index f3dc4be..bb89d86 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -1113,6 +1113,12 @@ void game (void)
rb->sleep(HZ/speed);
button = rb->button_get(false);
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ button = SNAKE2_PLAYPAUSE;
+#endif
+
switch (button)
{
case SNAKE2_UP:
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 32ab4bd..2cc3db9 100755
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -1525,6 +1525,12 @@ enum plugin_status start_game(void)
rb->lcd_update();
button = rb->button_get(false);
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ game_state = PAUSE_MODE;
+#endif
+
switch(button)
{
case(AST_PAUSE):
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 1da772d..7dc0ecd 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -1479,6 +1479,11 @@ static int run(void)
int i;
long cycle_duration=0;
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold())
+ paused = true;
+#endif
+
switch (button) {
case BTN_STARTPAUSE:
paused = !paused;
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 3ae9e22..bf2d96e 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -766,6 +766,14 @@ static int xobox_loop (void)
while (!quit) {
end = *rb->current_tick + (CYCLETIME * HZ) / 1000;
+
+#ifdef HAS_BUTTON_HOLD
+ if (rb->button_hold()) {
+ pause = true;
+ rb->splash (HZ, true, "PAUSED");
+ }
+#endif
+
button = rb->button_get_w_tmo (true);
switch (button) {
case UP: