Add svcOutputDebugString

This commit is contained in:
Somebody Whoisbored 2022-06-18 18:25:15 -07:00
parent 7c7b06542b
commit 2b7ca6d914
3 changed files with 38 additions and 1 deletions

View file

@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
TARGET ?= $(notdir $(CURDIR))$(SMOVER) TARGET ?= $(notdir $(CURDIR))$(SMOVER)
BUILD ?= build$(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 DATA := data
INCLUDES := include include/sead INCLUDES := include include/sead

20
include/nx/svc.h Normal file
View file

@ -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);
}

17
source/nx/svc.s Normal file
View file

@ -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