Some progresss on the plain SDL front.



This is running on the dualis emulator.

the Red box is using the standard SDL_FillRect, the Blue box is done using the JEDI-SDL SDL_PutPixel routine. Only the changes suggested by Legolas were made to the sdl.pas file. The sdlutils.pas was untouched and worked as is.

here is the code

[pascal]
program sdltest;

{$IFDEF NDS}
{$apptype arm9} //...or arm7
{$define ARM9} //...or arm7, according to apptype

{$mode objfpc} // required for some libc funcs implementation

uses
ctypes, sdl, SysUtils, sdlutils; // required by nds headers!

{$include nds.inc} // headers!
{$ELSE}
{$APPTYPE CONSOLE}
uses
sdl,
gl,
SysUtils, sdlutils;
{$ENDIF}

var Screen: PSDL_Surface;
r: TSDL_Rect;
x,y: Integer;

begin
SDL_Init(SDL_INIT_VIDEO);
try
Screen := SDL_SetVideoMode(320,200,16,SDL_HWSURFACE or SDL_DOUBLEBUF);
if Screen = nil then Exit;
try
r := SDLRect(10,10,20,20);
while True do
begin
SDL_FillRect(Screen, nil, SDL_MapRGB(Screen^.format, 255,0,0));
SDL_FillRect(Screen, @r, SDL_MapRGB(Screen^.format, 0,255,0));
for y := 40 to 80 do
begin
for x := 40 to 80 do
begin
SDL_PutPixel(Screen, x,y, SDL_MapRGB(Screen^.format, 0,0,255));
end;
end;
SDL_Flip(Screen);
end;
finally
SDL_FreeSurface(Screen);
end;
finally
SDL_Quit;
end;
end.
[/pascal]

Dom, shall I send you the changes to make the DS work with JEDI-SDL :?: