+ if (new_zone > 1 && (
+ new_zone == ambient_zone-1 || new_zone == ambient_zone+1)) {
+ // but change to the neighbouring zone is governed by _slow,
+ // except to the darkest zone, where we want fast reaction.
+ new_zone = val_to_zone(ambient_slow >> AMBIENT_SLOW_SHIFT);
+ }
+
+ // user_param ambient zone override
+ if ((user_zone = get_user_param(0)) > 0)
+ new_zone = user_zone - 1;
+
+ // TODO: maybe use these values instead of 10-bit?
+ byte_fast = a_10bit >> 2;
+ byte_slow = ambient_slow >> (AMBIENT_SLOW_SHIFT + 2);
+
+ if (byte_slow > byte_fast) {
+ drop = byte_slow - byte_fast;
+ if (drop > ambient_drop)
+ ambient_drop = drop;
+ }
+
+ if (ambient_min > byte_fast)
+ ambient_min = byte_fast;