Results 1 to 10 of 10

Thread: SDL 1.2.9 for devkitpro r19

                  
   
  1. #1
    DCEmu Coder GPF's Avatar
    Join Date
    Apr 2004
    Location
    Texas
    Age
    46
    Posts
    796
    Rep Power
    57

    Default SDL 1.2.9 for devkitpro r19

    ok updated my sourcecode on site
    http://gpf.dcemu.co.uk/ndsSDL.shtml

    added doublebuffering support and fixed some errors that prevent it working with r19 using the new arm-eabi-gcc.


    unfortunetly now doublebuffering is on all the time and it uses 1mb of system memory.

    in video/nds/SDL_ndsvideo.c NDS_SetVideoMode function this enabled the doublebuffering
    Code:
    this->hidden->secondbufferallocd=1;
    backBuffer=(u16*)malloc(1024*512*2);
    current->pixels = backBuffer;
    change to
    Code:
    this->hidden->secondbufferallocd=0;
    //backBuffer=(u16*)malloc(1024*512*2);
    current->pixels = frontBuffer;
    to disable doublebuffering and recompile the lib.

    if someone has a fix to this let me know. I thought that the NDS_AllocHWSurface(...) would be called and i used to have the malloc defined in there but for a couple of SDL ports they were never calling that function so i moved it into the NDS_SetVideoMode function.

    Also a lot of work need to be done to allocated VRAM better, right now 8bit video uses a mode6 1024X512 background
    and 16bit video uses mode5 515X512 background. So if you using a smaller screen it shouldnt need to allocate so much VRAM and the doublebuffering memory could be moved into VRAM instead of main ram.

    Thanks,
    Troy(GPF)

  2. #2

    Default

    Great news!! are you planning to release a precompiled zip? Im having some troubles when compiling on r19 devkit.

    thanks a lot.

  3. #3
    DCEmu Coder GPF's Avatar
    Join Date
    Apr 2004
    Location
    Texas
    Age
    46
    Posts
    796
    Rep Power
    57

    Default

    yeah eventually, ill do that.

    Finally got some sound to work with SDL lib today, its occasionally sound like music even lol. Its going to need to move to use a custom arm7 binary for streaming the sound cause right now without a way from the arm9 side to know if the currently playing buffer is done or its current playing position which has to be done from the arm7 with timers and/or fifos/ipc.

    Troy(GPF)

  4. #4

    Default

    Amazing!! great work!

  5. #5
    DCEmu Newbie
    Join Date
    Sep 2006
    Posts
    2
    Rep Power
    0

    Default Guidance on Building?

    Hi,

    I have great interest in using SDL on the DS. However, I cannot seem to figure out how to build the project (and I don't see any binaries).

    There is a configure script, but that fails for multiple reasons. First, there is no README file, which it requires. Then, it cannot find gcc (since I am using devkitpro, which uses arm-eabi-gcc.exe). To solve this, I set the CC env variable to the devkitARM eabi compiler, but the script fails with "C compiler cannot create executables".

    What am I missing?

    I am using the latest devkitPRO (r19) with cygwin on windows.

  6. #6
    DCEmu Coder Sektor's Avatar
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    212
    Rep Power
    47

    Default

    You don't need to use configure, I don't think it's setup for DS. You should be able to just run make or make -f makefile.ds.

  7. #7
    DCEmu Newbie
    Join Date
    Sep 2006
    Posts
    2
    Rep Power
    0

    Default

    Ok, I used the Makefile.ds, but it complained about missing kosstdio.h, so I downloaded the kos library, modified the makefile to see it, and tried again.

    There are a lot of warnings, the most serious looked like:

    Code:
    src/video/nds/SDL_ndsvideo.c: In function 'NDS_CreateDevice':
    src/video/nds/SDL_ndsvideo.c:138: warning: implicit declaration of function 'memset'
    src/video/nds/SDL_ndsvideo.c:138: warning: incompatible implicit declaration of
    built-in function 'memset'
    Looking in /c/devkitPro/devkitARM/arm-eabi/include, it seems as though memset is in string.h, not stdlib.h. I added an include for string.h.

    The the build failed with:

    Code:
    src/video/nds/SDL_ndsvideo.c: In function 'NDS_FlipHWSurface':
    src/video/nds/SDL_ndsvideo.c:414: error: 'DISP_Y' undeclared (first use in this
    function)
    Grepping devkitpro finds DISP_Y defined in "nds/registers_alt.h". Modify SDL_ndsvideo.c to include it, and the build finally works, but with lots of warnings. Most warnings are about changing the width or signedness of method parameters.

    Unfortunately, I have to go to work so I don't have time to try the lib to see if it is works.

    It is interesting that I had to modify the makefile to include kosstdio.h, but I did not have to actaully link in the library. Perhaps a missing IFDEF?

  8. #8
    DCEmu Coder GPF's Avatar
    Join Date
    Apr 2004
    Location
    Texas
    Age
    46
    Posts
    796
    Rep Power
    57

    Default

    Quote Originally Posted by tk1
    Ok, I used the Makefile.ds, but it complained about missing kosstdio.h, so I downloaded the kos library, modified the makefile to see it, and tried again.

    There are a lot of warnings, the most serious looked like:

    Code:
    src/video/nds/SDL_ndsvideo.c: In function 'NDS_CreateDevice':
    src/video/nds/SDL_ndsvideo.c:138: warning: implicit declaration of function 'memset'
    src/video/nds/SDL_ndsvideo.c:138: warning: incompatible implicit declaration of
    built-in function 'memset'
    Looking in /c/devkitPro/devkitARM/arm-eabi/include, it seems as though memset is in string.h, not stdlib.h. I added an include for string.h.

    The the build failed with:

    Code:
    src/video/nds/SDL_ndsvideo.c: In function 'NDS_FlipHWSurface':
    src/video/nds/SDL_ndsvideo.c:414: error: 'DISP_Y' undeclared (first use in this
    function)
    Grepping devkitpro finds DISP_Y defined in "nds/registers_alt.h". Modify SDL_ndsvideo.c to include it, and the build finally works, but with lots of warnings. Most warnings are about changing the width or signedness of method parameters.

    Unfortunately, I have to go to work so I don't have time to try the lib to see if it is works.

    It is interesting that I had to modify the makefile to include kosstdio.h, but I did not have to actaully link in the library. Perhaps a missing IFDEF?
    the file loading code is in C:\dev\devkitPro\msys\home\GPF\prj\SDL-1.2.9\src\file\SDL_rwops.c
    and its hardcoded to use my romfs port lib or fatlib based on a #define FAT being existing or not

    the memset message is just a warning so i never bothered with it.

    and the DISP_Y changed in devkitpro/libnds 19b so either include the altregister heacer or change the name.

    Im currently working with streaming sound with a custom arm7 code, but still needs a lot of work.

    Troy(GPF)

  9. #9
    DCEmu Newbie
    Join Date
    Jan 2007
    Posts
    11
    Rep Power
    0

    Default

    Appologies on reviving this topic, But I cannot get this SDL port to compile. I'm using DevkitARM r20 and on compiling (under the XP command prompt) I get:

    make: arm-elf-gcc: Command not found
    make: *** [src/audio/nds/SDL_ndsaudio.o] Error 127


    Does it work with r20? I also tried DevkitARM r19a and got the same error.

    Any help is much appreciated

  10. #10
    DCEmu Coder GPF's Avatar
    Join Date
    Apr 2004
    Location
    Texas
    Age
    46
    Posts
    796
    Rep Power
    57

    Default

    need devkitarm/bin added to your path, also you need to run make -f Makefile.ds which uses arm-eabi-gcc . Probably need to make some code changes to get it to work with r20.

    I have a newer version that works with r20 but requires a custom arm7 code to be used for sound streaming, that I am still working on.

    Troy(GPF)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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
  •