Homebrew RELEASE Development Thread - RetroArch libnx

  • Thread starter Thread starter m4xw
  • Start date Start date
  • Views Views 764,537
  • Replies Replies 4,272
  • Likes Likes 69
Status
Not open for further replies.
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.
 
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: 222
  • 2018061302030200-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    2018061302030200-DB1426D1DFD034027CECDE9C2DD914B8.jpg
    162.6 KB · Views: 236
Last edited by m4xw,
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
 
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
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
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,
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
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!

If only someone told me that 6h ago :P
 
  • Like
Reactions: SeongGino
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
 
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.
 
@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?
 
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...
 
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
 
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
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