View Single Post
Old 05 June 2014, 21:30   #38
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by Thorham View Post
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.

Thanks - reasonably clear although an example with tiles would be clearer.

I can see how this would save time as you are blitting less often but if you wanted to move the pipes up and down, this would be quite tricky?
Havie is offline  
 
Page generated in 0.04531 seconds with 11 queries