1. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    SDL_logo.png

    I started working on a SDL 1.2 port for Switch, reusing the code from my 3ds port.

    The link for the initial port is: (removed for project refactoring using a fork of the official SDL repository... stay tuned)

    I also started a collection of portlibs: (repo removed since an official package is to be released soon)

    At the moment I don't have a Switch and can't test the code myself, so any help for testing the code would be very apreciated.

    Changelog

    v0.2 - (02/03/2018)
    - Added 8bpp 16bpp and 24bpp video mode
    - Added touch screen handling (mapped to mouse events)
    - Added automatic download an install of SDL_image SDL_gfx SDL_TTF and SDL_Mixer

    v0.1 - (24/02/2018)
    in the first release there is a basic video 32 bpp driver and key input events handler.

    Installation

    Install the needed portlibs (https://github.com/Nop90-Switch/Switch_portlibs)

    Run make all & make install on the provided Makefile. This will compile the SDL lib , download and install SDL_image SDL_gfx SDL_TTF and SDL_Mixer and instal everything in the portlibs directory of your devkitA64 toolchain.

    To use the libs remember to declare all the libraries dependencies in you makefile ( refer to the standard SDL 1.2 documentation or look at my ported SDL games).

    Known Bugs

    - Exiting the homebrew using the SDL libs the HBL crashes

    To Do List

    - Joystick spport
    - Audio support
    - Thread support

    Games using SDL 1.2 for switch
    Fruity- Ported by @Nop90 (GBATemp Link)
     
    Last edited by nop90, Mar 5, 2018
    ry755, VMM, charlieb and 32 others like this.
  2. zoogie

    zoogie playing around in the dsiware
    Developer

    Joined:
    Nov 30, 2014
    Messages:
    8,079
    Country:
    Micronesia, Federated States of
    Fantastic! Looking forward to progress on the GPU front.
     
    KiiWii likes this.
  3. ploggy

    ploggy WAKA! WAKA!
    Member

    Joined:
    Aug 29, 2007
    Messages:
    3,537
    Country:
    United Kingdom
    Can someone say MUGEN ;)
    Thanks man :)
     
    lordelan, Don Jon and Linkuei like this.
  4. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    Attached a minimal SDL program (source and nro/nso).

    It simply should draw a small 10x10px square in the top-right corner, than loop till tha A key is pressed.

    The prognam runs fine on yuzu and the input handlig works. But nothing renders.

    Please test the program on a real switch and tell me if the sceen remauns balck or the square is visible.

    Thanks.

    PS: if the video uoput works, please exit the program after few seconds (press A) because in this code the screen isn't refreshed and I dont want that any LCD damage occours to your Switches.
     

    Attached Files:

    • test.zip
      File size:
      1,008.3 KB
      Views:
      158
    uyjulian, ShadowOne333 and Masterwin like this.
  5. Kojote

    Kojote Member
    Newcomer

    Joined:
    Sep 27, 2015
    Messages:
    22
    Country:
    Australia
    Great news my friend :) Seems the door is open to get many nice homebrew games to the Switch sometime soon.
     
    nop90 likes this.
  6. notimp

    notimp Well-Known Member
    Member

    Joined:
    Sep 18, 2007
    Messages:
    4,086
    Country:
    Laos
    The .nro results in a black screen. No Square is rendered. If you press A the switch hard crashes with errorcode 2162-0002. Results reproduced twice. .nro launched with HBL.
     
    lordelan and nop90 like this.
  7. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    Pressing A the app exit, this means the Key handlig is working. It crashes probably because I missed deiniting something. It's hard to code without testing.

    For the missing rendering, I'll try to find the cause in the sources.

    Thanks.
     

    Attached Files:

    • test.zip
      File size:
      234.4 KB
      Views:
      84
    Last edited by nop90, Feb 25, 2018
  8. kumikochan

    kumikochan GBAtemp Psycho!
    Member

    Joined:
    Feb 4, 2015
    Messages:
    3,720
    Country:
    Belgium
    Nice would love to play The Legend of Sword and Fairy on my switch. Played it on my vita and it's an amazing game
     
  9. Anfroid

    Anfroid GBAtemp Advanced Fan
    Member

    Joined:
    Sep 30, 2011
    Messages:
    513
    Country:
    United States
    Got the same thing.
     
  10. notimp

    notimp Well-Known Member
    Member

    Joined:
    Sep 18, 2007
    Messages:
    4,086
    Country:
    Laos
    If you are a Generation Y'er, how about not highjacking all posts with your *feels* of how *nice* things are, and how *soon* things must be happening, because you just *feel* it, calling everyone you hardly interacted with a *friend* and how that one Saturn game you played on Vita was lovely - because the port had the letters SDL in it as well. (edit SDL is closely linked to cross plattform ports of games developed with that layer, to different platforms. I didn't know that. The last nag was misplaced, I'm sorry.)

    Context (you didnt provide): http://wololo.net/2017/11/29/legend-sword-fairy-ported-psvita-play-famous-chinese-rpg-english-vita/

    I was just thinking of how swell a world would be, where people didnt just say pleasentries, because they wanted to compliment-nudge you into doing what they want.

    That said, that chinese RPG does look nice... ;)
     
    Last edited by notimp, Feb 25, 2018
    PCityPaul likes this.
  11. kumikochan

    kumikochan GBAtemp Psycho!
    Member

    Joined:
    Feb 4, 2015
    Messages:
    3,720
    Country:
    Belgium
    Well i assure you that i'm one of the last people you should expect a compliment from and especially nudging them in doing what i want. I don't feel that entitled sorry. I'm not one of those whiners believe me
     
  12. fatsquirrel

    fatsquirrel GBAtemp Addict
    Member

    Joined:
    Nov 11, 2013
    Messages:
    2,573
    Country:
    Great news, keep up the good work. The rate that things are coming out at is crazy...
     
  13. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    Someone please text the attached nso. Made a small change.
     

    Attached Files:

    • test.zip
      File size:
      234.4 KB
      Views:
      97
  14. Maufeat

    Maufeat Member
    Newcomer

    Joined:
    Sep 3, 2015
    Messages:
    31
    Country:
    Germany
    Whats supposed to happen? The .nro file just shows black screen on my Switch.
     
  15. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    Discovered that I can use Ryujinx to test the SDL code, and so I was able to debug the code and find the bug (I'm not setting the video sceen as a HW Surface, so rendering function is not called).

    I'll fix the SDL code tonight.
     
    Last edited by nop90, Feb 25, 2018
    lordelan likes this.
  16. nop90

    OP nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    In Ryujinx now the rendering works fine.

    Please check the nso in the attached file, you shouls see a 30x30px white swuare with a smaller purple square inside, and pressing A the code should exit to HBL (now the program should exit without crashing).

    Sorry for all the requestes of today, if this works I'll continue testing on the emulator.

    Thanks
     

    Attached Files:

    • test.zip
      File size:
      237.4 KB
      Views:
      115
  17. Don Jon

    Don Jon GBAtemp Maniac
    Member

    Joined:
    Nov 20, 2015
    Messages:
    1,044
    Country:
    United States
    love mugen but not familiar with its porting abilities
    could you elaborate kind sir?
     
  18. ploggy

    ploggy WAKA! WAKA!
    Member

    Joined:
    Aug 29, 2007
    Messages:
    3,537
    Country:
    United Kingdom
    Iirc Mugen uses Sdl as it's base so hopefully with this sdl implementation, Mugen could make its way onto Switch ;)
     
    lordelan and Don Jon like this.
  19. Anfroid

    Anfroid GBAtemp Advanced Fan
    Member

    Joined:
    Sep 30, 2011
    Messages:
    513
    Country:
    United States
    Squares showed up properly but pressing A still crashed my switch.
     
  20. Technicmaster0

    Technicmaster0 GBAtemp Psycho!
    Member

    Joined:
    Oct 22, 2011
    Messages:
    4,199
    Country:
    Gambia, The
    Same for me. Error Code: 2162-0002
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Switch, (libnx, based)