]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix >=96 power_led_dim values affecting led sound filter state
authorToni Wilen <twilen@winuae.net>
Thu, 28 Dec 2023 16:42:22 +0000 (18:42 +0200)
committerToni Wilen <twilen@winuae.net>
Thu, 28 Dec 2023 16:42:22 +0000 (18:42 +0200)
cia.cpp

diff --git a/cia.cpp b/cia.cpp
index 13860fe9c938539b56e82cdb31067124f7a983ce..9ea46f522993a306b997ecee71d52e8a61fa3891 100644 (file)
--- a/cia.cpp
+++ b/cia.cpp
@@ -1252,6 +1252,7 @@ static void calc_led(int old_led)
 static void led_vsync(void)
 {
        int v;
+       bool ledonoff;
 
        calc_led(led);
        if (led_cycles_on && !led_cycles_off)
@@ -1264,6 +1265,7 @@ static void led_vsync(void)
                v = 255;
        if (v < 0)
                v = 0;
+       ledonoff = v > 96;
        if (currprefs.power_led_dim && v < currprefs.power_led_dim)
                v = currprefs.power_led_dim;
        if (v > 255)
@@ -1271,8 +1273,8 @@ static void led_vsync(void)
        gui_data.powerled_brightness = v;
        led_cycles_on = 0;
        led_cycles_off = 0;
-       if (led_old_brightness != gui_data.powerled_brightness) {
-               gui_data.powerled = gui_data.powerled_brightness > 96;
+       if (led_old_brightness != gui_data.powerled_brightness || ledonoff != gui_data.powerled) {
+               gui_data.powerled = ledonoff;
                gui_led (LED_POWER, gui_data.powerled, gui_data.powerled_brightness);
                led_filter_audio();
        }