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 > SetCode

#5652 - Daedro - Mon May 05, 2003 2:41 am

I have been using a tutorial. I combined tutorial number 2 and 5, map and sprite. I was woundering how to get them both to show up at the same time.

I have:

SetMode(MODE_0 | BG0_ENABLE | OBJ_ENABLE | OBJ_MAP_1D)

and I get the sprite, and my background map is all like zoomed you could say or just one part of it. The map is 240x160, and this one looks to be zoomed 10x. I tried all BG_ENABLE's and nothing. The only on i seem to get to show my map at the correct size is the:

SetMode(MODE_4 | BG2_ENABLE | OBJ_ENABLE | OBJ_MAP_1D)

do I have to change the coding to show them both ( i mean the whole file ) or just the modes in this line?

P.S. What is starringmonkey? and can anyone recommend some tutorials, I have done some but dont know the names.. I am using devkitadv.

Eric Muyser

#5654 - darkcloud - Mon May 05, 2003 3:18 am

Mode 0 is a tile mode, and you cannot have a tile map of size 240x160. It is not supported by hardware.

However, a 240x160 image can be used as a background in Mode 4, which is why it works in Mode 4 and not Mode 0.

Also, because Mode 4 is a bitmap mode, you lose half of you space for sprites and thus can only use the upper half of sprite memory (character name 512-1024).

You should probably check out The Pern Project since these tutorials will explain all you need to know about the display modes and stuff.

Starringmonkey developed a library of header files to make it easier to use some of the GBA's features like mosaic, blending, sprites, backgrounds, etc.
_________________
Maybe in order to understand mankind, we have to look at the word itself: "Mankind". Basically, it's made up of two separate words - "mank" and "ind". What do these words mean ? It's a mystery, and that's why so is mankind.

#5722 - Daedro - Wed May 07, 2003 12:00 am

Okay.. I will get to those tutorials. But what mode is best if half my sprites are unusable when using mode 4 for 240x160 images. Isnt it the only one that displays them at that size? What combination should I use for sprite and background? Should I use that BG_Properties(3) thing? what exactly is that code for the layer in which sprite and backgrounds are in order...?