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 > Question About Sprite Sizes

#44901 - AkumaATR - Mon Jun 06, 2005 6:01 pm

Does anyone know why the maximum sprite size is 64x64? I guess I'm just wondering why 128x128 isn't supported. Does it have something to do with the double size flag (because if double size is set, that would require space to store 256x256 normal sprite, which is larger than standard backgrounds even)...

Just wondered, thanks.

Jason

#44904 - DekuTree64 - Mon Jun 06, 2005 6:19 pm

Well one good reason I can think of is that a 128 pixel tall sprite would wrap around the screen. Since the Y coordinate is only 8 bits, and the screen is 160 pixels tall, there's not enough space 'outside' the screen for it to fit, so you'd have to turn it on and off in HBlank to make it work right.

Now that I think about it, a double-size 64x64 would do that...

Oh, and the double size flag doesn't take any more memory, it just gives you a box twice as big to display it in, so you can rotate without chopping off the corners. Also takes more GPU cycles per pixel than a normal sprite though, so you have to be careful or you'll get dropout pretty quick.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#44914 - poslundc - Mon Jun 06, 2005 6:54 pm

No one can answer your question with any definite certainty, but there are plenty of possible reasons.

One of the most compelling ones is that it's probably the way it was done on the SNES, which is what the GPU on the GBA most closely resembles.

Dan.

#44919 - AkumaATR - Mon Jun 06, 2005 7:36 pm

that's ok. thanks for the info guys.

Jason

#44928 - tepples - Mon Jun 06, 2005 9:29 pm

If you have a sprite that big, then each cel is bound to have a lot of blank tiles that waste RAM. In that case, try using a background layer; you can reuse the blank tile.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.