summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kukla <roolku@rockbox.org>2007-04-08 16:19:28 +0000
committerRobert Kukla <roolku@rockbox.org>2007-04-08 16:19:28 +0000
commit5b7d21f0921023ceac4100fbf46dd23109e4a61a (patch)
tree93bb093df8007cb2375833e16296ca7030c52f5d
parent357a4182a715488c7a9e9a972a0c6a678fb207f8 (diff)
downloadrockbox-5b7d21f0921023ceac4100fbf46dd23109e4a61a.tar.gz
rockbox-5b7d21f0921023ceac4100fbf46dd23109e4a61a.zip
sims have no MAS, hence no mas_codec_readreg()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13076 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/starfield.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index 1c7635799d..586c8ae97d 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -235,42 +235,47 @@ int plugin_main(void)
235 rb->sleep(1); 235 rb->sleep(1);
236 rb->lcd_clear_display(); 236 rb->lcd_clear_display();
237 237
238#if ((CONFIG_CODEC == SWCODEC) || !defined(SIMULATOR) && \
239 ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)))
240
238 /* This will make the stars pulse to the music */ 241 /* This will make the stars pulse to the music */
239 if(pulse==true){ 242 if(pulse==true){
240 243
241 /* Get the peaks. ( Borrowed from vu_meter ) */ 244 /* Get the peaks. ( Borrowed from vu_meter ) */
242#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) 245#if (CONFIG_CODEC == SWCODEC)
243 int left_peak = rb->mas_codec_readreg(0xC);
244 int right_peak = rb->mas_codec_readreg(0xD);
245#elif (CONFIG_CODEC == SWCODEC)
246 int left_peak, right_peak; 246 int left_peak, right_peak;
247 rb->pcm_calculate_peaks(&left_peak, &right_peak); 247 rb->pcm_calculate_peaks(&left_peak, &right_peak);
248#else
249 int left_peak = rb->mas_codec_readreg(0xC);
250 int right_peak = rb->mas_codec_readreg(0xD);
248#endif 251#endif
249 /* Devide peak data by 4098 to bring the max 252 /* Devide peak data by 4098 to bring the max
250 value down from ~32k to 8 */ 253 value down from ~32k to 8 */
251 left_peak = left_peak/0x1000; 254 left_peak = left_peak/0x1000;
252 right_peak = right_peak/0x1000; 255 right_peak = right_peak/0x1000;
253 256
254 /* Make sure they dont stop */ 257 /* Make sure they dont stop */
255 if(left_peak<0x1) 258 if(left_peak<0x1)
256 left_peak = 0x1; 259 left_peak = 0x1;
257 if(right_peak<0x1) 260 if(right_peak<0x1)
258 right_peak = 0x1; 261 right_peak = 0x1;
259 262
260 /* And make sure they dont go over 8 */ 263 /* And make sure they dont go over 8 */
261 if(left_peak>0x8) 264 if(left_peak>0x8)
262 left_peak = 0x8; 265 left_peak = 0x8;
263 if(right_peak>0x8) 266 if(right_peak>0x8)
264 right_peak = 0x8; 267 right_peak = 0x8;
265 268
266 /* We need the average of both chanels */ 269 /* We need the average of both chanels */
267 avg_peak = ( left_peak + right_peak )/2; 270 avg_peak = ( left_peak + right_peak )/2;
268 271
269 /* Set the speed to the peak meter */ 272 /* Set the speed to the peak meter */
270 starfield.z_move = avg_peak; 273 starfield.z_move = avg_peak;
271 274
272 } /* if pulse */ 275 } /* if pulse */
273 276#else
277 (void) avg_peak;
278#endif
274 starfield_move_and_draw(&starfield); 279 starfield_move_and_draw(&starfield);
275 280
276#ifdef HAVE_LCD_COLOR 281#ifdef HAVE_LCD_COLOR