diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-16 09:40:37 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-16 09:40:37 +0000 |
commit | fa0f02cacd76b64a38c9cb62af98b2de0bbc8aea (patch) | |
tree | 3dab19d012ae68ba5f237b0def476ce37244f685 /apps | |
parent | 862d2b5e3a37bde849ee8a60fce911a569fd4dfd (diff) | |
download | rockbox-fa0f02cacd76b64a38c9cb62af98b2de0bbc8aea.tar.gz rockbox-fa0f02cacd76b64a38c9cb62af98b2de0bbc8aea.zip |
Fixed the settings crash. The SH1 CPU is very picky about alignment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4249 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/settings.c b/apps/settings.c index 2e9518afc1..864c4cd186 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -353,14 +353,12 @@ int settings_save( void ) | |||
353 | ((global_settings.avc & 0x03) | | 353 | ((global_settings.avc & 0x03) | |
354 | ((global_settings.channel_config & 0x07) << 2)); | 354 | ((global_settings.channel_config & 0x07) << 2)); |
355 | 355 | ||
356 | #if 0 | ||
357 | *((short*)(&config_block[0x12])) = global_settings.resume_index; | 356 | *((short*)(&config_block[0x12])) = global_settings.resume_index; |
358 | *((short*)(&config_block[0x14])) = global_settings.resume_first_index; | 357 | *((short*)(&config_block[0x14])) = global_settings.resume_first_index; |
359 | *((int*)(&config_block[0x16])) = global_settings.resume_offset; | 358 | memcpy(&config_block[0x16], &global_settings.resume_offset, 4); |
360 | DEBUGF( "+Resume index %X offset %X\n", | 359 | DEBUGF( "+Resume index %X offset %X\n", |
361 | global_settings.resume_index, | 360 | global_settings.resume_index, |
362 | global_settings.resume_offset ); | 361 | global_settings.resume_offset ); |
363 | #endif | ||
364 | 362 | ||
365 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; | 363 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; |
366 | config_block[0x1b] = (unsigned char) | 364 | config_block[0x1b] = (unsigned char) |
@@ -372,9 +370,7 @@ int settings_save( void ) | |||
372 | (global_settings.flip_display ? 0x40 : 0) | | 370 | (global_settings.flip_display ? 0x40 : 0) | |
373 | (global_settings.rec_editable?0x80:0); | 371 | (global_settings.rec_editable?0x80:0); |
374 | 372 | ||
375 | #if 0 | 373 | memcpy(&config_block[0x1d], &global_settings.resume_seed, 4); |
376 | *((int*)(&config_block[0x1d])) = global_settings.resume_seed; | ||
377 | #endif | ||
378 | 374 | ||
379 | config_block[0x21] = (unsigned char) | 375 | config_block[0x21] = (unsigned char) |
380 | ((global_settings.repeat_mode & 3) | | 376 | ((global_settings.repeat_mode & 3) | |
@@ -664,7 +660,7 @@ void settings_load(void) | |||
664 | global_settings.resume_first_index= *((short*)(&config_block[0x14])); | 660 | global_settings.resume_first_index= *((short*)(&config_block[0x14])); |
665 | 661 | ||
666 | if (config_block[0x16] != 0xFF) | 662 | if (config_block[0x16] != 0xFF) |
667 | global_settings.resume_offset = *((int*)(&config_block[0x16])); | 663 | memcpy(&global_settings.resume_offset, &config_block[0x16], 4); |
668 | 664 | ||
669 | if (config_block[0x1a] != 0xFF) | 665 | if (config_block[0x1a] != 0xFF) |
670 | global_settings.disk_spindown = config_block[0x1a]; | 666 | global_settings.disk_spindown = config_block[0x1a]; |
@@ -685,7 +681,7 @@ void settings_load(void) | |||
685 | } | 681 | } |
686 | 682 | ||
687 | if (config_block[0x1d] != 0xFF) | 683 | if (config_block[0x1d] != 0xFF) |
688 | global_settings.resume_seed = *((int*)(&config_block[0x1d])); | 684 | memcpy(&global_settings.resume_seed,&config_block[0x1d], 4); |
689 | 685 | ||
690 | if (config_block[0x21] != 0xFF) | 686 | if (config_block[0x21] != 0xFF) |
691 | { | 687 | { |