From: Toni Wilen Date: Thu, 28 Dec 2023 16:42:22 +0000 (+0200) Subject: Fix >=96 power_led_dim values affecting led sound filter state X-Git-Tag: 5200~115 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=ff9aa508549458ada0b46b12e269e0508a42c93d;p=francis%2Fwinuae.git Fix >=96 power_led_dim values affecting led sound filter state --- diff --git a/cia.cpp b/cia.cpp index 13860fe9..9ea46f52 100644 --- 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(); }