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.

Beginners > Multiple Maps For Scrolling

#170700 - Azenris - Tue Oct 13, 2009 3:22 am

Btw i did check myself but for 100% clarity ill ask too!

When wanting to do screen scrolling I need to use 2 maps, (32x32). And from what I read they are one after the other, its not exactly 64x32 its two 32x32's. This is what ive based my coding on and it seems ok so far, so im assuming its corrent.

Anyway to get to the other maps im using
Code:

#define HARDWARE_TILES_X       32
#define HARDWARE_TILES_Y       32
#define HARDWARE_MAP_SIZE      (HARDWARE_TILES_X * HARDWARE_TILES_Y)
#define MAP_OFFSET(n)          ((n) * HARDWARE_MAP_SIZE)                     


Only reason I ask is to make sure 100% this is all ok, I'm fining it hard to get scrolling fully working and wanna make sure the basics are ok.

One of the problems I was having is everything that loads on the second map is a row lower than it should be (8 pixels lower). If this map offset is corrent I must be making the mistake elsewhere.
_________________
My Homebrew Games

#170703 - sverx - Tue Oct 13, 2009 3:21 pm

Maps are made up of halfwords (16 bits) if you're using 'text' and 'extended' backgrounds, bytes (8 bits) if you're using 'rotational' backgrounds. And with those, a 64x64 tiles map is a 'real' 64x64 map, not a group of 4 32x32. :)