Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: SDL Examples for NDS porting

  1. #21

    SDL Examples for NDS porting

    If you could PM me the code that would be great.

    I'll get r19 down instead and try that.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  2. #22

    SDL Examples for NDS porting

    Uhm... same error in pm. Maybe the forum engine parses the makefile text and comes out something wrong. When I try to make a message preview or try to send it, I get a 404 error
    I'll send that makefile via email (PM me your address)
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #23
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    SDL Examples for NDS porting

    Hmm... couldn't you alternately use PasteBin? www.pastebin.com
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #24

    SDL Examples for NDS porting

    Quote Originally Posted by Legolas

    Here is a quick list of changes I made in order to compile it:

    :arrow: NDS needs "uses types;" only
    :arrow: libSDL.a depends from libnds9.a and some other gcc libs:
    [pascal]{$IFDEF NDS}
    SDLLibName = 'libSDL.a';
    {$]
    :arrow: I have commented out all SDL_mutex and thread parts
    :arrow: All external funcs are declared as:
    [pascal]
    function SDL_Init( flags : UInt32 ) : Integer;
    cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Init'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF NDS};
    [/pascal]

    That's all
    As I said, it compiles fine but I dont' know if it works too
    I'm making changed to the sdl.pas for JEDI-SDL to see if I can make is conpile out of the box for the ds.

    I have made all of the changes you specified with the exception of defining PSDL_mutex as it is defined in the source code.

    But I get

    Code:
      sdl.pas &#40;4207,4&#41; Error &#58; Creation of Dynamic/Shared Libraries not supported
    Any ideas?
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  5. #25

    SDL Examples for NDS porting

    I got a similar error. I can't remember how I have solved it, but if it can help you, here is a pastebin ([size=9px]thanks WILL [/size]) of my sdl.pas
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  6. #26

    SDL Examples for NDS porting

    I got everything compiling OK. And a basic sample working .

    I'm now looking into OpenGL support, unfortunately the port of SDL to the DS does not support Opengl so I'm having to add it. Currently I just adding code like this

    Code:
    // Set the video mode to 3D
    	if &#40;flags & SDL_OPENGL&#41; &#123;
    	   videoSetMode&#40;MODE_0_3D| DISPLAY_BG2_ACTIVE&#41;;
    	   //set the sub background up for text display &#40;we could just print to one
    	   //of the main display text backgrounds just as easily
    	   videoSetModeSub&#40;MODE_0_2D | DISPLAY_BG0_ACTIVE&#41;; //sub bg 0 will be used to print text
    	&#125;
    but apart from the MODE_0_3D I'm not sure what everything else actially does....

    But things are looking good so far.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  7. #27

    SDL Examples for NDS porting

    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 :?:
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  8. #28

    SDL Examples for NDS porting

    This is extremely cool :thumbup:
    ZGameEditor - Develop 64kb games for Windows.
    Thrust for Vectrex - ROM-file and 6809 source code.

  9. #29

    SDL Examples for NDS porting

    Cool! I'm very pleased to see that it works :thumbup:
    Nice work, Dean! :clap:
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  10. #30

    SDL Examples for NDS porting

    Quote Originally Posted by technomage
    Dom, shall I send you the changes to make the DS work with JEDI-SDL :?:
    This is super cool. Would I say no to such an opportunity. Btw, The latest version of sdl.pas is in CVS. Are you not able to merge the changes in? If not send it over and tell me what needs changing. I don't have a diff tool so will need some hand holding to get it right.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •