mirror of
https://github.com/wiiu-env/AutobootModule.git
synced 2024-11-25 12:06:58 +01:00
Check which version of the HBC is installed
This commit is contained in:
parent
a836a3fdd1
commit
4cbc618674
4
Makefile
4
Makefile
@ -36,7 +36,7 @@ CXXFLAGS := $(CFLAGS) -std=c++20 -fno-rtti
|
||||
ASFLAGS := -g $(ARCH)
|
||||
LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
LIBS := -lfreetype -lpng -lbz2 -lwut -lz
|
||||
LIBS := -lfreetype -lpng -lbz2 -liosuhax -lwut -lz
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CXXFLAGS += -DDEBUG -g
|
||||
@ -47,7 +47,7 @@ endif
|
||||
# list of directories containing libraries, this must be the top level
|
||||
# containing include and lib
|
||||
#-------------------------------------------------------------------------------
|
||||
LIBDIRS := $(PORTLIBS) $(WUT_ROOT)
|
||||
LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUT_ROOT)/usr
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# no real need to edit anything past this point unless you need to add additional
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <vpad/input.h>
|
||||
#include <gx2/state.h>
|
||||
|
||||
#include <iosuhax.h>
|
||||
|
||||
void handleAccountSelection();
|
||||
|
||||
@ -118,5 +119,41 @@ void bootvWiiMenu() {
|
||||
}
|
||||
|
||||
void bootHomebrewChannel() {
|
||||
launchvWiiTitle(0x00010001, 0x4f484243); // 'OHBC'
|
||||
// fall back to booting the vWii system menu if anything fails
|
||||
uint64_t titleId = 0;
|
||||
|
||||
if (IOSUHAX_Open(nullptr) >= 0) {
|
||||
int fsaFd = IOSUHAX_FSA_Open();
|
||||
if (fsaFd >= 0) {
|
||||
// mount the slccmpt
|
||||
if (IOSUHAX_FSA_Mount(fsaFd, "/dev/slccmpt01", "/vol/storage_slccmpt01", 2, nullptr, 0) >= 0) {
|
||||
fileStat_s stat;
|
||||
|
||||
// test if the OHBC or HBC is installed
|
||||
if (IOSUHAX_FSA_GetStat(fsaFd, "/vol/storage_slccmpt01/title/00010001/4f484243/content/00000000.app", &stat) >= 0) {
|
||||
titleId = 0x000100014f484243; // 'OHBC'
|
||||
}
|
||||
else if (IOSUHAX_FSA_GetStat(fsaFd, "/vol/storage_slccmpt01/title/00010001/4c554c5a/content/00000000.app", &stat) >= 0) {
|
||||
titleId = 0x000100014c554c5a; // 'LULZ'
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("Cannot find HBC, booting vWii System Menu");
|
||||
}
|
||||
|
||||
IOSUHAX_FSA_Unmount(fsaFd, "/vol/storage_slccmpt01", 2);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("Failed to mount SLCCMPT");
|
||||
}
|
||||
|
||||
IOSUHAX_FSA_Close(fsaFd);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("Failed to open FSA");
|
||||
}
|
||||
|
||||
IOSUHAX_Close();
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("Failed to open IOSUHAX");
|
||||
}
|
||||
|
||||
DEBUG_FUNCTION_LINE("Launching vWii title %016llx", titleId);
|
||||
launchvWiiTitle((uint32_t) (titleId >> 32), (uint32_t) (titleId & 0xffffffff));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user