New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Scroll Scroll Scroll" demo has tearing during the display of the big scroll #680
Comments
Hi Arnaud, I've tested this and what I see is not tearing, but juddery / jerky scrolling. I'm using AIPC 0.1.42.1 and AppleWin both in 60Hz mode. (When I use AIPC in 50Hz, then it's jerky too.) Also I see similar jerky scrolling (only for AppleWin, not AIPC) for Ansi Story, at the "Turn the disk over!" horizontal scrolling message. I have seen this jerky (AppleWin) behaviour before, but hadn't raised it as an issue. I guess that AIPC is synchronising with the PC monitor's vsync, so that this jerky (or tearing) visual isn't visible? NB. My PC monitor's refresh rate is 60Hz. |
Hmm... I've just upgraded to AIPC 0.1.45.1 and I'm now seeing bad tearing for Scroll Scroll Scroll (big GR scroller) in 60Hz mode! (And 50Hz too.) What version of AIPC are using using? Are you running in 50 or 60Hz? |
Hello Tom, Thanks for your tests. AIPC v0.1.45.1 (50Hz and 60Hz) : no tearing but sometimes some jerky scrolling (not all the time... in fact rather infrequently). Not as smooth as on a real machine (in my memories) but OK. AW v1.28.8.0 (50Hz and 60Hz) : a lot of tearing. Edited: For information, my first monitor's refresh rate is 144Hz. The second is 60Hz. |
OK, I have just done other tests on a real machine this time... |
Definitely this is because AppleWin isn't synchronising with the PC monitor's display. So some sort of WaitForVerticalBlank() is required. And maybe GDI double-buffering is needed too. |
Note to self: I added support (currently turned off) in e09cd21 for WaitForVerticalBlank() between the StretchBlt() & the GdiFlush(). This now just gives me the sort of tearing that Arnaud is seeing. NB. WaitForVerticalBlank() is a heavyweight operation that busy-waits until VBL, so CPU usage is very high. See here where someone's solution is to check the scanline via a timer event every 2ms. He uses the scanline to decide where it's time to draw. |
Very interesting reading, thank you for sharing the link! |
To simply prevent the tearing (that you have posted screenshots for) I just need to do the Windows video update during the Apple II VBL. But this still gives juddery (jerky) scrolling :-/ I quickly tried using that heavyweight WaitForVerticalBlank(), but that didn't make much difference. Probably because I'm not updating the Windows display every 60Hz. I need to do further investigation here. btw. great to hear you have an Apple II again!! :-) |
NB. I committed 4ad0923 to fix the tearing. |
NB. I committed 4ad0923 to fix the tearing.
It makes sense that this fixed the issue.
The screenshots (from Windows) couldn't show an issue fixed by
WaitForVerticalBlank(). ; - )
|
Tearing fixed, so closing this issue. |
Email from Arnaud on 17/8/2019:
Today while making screenshots of my "old" releases, I noticed a weird issue. On "Scroll Scroll Scroll", there is tearing during the display of the big scroll (the one with GR characters).
I check again the original video I made at the time (with my real hardware), no problem of course (but I was pretty sure of that, otherwise I will not have released! ).
I also check with last version of AIPC, no issue either!
I thought of a regression, so I tested with another AppleWin version. But same issue with older version...
Note that version prior to 1.26 have display problems (but paradoxically, the tearing does not seem to be present).
I send you the DSK file if you want to test by yourself (it's exactly the original version, I did not change anything)...
Do you also see tearing or is it a problem with my PC ?!
The text was updated successfully, but these errors were encountered: