From bee52312d06313957cfe73dacdb1717d1c8bcddb Mon Sep 17 00:00:00 2001 From: gameblabla Date: Thu, 18 Jul 2019 01:09:21 +0200 Subject: [PATCH] psxbios: Add checks to strcat Nocash documentation says that function fails if src or dst is 0. If so, then it must return 0. This fix is required for fixing crash on bootup in Digimon World. --- libpcsxcore/psxbios.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 292d80d6..4624bf4d 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -394,7 +394,12 @@ void psxBios_strcat() { // 0x15 #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %s, %s\n", biosA0n[0x15], Ra0, Ra1); #endif - + if (a0 == 0 || a1 == 0) + { + v0 = 0; + pc0 = ra; + return; + } while (*p1++); --p1; while ((*p1++ = *p2++) != '\0'); -- 2.39.5