Direct Video interlace
paulb-nl opened this issue · comments
Some cores like Genesis and PSX have 2 interlaced modes: normal(240 lines) and high resolution(480 lines). The normal mode is more like 240p and does not need to be deinterlaced by the scaler so the cores keep VGA_F1
at 0 every field.
This causes sync issues with Direct Video because it uses the field signal to generate the vde
signal and the cores still output 2 different line counts every field.
Lines 1162 to 1170 in c1080e2
To fix this we can either change the cores to always output the field when Direct Video is enabled or change the framework to not use the field signal but detect the different field lengths. Although there might be some cores like Atari 2600/7800 which don't have the field available.
I have tested below with some cores and it works well.
Change this
if(~old_vs & vga_vs_osd & ~f1) vsz <= vcnt;
to
if(~old_vs & vga_vs_osd) begin
if (vcnt != vcnt_ll || vcnt < vcnt_l) vsz <= vcnt;
vcnt_l <= vcnt;
vcnt_ll <= vcnt_l;
end
i'm fine with this if it works. I suggest to try it with Minimig as well. It uses interlace modes often. And you can test it in workbench simply by changing video modes in preferences.