Re: A83: tilemapping question


[Prev][Next][Index][Thread]

Re: A83: tilemapping question




In a message dated 5/28/00 2:16:25 PM Eastern Daylight Time, 
phlu00@hotmail.com writes:

> thanks for your help but it isn't that useful for me but thx anyways

Well there are a couple important things you can get out of that algorithm.  
I used it in Megacar and essentially ripped it to pieces to make it easier 
and use the best parts while taking out the unnecessary stuff.  But remember 
these:

1.Use a 2 kilobyte rotate table for all the different byte values.  The high 
byte points to the start of the 256-byte listing for a certain bit offset 
(e.g. ld a,b \ and 7 \ add a,rot_table/256).  Then you put the actual byte 
from the buffer in the lower bit of the address and get the rotated byte by 
accessing the pointer.

2.Unroll your loops!  The code Jimmy came up with is very well optimized, 
using the shadow registers and all.  Doing a hundred loops lags the thing 
like crazy.


Even if you don't use his code, remember this when you write your own.  
Although Jimmy's code is for a map buffer instead of a tile buffer (ie the 
sprites have already been drawn), the concept is very similar.  Kirk Meyer 
(kirkmeyer@bigfoot.com) is modifying it to use tiles and will support both 
vertical and horizontal scrolling in a game he's working on.  You might want 
to email him for some ideas.


----
Jonah Cohen
<ComAsYuAre@aol.com>
http://jonah.ticalc.org