Skip to content

Commit

Permalink
cli: set renderer to null , wiiu: upgrade elf->rpx logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed Dec 23, 2019
1 parent 3aebed8 commit 16f7ba7
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion console/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void Menu::display()

console->drawColorString(5, 12, "Press [A] to install this package", 0xff, 0xff, 0x00);

if (cur->status != GET)
if (cur->status != GET && cur->status != LOCAL)
console->drawColorString(5, 14, "Press [X] to remove this package", 0xff, 0xff, 0x00);

console->drawString(5, 16, "Press [B] to go back");
Expand Down
1 change: 1 addition & 0 deletions console/console_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ int console_main(RootDisplay* rootDisplay, InputEvents* input)
{
// initialize text console
SDL_DestroyRenderer(rootDisplay->renderer);
rootDisplay->renderer = NULL;
Console* console = new Console(rootDisplay->window);

// create main menu object
Expand Down
2 changes: 1 addition & 1 deletion libs/chesto
Submodule chesto updated from 6b53cb to 27d321
2 changes: 1 addition & 1 deletion libs/get
Submodule get updated from c2d6f6 to ccb2a3
34 changes: 32 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#if defined(__WIIU__)
#include <romfs-wiiu.h>
#include <unistd.h>


#include <unistd.h>
#include <sys/iosupport.h>
#endif

#include "libs/get/src/Get.hpp"
Expand All @@ -15,6 +19,7 @@

#include "console/Menu.hpp"


#include "main.hpp"

static bool running = true;
Expand All @@ -30,6 +35,9 @@ int main(int argc, char* argv[])
// stdout = stderr; // for yuzu

#if defined(__WIIU__)
// WHBLogUdpInit();
// WHBLogCafeInit();

#define HBAS_PATH ROOT_PATH "wiiu/apps/appstore"
#define ELF_PATH HBAS_PATH "/hbas.elf"
#define RPX_PATH HBAS_PATH "/appstore.rpx"
Expand All @@ -39,7 +47,22 @@ int main(int argc, char* argv[])
// "migrate" old elf users over to rpx (should've been done last version)
struct stat sbuff;
if (stat(ELF_PATH, &sbuff) == 0)
std::rename(ELF_PATH, RPX_PATH);
{
// hbas.elf exists... what should we do about it?
if (stat(RPX_PATH, &sbuff) == 0)
{
// rpx is here, we can just delete hbas.elf
// if we really have to, we can have wiiu-hbas.elf later for nostalgic people for the old version
int re = std::remove(ELF_PATH);
printf("Status removing folder... %d, %d: %s\n", re, errno, strerror(errno));
}
else
{
// no rpx, let's move our elf there
int re = std::rename(ELF_PATH, RPX_PATH);
printf("Status renaming folder... %d, %d: %s\n", re, errno, strerror(errno));
}
}
#endif

init_networking();
Expand All @@ -62,7 +85,7 @@ int main(int argc, char* argv[])
while (events->update()) {
cliMode |= (events->held(L_BUTTON) || events->held(R_BUTTON));
}
SDL_Delay(32);
SDL_Delay(16);
}

if (cliMode)
Expand All @@ -72,6 +95,9 @@ int main(int argc, char* argv[])
console_main(display, events);
running = false;
}
else
// start music (only if MUSIC defined)
display->initAndStartMusic();

DownloadQueue::init();

Expand Down Expand Up @@ -132,5 +158,9 @@ int main(int argc, char* argv[])
socketExit();
#endif

#if defined(__WIIU__)
// WHBLogUdpDeinit();
#endif

return 0;
}

0 comments on commit 16f7ba7

Please sign in to comment.