From c2c9179406a5dd05f56c8d543e4d8be9af600cd3 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 31 Jul 2013 08:15:07 -0700 Subject: [PATCH] Fix TLS allocation (been there a while...) This worked for the most common case, but was a typo. --- Core/HLE/sceKernelMemory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 90d75c88a2..c79c219c61 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1490,7 +1490,7 @@ int sceKernelAllocateTls(SceUID uid) // The PSP doesn't give the same block out twice in a row, even if freed. if (tls->usage[tls->next] == 0) allocBlock = tls->next; - tls->next = (tls->next + 1) % tls->ntls.blockSize; + tls->next = (tls->next + 1) % tls->ntls.totalBlocks; } if (allocBlock != -1)