Hacking WIP SDL 1.2.15 for Switch (libnx based)

  • Thread starter Thread starter nop90
  • Start date Start date
  • Views Views 33,269
  • Replies Replies 93
  • Likes Likes 35
Nice project, nop90! I've got only one question, why not the latest and the greatest SDL 2.0? AFAIK 1.2 is good only for compatibility purposes like programming for older operating systems plus it's not as well documented as 2.0
 
  • Like
Reactions: CuriousTommy
SDL_Quit() have never been called in your sample. Is it what makes the program crashed on exit?
Probably it's the cause.

Meanwhile I added on github the makefiles for SDL_image, SDL_gfx and SDL_ttf (not tested). Added a makefile for SDL_mixer, but since the audio driver is stubbed, it's not useful at the moment.

To compile them I added other libs the Switch portlibs repository.

About the main SDL lib, I tryed to add the Thread support, but threads are only partially implemented on libnx and devkita64, so the thread driver is halted. I'll try to add an Audio driver working directly with libnx (not the correct way, but I'll fix it when the thread support will be finished).

If someone wants to help, there are a lot of things to test.
 
  • Like
Reactions: lordelan
Nice project, nop90! I've got only one question, why not the latest and the greatest SDL 2.0?

there are several reasons:
I know better SDL1 because I ported it to 3ds, I need it to port Retroguru games to Switch because I promised it to @Kojote and , first of all, makes no sense porting SDL2 without Open GL support.

The big difference betwen SDl2 and SDl1 is a better use is GFX HW aceleration, without it the two are almost the same code.

You can convert a SD2 game to a SD1.2 ones (and vice versa) changing only few line of codes in the video init part and slightly modifying some funtions calls (like SDL_SetColorKet or SDl_Alpha).
 
there are several reasons:
I know better SDL1 because I ported it to 3ds, I need it to port Retroguru games to Switch because I promised it to @Kojote and , first of all, makes no sense porting SDL2 without Open GL support.

The big difference betwen SDl2 and SDl1 is a better use is GFX HW aceleration, without it the two are almost the same code.

You can convert a SD2 game to a SD1.2 ones (and vice versa) changing only few line of codes in the video init part and slightly modifying some funtions calls (like SDL_SetColorKet or SDl_Alpha).
Hi,

I may help soon, but my main problem is your repo not forked from mainstream, which will make updates more difficult. Also I have a SDL repo which I work on for different platforms, I may prefer start from there. I also would work on SDL2 I guess so we don't cross but can take part from each other.
That said, we could both benefit of each repo and merge in the future.
 
Last edited by cpasjuste,
Finished adding support for 24, 16 and 8 bpp other 32 bpp.

The video part is amost complete (at least without GPU support).

Next I'll add joystick and touchpad support.

Attached a simple democode compiled with the SDL lib without problems. I tested it with RyujiNX, but a test on real HW would be great. Press A to exit the demo (hope it doesn't crash on exiting)

PS: SDL_ttf and SDL_image work fine. Not tested SDL_gfx, but should be ok too.
 

Attachments

Pressing A results into error-code 2162-0002.

This will be hard to fix without a real hw.

Here is a preview of my next release:

fruity_2x.png

soon an alpha of the game (with no sound at the moment) on www.retroguru.com
 
Attached the rotating knot SDL demo.

Please test it on a eral switch and tell me if it crashes on exit (pressing A key). Thanks.
 

Attachments

I'll consider it, but now is too early. There is a lot of work to do on the lib.

Can someone test the above example?
Thanks I hope you do. Mugen is the gift that keeps on giving simply because of the customisation possibilities :creep:

Edit.. cant test..my Switch is on 2.3.0.
 
Last edited by ploggy,

Site & Scene News

Popular threads in this forum