tomm / fab-agon-emulator

Agon Light, Agon Light 2, Agon Console8 Emulator for Linux, Windows, any system with libSDL
GNU General Public License v3.0
82 stars 19 forks source link

Wait for VSYNC (VDU 23,0,&C3) not working? #26

Closed andrewmolyneux closed 10 months ago

andrewmolyneux commented 10 months ago

Platform: Windows 10 x64 Emulator version: v0.9.2 I've been playing with the emulator with a view to possibly buying a Console8. I wrote a BBC BASIC program to try scrolling the screen using VDU 23,7,m,d,z and I wanted it to be smooth so I added VDU 23,0,&C3 (flip buffer or wait for VSYNC) but it doesn't seem to be waiting for VSYNC. That is, I'd expect the program to take 8 seconds to scroll by a total of 480 pixels at 60 pixels per second, but it completes in well under a second. Have I misunderstood something or is the emulator not implementing the wait for VSYNC?

andrewmolyneux commented 10 months ago

Aha! I discovered *FX 19 is also supposed to wait for VSYNC and that works perfectly, so whatever's going on here presumably isn't an issue with the emulation. Ignore me 😀

astralaster commented 10 months ago

Did you use one of the double buffered modes? If not the swap buffer command might not do anything.

andrewmolyneux commented 10 months ago

I was working off the documentation here which says VDU 23, 0, &C3 “Flip(s) the screen buffer (double-buffered modes only) or wait(s) for VSYNC (all modes)" but I’ve found similar-looking pages elsewhere that don’t mention VSYNC so perhaps that page is just wrong 🤣

andrewmolyneux commented 10 months ago

Oh in fact @astralaster it seems that document is in your repo…

astralaster commented 10 months ago

I will check how it works on real hardware. But this might be a bug in the emulator.

andrewmolyneux commented 10 months ago

I guess if it works on real hardware we can reopen this 😄