mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Moved libultra files to /lib/ directory
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800CE170 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
void *memcpy(void *dst, const void *src, size_t size) {
|
||||
u8 *_dst = dst;
|
||||
const u8 *_src = src;
|
||||
while (size > 0) {
|
||||
*_dst++ = *_src++;
|
||||
size--;
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
size_t strlen(const char *str) {
|
||||
const u8 *ptr = (const u8 *) str;
|
||||
while (*ptr) {
|
||||
ptr++;
|
||||
}
|
||||
return (const char *) ptr - str;
|
||||
}
|
||||
|
||||
char *strchr(const char *str, s32 ch) {
|
||||
u8 c = ch;
|
||||
while (*(u8 *)str != c) {
|
||||
if (*(u8 *)str == 0) {
|
||||
return NULL;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
return (char *) str;
|
||||
}
|
||||
Reference in New Issue
Block a user