View Single Post
Old 24 October 2015, 06:59   #8
Code Kitten

Join Date: Aug 2015
Location: Montreal/Canadia
Age: 48
Posts: 1,143
Originally Posted by Akira View Post
I actually am interested in making something that would scroll horizontally so this is good to hear.
Thanks, guys!
I need to learn so much more though.
An added advantage of CodeTapper's method is that interleaved bitplanes can also simplify blits: you can blit all bitplanes in a single operation when adding new tiles. For cookie cuts you need masks n times bigger if you want to do a single operation though but you could simply opt for a two times bigger mask and blit two planes at once depending on memory pressure at that particular moment (*). For small blits this is interesting since their setup time overhead is relatively higher.

Also I realize now that I completely miscalculated the bitplane pointer update for his technique: there is no need to reset any "exhausted" pointer at all because there is no "exhaustion": only 800 additional bytes are needed for the last bitplane while the others simply recycle existing bytes. Silly kitty.

This said, if you wanted to scroll say 400 screens, then instead of allocating 400x40 bytes you could simply allocate one additional bitplane (256x40) and do the reset of the exhausted pointer I suggested. This will require reordering bob data in memory though but only if you want to keep factorizing blits.

(*) note that blitting several planes requires that the planes to blit are separated by the same number (can be zero) of non blit planes (quite hard to picture I must admit) which can require an even number of planes. A bonus of the additional bitplane allocation suggested in the third paragraph is that it can transform an odd number of bitplanes into an even one and thus allow more viable combinations of bitplanes to blit.

Last edited by ReadOnlyCat; 24 October 2015 at 07:39. Reason: Added a paragraph. Added precision about blits.
ReadOnlyCat is offline  
Page generated in 0.04199 seconds with 11 queries