Homebrew RELEASE Development Thread - RetroArch libnx

  • Thread starter Thread starter m4xw
  • Start date Start date
  • Views Views 764,838
  • Replies Replies 4,272
  • Likes Likes 69
Status
Not open for further replies.
You mean FBA with the libnx port? Else its unrelated.

This thread is exclusive for this Port, as it is very specific.

Edit: Your post really makes little sense lol
I guess this was probably meant for another thread...

--------------------- MERGED ---------------------------

BTW, what is the "RetroArch_LibNX" repo meant for?
(not the "snes9x_LibNX" one)
 
I guess this was probably meant for another thread...

You know, usually I would think the same.

But in the single week since i registered, i already saw lots of weird shit/posts

RetroArch_libNX = libretro loader/ Retroarch

snes9x_libnx = libretro core
 
Last edited by m4xw,
Are you planning to port other cores, including ones that haven't been ported to the Switch at all yet? (e.g. GLupen64, mupen64plus, GLideN64, Reicast, etc.)
Also, how does it feel working on this LibNX port?
 
Are you planning to port other cores, including ones that haven't been ported to the Switch at all yet? (e.g. GLupen64, mupen64plus, GLideN64, Reicast, etc.)
Also, how does it feel working on this LibNX port?

We need gl/vulkan for those, but that might be my next construction site (if I ever find the time + a team).

Honestly, I only do it for practice. Doesn't feel any different than working on any other library, I actually don't get what all the hype is about personally (other than JIT, but libt gets that too and full compatibility)

I never even heard libretro, before I started working on the port.

But given I earn my bread and butter with C++, this went far smoother than anticipated till now.

Edit: On a side note, libnx feels pretty much at home for me!

Btw if anyone is wondering, this port is basically ~16h of work
 
Last edited by m4xw,
I've never touched libretro either, besides compiling the snes9x core for libtransistor.
I always thought libretro/retroarch was kinda scary, like it was trying to do too much without adding much functionality to the emulators themselves.
Sounds like it's not that bad after all. ^^
How are you handling the graphics side of things. To my understanding the snes9x libretro core is not based on SDL2. Are you reimplementing all the rendering stuff?
Does your port of snes9x run in Yuzu or does it also crash there?
 
I've never touched libretro either, besides compiling the snes9x core for libtransistor.
I always thought libretro/retroarch was kinda scary, like it was trying to do too much without adding much functionality to the emulators themselves.
Sounds like it's not that bad after all. ^^
How are you handling the graphics side of things. To my understanding the snes9x libretro core is not based on SDL2. Are you reimplementing all the rendering stuff?
Does your port of snes9x run in Yuzu or does it also crash there?

> like it was trying to do too much without adding much functionality to the emulators themselves.

Actually I feel split on this. Sometimes I feel the interfacing is great and sometimes it just feels fucking odd.

> How are you handling the graphics side of things. To my understanding the snes9x libretro core is not based on SDL2

The graphics driver for the switch is based on libtransistors implementation (which is basically swizzling the pixel into the output framebuffer).

I have no experience with SDL, so no Idea how they handle it. This is done in like 20-30 lines of code.

How the cores themselves handle it, well I am still figuring some stuff out, I just expect them to call the gfx_frame function and just passing the new framebuffer data to my driver.

Edit: I forgot, it runs on RyujiNX, but ROM's themselves don't run yet, for some reason.
 
Last edited by m4xw,
> like it was trying to do too much without adding much functionality to the emulators themselves.

Actually I feel split on this. Sometimes I feel the interfacing is great and sometimes it just feels fucking odd.

> How are you handling the graphics side of things. To my understanding the snes9x libretro core is not based on SDL2

The graphics driver for the switch is based on libtransistors implementation (which is basically swizzling the pixel into the output framebuffer).

I have no experience with SDL, so no Idea how they handle it. This is done in like 20-30 lines of code.

How the cores themselves handle it, well I am still figuring some stuff out, I just expect them to call the gfx_frame function and just passing the new framebuffer data to my driver.

Edit: I forgot, it runs on ryuzuki (if thats the name), but ROM's themselves don't run yet, for some reason.

Ok the graphics stuff makes a lot of sense now.
How are you planning on debugging the code? It's not like you can run GDB on the Switch and existing Emulators are not that helpful at the moment.
 
Ok the graphics stuff makes a lot of sense now.
How are you planning on debugging the code? It's not like you can run GDB on the Switch and existing Emulators are not that helpful at the moment.

Right now it feels like the old dark days of printf() debugging.

We have https://github.com/switchbrew/nxdbg but I didn't get that to run yet (would need changes anyway)

If I can't figure it (the rom launch problem) out in a reasonable time, I guess I will need to come up with my own debugging solution.
 
Last edited by m4xw,
Got it to run on my 4.1 Switch. Loading ROMs crashes Retroarch like expected.
Input doesn't work in Yuzu (I think this is a common problem with the newest libNX if I'm not mistaken), so I can't check if it loads ROMs there.
It's interesting how it doesn't crash back to either hbmenu or horizon. Just a white screen with some input instructions at the bottom. I hope you will figure this out! I'll see if I can find anything.
 
You should try the snes9x2010 core with the (CTRL+F "switch") part of the Makefile.libretro from my snes9x repo (I think you only need to edit the libretro.c in addition and change posix_memalign to memalign and include switch.h)

It doesn't crash, but gives you a blank page.

I think it might be because of my display driver (init-deinit) to be specific.

For some reason I cant write to the framebuffer like that if I dont consoleInit, this might be related.

The 9x mainline core might be broken as of now (on switch).

If you want, write me a message with your email and I give you a gitlab account (I hate github)

Btw for yuzu you could try binding a non-joycon button in display_init (switch_gfx.c) and just check/loadrom in the frame function or smth

Other stuff that might fix it: Redo the core makefile with the library template - from scratch, could be related to -fPIE/PIC too I got told, but from what I know we need that but worth a shot.
 
Last edited by m4xw,
Tested it on 4.1.0 Switch...
For some reason a low-pitched noise plays for about three seconds when loading RetroArch, I can navigate the menus just fine, but then the ROMs of course won't load, they just quit and the Switch stays on a blank screen unless I press the HOME button.
Can anyone figure out why this isn't working? Researching through the code maybe?
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum