larsbrinkhoff / terminal-simulator

Simulation of VT52 and VT100 terminal hardware.
GNU General Public License v3.0
113 stars 17 forks source link

Make smooth scroll a little smoother #34

Closed davide-romanini closed 2 years ago

davide-romanini commented 2 years ago

Attempt to fix issue #8. When smooth scrolling is enabled (the default), scrolling actually "jumps" every tenth frame. It seems that the firmware does its "shuffling" operation after having set the scroll latch to 0, but after the simulator actually rendered the current lines. That causes the scroll to appear smooth for a while but at the last frame it "jumps back" at its original position for a moment. I think the problem is that the "offset counter" used for smooth scrolling is actually loaded from the scroll latch during vertical reset (this is what I understand from the Tech reference at 4-96), but the simulator directly uses the scroll latch as immediately set by the cpu. I changed the video source to use an offset_counter loaded from the line_scroll to simulate this behavior and the scrolling seems to be much better. Probably this is not the definitive fix, but hope it's a step in the right direction.

larsbrinkhoff commented 2 years ago

That's great, thanks! I have looked but failed to find the cause. In retrospect it seems somewhat obvious.