Merge pull request #114 from m4xw/libnx

[LIBNX] Initial Port
This commit is contained in:
Twinaphex 2018-09-29 21:51:28 +02:00 committed by GitHub
commit 85c1cf5bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 2 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
*.pyc
*.a
*.o
*.d

View File

@ -255,6 +255,20 @@ else ifneq (,$(filter $(platform), ngc wii wiiu))
PLATFORM_DEFINES += -DHAVE_LOCALE
# Nintendo Switch (libnx)
else ifeq ($(platform), libnx)
export DEPSDIR := $(CURDIR)/
TARGET := $(TARGET_NAME)_libretro_$(platform).a
include $(DEVKITPRO)/libnx/switch_rules
STATIC_LINKING=1
STATIC_LINKING_LINK=1
HAVE_VFS_FD = 0
CFLAGS += -O3 -fomit-frame-pointer -ffast-math -I$(LIBNX)/include/ -fPIE -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
DEFINES += -std=c99
ASFLAGS += -DHAVE_LIBNX
PLATFORM_DEFINES += -D__SWITCH__ -DHAVE_LIBNX
PLATFORM_DEFINES += -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd -DHAVE_INTTYPES -DLSB_FIRST -DINLINE=inline
# Nintendo Switch (libtransistor)
else ifeq ($(platform), switch)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
@ -289,7 +303,6 @@ endif
DEFINES += -DHAVE_STRNDUP -DHAVE_STRDUP -DDISABLE_THREADING
include $(BUILD_DIR)/Makefile.common
OBJS := $(SOURCES_C:.c=.o) $(SOURCES_ASM:.S=.o)

View File

@ -325,6 +325,10 @@ void mCoreConfigCopyValue(struct mCoreConfig* config, const struct mCoreConfig*
}
void mCoreConfigMap(const struct mCoreConfig* config, struct mCoreOptions* opts) {
#ifdef HAVE_LIBNX // Needed or fatal
return;
#endif
_lookupCharValue(config, "bios", &opts->bios);
_lookupCharValue(config, "shader", &opts->shader);
_lookupIntValue(config, "logLevel", &opts->logLevel);

View File

@ -294,7 +294,9 @@ void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config
mCoreConfigCopyValue(&core->config, config, "cheatAutosave");
mCoreConfigCopyValue(&core->config, config, "cheatAutoload");
#ifndef HAVE_LIBNX // Needed or fatal
core->loadConfig(core, config);
#endif
}
void mCoreSetRTC(struct mCore* core, struct mRTCSource* rtc) {

View File

@ -4,7 +4,7 @@ OBJCOPY := $(PREFIX)objcopy
all: hle-bios.c
hle-bios.o: hle-bios.s
hle-bios.o: hle-bios-src.s
$(AS) -o $@ $<
hle-bios.bin: hle-bios.o