27 February 2019, 22:01 | #21 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Funny thing actually, interleaved shapes and bitmaps made the scrolling algorithm about twice as slow (at least in WinUAE, A1200 config), wth, it's supposed to be faster. Scrolling in one direction three pixels takes ~650µs in normal mode and ~1250µs using interleaved shapes and bitmaps. EDIT: The above is BS, it was probably a glitch in the matrix, testing it again today gave me the results (when scrolling horisontally 3px at top): ALBM: ~550µs, ILBM: ~450µs. I guess so, can't find the reason for it though. Last edited by MickGyver; 28 February 2019 at 13:03. |
|
28 February 2019, 21:55 | #22 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,543
|
@MickGyver
With Kiwi's Tale and the revised AlarCity engine, I approached scrolling in an entirely different fashion based on discussions with Alpine9000. The principle of it is - there's an array that contains dirty blocks that need to be reblitted. That's basically it. The advantages for such an approach are:
To start with, I declare a few different arrays at the top of my code Code:
;The width of the bitmap in number of tiles #XFillSize = 19 ;The height of the bitmap in number of tiles #YFillSize = 16 ;Number of buffers (just front and back buffer) #NumOfBuffers=2 ;The maximum level size supported #MaxLevelSize=256 ;My dirty buffer Dim DirtyBuffer.l(#YFillSize,#NumOfBuffers) ;The last camera X position for each buffer Dim LastDrawX(#NumOfBuffers) ;The last camera Y position for each buffer Dim LastDrawY(#NumOfBuffers) ;Look up tables that convert a "real" tile X/Y position to the position on the wrapped bitmap ;Much faster than using Mod at real time Dim XLookup(#MaxLevelSize) Dim YLookup(#MaxLevelSize) for i = 0 to 255 XLookup(i) = i Mod #XFillSize YLookup(i) = i Mod #YFillSize next Code:
;Translate the Camera position to Tile position DrawX = CameraX lsr 4 DrawY = CameraY lsr 4 ;How many tiles have we scrolled in either direction? ;Clamp this value to make sure we don't mark values outside of the buffer as dirty XDelta = QLimit(DrawX - LastDrawX(BackBuffer),-#XFillSize+1,#XFillSize-1) YDelta = QLimit(DrawY - LastDrawY(BackBuffer),-#YFillSize+1,#YFillSize-1) ;We're scrolling on the X Axis if XDelta ;We're scrolling left while XDelta < 0 LastDrawX(BackBuffer) - 1 wrappedx = XLookup(LastDrawX(BackBuffer)) y = #YFillSize while y y-1 DirtyBuffer(y,BackBuffer) BitSet wrappedx ;Set this one tile as dirty wend XDelta + 1 wend ;We're scrolling right while XDelta > 0 LastDrawX(BackBuffer) + 1 wrappedx = XLookup(LastDrawX(BackBuffer) + #XFillSize - 1) y = #YFillSize while y y-1 DirtyBuffer(y,BackBuffer) BitSet wrappedx ;Set this one tile as dirty wend XDelta - 1 wend endif ;We're scrolling on the Y Axis if YDelta ;We're scrolling up while YDelta < 0 LastDrawY(BackBuffer) - 1 wrappedy = YLookup(LastDrawY(BackBuffer)) DirtyBuffer(wrappedy,BackBuffer) = -1 ;Set the whole row as dirty YDelta + 1 wend ;We're scrolling down while YDelta > 0 LastDrawY(BackBuffer) + 1 wrappedy = YLookup(LastDrawY(BackBuffer) + #YFillSize - 1) DirtyBuffer(wrappedy,BackBuffer) = -1 ;Set the whole row as dirty YDelta - 1 wend endif ;When we get here, check each row if dirty, and reblit the tiles if needed y = #YFillSize while y y-1 wrappedy = YLookup(y+DrawY) row.l = DirtyBuffer(wrappedy,BackBuffer) if(row) ;Skip checking the row if there are no dirty tiles x = #XFillSize while x x-1 wrappedx = XLookup(x+DrawX) if row BITTST wrappedx ;Note that here my tile bitmap is a single long bitmap with only one column tile = !GetTile{x + DrawX,y + DrawY} BlockScroll 0,tile * 80,16,80,(x+DrawX) * 16,((y+DrawY) * 80) mod #BufferHeightMax,#BitMap_Tiles ;Hmm - I should be using a Look Up table for the Y coordinate above. Also LSL 4 rather than *16 for X endif wend DirtyBuffer(wrappedy,BackBuffer)=0 ;The entire row is now clean endif wend Note that my tiles are not literally 16x80. They're 16x16 with 5 bitplanes, but both the source and destination bitmaps are interleaved. I handle this in Blitz by treating the interleaved bitmaps like they were tall, single bitplane bitmaps. |
28 February 2019, 22:26 | #23 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Thanks! So you ended up using blockscroll instead of coppersplit + corkscrew? Isn't that much slower? Did you get stuck with the coppersplit method for Kiwi's tale (I would love to know before I put too much time into this method)?
Last edited by MickGyver; 01 March 2019 at 16:42. |
28 February 2019, 22:30 | #24 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,543
|
Quote:
I'm still using coppersplit+corkscrew, I'm using using the blockscroll command instead of block in order not to have to create a shape for each tile. |
|
01 March 2019, 08:11 | #25 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
I guess the issue that I'm having is a special case where some tile is drawn where it shouldn't (wrong x-offset) due to corkscrew scrolling. |
|
01 March 2019, 15:36 | #26 | |
Registered User
Join Date: Nov 2015
Location: Italy
Posts: 191
|
Except he seems to always blit complete row of tiles or complete column of tiles even when just scrolling one single pixel. That's super lame ;-p (I can say so, because ScrollingTrick.lha was written by me ...) Quote:
Example tilemap with first screen full of 1-Tiles and screen to the right full of 2-Tiles, scrolled to X position 3: Code:
21111111 21111111 21111111 11111111 11111111 11111111 So if now you were to scroll down this must be taken into account: Code:
33333333 21111111 21111111 21111111 11111111 11111111 |
|
01 March 2019, 16:22 | #27 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Oh, you wrote it, it's a brilliant algorithm!
Quote:
I think I have now narrowed down the problem to something related to what you explained above. Since the height of the screen in my example is only 208, there are a few steps where no tile is needed to be drawn when scrolling horisontally. When offsetting the horisontal fillup column downward like you explained above (at stepy=0, stepx>0), if stepx>=#BITMAPBLOCKSPERCOL then the first block of the vertical fillup row (yellow, blue and white squares) will overwrite one planeline of the last tile in the horisontal fillup column (pink squares). |
|
01 March 2019, 21:21 | #28 | ||
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Quote:
Last edited by MickGyver; 01 March 2019 at 21:58. |
||
04 March 2019, 15:56 | #29 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
These things seem to have sped up the algorithm according to these figures (WinUAE, A1200 configuration): Code:
Before opt. ------------ R/L: 3680us U/D: 2825us Diag: 5920us After opt. ------------ R/L: 1960us U/D: 1200us Diag: 2890us Code:
#TileHeight1P=80 Dim XLookup(#MaxLevelSize) Dim YLookup(#MaxLevelSize) Dim YModLookup(#MaxLevelSize) For i = 0 To #MaxLevelSize-1 XLookup(i) = i MOD #XFillSize YLookup(i) = i MOD #YFillSize YModLookup(i) = (i * #TileHeight1P) MOD (#BufferHeightMax) #BufferHeight)*#BufferDepth Next Code:
;Translate the Camera position to Tile position DrawX = CameraX LSR #TileXShift DrawY = CameraY LSR #TileYShift ;How many tiles have we scrolled in either direction? ;Clamp this value to make sure we don't mark values outside of the buffer as dirty XDelta = QLimit(DrawX - LastDrawX(BackBuffer),-#XFillSize+1,#XFillSize-1) YDelta = QLimit(DrawY - LastDrawY(BackBuffer),-#YFillSize+1,#YFillSize-1) ; We're scrolling on the X Axis If XDelta ; Set HeavyLoad flag HeavyLoad = True ; We're scrolling left While XDelta < 0 LastDrawX(BackBuffer) - 1 wrappedx = XLookup(LastDrawX(BackBuffer)) ; This assembly loop is about 200us faster than the basic equivalent below GetReg d0,wrappedx ; Set d0 to wrappedx GetReg d1,&DirtyBuffer(0,BackBuffer) ; Set d1 to the address of DirtyBuffer(0,BackBuffer) MOVE.l d1,a0 ; Move the address above to a0 MOVE.w #YFillSize-1,d2 ; Set d2 to #YFillSize-1 (for loop, using .w because DBRA operates on .w) LoopLeft: MOVE.l (a0),d1 ; Copy the long value at a2 to d1 BSET.l d0,d1 ; Set wrappedx bit of d1 MOVE.l d1,(a0)+ ; Copy d1 back to address a0, then increase a0 by 4 (l) DBRA d2,LoopLeft ; Decrease the value of d0 and jump to LoopLeft if value is > -1 ; y = #YFillSize ; While y ; y-1 ; DirtyBuffer(y,BackBuffer) BitSet wrappedx ; Set this one tile (bit) as dirty ; Wend XDelta + 1 Wend ; We're scrolling right While XDelta > 0 LastDrawX(BackBuffer) + 1 wrappedx = XLookup(LastDrawX(BackBuffer) + #XFillSize-1) ; This assembly loop is about 200us faster than the basic equivalent below GetReg d0,wrappedx ; Set d0 to wrappedx GetReg d1,&DirtyBuffer(0,BackBuffer) ; Set d1 to the address of DirtyBuffer(0,BackBuffer) MOVE.l d1,a0 ; Move the address above to a0 MOVE.w #YFillSize-1,d2 ; Set d2 to #YFillSize-1 (for loop, using .w because DBRA works with .w) LoopRight: ; MOVEQ #0,d1 ; This method is equally fast ; BSET.l d0,d1 ; OR.l d1,(a0)+ MOVE.l (a0),d1 ; Copy the long value at a2 to d1, BSET.l can only be used on d-register BSET.l d0,d1 ; Set wrappedx bit of d1 MOVE.l d1,(a0)+ ; Copy d1 back to address a0, then increase a0 by 4 (l) DBRA d2,LoopRight ; Decrease the value of d0 and jump to LoopRight if value is > -1 ; y = #YFillSize ; While y ; y-1 ; DirtyBuffer(y,BackBuffer) BitSet wrappedx ; Set this one tile (bit) as dirty ; Wend XDelta - 1 Wend EndIf ; We're scrolling on the Y Axis If YDelta ; Set HeavyLoad flag HeavyLoad = True ; We're scrolling up While YDelta < 0 LastDrawY(BackBuffer) - 1 wrappedy = YLookup(LastDrawY(BackBuffer)) DirtyBuffer(wrappedy,BackBuffer) = #RowDirty ; Set the whole row as dirty YDelta + 1 Wend ; We're scrolling down While YDelta > 0 LastDrawY(BackBuffer) + 1 wrappedy = YLookup(LastDrawY(BackBuffer) + #YFillSize-1) DirtyBuffer(wrappedy,BackBuffer) = #RowDirty ; Set the whole row as dirty YDelta - 1 Wend EndIf ; When we get here, check each row if dirty, and reblit the tiles if needed y = #YFillSize While y y-1 ycalc=y+DrawY wrappedy = YLookup(ycalc) row = DirtyBuffer(wrappedy,BackBuffer) If row ; Skip checking the row if there are no dirty tiles x = #XFillSize While x x-1 xcalc=x+DrawX wrappedx = XLookup(xcalc) If row BitTst wrappedx tile = !GetTile{xcalc,ycalc} ;Block tile, xcalc LSL 4, YModLookup(ycalc) ; Use this if you create shapes for all the tiles ; 4 16 80 4 BlockScroll tile LSL #TileXShift, 0, #TileWidth, #TileHeight1P, xcalc LSL #TileXShift, YModLookup(ycalc), #BitmapVTiles EndIf Wend DirtyBuffer(wrappedy,BackBuffer)=0 ; The entire row is now clean EndIf Wend Last edited by MickGyver; 04 March 2019 at 18:19. |
|
04 March 2019, 23:43 | #30 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,543
|
Quote:
|
|
11 March 2019, 10:37 | #31 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
8-Way Scrolling (Interleaved)
A few days ago I had eye surgery so to occupy my mind the day before, I was fighting to get the 8-way scrolling algorithm by aros-sg to work and I succeeded! There might be some bugs still, but according to my tests it seems to work. The example uses interleaved bitmaps. I have avoided using MOD, divisions and multiplications wherever possible.
Code:
; **************************************************** ; ; Interleaved single buffer 8-way tilemap scrolling demo (corkscrew+coppersplit) ; by MickGyver @ English Amiga Board 2019 ; Based on http://aminet.net/package/dev/src/ScrollingTrick ; (more precisely Scroller_XYLimited, read the docs in ScrollingTrick.lha) ; and earoks (English Amiga Board) dev notes for Kiwi's Tale ; ; MIT License, read license.txt ; ; In order to use the Bitmap newtype, include the resident file ; Blitzlibs:Bb2objtypes.res in the residents list in the compiler options. ; ; Notes about the tilemap: ; The leftmost and rightmost columns and topmost and bottommost rows of the tilemap ; will never be visible, so you need to add padding to the map. ; ; **************************************************** ; ... ; This code has been truncated to fit the post, download the zip file to view full source ; ... ; ---------------------------------------------- ; SCROLL UP ; ---------------------------------------------- ScrollUp: If mapposy > 0 ; Increase position first mapposy-1 mapblocky=mapposy LSR #TileYShift stepy=!ModNumYSteps{mapposy} videoposy-1 If videoposy<0 Then videoposy+#BitmapHeight If stepy = (#TileHeight-1) block_videoposy-#TileHeight If block_videoposy<0 Then block_videoposy+#BitmapHeight If stepx > #NoBlocks ; Step 1: blit the 1st block in the fillup mapx=mapblockx+#BitmapTilesX mapy=mapblocky+1 x=!RoundToBlockWidth{videoposx} y=(block_videoposy+#TileHeight) If y>=#BitmapHeight Then y-#BitmapHeight !DrawTile{mapx, mapy, x+#BitmapWidth, y * #BufferDepth} ; Step 2: remove the (former) bottommost fill up block ; we blit a 'left' block mapy=stepx-#NoBlocks+1 y=(block_videoposy+(mapy LSL #TileYShift)) If y>=#BitmapHeight Then y-#BitmapHeight mapx-#BitmapTilesX ; Repair broken tile if needed (the tile below the current drawn) If scroll_dir_prev=#DirRight If mapy+1 < #BitmapTilesY y2=y+#TileHeight If y2>=#BitmapHeight Then y2-#BitmapHeight !DrawTileTop{mapx, mapy+mapblocky+1, x, y2 * #BufferDepth} EndIf EndIf !DrawTile{mapx, mapy+mapblocky, x, y * #BufferDepth} ; Set previous direction as left scroll_dir_prev=#DirLeft EndIf EndIf mapx=stepy mapy=mapblocky y=block_videoposy If mapx >= #TwoBlocks ; Blit only one block mapx+#TwoBlocks x=mapx LSL #TileXShift + !RoundToBlockWidth{videoposx} mapx+mapblockx !DrawTile{mapx, mapy, x, y * #BufferDepth} Else ; Draw two tiles mapx=mapx LSL 1 x=mapx LSL #TileXShift + !RoundToBlockWidth{videoposx} mapx+mapblockx !DrawTile{mapx, mapy, x, y * #BufferDepth} !DrawTile{mapx+1, mapy, x+#TileWidth, y * #BufferDepth} EndIf EndIf RTS ; ---------------------------------------------- ; SCROLL DOWN ; ---------------------------------------------- ScrollDown: If mapposy < #MapYMax ; Get positions mapx = stepy mapy = mapblocky + #BitmapTilesY y = block_videoposy If mapx >= #TwoBlocks ; Blit only one block mapx+#TwoBlocks x=mapx LSL #TileXShift + !RoundToBlockWidth{videoposx} mapx+mapblockx !DrawTile{mapx, mapy, x, y * #BufferDepth} Else ; Blit two blocks mapx = mapx LSL 1 x = mapx LSL #TileXShift + !RoundToBlockWidth{videoposx} mapx+mapblockx !DrawTile{mapx, mapy, x, y * #BufferDepth} !DrawTile{mapx+1, mapy, x+#TileWidth, y * #BufferDepth} EndIf ; Increase position mapposy+1 mapblocky=mapposy LSR #TileYShift stepy=!ModNumYSteps{mapposy} videoposy+1 If videoposy>=#BitmapHeight Then videoposy-#BitmapHeight ; If stepy=0 then we need to fix the horisontal fillup row If stepy=0 block_videoposy+#TileHeight If block_videoposy>=#BitmapHeight Then block_videoposy-#BitmapHeight If stepx >= #NoBlocks ; Step 1: blit the 1st block in the fillup row (y) mapx=mapblockx mapy=mapblocky x=!RoundToBlockWidth{videoposx} y=block_videoposy !DrawTile{mapx, mapy, x, y * #BufferDepth} mapy=stepx-#NoBlocks y=(block_videoposy+(mapy LSL #TileYShift)) If y>=#BitmapHeight Then y-#BitmapHeight x+#BitmapWidth mapx+#BitmapTilesX If scroll_dir_prev=#DirLeft If (mapy-1) > 0 AND (mapy-1) < #BitmapTilesY-1 y2=y-#TileHeight If y2<0 Then y2+#BitmapHeight !DrawTileBottom{mapx, mapy+mapblocky-1, x, y2 * #BufferDepth} EndIf EndIf !DrawTile{mapx, mapy+mapblocky , x, y * #BufferDepth} ; Set previous direction as right scroll_dir_prev=#DirRight EndIf EndIf EndIf RTS ; ---------------------------------------------- ; SCROLL LEFT ; ---------------------------------------------- ScrollLeft: If mapposx > 0 ; Decrease position mapposx-1 mapblockx=mapposx LSR #TileXShift stepx=!ModNumXSteps{mapposx} videoposx-1 If stepx = (#TileWidth-1) ; Step 1: blit the block which came in at the left side, ; which might or might not be a fill up block mapx=mapblockx mapy=mapblocky If stepy > 0 ; There is a fill up block mapy+#BitmapTilesY EndIf x=!RoundToBlockWidth{videoposx} y=block_videoposy !DrawTile{mapx, mapy, x, y * #BufferDepth} ; Step 2: remove the (former) rightmost fillup-block mapx=stepy If mapx > 0 ; There is a fill up block If mapx >= #TwoBlocks mapx+#TwoBlocks Else mapx+mapx; mapx=mapx*2 EndIf x=!RoundToBlockWidth{videoposx}+(mapx LSL #TileXShift) ; mapx*#TileWidth y=block_videoposy mapx+mapblockx mapy-#BitmapTilesY !DrawTile{mapx, mapy, x, y * #BufferDepth} EndIf EndIf mapx=mapblockx mapy=stepx-#NoBlocks+1 x=!RoundToBlockWidth{videoposx} y=(block_videoposy+(mapy LSL #TileYShift)) ;MOD #BitmapHeight If y>=#BitmapHeight Then y-#BitmapHeight ; Repair broken tile if needed (the tile below the current drawn) If scroll_dir_prev=#DirRight If mapy+1 < #BitmapTilesY y2=y+#TileHeight If y2>=#BitmapHeight Then y2-#BitmapHeight !DrawTileTop{mapx, mapy+mapblocky+1, x, y2 * #BufferDepth} EndIf EndIf If stepx >= #NoBlocks ; Don't draw tiles every step, it's not needed/wanted !DrawTile{mapx, mapy+mapblocky, x, y * #BufferDepth} EndIf If stepx > 0 scroll_dir_prev=#DirLeft Else scroll_dir_prev=#DirNone EndIf EndIf RTS ; ---------------------------------------------- ; SCROLL RIGHT ; ---------------------------------------------- ScrollRight: If mapposx < #MapXMax mapx=mapblockx + #BitmapTilesX mapy=stepx-#NoBlocks+1 x=!RoundToBlockWidth{videoposx} y=(block_videoposy+(mapy LSL #TileYShift)) ;MOD #BitmapHeight If y>=#BitmapHeight Then y-#BitmapHeight ; Repair broken tile if needed (tile above current drawn) If scroll_dir_prev=#DirLeft If (mapy-1) > 0 AND (mapy-1) < #BitmapTilesY-1 y2=y-#TileHeight If y2<0 Then y2+#BitmapHeight !DrawTileBottom{mapx, mapy+mapblocky-1, x+#BitmapWidth, y2 * #BufferDepth} EndIf EndIf ; Blit one block If stepx >= #NoBlocks ; Don't draw tiles every step, it's not needed/wanted !DrawTile{mapx, mapy+mapblocky, x+#BitmapWidth, y * #BufferDepth} EndIf ; Increase position mapposx+1 mapblockx=mapposx LSR #TileXShift stepx=!ModNumXSteps{mapposx} videoposx+1 If stepx = 0 ; Step 1: blit the block which came in at the right side, ; which is never a fill up block mapx=mapblockx+#BitmapTilesX-1 mapy=mapblocky x=!RoundToBlockWidth{videoposx}+(#BitmapTilesX-1) LSL #TileXShift y=block_videoposy !DrawTile{mapx, mapy, x, y * #BufferDepth} ; Step 2: blit the (new) rightmost fillup-block mapx=stepy If mapx > 0 ; There is a fill up block If mapx >= #TwoBlocks mapx = mapx + (#TwoBlocks-1) Else mapx = mapx LSL 1 - 1 EndIf x=!RoundToBlockWidth{videoposx} + (mapx LSL #TileXShift) y=block_videoposy mapx+mapblockx !DrawTile{mapx, mapy+#BitmapTilesY, x, y * #BufferDepth} EndIf EndIf If stepx > 0 scroll_dir_prev=#DirRight Else scroll_dir_prev=#DirNone EndIf EndIf RTS 2019-03-12 - Added MIT license.txt 2019-03-11 - Initial version Last edited by MickGyver; 12 March 2019 at 11:48. Reason: Added MIT license.txt |
11 March 2019, 18:38 | #32 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
I also updated the horisontal and vertical scrolling examples, they can be found in previous posts in this thread. All examples now use interleaved bitmaps and the blockscroll function for drawing tiles (instead of shapes).
|
11 March 2019, 19:17 | #33 |
Registered User
Join Date: Dec 2016
Location: Warsaw area
Posts: 153
|
This is really great job you do here.
I'll test it when back at home but looking at your previous X and Y scrollers this will be perfect, I'm sure. Now I wanted to ask this for long time, and forgive me if the question is ... strange but: What is the "license" for this code examples? Can I (we) use it in our games? Can we make commercial products with this code? I'm thinking of using these procedures in my production hence the question. TIA |
12 March 2019, 07:38 | #34 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
The aim with my Blitz Basic work has been to make BB2 more accessible so we could see less Backbone etc. games and hopefully more better quality games for our beloved Amigas. |
|
12 March 2019, 08:44 | #35 |
Registered User
Join Date: Nov 2015
Location: Italy
Posts: 191
|
|
12 March 2019, 08:48 | #36 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,543
|
Also OK with whatever code I've posted online being in the public domain
|
12 March 2019, 11:53 | #37 | ||
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Quote:
I have now added the MIT license to all the demos. If you (read BB2 programmers) end up using one of these algorithms, please post any improvements / optimisations if at all possible. |
||
12 March 2019, 21:29 | #38 |
Registered User
Join Date: Dec 2016
Location: Warsaw area
Posts: 153
|
Gentleman
Thank you very much. I started sharing my code because of the same reasons as MickGyver (to make BB2 more accessible. I'm not an expert by any means but I had chance to code few simple things and sharing is crucial to Amiga community nowadays IMO. So again thanks a lot for your work on these very important assets. Now we don't have any excuses. Example code and demos are here - let's use them I hope to share with you soon(ish) some info of little project I work on. [edit] @MickGyver You said you use Earok's interleaved bitmap trick for latest XY demos. Is it also used in other X and Y demos? |
13 March 2019, 07:34 | #39 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Interleaved bitmaps are used in all the demos in this thread. Earok mentioned earlier that "normal" shapes can still be used with the blit functions. The tiles are drawn using blockscroll so they don't need any extra memory.
|
13 March 2019, 09:03 | #40 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,543
|
Quote:
The advantage with using interleaved bitmaps is you only need to do one blitter operation to hit all bitplanes. With a non-interleaved five bitplane bitmap, Blitz would need to do five individual blitter operations "under the hood" to hit all five bitplanes. So it makes sense to have your tileset as interleaved, although it's a bit more complicated to set up. It is possible to also have interleaved Bobs of course, but it's very memory intensive - the cookie mask for a five bitplane interleaved shape is five times the size of the mask of a non-interleaved version. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tilemap Designer for Blitz Basic | Havie | Coders. Blitz Basic | 5 | 16 June 2014 00:19 |
tilemap.library | Samurai_Crow | Coders. System | 4 | 02 November 2011 21:08 |
smooth scrolling.is it possible? | kirk | support.WinUAE | 30 | 01 October 2007 13:57 |
Tilemap + Scrolling routines source code | Ultron | Coders. General | 0 | 02 April 2007 01:00 |
0.8.21 R2: Scrolling issues | andreas | support.WinUAE | 0 | 12 March 2002 08:14 |
|
|