From 1b9af5773108baa8d1c11ac8a9ed647a6d5c7153 Mon Sep 17 00:00:00 2001 From: tomvita <68505331+tomvita@users.noreply.github.com> Date: Wed, 16 Sep 2020 01:47:41 +0800 Subject: [PATCH] makie kip --- server/source/noexs/Makefile | 75 +++++---- server/source/noexs/noexs.json | 279 ++++++++++++++++----------------- 2 files changed, 181 insertions(+), 173 deletions(-) diff --git a/server/source/noexs/Makefile b/server/source/noexs/Makefile index 04a21e6..3ce27b9 100644 --- a/server/source/noexs/Makefile +++ b/server/source/noexs/Makefile @@ -16,14 +16,27 @@ include $(DEVKITPRO)/libnx/switch_rules # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files # EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". -#--------------------------------------------------------------------------------- -TARGET := noexs +# +# NO_ICON: if set to anything, do not use icon. +# NO_NACP: if set to anything, no .nacp file is generated. +# APP_TITLE is the name of the app stored in the .nacp file (Optional) +# APP_AUTHOR is the author of the app stored in the .nacp file (Optional) +# APP_VERSION is the version of the app stored in the .nacp file (Optional) +# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional) +# ICON is the filename of the icon (.jpg), relative to the project folder. +# If not set, it attempts to use one of the following (in this order): +# - .jpg +# - icon.jpg +# - /default_icon.jpg +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := source DATA := data INCLUDES := include EXEFS_SRC := exefs_src -ROMFS := romfs + +DEFINES := -DDISABLE_IPC #--------------------------------------------------------------------------------- # options for code generation @@ -35,7 +48,7 @@ CFLAGS := -g -Wall -O2 -ffunction-sections \ CFLAGS += $(INCLUDE) -D__SWITCH__ -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 ASFLAGS := -g $(ARCH) LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) @@ -83,10 +96,8 @@ else endif #--------------------------------------------------------------------------------- -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) -export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) -export OFILES := $(OFILES_BIN) $(OFILES_SRC) -export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES))) +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ @@ -96,32 +107,48 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) -ifeq ($(strip $(CONFIG_JSON)),) - jsons := $(wildcard *.json) - ifneq (,$(findstring $(TARGET).json,$(jsons))) - export APP_JSON := $(TOPDIR)/$(TARGET).json +ifeq ($(strip $(ICON)),) + icons := $(wildcard *.jpg) + ifneq (,$(findstring $(TARGET).jpg,$(icons))) + export APP_ICON := $(TOPDIR)/$(TARGET).jpg else - ifneq (,$(findstring config.json,$(jsons))) - export APP_JSON := $(TOPDIR)/config.json + ifneq (,$(findstring icon.jpg,$(icons))) + export APP_ICON := $(TOPDIR)/icon.jpg endif endif else - export APP_JSON := $(TOPDIR)/$(CONFIG_JSON) + export APP_ICON := $(TOPDIR)/$(ICON) +endif + +ifeq ($(strip $(NO_ICON)),) + export NROFLAGS += --icon=$(APP_ICON) +endif + +ifeq ($(strip $(NO_NACP)),) + export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp +endif + +ifneq ($(APP_TITLEID),) + export NACPFLAGS += --titleid=$(APP_TITLEID) endif .PHONY: $(BUILD) clean all #--------------------------------------------------------------------------------- +#building of kip1 should not have any issues, so just added the "built" text to keep it cool. all: $(BUILD) $(BUILD): @[ -d $@ ] || mkdir -p $@ @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - + @../../tools/elf2kip/elf2kip $(TARGET).elf $(TARGET).json $(TARGET).kip1 + @echo built ... $(TARGET).kip1 + #--------------------------------------------------------------------------------- clean: @echo clean ... - @rm -fr $(BUILD) $(TARGET).nsp $(TARGET).npdm $(TARGET).nso $(TARGET).elf + @rm -fr $(BUILD) $(TARGET).elf $(TARGET).kip1 + #--------------------------------------------------------------------------------- else @@ -132,20 +159,10 @@ DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- -all : $(OUTPUT).nsp - -ifeq ($(strip $(APP_JSON)),) -$(OUTPUT).nsp : $(OUTPUT).nso -else -$(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm -endif - -$(OUTPUT).nso : $(OUTPUT).elf +all : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES) -$(OFILES_SRC) : $(HFILES_BIN) - #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data #--------------------------------------------------------------------------------- @@ -158,4 +175,4 @@ $(OFILES_SRC) : $(HFILES_BIN) #--------------------------------------------------------------------------------------- endif -#--------------------------------------------------------------------------------------- \ No newline at end of file +#--------------------------------------------------------------------------------------- diff --git a/server/source/noexs/noexs.json b/server/source/noexs/noexs.json index bc1a39b..06dfed1 100644 --- a/server/source/noexs/noexs.json +++ b/server/source/noexs/noexs.json @@ -1,147 +1,138 @@ { - "name": "TCPGecko", - "title_id": "0x054e4f4558454000", - "title_id_range_min": "0x0100000000000038", - "title_id_range_max": "0x0100000000000038", - "main_thread_stack_size": "0x00004000", - "main_thread_priority": 49, - "default_cpu_id": 3, - "process_category": 0, - "is_retail": true, - "pool_partition": 2, - "is_64_bit": true, - "address_space_type": 3, - "filesystem_access": { - "permissions": "0xFFFFFFFFFFFFFFFF" + "name" : "TCPGecko", + "title_id" : "0x054e4f4558454000", + "main_thread_stack_size" : "0x4000", + "main_thread_priority" : 40, + "default_cpu_id" : 3, + "process_category" : 1, + "pool_partition" : 2, + "address_space_type" : 3, + "process_category": 1, + "filesystem_access" : { + "permissions" : "0x8000000000000000" }, - "service_access": [ - "*" - ], - "service_host": [], - "kernel_capabilities": { - "kernel_flags": { - "highest_thread_priority": 63, - "lowest_thread_priority": 24, - "lowest_cpu_id": 3, - "highest_cpu_id": 3 - }, - "syscalls": { - "svcUnknown00": "0x00", - "svcSetHeapSize": "0x01", - "svcSetMemoryPermission": "0x02", - "svcSetMemoryAttribute": "0x03", - "svcMapMemory": "0x04", - "svcUnmapMemory": "0x05", - "svcQueryMemory": "0x06", - "svcExitProcess": "0x07", - "svcCreateThread": "0x08", - "svcStartThread": "0x09", - "svcExitThread": "0x0A", - "svcSleepThread": "0x0B", - "svcGetThreadPriority": "0x0C", - "svcSetThreadPriority": "0x0D", - "svcGetThreadCoreMask": "0x0E", - "svcSetThreadCoreMask": "0x0F", - "svcGetCurrentProcessorNumber": "0x10", - "svcSignalEvent": "0x11", - "svcClearEvent": "0x12", - "svcMapSharedMemory": "0x13", - "svcUnmapSharedMemory": "0x14", - "svcCreateTransferMemory": "0x15", - "svcCloseHandle": "0x16", - "svcResetSignal": "0x17", - "svcWaitSynchronization": "0x18", - "svcCancelSynchronization": "0x19", - "svcArbitrateLock": "0x1A", - "svcArbitrateUnlock": "0x1B", - "svcWaitProcessWideKeyAtomic": "0x1C", - "svcSignalProcessWideKey": "0x1D", - "svcGetSystemTick": "0x1E", - "svcConnectToNamedPort": "0x1F", - "svcSendSyncRequestLight": "0x20", - "svcSendSyncRequest": "0x21", - "svcSendSyncRequestWithUserBuffer": "0x22", - "svcSendAsyncRequestWithUserBuffer": "0x23", - "svcGetProcessId": "0x24", - "svcGetThreadId": "0x25", - "svcBreak": "0x26", - "svcOutputDebugString": "0x27", - "svcReturnFromException": "0x28", - "svcGetInfo": "0x29", - "svcFlushEntireDataCache": "0x2A", - "svcFlushDataCache": "0x2B", - "svcMapPhysicalMemory": "0x2C", - "svcUnmapPhysicalMemory": "0x2D", - "svcGetFutureThreadInfo": "0x2E", - "svcGetLastThreadInfo": "0x2F", - "svcGetResourceLimitLimitValue": "0x30", - "svcGetResourceLimitCurrentValue": "0x31", - "svcSetThreadActivity": "0x32", - "svcGetThreadContext3": "0x33", - "svcWaitForAddress": "0x34", - "svcSignalToAddress": "0x35", - "svcUnknown36": "0x36", - "svcUnknown37": "0x37", - "svcUnknown38": "0x38", - "svcUnknown39": "0x39", - "svcUnknown3a": "0x3A", - "svcUnknown3b": "0x3B", - "svcDumpInfo": "0x3C", - "svcDumpInfoNew": "0x3D", - "svcUnknown3e": "0x3E", - "svcUnknown3f": "0x3F", - "svcCreateSession": "0x40", - "svcAcceptSession": "0x41", - "svcReplyAndReceiveLight": "0x42", - "svcReplyAndReceive": "0x43", - "svcReplyAndReceiveWithUserBuffer": "0x44", - "svcCreateEvent": "0x45", - "svcUnknown46": "0x46", - "svcUnknown47": "0x47", - "svcMapPhysicalMemoryUnsafe": "0x48", - "svcUnmapPhysicalMemoryUnsafe": "0x49", - "svcSetUnsafeLimit": "0x4A", - "svcCreateCodeMemory": "0x4B", - "svcControlCodeMemory": "0x4C", - "svcSleepSystem": "0x4D", - "svcReadWriteRegister": "0x4E", - "svcSetProcessActivity": "0x4F", - "svcCreateSharedMemory": "0x50", - "svcMapTransferMemory": "0x51", - "svcUnmapTransferMemory": "0x52", - "svcDebugActiveProcess": "0x60", - "svcBreakDebugProcess": "0x61", - "svcTerminateDebugProcess": "0x62", - "svcGetDebugEvent": "0x63", - "svcContinueDebugEvent": "0x64", - "svcGetProcessList": "0x65", - "svcGetThreadList": "0x66", - "svcGetDebugThreadContext": "0x67", - "svcSetDebugThreadContext": "0x68", - "svcQueryDebugProcessMemory": "0x69", - "svcReadDebugProcessMemory": "0x6A", - "svcWriteDebugProcessMemory": "0x6B", - "svcSetHardwareBreakPoint": "0x6C", - "svcGetDebugThreadParam": "0x6D", - "svcConnectToPort": "0x72", - "svcSetProcessMemoryPermission": "0x73", - "svcMapProcessMemory": "0x74", - "svcUnmapProcessMemory": "0x75", - "svcQueryProcessMemory": "0x76", - "svcMapProcessCodeMemory": "0x77", - "svcUnmapProcessCodeMemory": "0x78", - "svcCreateProcess": "0x79", - "svcStartProcess": "0x7A", - "svcTerminateProcess": "0x7B", - "svcGetProcessInfo": "0x7C", - "svcCreateResourceLimit": "0x7D", - "svcSetResourceLimitLimitValue": "0x7E", - "svcCallSecureMonitor": "0x7F" - }, - "min_kernel_version": "0x0060", - "debug_flags": { - "allow_debug": false, - "force_debug": true - } - } + "service_access" : { + "*": true + }, + "kernel_capabilities": { + "handle_table_size": 128, + "syscalls": { + "svcSetHeapSize": 1, + "svcSetMemoryPermission": 2, + "svcSetMemoryAttribute": 3, + "svcMapMemory": 4, + "svcUnmapMemory": 5, + "svcQueryMemory": 6, + "svcExitProcess": 7, + "svcCreateThread": 8, + "svcStartThread": 9, + "svcExitThread": 10, + "svcSleepThread": 11, + "svcGetThreadPriority": 12, + "svcSetThreadPriority": 13, + "svcGetThreadCoreMask": 14, + "svcSetThreadCoreMask": 15, + "svcGetCurrentProcessorNumber": 16, + "svcSignalEvent": 17, + "svcClearEvent": 18, + "svcMapSharedMemory": 19, + "svcUnmapSharedMemory": 20, + "svcCreateTransferMemory": 21, + "svcCloseHandle": 22, + "svcResetSignal": 23, + "svcWaitSynchronization": 24, + "svcCancelSynchronization": 25, + "svcArbitrateLock": 26, + "svcArbitrateUnlock": 27, + "svcWaitProcessWideKeyAtomic": 28, + "svcSignalProcessWideKey": 29, + "svcGetSystemTick": 30, + "svcConnectToNamedPort": 31, + "svcSendSyncRequestLight": 32, + "svcSendSyncRequest": 33, + "svcSendSyncRequestWithUserBuffer": 34, + "svcSendAsyncRequestWithUserBuffer": 35, + "svcGetProcessId": 36, + "svcGetThreadId": 37, + "svcBreak": 38, + "svcOutputDebugString": 39, + "svcReturnFromException": 40, + "svcGetInfo": 41, + "svcFlushEntireDataCache": 42, + "svcFlushDataCache": 43, + "svcMapPhysicalMemory": 44, + "svcUnmapPhysicalMemory": 45, + "svcGetFutureThreadInfo": 46, + "svcGetLastThreadInfo": 47, + "svcGetResourceLimitLimitValue": 48, + "svcGetResourceLimitCurrentValue": 49, + "svcSetThreadActivity": 50, + "svcGetThreadContext3": 51, + "svcWaitForAddress": 52, + "svcSignalToAddress": 53, + "svcDumpInfo": 60, + "svcDumpInfoNew": 61, + "svcCreateSession": 64, + "svcAcceptSession": 65, + "svcReplyAndReceiveLight": 66, + "svcReplyAndReceive": 67, + "svcReplyAndReceiveWithUserBuffer": 68, + "svcCreateEvent": 69, + "svcMapPhysicalMemoryUnsafe": 72, + "svcUnmapPhysicalMemoryUnsafe": 73, + "svcSetUnsafeLimit": 74, + "svcCreateCodeMemory": 75, + "svcControlCodeMemory": 76, + "svcSleepSystem": 77, + "svcReadWriteRegister": 78, + "svcSetProcessActivity": 79, + "svcCreateSharedMemory": 80, + "svcMapTransferMemory": 81, + "svcUnmapTransferMemory": 82, + "vcCreateInterruptEvent": 83, + "svcQueryPhysicalAddress": 84, + "svcQueryIoMapping": 85, + "svcCreateDeviceAddressSpace": 86, + "svcAttachDeviceAddressSpace": 87, + "svcDetachDeviceAddressSpace": 88, + "svcMapDeviceAddressSpaceByForce": 89, + "svcMapDeviceAddressSpaceAligned": 90, + "svcMapDeviceAddressSpace": 91, + "svcUnmapDeviceAddressSpace": 92, + "svcInvalidateProcessDataCache": 93, + "svcStoreProcessDataCache": 94, + "svcFlushProcessDataCache": 95, + "svcDebugActiveProcess": 96, + "svcBreakDebugProcess": 97, + "svcTerminateDebugProcess": 98, + "svcGetDebugEvent": 99, + "svcContinueDebugEvent": 100, + "svcGetProcessList": 101, + "svcGetThreadList": 102, + "svcGetDebugThreadContext": 103, + "svcSetDebugThreadContext": 104, + "svcQueryDebugProcessMemory": 105, + "svcReadDebugProcessMemory": 106, + "svcWriteDebugProcessMemory": 107, + "svcSetHardwareBreakPoint": 108, + "svcGetDebugThreadParam": 109, + "svcGetSystemInfo": 111, + "svcCreatePort": 112, + "svcManageNamedPort": 113, + "svcConnectToPort": 114, + "svcSetProcessMemoryPermission": 115, + "svcMapProcessMemory": 116, + "svcUnmapProcessMemory": 117, + "svcQueryProcessMemory": 118, + "svcMapProcessCodeMemory": 119, + "svcUnmapProcessCodeMemory": 120, + "svcCreateProcess": 121, + "svcStartProcess": 122, + "svcTerminateProcess": 123, + "svcGetProcessInfo": 124, + "svcCreateResourceLimit": 125, + "svcSetResourceLimitLimitValue": 126, + "svcCallSecureMonitor": 127 + } + } } \ No newline at end of file