View Single Post
Old 05 June 2014, 01:47   #35
Computer Nerd

Thorham's Avatar
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 42
Posts: 3,047
In the diagram below the red box is the visible part of the screen (320x256 pixels). The green box is the whole screen (320*2+16*2 pixels wide, 256 pixels high), and the blue and cyan boxes are the blitting areas (both 16x256 pixels). Your background tiles are all 16 pixels wide.

You start with the top box setup. First you blit one column of tiles in the blue area, then you hardware scroll 16 pixels to the left so that you get to the second box setup. There you blit the same column of tiles you blitted in step one in the cyan area.

Then you start with the blue column again, where you blit the next column of tiles. Scroll 16 pixels to the left to get to the third box setup, blit the same tiles in the cyan part, then do the next bunch of tiles in the blue part, and just repeat all that until you get to the bottom box setup.

In the bottom box setup you only blit the cyan area, after that you move the screen back to the initial position as show in the top box setup, and you repeat the whole process again, and again until you reach the end of a level.

By blitting the same tiles in the blue and cyan areas you create two identical images in both halves of the screen, so that when you move the screen back to it's initial position, you won't see anything change in the visible part of the screen, and you can simply repeat the whole process again.

You save a ton of blitter time because you're only blitting 2*16*256 pixels for every 16 pixels you scroll with hardware scrolling.

If this wasn't clear enough, I'll come up with a better diagram with some actual tiles

Edit: Seems there's an inaccuracy in here. Hmm. Doesn't matter if it's clear, though.

Last edited by Thorham; 05 June 2014 at 06:55.
Thorham is offline  
Page generated in 0.04031 seconds with 10 queries