An Nintendo ds update

Hello,

For those interested, here’s a snapshot of the current port. I did away with
most of the previous attempt which was based of the sprite engine, because the
support is limited to 128 64x64 sprites. Instead I’m using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there’s not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the color
is not displayed. So I had to patch a few core file to set that bit to 1. See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or is
there a better way ?

The nds also doesn’t support windowed mode, so I force the fullscreen in
src/video/SDL_video.c. Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT; however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?

Diffstat for the patch:
Makefile.ds | 338 ++++++++++++++±--------
README.ds | 34 ±
a/src/video/nds/SDL_ndsrender.c | 522 --------------------------------------
a/src/video/nds/SDL_ndsrender_c.h | 28 –
b/src/render/nds/SDL_ndsrender.c | 364 ++++++++++++++++++++++++++
include/SDL_config_nintendods.h | 6
src/render/SDL_render.c | 3
src/render/SDL_sysrender.h | 3
src/video/SDL_RLEaccel.c | 5
src/video/SDL_blit.h | 14 -
src/video/SDL_video.c | 4
src/video/nds/SDL_ndsvideo.c | 421 +++++++++++++++++±-----------
src/video/nds/SDL_ndsvideo.h | 27 +
13 files changed, 927 insertions(+), 842 deletions(-)

Regards,
Frank.

-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl13-nds6.diff.gz
Type: application/x-gzip
Size: 14898 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110305/89d60923/attachment.bin

This patch is in, and I made a few changes afterwards, including removing
the NDS ARGB1555 hacks in the blitting code. The problem was general, not
limited to Nintendo DS, and I think I fixed everything except RLE alpha and
improved the color quality to boot!

Thanks,On Sat, Mar 5, 2011 at 12:32 PM, Frank Zago wrote:

Hello,

For those interested, here’s a snapshot of the current port. I did away
with
most of the previous attempt which was based of the sprite engine, because
the
support is limited to 128 64x64 sprites. Instead I’m using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there’s not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the
color
is not displayed. So I had to patch a few core file to set that bit to 1.
See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or
is
there a better way ?

The nds also doesn’t support windowed mode, so I force the fullscreen in
src/video/SDL_video.c. Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT;
however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY
is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?

Diffstat for the patch:
Makefile.ds | 338 ++++++++++++++±--------
README.ds | 34 ±
a/src/video/nds/SDL_ndsrender.c | 522

a/src/video/nds/SDL_ndsrender_c.h | 28 –
b/src/render/nds/SDL_ndsrender.c | 364 ++++++++++++++++++++++++++
include/SDL_config_nintendods.h | 6
src/render/SDL_render.c | 3
src/render/SDL_sysrender.h | 3
src/video/SDL_RLEaccel.c | 5
src/video/SDL_blit.h | 14 -
src/video/SDL_video.c | 4
src/video/nds/SDL_ndsvideo.c | 421 +++++++++++++++++±-----------
src/video/nds/SDL_ndsvideo.h | 27 +
13 files changed, 927 insertions(+), 842 deletions(-)

Regards,
Frank.


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

SDL_NO_COMPAT is just for the application. We could add a separate define
to disable the software renderer, if you like.On Sat, Mar 5, 2011 at 12:32 PM, Frank Zago wrote:

Hello,

For those interested, here’s a snapshot of the current port. I did away
with
most of the previous attempt which was based of the sprite engine, because
the
support is limited to 128 64x64 sprites. Instead I’m using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there’s not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the
color
is not displayed. So I had to patch a few core file to set that bit to 1.
See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or
is
there a better way ?

The nds also doesn’t support windowed mode, so I force the fullscreen in
src/video/SDL_video.c. Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT;
however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY
is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?

Diffstat for the patch:
Makefile.ds | 338 ++++++++++++++±--------
README.ds | 34 ±
a/src/video/nds/SDL_ndsrender.c | 522

a/src/video/nds/SDL_ndsrender_c.h | 28 –
b/src/render/nds/SDL_ndsrender.c | 364 ++++++++++++++++++++++++++
include/SDL_config_nintendods.h | 6
src/render/SDL_render.c | 3
src/render/SDL_sysrender.h | 3
src/video/SDL_RLEaccel.c | 5
src/video/SDL_blit.h | 14 -
src/video/SDL_video.c | 4
src/video/nds/SDL_ndsvideo.c | 421 +++++++++++++++++±-----------
src/video/nds/SDL_ndsvideo.h | 27 +
13 files changed, 927 insertions(+), 842 deletions(-)

Regards,
Frank.


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Oh, ARGB1555 isn’t on the blitting fast path. We could add some functions
specifically to optimize that case, if you think it’s worth it, see
SDL_blit_N.c for details.On Sat, Mar 5, 2011 at 12:32 PM, Frank Zago wrote:

Hello,

For those interested, here’s a snapshot of the current port. I did away
with
most of the previous attempt which was based of the sprite engine, because
the
support is limited to 128 64x64 sprites. Instead I’m using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there’s not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the
color
is not displayed. So I had to patch a few core file to set that bit to 1.
See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or
is
there a better way ?

The nds also doesn’t support windowed mode, so I force the fullscreen in
src/video/SDL_video.c. Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT;
however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY
is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?

Diffstat for the patch:
Makefile.ds | 338 ++++++++++++++±--------
README.ds | 34 ±
a/src/video/nds/SDL_ndsrender.c | 522

a/src/video/nds/SDL_ndsrender_c.h | 28 –
b/src/render/nds/SDL_ndsrender.c | 364 ++++++++++++++++++++++++++
include/SDL_config_nintendods.h | 6
src/render/SDL_render.c | 3
src/render/SDL_sysrender.h | 3
src/video/SDL_RLEaccel.c | 5
src/video/SDL_blit.h | 14 -
src/video/SDL_video.c | 4
src/video/nds/SDL_ndsvideo.c | 421 +++++++++++++++++±-----------
src/video/nds/SDL_ndsvideo.h | 27 +
13 files changed, 927 insertions(+), 842 deletions(-)

Regards,
Frank.


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Getting error in rev. 5439:

In file included from src/video/SDL_pixels_c.h:26,
from src/SDL_compat.c:30:
src/video/SDL_blit.h:213: error: expected ?=?, ?,?, ?;?, ?asm? or ?attribute? before ?->? token
src/video/SDL_blit.h:214: error: expected identifier or ?(? before ?}? token
make: *** [build/SDL_compat.lo] Error 1

No Error in rev. 5438.

Greetings.

Same here. There’s a missing backslash at the end of line 212.

Frank.On 03/07/2011 04:57 AM, Kakarott wrote:

Getting error in rev. 5439:

In file included from src/video/SDL_pixels_c.h:26,
from src/SDL_compat.c:30:
src/video/SDL_blit.h:213: error: expected ?=?, ?,?, ?;?, ?asm? or
?attribute? before ?->? token
src/video/SDL_blit.h:214: error: expected identifier or ?(? before ?}? token
make: *** [build/SDL_compat.lo] Error 1

Haha, klar, aber du glaubst doch wohl nicht zum alten Preis B))> -----Urspr?ngliche Nachricht-----

Von: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
Im Auftrag von Frank Zago
Gesendet: Montag, 7. M?rz 2011 15:59
An: sdl at lists.libsdl.org
Cc: Kakarott
Betreff: Re: [SDL] an Nintendo ds update

On 03/07/2011 04:57 AM, Kakarott wrote:

Getting error in rev. 5439:

In file included from src/video/SDL_pixels_c.h:26,
from src/SDL_compat.c:30:
src/video/SDL_blit.h:213: error: expected ?=?, ?,?, ?;?, ?asm? or
?attribute? before ?->? token
src/video/SDL_blit.h:214: error: expected identifier or ?(? before
?}? token
make: *** [build/SDL_compat.lo] Error 1

Same here. There’s a missing backslash at the end of line 212.

Frank.


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

Yup fixed, thanks!On Mon, Mar 7, 2011 at 6:59 AM, Frank Zago wrote:

On 03/07/2011 04:57 AM, Kakarott wrote:

Getting error in rev. 5439:

In file included from src/video/SDL_pixels_c.h:26,
from src/SDL_compat.c:30:
src/video/SDL_blit.h:213: error: expected ?=?, ?,?, ?;?, ?asm? or
?attribute? before ?->? token
src/video/SDL_blit.h:214: error: expected identifier or ?(? before ?}?
token
make: *** [build/SDL_compat.lo] Error 1

Same here. There’s a missing backslash at the end of line 212.

Frank.


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks