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 > Getting the map right :-)

#42954 - WaltherSan - Tue May 17, 2005 12:48 pm

Hi.
I have a problem with making a 512*256 map look correct.

I am using

DMAFastCopy((void*)Map, (void*)bg0map, 512, DMA_32NOW);

but I dont really know what the '512' is actually about - only that it is the reason to why my map looks kind of messed up since I can change the way the map looks by changing this value.(just cant make it look the way its supposed to do)
So, what excactly does it specify and how do I know which value to give it depending on the size of the map?

Thanks.
- AW

#42957 - tepples - Tue May 17, 2005 1:40 pm

Have you tried copying the left half (x=0 to 31) to one map and the right half (x=32 to 63) to the next map?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#42960 - WaltherSan - Tue May 17, 2005 1:59 pm

I didnt know that you could be working with several maps at the same time?
In the tutorials that I have looked at you are only creating one map, which you can then modify.
Do you have a link to someone explaining how to work with 2 or more?
- AW

#42994 - strager - Tue May 17, 2005 10:09 pm

The BG map data must be divided into sections, and in text modes, these sections are 256x256 pixels. For example, say you have the map at 512x256 (each number represents 4 tiles, or 32x32 pixels):

Code:

1111111122222222
1111111122222222
1111111122222222
1111111122222222
1111111122222222
1111111122222222
1111111122222222
1111111122222222


1 is the first secion, and 2 the second. Here's how it would appear in memory:

Code:

06000000 :   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
06000010 :   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
06000020 :   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
06000030 :   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
06000040 :   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
06000040 :   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
06000040 :   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
06000040 :   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


Do you get it?? It was complicated when I read the guides myself, but once you understand, it's as easy as coding a working trig. function. :-)

' luck!