From: Toni Wilen Date: Sun, 6 Nov 2022 16:51:35 +0000 (+0200) Subject: Random color register contents at powerup. X-Git-Tag: 41000~90 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7b9ea1be00f338d14895305d8865890126829dc3;p=francis%2Fwinuae.git Random color register contents at powerup. --- diff --git a/custom.cpp b/custom.cpp index 69e5f429..36bb700b 100644 --- a/custom.cpp +++ b/custom.cpp @@ -13225,20 +13225,36 @@ void custom_reset(bool hardreset, bool keyboardreset) vsstop = 0; hcenter = 0; + for (int i = 0; i < 32; i++) { + uae_u16 c; + if (i == 0) { + c = ((ecs_denise && !aga_mode) || currprefs.cs_denisenoehb) ? 0xfff : 0x000; + } else { + c |= uaerand(); + c |= uaerand(); + } + c &= 0xfff; + current_colors.color_regs_ecs[i] = c; + } + for (int i = 0; i < 256; i++) { + uae_u32 c = 0; + if (i > 0) { + c |= uaerand(); + c |= uaerand(); + } + c &= 0xffffff; + current_colors.color_regs_aga[i] = c; + } if (!aga_mode) { - uae_u16 c = ((ecs_denise && !aga_mode) || currprefs.cs_denisenoehb) ? 0xfff : 0x000; for (int i = 0; i < 32; i++) { - current_colors.color_regs_ecs[i] = c; - current_colors.acolors[i] = getxcolor(c); + current_colors.acolors[i] = getxcolor(current_colors.color_regs_ecs[i]); } - #ifdef AGA +#ifdef AGA } else { - uae_u32 c = 0; for (int i = 0; i < 256; i++) { - current_colors.color_regs_aga[i] = c; - current_colors.acolors[i] = getxcolor(c); + current_colors.acolors[i] = getxcolor(current_colors.color_regs_aga[i]); } - #endif +#endif } lof_store = lof_display = 0; lof_lace = false;