English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 23 July 2009, 13:21   #1
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 628
(asm) how many gfx tiles I can put in one frame

How many gfx tiles 16x16x4 or 16x16x5 ( pixels x pixels x planes ) I can put ( paste ) on screen in one frame ? I think about amiga 500 and screen is 320x256x4 or 320x256x5.
Asman is offline  
AdSense AdSense  
Old 23 July 2009, 18:55   #2
Leffmann

 
Join Date: Jul 2008
Location: Sweden
Posts: 2,029
It depends on circumstances and what techniques you use. Do you want to make a scrolling map of tiles? Bobs that fly around on the screen, on a cleared background or on top of a backdrop?

In one 50hz frame there are about 70 000 memory cycles during which chip memory can be accessed, and for a 320x256x5 screen an OCS system will need 320*256*5/16 = 25600 cycles to generate the display signal, which leaves about 44 400 cycles free for other DMA.

For a scrolling game map you will be drawing tiles without masks or consideration for the background, and in word aligned positions. In this case the blitter will need 2*16*16*5/16 = 160 cycles for each 16x16x5 tile, excluding blitter setup time, which gives a theoretical max of only 277 tiles per frame.

However for a full screen scrolling map you don't need to redraw all the tiles each frame, but only the new tiles that have just come into view. For a 320x256 screen this means never more than 20+16+1 tiles (unless you want to scroll really fast), and so a 320x256x5 scrolling map in 50fps is not pushing the limits.
Leffmann is offline  
Old 24 July 2009, 01:38   #3
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
You could perform hardware scrolling for 1tileset. Just add 16 pixels right and down.
After that scroll You need to redraw whole screen.
But wait.
Do it only for tiles which change. Which means tiles that change on line movement and next one line on screen border.

Here is our screen:
DDDCDDD
DDDCDDD
DDDCDDD
If we scroll horizontally then only tile C is to redrawn and D next to it.

This works nice when You have static tiles and not much objects (not sprites) on playfield.
At every 1px hardware scroll You need to redraw tiles under them and put objects again.

Superfrog might be a good example how to do fast tiled screen.
AGN is offline  
Old 24 July 2009, 05:36   #4
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,452
You can calculate this from the blitter speed formula in HRM.

Use copyblit from A to D on even word boundaries and the blitsize width will be only 1 word.
Photon is offline  
Old 08 February 2010, 13:48   #5
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 628
@Leffmann, AGN, Photon

Its maybe a little late, but thanks for advices.

There is another question/problem. To find fastest way to copy tile ( 16x16x4 ) to interleaved screen. Any suggestion are welcome.
Asman is offline  
Old 08 February 2010, 13:55   #6
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,591
Quote:
Originally Posted by Asman View Post
To find fastest way to copy tile ( 16x16x4 ) to interleaved screen.
Just use the blitter.
StingRay is offline  
Old 08 February 2010, 13:59   #7
BuZz
Registered User
 
Join Date: May 2002
Location: Oxford / UK
Age: 41
Posts: 582
Send a message via ICQ to BuZz
Quote:
Originally Posted by AGN View Post
You could perform hardware scrolling for 1tileset. Just add 16 pixels right and down.
After that scroll You need to redraw whole screen.
But wait.
Do it only for tiles which change. Which means tiles that change on line movement and next one line on screen border.

Here is our screen:
DDDCDDD
DDDCDDD
DDDCDDD
If we scroll horizontally then only tile C is to redrawn and D next to it.

This works nice when You have static tiles and not much objects (not sprites) on playfield.
At every 1px hardware scroll You need to redraw tiles under them and put objects again.

Superfrog might be a good example how to do fast tiled screen.
I dont think you need to redraw the whole screen after scrolling 1 tile. you use a technique where the screen memory is like a piece of paper rolled into a cylinder after one screen height, you have a "join" where you reset to the beginning of screen memory again. you do have to do multiple blits for objects that sit over the "join" though. I've explained this badly, as it has been a long time since i have thought about this stuff
BuZz is offline  
Old 11 February 2010, 17:40   #8
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 628
Hi

@StingRay,

You're right but I need to copy at least about 300 tiles on one frame and I need some special ( mean speeeeed up technique ) way to do this, if exists of course
Any ideas ?

Regards
asman
Asman is offline  
Old 11 February 2010, 19:08   #9
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,452
There's no faster way than using the blitter. If doing 300 16x1x4bpl blits takes too long, you have to either only blit the tiles that CHANGE (anim tiles), by diffing (subtracting) the grid with tile numbers and only blit the tiles that have changed. To reduce the tile-count to minimum. Or, you need to make some design change to reduce the max count, f.ex. shrinking the screen.

If you don't have animated tiles, and need to blit 300 tiles just for scrolling, every frame, then you must re-code your scrolling routine to only blit the tiles that are coming in from top/bottom/left/right edge. And that's 72 tiles for a 320x256 screen, divided by two because you can't scroll BOTH up-left and down-right in the same frame
Photon is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Giana Sisters Tiles BippyM project.Maptapper 6 21 March 2016 18:36
Making tiles and Sprites..... sebmacfly Retrogaming General Discussion 4 31 March 2010 14:34
Dragon Tiles Badders request.Old Rare Games 2 28 August 2006 18:19
Found -> Dragon Tiles BippyM Looking for a game name ? 5 21 July 2004 11:05

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:06.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.32411 seconds with 14 queries