Skip to content

Commit

Permalink
Merge pull request #17710 from hrydgard/retro-doframe-on-vblank
Browse files Browse the repository at this point in the history
RetroAchievements: Call rc_client_do_frame from hleEnterVblank
  • Loading branch information
hrydgard committed Jul 13, 2023
2 parents 909f0d4 + 5aeccca commit 54f6453
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Common/UI/IconCache.cpp
Expand Up @@ -91,7 +91,11 @@ bool IconCache::LoadFromFile(FILE *file) {

std::string data;
data.resize(entryHeader.dataLen);
fread(&data[0], 1, entryHeader.dataLen, file);
size_t len = fread(&data[0], 1, entryHeader.dataLen, file);
if (len != (size_t)entryHeader.dataLen) {
// Stop reading and don't use this entry. Seems the file is truncated, but we'll recover.
break;
}

Entry entry{};
entry.data = data;
Expand Down
3 changes: 3 additions & 0 deletions Core/HLE/sceDisplay.cpp
Expand Up @@ -506,6 +506,9 @@ static void DoFrameIdleTiming() {
void hleEnterVblank(u64 userdata, int cyclesLate) {
int vbCount = userdata;

// This should be a good place to do it. Should happen once per vblank. Here or in leave? Not sure it matters much.
Achievements::FrameUpdate();

VERBOSE_LOG(SCEDISPLAY, "Enter VBlank %i", vbCount);

DisplayFireVblankStart();
Expand Down
2 changes: 0 additions & 2 deletions UI/EmuScreen.cpp
Expand Up @@ -1146,8 +1146,6 @@ void EmuScreen::update() {
}
}
}

Achievements::FrameUpdate();
}

void EmuScreen::checkPowerDown() {
Expand Down

0 comments on commit 54f6453

Please sign in to comment.