diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-02-27 14:22:30 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-02-27 14:22:30 +0000 |
commit | b1079200d34b197a9ea0ec649168b0a307ee9517 (patch) | |
tree | f4132e5965de2c6cf997a653af48f615b30c7a50 /apps/settings.c | |
parent | 8856b8651980e0e2df2dbb94726cbc9bb4fc085b (diff) | |
download | rockbox-b1079200d34b197a9ea0ec649168b0a307ee9517.tar.gz rockbox-b1079200d34b197a9ea0ec649168b0a307ee9517.zip |
New option: Invert display. Patch by Mark Hillebrand.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3355 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/settings.c b/apps/settings.c index 2bb2e97ab3..7019319fb3 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -82,7 +82,7 @@ offset abs | |||
82 | 0x07 0x1b <treble byte> | 82 | 0x07 0x1b <treble byte> |
83 | 0x08 0x1c <loudness byte> | 83 | 0x08 0x1c <loudness byte> |
84 | 0x09 0x1d <bass boost byte> | 84 | 0x09 0x1d <bass boost byte> |
85 | 0x0a 0x1e <contrast byte> | 85 | 0x0a 0x1e <contrast (bit 0-5), invert bit (bit 6)> |
86 | 0x0b 0x1f <backlight_on_when_charging, backlight_timeout> | 86 | 0x0b 0x1f <backlight_on_when_charging, backlight_timeout> |
87 | 0x0c 0x20 <poweroff timer byte> | 87 | 0x0c 0x20 <poweroff timer byte> |
88 | 0x0d 0x21 <resume settings byte> | 88 | 0x0d 0x21 <resume settings byte> |
@@ -297,7 +297,9 @@ int settings_save( void ) | |||
297 | config_block[0x8] = (unsigned char)global_settings.loudness; | 297 | config_block[0x8] = (unsigned char)global_settings.loudness; |
298 | config_block[0x9] = (unsigned char)global_settings.bass_boost; | 298 | config_block[0x9] = (unsigned char)global_settings.bass_boost; |
299 | 299 | ||
300 | config_block[0xa] = (unsigned char)global_settings.contrast; | 300 | config_block[0xa] = (unsigned char) |
301 | ((global_settings.contrast & 0x3f) | | ||
302 | (global_settings.invert ? 0x40 : 0)); | ||
301 | 303 | ||
302 | config_block[0xb] = (unsigned char) | 304 | config_block[0xb] = (unsigned char) |
303 | ((global_settings.backlight_on_when_charging?0x40:0) | | 305 | ((global_settings.backlight_on_when_charging?0x40:0) | |
@@ -482,6 +484,7 @@ void settings_apply(void) | |||
482 | set_battery_capacity(global_settings.battery_capacity); | 484 | set_battery_capacity(global_settings.battery_capacity); |
483 | 485 | ||
484 | #ifdef HAVE_LCD_BITMAP | 486 | #ifdef HAVE_LCD_BITMAP |
487 | lcd_set_invert_display(global_settings.invert); | ||
485 | settings_apply_pm_range(); | 488 | settings_apply_pm_range(); |
486 | peak_meter_init_times( | 489 | peak_meter_init_times( |
487 | global_settings.peak_meter_release, global_settings.peak_meter_hold, | 490 | global_settings.peak_meter_release, global_settings.peak_meter_hold, |
@@ -550,7 +553,9 @@ void settings_load(void) | |||
550 | global_settings.bass_boost = config_block[0x9]; | 553 | global_settings.bass_boost = config_block[0x9]; |
551 | 554 | ||
552 | if (config_block[0xa] != 0xFF) { | 555 | if (config_block[0xa] != 0xFF) { |
553 | global_settings.contrast = config_block[0xa]; | 556 | global_settings.contrast = config_block[0xa] & 0x3f; |
557 | global_settings.invert = | ||
558 | config_block[0xa] & 0x40 ? true : false; | ||
554 | if ( global_settings.contrast < MIN_CONTRAST_SETTING ) | 559 | if ( global_settings.contrast < MIN_CONTRAST_SETTING ) |
555 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; | 560 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; |
556 | } | 561 | } |
@@ -1066,6 +1071,7 @@ void settings_reset(void) { | |||
1066 | global_settings.rec_right_gain = 2; /* 0dB */ | 1071 | global_settings.rec_right_gain = 2; /* 0dB */ |
1067 | global_settings.resume = RESUME_ASK; | 1072 | global_settings.resume = RESUME_ASK; |
1068 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; | 1073 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; |
1074 | global_settings.invert = DEFAULT_INVERT_SETTING; | ||
1069 | global_settings.poweroff = DEFAULT_POWEROFF_SETTING; | 1075 | global_settings.poweroff = DEFAULT_POWEROFF_SETTING; |
1070 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; | 1076 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; |
1071 | global_settings.backlight_on_when_charging = | 1077 | global_settings.backlight_on_when_charging = |
@@ -1132,8 +1138,9 @@ void settings_display(void) | |||
1132 | global_settings.loudness, | 1138 | global_settings.loudness, |
1133 | global_settings.bass_boost ); | 1139 | global_settings.bass_boost ); |
1134 | 1140 | ||
1135 | DEBUGF( "contrast:\t%d\npoweroff:\t%d\nbacklight_timeout:\t%d\n", | 1141 | DEBUGF( "contrast:\t%d\ninvert:\t%d\npoweroff:\t%d\nbacklight_timeout:\t%d\n", |
1136 | global_settings.contrast, | 1142 | global_settings.contrast, |
1143 | global_settings.invert, | ||
1137 | global_settings.poweroff, | 1144 | global_settings.poweroff, |
1138 | global_settings.backlight_timeout ); | 1145 | global_settings.backlight_timeout ); |
1139 | #endif | 1146 | #endif |