forked from len0rd/rockbox
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
This commit is contained in:
parent
862d2b5e3a
commit
fa0f02cacd
1 changed files with 4 additions and 8 deletions
|
@ -353,14 +353,12 @@ int settings_save( void )
|
||||||
((global_settings.avc & 0x03) |
|
((global_settings.avc & 0x03) |
|
||||||
((global_settings.channel_config & 0x07) << 2));
|
((global_settings.channel_config & 0x07) << 2));
|
||||||
|
|
||||||
#if 0
|
|
||||||
*((short*)(&config_block[0x12])) = global_settings.resume_index;
|
*((short*)(&config_block[0x12])) = global_settings.resume_index;
|
||||||
*((short*)(&config_block[0x14])) = global_settings.resume_first_index;
|
*((short*)(&config_block[0x14])) = global_settings.resume_first_index;
|
||||||
*((int*)(&config_block[0x16])) = global_settings.resume_offset;
|
memcpy(&config_block[0x16], &global_settings.resume_offset, 4);
|
||||||
DEBUGF( "+Resume index %X offset %X\n",
|
DEBUGF( "+Resume index %X offset %X\n",
|
||||||
global_settings.resume_index,
|
global_settings.resume_index,
|
||||||
global_settings.resume_offset );
|
global_settings.resume_offset );
|
||||||
#endif
|
|
||||||
|
|
||||||
config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
|
config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
|
||||||
config_block[0x1b] = (unsigned char)
|
config_block[0x1b] = (unsigned char)
|
||||||
|
@ -372,9 +370,7 @@ int settings_save( void )
|
||||||
(global_settings.flip_display ? 0x40 : 0) |
|
(global_settings.flip_display ? 0x40 : 0) |
|
||||||
(global_settings.rec_editable?0x80:0);
|
(global_settings.rec_editable?0x80:0);
|
||||||
|
|
||||||
#if 0
|
memcpy(&config_block[0x1d], &global_settings.resume_seed, 4);
|
||||||
*((int*)(&config_block[0x1d])) = global_settings.resume_seed;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
config_block[0x21] = (unsigned char)
|
config_block[0x21] = (unsigned char)
|
||||||
((global_settings.repeat_mode & 3) |
|
((global_settings.repeat_mode & 3) |
|
||||||
|
@ -664,7 +660,7 @@ void settings_load(void)
|
||||||
global_settings.resume_first_index= *((short*)(&config_block[0x14]));
|
global_settings.resume_first_index= *((short*)(&config_block[0x14]));
|
||||||
|
|
||||||
if (config_block[0x16] != 0xFF)
|
if (config_block[0x16] != 0xFF)
|
||||||
global_settings.resume_offset = *((int*)(&config_block[0x16]));
|
memcpy(&global_settings.resume_offset, &config_block[0x16], 4);
|
||||||
|
|
||||||
if (config_block[0x1a] != 0xFF)
|
if (config_block[0x1a] != 0xFF)
|
||||||
global_settings.disk_spindown = config_block[0x1a];
|
global_settings.disk_spindown = config_block[0x1a];
|
||||||
|
@ -685,7 +681,7 @@ void settings_load(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_block[0x1d] != 0xFF)
|
if (config_block[0x1d] != 0xFF)
|
||||||
global_settings.resume_seed = *((int*)(&config_block[0x1d]));
|
memcpy(&global_settings.resume_seed,&config_block[0x1d], 4);
|
||||||
|
|
||||||
if (config_block[0x21] != 0xFF)
|
if (config_block[0x21] != 0xFF)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue