decompile strlen

This commit is contained in:
Alejandro Javier Asenjo Nitti 2023-10-16 13:53:36 -03:00
parent 4985931714
commit e5ef31fe37

View File

@ -14,6 +14,15 @@ void* memcpy(void* s1, const void* s2, size_t n) {
return s1;
}
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/libc/string/strlen.s")
size_t strlen(const char* s) {
const char* sc = s;
while (*sc != '\0') {
sc++;
}
return (size_t)(sc - s);
}
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/libc/string/strchr.s")