View Single Post
Old 27 February 2019, 19:46   #19
aros-sg
Registered User
 
Join Date: Nov 2015
Location: Italy
Posts: 191
Quote:
Originally Posted by MickGyver View Post
I somehow suspect that I shouldn't have to use interleaved bitmaps since the demo is otherwise working fine but you'll never know.

If your code isn't using the "saveword" optimization as in demo sources (only save/restore 2 bytes which are ~"trashed" when left/right scrolling, instead of a whole tile/block) then that can be so.


But there are some differences for algorithm between interleaved and non interleaved bitmaps. For interleaved bitmap to be able to scroll 16 pixels to the right, the bitmap needs to only have additional 2 extra bytes (32 pixels -> 4 bytes -> 320 pixels -> 40 bytes). For a non interleaved bitmap that would be 2*numplanes extra bytes (32 pixels -> 4 * numplanes bytes, 320 pixels -> 40 * numplanes bytes).


Example: interleaved bitmap at start x pixel position 0 goes from 0x10000 to 0x20000. At start x pixel position 16 it goes from 0x10002 to 0x20002. That's the whole bitmap with all planes. Because interleaved bitmap is basically a bit like a vertical strecthed single plane bitmap.


For a non interleaved 2 plane bitmap at start x pixel position 0: plane 1 0x10000 to 0x11000. plane 2 0x12000 to 0x13000. At pixel position 16: plane 1 0x10002 to 0x11002. plane 2 0x12002 to 0x130002. Each plane needs an additional 2 bytes.
So in total 4 extra bytes.
aros-sg is offline  
 
Page generated in 0.04356 seconds with 11 queries