Hardware scrolling part of the screen

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
TobyLobster
Posts: 170
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Hardware scrolling part of the screen

Post by TobyLobster »

I was thinking about keeping the top four or five character rows of a MODE 2 screen fixed in position, then under a timed interrupt changing the CRTC register for the 'screen start address/8' when the electron beam has passed that point in order to horizontal scroll the rest of the screen. Then restoring the register back once the rest of the screen is displayed. Would this even work?

I could instead write (restore) the top part of the screen every update, but that takes a lot of time.
User avatar
Rich Talbot-Watkins
Posts: 1781
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Hardware scrolling part of the screen

Post by Rich Talbot-Watkins »

No, that won't work, because the CRTC only reloads its address counters from R12/13 at the end of its conceptual frame, i.e. when the vertical counter reaches R4.

But that helps us to consider how we might be able to achieve this! What if we tricked the CRTC into finishing its frame early, by setting the vertical total (R4) to a value midway down the screen? Then it would reload R12/13, and this time we would have to give it an R4 which genuinely takes it to the end of the PAL frame.

Turns out that this technique isn't particularly timing sensitive, and I wrote up how to do it in this article a few years back!
User avatar
TobyLobster
Posts: 170
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Hardware scrolling part of the screen

Post by TobyLobster »

Thanks Rich, that looks like exactly what I wanted! =D>
User avatar
Rich Talbot-Watkins
Posts: 1781
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Hardware scrolling part of the screen

Post by Rich Talbot-Watkins »

TobyLobster wrote:
Tue Oct 12, 2021 1:09 pm
Thanks Rich, that looks like exactly what I wanted! =D>
Good luck getting it working! You'll find that the timing isn't particularly critical, but it's a bit fiddly to implement for the first time. Basically you just need two interrupt points - one at the top of the static area, and one at the top of the scrolling area (these days I would probably use User VIA timer 1 for that, using the latch to measure the two different periods of time). Remember to make sure interlace is off, or it won't work as expected, and remember you'll probably need to mess with the addressable latch to constrain the wrap-around to 16k in the scrolling part!
User avatar
kieranhj
Posts: 983
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Hardware scrolling part of the screen

Post by kieranhj »

This reminds me I'm at least a year late to present the "Intro to CRTC Registers - part 2" which was intended to cover "Vertical Rupture" in some detail. :-k
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/
User avatar
TobyLobster
Posts: 170
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Hardware scrolling part of the screen

Post by TobyLobster »

kieranhj wrote:
Wed Oct 13, 2021 11:53 am
This reminds me I'm at least a year late to present the "Intro to CRTC Registers - part 2" which was intended to cover "Vertical Rupture" in some detail. :-k
Yes please!
User avatar
Rich Talbot-Watkins
Posts: 1781
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Hardware scrolling part of the screen

Post by Rich Talbot-Watkins »

Put together the most simple example I can manage of this, in Owlet.
User avatar
TobyLobster
Posts: 170
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Hardware scrolling part of the screen

Post by TobyLobster »

Rich Talbot-Watkins wrote:
Wed Oct 13, 2021 6:03 pm
Put together the most simple example I can manage of this...
Excellent, that's working nicely. Thanks again.
nicolagiacobbe
Posts: 77
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Hardware scrolling part of the screen

Post by nicolagiacobbe »

Thanks RTW. It is the easiest way I have found to dive into Vertical Rupture, I'll put it to good use soon.
cmorley
Posts: 1576
Joined: Sat Jul 30, 2016 8:11 pm
Location: Oxford
Contact:

Re: Hardware scrolling part of the screen

Post by cmorley »

Rich Talbot-Watkins wrote:
Wed Oct 13, 2021 6:03 pm
Put together the most simple example I can manage of this, in Owlet.
A very neat demo with some great comments. =D>
Post Reply

Return to “programming”