diff --git a/MakefileNSO b/MakefileNSO index e37bcfe..969473f 100644 --- a/MakefileNSO +++ b/MakefileNSO @@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules #--------------------------------------------------------------------------------- TARGET ?= $(notdir $(CURDIR))$(SMOVER) BUILD ?= build$(SMOVER) -SOURCES := source/sead/time source/sead source/puppets source/server source/layouts source/states source/cameras source +SOURCES := source/sead/time source/sead source/puppets source/server source/layouts source/states source/cameras source/nx source DATA := data INCLUDES := include include/sead diff --git a/include/nx/svc.h b/include/nx/svc.h new file mode 100644 index 0000000..8761d3f --- /dev/null +++ b/include/nx/svc.h @@ -0,0 +1,20 @@ +/** + * @file svc.h + * @brief Wrappers for kernel syscalls. + * @copyright libnx Authors + */ +#pragma once + +extern "C" { + +/** + * @brief Outputs debug text, if used during debugging. + * @param[in] str Text to output. + * @param[in] size Size of the text in bytes. + * @return Result code. + * @note Syscall number 0x27. + */ +Result svcOutputDebugString(const char *str, u64 size); + + +} \ No newline at end of file diff --git a/source/nx/svc.s b/source/nx/svc.s new file mode 100644 index 0000000..7d9b618 --- /dev/null +++ b/source/nx/svc.s @@ -0,0 +1,17 @@ +.macro SVC_BEGIN name + .section .text.\name, "ax", %progbits + .global \name + .type \name, %function + .align 2 + .cfi_startproc +\name: +.endm + +.macro SVC_END + .cfi_endproc +.endm + +SVC_BEGIN svcOutputDebugString + svc 0x27 + ret +SVC_END \ No newline at end of file