From: gameblabla Date: Sun, 21 Jul 2019 15:31:48 +0000 (+0200) Subject: psxbios: Return value is always 1 for CloseTh and ChangeTh. X-Git-Tag: r23~156^2~3 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=9ee77db131fbb7708c0fdf2dda91dd92c277c20b psxbios: Return value is always 1 for CloseTh and ChangeTh. According to nocash PSX doc, ChangeThread and CloseThread should always return 1. Fix it accordingly. --- diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 3247402d..7c908e39 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -1878,12 +1878,10 @@ void psxBios_CloseTh() { // 0f #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x0f], th); #endif - - if (Thread[th].status == 0) { - v0 = 0; - } else { + /* The return value is always 1 (even if the handle was already closed). */ + v0 = 1; + if (Thread[th].status != 0) { Thread[th].status = 0; - v0 = 1; } pc0 = ra; @@ -1899,14 +1897,11 @@ void psxBios_ChangeTh() { // 10 #ifdef PSXBIOS_LOG // PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x10], th); #endif - + /* The return value is always 1. */ + v0 = 1; if (Thread[th].status == 0 || CurThread == th) { - v0 = 0; - pc0 = ra; } else { - v0 = 1; - if (Thread[CurThread].status == 2) { Thread[CurThread].status = 1; Thread[CurThread].func = ra;