From 17d74d661dd5fb312e71d1ba369f382a8b3b650c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 27 Mar 2024 20:12:27 +0200 Subject: [PATCH] Fix bitplane corruption in some weird modes --- custom.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/custom.cpp b/custom.cpp index e4525dc7..4d0e8536 100644 --- a/custom.cpp +++ b/custom.cpp @@ -1934,17 +1934,15 @@ static void end_estimate_last_fetch_cycle(int hpos) if (estimated_cycles_empty != estimated_cycles) { estimated_cycles = estimated_cycles_empty; estimate_cycles_empty_index = hpos; - uae_s8 *est = NULL; + uae_s8 *est = maxhposeven ? estimated_cycles_buf1 : estimated_cycles_buf0; if (maxhpos == estimated_maxhpos[0]) { est = estimated_cycles_buf0; } else if (maxhpos == estimated_maxhpos[1]) { est = estimated_cycles_buf1; } - if (est) { - for (int i = 0; i < RGA_PIPELINE_ADJUST; i++) { - int pos = (hpos + i) % maxhpos; - estimated_cycles_empty[pos] = est[pos]; - } + for (int i = 0; i < RGA_PIPELINE_ADJUST; i++) { + int pos = (hpos + i) % maxhpos; + estimated_cycles_empty[pos] = est[pos]; } } #else -- 2.47.3