psxbios: Add checks for strlen.
authorgameblabla <gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:28:55 +0000 (02:28 +0200)
committergameblabla <gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:28:55 +0000 (02:28 +0200)
Per what Nocash documentation says.

libpcsxcore/psxbios.c

index 13cfe73..cd2fb0c 100644 (file)
@@ -666,6 +666,11 @@ void psxBios_strncpy() { // 0x1a
 void psxBios_strlen() { // 0x1b
        char *p = (char *)Ra0;
        v0 = 0;
+       if (a0 == 0)
+       {
+               pc0 = ra;
+               return;
+       }
        while (*p++) v0++;
        pc0 = ra;
 }