From aa245edb9a45eed9e90babd07d32fff24510d33e Mon Sep 17 00:00:00 2001 From: sum2012 Date: Sun, 1 Mar 2015 13:28:39 +0800 Subject: [PATCH] Stack useage for scefont --- Core/HLE/sceFont.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index be1a77d4a8b6..99f170d78a69 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -730,6 +730,7 @@ void __FontDoState(PointerWrap &p) { static u32 sceFontNewLib(u32 paramPtr, u32 errorCodePtr) { // Lazy load internal fonts, only when font library first inited. + Memory::Memset(currentMIPS->r[MIPS_REG_SP] - 0x590, 0, 0x590); __LoadInternalFonts(); auto params = PSPPointer::Create(paramPtr); @@ -798,6 +799,7 @@ static u32 sceFontOpen(u32 libHandle, u32 index, u32 mode, u32 errorCodePtr) { // Open a user font in RAM into a FontLib static u32 sceFontOpenUserMemory(u32 libHandle, u32 memoryFontAddrPtr, u32 memoryFontLength, u32 errorCodePtr) { + Memory::Memset(currentMIPS->r[MIPS_REG_SP] - 0x440, 0, 0x440); auto errorCode = PSPPointer::Create(errorCodePtr); if (!errorCode.IsValid()) { ERROR_LOG_REPORT(SCEFONT, "sceFontOpenUserMemory(%08x, %08x, %08x, %08x): invalid error address", libHandle, memoryFontAddrPtr, memoryFontLength, errorCodePtr); @@ -1063,6 +1065,7 @@ static int sceFontGetFontInfoByIndexNumber(u32 libHandle, u32 fontInfoPtr, u32 i } static int sceFontGetCharInfo(u32 fontHandle, u32 charCode, u32 charInfoPtr) { + Memory::Memset(currentMIPS->r[MIPS_REG_SP] - 0x100, 0, 0x100); if (!Memory::IsValidAddress(charInfoPtr)) { ERROR_LOG(SCEFONT, "sceFontGetCharInfo(%08x, %i, %08x): bad charInfo pointer", fontHandle, charCode, charInfoPtr); return ERROR_FONT_INVALID_PARAMETER; @@ -1157,6 +1160,7 @@ static int sceFontGetCharGlyphImage(u32 fontHandle, u32 charCode, u32 glyphImage } static int sceFontGetCharGlyphImage_Clip(u32 fontHandle, u32 charCode, u32 glyphImagePtr, int clipXPos, int clipYPos, int clipWidth, int clipHeight) { + Memory::Memset(currentMIPS->r[MIPS_REG_SP] - 0x120, 0, 0x120); if (!Memory::IsValidAddress(glyphImagePtr)) { ERROR_LOG(SCEFONT, "sceFontGetCharGlyphImage_Clip(%08x, %i, %08x, %i, %i, %i, %i): bad glyphImage pointer", fontHandle, charCode, glyphImagePtr, clipXPos, clipYPos, clipWidth, clipHeight); return ERROR_FONT_INVALID_PARAMETER;