From 9d49a24924900d09a1677ee30e76bd432f88b46c Mon Sep 17 00:00:00 2001 From: oioitff Date: Sun, 3 Mar 2013 17:22:50 +0800 Subject: [PATCH] use vector instead of Memory read/write , becasue Memory read/write works incorrectly here... --- Core/HLE/sceFont.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 92887830d6..c863302e04 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -242,14 +242,16 @@ public: __KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 1, false); handle_ = 0; fonts_.clear(); + isfontopen_.clear(); } void AllocDone(u32 allocatedAddr) { handle_ = allocatedAddr; fonts_.resize(params_.numFonts); + isfontopen_.resize(params_.numFonts); for (size_t i = 0; i < fonts_.size(); i++) { u32 addr = allocatedAddr + 4 + i * 4; - Memory::Write_U32(FONT_IS_CLOSED, addr); + isfontopen_[i] = 0; fonts_[i] = addr; } } @@ -274,7 +276,7 @@ public: LoadedFont *OpenFont(Font *font) { int freeFontIndex = -1; for (size_t i = 0; i < fonts_.size(); i++) { - if (Memory::Read_U32(fonts_[i]) == FONT_IS_CLOSED) { + if (isfontopen_[i] == 0) { freeFontIndex = (int)i; break; } @@ -284,14 +286,14 @@ public: return 0; } LoadedFont *loadedFont = new LoadedFont(font, this, fonts_[freeFontIndex]); - Memory::Write_U32(FONT_IS_OPEN, fonts_[freeFontIndex]); + isfontopen_[freeFontIndex] = 1; return loadedFont; } void CloseFont(LoadedFont *font) { for (size_t i = 0; i < fonts_.size(); i++) { if (fonts_[i] == font->Handle()) { - Memory::Write_U32(FONT_IS_CLOSED, font->Handle()); + isfontopen_[i] = 0; } } @@ -316,6 +318,7 @@ public: private: std::vector fonts_; + std::vector isfontopen_; FontNewLibParams params_; float fontHRes_;