MiSTer-devel / Atari7800_MiSTer

Atari 7800 for MiSTer
Other
10 stars 13 forks source link

Flickerblend broken #37

Open trebor68 opened 2 weeks ago

trebor68 commented 2 weeks ago

The Flickerblend option for the Atari 2600 appears to be broken. When enabled, it darkens the entire screen and flicker is still present. The game Space Invaders is a good testbed for this issue. It can be observed that often when shots are fired either by the enemy or the player, the shots remain "invisible", and Flickerblend enabled only darkens the entire screen image.

Kitrinx commented 2 weeks ago

Do you happen to know which build this broke in?

birdybro commented 2 weeks ago

I made a build just before @gyurco's recent sdram changes and one just after and that appears to be the correlating change that causes it.

https://github.com/MiSTer-devel/Atari7800_MiSTer/pull/27

Kitrinx commented 2 weeks ago

ah, this is probably what that curious part of video_mux was for

gyurco commented 2 weeks ago

Sorry if I broke it, however I don't see how even the original code could be a real 'flickerblend' - if flickerblend means that it's interpolating between frames. Looks like a composite blend instead. I admit, my patch broke the colors, here's a correction for that:

diff --git a/rtl/video_mux.sv b/rtl/video_mux.sv
index 5e6b0f3..5b7d5dd 100644
--- a/rtl/video_mux.sv
+++ b/rtl/video_mux.sv
@@ -144,13 +144,13 @@ always @(posedge clk_sys) begin
        end
        if (pix_ce_immediate) begin
                old_color <= out_color;
+               old_yuv_index <= yuv_index;
        end

        pix_ce_delayed <= pix_ce_immediate;
        pix_ce <= pix_ce_delayed;
        if (pix_ce_delayed) begin
                old_vblank <= tia_vblank;
-               old_yuv_index <= yuv_index;
                last_color <= {last_color[0], yuv_index};
                {red, green, blue} <= (blend && ~is_maria) ? blend_color : out_color;
                vsync <= is_maria ? maria_vsync : tia_vsync;
Kitrinx commented 2 weeks ago

It's not problem, I could have probably documented what was going on better. I didn't even remember what was going on looking at.