Skip to content

Commit

Permalink
Stack useage for scefont
Browse files Browse the repository at this point in the history
  • Loading branch information
sum2012 committed Mar 1, 2015
1 parent 30ad27f commit aa245ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/HLE/sceFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FontNewLibParams>::Create(paramPtr);
Expand Down Expand Up @@ -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<int>::Create(errorCodePtr);
if (!errorCode.IsValid()) {
ERROR_LOG_REPORT(SCEFONT, "sceFontOpenUserMemory(%08x, %08x, %08x, %08x): invalid error address", libHandle, memoryFontAddrPtr, memoryFontLength, errorCodePtr);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aa245ed

Please sign in to comment.