What I wanted on screen

Scenery that slides, soft and continuous, pixel by pixel. Not a stepped scroll that hops along, not an image that tears when the hero moves forward. The kind of smoothness you feel more than you notice, and that makes you say straight away that the game is good.

The trouble is that a 1989 Atari cannot afford to redraw the whole screen fifty times a second (and I hadn't even started on the STf yet). It's too much work for the processor, especially if it also has to animate the hero, the enemies and the game logic. If I had redrawn the scenery on every frame, there would have been nothing left for the rest.

The wrong track

My first instinct was to tell myself I should redraw cleverly, copying only what changes. But even optimised, copying the scenery continuously is still too heavy for the machine, and it showed: the scrolling dragged, and the rest of the game slowed down with it. I was trying to do quickly something that, in reality, shouldn't have been done at all.

The answer: let the STe do the work

The STe has an advantage its big brother the STf didn't have: it can move its own display, pixel by pixel, without asking anything of the processor. Rather than scrolling the scenery by redrawing it, I prepare a strip of scenery wider than the screen and simply ask the machine to look a little further right on each frame. The scenery slides, and the processor has done nothing. This is what is called hardware scroll.

There was still a quirk of the machine itself to sort out, which required the sprites to be erased and redrawn at the right moment so they wouldn't flicker or leave trails. Once that synchronisation was dialled in, the image became perfectly crisp in motion.

The result

Pixel-by-pixel scrolling on STe, smooth, flicker-free, and costing the machine almost nothing. All the time I'm not spending moving the scenery, I can now spend on the hero, the enemies and the game. This is the foundation everything else rests on: without clean scrolling, nothing else would look alive.

Download morteveille-003-hwscroll.prg (2.2 KB) - Historical archive of this step. Arrows to move, up to jump, fire to quit. For the current version of the game, see the homepage.

Next step

Collisions with the scenery and bigger levels. The player will be able to walk on platforms, be blocked by walls, and explore spaces much longer than what the screen shows at once.