Homebrew RELEASE Development Thread - RetroArch libnx

  • Thread starter Thread starter m4xw
  • Start date Start date
  • Views Views 764,480
  • Replies Replies 4,272
  • Likes Likes 69
Status
Not open for further replies.
I actually like the slowmo action!

Quick video demonstration of PSX or the Playstation 1 emulator.

Not 100% and a pain in the ass to even get running.

MORE INFO TOMORROW IT IS 2AM

all the best and have fun.




Thanks a lot for all the hard work and time @m4xw much appreciated.


Please dont rush still in development stage.

Leonidas
 
With PCSX Rearmed I play and end great games like Resident Evil 2, Final Fantasy IX, Parasite Eve or Chrono Cross in my GCW Zero, and Switch is more powerful than Zero, right?

I wish and pray for a PCSX R in our Switchs :), I think is a great emulator.
Sorry for my bad english again :P
 
Last edited by TimeDevouncer,
  • Like
Reactions: Fadi5555
I have tried to compile this core, firstly needs to fix Makefile.libretro file (just add under Wii section):
Code:
# Nintendo Switch (libnx)
else ifeq ($(platform), switch)
    include $(DEVKITPRO)/libnx/switch_rules
    EXT=a
    TARGET := libretro_switch.a#$(TARGET_NAME)_libretro_$(platform).$(EXT)
    DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DHAVE_THREADS=1
    CFLAGS    :=     $(DEFINES) -g \
                -O2 \
                -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs \
                -I$(PORTLIBS)/include -Wimplicit-function-declaration -Ifrontend/3ds -DNO_OS -DNO_DYLIB -DNO_SOCKET -DARM11 -D_3DS
    CFLAGS += $(INCDIRS)
    CFLAGS    +=    $(INCLUDE)  -D__SWITCH__
    CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
    CFLAGS += -std=gnu11
    STATIC_LINKING = 1
    export DEPSDIR    :=    $(CURDIR)

    USE_DYNAREC = 0
    DRC_CACHE_BASE = 0
    HAVE_NEON = 0

Next needs update $PATH var:
Code:
$ export PATH=$DEVKITPRO/devkitA64/bin:$PATH

Now u can build pcsx core by run:
Code:
$ make -f Makefile.libretro platform=switch


But after linking RetroArch i'm got this errors:
Code:
linking retroarch_switch.elf

libretro_switch.a(libretro.o): In function `pl_3ds_mmap':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/libretro.c:248: undefined reference to `svcControlMemory'

libretro_switch.a(libretro.o): In function `pl_3ds_munmap':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/libretro.c:278: undefined reference to `svcControlMemory'

libretro_switch.a(libretro.o): In function `retro_init':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/libretro.c:1681: undefined reference to `linearMemAlign'

libretro_switch.a(libretro.o): In function `retro_deinit':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/libretro.c:1751: undefined reference to `linearFree'

libretro_switch.a(cdriso.o): In function `pthread_join':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/3ds/pthread.h:41: undefined reference to `linearFree'

libretro_switch.a(cdriso.o): In function `pthread_create':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/3ds/pthread.h:24: undefined reference to `linearMemAlign'

libretro_switch.a(psxmem.o): In function `munmap':

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/3ds/sys/mman.h:88: undefined reference to `svcDuplicateHandle'

/Users/rock88/Documents/MySwitchProject/pcsx_rearmed/frontend/3ds/sys/mman.h:89: undefined reference to `svcControlProcessMemory'

collect2: error: ld returned 1 exit status

I used some 3DS stuff, so maybe it's my mistake. linearMemAlign/linearFree easy implement by yourself or google it, but svcDuplicateHandle/svcControlProcessMemory currently not present in libnx, so needs find other way to prepare memory for pcsx.

Use the threading branch, linear align gets memalign, linear free gets free.

For the other stuff, well you include the bundled 3ds header, does libnx not have mman. H?

I would need to look at the code, on mobile currently

Edit: You REALLY don't want the 3ds stuff
 
Last edited by m4xw,
  • Like
Reactions: Fadi5555
Updated Threaded + Fullscreen (optional!) Test Builds:
https://git.m4xw.net/Switch/RetroArch/VBA-Next/-/jobs/585/artifacts/download
https://git.m4xw.net/Switch/RetroArch/libretro-snes9x2010/-/jobs/583/artifacts/download

Use w/o config (as supplied), Integer scaling is off by default (it works but seems to freeze on certain aspect ratios. leave it off for SNES if you want it like it was, for vba enable it to have it as it was [but I like the default more, @SeongGino]).

If you want fullscreen set aspect to Custom, make sure there is no integer scaling

Integer scaling + certain aspect rations will freeze
I capped everything 1270x780 as supersampling isn't there yet.


Def. need feedback on that. @SeongGino @Leonidas87

Edit: Don't forget vsync swap = 4 smoothes things out a bit. I'll use that as default (if it is still needed) at some point!
Unfortunately I tried snes9x2010 and VBA-Next both of them are crashing after selecting roms (error code: 2162-0002)
My switch version is 3.0.0

I really want to play them on fullscreen but no luck.
by the way thanks for your efforts. We really appreciate a lot.
 
Last edited by Fadi5555,
  • Like
Reactions: pinbi7
Unfortunately I tried snes9x2010 and VBA-Next both of them are crashing after selecting roms (error code: 2162-0002)
My switch version is 3.0.0

I really want to play them on fullscreen but no luck.
by the way thanks for your efforts. We really appreciate a lot.
Error code or just freeze?
 
Error code or just freeze?
Error code: 2162-0002

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

Unfortunately I tried snes9x2010 and VBA-Next both of them are crashing after selecting roms (error code: 2162-0002)
My switch version is 3.0.0

I really want to play them on fullscreen but no luck.
by the way thanks for your efforts. We really appreciate a lot.
I edited my reply.
 
I'll be grabbing the pcsx r and working on it during a 7 hour plane ride. Like m4xw, my beetle psx results were either too gross to play or didn't boot at all.

It actually plays suprisingly good, IF it launches like at all.

Not sure if the core just is buggy, or maybe its a good stress test for my code.

I just feel like different cores need slightly different code for some parts.

Btw you should probably try to re-do the makefile. I looked at it (and it sucks ass).

A clean libnx makefile would be nice.

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

Error code: 2162-0002

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


I edited my reply.

Can you try with video_threaded off and vsync off in Settings->Video ?

It will suck, just wanna know if it will crash
 
It actually plays suprisingly good, IF it launches like at all.

Not sure if the core just is buggy, or maybe its a good stress test for my code.

I just feel like different cores need slightly different code for some parts.

Btw you should probably try to re-do the makefile. I looked at it (and it sucks ass).

A clean libnx makefile would be nice.
Any idea please about that error code?
Playing in fullscreen makes me more than happy.
 
Any idea please about that error code?
Playing in fullscreen makes me more than happy.

2162-0002 Can be triggered by running svcBreak. The svcBreak params have no affect on the value of the thrown error-code.

Nintendo internals trigger that.

I get that crash too, but maybe only after 30 starts and like a dozen freezes (while developing)

But then it crashes just in hbmenu or even normal games for me.

Edit: Guess you're out of luck. Next 8h at work ;)
 
Last edited by m4xw,
Use the threading branch, linear align gets memalign, linear free gets free.
Ok, I'll check it at evening.

For the other stuff, well you include the bundled 3ds header, does libnx not have mman. H?
Yep, sys/mman.h not present in libnx/devkit.

You REALLY don't want the 3ds stuff
I'll try to remove any 3ds stuff, see what will happen =)

Also I'll upload sources to github.
 
Unfortunately I tried snes9x2010 and VBA-Next both of them are crashing after selecting roms (error code: 2162-0002)
My switch version is 3.0.0

I really want to play them on fullscreen but no luck.
by the way thanks for your efforts. We really appreciate a lot.

I had the same thing happen on loading the rom, i also tried the new config with no luck
On 3.0
 
  • Like
Reactions: Fadi5555
Quick video demonstration of PSX or the Playstation 1 emulator.

Not 100% and a pain in the ass to even get running.

MORE INFO TOMORROW IT IS 2AM

all the best and have fun.




Thanks a lot for all the hard work and time @m4xw much appreciated.


Please dont rush still in development stage.

Leonidas

Not bad at all
 
That is really cool, would love to have it running, a few old wrestling games i liked on psx

--------------------- MERGED ---------------------------
 
Sounds like @Fadi5555 needs to learn to code, cause that is a non issue for most haha
Don't speak for all :creep:
I would also love to have custom resolutions for RetroArch, as I always play on fullscreen (or custom res) most of the time, I never use the core default res for gaming on RA.

Though, with that said, I do understand that such a thing is not a priority, and other stuff should be handled first, like threading and stability, before attempting more aesthetic things like those. Once we get a stable enough build that m4xw feels happy with, then we can get to more fancy shit like that and XMB :P
 
  • Like
Reactions: Fadi5555
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum