According to nocash PSX doc, ChangeThread and CloseThread should
always return 1. Fix it accordingly.
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x0f], th);
#endif
#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) {
#ifdef PSXBIOS_LOG
// PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x10], th);
#endif
#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) {
if (Thread[th].status == 0 || CurThread == th) {
if (Thread[CurThread].status == 2) {
Thread[CurThread].status = 1;
Thread[CurThread].func = ra;
if (Thread[CurThread].status == 2) {
Thread[CurThread].status = 1;
Thread[CurThread].func = ra;