gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > infinite scrolling

#8059 - mlequim - Tue Jul 01, 2003 2:10 pm

Hi there.
I have seen that 1024 tiles are available for tile data in mode0..2.
so is it possible to do an infinite scrolling ?
A screen need (240*160)/64 tiles = 600
+ border tiles (32+21).
So is it possible for the GBA to refresh +/- 53 tiles data with maybe DMA transfert and a cache system to reuse the tiles in the[0..652] boudary (if the tiles to transfert are in Rom)?
And there is also the need to keep correspondance between the tile map hardware and a tile map that indexes in a bigger image in Rom.
there will then rest 1024-653 static tiles for the 1,2or 3 backgrounds

Does someone has already do this and can tell me is it is possible to do ?
thanks, Michel

#8063 - Stephanj - Tue Jul 01, 2003 3:09 pm

hey didnt the NES do that at the end of Super Mario Bros., it went on forever until you went in the right door

#8064 - mlequim - Tue Jul 01, 2003 3:26 pm

I don't remember, but I am talking about refresh of tile Data and Tile Map, I think Super Mario did an infinite refresh of Tile Map. I want to break out of the limitation of the 64kb memory for background.

#8066 - niltsair - Tue Jul 01, 2003 3:42 pm

Yes it is possible.

Use one 256x256 Map. Keep two spare columns Left/Right and two spare lines (top/bottom). Scroll your map as you move, and load dynamicly the column/line, 1 at a time in the Map and the tiles. For the tiles you could just have 1 tile per map entry :

Map width : 240 + 8(left) + 8(Right) = 32columns
Map height : 160 + 8(Top) + 8(Bottom) = 22lines
Total tile per map : 32*22 = 704tiles
=>1.5 Layer in 256colors (minus the map entries)
=>2.9 layers in 16colors (minus the map entries)

Or keep track of the loaded tiles and reuse/free them as you go. Which would be much more efficient.

#8074 - mlequim - Tue Jul 01, 2003 4:38 pm

thanks for these explanations

#8168 - dragor - Thu Jul 03, 2003 5:21 pm

There was a discussion on this a few months back that may help you. Here's the link to the forum post.

http://forum.gbadev.org/viewtopic.php?t=7
_________________
Sum Ergo Cogito