From f3a10fb4c3050182e2efd22528455474835db46b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 Feb 2013 22:20:42 -0800 Subject: [PATCH 1/2] Correct arguments to font alloc function. --- Core/HLE/sceFont.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 0d5a793b30..182baf386f 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -270,8 +270,8 @@ public: if (false) { // This fails in dissidia. The function at 088ff320 (params_.allocFuncAddr) calls some malloc function, the second one returns 0 which causes // bad stores later. So we just ignore this with if (false) and fake it. - u32 args[1] = { allocSize }; - __KernelDirectMipsCall(params_.allocFuncAddr, action, args, 1, false); + u32 args[2] = { params_.userDataAddr, allocSize }; + __KernelDirectMipsCall(params_.allocFuncAddr, action, args, 2, false); } else { AllocDone(fakeAlloc_); fakeAlloc_ += allocSize; @@ -296,8 +296,8 @@ public: fontMap.erase(fonts_[i]); } } - u32 args[1] = { (u32)handle_ }; - __KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 1, false); + u32 args[2] = { params_.userDataAddr, (u32)handle_ }; + __KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false); handle_ = 0; fonts_.clear(); isfontopen_.clear(); From ab66aa4c45bf64b91e8017e888d3dbf8c08dd61b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 9 Mar 2013 00:54:16 -0800 Subject: [PATCH 2/2] Fix a shutdown crash with close fonts. --- Core/HLE/sceFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 182baf386f..095f2633a2 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -190,7 +190,7 @@ public: : fontLibID_(fontLibID), font_(font), handle_(handle) {} Font *GetFont() { return font_; } - FontLib *GetFontLib() { return fontLibList[fontLibID_]; } + FontLib *GetFontLib() { if (!IsOpen()) return NULL; return fontLibList[fontLibID_]; } u32 Handle() const { return handle_; } bool IsOpen() const { return fontLibID_ != (u32)-1; }