Proper coding for Vsync or similar functionality

Anything QL Software or Programming Related.
User avatar
tofro
QL Wafer Drive
Posts: 1794
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Proper coding for Vsync or similar functionality

Postby tofro » Fri Feb 14, 2020 7:22 am

In case the code still doesn't sync, you're probably trying to do too much (or rather, spend too much time) in the blanking.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
grafvonb
ROM Dongle
Posts: 35
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Proper coding for Vsync or similar functionality

Postby grafvonb » Fri Feb 14, 2020 7:44 pm

Hi guys, many thanks, my code with interrupts off and correct vsync (and after "no beer" review :lol:) works as expected!


Loving QL & ZX Spectrum & Amiga...
User avatar
tofro
QL Wafer Drive
Posts: 1794
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Proper coding for Vsync or similar functionality

Postby tofro » Fri Feb 14, 2020 8:26 pm

M68008 wrote:
Yes, this disables the interrupts. It's a good way to get all the processor time for your program.
With your vsync mechanism, this also prevents the OS from intercepting and clearing the interrupt before you detect it.

Avoid Minerva and use the MGG you have. It doesn't matter for now since you disable the OS, but it can cause problems if later you decide to call the OS for sound or reading the keyboard. See https://qemulator.blogspot.com/2013/04/minerva-and-games.html.


The main problem I had with Minerva was that it doesn't like to talk to the IPC with interrupts disabled. It works for a while, then behaves erratically and dies - In the end, I stole the MT.IPCOM trap from SMSQ/E sources - that works fine.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO

Who is online

Users browsing this forum: NormanDunbar and 3 guests