#46553 - rize - Mon Jun 27, 2005 8:51 am
so oam has room for 128 entries per screen
does it matter how big the sprites are?
can the ds do 128 64x64 sprites at 60 fps? somehow I doubt it. So what's the limit? Is it based on the total number of 8x8 "tiles" making up each sprite?
#46559 - tepples - Mon Jun 27, 2005 12:58 pm
OAM has room for 128 sprites per scene, no matter how large the sprites are. But if you rewrite some of OAM after each scanline, you can break this limit.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#46593 - rize - Mon Jun 27, 2005 8:21 pm
well that's interesting. so does sprite size matter?
#46595 - DekuTree64 - Mon Jun 27, 2005 9:36 pm
rize wrote: |
well that's interesting. so does sprite size matter? |
tepples wrote: |
no matter how large the sprites are. |
...so no, that doesn't affect the 128 OAM limit.
There IS a limit to the number of sprite pixels drawn on each scanline though, which sort of limits the size. GBATEK has details, but basically you can draw 1210 normal sprite pixels per line, so almost 19 64x64 sprites all on the same horizontal line.
Rot/scale takes more cycles per pixel, so less sprites on the same line with them, and double-size rot/scale is even more than that (plus having twice as many pixels to draw).
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#46596 - tepples - Mon Jun 27, 2005 9:48 pm
Everything DekuTree64 said was correct for the GBA. But I'll add that the limit of 1210 normal sprite pixels per line is reduced to 954 if you give the CPU access to OAM during hblank (such as if you're swapping OAM to break the 128-sprite barrier). Also, each rot/scale pixel counts as 3.25 non-rot/scale pixels.
I'd imagine that each of the Nintendo DS's 2D cores has similar constraints, but the exact numbers might be different in DS mode.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#46620 - KoaM - Tue Jun 28, 2005 5:41 am
Just wondering, is it possible to mix and match the OAMs from both screens. For example, let's say i want to use 228 sprites on the bottom screen and 28 for the top, is that possible?
#46633 - tepples - Tue Jun 28, 2005 1:28 pm
Each screen has its own bank of 128, so no. If you really want 200 little bullets in your 2D shooter or units in your RTS, then use an HDMA to OAM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.