Add support for exiting the application while loading title infos

This commit is contained in:
Maschell 2020-02-21 14:35:20 +01:00
parent 933a97f2f3
commit e96e51ad46
2 changed files with 12 additions and 1 deletions

View File

@ -82,7 +82,7 @@ int32_t GameList::readGameList() {
}
for (auto title_candidate : titles) {
if((title_candidate.titleId & 0xFFFFFFFF00000000L) == 0x0005000000000000L) {
if(true || (title_candidate.titleId & 0xFFFFFFFF00000000L) == 0x0005000000000000L) {
gameInfo* newGameInfo = new gameInfo;
newGameInfo->titleId = title_candidate.titleId;
newGameInfo->gamePath = title_candidate.path;
@ -101,6 +101,12 @@ int32_t GameList::readGameList() {
for (uint32_t i = 0; i < fullGameList.size(); ++i) {
gameInfo *header = fullGameList[i];
DCFlushRange(&stopAsyncLoading, sizeof(stopAsyncLoading));
if(stopAsyncLoading) {
DEBUG_FUNCTION_LINE("Stop async title loading\n");
break;
}
DEBUG_FUNCTION_LINE("Load extra infos of %016llX\n",header->titleId);
ACPMetaXml* meta = (ACPMetaXml*)calloc(1, 0x4000); //TODO fix wut
if(meta) {

View File

@ -5,6 +5,7 @@
#include <mutex>
#include <stdint.h>
#include <coreinit/mcp.h>
#include <coreinit/cache.h>
#include <gui/sigslot.h>
#include <gui/GuiImageData.h>
@ -19,6 +20,8 @@ class GameList {
public:
GameList() : selectedGame(0) { };
~GameList() {
stopAsyncLoading = true;
DCFlushRange(&stopAsyncLoading, sizeof(stopAsyncLoading));
clear();
};
@ -134,6 +137,8 @@ protected:
std::vector<gameInfo *> fullGameList;
std::recursive_mutex _lock;
bool stopAsyncLoading = false;
};
#endif