Homebrew RELEASE Development Thread - RetroArch libnx

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

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
I actually saw no reason to use the switch branch after going through the commits

Yeah, I know already. I thought you were meaning *a by a certain flag or something like that.
Correction: But I am a flamer in real life, too.

Otherwise, I would side with you on recompiling the core with the Switch branch. If you do get it to run, please allow me to test it.
 

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
Results of the last 6h:
2018061302134800-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302135700-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302122000-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302124100-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302092100-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302114800-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302075600-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302081100-DB1426D1DFD034027CECDE9C2DD914B8.jpg 2018061302073200-DB1426D1DFD034027CECDE9C2DD914B8.jpg

Maybe 15-30fps (at some parts, its really unreliable), audio is choppy (wrong samplerate), needed to rewrite file i/o @CatmanFan that would've been waaay out of your league in retrospect, so don't feel bad! :D

Anyway not sure if the core is worth it. Its buggy af, pure luck if I enter a game. Once I am in it works but open menu crashes.

Not feeling like releasing it like that, so time for bed :>
 

Attachments

  • 2018061301543900-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    2018061301543900-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    195.4 KB · Views: 197
  • 2018061302030200-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    2018061302030200-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    162.6 KB · Views: 213
Last edited by m4xw,

Phenj

Well-Known Member
Member
Joined
May 22, 2018
Messages
493
Trophies
0
XP
1,895
Country
Italy
Results of the last 6h:
View attachment 131289 View attachment 131290 View attachment 131291 View attachment 131292 View attachment 131293 View attachment 131294 View attachment 131295 View attachment 131296 View attachment 131297

Maybe 15-30fps (at some parts, its really unreliable), audio is choppy (wrong samplerate), needed to rewrite file i/o @CatmanFan that would've been waaay out of your league in retrospect, so don't feel bad! :D

Anyway not sure if the core is worth it. Its buggy af, pure luck if I enter a game. Once I am in it works but open menu crashes.

Not feeling like releasing it like that, so time for bed :>
Holy shit dude, you did the impossible. I thought this would have been hard af cause limitations
 

Sm0k3r83

Well-Known Member
Member
Joined
May 16, 2018
Messages
192
Trophies
0
Age
41
XP
1,726
Country
Canada
Results of the last 6h:
View attachment 131289 View attachment 131290 View attachment 131291 View attachment 131292 View attachment 131293 View attachment 131294 View attachment 131295 View attachment 131296 View attachment 131297

Maybe 15-30fps (at some parts, its really unreliable), audio is choppy (wrong samplerate), needed to rewrite file i/o @CatmanFan that would've been waaay out of your league in retrospect, so don't feel bad! :D

Anyway not sure if the core is worth it. Its buggy af, pure luck if I enter a game. Once I am in it works but open menu crashes.

Not feeling like releasing it like that, so time for bed :>
You almost made me explode in my pants when I saw metal gear
 
  • Like
Reactions: Hondyn and m4xw

Billy Acuña

Well-Known Member
Member
Joined
Oct 10, 2015
Messages
3,126
Trophies
1
Age
31
XP
3,701
Country
Mexico
Results of the last 6h:
View attachment 131289 View attachment 131290 View attachment 131291 View attachment 131292 View attachment 131293 View attachment 131294 View attachment 131295 View attachment 131296 View attachment 131297

Maybe 15-30fps (at some parts, its really unreliable), audio is choppy (wrong samplerate), needed to rewrite file i/o @CatmanFan that would've been waaay out of your league in retrospect, so don't feel bad! :D

Anyway not sure if the core is worth it. Its buggy af, pure luck if I enter a game. Once I am in it works but open menu crashes.

Not feeling like releasing it like that, so time for bed :>
I highly think we shouldn't mess with Beetle PSX, Beetle is OK for PC but is a waste of time on consoles since it does not have dynarec code at all, PCSX Rearmed on the other hand suits better for ARM based devices and it alreally has dynarec, but I don't think it can be easily ported to the Switch due to its early homebrew state tho.

Edit. Ninja'd by @SeongGino [emoji14]
 
Last edited by Billy Acuña,
  • Like
Reactions: m4xw

m4xw

Ancient Deity
OP
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
Assuming this was Beetle-PSX, then it makes sense. Switch atm is just not ready for something so cycle-accurate.
PCSX-ReARMed would have been a much better fit than Beetle.
Yea I got that suggestion too, but hey at least I found another bug in the fullscreen feature branch
Honestly, I don't feel like optimizing the core. Doesn't look future proof to me

This is more of a proof-of-concept to me
 
Last edited by m4xw,

SeongGino

The Average One
Member
Joined
May 20, 2015
Messages
939
Trophies
0
Age
25
Location
Jersey, Jersey
Website
www.twitter.com
XP
1,932
Country
United States
Yea I got that suggestion too, but hey at least I found another bug in the fullscreen feature branch
Honestly, I don't feel like optimizing the core. Doesn't look future proof to me

Yeah, I would have told you the same as well. All the trouble just for cycle accuracy on a portable wouldn't be worth the effort.
Whelp, it was a learning experience for everyone involved, at least!
 
  • Like
Reactions: m4xw

hitodesu

Well-Known Member
Member
Joined
Mar 10, 2017
Messages
136
Trophies
0
Age
25
XP
259
Country
United States
Yea I got that suggestion too, but hey at least I found another bug in the fullscreen feature branch
Honestly, I don't feel like optimizing the core. Doesn't look future proof to me

This is more of a proof-of-concept to me
If beetle isn't a good choice for a PS1 emulator, then what do you believe is the better option? Having a working PS1 emulator would make me soo happy
 

CatmanFan

Anxious and regretful
Member
Joined
Aug 14, 2016
Messages
1,962
Trophies
0
Website
www.youtube.com
XP
2,595
Country
Morocco
Results of the last 6h:
View attachment 131289 View attachment 131290 View attachment 131291 View attachment 131292 View attachment 131293 View attachment 131294 View attachment 131295 View attachment 131296 View attachment 131297

Maybe 15-30fps (at some parts, its really unreliable), audio is choppy (wrong samplerate), needed to rewrite file i/o @CatmanFan that would've been waaay out of your league in retrospect, so don't feel bad! :D

Anyway not sure if the core is worth it. Its buggy af, pure luck if I enter a game. Once I am in it works but open menu crashes.

Not feeling like releasing it like that, so time for bed :>
It's OK. I likely can't do complicated stuff like this.
Don't give @CatmanFan wrong ideas :D
I already knew from the start that it was possible to port Beetle-PSX to the Switch using LibNX since it already used to have a LibTransistor port.
I highly think we shouldn't mess with Beetle PSX, Beetle is OK for PC but is a waste of time on consoles since it does not have dynarec code at all, PCSX Rearmed on the other hand suits better for ARM based devices and it alreally has dynarec, but I don't think it can be easily ported to the Switch due to its early homebrew state tho.

Edit. Ninja'd by @SeongGino [emoji14]
Well, your explanation is more detailed, so there's that.
 

lifajucejo

Member
Newcomer
Joined
Jun 7, 2018
Messages
15
Trophies
0
XP
288
Country
Canada
@m4xw it appears certain cores expect a core config file to be written to pass in certain parameters. Are you familiar with it and do you know know if it's currently supported?
 

CatmanFan

Anxious and regretful
Member
Joined
Aug 14, 2016
Messages
1,962
Trophies
0
Website
www.youtube.com
XP
2,595
Country
Morocco
We can probably take a shot at compiling PCSX-ReArmed, but not now, it's like almost 5 AM in my time. Wait until the afternoon or later...
But, once again, the frustration continues. :sleep:
This is what I get when I run make:
Please run ./configure before running make!
make: *** [Makefile:30: config.mak] Error 1
Then I try to comment out line 30 in the Makefile so it doesn't exit...
Code:
ifndef NO_CONFIG_MAK
ifneq ($(wildcard config.mak),)
config.mak: ./configure
    @echo $@ is out-of-date, running configure
    @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
include config.mak
else
config.mak:
    @echo "Please run ./configure before running make!"
#    @exit 1
endif
else # NO_CONFIG_MAK
config.mak:
endif
And here's the following result:
Please run ./configure before running make!
cc -Wall -Iinclude -ffast-math -O2 -DNDEBUG -DNO_FRONTEND -c -o libpcsxcore/cdriso.o libpcsxcore/cdriso.c
make: cc: Command not found
make: *** [<builtin>: libpcsxcore/cdriso.o] Error 127
So clearly, m4xw was right, I guess. I'm not that great at compiling cores which take this hard to port for me, which is why I would much better depend on the work of other people.
4DO seemed like it was easy to port, though...
 

Leonidas87

Well-Known Member
Member
Joined
Jul 15, 2014
Messages
651
Trophies
0
Location
Toronto, Ontario
Website
www.youtube.com
XP
960
Country
Canada
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
 

rock88

Well-Known Member
Newcomer
Joined
May 19, 2018
Messages
81
Trophies
0
Age
35
XP
900
Country
Russia
We can probably take a shot at compiling PCSX-ReArmed
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.
 
  • Like
Reactions: Fadi5555

Fadi5555

Well-Known Member
Member
Joined
Jan 3, 2018
Messages
499
Trophies
0
Age
35
XP
2,400
Country
United States
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 /svcControlProcessMemory currently not present in libnx, so needs find other way to prepare memory for pcsx.
Honestly from my understanding pcsx is much better and lighter than beetle.
Because pcsx is running much faster even on low cpu devices. So I’m sure it’ll be a great idea to implement pcsx on switch via libnx because libnx is already support JIT functionality which is extremely important for any kind of emu.
 
Last edited by 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.
    K3Nv2 @ K3Nv2: Keep current Gen consoles stock mod last gen imo