summaryrefslogtreecommitdiff
path: root/src/code/__osMemset.c
diff options
context:
space:
mode:
authorEllipticEllipsis <elliptic.ellipsis@gmail.com>2022-05-01 23:06:35 +0100
committerGitHub <noreply@github.com>2022-05-02 00:06:35 +0200
commite84f5ab3878b30bdddd2ee5a0dbddc10e00d219d (patch)
tree67e1ac6584b3612b2b5e4066388ef2bc811efc1f /src/code/__osMemset.c
parent7334ffa373d7aeef31977c2fe39af711d7069809 (diff)
Memstuff (#1164)
* Un-fake a couple of matches in memory manip functions * Document fmodf * Un-fake a couple of matches in memory manip functions * Document fmodf * Rename functions and files * Document memmove, memsets, memcpys * Format * Sort out some missing sizeofs * Name fmodf * Rename local variables * size_t * Use COBRA_SHADOW_TEX_SIZE * Review * Tweak the Doxyfile to remove @brief requirement * Roman's review * Fix a bug comment * Change fmodf
Diffstat (limited to 'src/code/__osMemset.c')
-rw-r--r--src/code/__osMemset.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/code/__osMemset.c b/src/code/__osMemset.c
new file mode 100644
index 000000000..703d3a8c1
--- /dev/null
+++ b/src/code/__osMemset.c
@@ -0,0 +1,21 @@
+#include "global.h"
+
+/**
+ * memset: sets `len` bytes to `val` starting at address `dest`.
+ *
+ * @see There are two other memsets in this codebase, Lib_MemSet(), MemSet()
+ *
+ * @param dest address to start at
+ * @param val value to write (s32, but interpreted as u8)
+ * @param len number of bytes to write
+ *
+ * @return dest
+ */
+void* __osMemset(void* dest, s32 val, size_t len) {
+ u8* ptr = dest;
+
+ while (len--) {
+ *ptr++ = val;
+ }
+ return dest;
+}