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.

Graphics > Making a sprite 16x32

#89635 - nick5454 - Sun Jun 25, 2006 10:26 pm

I have a sprite thats 16x32. But I can get the image to comeout correctly.

If I use a 32x32 it comes out correctly. But I would like to make it 16x32 instead.

Can someone give me a pointer or a link for some help for setting up sprites.

Code is included for an example. This is from j. harbours book. The first sprite example.

Thanks,
Nick

#define COLOR_16 0x0000
#define COLOR_256 0x2000

#define SIZE_8 0x0
#define SIZE_16 0x4000
#define SIZE_32 0x8000
#define SIZE_64 0xC000

typedef struct tagSprite
{
unsigned short attribute0;
unsigned short attribute1;
unsigned short attribute2;
unsigned short attribute3;
} Sprite, *pSprite;

sprites[0].attribute0 = COLOR_256 | y;
sprites[0].attribute1 = SIZE_16 | x;
sprites[0].attribute2 = char_number;

#89644 - tepples - Sun Jun 25, 2006 11:46 pm

You need to set the "tall" bit in attribute 0 and use SIZE_32 in attribute 1.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#89751 - nick5454 - Mon Jun 26, 2006 4:16 pm

do you have a link that shows all the possible bits for the attribute fields?

#89787 - Dwedit - Mon Jun 26, 2006 6:32 pm

http://nocash.emubase.de/gbatek.htm

Gbatek is THE site for any information about programming the GBA hardware.

For the question you asked, here's the link with anchor:

http://nocash.emubase.de/gbatek.htm#lcdobjoamattributes

You want OBJ Attribute 1.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#89814 - Ant6n - Mon Jun 26, 2006 7:56 pm

or if you want more explanation, use tonc's tutorial
under point 4.1 is a table
http://user.chem.tue.nl/jakvijn/tonc/regobj.htm

#89822 - nick5454 - Mon Jun 26, 2006 8:25 pm

Dwedit - those links dont work. COuld you please post workable links. I am very interested.

Thanks,
Nick

#89848 - kusma - Mon Jun 26, 2006 11:43 pm

the links works fine...

#89933 - nick5454 - Tue Jun 27, 2006 2:57 pm

Yeah. maybe thier site was rebooting or something