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 | |
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')
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/settings.c | 15 | ||||
-rw-r--r-- | apps/settings.h | 4 | ||||
-rw-r--r-- | apps/settings_menu.c | 10 |
4 files changed, 29 insertions, 5 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index a3b98487ab..62cf492abc 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -1404,3 +1404,8 @@ id: LANG_SOKOBAN_ON | |||
1404 | desc: how to undo move | 1404 | desc: how to undo move |
1405 | eng: "[ON] To Undo" | 1405 | eng: "[ON] To Undo" |
1406 | new: | 1406 | new: |
1407 | |||
1408 | id: LANG_INVERT | ||
1409 | desc: in settings_menu | ||
1410 | eng: "Invert" | ||
1411 | new: | ||
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 |
diff --git a/apps/settings.h b/apps/settings.h index 6f127e05dc..6c383f9976 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -77,7 +77,8 @@ struct user_settings | |||
77 | 77 | ||
78 | /* device settings */ | 78 | /* device settings */ |
79 | 79 | ||
80 | int contrast; /* lcd contrast: 0-100 0=low 100=high */ | 80 | int contrast; /* lcd contrast: 0-63 0=low 63=high */ |
81 | bool invert; /* invert display */ | ||
81 | int poweroff; /* power off timer */ | 82 | int poweroff; /* power off timer */ |
82 | int backlight_timeout; /* backlight off timeout: 0-18 0=never, | 83 | int backlight_timeout; /* backlight off timeout: 0-18 0=never, |
83 | 1=always, | 84 | 1=always, |
@@ -189,6 +190,7 @@ extern char rockboxdir[]; | |||
189 | #define DEFAULT_CONTRAST_SETTING 38 | 190 | #define DEFAULT_CONTRAST_SETTING 38 |
190 | #endif | 191 | #endif |
191 | #define MIN_CONTRAST_SETTING 5 | 192 | #define MIN_CONTRAST_SETTING 5 |
193 | #define DEFAULT_INVERT_SETTING false | ||
192 | #define DEFAULT_POWEROFF_SETTING 0 | 194 | #define DEFAULT_POWEROFF_SETTING 0 |
193 | #define DEFAULT_BACKLIGHT_TIMEOUT_SETTING 5 | 195 | #define DEFAULT_BACKLIGHT_TIMEOUT_SETTING 5 |
194 | #define DEFAULT_BACKLIGHT_ON_WHEN_CHARGING_SETTING 0 | 196 | #define DEFAULT_BACKLIGHT_ON_WHEN_CHARGING_SETTING 0 |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index e931fe63bc..d82053caa9 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -51,6 +51,15 @@ static bool contrast(void) | |||
51 | 51 | ||
52 | #ifdef HAVE_LCD_BITMAP | 52 | #ifdef HAVE_LCD_BITMAP |
53 | 53 | ||
54 | static bool invert(void) | ||
55 | { | ||
56 | char* names[] = { str(LANG_SET_BOOL_NO), | ||
57 | str(LANG_SET_BOOL_YES) }; | ||
58 | |||
59 | return set_option( str(LANG_INVERT), &global_settings.invert, | ||
60 | names, 2, lcd_set_invert_display ); | ||
61 | } | ||
62 | |||
54 | /** | 63 | /** |
55 | * Menu to configure the battery display on status bar | 64 | * Menu to configure the battery display on status bar |
56 | */ | 65 | */ |
@@ -724,6 +733,7 @@ static bool display_settings_menu(void) | |||
724 | { str(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, | 733 | { str(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, |
725 | { str(LANG_CONTRAST), contrast }, | 734 | { str(LANG_CONTRAST), contrast }, |
726 | #ifdef HAVE_LCD_BITMAP | 735 | #ifdef HAVE_LCD_BITMAP |
736 | { str(LANG_INVERT), invert }, | ||
727 | { str(LANG_PM_MENU), peak_meter_menu }, | 737 | { str(LANG_PM_MENU), peak_meter_menu }, |
728 | { str(LANG_VOLUME_DISPLAY), volume_type }, | 738 | { str(LANG_VOLUME_DISPLAY), volume_type }, |
729 | { str(LANG_BATTERY_DISPLAY), battery_type }, | 739 | { str(LANG_BATTERY_DISPLAY), battery_type }, |