13 March 2019, 09:29 | #41 | |
Registered User
Join Date: Nov 2015
Location: Italy
Posts: 192
|
Quote:
Who knows. Theoretically it may be possible to get rid of annoying copper split, if ones uses three buffers (buffer 3 is clean buffer for restoring bobs). Code:
333333 333333 111111 111111 111111 111111 111111 111111 222222 222222 222222 222222 222222 222222 333333 333333 333333 333333 Each frame when the back buffer got cleaned (restore bob gfx trash) it should look like the restore buffer so if bad luck strikes and the back buffer (which will be display buffer in next frame) would become the one to cross the single wrap line at the bottom of memory it could swap role with the current restore buffer. |
|
13 March 2019, 12:18 | #42 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
|
Quote:
(actually I didn't read the whole thread, so I might not have the whole issue). The only drawback is that if you use triple buffering is mandatory to update two of it (in scrolling regards) in each frame. But if your engine already expects it normally, then nothing changes. This preclude you some tricks, like the partial only cookie cut on big objects (because you are forced to a full backgroud cleanup every frame). This can be an intriguing exercise |
|
26 March 2019, 10:42 | #43 | |
Pixel Vixen
Join Date: Feb 2018
Location: Mie, Japan
Posts: 219
|
Quote:
Thanks again. |
|
07 April 2019, 11:56 | #44 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
I'm trying to optimise my engine further as it's starting to choke with a few Bobs running around on screen. One idea that came up from discussions with Alpine9000 is to precalculate addresses to blit from and to - not exactly memory efficient, but saves Blitz from having to work out the addresses of a tile and the destination on the map every time a tile needs to be drawn. So I've implemented that in my engine.
First up, the blitter functions. These are hard coded specifically for 32 color 16x16 interleaved tiles (won't work on non-interleaved tiles, as you'll need to do several blits) Code:
#ScreenModulo = #XFillSize*2-2 #TileSize = 64*80+1 Statement PrepareTileBlit{} Move.l #$09f00000,$DFF040 ;A->D copy, no shifts, ascending mode Move.l #$ffffffff,$DFF044 ;no masking of first/last word Move.w $0,$DFF064 ;A modulo=bytes to skip between lines Move.w #ScreenModulo,$DFF066 ;d modulo=bytes to skip between screen lines End Statement Statement DoTileBlit{source.l,dest.l} Move.l D0,$DFF050 ;Source Move.l D1,$DFF054 ;Destination Move.w #TileSize,$DFF058 ;Start Blit End Statement Here's my code for calculating those. Code:
*Tile\Source = Address + (*Tile\Source * (2 * 16 * 5)) ;2 bytes across * height * depth *Tile\Destination = (x*2) + (y Mod #YFillSize) * (#XFillSize * 2 * 16 * 5) ;Tiles across * wordsize of 2 * height of 16 * depth of 5 |
07 April 2019, 19:15 | #45 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,217
|
Code:
*Tile\Source = Address + (*Tile\Source * (2 * 16 * 5)) |
08 April 2019, 01:37 | #46 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
Quote:
*Tile\Source = Address + (TileID * (2 * 16 * 5)) The reason I set the value to a multiple of itself is the original value is set by the map creation tool. I simply take that value and change it to be the literal memory location of the tile graphic. It only gets evaluated once (when the map is loaded). |
|
08 April 2019, 15:01 | #47 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,217
|
Ah, that makes sense. Thanks for the clarification!
|
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 |
|
|