Skip to content

Commit

Permalink
Update 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokes303 authored Oct 6, 2019
1 parent dd52008 commit 00efbe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
15 changes: 4 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ uint8_t downloadFile(std::string url, std::string file, uint8_t type) {
//Types: 0 = .app | 1 = .h3 | 2 = title.tmd | 3 = tilte.tik
downloading = file.c_str();

WHBLogPrintf("Download URL: %s", url.c_str());
WHBLogPrintf("Download NAME: %s", file.c_str());
//WHBLogPrintf("Download URL: %s", url.c_str());
//WHBLogPrintf("Download NAME: %s", file.c_str());

CURL* curl = NULL;
FILE* fp;
int ret = 0;
Expand All @@ -165,7 +166,6 @@ uint8_t downloadFile(std::string url, std::string file, uint8_t type) {
curl_easy_cleanup(curl);
return 1;
}
WHBLogPrintf("curl_easy_init executed successfully");

std::string tUrl = downloadUrl + url;
std::string tFile = installDir + file;
Expand Down Expand Up @@ -636,10 +636,8 @@ int main() {
ddnext:
disableShutdown();

if (!downloadTitle(titleID, titleVer, folderName)) {
WHBLogPrintf("return");
if (!downloadTitle(titleID, titleVer, folderName))
goto exit;
}

downloadUrl = "http://ccs.cdn.wup.shop.nintendo.net/ccs/download/";
installDir = "/vol/external01/install/";
Expand All @@ -658,20 +656,15 @@ int main() {
mainLoop:;
}
exit:
WHBLogPrintf("SWKBD");
SWKBD_Shutdown();
WHBLogPrintf("screen");
if (hbl)
shutdownScreen();

WHBLogPrintf("fs");
FSDelClient(fsCli, 0);
MEMFreeToDefaultHeap(fsCli);
MEMFreeToDefaultHeap(fsCmd);

WHBLogPrintf("fs shutdown");
FSShutdown();
WHBLogPrintf("proc&udp");
if (hbl)
WHBProcShutdown();
WHBLogUdpDeinit();
Expand Down
25 changes: 2 additions & 23 deletions src/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,22 @@
uint8_t app = 1;
uint8_t AppRunning() {
if (!hbl) {
if(!OSIsMainCore()) {
WHBLogPrintf("Os not main core");
if(!OSIsMainCore())
ProcUISubProcessMessages(true);
}
else {
WHBLogPrintf("haha yess");
ProcUIStatus status = ProcUIProcessMessages(true);
WHBLogPrintf("status: %d", status);

switch (status) {
case PROCUI_STATUS_EXITING: {
WHBLogPrintf("exiting");
// Being closed, deinit, free, and prepare to exit
WHBLogPrintf("procui");
ProcUIShutdown();
WHBLogPrintf("screen");
WHBLogPrintf("ok!");
app = 0;
break;
}
case PROCUI_STATUS_RELEASE_FOREGROUND: {
WHBLogPrintf("release");
// Free up MEM1 to next foreground app, deinit screen, etc.

ProcUIDrawDoneRelease();

//shutdownScreen();

WHBGfxInit();
WHBGfxBeginRender();

Expand All @@ -53,34 +41,25 @@ uint8_t AppRunning() {

WHBGfxFinishRender();

WHBLogPrintf("draw ok");
app = 2;
WHBLogPrintf("-------------------");
//OSScreenShutdown();??
break;
}
case PROCUI_STATUS_IN_FOREGROUND: {
WHBLogPrintf("foreground");
// Executed while app is in foreground
if (app == 2) {
WHBGfxShutdown();
shutdownScreen();
initScreen();
}

app = 1;
// Executed while app is in foreground
break;
}
case PROCUI_STATUS_IN_BACKGROUND: {
WHBLogPrintf("background");
app = 2;
break;
}
default: {
WHBLogPrintf("default");
}
}
WHBLogPrintf("app: %d", app);
return app;
}
}
Expand Down

0 comments on commit 00efbe6

Please sign in to comment.