Get info when QL is ready with screen redrawing?

Anything QL Software or Programming Related.
User avatar
grafvonb
ROM Dongle
Posts: 19
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Get info when QL is ready with screen redrawing?

Postby grafvonb » Wed Jul 03, 2019 5:54 pm

Is there any possibility to get an info that QL is ready with redrawing of the screen so I can update the screen memory (using some cycles) without the effect of flickering?


I'm Adam and I love QL & ZX Spectrum & Amiga
User avatar
tofro
QL Wafer Drive
Posts: 1604
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Get info when QL is ready with screen redrawing?

Postby tofro » Wed Jul 03, 2019 6:04 pm

Did you experience any flickering when you didn't?

Flickering typically occurs on concurrent access to memory (like on old IBM CGA video adapters) - This doesn't happen on the QL - The CPU always waits until the ULA has drawn the screen.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Dave
SandySuperQDave
Posts: 2414
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: Get info when QL is ready with screen redrawing?

Postby Dave » Wed Jul 03, 2019 6:08 pm

It's also an option to turn the video display off while the screen is being redrawn, so the redraw happens during the dark spell, if that is the effect you're trying to achieve?


User avatar
grafvonb
ROM Dongle
Posts: 19
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Get info when QL is ready with screen redrawing?

Postby grafvonb » Wed Jul 03, 2019 6:20 pm

Dave wrote:It's also an option to turn the video display off while the screen is being redrawn, so the redraw happens during the dark spell, if that is the effect you're trying to achieve?


Yes, exactly. I know it from Amiga where you can query if the redrawing of the screen is ready, allowing making some changes within some CPU cycles (like "move" a part of screen) without flickering or similar. How can I achieve this on QL? Would it be a right idea to switch between screen#0 and screen#1?


I'm Adam and I love QL & ZX Spectrum & Amiga
User avatar
tofro
QL Wafer Drive
Posts: 1604
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Get info when QL is ready with screen redrawing?

Postby tofro » Wed Jul 03, 2019 6:59 pm

grafvonb wrote:
Dave wrote:It's also an option to turn the video display off while the screen is being redrawn, so the redraw happens during the dark spell, if that is the effect you're trying to achieve?


Yes, exactly. I know it from Amiga where you can query if the redrawing of the screen is ready, allowing making some changes within some CPU cycles (like "move" a part of screen) without flickering or similar. How can I achieve this on QL? Would it be a right idea to switch between screen#0 and screen#1?


That's something different, then. Apparently, you want to make sure that your complete screen drawing is done in exactly one update cycle. That could be achieved by using the second screen as a back buffer, and switching back and forth between screens, making sure you never update the one currently on display. Quite some games use this method, however, some QL compatibles and emulators don't support the second screen.

Another method, which is horribly inefficient, is, synchronize your screen updates with the 50Hz interrupt (polling interrupt) - You can hook a routine to the polling interrupt, spend some cycles in a busy wait loop and then start drawing. This will make sure your access to screen memory happens during flyback - Note the original QL isn't exactly a racehorse, so the amount of update you can do there is quite small. Also, note that not all programs are executed at the same speed - If your program runs in contended memory (lower RAM shared with the video circuitry) your code will run around half the "normal" speed. In upper RAM, speed might depend on the quality of your memory expansion. Here, "speed" mainly applies to the "spend some cycles" thing mentioned above - This needs to be a timed loop based on cycle count, so must be adaptable between different makes and state of non-expanded and expanded QLs - so might be a bit tricky.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Derek_Stewart
QL Wafer Drive
Posts: 1429
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Get info when QL is ready with screen redrawing?

Postby Derek_Stewart » Wed Jul 03, 2019 8:17 pm

Hi,

In the 1990s, I wrote some extensions to copy screen 0 to screen 1 or screen 1 to screen 0. Using the Minerva fast copy routine, detailed in the Minerva manual.

I never released them, as it was a fun exercise for me to do.

Of course, a section of memory could reserved to do the screen updates the same size as the screen 0 size. Not needing the second screen.


Regards,

Derek
User avatar
grafvonb
ROM Dongle
Posts: 19
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Get info when QL is ready with screen redrawing?

Postby grafvonb » Wed Jul 03, 2019 9:10 pm

tofro wrote:
Another method, which is horribly inefficient, is, synchronize your screen updates with the 50Hz interrupt (polling interrupt)

Tobias


Wow, many thanks for your ideas. The 50Hz interrupt (7) was also my idea but this interrupt I just want to use to play "music" in background. So switching the screens might be the best solution....


I'm Adam and I love QL & ZX Spectrum & Amiga
User avatar
grafvonb
ROM Dongle
Posts: 19
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Get info when QL is ready with screen redrawing?

Postby grafvonb » Wed Jul 03, 2019 9:14 pm

Derek_Stewart wrote:Hi,
I never released them, as it was a fun exercise for me to do.


Wow, It would be great to see this code e.g. on GitHub? Please :)


I'm Adam and I love QL & ZX Spectrum & Amiga
stevepoole
Trump Card
Posts: 202
Joined: Mon Nov 24, 2014 2:03 pm

Re: Get info when QL is ready with screen redrawing?

Postby stevepoole » Wed Jul 03, 2019 9:20 pm

Hi,

I remember that TURBO did some pretty nifty screen handling, via the MOVE_MEMORY routines.
These routines are easily emulated using PEEK$ and POKE$.

I used them a lot replaying screenfulls of precalculated perspective image frames, just like videos.
But you do need lots of memory to be comfortable. So I had to wait for QPC2 to get fast video replays.

My first Turbo program had just two 'screens' in 128ko, leaving very little room for programs...
So I couldn't really apply my programs until I could afford a gold card !

These days, virtual reality animation is available on most platforms.
Regards,
Steve Poole.


User avatar
grafvonb
ROM Dongle
Posts: 19
Joined: Sat Jan 05, 2019 7:54 am
Location: Frankfurt/Germany

Re: Get info when QL is ready with screen redrawing?

Postby grafvonb » Wed Jul 03, 2019 9:29 pm

Maybe to state it clearly and I need your opinion if the whole story is possible.

I wrote some demos for Amiga in 90' but the QL... I'm just in love in this machine. My plan is to write a simple scroller (as I did for Amiga) but using just pure QL (68008) with 640k memory. Possible, without flickering?


I'm Adam and I love QL & ZX Spectrum & Amiga

Who is online

Users browsing this forum: No registered users and 5 guests