Sprite Support on NDS [was Re: [SVN] r3971 - in branches/gsoc2008_nds: src/video/nds test/nds-test-progs/sprite/source]

Hello !

Has the Nintendo DS special
sprite functions like the C64 had ?

If yes, are there any limitations to the
sprites size, nr. of colors ?

If yes, how will i be able to use
these sprite functions in SDL ?

CU

Yes, the DS has special sprite functionality built-in to its graphics
engines. There’s room for 128 of them in the OAM, and they can be up to
64x64 pixels in size. Like other graphics on the DS, they can either be
"tiled" or “bitmap” and can have either 16 color palette, 256 color
palette (8-bit indexed mode), or 16-bit color (ABGR1555 mode). The
hardware allows them to be positioned easily on the screen, scaled, and
rotated by simply setting a few values in memory.

When I finish implementing it in the SDL NDS render driver, textures
that are 64x64 or smaller in ABGR1555 or INDEX8 pixel formats will be
automatically copied into sprites. So to use the sprite functions, all
you should end up having to do, is make a texture that fits in a sprite
and draw it to the screen =)

Hope that answers your questions.

-DarrenOn Fri, 2008-08-15 at 17:20 +0200, Torsten Giebl wrote:

Hello !
Has the Nintendo DS special
sprite functions like the C64 had ?
If yes, are there any limitations to the
sprites size, nr. of colors ?
If yes, how will i be able to use
these sprite functions in SDL ?

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello !

Yes, the DS has special sprite functionality built-in to its graphics
engines. There’s room for 128 of them in the OAM, and they can be up to
64x64 pixels in size. Like other graphics on the DS, they can either be
"tiled" or “bitmap” and can have either 16 color palette, 256 color
palette (8-bit indexed mode), or 16-bit color (ABGR1555 mode). The
hardware allows them to be positioned easily on the screen, scaled, and
rotated by simply setting a few values in memory.

When I finish implementing it in the SDL NDS render driver, textures
that are 64x64 or smaller in ABGR1555 or INDEX8 pixel formats will be
automatically copied into sprites. So to use the sprite functions, all
you should end up having to do, is make a texture that fits in a sprite
and draw it to the screen =)

Great. Will you also provide a special header file that
allows other people to use these rotate and scale functions
of sprites ?

CU

Maybe once I get the renderer working using sprites, I’ll see if it’s
possible to patch the rotation and zooming in SDL_gfx (or similar) to
use them… Unless anyone has any better ideas.

-DarrenOn Sat, 2008-08-16 at 08:42 +0200, Torsten Giebl wrote:

Hello !
Great. Will you also provide a special header file that
allows other people to use these rotate and scale functions
of sprites ?