mirror of
https://github.com/wiiu-env/AutobootModule.git
synced 2024-11-22 10:59:15 +01:00
Use libmocha instead of libiosuhax
This commit is contained in:
parent
d3a542d549
commit
c0f6e1744a
@ -1,5 +1,5 @@
|
|||||||
FROM wiiuenv/devkitppc:20220806
|
FROM wiiuenv/devkitppc:20220806
|
||||||
|
|
||||||
COPY --from=wiiuenv/libiosuhax:20220523 /artifacts $DEVKITPRO
|
COPY --from=wiiuenv/libmocha:20220728 /artifacts $DEVKITPRO
|
||||||
|
|
||||||
WORKDIR project
|
WORKDIR project
|
2
Makefile
2
Makefile
@ -36,7 +36,7 @@ CXXFLAGS := $(CFLAGS) -std=c++20 -fno-rtti
|
|||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map)
|
LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
LIBS := -lfreetype -lpng -lbz2 -liosuhax -lwut -lz
|
LIBS := -lfreetype -lpng -lbz2 -lmocha -lwut -lz
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CXXFLAGS += -DDEBUG -g
|
CXXFLAGS += -DDEBUG -g
|
||||||
|
@ -4,14 +4,11 @@
|
|||||||
#include "MenuUtils.h"
|
#include "MenuUtils.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <coreinit/debug.h>
|
#include <coreinit/filesystem_fsa.h>
|
||||||
#include <coreinit/screen.h>
|
|
||||||
#include <gx2/state.h>
|
|
||||||
#include <iosuhax.h>
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <map>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <mocha/mocha.h>
|
||||||
#include <nn/act.h>
|
#include <nn/act.h>
|
||||||
#include <nn/cmpt/cmpt.h>
|
#include <nn/cmpt/cmpt.h>
|
||||||
#include <padscore/kpad.h>
|
#include <padscore/kpad.h>
|
||||||
@ -19,7 +16,6 @@
|
|||||||
#include <sysapp/launch.h>
|
#include <sysapp/launch.h>
|
||||||
#include <sysapp/title.h>
|
#include <sysapp/title.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <vpad/input.h>
|
|
||||||
|
|
||||||
void handleAccountSelection();
|
void handleAccountSelection();
|
||||||
|
|
||||||
@ -118,41 +114,43 @@ void bootvWiiMenu() {
|
|||||||
launchvWiiTitle(0);
|
launchvWiiTitle(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootHomebrewChannel() {
|
uint64_t getVWiiHBLTitleId() {
|
||||||
// fall back to booting the vWii system menu if anything fails
|
// fall back to booting the vWii system menu if anything fails
|
||||||
uint64_t titleId = 0;
|
uint64_t titleId = 0;
|
||||||
|
|
||||||
if (IOSUHAX_Open(nullptr) >= 0) {
|
FSAInit();
|
||||||
int fsaFd = IOSUHAX_FSA_Open();
|
auto client = FSAAddClient(nullptr);
|
||||||
if (fsaFd >= 0) {
|
if (client > 0) {
|
||||||
|
if (Mocha_UnlockFSClientEx(client) == MOCHA_RESULT_SUCCESS) {
|
||||||
// mount the slccmpt
|
// mount the slccmpt
|
||||||
if (IOSUHAX_FSA_Mount(fsaFd, "/dev/slccmpt01", "/vol/storage_slccmpt01", 2, nullptr, 0) >= 0) {
|
if (FSAMount(client, "/dev/slccmpt01", "/vol/storage_slccmpt01", FSA_MOUNT_FLAG_GLOBAL_MOUNT, nullptr, 0) >= 0) {
|
||||||
FSStat stat;
|
FSStat stat;
|
||||||
|
|
||||||
// test if the OHBC or HBC is installed
|
// test if the OHBC or HBC is installed
|
||||||
if (IOSUHAX_FSA_GetStat(fsaFd, "/vol/storage_slccmpt01/title/00010001/4f484243/content/00000000.app", &stat) >= 0) {
|
if (FSAGetStat(client, "/vol/storage_slccmpt01/title/00010001/4f484243/content/00000000.app", &stat) >= 0) {
|
||||||
titleId = 0x000100014F484243L; // 'OHBC'
|
titleId = 0x000100014F484243L; // 'OHBC'
|
||||||
} else if (IOSUHAX_FSA_GetStat(fsaFd, "/vol/storage_slccmpt01/title/00010001/4c554c5a/content/00000000.app", &stat) >= 0) {
|
} else if (FSAGetStat(client, "/vol/storage_slccmpt01/title/00010001/4c554c5a/content/00000000.app", &stat) >= 0) {
|
||||||
titleId = 0x000100014C554C5AL; // 'LULZ'
|
titleId = 0x000100014C554C5AL; // 'LULZ'
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("Cannot find HBC, booting vWii System Menu");
|
DEBUG_FUNCTION_LINE("Cannot find HBC");
|
||||||
}
|
}
|
||||||
|
FSAUnmount(client, "/vol/storage_slccmpt01", static_cast<FSAUnmountFlags>(2));
|
||||||
IOSUHAX_FSA_Unmount(fsaFd, "/vol/storage_slccmpt01", 2);
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("Failed to mount SLCCMPT");
|
DEBUG_FUNCTION_LINE_ERR("Failed to mount slccmpt01");
|
||||||
}
|
}
|
||||||
|
|
||||||
IOSUHAX_FSA_Close(fsaFd);
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("Failed to open FSA");
|
DEBUG_FUNCTION_LINE_ERR("Failed to unlock FSClient");
|
||||||
}
|
}
|
||||||
|
FSADelClient(client);
|
||||||
IOSUHAX_Close();
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("Failed to open IOSUHAX");
|
DEBUG_FUNCTION_LINE_ERR("Failed to add FSAClient");
|
||||||
}
|
}
|
||||||
|
DEBUG_FUNCTION_LINE_ERR("%016llX", titleId);
|
||||||
|
return titleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bootHomebrewChannel() {
|
||||||
|
uint64_t titleId = getVWiiHBLTitleId();
|
||||||
DEBUG_FUNCTION_LINE("Launching vWii title %016llx", titleId);
|
DEBUG_FUNCTION_LINE("Launching vWii title %016llx", titleId);
|
||||||
launchvWiiTitle(titleId);
|
launchvWiiTitle(titleId);
|
||||||
}
|
}
|
||||||
|
@ -9,3 +9,5 @@ void bootHomebrewLauncher();
|
|||||||
void bootvWiiMenu();
|
void bootvWiiMenu();
|
||||||
|
|
||||||
void bootHomebrewChannel();
|
void bootHomebrewChannel();
|
||||||
|
|
||||||
|
uint64_t getVWiiHBLTitleId();
|
@ -5,6 +5,7 @@
|
|||||||
#include <coreinit/debug.h>
|
#include <coreinit/debug.h>
|
||||||
#include <gx2/state.h>
|
#include <gx2/state.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <mocha/mocha.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <vpad/input.h>
|
#include <vpad/input.h>
|
||||||
@ -38,6 +39,11 @@ int32_t main(int32_t argc, char **argv) {
|
|||||||
deinitLogging();
|
deinitLogging();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Mocha_InitLibrary() != MOCHA_RESULT_SUCCESS) {
|
||||||
|
OSFatal("AutobootModule: Mocha_InitLibrary failed");
|
||||||
|
}
|
||||||
|
|
||||||
bool showHBL = false;
|
bool showHBL = false;
|
||||||
std::string configPath = "fs:/vol/external01/wiiu/autoboot.cfg";
|
std::string configPath = "fs:/vol/external01/wiiu/autoboot.cfg";
|
||||||
if (argc >= 1) {
|
if (argc >= 1) {
|
||||||
@ -86,5 +92,6 @@ int32_t main(int32_t argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinitLogging();
|
deinitLogging();
|
||||||
|
Mocha_DeinitLibrary();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user