From 6e655e17e915aad786cba61aa45bb2c14c1c5c55 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 6 Nov 2016 16:58:37 +0200 Subject: [PATCH] More clear COLOR_CHANGE_MASK special case. --- drawing.cpp | 14 +++++++------- include/drawing.h | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drawing.cpp b/drawing.cpp index 5bfbae7e..cfe22d42 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -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) diff --git a/include/drawing.h b/include/drawing.h index 154ab287..bb87a756 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -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; -- 2.47.3