Proper coding for Vsync or similar functionality

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Proper coding for Vsync or similar functionality

Post by tofro »

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
Bent Pin Expansion Port
Posts: 80
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Proper coding for Vsync or similar functionality

Post by grafvonb »

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
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Proper coding for Vsync or similar functionality

Post by tofro »

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/ ... 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
Post Reply