[Release] SDL-3DS 1.2.15 - Simple DirectMedia Layer for 3DS

Discussion in '3DS - Homebrew Development and Emulators' started by nop90, Jan 30, 2017.

  1. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    As @realWinterMute said check first if you ran "make instal"

    Than, with no pkg-config available for now, to reach the include file of the lib, that is in a SDL subfolder, you have two options:

    1. (The clean way)

    add the SDL folder in the includes of the SDL header, i.e use:
    Code:
    #include "SDL/SDL.h"
    
    instead of
    Code:
    #include "SDL.h"
    
    The same for SDL_mixer SDL_ttf, etc,

    2. (the tricky way, the one I use)

    Modify the makefile to look in for header files in the SDL subfolder. here is how I do for my homebrew

    Code:
    export INCLUDE   :=   $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
               $(foreach dir,$(LIBDIRS),-I$(dir)/include),$(foreach dir,$(LIBDIRS),-I$(dir)/include/SDL) \
               -I$(CURDIR)/$(BUILD)
    
    Regarding the problem with sf2dlib on Luma, I'm not using Boot9strap yet, but haven't received report of hb of mine not working on it. Please check one of the game using sf2dlib (Retrobattle for example). If it works maybe you only need to fix something. And remember to update Citro3d to the "next" branch on github, not the Master branch.

    Last thing, in sf2dlib the first two letters mean "simple fast", The firsts 's' in SDL means "fast" too, but notice that there is no 'f' following :D.

    Using SDL you'll reach no more than 30FPS.
     
    Last edited by nop90, Jul 7, 2017
  2. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    I'm cleaning my project pipeline. Today I release another SDL game ported to 3ds: KETM
     
    cearp likes this.
  3. kprovost7314

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,723
    939
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    If only sf2dlib was still being worked on
     
  4. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Using citro3d directly isn't difficult and is higly performing. I used it for Powder.
     
    Joel16 likes this.
  5. kprovost7314

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,723
    939
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    I always wondered how to do that, but I can't now since my laptop's charger broke
     
  6. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    After hours of debug, fixed a random NDSP sound problem happening with the Cias build of the games. The video thread was randomly conflicting (about 10% of times on my n3ds) with the ctrulib code that handles the NDSP init.

    It wasn't a big issue because to make sound start there was the workaround of closing and reopening the 3ds lid. But it was annoying.

    I'll update the build of all my SDL games in the next days.

    Now there is only one bug to fix: calling SDL_SetVideoMode a second time crashes the app.
     
    cearp and kprovost7314 like this.
  7. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Fixed the SDL_SetVideoMode bug too. :)

    Now I can finish this:

    smw1.png smw2.png
     
    Joel16, Cid2mizard and cearp like this.
  8. kane159

    kane159 GBAtemp Regular

    Member
    153
    29
    May 28, 2013
    Taiwan
    Any good news for onscripter bro :)


    從我的iPhone使用Tapatalk Pro 發送
     
  9. PlayerGDS

    PlayerGDS Newbie

    Newcomer
    4
    0
    Jul 27, 2017
    Brazil
    wow, good, great work champz
     
  10. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Started working on it, but I have other things to finish first.
     
  11. realWinterMute

    realWinterMute Member

    Newcomer
    49
    47
    Feb 24, 2011
    Offer to help get this autotoolised and upstreamed still stands
     
  12. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Thanks, I'm going to upload on github the private version of the lib in the next days, so you can check what I did.

    Now that every bug is fixed it's time to finalize the port.

    Now I have only little time because I'm in the middle of a home moving, but from monday start my holidays and I'll have time for coding.
     
    cearp likes this.
  13. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    @realWinterMute

    now that finally I have some free time I fixed the configure script and updated the changes to github.

    But I had to us a dirty workaround bacause I wasn't able to modify the build scripts to call Picasso to compile the shader file (in the video/n3ds folder), so I added the pre compiled file in the same folder and modified the configure.in and makefile.in adding a PREBUILDOBJECTS variable to add it to the objects file list for the 3ds.

    If you have some time you could help me to fix this.

    Another thing to fix is to compile the other SDL lib using the configure script. Tryed with SDL_ttf and the SDL lib is recognized, but when linking the SDL_ttf lib there are problems with some ctrulib. . I'm still trying to figure out the problem, but probably there are some flags missing. Please let me know if you have some hints to solve this.

    Meanwhile I'm fixing SDL_Mixer to work with ogg and mp3 files. Finished to fix Ogg music playback (there where an array of 4k char declared inside a function causing a stack overflow. Now I declared it static amd solved the problem, but the fix isn't on github yet).

    Rgarding Ogg Vorbis decoding, noticed that the devkitpro 3ds portlibs on github (https://github.com/devkitPro/3ds_portlibs) use the standard version of the Tremor lib, that doesn't work for the 3ds (same stack problem I think). It should be used the low mem version that works fine.
     
  14. realWinterMute

    realWinterMute Member

    Newcomer
    49
    47
    Feb 24, 2011
    @nop90

    You have a PR :P

    I had a quick try with SDL_ttf after compiling & installing with my changes but it doesn't like --host=arm-none-eabi as is. Too late here now to fiddle much more tonight though.

    It's possible to adjust the stack size with libctru by declaring __stacksize__ in your code

    Code:
    const unsigned int __stacksize__ = 64 * 1024;
    will set a 64K stack (default is 32K)
     
  15. MiqellDestroyer

    MiqellDestroyer Advanced Member

    Newcomer
    51
    8
    Apr 22, 2017
    Seguidores de la grasa? xd
     
  16. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Thank you very much @realWinterMute . Looking at the script to build the pica shader I wasn't too far from the solution, but I'm not experienced in writing shell scripts and was making a lot of small mistakes.

    Just submitted a small change in che configure.in script: had to move the compiling position of the pica file before the n3ds video driver c file-

    About SDL_ttf, with your changes it complies without problems running it's configure script.

    Now I'm going to write a makefile like the one for the portlibs to build the SDL lib and download and build the other libs. probably I'll add a makefile with a subset of the potlibs needed by the SDL libs.
     
  17. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    Committed a makefile to build the SDL lib with autotools and download and build the other SDL libs (SDL_ttf, SDL_mixer, SDL_image, SDL_net, SDL_audio, SDL_gfx).

    The configure.in for SDL_image and SDL_gfx need to be fixed.

    The script can't recognize my cross compile configuration (my pc is windows 7 64bit), so for these libs I used a preformatted makefile. Don't know if it works on a linux os.

    Next week I'll add an options to build the dependancies too from the same makefile, but now I want to work on SDL2.
     
    cearp likes this.
  18. realWinterMute

    realWinterMute Member

    Newcomer
    49
    47
    Feb 24, 2011
    Actually, could you do me a favour and PR these to https://github.com/devkitPro/3ds_portlibs.

    I still have a couple more things to do to get things reasonably clean with the portlibs setup - for instance that arm-none-eabi-pkg-config script should be in the portlibs bin directory & not copied around other source repos.

    For now it's probably best to grab your SDL 1.2 source tree & build that first.

    I'd also like to try and sort out some proper dependencies with the packages as well as have a look at which libraries are actually suited to the 3DS rather than just piling a load of partially ported and untested things in there. That'll also save you from having to deal with other dependencies.

    Ideally your SDL port can get upstreamed though :) Is there any chance you can sort out a diff against https://github.com/SDL-mirror/SDL/tree/SDL-1.2 ?

    I can have a look at sorting the configury for those soon.


    That'll be nice :)

    Thanks for moving to the autotools setup btw, it's much appreciated.
     
    Last edited by realWinterMute, Aug 14, 2017
  19. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    I opened a PR where I added libmikmod (tested it thoug SDL_mixer and works fine) and changed tremor lib to the low mwmory branch. Hope this is ok for you, I'm having a lot of problem with the standard branch.

    With this two changes, the portlibs makefile has all the dependecies I'm using at the moment o build the SDL libs (I'm working on adding some more).

    Now I'm going to add the SDL libs but don't know if it's better to instal them in the portlibs/3ds folder with the main SDL lib or use the armv6k folder, like for the other porlibs

    I can make a diff of the two package, but in the last versiones I maintained the code as clean as possible and I know exactly the files I changed, so I could fork the SDL reppository and send a PR with the changes. probably I'll do it next week. Now I'm with a very bad internet connection.
     
    Joel16 likes this.
  20. nop90
    OP

    nop90 GBAtemp Maniac

    Member
    1,437
    2,138
    Jan 11, 2014
    Italy
    Rome
    @kane159

    Here is a preview of what you asked, but there is a lot of work to do yet.

    onscripter-en.png