From 3ce21ce672b2e2a28a99bc12c29c63cae6ea16df Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 13 Dec 2014 18:35:58 -0800 Subject: [PATCH] Allocate a correct amount for helper threads. This was usually "saved" by the round up to 0x100, but was underallocating. --- Core/HLE/HLEHelperThread.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/HLE/HLEHelperThread.cpp b/Core/HLE/HLEHelperThread.cpp index e9ce72f2f5..193a1514c7 100644 --- a/Core/HLE/HLEHelperThread.cpp +++ b/Core/HLE/HLEHelperThread.cpp @@ -27,14 +27,14 @@ HLEHelperThread::HLEHelperThread() : id_(-1), entry_(0) { } HLEHelperThread::HLEHelperThread(const char *threadName, u32 instructions[], u32 instrCount, u32 prio, int stacksize) { - u32 bytes = instrCount * sizeof(u32); - u32 size = bytes + sizeof(u32) * 2; - AllocEntry(bytes); - Memory::Memcpy(entry_, instructions, bytes); + u32 instrBytes = instrCount * sizeof(u32); + u32 totalBytes = instrBytes + sizeof(u32) * 2; + AllocEntry(totalBytes); + Memory::Memcpy(entry_, instructions, instrBytes); // Just to simplify things, we add the return here. - Memory::Write_U32(MIPS_MAKE_JR_RA(), entry_ + bytes + 0); - Memory::Write_U32(MIPS_MAKE_NOP(), entry_ + bytes + 4); + Memory::Write_U32(MIPS_MAKE_JR_RA(), entry_ + instrBytes + 0); + Memory::Write_U32(MIPS_MAKE_NOP(), entry_ + instrBytes + 4); Create(threadName, prio, stacksize); }