Remove the exit button when running on the HBL

This commit is contained in:
Maschell 2022-07-26 14:27:31 +02:00
parent 21cb6adaa6
commit 90b6a36add
5 changed files with 30 additions and 5 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include "common/common.h"
#include "input/Input.h"
#include "utils/ScreenUtils.h"
#include "utils/WiiUScreen.h"
@ -37,8 +38,9 @@ public:
} else if (input->data.buttons_d & Input::BUTTON_RIGHT) {
this->selectedOptionX++;
}
if (this->selectedOptionX < 0) {
this->selectedOptionX = maxOptionValue;
this->selectedOptionX = maxOptionValue - 1;
} else if (this->selectedOptionX >= maxOptionValue) {
this->selectedOptionX = 0;
}
@ -55,6 +57,10 @@ public:
}
virtual void printFooter() {
if (gRunFromHBL) {
ScreenUtils::printTextOnScreen(CONSOLE_SCREEN_TV, 0, 25, "Press HOME to exit to HBL");
ScreenUtils::printTextOnScreen(CONSOLE_SCREEN_DRC, 0, 15, "Press HOME to exit to HBL");
}
ScreenUtils::printTextOnScreen(CONSOLE_SCREEN_TV, 0, 27, "Created by Maschell, inspired by wudump from FIX94");
ScreenUtils::printTextOnScreen(CONSOLE_SCREEN_DRC, 0, 17, "Created by Maschell, inspired by wudump from FIX94");
}

View File

@ -52,7 +52,9 @@ void MainApplicationState::render() {
WiiUScreen::drawLinef(" [%s] SD ??? NTFS (USB) (not connected)", dumpTarget == TARGET_SD ? "*" : " ");
}
WiiUScreen::drawLine();
WiiUScreen::drawLinef("%s Exit", this->selectedOptionY == 4 ? ">" : " ");
if (!gRunFromHBL) {
WiiUScreen::drawLinef("%s Exit", this->selectedOptionY == 4 ? ">" : " ");
}
}
printFooter();
@ -61,7 +63,8 @@ void MainApplicationState::render() {
ApplicationState::eSubState MainApplicationState::update(Input *input) {
if (this->state == STATE_WELCOME_SCREEN) {
proccessMenuNavigationY(input, 5);
int optionCount = gRunFromHBL ? 4 : 5;
proccessMenuNavigationY(input, optionCount);
if (selectedOptionY == 3) {
if (ntfs_mount_count > 0) {
proccessMenuNavigationX(input, 2);
@ -85,7 +88,9 @@ ApplicationState::eSubState MainApplicationState::update(Input *input) {
} else if (this->selectedOptionY == 3) {
//
} else {
SYSLaunchMenu();
if (gRunFromHBL) {
SYSLaunchMenu();
}
}
this->selectedOptionY = 0;
}

View File

@ -4,3 +4,4 @@ int32_t gFSAfd = -1;
ntfs_md *ntfs_mounts = nullptr;
int ntfs_mount_count = 0;
BOOL gRunFromHBL = false;

View File

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include <ntfs.h>
#include <wut.h>
extern int32_t gFSAfd;
@ -11,6 +11,8 @@ extern int32_t gFSAfd;
extern ntfs_md *ntfs_mounts;
extern int ntfs_mount_count;
extern BOOL gRunFromHBL;
enum eDumpTarget {
TARGET_SD,
TARGET_NTFS

View File

@ -6,6 +6,7 @@
#include <coreinit/debug.h>
#include <coreinit/energysaver.h>
#include <coreinit/title.h>
#include <input/CombinedInput.h>
#include <input/WPADInput.h>
#include <iosuhax.h>
@ -34,6 +35,16 @@ int main(int argc, char **argv) {
initIOSUHax();
uint64_t titleID = OSGetTitleID();
if (titleID == 0x0005000013374842 ||
titleID == 0x000500101004A000 ||
titleID == 0x000500101004A100 ||
titleID == 0x000500101004A200) {
gRunFromHBL = true;
} else {
gRunFromHBL = false;
}
uint32_t isAPDEnabled;
IMIsAPDEnabled(&isAPDEnabled);