]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
power_led_dim adjusts now brightness of dimmed state (1 to 100, 0 = off)
authorToni Wilen <twilen@winuae.net>
Sun, 20 May 2018 16:12:29 +0000 (19:12 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 20 May 2018 16:12:29 +0000 (19:12 +0300)
cfgfile.cpp
cia.cpp
include/options.h
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/win32gui.cpp

index 5a7bfd8199d46c029dbf2a97307cd7a40b59ffa8..85cc3dcccd31ced11b405353dbbcd0b5cb0f80c4 100644 (file)
@@ -2065,7 +2065,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        write_leds(f, _T("show_leds_enabled"), p->leds_on_screen_mask[0]);
        write_leds(f, _T("show_leds_enabled_rtg"), p->leds_on_screen_mask[1]);
        cfgfile_dwrite_bool(f, _T("show_refresh_indicator"), p->refresh_indicator);
-       cfgfile_dwrite_bool(f, _T("power_led_dim"), p->power_led_dim);
+       cfgfile_dwrite(f, _T("power_led_dim"), _T("%d"), p->power_led_dim);
 
        if (p->osd_pos.y || p->osd_pos.x) {
                cfgfile_dwrite (f, _T("osd_position"), _T("%.1f%s:%.1f%s"),
@@ -3027,7 +3027,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("sound_stereo_mixing_delay"), &p->sound_mixed_stereo_delay, 1)
                || cfgfile_intval (option, value, _T("sampler_frequency"), &p->sampler_freq, 1)
                || cfgfile_intval (option, value, _T("sampler_buffer"), &p->sampler_buffer, 1)
-               || cfgfile_intval (option, value, _T("warp_limit"), &p->turbo_emulation_limit, 1)
+               || cfgfile_intval(option, value, _T("warp_limit"), &p->turbo_emulation_limit, 1)
+               || cfgfile_intval(option, value, _T("power_led_dim"), &p->power_led_dim, 1)
 
                || cfgfile_intval(option, value, _T("gfx_frame_slices"), &p->gfx_display_sections, 1)
                || cfgfile_intval(option, value, _T("gfx_framerate"), &p->gfx_framerate, 1)
@@ -3111,7 +3112,6 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_yesno(option, value, _T("show_refresh_indicator"), &p->refresh_indicator)
                || cfgfile_yesno(option, value, _T("warp"), &p->turbo_emulation)
                || cfgfile_yesno(option, value, _T("headless"), &p->headless)
-               || cfgfile_yesno(option, value, _T("power_led_dim"), &p->power_led_dim)
                || cfgfile_yesno(option, value, _T("clipboard_sharing"), &p->clipboard_sharing)
                || cfgfile_yesno(option, value, _T("native_code"), &p->native_code)
                || cfgfile_yesno(option, value, _T("tablet_library"), &p->tablet_library)
diff --git a/cia.cpp b/cia.cpp
index 3adedb93a48fd559314e4878c302e890781525cb..bf5db603dabd48498728c48c008e85827020e1fa 100644 (file)
--- a/cia.cpp
+++ b/cia.cpp
@@ -898,8 +898,8 @@ static void led_vsync (void)
                v = 255;
        if (v < 0)
                v = 0;
-       if (currprefs.power_led_dim && v < 96)
-               v = 96;
+       if (currprefs.power_led_dim && v < currprefs.power_led_dim)
+               v = currprefs.power_led_dim;
        if (v > 255)
                v = 255;
        gui_data.powerled_brightness = v;
index 99718c2adc76742e86cbf657936de0882fb0299e..c4524bc9cda72c943de3bbaa8720666c16a4d56b 100644 (file)
@@ -556,7 +556,7 @@ struct uae_prefs {
        int collision_level;
        int leds_on_screen;
        int leds_on_screen_mask[2];
-       bool power_led_dim;
+       int power_led_dim;
        struct wh osd_pos;
        int keyboard_leds[3];
        bool keyboard_leds_in_use;
index 42539eda0af5431f3c658bb7e64b5bde9dc98f61..fb83e451ca20d381eed333dfc8701762e7476b02 100644 (file)
@@ -1712,7 +1712,7 @@ static void narrowimg(struct uae_image *img, int *xop, int *yop, const TCHAR *na
 
 static uae_u8 dimming(uae_u8 v)
 {
-       return v / 2;
+       return v * currprefs.power_led_dim / 100;
 }
 
 static int createmask2texture (struct d3dstruct *d3d, const TCHAR *filename)
index c45d7f3c17014934426d127d75bbef07b668833b..f7b4f9186eb617c522d97752cb952fc07ea4742a 100644 (file)
@@ -2387,7 +2387,7 @@ static void narrowimg(struct uae_image *img, int *xop, int *yop, const TCHAR *na
 
 static uae_u8 dimming(uae_u8 v)
 {
-       return v / 2;
+       return v * currprefs.power_led_dim / 100;
 }
 
 static int createmask2texture(struct d3d11struct *d3d, const TCHAR *filename)
index 5547766defb98251b0a327e19362c82431ba4e99..4b5a2ff2c8c199f88964c743a0c7be910a7d7436 100644 (file)
@@ -4410,7 +4410,7 @@ static const struct miscentry misclist[] = {
        { 0, 1, _T("Right Control = Right Windows key"), &workprefs.right_control_is_right_win_key },
        { 0, 0, _T("Windows shutdown/logoff notification"), &workprefs.win32_shutdown_notification },
        { 0, 1, _T("Warn when attempting to close window"), &workprefs.win32_warn_exit },
-       { 0, 1, _T("Power led dims when audio filter is disabled"), &workprefs.power_led_dim },
+       { 0, 1, _T("Power led dims when audio filter is disabled"), NULL, &workprefs.power_led_dim, 128, 0 },
        { 0, NULL }
 };