1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-22 21:35:27 +00:00
oot/src/code/__osMemset.c

22 lines
468 B
C
Raw Normal View History

#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;
}