Index: apps/plugins/brickmania.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/brickmania.c,v
retrieving revision 1.12
diff -p -u -d -r1.12 brickmania.c
--- apps/plugins/brickmania.c	22 Feb 2006 10:34:36 -0000	1.12
+++ apps/plugins/brickmania.c	24 Feb 2006 06:06:27 -0000
@@ -65,15 +65,15 @@ PLUGIN_HEADER
 
 #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
 
-#define QUIT BUTTON_MENU
+#define QUIT (BUTTON_SELECT|BUTTON_MENU)
 #define LEFT BUTTON_LEFT
 #define RIGHT BUTTON_RIGHT
 #define SELECT BUTTON_SELECT
-#define UP BUTTON_SCROLL_BACK
-#define DOWN BUTTON_SCROLL_FWD
+#define UP BUTTON_MENU
+#define DOWN BUTTON_PLAY
 
-#define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD)
-#define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK)
+#define SCROLL_FWD(x) (0)// ((x) & BUTTON_SCROLL_FWD)
+#define SCROLL_BACK(x) (0)//((x) & BUTTON_SCROLL_BACK)
 
 #elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */
 
@@ -663,7 +664,6 @@ typedef struct balls {
     int tempx;
     bool glue;
 } balls;
-
 balls ball[MAX_BALLS];
 
 typedef struct sfire {
@@ -1458,11 +1458,28 @@ int game_loop(void){
                        }
                   }
 
-                  int move_button,button;
-                  int button_right,button_left;
+                  int button;
                   button=rb->button_get(false);
-                  move_button=rb->button_status();
 
+#if CONFIG_KEYPAD == IPOD_4G_PAD //maybe this could be a #if HAVE_ABSOLUTE_WHEEL or something
+                  int wheel;
+                  int old_pad_pos_x = pad_pos_x; //to move the glued balls
+                  wheel = (rb->wheel_status()+0x5f/4)%0x5f;
+                  if (wheel > 0x5f/2)
+                      wheel = 0x5f - wheel;
+                  pad_pos_x = wheel*(LCD_WIDTH-PAD_WIDTH)*2/0x5f;
+                  pad_pos_x = pad_pos_x*8/6-(LCD_WIDTH-PAD_WIDTH)/6;
+                  pad_pos_x = MIN(LCD_WIDTH-PAD_WIDTH,MAX(0,pad_pos_x));
+
+                  if (flip_sides)
+                      pad_pos_x = LCD_WIDTH - PAD_WIDTH - pad_pos_x;
+                  for (k = 0; k < used_balls; k++) {
+                      if (start_game == 1 || ball[k].glue)
+                          ball[k].pos_x += pad_pos_x - old_pad_pos_x;
+                  }
+#else
+                  int move_button,button_right,button_left;
+                  move_button=rb->button_status();
                   button_right=((move_button & RIGHT) || (SCROLL_FWD(button)));
                   button_left=((move_button & LEFT) || (SCROLL_BACK(button)));
 
@@ -1471,7 +1488,7 @@ int game_loop(void){
                           for(k=0;k<used_balls;k++)
                               if (start_game==1 || ball[k].glue) 
                                   ball[k].pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH;
-                          pad_pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH;
+                          pad_pos_x=LCD_WIDTH-PAD_WIDTH;
                       } else {
                           for(k=0;k<used_balls;k++)
                               if ((start_game==1 || ball[k].glue))
@@ -1483,7 +1500,7 @@ int game_loop(void){
                           for(k=0;k<used_balls;k++)
                               if (start_game==1 || ball[k].glue) 
                                   ball[k].pos_x-=pad_pos_x;
-                              pad_pos_x-=pad_pos_x;
+                              pad_pos_x=0;
                       } else {
                           for(k=0;k<used_balls;k++)
                               if (start_game==1 || ball[k].glue) 
@@ -1491,7 +1508,7 @@ int game_loop(void){
                               pad_pos_x-=8;
                       }
                   }
-
+#endif
 
                   switch(button) {
                       case UP:
