diff --git a/libretro/Makefile b/libretro/Makefile index c86b0e3c..12d7ba88 100644 --- a/libretro/Makefile +++ b/libretro/Makefile @@ -93,6 +93,20 @@ else ifeq ($(platform), osx) OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"` fpic += -mmacosx-version-min=10.1 +# Nintendo Switch (libnx) +else ifeq ($(platform), libnx) + include $(DEVKITPRO)/libnx/switch_rules + EXT=a + TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT) + DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL + CFLAGS := $(DEFINES) -g -O3 \ + -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs + CFLAGS += $(INCDIRS) + CFLAGS += $(INCLUDE) -D__SWITCH__ -DHAVE_LIBNX -march=armv8-a -mtune=cortex-a57 -mtp=soft + CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + CFLAGS += -std=gnu11 + STATIC_LINKING = 1 + # iOS else ifneq (,$(findstring ios,$(platform))) CFLAGS += -flto diff --git a/port.h b/port.h index 26338af4..8c97ad06 100644 --- a/port.h +++ b/port.h @@ -355,7 +355,7 @@ void SetInfoDlgColor(unsigned char, unsigned char, unsigned char); #define TITLE "Snes9x" #endif -#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86) || defined(_M_X64) || defined(_XBOX1) || defined(__arm__) || defined(ANDROID) || (defined(__BYTE_ORDER__) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN__) +#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86) || defined(_M_X64) || defined(_XBOX1) || defined(__arm__) || defined(ANDROID) || defined(__aarch64__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN__) #define LSB_FIRST #define FAST_LSB_WORD_ACCESS #else