STE horizontal hardware scroll


Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Atari maniac
Atari maniac
Posts: 85
Joined: Thu Dec 05, 2013 4:15 pm

Re: STE horizontal hardware scroll

Post by joefish »

Surely to horizontal scroll, the intention is that you set up a double-width screen and pan from one side to the other, filling in the same thing to both the leading and trailing edge of the viewport. Then when you reach the end of the pan, you jump back to the beginning because at that point both halves of the virtual screen are showing the same thing.

Technically your virtual screen would probably be two screens plus two (or more) tiles in width to disguise the filling-in, but the pan-and-jump-back principal still applies. It takes more memory (two screens) but it's a lot easier to manage. You only have to do that fiddly one-screen roll-around thing if you're sync-scrolling the standard ST screen.
User avatar
Captain Atari
Captain Atari
Posts: 163
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STE horizontal hardware scroll

Post by thomas3 »

evil wrote: But enough babble, here's the source:
Thanks for that - I'm just learning, so this is really helpful. Great commenting too :D

But I have a very stupid question - bear with me - this is STE-only source, right? Surely you can't write to the video base like this on an ordinary ST?! (I only have STEEM to try it on).

Atari God
Atari God
Posts: 1242
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: STE horizontal hardware scroll

Post by Zamuel_a »

What I did in my Giana sisters STE conversion is that when I enter a new level I setup several screens with all the graphics so that the scroll routine only has to do that and not fill in any new data. I tried that at first, but it takes a lot of processor power to redraw the new 16 pixels that will come into view. If you scroll diagonal you need to draw both horizontal and vertical data so that's even more.

The problem is ofcourse that the hardware scroller can't scroll an infinite wide screen. If you need a wider screen than just 4 * 320 you just have to create a copy of the last screen and put at the beginning of a new memory area that you jump to then you walk past the first 4 screens.

For example, if I need a 7 screen wide playfield I just put them in memory like this:

1 2 3 4 | 4 5 6 7
So I have to waste one 320x200 area with a copy of the last screen in the first buffer but it's not that much memory you loose. 8 screens only take 32k*8 = 256k and it shouldn't be a problem for an STE.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe
Captain Atari
Captain Atari
Posts: 376
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: STE horizontal hardware scroll

Post by jury »

Quite neat trick to save processor time.
Post Reply

Return to “Coding”