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.