]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
More clear COLOR_CHANGE_MASK special case.
authorToni Wilen <twilen@winuae.net>
Sun, 6 Nov 2016 14:58:37 +0000 (16:58 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 6 Nov 2016 14:58:37 +0000 (16:58 +0200)
drawing.cpp
include/drawing.h

index 5bfbae7e3945caac6ed110946b5418c9b33fbd52..cfe22d425e59332bcf642b396dee0e31a3083cca 100644 (file)
@@ -2813,24 +2813,24 @@ static void do_color_changes (line_draw_func worker_border, line_draw_func worke
 
                if (regno >= 0x1000) {
                        pfield_expand_dp_bplconx (regno, value);
-               } else if (regno >= 0) {
-                       if (regno == 0 && (value & COLOR_CHANGE_BRDBLANK)) {
+               } else if (regno >= 0 && !(value & COLOR_CHANGE_MASK)) {
+                       color_reg_set(&colors_for_drawing, regno, value);
+                       colors_for_drawing.acolors[regno] = getxcolor(value);
+               } else if (regno == 0 && (value & COLOR_CHANGE_MASK)) {
+                       if (value & COLOR_CHANGE_BRDBLANK) {
                                colors_for_drawing.extra &= ~(1 << CE_BORDERBLANK);
                                colors_for_drawing.extra &= ~(1 << CE_BORDERNTRANS);
                                colors_for_drawing.extra &= ~(1 << CE_BORDERSPRITE);
                                colors_for_drawing.extra |= (value & 1) != 0 ? (1 << CE_BORDERBLANK) : 0;
                                colors_for_drawing.extra |= (value & 3) == 2 ? (1 << CE_BORDERSPRITE) : 0;
                                colors_for_drawing.extra |= (value & 5) == 4 ? (1 << CE_BORDERNTRANS) : 0;
-                       } else if (regno == 0 && (value & COLOR_CHANGE_SHRES_DELAY)) {
+                       } else if (value & COLOR_CHANGE_SHRES_DELAY) {
                                colors_for_drawing.extra &= ~(1 << CE_SHRES_DELAY);
                                colors_for_drawing.extra &= ~(1 << (CE_SHRES_DELAY + 1));
                                colors_for_drawing.extra |= (value & 3) << CE_SHRES_DELAY;
                                pfield_expand_dp_bplcon();
-                       } else if (regno == 0 && (value & COLOR_CHANGE_HSYNC_HACK)) {
+                       } else if (value & COLOR_CHANGE_HSYNC_HACK) {
                                hsync_shift_hack = (uae_s8)value;
-                       } else {
-                               color_reg_set (&colors_for_drawing, regno, value);
-                               colors_for_drawing.acolors[regno] = getxcolor (value);
                        }
                }
                if (lastpos >= endpos)
index 154ab287b7e3c6bcad408032887fea5a9ec5a5a2..bb87a75698d4851b11a2637e281209fe3121cd98 100644 (file)
@@ -195,6 +195,7 @@ STATIC_INLINE void color_reg_cpy (struct color_entry *dst, struct color_entry *s
 #define COLOR_CHANGE_BRDBLANK 0x80000000
 #define COLOR_CHANGE_SHRES_DELAY 0x40000000
 #define COLOR_CHANGE_HSYNC_HACK 0x20000000
+#define COLOR_CHANGE_MASK 0xf0000000
 struct color_change {
        int linepos;
        int regno;