Index: apps/plugins/starfield.c
===================================================================
--- apps/plugins/starfield.c	(revision 12120)
+++ apps/plugins/starfield.c	(working copy)
@@ -76,8 +76,8 @@
 
 
 #define MAX_STARS (LCD_WIDTH*LCD_HEIGHT*20)/100
-#define INIT_STARS 600
-#define STARFIELD_INCREASE_STEP 100
+#define INIT_STARS 200
+#define STARFIELD_INCREASE_STEP 50
 #define INIT_SPACE_SPEED 1
 #define STAR_MAX_VELOCITY 2
 /*
@@ -149,13 +149,14 @@
         star_init(star, z_move);
         return;
     }
+    
     rb->lcd_drawpixel(x_draw, y_draw);
     if(star->z<5*Z_MAX_DIST/6)
     {
         rb->lcd_drawpixel(x_draw, y_draw - 1);
         rb->lcd_drawpixel(x_draw - 1, y_draw);
         if(star->z<Z_MAX_DIST/2)
-        {
+        {  	
             rb->lcd_drawpixel(x_draw + 1, y_draw);
             rb->lcd_drawpixel(x_draw, y_draw + 1);
         }
@@ -217,15 +218,13 @@
 int plugin_main(void)
 {
     char str_buffer[40];
-    int button, t_disp=0;
+    int button, avg_peak, t_disp=0;
     int font_h, font_w;
+    bool pulse=true;
     rb->lcd_getstringsize("A", &font_w, &font_h);
     starfield_init(&starfield);
     starfield_add_stars(&starfield, INIT_STARS);
-    
-#if LCD_DEPTH > 1
-    rb->lcd_set_backdrop(NULL);
-#endif
+
 #ifdef HAVE_LCD_COLOR
     rb->lcd_set_background(LCD_BLACK);
     rb->lcd_set_foreground(LCD_WHITE);
@@ -235,8 +234,41 @@
     {
         rb->sleep(1);
         rb->lcd_clear_display();
+        
+				if(pulse==true){																	/* This will make the stars pulse to the music */
 
+#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)  /* Get the peaks. ( Borrowed from vu_meter ) */
+				    int left_peak = rb->mas_codec_readreg(0xC);
+				    int right_peak = rb->mas_codec_readreg(0xD);
+#elif (CONFIG_CODEC == SWCODEC)
+				    int left_peak, right_peak;
+				    rb->pcm_calculate_peaks(&left_peak, &right_peak);
+#endif
+				
+						left_peak		=	left_peak/0x1000;							/* Devide peak data by 4098 to bring the max value down from ~32k to 8 */
+						right_peak	=	right_peak/0x1000;
+						
+						if(left_peak<0x1)														/* Make sure they dont stop */
+							left_peak 	= 0x1;
+						if(right_peak<0x1)
+							right_peak	= 0x1;
+						
+						if(left_peak>0x8)														/* And make sure they dont go over 8 */
+							left_peak 	= 0x8;
+						if(right_peak>0x8)
+							right_peak	= 0x8;
+							
+						avg_peak 	= ( left_peak + right_peak )/2;		/* We need the average of both chanels */
+				    
+				    starfield.z_move = avg_peak;								/* Set the speed to the peak meter */
+		    
+		  	} /* if pulse */
+
         starfield_move_and_draw(&starfield);
+        
+#ifdef HAVE_LCD_COLOR
+    		rb->lcd_set_foreground(LCD_WHITE);
+#endif
 
         if (t_disp > 0)
         {/* if a parameter is updated (by the user), we must print it */
@@ -255,11 +287,13 @@
             case (STARFIELD_INCREASE_ZMOVE):
             case (STARFIELD_INCREASE_ZMOVE | BUTTON_REPEAT):
                 ++(starfield.z_move);
+                pulse=false;
                 t_disp=MSG_DISP_TIME;
                 break;
             case (STARFIELD_DECREASE_ZMOVE):
             case (STARFIELD_DECREASE_ZMOVE | BUTTON_REPEAT):
                 --(starfield.z_move);
+                pulse=false;
                 t_disp=MSG_DISP_TIME;
                 break;
             case(STARFIELD_INCREASE_NB_STARS):
