How were individual bit planes scrolled on the Amiga (OCS)?

Back in my early Amiga days (A500), I remember coding simple demos that would use the dual-playfield mode and scroll them around (at a sweet 60FPS). It was pretty trivial to do with languages like Blitz Basic and AMOS. My knowledge back then was pretty limited as to what the Amiga could really do.

Later on in life, I learn that games like Agony used tricks like putting a static 1-bit bit plane and simply altering the background color of that bit plane with a copper list. Then, it would use the dual-playfield as normal with the exception that the background would now only have 2 planes instead of 3. This effect gives the illusion of three layers of scrolling with little CPU overhead.

This is amazing!

So my question is, how were the individual bit planes controlled like that? I originally thought that the grouped planes had to "stick together" when they move around. But I was wrong.

Thanks.

• No doubt someone will give you a detailed answer, but if you want to do some reading, I would recommend checking out the Amiga System Programmer's Guide by Abacus, section 1.5.5 does a detailed dive into playfields, scrolling, copper lists, etc. I used this book back in the day as my go-to resource for puzzling this stuff out. archive.org/details/Amiga_System_Programmers_Guide_1988_Abacus Jul 20, 2018 at 15:50

Individual bitplanes can only be scrolled by 16 pixels at a time, because the bitplane start address is word aligned. To scroll less than 16 pixels, the scroll register must be used, but it applies to all bitplanes on a playfield equally. The maximum number of playfields is two in dual playfield mode.

Agony uses a different technique. First, it uses dual playfield so that there are three playfields for the front scrolling layer and three for the back layer. That gives you two layers of parallax.

Then it splits the back playfield into two layers, using a trick that keeps one of the three bitplanes stationary while scrolling the other two with the scroll reigster. To stop the stationary layer from moving due to the scroll register, the blitter is used to shift it back in the opposite direction. This results in around 4k/frame of data copying, which is not too bad. To understand how this works, you need to understand bitplanes and how a kind of fake parallax can be created with duplicate colours.

A fourth layer of parallax is added with the rain effect that is created with sprites alone. Some games use sprites for background layers too by repeating them over a single line (Risky Woods is a good example).

On top of all that, the game users the Amiga's co-processor (copper) to alter the colour palette at different vertical positions on the screen, and then alternates between two palettes at 50Hz as well to produce a display with dozens of colours.

It really is a masterpiece of Amiga programming.

• That's what I was wondering. I didn't realize the blitter was moving that much data in the background layer. So, it's basically doing a soft scroll then? (of the background layer). Jul 23, 2018 at 15:35
• @cbmeeks yeah, soft scroll. It actually splits it over two frames as well so the scrolling is only 25 fps, meaning that the amount of data shifted on each frame is very small.
– user
Jul 23, 2018 at 15:51
• @cbmeeks it's a soft scroll of one bitplane and a hard scroll of the other two. Jul 23, 2018 at 21:37
• To be precise, the two scroll registers control the even planes and odd planes, regardless of whether the dual playfield mode has been actually activated. While the original intention is the use with dual playfield, it could be used for other effects too. Aug 31, 2018 at 8:22

It's as simple as you'd think; the individual bit planes have individual start addresses, set from DFF0E0 upwards, though the seventh and eighth planes listed there don't exist on the OCS or ECS Amigas, such as the A500 (OCS) or A500+ (ECS).

So they don't need to stick together at all, they're all set individually.

For scrolling finer than a word boundary (i.e. 16px), the Amiga offers two playfields. One is comprised of the even bit planes, the other of the odd. Each playfield can be hardware scrolled independently at pixel resolution.

Agony squeezes a third layer of scrolling by shifting one bitplane in the opposite direction to its playfield, so that it remains static. This is achieved via the blitter. The affected playfield ordinarily scrolls at only 25fps so less than 10% of blitter bandwidth is used up.

• Changing start address would only give 16-pixels-at-once horizontal scroll (while of course the finest 1 pixel vertical scroll).
– lvd
Jul 22, 2018 at 18:15
• @lvd you're right; I had strongly under-read the question. Updated to comment on playfields and how Agony as a specific title works. Jul 23, 2018 at 14:16
• Standard request after anonymous negative voting: please also comment. Otherwise I don't get the opportunity to learn how to improve. Jul 23, 2018 at 21:38
• @Tommy it's probably because you copied my answer after I posted it.
– user
Jul 24, 2018 at 8:59
• @user on the contrary, yours is wrong unless you already know the answer. I quote: "Then it splits the back playfield into two layers using a trick that keeps one of the three bitplanes stationary while scrolling the other two with the blitter." Maybe you're not a native spraker, and the text is ambiguous, but the thing that most strongly says is that the blitter scrolls two planes, which it doesn't. Luckily I have a long history here and have frequently originated community wiki answers when dealing with shared contributions, so your paranoia is easy to laugh off. Jul 24, 2018 at 13:00