diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-18 10:12:16 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-18 10:12:16 +0000 |
commit | 78ea93d8698fb240c02b0d430966452a3d1ff3c9 (patch) | |
tree | 54384ea861238a1d66dbef6baffa9893c6a816fc /apps/settings.c | |
parent | c3a30409dd9de6eecee039e9f40ab89e7c2eb74f (diff) | |
download | rockbox-78ea93d8698fb240c02b0d430966452a3d1ff3c9.tar.gz rockbox-78ea93d8698fb240c02b0d430966452a3d1ff3c9.zip |
Added play_selected option, and moved browse_current
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2322 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/settings.c b/apps/settings.c index 771e21affc..76b0cc5088 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -69,13 +69,14 @@ offset abs | |||
69 | 0x0c 0x20 <poweroff timer byte> | 69 | 0x0c 0x20 <poweroff timer byte> |
70 | 0x0d 0x21 <resume settings byte> | 70 | 0x0d 0x21 <resume settings byte> |
71 | 0x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden, | 71 | 0x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden, |
72 | browse_current> | 72 | scroll bar> |
73 | 0x0f 0x23 <scroll speed> | 73 | 0x0f 0x23 <scroll speed> |
74 | 0x10 0x24 <ff/rewind min step, acceleration rate> | 74 | 0x10 0x24 <ff/rewind min step, acceleration rate> |
75 | 0x11 0x25 <AVC, channel config> | 75 | 0x11 0x25 <AVC, channel config> |
76 | 0x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> | 76 | 0x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> |
77 | 0x16 0x2a <(int) Byte offset into resume file> | 77 | 0x16 0x2a <(int) Byte offset into resume file> |
78 | 0x1a 0x2e <time until disk spindown> | 78 | 0x1a 0x2e <time until disk spindown> |
79 | 0x1b 0x2f <browse current, play selected> | ||
79 | 80 | ||
80 | <all unused space filled with 0xff> | 81 | <all unused space filled with 0xff> |
81 | 82 | ||
@@ -268,8 +269,7 @@ int settings_save( void ) | |||
268 | ((global_settings.discharge & 1) << 3) | | 269 | ((global_settings.discharge & 1) << 3) | |
269 | ((global_settings.statusbar & 1) << 4) | | 270 | ((global_settings.statusbar & 1) << 4) | |
270 | ((global_settings.show_hidden_files & 1) << 5) | | 271 | ((global_settings.show_hidden_files & 1) << 5) | |
271 | ((global_settings.scrollbar & 1) << 6) | | 272 | ((global_settings.scrollbar & 1) << 6)); |
272 | ((global_settings.browse_current & 1) << 7)); | ||
273 | 273 | ||
274 | config_block[0xf] = (unsigned char)(global_settings.scroll_speed << 3); | 274 | config_block[0xf] = (unsigned char)(global_settings.scroll_speed << 3); |
275 | 275 | ||
@@ -278,10 +278,15 @@ int settings_save( void ) | |||
278 | (global_settings.ff_rewind_accel & 15)); | 278 | (global_settings.ff_rewind_accel & 15)); |
279 | config_block[0x11] = (unsigned char)(global_settings.avc || | 279 | config_block[0x11] = (unsigned char)(global_settings.avc || |
280 | global_settings.channel_config << 2); | 280 | global_settings.channel_config << 2); |
281 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; | ||
282 | 281 | ||
283 | memcpy(&config_block[0x12], &global_settings.resume_index, 4); | 282 | memcpy(&config_block[0x12], &global_settings.resume_index, 4); |
284 | memcpy(&config_block[0x16], &global_settings.resume_offset, 4); | 283 | memcpy(&config_block[0x16], &global_settings.resume_offset, 4); |
284 | |||
285 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; | ||
286 | config_block[0x1b] = (unsigned char) | ||
287 | (((global_settings.browse_current & 1)) | | ||
288 | ((global_settings.play_selected & 1) << 1)); | ||
289 | |||
285 | memcpy(&config_block[0xF8], &global_settings.resume_seed, 4); | 290 | memcpy(&config_block[0xF8], &global_settings.resume_seed, 4); |
286 | 291 | ||
287 | memcpy(&config_block[0x24], &global_settings.total_uptime, 4); | 292 | memcpy(&config_block[0x24], &global_settings.total_uptime, 4); |
@@ -359,7 +364,8 @@ void settings_load(void) | |||
359 | global_settings.statusbar = (config_block[0xe] >> 4) & 1; | 364 | global_settings.statusbar = (config_block[0xe] >> 4) & 1; |
360 | global_settings.show_hidden_files = (config_block[0xe] >> 5) & 1; | 365 | global_settings.show_hidden_files = (config_block[0xe] >> 5) & 1; |
361 | global_settings.scrollbar = (config_block[0xe] >> 6) & 1; | 366 | global_settings.scrollbar = (config_block[0xe] >> 6) & 1; |
362 | global_settings.browse_current = (config_block[0xe] >> 7) & 1; | 367 | /* Don't use the last bit, it must be unused to detect |
368 | an uninitialized entry */ | ||
363 | } | 369 | } |
364 | 370 | ||
365 | c = config_block[0xf] >> 3; | 371 | c = config_block[0xf] >> 3; |
@@ -386,6 +392,11 @@ void settings_load(void) | |||
386 | if (config_block[0x1a] != 0xFF) | 392 | if (config_block[0x1a] != 0xFF) |
387 | global_settings.disk_spindown = config_block[0x1a]; | 393 | global_settings.disk_spindown = config_block[0x1a]; |
388 | 394 | ||
395 | if (config_block[0x1b] != 0xFF) { | ||
396 | global_settings.browse_current = (config_block[0x1b]) & 1; | ||
397 | global_settings.play_selected = (config_block[0x1b] >> 1) & 1; | ||
398 | } | ||
399 | |||
389 | memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); | 400 | memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); |
390 | 401 | ||
391 | if (config_block[0x24] != 0xFF) | 402 | if (config_block[0x24] != 0xFF) |
@@ -595,6 +606,7 @@ void settings_reset(void) { | |||
595 | global_settings.resume_offset = -1; | 606 | global_settings.resume_offset = -1; |
596 | global_settings.disk_spindown = 5; | 607 | global_settings.disk_spindown = 5; |
597 | global_settings.browse_current = false; | 608 | global_settings.browse_current = false; |
609 | global_settings.play_selected = true; | ||
598 | } | 610 | } |
599 | 611 | ||
600 | 612 | ||