Homebrew RELEASE Development Thread - RetroArch libnx

  • Thread starter m4xw
  • Start date
  • Views 666,607
  • Replies 4,272
  • Likes 69
Status
Not open for further replies.

Zumoly

GBATemp Analyst
Member
Joined
Apr 27, 2018
Messages
1,817
Trophies
0
Location
Yorosso
XP
3,091
Country
Mali
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
 

TimeDevouncer

Well-Known Member
Member
Joined
Jun 7, 2018
Messages
142
Trophies
0
Age
39
XP
1,088
Country
Spain
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

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,957
Country
Germany
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

Fadi5555

Well-Known Member
Member
Joined
Jan 3, 2018
Messages
499
Trophies
0
Age
35
XP
2,384
Country
United States
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

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,957
Country
Germany
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?
 

Fadi5555

Well-Known Member
Member
Joined
Jan 3, 2018
Messages
499
Trophies
0
Age
35
XP
2,384
Country
United States
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.
 

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,957
Country
Germany
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
 

Fadi5555

Well-Known Member
Member
Joined
Jan 3, 2018
Messages
499
Trophies
0
Age
35
XP
2,384
Country
United States
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.
 

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,957
Country
Germany
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,

rock88

Well-Known Member
Newcomer
Joined
May 19, 2018
Messages
81
Trophies
0
Age
35
XP
900
Country
Russia
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.
 

pinbi7

Well-Known Member
Member
Joined
Apr 4, 2004
Messages
611
Trophies
2
XP
2,086
Country
Canada
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

Phenj

Well-Known Member
Member
Joined
May 22, 2018
Messages
493
Trophies
0
XP
1,895
Country
Italy
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
 

rad.i.kal

Well-Known Member
Member
Joined
Nov 17, 2008
Messages
119
Trophies
0
Location
the web
XP
1,032
Country
United States
That is really cool, would love to have it running, a few old wrestling games i liked on psx

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

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,173
Trophies
2
XP
33,396
Country
Mexico
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sonic Angel Knight @ Sonic Angel Knight: :ninja: